TOOLTIP question

Post Reply
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

TOOLTIP question

Post by Otto »

Sometimes I redefine the used controls without inserting an object name.

REDEFINE GET cBetriebnr ID 103 of oDlg

Is it possible to inset tooltips without having an object name or do I have to insert object names.


REDEFINE GET oGet VAR cBetriebnr ID 103 of oDlg
oGet:cTooltip = “Help me”

Thanks in advance
Otto
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

Otto,

Since there is no TOOLTIP clause for REDEFINE GET, then yes you have to assign an object name so you can assign the tooltip.

You can always look at the .CH file (in this case FIVEWIN.CH) to see what all the available clauses are.

James
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: TOOLTIP question

Post by Enrico Maria Giordano »

You can access the control through its position inside oDlg:aControls or find it using nId.

EMG
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Post by Otto »

Thank you. Could you show me how to find a control by the nID.
Thanks in adance.
Regards,
Otto
Rochinha
Posts: 309
Joined: Sun Jan 08, 2006 10:09 pm
Location: Brasil - Sao Paulo
Contact:

Post by Rochinha »

Otto,

see the SAMPLES\TESTFOC2.PRG.
User avatar
TecniSoftware
Posts: 213
Joined: Fri Oct 28, 2005 6:29 pm
Location: Quilmes, Buenos Aires, Argentina

Post by TecniSoftware »

Try it this way:

niD := 123
nPosition := aScan( oDlg:aControls, { |oCtrl| oCtrl:nID == nID } )

oDlg:aControls[nPosition]:cToolTip := "Hello"



Regards.
Alejandro Cebolido
Buenos Aires, Argentina
demont frank
Posts: 167
Joined: Thu Mar 22, 2007 11:24 am

Post by demont frank »

Otto,

I use very often the controls from a dialog with their nId.

Before activating the dialog :

BuildDlgObj(@oDlg)

This procedure add as DATA to oDlg DlgObj (Hash array)

Code: Select all

******************************************************************************
PROC BuildDlgObj(oDlg)
**********************
LOCAL el
IF ! __ObjHasData(oDlg,"DLGOBJ")
	__OBJADDDATA(oDlg,"DlgObj")
END
oDlg:DlgObj := Hash()
WITH OBJECT oDlg
	FOR EACH el IN :aControls
		//IF el:nId > 9
		IF __ObjHasData(el,"NID")
			oDlg:DlgObj[el:nId] := el
		END
	NEXT
END
RETURN
To use a control we can now

oDlg:DlgObj[nId]

This is possible in each routine where oDlg is visible

Frank
User avatar
James Bott
Posts: 4654
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA
Contact:

Post by James Bott »

Finding the control's ID seems like a lot more work than just assigning an object name.

Regards,
James
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Post by Otto »

Thanks to all for helping.
Regards,
Otto
demont frank
Posts: 167
Joined: Thu Mar 22, 2007 11:24 am

Post by demont frank »

James Bott wrote:Finding the control's ID seems like a lot more work than just assigning an object name.

Regards,
James
James

In many cases we have to pass this objects to sub routines. All objects ? which one ? A nightmare to synchronise to pass !

In mine code we have only to call ones BuildDlgObj , and later when it is necessary oDlg as parameter

Frank
User avatar
xProgrammer
Posts: 464
Joined: Tue May 16, 2006 7:47 am
Location: Australia

Another idea

Post by xProgrammer »

Hi all

I'm basically a FiveLinux guy rather than FiveWin guy and I build my dialogs via code but the other logical alternative would presumably be to modify FiveWin.ch to support TOOLTIPS on a REDEFINE.

Regards
xProgrammer
Post Reply