FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour How to get the Button-No. from a Buttonlist on Action ?
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
How to get the Button-No. from a Buttonlist on Action ?
Posted: Tue Mar 12, 2013 05:28 PM
Hello,

I want to define hotspotareas with transparent BTNBMP in Design-mode
The button-values are saved / restored to / from a DBF
I need the Button-No. from a button-list defined in a DO WHILE like



Buttons created from a DBF-file .

Code (fw): Select all Collapse
DBSELECTAREA (1)
DBSETORDER(1)
DBSEEK(UPPER(cWImage))
IF FOUND()
   DO WHILE (1)->IMAGE = cWImage .and. !EOF()
        nHSpotCol := (1)->HSCOLOR
        @ (1)->TOP, (1)->LEFT BTNBMP oHBtn[n] OF oHDialog ;
        SIZE (1)->WIDTH, (1)->HEIGHT  PIXEL ;
        PROMPT ALLTRIM( STR(n)) ;
        FONT oFont2 ;
        CENTER 

       oHBtn[n]:bAction := {||  msGalert( "Button. " + ALLTRIM(STR( // ?????  oHBtn[n] )) ) }
       oHBtn[n] :lTransparent := .t.   
       oHBtn[n] :SetColor( nHSpotCol, )
       DBSKIP(+1)
       n++
   ENDDO
ENDIF


Best Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 PM
Re: How to get the Button-No. from a Buttonlist ?
Posted: Tue Mar 12, 2013 05:37 PM
Hello

Code (fw): Select all Collapse
oHBtn[n]:bAction := buildBtnAccion( n )
...
function buildBtnAction(n)
return {||  msGalert( "Button. " + ALLTRIM(STR( n )) ) }
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: How to get the Button-No. from a Buttonlist on Action ?
Posted: Tue Mar 12, 2013 05:57 PM
Daniel,

Thank You very much.
It works fine now.
( needed for my new hotspot-editor release with a different solution that will work in design-mode )



Code (fw): Select all Collapse
DBSELECTAREA (1)
DBSETORDER(1)
DBSEEK(UPPER(cWImage))
IF FOUND()
   DO WHILE (1)->IMAGE = cWImage .and. !EOF()
      nHSpotCol := (1)->HSCOLOR
      @ (1)->TOP, (1)->LEFT BTNBMP oHBtn[n] OF oHDialog ;
      SIZE (1)->WIDTH, (1)->HEIGHT  PIXEL ;
      PROMPT ALLTRIM( STR(n)) ;
      FONT oFont2 ;
      CENTER
 
      oHBtn[n]:bAction := BTNACTION( n, oHBtn )

      oHBtn[n] :lTransparent := .t.   
      oHBtn[n] :SetColor( nHSpotCol, )

      DBSKIP(+1)
      n++
   ENDDO
ENDIF
....
....

// ----------------

FUNCTION BTNACTION( n, oHBtn )
RETURN {||  MsGalert( "Button : " + ALLTRIM(STR( n )) + CRLF + ;
          "========" + CRLF + ;
          "Top . " + ALLTRIM(STR(oHBtn[n]:nTop )) + CRLF + ;
          "Left . " + ALLTRIM(STR(oHBtn[n]:nLeft )) + CRLF + ;
          "Width . " + ALLTRIM(STR(oHBtn[n]:nWidth )) + CRLF + ;
          "Height . " + ALLTRIM(STR(oHBtn[n]:nHeight )), "Size" ) }


Best Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.

Continue the discussion