TOOLTIP question

TOOLTIP question

Postby Otto » Thu Aug 07, 2008 7: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
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Postby James Bott » Thu Aug 07, 2008 7: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
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: TOOLTIP question

Postby Enrico Maria Giordano » Thu Aug 07, 2008 11:49 am

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

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

Postby Otto » Thu Aug 07, 2008 2:15 pm

Thank you. Could you show me how to find a control by the nID.
Thanks in adance.
Regards,
Otto
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Postby Rochinha » Thu Aug 07, 2008 2:37 pm

Otto,

see the SAMPLES\TESTFOC2.PRG.
Rochinha
 
Posts: 310
Joined: Sun Jan 08, 2006 10:09 pm
Location: Brasil - Sao Paulo

Postby TecniSoftware » Thu Aug 07, 2008 2: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
User avatar
TecniSoftware
 
Posts: 235
Joined: Fri Oct 28, 2005 6:29 pm
Location: Quilmes, Buenos Aires, Argentina

Postby demont frank » Thu Aug 07, 2008 3: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)

Code: Select all  Expand view  RUN
******************************************************************************
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
demont frank
 
Posts: 167
Joined: Thu Mar 22, 2007 11:24 am

Postby James Bott » Thu Aug 07, 2008 3:59 pm

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

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

Postby Otto » Thu Aug 07, 2008 4:07 pm

Thanks to all for helping.
Regards,
Otto
User avatar
Otto
 
Posts: 6332
Joined: Fri Oct 07, 2005 7:07 pm

Postby demont frank » Thu Aug 07, 2008 5: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
demont frank
 
Posts: 167
Joined: Thu Mar 22, 2007 11:24 am

Another idea

Postby xProgrammer » Fri Aug 08, 2008 1: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
User avatar
xProgrammer
 
Posts: 464
Joined: Tue May 16, 2006 7:47 am
Location: Australia


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot], jmartial and 45 guests