FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour TOOLTIP question
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM
TOOLTIP question
Posted: Thu Aug 07, 2008 07:11 AM

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

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
TOOLTIP question
Posted: Thu Aug 07, 2008 07:17 AM

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

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: TOOLTIP question
Posted: Thu Aug 07, 2008 11:49 AM

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

EMG

Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM
TOOLTIP question
Posted: Thu Aug 07, 2008 02:15 PM

Thank you. Could you show me how to find a control by the nID.
Thanks in adance.
Regards,
Otto

Posts: 310
Joined: Sun Jan 08, 2006 10:09 PM
TOOLTIP question
Posted: Thu Aug 07, 2008 02:37 PM

Otto,

see the SAMPLES\TESTFOC2.PRG.

Posts: 244
Joined: Fri Oct 28, 2005 06:29 PM
TOOLTIP question
Posted: Thu Aug 07, 2008 02:47 PM

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
Posts: 167
Joined: Thu Mar 22, 2007 11:24 AM
TOOLTIP question
Posted: Thu Aug 07, 2008 03:09 PM
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)

******************************************************************************
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
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
TOOLTIP question
Posted: Thu Aug 07, 2008 03:59 PM

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

Regards,
James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 6984
Joined: Fri Oct 07, 2005 07:07 PM
TOOLTIP question
Posted: Thu Aug 07, 2008 04:07 PM

Thanks to all for helping.
Regards,
Otto

Posts: 167
Joined: Thu Mar 22, 2007 11:24 AM
TOOLTIP question
Posted: Thu Aug 07, 2008 05:51 PM
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
Posts: 464
Joined: Tue May 16, 2006 07:47 AM
Another idea
Posted: Fri Aug 08, 2008 01:30 AM

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

Continue the discussion