How to get the Button-No. from a Buttonlist on Action ?

How to get the Button-No. from a Buttonlist on Action ?

Postby ukoenig » Tue Mar 12, 2013 5: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

Image

Buttons created from a DBF-file .

Code: Select all  Expand view

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 :?:
Last edited by ukoenig on Tue Mar 12, 2013 5:55 pm, edited 6 times in total.
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: How to get the Button-No. from a Buttonlist ?

Postby Daniel Garcia-Gil » Tue Mar 12, 2013 5:37 pm

Hello

Code: Select all  Expand view
oHBtn[n]:bAction := buildBtnAccion( n )
...
function buildBtnAction(n)
return {||  msGalert( "Button. " + ALLTRIM(STR( n )) ) }
User avatar
Daniel Garcia-Gil
 
Posts: 2365
Joined: Wed Nov 02, 2005 11:46 pm
Location: Isla de Margarita

Re: How to get the Button-No. from a Buttonlist on Action ?

Postby ukoenig » Tue Mar 12, 2013 5: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 )

Image

Code: Select all  Expand view

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 :lol:
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 86 guests