lose focus on buttonbar

Re: lose focus on buttonbar

Postby Silvio.Falconi » Fri Apr 28, 2023 10:50 am

karinha wrote:Buen día. Maestro Antônio, en este ejemplo de Maestro Navarro, pídale que después de cambiar el botón, pase el mouse sobre los botones de la barra. En este ejemplo del maestro navarro, ¿cómo solucionarlo?

Gracias.

Regards, saludos.



the navarro sample run ok !!
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6834
Joined: Thu Oct 18, 2012 7:17 pm

Re: lose focus on buttonbar

Postby karinha » Fri Apr 28, 2023 10:59 am

Silvio, I asked Master Navarro. Here it didn't work well.

Silvio, le pregunté al maestro Navarro. Aquí no funcionó bien.

Necesito saber si hay un BUG(ERROR) en mi versión de FWH.

Gracias.
Thanks.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7315
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: lose focus on buttonbar

Postby Silvio.Falconi » Fri Apr 28, 2023 1:42 pm

here is the complete example, the problem is that when I click on a row there is a flicker that denotes that there is something wrong

to select a row I use a popup menu

@ 85, 10 BTNBMP aBtnBrow ;
FLAT SIZE 80, 20 OF oDlg PIXEL ;
PROMPT "Select menu" ;
NOROUND ;
ACTION ::ShowPopUp( { |oBtn| MenuContextual(oBtn,oBrw,oDbf,oDlg) } )

When I click on xbrowse not run ok


Code: Select all  Expand view



#include 'fivewin.ch'
#include 'xbrowse.ch'
#include "constant.ch"
#include "report.ch"


Function test()
   local oDlg,oDbf,oFont
   local oBar,aBtnBar:=array(8)
   local aBtnBrow
   local  nBottom   := 27.2
   local  nRight    := 89
   local  nWd       := Max( nRight * DLG_CHARPIX_W, 180 )
   local  nHt       := nBottom * DLG_CHARPIX_H



       oDbf :=TDatabase():Open( , "Customer", "DBFCDX", .T. )
       oDbf:setorder(1)
       oDbf:Gotop()


 DEFINE DIALOG oDlg SIZE nWd, nHt PIXEL TRUEPIXEL;
         TiTle "test"

 @ 110,10 XBROWSE oBrw SIZE -10,-10 PIXEL OF oDlg ;
          DATASOURCE oDbf AUTOCOLS  ;
          AUTOSORT FONT oFont;
          NOBORDER CELL LINES

     WITH OBJECT oBrw
            :nRowHeight          := 25
            :l2007               := .F.
            :l2015               := .T.
            :lRecordSelector     := .F.
            :nColDividerStyle    := LINESTYLE_LIGHTGRAY
            :nRowDividerStyle    := LINESTYLE_LIGHTGRAY
            :nStretchCol         := STRETCHCOL_WIDEST
            :nMarqueeStyle        := MARQSTYLE_HIGHLROW
            :lAllowRowSizing     := .F.
            :lAllowColSwapping   := .F.
            :lAllowColHiding     := .F.
            :lAllowSizings       := .F.
             :lDrawBorder := .t.
             :nClrBorder := Rgb(195,195,185)
            :bClrStd := { || { CLR_BLACK, If( oBrw:KeyNo % 2 == 0, CLR_WHITE,RGB(243,243,238)) } }
         END

      WITH OBJECT oBrw

           :bLClicked := { ||  ;
                   If( oBrw:IsSelectedRow(), ;
                         Btnbar(1,oDlg:oBar,oDlg,oDbf,oBrw), ;
                         Btnbar(2,oDlg:oBar,oDlg,oDbf,oBrw)) }

            :SetMultiSelectCol()
            :CreateFromCode()
          END


    @ 85, 10 BTNBMP aBtnBrow ;
                FLAT  SIZE 80, 20  OF oDlg   PIXEL ;
                PROMPT "Select menu"  ;
                 NOROUND  ;
                ACTION ::ShowPopUp( { |oBtn| MenuContextual(oBtn,oBrw,oDbf,oDlg)  } )


          ACTIVATE DIALOG oDlg  CENTER   ;
          ON INIT (  Btnbar(0,oBar,oDlg,oDbf,oBrw),;
                     Btnbar(1,oDlg:oBar,oDlg,oDbf,oBrw),;
                     ChangeButtons( oDlg:oBar ) )
RETURN NIL


//---------------------------------------------------------------------------------//
Function Btnbar(nBar,oBar,oDlg,oDbf,oBrw)  // ,aBtnBar
   local aBtnBar
   local x

   if Valtype( oBar ) = "O"
      For x := Len( oBar:aControls ) to 1 step - 1
         oBar:Del( x )
      Next x
   endif

  Do case
  case nbar = 0
     DEFINE BUTTONBAR oBar OF oDlg  SIZE 80,70  TOP NOBORDER  2015
  case nbar = 1
   aBtnBar := array(6)
   DEFINE BUTTON aBtnBar[1] OF oBar PROMPT "New"      ACTION NIL
   DEFINE BUTTON aBtnBar[2] OF oBar PROMPT "Modify"    ACTION NIL
   DEFINE BUTTON aBtnBar[3] OF oBar PROMPT "Duplicate"   ACTION NIL
   DEFINE BUTTON aBtnBar[4] OF oBar PROMPT "Del"    ACTION NIL
   DEFINE BUTTON aBtnBar[5] OF oBar PROMPT "Print"    action oBrw:Report( )
   DEFINE BUTTON aBtnBar[6] OF oBar PROMPT "HElp"    ACTION NIL    BTNRIGHT

  case nbar = 2
   aBtnBar := array(3)
   DEFINE BUTTON aBtnBar[1] OF oBar PROMPT "Del"    ACTION NIL
   DEFINE BUTTON aBtnBar[2] OF oBar PROMPT "Print"     action oBrw:Report( )
   DEFINE BUTTON aBtnBar[3] OF oBar PROMPT "Help"     ACTION NIL  BTNRIGHT
  endcase
return oBar
//-------------------------------------------------------------------------------//
 function ChangeButtons( oBar )
       AEval( oBar:aControls, { | oCtrl | oCtrl:nTop += 4, oCtrl:nHeight -= 4 } )
    return .T.
//-------------------------------------------------------------------------------//
//-------------------------------------------------------------------------------//
Function MenuContextual(oControl,oBrw,oDbf,oParent)
   local oMenu
 MENU oMenu POPUP
           if oBrw:IsSelectedRow()
              MENUITEM "Deselect row" action (oBrw:SelectRow( 0 ) , Btnbar(1,oParent:oBar,oParent,oDbf,oBrw))
                else
              MENUITEM "Select row"   action (oBrw:SelectRow( 2 ), Btnbar(2,oParent:oBar,oParent,oDbf,oBrw) )

        endif
       SEPARATOR
              MENUITEM "Print"   action oBrw:Report( )
     ENDMENU
   return oMenu

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



 
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 6834
Joined: Thu Oct 18, 2012 7:17 pm

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 39 guests