FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour BtnBmp - how to get id number of focused button?
Posts: 60
Joined: Fri Oct 07, 2005 05:38 AM
BtnBmp - how to get id number of focused button?
Posted: Fri Jan 05, 2007 09:39 PM
FOR nM := 1 TO 12
  cM := str0(nM,2)
  dDay := ctod('01.'+cM+"."+cYear)
  FOR nD := 1 TO 31
    aKolor := aKol(nD,cKld&cM)
    IF month(dDay)==nM
       oBtn1:=tBtnBmp():Redefine((nM*1000)+nD,,,,,,{|| msgInfo(KardSay(focused_button_id))},oDlg,,,,KardSay(focused_button_id),str(nD,2)+":"+aTab[dow(dDay)],oFont)
       oBtn1:SetColor(aKolor[1],aKolor[2])
    ENDIF
    dDay++
  NEXT
NEXT


oDlg is dialog with button for each day
aKol return different array of color fo every day of a weak

I wish display info by using tooltip and msgInfo. How can i get id number of focused btnBmp?

regards Eugeniusz
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: BtnBmp - how to get id number of focused button?
Posted: Fri Jan 05, 2007 11:20 PM

Can you build a reduced and self-contained sample to experiment with?

EMG

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
BtnBmp - how to get id number of focused button?
Posted: Sat Jan 06, 2007 08:05 AM
Eugeniusz,

Change the variable focused_button_id into a function call:
function focused_button_id( oDlg )

   local nAt := AScan( oDlg:aControls, { | o | o:lFocused } )

return If( nAt != 0, oDlg:aControls[ nAt ]:nId, 0 )
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 60
Joined: Fri Oct 07, 2005 05:38 AM
BtnBmp - how to get id number of focused button?
Posted: Mon Jan 08, 2007 10:35 AM

Antonio
as usualy Your help is great and every button reports now its id number.
But what i have to do to display this number as cTooltip (it display id=0)?
regards Eugeniusz.

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
BtnBmp - how to get id number of focused button?
Posted: Mon Jan 08, 2007 11:51 AM
Eugeniusz,

Do you mean this ? In your loop:
       oBtn1:=tBtnBmp():Redefine((nM*1000)+nD,,,,,,{|| msgInfo(KardSay(focused_button_id))},oDlg,,,,KardSay(focused_button_id),str(nD,2)+":"+aTab[dow(dDay)],oFont) 
       oBtn1:SetColor(aKolor[1],aKolor[2]) 
       oBtn1:cToolTip := Str( oBtn1:nId )
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 60
Joined: Fri Oct 07, 2005 05:38 AM
BtnBmp - how to get id number of focused button?
Posted: Mon Jan 08, 2007 12:05 PM

Yes - second KardSay()
Eugeniusz

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
BtnBmp - how to get id number of focused button?
Posted: Mon Jan 08, 2007 12:16 PM

Eugeniusz,

oBtn1:cToolTip := Str( oBtn1:nId )

Is it ok ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 60
Joined: Fri Oct 07, 2005 05:38 AM
BtnBmp - how to get id number of focused button?
Posted: Mon Jan 08, 2007 12:24 PM

Antonio,

Yes, it works - it's to simple .
Thank You.
Eugeniusz

Continue the discussion