UBBFriend: Email This Page to Someone!
  Computer Workshop User Forums
  General Questions about EZGUI
  No Event Code = No Tool Tips?

Post New Topic  Post A Reply
profile | register | preferences | faq | search

next newest topic | next oldest topic
Author Topic:   No Event Code = No Tool Tips?
C L Davis
Member
posted 04-09-2007 11:12 PM     Click Here to See the Profile for C L Davis     Edit/Delete Message Reply w/Quote
I want to have tool tips on many fields but don't want any event code generated. The two seem to be tied together, so if I don't generate event code, the tool tips don't work either. Is there a way around this?

Chris Boss
Administrator
posted 04-10-2007 10:11 AM     Click Here to See the Profile for Chris Boss     Edit/Delete Message Reply w/Quote
No!

Controls must process the %EZ_ToolTip event to set the tooltip text.

You can though get around having to generate event code for all the controls that need tooltips, by processing the %EZ_ToolTip event in the forms event routine, rather than in each controls event routine.

The Designer generates a call to a forms event routine in the ELSE part of the select case, so any controls which don't have event code routines generated will have their events sent to the forms event routine.

In this example, I use 3 label controls (requires A property for tooltips to work), which don't generate event code.

I add a routine which I call from the forms event routine which parses out the ID's for the controls during the %EZ_ToolTip event and sets the tooltip text.

code:



' Portions: Copyright Christopher R. Boss, 2003 to 2006 , All Rights Reserved !
' Registered EZGUI 4.0 users may use this code Royalty Free !

'
' ======================================
' [PROTECTED CODE] Do NOT Edit !
' ======================================
'
#COMPILE EXE
#DIM ALL ' This is helpful to prevent errors in coding
#INCLUDE "C:\ezgui40pro\includes\ezgui40.inc" ' EZGUI Include file for Declares
'
DECLARE FUNCTION Main_Initialize(BYVAL VerNum&) AS LONG
DECLARE SUB EZ_FORM1_Display(BYVAL Parent$)
DECLARE SUB EZ_FORM1_Design()
DECLARE SUB EZ_FORM1_ParseEvents(CID&, CMsg&, CVal&, Cancel&)
DECLARE SUB FORM1_Events(CID&, CMsg&, CVal&, Cancel&)
'
%FORM1_LABEL1 = 100
%FORM1_LABEL2 = 105
%FORM1_LABEL3 = 110
'
#INCLUDE "C:\ezgui40pro\includes\ezwmain.inc" ' EZGUI Include file for WinMain
'
SUB EZ_Main(VerNum&) ' (PROTECTED)
EZ_Reg %EZ_CUSTID,%EZ_REGNUM
EZ_DefImageFolder "Graphics"
EZ_AllowCommandEvents 0
EZ_DefFont 6, "Arial", 10, "V"
EZ_DefFont 7, "Courier New", 10, "F"
EZ_DefFont 8, "Times New Roman", 10, "V"
EZ_DefFont 9, "Modern", 10, "V"
EZ_DefSystemColor 32, 4
EZ_DefSystemColor 33, 5
EZ_DefSystemColor 34, 15
EZ_DefSystemColor 35, 24
EZ_DefColorL 36, &HB96FFF
EZ_DefColorL 37, &H14AB9F
EZ_DefColorL 38, &H47A7FF
EZ_DefColorL 39, &HD2AACF
EZ_DefColorL 40, &H1CD5E3
EZ_DefColorL 41, &HBC8943
EZ_DefColorL 42, &H6C6AB7
EZ_DefColorL 43, &HDD4489
IF Main_Initialize(VerNum&) THEN
EZ_FORM1_Display ""
END IF
END SUB
'
SUB EZ_DesignWindow(FormName$) ' (PROTECTED)
SELECT CASE FormName$
CASE "FORM1"
EZ_FORM1_Design
CASE ELSE
END SELECT
END SUB
'
SUB EZ_Events(FormName$, CID&, CMsg&, CVal&, Cancel&) ' (PROTECTED)
SELECT CASE FormName$
CASE "FORM1"
EZ_FORM1_ParseEvents CID&, CMsg&, CVal&, Cancel&
CASE ELSE
END SELECT
END SUB
'
' ======================================
' [USER ACCESSABLE CODE] You may Edit !
' ======================================
'
FUNCTION Main_Initialize(BYVAL VerNum&) AS LONG
LOCAL RV&
RV&=1
FUNCTION=RV&
END FUNCTION
'
'<<BEGINFORM>> "FORM1"
'
' ======================================
' [PROTECTED CODE] Do NOT Edit !
' ======================================
'
SUB EZ_FORM1_Display(BYVAL Parent$) ' (PROTECTED)
EZ_Color -1, -1
EZ_Form "FORM1", Parent$, "Your Dialog", 0, 0, 55, 19, "C"
END SUB
'
SUB EZ_FORM1_Design() ' (PROTECTED)
LOCAL CText$
EZ_Color 0, 28
EZ_UseFont 4
EZ_Label %FORM1_LABEL1, 4.5, 3, 19, 1.75, "Label 1", "ACF"
EZ_AddToolTip "Form1", %FORM1_LABEL1
EZ_Color 0, 26
EZ_UseFont 4
EZ_Label %FORM1_LABEL2, 4.5, 6.25, 19, 1.75, "Label 2", "ACF"
EZ_AddToolTip "Form1", %FORM1_LABEL2
EZ_Color 0, 14
EZ_UseFont 4
EZ_Label %FORM1_LABEL3, 4.5, 9.5, 19, 1.75, "Label 3", "ACF"
EZ_AddToolTip "Form1", %FORM1_LABEL3
END SUB
'
SUB EZ_FORM1_ParseEvents(CID&, CMsg&, CVal&, Cancel&) ' (PROTECTED)
SELECT CASE CID&
CASE %EZ_Window
FORM1_Events CID&, CMsg&, CVal&, Cancel&
CASE ELSE
FORM1_Events CID&, CMsg&, CVal&, Cancel&
END SELECT
END SUB
'
' ======================================
' [USER ACCESSABLE CODE] You may Edit !
' ======================================
'
'<<SAVE>>
SUB ProcessForm1ToolTips(BYVAL CID&)
SELECT CASE CID&
CASE %FORM1_LABEL1
EZ_SetToolTip "My label 1"
CASE %FORM1_LABEL2
EZ_SetToolTip "My label 2"
CASE %FORM1_LABEL3
EZ_SetToolTip "My label 3"
CASE ELSE
END SELECT
END SUB
'<<END>>
'
SUB FORM1_Events(CID&, CMsg&, CVal&, Cancel&)
IF CMsg&=%EZ_ToolTip THEN
ProcessForm1ToolTips CID&
EXIT SUB
END IF
SELECT CASE CID&
CASE %EZ_Window
SELECT CASE CMsg&
CASE %EZ_Loading
CASE %EZ_Loaded
CASE %EZ_Started
CASE %EZ_Close
CASE ELSE
END SELECT
CASE ELSE
END SELECT
END SUB
'
'<<END ALL FORMS>> UnKnown Routines follow:
#IF %EZ_NOSKIPCODE
#ENDIF 'PARSE END
'



All times are EST (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | Computer Workshop ( EZGUI ) Home Page

Copyright 2000 to 2007 Christopher R. Boss

Powered by: Ultimate Bulletin Board, Version 5.44
© Infopop Corporation (formerly Madrona Park, Inc.), 1998 - 2000.