problem of bLClicked in ribbon 'ADD BUTTON'

problem of bLClicked in ribbon 'ADD BUTTON'

Postby marzio » Tue Feb 21, 2017 10:16 am

The below instruction works with 'BUTTONBMP' but with 'ADD BUTTON' in ribbonbar doesn't work. MsgInfo() is not visualized.

DEFINE CURSOR oCursor HAND
@ 1, 1 ADD BUTTONBMP oBtn prompt "prova" OF oGr BITMAP "info.bmp" SIZE 50, 80 TOP;
ACTION( oBtn:Capture(), oBtn:oCursor := oCursor,;
oBtn:bLClicked := { | nRow, nCol | MsgInfo("!"), ReleaseCapture(), oBtn:oCursor := NIL, oBtn:bLClicked := NIL, 0 } )

any suggestions ?
marzio
marzio
 
Posts: 129
Joined: Wed Apr 04, 2007 6:54 am

Re: problem of bLClicked in ribbon 'ADD BUTTON'

Postby marzio » Mon Feb 27, 2017 8:17 am

This example code below works fine.
when i click 'help' button the cursor changes and if i click in a point of the window then the MsgInfo() is visualized.

Code: Select all  Expand view
    #include "FiveWin.ch"
    #include "Ribbon.ch"
   
    FUNCTION Main()
   
    LOCAL oWnd, oCursor, oRBar, oGr, oBtn
   
    DEFINE WINDOW oWnd FROM 0, 0 TO 100, 100 PIXEL
    DEFINE CURSOR oCursor HAND
    DEFINE RIBBONBAR oRBar WINDOW oWnd PROMPT "     help     ", "     Extra     " HEIGHT 157 TOPMARGIN 25
    ADD GROUP oGr RIBBON oRBar TO OPTION 1 PROMPT "prova" WIDTH 420
    @ 5, 6 BUTTONBMP oBtn PROMPT "HELP" OF oGr BITMAP ".\aiuto.bmp" SIZE 80, 50 PIXEL ;
            ACTION( oBtn:Capture(), oBtn:oCursor := oCursor,;
                      oBtn:bLClicked := { | nRow, nCol | MsgInfo("!"), ReleaseCapture(), oBtn:oCursor := NIL, oBtn:bLClicked := NIL, 0 } )
   
    ACTIVATE WINDOW oWnd MAXIMIZED
   
    Return( NIL )


This example code below doesn 't work.
when i click 'help' button the cursor changes and if i click in a point of the window then the MsgInfo() is NOT visualized.


Code: Select all  Expand view
    #include "FiveWin.ch"
    #include "Ribbon.ch"
   
    FUNCTION Main()
   
    LOCAL oWnd, oCursor, oRBar, oGr, oBtn
   
    DEFINE WINDOW oWnd FROM 0, 0 TO 100, 100 PIXEL
    DEFINE CURSOR oCursor HAND
    DEFINE RIBBONBAR oRBar WINDOW oWnd PROMPT "     help     ", "     Extra     " HEIGHT 157 TOPMARGIN 25
    ADD GROUP oGr RIBBON oRBar TO OPTION 1 PROMPT "prova" WIDTH 420
    @ 5, 6 ADD BUTTON oBtn PROMPT "HELP" GROUP oGr BITMAP ".\aiuto.bmp" SIZE 80, 50 PIXEL ;
            ACTION( oBtn:Capture(), oBtn:oCursor := oCursor,;
                      oBtn:bLClicked := { | nRow, nCol | MsgInfo("!"), ReleaseCapture(), oBtn:oCursor := NIL, oBtn:bLClicked := NIL, 0 } )
   
    ACTIVATE WINDOW oWnd MAXIMIZED
   
    Return( NIL )


is there something wrong in 'ADD BUTTON' of ribbonbar?
thanks, marzio
marzio
 
Posts: 129
Joined: Wed Apr 04, 2007 6:54 am

Re: problem of bLClicked in ribbon 'ADD BUTTON'

Postby marzio » Tue Mar 07, 2017 10:14 am

Antonio,
what do you think about this behavior in the above examples ?
can you verify if something is lacking in 'ADD BUTTON' code ?
thanks
marzio
marzio
 
Posts: 129
Joined: Wed Apr 04, 2007 6:54 am

Re: problem of bLClicked in ribbon 'ADD BUTTON'

Postby Antonio Linares » Tue Mar 07, 2017 11:31 am

This code is working fine:

@ 5, 6 ADD BUTTON oBtn PROMPT "HELP" GROUP oGr BITMAP ".\aiuto.bmp" SIZE 80, 50 ;
ACTION MsgInfo( "click" )

I don't understand what you are trying to do
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41302
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: problem of bLClicked in ribbon 'ADD BUTTON'

Postby marzio » Tue Mar 07, 2017 3:56 pm

hi Antonio,
i use it for obtain help for each column of a database open with tcbrowse.
i click on the help button, the cursor changes its form,
then i click on the dbase column that opens a MsgInfo() with different text for each column.
marzio
 
Posts: 129
Joined: Wed Apr 04, 2007 6:54 am

Re: problem of bLClicked in ribbon 'ADD BUTTON'

Postby marzio » Wed Mar 15, 2017 5:37 pm

i have resolved for 'ADD BUTTON' of 'RIBBONBAR'
substituting
oBtnAiuto:bLClicked
with
oBtnAiuto:bLButtonUp

now the code below works fine:

Code: Select all  Expand view
       #include "FiveWin.ch"
        #include "Ribbon.ch"
       
        FUNCTION Main()
       
        LOCAL oWnd, oCursor, oRBar, oGr, oBtn
       
        DEFINE WINDOW oWnd FROM 0, 0 TO 100, 100 PIXEL
        DEFINE CURSOR oCursor HAND
        DEFINE RIBBONBAR oRBar WINDOW oWnd PROMPT "     help     ", "     Extra     " HEIGHT 157 TOPMARGIN 25
        ADD GROUP oGr RIBBON oRBar TO OPTION 1 PROMPT "prova" WIDTH 420
        @ 5, 6 ADD BUTTON oBtn PROMPT "HELP" GROUP oGr BITMAP ".\aiuto.bmp" SIZE 80, 50 PIXEL ;
                ACTION( oBtn:Capture(), oBtn:oCursor := oCursor,;
                          oBtn:bLButtonUp := { | nRow, nCol | MsgInfo("!"), ReleaseCapture(), oBtn:oCursor := NIL, oBtn:bLButtonUp := NIL, 0 } )
       
        ACTIVATE WINDOW oWnd MAXIMIZED
       
        Return( NIL )


thanks for the attention
marzio
marzio
 
Posts: 129
Joined: Wed Apr 04, 2007 6:54 am

Re: problem of bLClicked in ribbon 'ADD BUTTON'

Postby Antonio Linares » Thu Mar 16, 2017 12:18 pm

very good
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41302
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 9 guests