Balloon Tool Tips on Dialogs II

Started by erezpaz, December 08, 2016, 08:39:12 AM

Previous topic - Next topic

erezpaz


td

Use the WIL Dialog Editor to automagically convert the dialog template from the 6.1 to the 6.2 format.  Then change any references to control numbers in your dialog callback to control names.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

JTaylor

I generated this from a random test dialog using my WBRAD app so it has lots of extra stuff but provides a ToolTip Example that might be helpful.

Jim


Code (winbatch) Select



Home_Path = DirScript()
Data_Path = ShortCutDir("Local AppData",0,@TRUE):"MyDialog\"
MyDialog_Ini = Data_Path:"MyDialog.ini"
DirChange(Home_Path)
GoSub Load_Routines
IntControl(49,3,0,0,0)

MyDialogFormat=`WWWDLGED,6.2`

MyDialogCaption=`WIL Dialog 2`
MyDialogX=004
MyDialogY=035
MyDialogWidth=434
MyDialogHeight=340
MyDialogNumControls=037
MyDialogProcedure=`DEFAULT`
MyDialogFont=`DEFAULT`
MyDialogTextColor=`DEFAULT`
MyDialogBackground=`DEFAULT,48|48|48`
MyDialogConfig=0

MyDialog001=`169,269,036,012,PUSHBUTTON,pb_MyD_Cancel,DEFAULT,"Cancel",0,2,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog002=`119,267,036,012,PUSHBUTTON,pb_MyD_OK,DEFAULT,"OK",1,1,@csDefButton,DEFAULT,DEFAULT,DEFAULT`
MyDialog003=`005,003,036,012,PUSHBUTTON,pb_MyD_Next,DEFAULT,"&Next",3,100,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog004=`073,003,036,012,PUSHBUTTON,pb_MyD_Previous,DEFAULT,"&Previous",4,103,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog005=`141,003,036,012,PUSHBUTTON,pb_MyD_First,DEFAULT,"&First",5,106,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog006=`209,003,036,012,PUSHBUTTON,pb_MyD_Last,DEFAULT,"&Last",6,109,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog007=`277,003,036,012,PUSHBUTTON,pb_MyD_Add,DEFAULT,"&Add",7,112,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog008=`327,003,036,012,PUSHBUTTON,pb_MyD_Edit,DEFAULT,"&Edit",8,115,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog009=`385,003,036,012,PUSHBUTTON,pb_MyD_Delete,DEFAULT,"&Delete",9,118,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog010=`005,019,064,012,STATICTEXT,st_MyD_RequestorX,DEFAULT,"Requestor X",DEFAULT,121,DEFAULT,"Microsoft Sans Serif|6656|40|34","255|255|255",DEFAULT`
MyDialog011=`093,019,064,012,EDITBOX,eb_MyD_requestor_x,requestor_x,"requestor_x",DEFAULT,124,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog012=`005,035,064,012,STATICTEXT,st_MyD_RequestorOrder,DEFAULT,"Requestor Order",DEFAULT,127,DEFAULT,"Microsoft Sans Serif|6656|40|34","255|255|255",DEFAULT`
MyDialog013=`093,035,064,012,EDITBOX,eb_MyD_requestor_order,requestor_order,"requestor_order",DEFAULT,130,@csDigits,DEFAULT,DEFAULT,DEFAULT`
MyDialog014=`005,051,064,012,STATICTEXT,st_MyD_RequestorEmail,DEFAULT,"Requestor Email",DEFAULT,133,DEFAULT,"Microsoft Sans Serif|6656|40|34","255|255|255",DEFAULT`
MyDialog015=`093,051,064,012,EDITBOX,eb_MyD_requestor_email,requestor_email,"requestor_email",DEFAULT,136,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog016=`005,067,064,012,STATICTEXT,st_MyD_RequestorName,DEFAULT,"Requestor Name",DEFAULT,139,DEFAULT,"Microsoft Sans Serif|6656|40|34","255|255|255",DEFAULT`
MyDialog017=`093,067,064,012,EDITBOX,eb_MyD_requestor_name,requestor_name,"requestor_name",DEFAULT,142,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog018=`005,083,064,012,STATICTEXT,st_MyD_RequestorArea,DEFAULT,"Requestor Area",DEFAULT,145,DEFAULT,"Microsoft Sans Serif|6656|40|34","255|255|255",DEFAULT`
MyDialog019=`093,083,064,012,EDITBOX,eb_MyD_requestor_area,requestor_area,"requestor_area",DEFAULT,148,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog020=`005,099,064,012,STATICTEXT,st_MyD_RequestorBudget,DEFAULT,"Requestor Budget",DEFAULT,151,DEFAULT,"Microsoft Sans Serif|6656|40|34","255|255|255",DEFAULT`
MyDialog021=`093,099,064,012,EDITBOX,eb_MyD_requestor_budget,requestor_budget,"requestor_budget",DEFAULT,154,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog022=`005,115,064,012,STATICTEXT,st_MyD_RequestorCopies,DEFAULT,"Requestor Copies",DEFAULT,157,DEFAULT,"Microsoft Sans Serif|6656|40|34","255|255|255",DEFAULT`
MyDialog023=`093,115,064,012,EDITBOX,eb_MyD_requestor_copies,requestor_copies,"requestor_copies",DEFAULT,160,@csDigits,DEFAULT,DEFAULT,DEFAULT`
MyDialog024=`005,131,064,012,STATICTEXT,st_MyD_RequestorVendor,DEFAULT,"Requestor Vendor",DEFAULT,163,DEFAULT,"Microsoft Sans Serif|6656|40|34","255|255|255",DEFAULT`
MyDialog025=`093,131,064,012,EDITBOX,eb_MyD_requestor_vendor,requestor_vendor,"requestor_vendor",DEFAULT,166,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog026=`005,147,064,012,STATICTEXT,st_MyD_RequestorLocation,DEFAULT,"Requestor Location",DEFAULT,169,DEFAULT,"Microsoft Sans Serif|6656|40|34","255|255|255",DEFAULT`
MyDialog027=`093,147,064,012,EDITBOX,eb_MyD_requestor_location,requestor_location,"requestor_location",DEFAULT,172,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog028=`005,163,064,012,STATICTEXT,st_MyD_RequestorCollection,DEFAULT,"Requestor Collection",DEFAULT,175,DEFAULT,"Microsoft Sans Serif|6656|40|34","255|255|255",DEFAULT`
MyDialog029=`093,163,064,012,EDITBOX,eb_MyD_requestor_collection,requestor_collection,"requestor_collection",DEFAULT,178,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog030=`005,179,064,012,STATICTEXT,st_MyD_RequestorItype,DEFAULT,"Requestor Itype",DEFAULT,181,DEFAULT,"Microsoft Sans Serif|6656|40|34","255|255|255",DEFAULT`
MyDialog031=`093,179,064,012,EDITBOX,eb_MyD_requestor_itype,requestor_itype,"requestor_itype",DEFAULT,184,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog032=`005,195,064,012,STATICTEXT,st_MyD_RequestorExtra1,DEFAULT,"Requestor Extra1",DEFAULT,187,DEFAULT,"Microsoft Sans Serif|6656|40|34","255|255|255",DEFAULT`
MyDialog033=`093,195,064,012,EDITBOX,eb_MyD_requestor_extra1,requestor_extra1,"requestor_extra1",DEFAULT,190,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog034=`005,211,064,012,STATICTEXT,st_MyD_RequestorExtra2,DEFAULT,"Requestor Extra2",DEFAULT,193,DEFAULT,"Microsoft Sans Serif|6656|40|34","255|255|255",DEFAULT`
MyDialog035=`093,211,064,012,EDITBOX,eb_MyD_requestor_extra2,requestor_extra2,"requestor_extra2",DEFAULT,196,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog036=`005,227,064,012,STATICTEXT,st_MyD_RequestorExtra3,DEFAULT,"Requestor Extra3",DEFAULT,199,DEFAULT,"Microsoft Sans Serif|6656|40|34","255|255|255",DEFAULT`
MyDialog037=`093,227,064,012,EDITBOX,eb_MyD_requestor_extra3,requestor_extra3,"requestor_extra3",DEFAULT,202,DEFAULT,DEFAULT,DEFAULT,DEFAULT`


ButtonPushed=Dialog("MyDialog")


Exit

:Load_Routines



#DefineSubRoutine DEFAULT_Get_List_Rtn()

  requestor_x               = DialogControlGet(MyD_Handle,"eb_MyD_requestor_x",@dcText)
  requestor_order           = DialogControlGet(MyD_Handle,"eb_MyD_requestor_order",@dcText)
  requestor_email           = DialogControlGet(MyD_Handle,"eb_MyD_requestor_email",@dcText)
  requestor_name            = DialogControlGet(MyD_Handle,"eb_MyD_requestor_name",@dcText)
  requestor_area            = DialogControlGet(MyD_Handle,"eb_MyD_requestor_area",@dcText)
  requestor_budget          = DialogControlGet(MyD_Handle,"eb_MyD_requestor_budget",@dcText)
  requestor_copies          = DialogControlGet(MyD_Handle,"eb_MyD_requestor_copies",@dcText)
  requestor_vendor          = DialogControlGet(MyD_Handle,"eb_MyD_requestor_vendor",@dcText)
  requestor_location        = DialogControlGet(MyD_Handle,"eb_MyD_requestor_location",@dcText)
  requestor_collection      = DialogControlGet(MyD_Handle,"eb_MyD_requestor_collection",@dcText)
  requestor_itype           = DialogControlGet(MyD_Handle,"eb_MyD_requestor_itype",@dcText)
  requestor_extra1          = DialogControlGet(MyD_Handle,"eb_MyD_requestor_extra1",@dcText)
  requestor_extra2          = DialogControlGet(MyD_Handle,"eb_MyD_requestor_extra2",@dcText)
  requestor_extra3          = DialogControlGet(MyD_Handle,"eb_MyD_requestor_extra3",@dcText)
 
#EndSubRoutine
 

#DefineSubRoutine DEFAULT_Set_List_Rtn()

  DialogControlSet(MyD_Handle,"eb_MyD_requestor_x",@dcText,requestor_x)
  DialogControlSet(MyD_Handle,"eb_MyD_requestor_order",@dcText,requestor_order)
  DialogControlSet(MyD_Handle,"eb_MyD_requestor_email",@dcText,requestor_email)
  DialogControlSet(MyD_Handle,"eb_MyD_requestor_name",@dcText,requestor_name)
  DialogControlSet(MyD_Handle,"eb_MyD_requestor_area",@dcText,requestor_area)
  DialogControlSet(MyD_Handle,"eb_MyD_requestor_budget",@dcText,requestor_budget)
  DialogControlSet(MyD_Handle,"eb_MyD_requestor_copies",@dcText,requestor_copies)
  DialogControlSet(MyD_Handle,"eb_MyD_requestor_vendor",@dcText,requestor_vendor)
  DialogControlSet(MyD_Handle,"eb_MyD_requestor_location",@dcText,requestor_location)
  DialogControlSet(MyD_Handle,"eb_MyD_requestor_collection",@dcText,requestor_collection)
  DialogControlSet(MyD_Handle,"eb_MyD_requestor_itype",@dcText,requestor_itype)
  DialogControlSet(MyD_Handle,"eb_MyD_requestor_extra1",@dcText,requestor_extra1)
  DialogControlSet(MyD_Handle,"eb_MyD_requestor_extra2",@dcText,requestor_extra2)
  DialogControlSet(MyD_Handle,"eb_MyD_requestor_extra3",@dcText,requestor_extra3)
 
#EndSubRoutine
 

#DefineSubRoutine DEFAULT_Init_Var_Null()

  requestor_x               = ""
  requestor_order           = ""
  requestor_email           = ""
  requestor_name            = ""
  requestor_area            = ""
  requestor_budget          = ""
  requestor_copies          = ""
  requestor_vendor          = ""
  requestor_location        = ""
  requestor_collection      = ""
  requestor_itype           = ""
  requestor_extra1          = ""
  requestor_extra2          = ""
  requestor_extra3          = ""
 
#EndSubRoutine
 

;ToolTip control
;Guido 09/2002 - Made into UDF's Iain Dickason 1/2003 - Tweaked by Jim Taylor 4/2009
;Baloon tooltips Guido 01/03
;Multiline tooltips Guido 03/03
;Ref:
;http://msdn.microsoft.com/library/en-us/shellcc/platform/commctls/tooltip/reflist.asp


;------------------------------------------------------------------------------;
;TTCreate :  Creates a tool window                                             ;
;------------------------------------------------------------------------------;
;dlghandle :  wil dialog handle                                                ;
;balloon   :  @true baloon tooltips (Comctl32.dll v.5.8 Internet Explorer 5)   ;
;             @false normal tooltips                                           ;
;------------------------------------------------------------------------------;
;Returns   :  tool window handle                                               ;
;------------------------------------------------------------------------------;
#DefineFunction TTCreate(dlghandle,balloon)
   If balloon Then
     TTS_BALLOON=64
   Else
     TTS_BALLOON=0
   EndIf
   
   ICC_BAR_CLASSES=4
   WM_USER=1024
   WS_POPUP=2147483648
   WS_EX_TOPMOST=8
   HWND_TOPMOST=-1
   ICC_BAR_CLASSES=4
   USEDEFAULT=2147483648
   TTS_ALWAYSTIP=1
   TTS_NOPREFIX=2
   TTF_SUBCLASS=16
   TTF_IDISHWND=1
   TTM_ADDTOOL=WM_USER+4
   SWP_NOSIZE=1
   SWP_NOMOVE=2
   SWP_NOACTIVATE=16

   user32=DllLoad(StrCat(DirWindows(1),"user32.dll"))
   hinst=DllHinst("")

   ;init common controls
   COMMONCONTROLSEX=BinaryAlloc(8)
   BinaryPoke4(COMMONCONTROLSEX,0,8)
   BinaryPoke4(COMMONCONTROLSEX,4,ICC_BAR_CLASSES)
   comctl32=StrCat(DirWindows(1),"comctl32.dll")
   r=DllCall(comctl32,long:"InitCommonControlsEx",lpbinary:COMMONCONTROLSEX)
   BinaryFree(COMMONCONTROLSEX)

   ;create toolwindow
   htt=DllCall(user32,long:"CreateWindowExA",long:WS_EX_TOPMOST,lpstr:"tooltips_class32",lpstr:"",long:WS_POPUP|TTS_NOPREFIX|TTS_ALWAYSTIP|TTS_BALLOON,long:USEDEFAULT,long:USEDEFAULT,long:USEDEFAULT,long:USEDEFAULT,long:dlghandle,long:0,long:hinst,long:0)
   DllCall(user32,long:"SetWindowPos",long:htt,long:HWND_TOPMOST,long:0,long:0,long:0,long:0,long:SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE)
   dllfree(user32)
   Return htt

#EndFunction

;------------------------------------------------------------------------;
;TTAdd  : Adds a tooltip to a control                                    ;
;------------------------------------------------------------------------;
;htt       : tool window handle returned by TTCreate()                   ;
;dlghandle : the handle of the dialog (passed from the dialog callback)  ;
;dcid    : real control id obtained with roboscripter                  ;
;text      : the text to display as the tooltip                          ;
;= IconType=0 - No icon.                                                =
;= IconType=1 - Blue info on white bubble.                              =
;= IconType=2 - Exclamation mark on triangle.                           =
;= IconType=3 - White cross on red circle.                              =
;------------------------------------------------------------------------;
;Returns   : Returns TRUE if successful, or FALSE otherwise.             ;
;------------------------------------------------------------------------;
#DefineFunction TTAdd(htt,dlghandle,dcid,icontype,text)
   WM_USER=1024
   TTM_ADDTOOL=WM_USER+4
   TTF_SUBCLASS=16
   TTM_SETTITLE=WM_USER+32

   icontype=Min(Max(0,icontype),3)
 
   user32=DllLoad(StrCat(DirWindows(1),"user32.dll"))
   hinst=DllHinst("")
   
   RECT=BinaryAlloc(16)

   ;get control handle
   ctrhandle=dcid
   
   ;get button location
   DllCall(user32,long:"GetClientRect",long:ctrhandle,lpbinary:RECT)
   ;tooltip text
   textbuf=BinaryAlloc(StrLen(text)+1)
   BinaryPokeStr(textbuf,0,text)
   textad=IntControl(42,textbuf,0,0,0)
   
   ;fill structure
   TOOLINFO=BinaryAlloc(44)
   BinaryPoke4(TOOLINFO,0,44) ;cbSize
   BinaryPoke4(TOOLINFO,4,TTF_SUBCLASS) ;uFlags
   BinaryPoke4(TOOLINFO,8,ctrhandle) ;hwnd
   BinaryPoke4(TOOLINFO,12,0) ;uId
   
   BinaryPoke4(TOOLINFO,16,BinaryPeek4(RECT,0)) ;rect.left
   BinaryPoke4(TOOLINFO,20,BinaryPeek4(RECT,4)) ;rect.top
   BinaryPoke4(TOOLINFO,24,BinaryPeek4(RECT,8)) ;rect.right
   BinaryPoke4(TOOLINFO,28,BinaryPeek4(RECT,12));rect.bottom
   
   BinaryPoke4(TOOLINFO,32,hinst)  ;hinst
   BinaryPoke4(TOOLINFO,36,textad) ;lpszText
   BinaryPoke4(TOOLINFO,40,0) ;lParam
   
   ;add tooltip
   r=DllCall(user32,long:"SendMessageA",long:htt,long:TTM_ADDTOOL,long:0,lpbinary:TOOLINFO)
   If icontype Then r=DllCall(user32,long:"SendMessageA",long:htt,long:TTM_SETTITLE,long:IconType,lpbinary:TOOLINFO)
   DllFree(user32)
   BinaryFree(RECT)
   BinaryFree(TOOLINFO)
   Return r

#EndFunction

;--------------------------------------------------------------------------------;
;TTSetMaxTipWidth : Sets the maximum width for a ToolTip window.                 ;
;                   Use this function only if you want a multiline tooltip.      ;
;--------------------------------------------------------------------------------;
;htt   : tool window handle                                                      ;
;width : Maximum ToolTip window width to be set.                                 ;
;--------------------------------------------------------------------------------;
;Returns : The previous maximum ToolTip width.                                   ;
;--------------------------------------------------------------------------------;
;Remarks : The maximum ToolTip width value does not indicate a ToolTip window's  ;
;actual width. Rather, if a ToolTip string exceeds the maximum width, the control;
;breaks the text into multiple lines, using spaces to determine line breaks.     ;
;If the text cannot be segmented into multiple lines, it will be displayed on a  ;
;single line. The length of this line may exceed the maximum ToolTip width.      ;
;                                                                                ;
;Note : you can force a line break with a @crlf , use strcat()                   ;
;--------------------------------------------------------------------------------;
#DefineFunction TTSetMaxTipWidth(htt,width)
  user32=StrCat(DirWindows(1),"user32.dll")
  TTM_SETMAXTIPWIDTH=1024+24
  return dllcall(user32,long:"SendMessageA",long:htt,long:TTM_SETMAXTIPWIDTH,long:0,long:width)
#EndFunction

#DefineSubRoutine TTAdd_to_Control()

  text = "This is a tooltip for control pb_MyD_Cancel"
  TTAdd(htt,MyD_Handle,DialogControlGet(MyD_Handle,"pb_MyD_Cancel",@dchWnd),icontype,text)
 
  text = "This is a tooltip for control pb_MyD_OK"
  TTAdd(htt,MyD_Handle,DialogControlGet(MyD_Handle,"pb_MyD_OK",@dchWnd),icontype,text)
 
  text = "This is a tooltip for control pb_MyD_Next"
  TTAdd(htt,MyD_Handle,DialogControlGet(MyD_Handle,"pb_MyD_Next",@dchWnd),icontype,text)
 
  text = "This is a tooltip for control pb_MyD_Previous"
  TTAdd(htt,MyD_Handle,DialogControlGet(MyD_Handle,"pb_MyD_Previous",@dchWnd),icontype,text)
 
  text = "This is a tooltip for control pb_MyD_First"
  TTAdd(htt,MyD_Handle,DialogControlGet(MyD_Handle,"pb_MyD_First",@dchWnd),icontype,text)
 
  text = "This is a tooltip for control pb_MyD_Last"
  TTAdd(htt,MyD_Handle,DialogControlGet(MyD_Handle,"pb_MyD_Last",@dchWnd),icontype,text)
 
  text = "This is a tooltip for control pb_MyD_Add"
  TTAdd(htt,MyD_Handle,DialogControlGet(MyD_Handle,"pb_MyD_Add",@dchWnd),icontype,text)
 
  text = "This is a tooltip for control pb_MyD_Edit"
  TTAdd(htt,MyD_Handle,DialogControlGet(MyD_Handle,"pb_MyD_Edit",@dchWnd),icontype,text)
 
  text = "This is a tooltip for control pb_MyD_Delete"
  TTAdd(htt,MyD_Handle,DialogControlGet(MyD_Handle,"pb_MyD_Delete",@dchWnd),icontype,text)
 
  text = "This is a tooltip for control st_MyD_RequestorX"
  TTAdd(htt,MyD_Handle,DialogControlGet(MyD_Handle,"st_MyD_RequestorX",@dchWnd),icontype,text)
 
  text = "This is a tooltip for control eb_MyD_requestor_x"
  TTAdd(htt,MyD_Handle,DialogControlGet(MyD_Handle,"eb_MyD_requestor_x",@dchWnd),icontype,text)
 
  text = "This is a tooltip for control st_MyD_RequestorOrder"
  TTAdd(htt,MyD_Handle,DialogControlGet(MyD_Handle,"st_MyD_RequestorOrder",@dchWnd),icontype,text)
 
  text = "This is a tooltip for control eb_MyD_requestor_order"
  TTAdd(htt,MyD_Handle,DialogControlGet(MyD_Handle,"eb_MyD_requestor_order",@dchWnd),icontype,text)
 
  text = "This is a tooltip for control st_MyD_RequestorEmail"
  TTAdd(htt,MyD_Handle,DialogControlGet(MyD_Handle,"st_MyD_RequestorEmail",@dchWnd),icontype,text)
 
  text = "This is a tooltip for control eb_MyD_requestor_email"
  TTAdd(htt,MyD_Handle,DialogControlGet(MyD_Handle,"eb_MyD_requestor_email",@dchWnd),icontype,text)
 
  text = "This is a tooltip for control st_MyD_RequestorName"
  TTAdd(htt,MyD_Handle,DialogControlGet(MyD_Handle,"st_MyD_RequestorName",@dchWnd),icontype,text)
 
  text = "This is a tooltip for control eb_MyD_requestor_name"
  TTAdd(htt,MyD_Handle,DialogControlGet(MyD_Handle,"eb_MyD_requestor_name",@dchWnd),icontype,text)
 
  text = "This is a tooltip for control st_MyD_RequestorArea"
  TTAdd(htt,MyD_Handle,DialogControlGet(MyD_Handle,"st_MyD_RequestorArea",@dchWnd),icontype,text)
 
  text = "This is a tooltip for control eb_MyD_requestor_area"
  TTAdd(htt,MyD_Handle,DialogControlGet(MyD_Handle,"eb_MyD_requestor_area",@dchWnd),icontype,text)
 
  text = "This is a tooltip for control st_MyD_RequestorBudget"
  TTAdd(htt,MyD_Handle,DialogControlGet(MyD_Handle,"st_MyD_RequestorBudget",@dchWnd),icontype,text)
 
  text = "This is a tooltip for control eb_MyD_requestor_budget"
  TTAdd(htt,MyD_Handle,DialogControlGet(MyD_Handle,"eb_MyD_requestor_budget",@dchWnd),icontype,text)
 
  text = "This is a tooltip for control st_MyD_RequestorCopies"
  TTAdd(htt,MyD_Handle,DialogControlGet(MyD_Handle,"st_MyD_RequestorCopies",@dchWnd),icontype,text)
 
  text = "This is a tooltip for control eb_MyD_requestor_copies"
  TTAdd(htt,MyD_Handle,DialogControlGet(MyD_Handle,"eb_MyD_requestor_copies",@dchWnd),icontype,text)
 
  text = "This is a tooltip for control st_MyD_RequestorVendor"
  TTAdd(htt,MyD_Handle,DialogControlGet(MyD_Handle,"st_MyD_RequestorVendor",@dchWnd),icontype,text)
 
  text = "This is a tooltip for control eb_MyD_requestor_vendor"
  TTAdd(htt,MyD_Handle,DialogControlGet(MyD_Handle,"eb_MyD_requestor_vendor",@dchWnd),icontype,text)
 
  text = "This is a tooltip for control st_MyD_RequestorLocation"
  TTAdd(htt,MyD_Handle,DialogControlGet(MyD_Handle,"st_MyD_RequestorLocation",@dchWnd),icontype,text)
 
  text = "This is a tooltip for control eb_MyD_requestor_location"
  TTAdd(htt,MyD_Handle,DialogControlGet(MyD_Handle,"eb_MyD_requestor_location",@dchWnd),icontype,text)
 
  text = "This is a tooltip for control st_MyD_RequestorCollection"
  TTAdd(htt,MyD_Handle,DialogControlGet(MyD_Handle,"st_MyD_RequestorCollection",@dchWnd),icontype,text)
 
  text = "This is a tooltip for control eb_MyD_requestor_collection"
  TTAdd(htt,MyD_Handle,DialogControlGet(MyD_Handle,"eb_MyD_requestor_collection",@dchWnd),icontype,text)
 
  text = "This is a tooltip for control st_MyD_RequestorItype"
  TTAdd(htt,MyD_Handle,DialogControlGet(MyD_Handle,"st_MyD_RequestorItype",@dchWnd),icontype,text)
 
  text = "This is a tooltip for control eb_MyD_requestor_itype"
  TTAdd(htt,MyD_Handle,DialogControlGet(MyD_Handle,"eb_MyD_requestor_itype",@dchWnd),icontype,text)
 
  text = "This is a tooltip for control st_MyD_RequestorExtra1"
  TTAdd(htt,MyD_Handle,DialogControlGet(MyD_Handle,"st_MyD_RequestorExtra1",@dchWnd),icontype,text)
 
  text = "This is a tooltip for control eb_MyD_requestor_extra1"
  TTAdd(htt,MyD_Handle,DialogControlGet(MyD_Handle,"eb_MyD_requestor_extra1",@dchWnd),icontype,text)
 
  text = "This is a tooltip for control st_MyD_RequestorExtra2"
  TTAdd(htt,MyD_Handle,DialogControlGet(MyD_Handle,"st_MyD_RequestorExtra2",@dchWnd),icontype,text)
 
  text = "This is a tooltip for control eb_MyD_requestor_extra2"
  TTAdd(htt,MyD_Handle,DialogControlGet(MyD_Handle,"eb_MyD_requestor_extra2",@dchWnd),icontype,text)
 
  text = "This is a tooltip for control st_MyD_RequestorExtra3"
  TTAdd(htt,MyD_Handle,DialogControlGet(MyD_Handle,"st_MyD_RequestorExtra3",@dchWnd),icontype,text)
 
  text = "This is a tooltip for control eb_MyD_requestor_extra3"
  TTAdd(htt,MyD_Handle,DialogControlGet(MyD_Handle,"eb_MyD_requestor_extra3",@dchWnd),icontype,text)
 


#EndSubRoutine





#DefineSubRoutine DEFAULT(MyD_Handle,DMsg,DCID,DEInfo,ChangeInfo)

Switch (DMsg)
    Case @deInit
    DialogProcOptions(MyD_Handle, @deTimer,0)                             ; TimerEvent (0- Off).
    DialogProcOptions(MyD_Handle, @deClose,1)                             ; Close selected (IntControl(49....) (1-On, 0-Off).
    DialogProcOptions(MyD_Handle, @dpoDisable,0)                          ; Dialog Disable (1-Disable, 2-Wait cursor, 0-Enable).
    DialogProcOptions(MyD_Handle, @dpoBkground,-1)                        ; Change Dialog Background (Bitmap File or RGB String).
   
    ;create tool window
    balloon = 0
    htt=TTCreate(MyD_Handle,balloon)
    ;set max width (just if you want a multiline tooltip)
    maxwidth = 220
    icontype = 0
    TTSetMaxTipWidth(htt,maxwidth)
   
    TTAdd_to_Control()
   
    DialogProcOptions(MyD_Handle, @dePbPush,1)                              ; Pushbutton/PictureButton.
    DialogProcOptions(MyD_Handle, @deEdText,1)                            ; EditBox or Multi-LineBox.
   
   
    Break
  Case @deTimer
    Break
  Case @deClose
    Return 9
    Break
  Case @deEdText
    Switch(DialogProcOptions(MyD_Handle,@dpoCtlNumber,DCID))
      Case DialogProcOptions(MyD_Handle,@dpoCtlNumber,"eb_MyD_requestor_x")
        requestor_x = DialogControlGet(MyD_Handle,"eb_MyD_requestor_x",@dcText)
        Break
      Case DialogProcOptions(MyD_Handle,@dpoCtlNumber,"eb_MyD_requestor_order")
        requestor_order = DialogControlGet(MyD_Handle,"eb_MyD_requestor_order",@dcText)
        Break
      Case DialogProcOptions(MyD_Handle,@dpoCtlNumber,"eb_MyD_requestor_email")
        requestor_email = DialogControlGet(MyD_Handle,"eb_MyD_requestor_email",@dcText)
        Break
      Case DialogProcOptions(MyD_Handle,@dpoCtlNumber,"eb_MyD_requestor_name")
        requestor_name = DialogControlGet(MyD_Handle,"eb_MyD_requestor_name",@dcText)
        Break
      Case DialogProcOptions(MyD_Handle,@dpoCtlNumber,"eb_MyD_requestor_area")
        requestor_area = DialogControlGet(MyD_Handle,"eb_MyD_requestor_area",@dcText)
        Break
      Case DialogProcOptions(MyD_Handle,@dpoCtlNumber,"eb_MyD_requestor_budget")
        requestor_budget = DialogControlGet(MyD_Handle,"eb_MyD_requestor_budget",@dcText)
        Break
      Case DialogProcOptions(MyD_Handle,@dpoCtlNumber,"eb_MyD_requestor_copies")
        requestor_copies = DialogControlGet(MyD_Handle,"eb_MyD_requestor_copies",@dcText)
        Break
      Case DialogProcOptions(MyD_Handle,@dpoCtlNumber,"eb_MyD_requestor_vendor")
        requestor_vendor = DialogControlGet(MyD_Handle,"eb_MyD_requestor_vendor",@dcText)
        Break
      Case DialogProcOptions(MyD_Handle,@dpoCtlNumber,"eb_MyD_requestor_location")
        requestor_location = DialogControlGet(MyD_Handle,"eb_MyD_requestor_location",@dcText)
        Break
      Case DialogProcOptions(MyD_Handle,@dpoCtlNumber,"eb_MyD_requestor_collection")
        requestor_collection = DialogControlGet(MyD_Handle,"eb_MyD_requestor_collection",@dcText)
        Break
      Case DialogProcOptions(MyD_Handle,@dpoCtlNumber,"eb_MyD_requestor_itype")
        requestor_itype = DialogControlGet(MyD_Handle,"eb_MyD_requestor_itype",@dcText)
        Break
      Case DialogProcOptions(MyD_Handle,@dpoCtlNumber,"eb_MyD_requestor_extra1")
        requestor_extra1 = DialogControlGet(MyD_Handle,"eb_MyD_requestor_extra1",@dcText)
        Break
      Case DialogProcOptions(MyD_Handle,@dpoCtlNumber,"eb_MyD_requestor_extra2")
        requestor_extra2 = DialogControlGet(MyD_Handle,"eb_MyD_requestor_extra2",@dcText)
        Break
      Case DialogProcOptions(MyD_Handle,@dpoCtlNumber,"eb_MyD_requestor_extra3")
        requestor_extra3 = DialogControlGet(MyD_Handle,"eb_MyD_requestor_extra3",@dcText)
        Break
    EndSwitch
    Break
  Case @dePbPush
    Switch(DialogProcOptions(MyD_Handle,@dpoCtlNumber,DCID))
      Case DialogProcOptions(MyD_Handle,@dpoCtlNumber,"pb_MyD_Cancel")
        button_text = DialogControlGet(MyD_Handle,"pb_MyD_Cancel",@dcTitle)

        Return -1
        Break
      Case DialogProcOptions(MyD_Handle,@dpoCtlNumber,"pb_MyD_OK")
        button_text = DialogControlGet(MyD_Handle,"pb_MyD_OK",@dcTitle)

        Break
      Case DialogProcOptions(MyD_Handle,@dpoCtlNumber,"pb_MyD_Next")
        button_text = DialogControlGet(MyD_Handle,"pb_MyD_Next",@dcTitle)

        Break
      Case DialogProcOptions(MyD_Handle,@dpoCtlNumber,"pb_MyD_Previous")
        button_text = DialogControlGet(MyD_Handle,"pb_MyD_Previous",@dcTitle)

        Break
      Case DialogProcOptions(MyD_Handle,@dpoCtlNumber,"pb_MyD_First")
        button_text = DialogControlGet(MyD_Handle,"pb_MyD_First",@dcTitle)

        Break
      Case DialogProcOptions(MyD_Handle,@dpoCtlNumber,"pb_MyD_Last")
        button_text = DialogControlGet(MyD_Handle,"pb_MyD_Last",@dcTitle)

        Break
      Case DialogProcOptions(MyD_Handle,@dpoCtlNumber,"pb_MyD_Add")
        button_text = DialogControlGet(MyD_Handle,"pb_MyD_Add",@dcTitle)

        Break
      Case DialogProcOptions(MyD_Handle,@dpoCtlNumber,"pb_MyD_Edit")
        button_text = DialogControlGet(MyD_Handle,"pb_MyD_Edit",@dcTitle)

        Break
      Case DialogProcOptions(MyD_Handle,@dpoCtlNumber,"pb_MyD_Delete")
        button_text = DialogControlGet(MyD_Handle,"pb_MyD_Delete",@dcTitle)

        Break
    EndSwitch
    Break
EndSwitch
Return -2

#EndSubRoutine
 

Return