FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour problem of bLClicked in ribbon 'ADD BUTTON'
Posts: 193
Joined: Wed Apr 04, 2007 06:54 AM
problem of bLClicked in ribbon 'ADD BUTTON'
Posted: 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

Posts: 193
Joined: Wed Apr 04, 2007 06:54 AM
Re: problem of bLClicked in ribbon 'ADD BUTTON'
Posted: Mon Feb 27, 2017 08: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 (fw): Select all Collapse
    #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 (fw): Select all Collapse
    #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
Posts: 193
Joined: Wed Apr 04, 2007 06:54 AM
Re: problem of bLClicked in ribbon 'ADD BUTTON'
Posted: 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

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: problem of bLClicked in ribbon 'ADD BUTTON'
Posted: 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
Posts: 193
Joined: Wed Apr 04, 2007 06:54 AM
Re: problem of bLClicked in ribbon 'ADD BUTTON'
Posted: Tue Mar 07, 2017 03: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.

Posts: 193
Joined: Wed Apr 04, 2007 06:54 AM
Re: problem of bLClicked in ribbon 'ADD BUTTON'
Posted: Wed Mar 15, 2017 05:37 PM
i have resolved for 'ADD BUTTON' of 'RIBBONBAR'
substituting
oBtnAiuto:bLClicked
with
oBtnAiuto:bLButtonUp

now the code below works fine:

Code (fw): Select all Collapse
        #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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: problem of bLClicked in ribbon 'ADD BUTTON'
Posted: Thu Mar 16, 2017 12:18 PM

very good

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion