Page 1 of 1

oXbp:showBalloonTip()

Posted: Fri Aug 09, 2013 9:49 am
by unixkd
Hi all,

anybody with the idea of how to implement oXbp:showBalloonTip() ?

Thanks

Joe

Re: oXbp:showBalloonTip()

Posted: Fri Aug 09, 2013 10:30 am
by Auge_Ohr
unixkd wrote:anybody with the idea of how to implement oXbp:showBalloonTip() ?
Code is simple and NEED Xp Manifest

Code: Select all

#include "Appevent.ch"
#include "GRA.ch"
#include "xbp.ch"

#define DLGBACKGROUND        GraMakeRGBColor({255,242,229})

PROCEDURE APPSYS
RETURN

PROCEDURE Main
LOCAL nEvent, mp1, mp2, oXbp, oXbp1, oXbp2
LOCAL oDlg, oDraw
LOCAL cVarA         // := SPACE(20) do not store for Cuebanner
LOCAL cVarB         // := SPACE(20)
LOCAL aPres := {{ XBP_PP_BGCLR , DLGBACKGROUND       },;
                { XBP_PP_ORIGIN,XBP_ORIGIN_BOTTOMLEFT} }

   oDlg := XbpDialog():new( Appdesktop(),,{100,100},{640,480},aPres,.F. )
   oDlg:minButton := .F.
   oDlg:maxButton := .F.
   oDlg:title     := "Demo CueBanner / BallonTip"
   oDlg:taskList  := .T.
   oDlg:border    := XBPDLG_DLGBORDER
   oDlg:close     := { | mp1, mp2, obj | PostAppEvent(xbeP_Close) }
   oDlg:Icon      := 16
   oDlg:create()
   oDlg:drawingArea:setColorBG(aPres[1,2])

   oDraw := oDlg:drawingArea

   oXbp1              := XbpSLE():new(oDraw , , {100,200}, {100,30})
   oXbp1:cueBanner := "hier Variabel A"
   oXbp1:tabStop      := .T.
   oXbp1:bufferLength := 20
   oXbp1:dataLink  := {|x| IIf( x==NIL, cVarA, cVarA := x ) }
   oXbp1:SetInputFocus := {| x,y,o | o:showBalloonTip(XBP_TIPINFO,'Vorname', "BalloonTip A" )}
   oXbp1:create()

   oXbp2              := XbpSLE():new(oDraw , , {100,150}, {100,30} )
   oXbp2:cueBanner := ("hier Variabel B")
   oXbp2:tabStop      := .T.
   oXbp2:bufferLength := 20
   oXbp2:dataLink := {|x| IIf( x==NIL, cVarB, cVarB := x ) }
   oXbp2:SetInputFocus := {| x,y,o | o:showBalloonTip(XBP_TIPWARNING,'Nachname', "BalloonTip B" )}
   oXbp2:create()

   oXbp := XbpPushButton():new(oDraw, , {500,10}, {100,100} )
   oXbp:caption := "Exit"
   oXbp:activate:= {|| PostAppEvent(xbeP_Close)  }
   oXbp:create()

   oDlg:show()
   setappfocus(oXbp1)

   // Event loop = Programmsteuerung
   nEvent := 0
   DO WHILE nEvent <> xbeP_Close
      nEvent := AppEvent( @mp1, @mp2, @oXbp )
      oXbp:handleEvent( nEvent, mp1, mp2 )
   ENDDO

RETURN
if you still "see" no BalloonTip look into you Registry
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced
and set "EnableBalloonTips" to 1

if you did not "see" Cuebanner you might have install " Far East language extensions" see PDR 6083