Different width buttonbar

Different width buttonbar

Postby ctoas » Thu Sep 17, 2020 5:15 pm

Hello friends

Is it possible that on the buttonbar I have one of the buttons with a different width?

Code: Select all  Expand view

        @ 0060,0000 BUTTONBAR oBarMARCA OF oWndMARCA TOP SIZE 1226,0078 3DLOOK PIXEL
        oBarMARCA:bClrGrad   := {|lMouseOver|If(!lMouseOver,{{1,nRGB(244,244,245),nRGB(244,244,245)}},{{1,nRGB(145,201,247),nRGB(145,201,247) }})}                        
        oBarMARCA:bRClicked  := { || nil }
        oBarMARCA:l2015      := .T.
        oBarMARCA:nBtnWidth  := 78
        oBarMARCA:nBtnHeight := 78         
       
        DEFINE BUTTON oBtnADICIONAR  RESOURCE "BAR_ADICIONAR"  OF oBarMARCA PROMPT "Adicionar"        FONT ARIAL14B ACTION OPERACAO_AGENDA(1)
        DEFINE BUTTON oBtnVISUALIZAR RESOURCE "BAR_VISUALIZAR" OF oBarMARCA PROMPT "Visualizar"       FONT ARIAL14B ACTION OPERACAO_AGENDA(2)
        DEFINE BUTTON oBtnALTERAR    RESOURCE "BAR_EDITAR"     OF oBarMARCA PROMPT "Editar"           FONT ARIAL14B ACTION OPERACAO_AGENDA(3)
        DEFINE BUTTON oBtnEXCLUIR    RESOURCE "BAR_EXCLUIR"    OF oBarMARCA PROMPT "Excluir"          FONT ARIAL14B ACTION OPERACAO_AGENDA(4)
        DEFINE BUTTON oBtnRELATORIOS RESOURCE "BAR_RELATORIOS" OF oBarMARCA PROMPT "Relatórios" GROUP FONT ARIAL14B //ACTION PRODUTOS()   
        DEFINE BUTTON oBtnAJUSTES    RESOURCE "BAR_AJUSTES"    OF oBarMARCA PROMPT "Ajustar CdEst/CdPad" GROUP FONT ARIAL14B //ACTION PRODUTOS()   
        DEFINE BUTTON oBtnSAIR       RESOURCE "BAR_SAIR"       OF oBarMARCA PROMPT "Sair"       GROUP FONT ARIAL14B //ACTION PRODUTOS()
       
        oBarMARCA:oBtnAJUSTES:nBtnWidth  := 128
 


Thank you.
Christiano Augusto Silveira
christiano.silveira@gmail.com

MaxxTech Soluções em TI
http://www.maxxtech.com.br
User avatar
ctoas
 
Posts: 115
Joined: Wed Oct 26, 2005 2:38 pm
Location: São Paulo - Brasil

Re: Different width buttonbar

Postby ukoenig » Thu Sep 17, 2020 8:39 pm

Christiano,

as soon I need something special inside of a buttonbar I use BTNBMP.
Use NOBORDER if needed.
You can create a doublerow of buttons inside one bar if You like.

Image

Code: Select all  Expand view

#include "fivewin.ch"

function main()
local oWndMARCA, oBarMARCA, ARIAL14B, oBtn[8]

SETBALLOON( .T. ) // Balloon shape required for tooltips

DEFINE WINDOW oWndMARCA TITLE "oWnd" ;
FROM 5, 5 TO 24, 90

        @ 0060,0000 BUTTONBAR oBarMARCA OF oWndMARCA TOP SIZE 1226,0078 3DLOOK PIXEL
        oBarMARCA:bClrGrad   := { || { { 1, 12632256, 16777215 }, { 1, 16777215, 12632256 } } }
   
    /// {|lMouseOver|If(!lMouseOver,{{1,nRGB(244,244,245),nRGB(244,244,245)}},{{1,nRGB(145,201,247),nRGB(145,201,247) }})}                        
        oBarMARCA:bRClicked  := { || nil }
        oBarMARCA:l2015      := .T.
        //oBarMARCA:nBtnWidth  := 78
        //oBarMARCA:nBtnHeight := 78          
       
       @ 0, 0 BTNBMP oBtn[1] SIZE 78, 78 ;
        RESOURCE "BAR_ADICIONAR"  OF oBarMARCA PROMPT "Adicionar" ;
        FONT ARIAL14B ACTION OPERACAO_AGENDA(1) // NOBORDER
        oBtn[1]:bClrGrad := { | lMouseOver | If( ! lMouseOver,;
    { { 1, 12500605, 16777215 }, { 1, 16777215, 12500605 } }, ;
    { { 1, 16777215, 12500605 }, { 1, 12500605, 16777215 } } ) }

       @ 0, 78 BTNBMP oBtn[2] SIZE 78, 78 ;
        RESOURCE "BAR_VISUALIZAR"  OF oBarMARCA PROMPT "Visualizar" ;
        FONT ARIAL14B ACTION OPERACAO_AGENDA(2)  
        oBtn[2]:bClrGrad := { | lMouseOver | If( ! lMouseOver,;
    { { 1, 12500605, 16777215 }, { 1, 16777215, 12500605 } }, ;
    { { 1, 16777215, 12500605 }, { 1, 12500605, 16777215 } } ) }

       @ 0, 156 BTNBMP oBtn[3] SIZE 78, 78 ;
        RESOURCE "BAR_EDITAR"  OF oBarMARCA PROMPT "Editar" ;
        FONT ARIAL14B ACTION OPERACAO_AGENDA(3)  
       oBtn[3]:bClrGrad := { | lMouseOver | If( ! lMouseOver,;
    { { 1, 10976078, 16777215 }, { 1, 16777215, 10976078 } }, ;
    { { 1, 16777215, 10976078 }, { 10, 10976078, 16777215 } } ) }

       @ 0, 234 BTNBMP oBtn[4] SIZE 78, 78 ;
        RESOURCE "BAR_EXCLUIR"  OF oBarMARCA PROMPT "Excluir" ;
        FONT ARIAL14B ACTION OPERACAO_AGENDA(4)  
       oBtn[4]:bClrGrad := { | lMouseOver | If( ! lMouseOver,;
    { { 1, 10976078, 16777215 }, { 1, 16777215, 10976078 } }, ;
    { { 1, 16777215, 10976078 }, { 1, 10976078, 16777215 } } ) }

       @ 0, 312 BTNBMP oBtn[5 ]SIZE 78, 78 ;
        RESOURCE "BAR_RELATORIOS"  OF oBarMARCA PROMPT "Relatórios" ;
        FONT ARIAL14B ACTION PRODUTOS()  
       oBtn[5]:bClrGrad := { | lMouseOver | If( ! lMouseOver,;
    { { 1, 10976078, 16777215 }, { 1, 16777215, 10976078 } }, ;
    { { 1, 16777215, 10976078 }, { 1, 10976078, 16777215 } } ) }

       @ 0, 410 BTNBMP oBtn[6] SIZE 128, 78 ;
        RESOURCE "BAR_AJUSTES"  OF oBarMARCA PROMPT "Ajustar CdEst/CdPad" ;
        FONT ARIAL14B ACTION PRODUTOS()  
        oBtn[6]:bClrGrad := { | lMouseOver | If( ! lMouseOver,;
    { { 1, 11704524, 16777215 }, { 1, 16777215, 11704524 } }, ;
    { { 1, 16777215, 11704524 }, { 1, 11704524, 16777215 } } ) }
    oBtn[6] :cToolTip =  { "This is a" + CRLF + "extra long button","Ajustar CdEst/CdPad", 1, CLR_BLACK, 14089979 }
    oBtn[6] :SetColor( 0, ) 

       @ 0, oWndMARCA:nWidth - 94 BTNBMP oBtn[7] SIZE 78, 78 ; // adjust position to the right
        RESOURCE "BAR_SAIR"  OF oBarMARCA PROMPT "Sair" ;
        FONT ARIAL14B ACTION PRODUTOS()  
       oBtn[7]:bClrGrad := { | lMouseOver | If( ! lMouseOver,;
    { { 1, 10976078, 16777215 }, { 1, 16777215, 10976078 } }, ;
    { { 1, 16777215, 10976078 }, { 1, 10976078, 16777215 } } ) }

        //DEFINE BUTTON oBtnADICIONAR  RESOURCE "BAR_ADICIONAR"  OF oBarMARCA PROMPT "Adicionar"        FONT ARIAL14B ACTION OPERACAO_AGENDA(1)
        //DEFINE BUTTON oBtnVISUALIZAR RESOURCE "BAR_VISUALIZAR" OF oBarMARCA PROMPT "Visualizar"       FONT ARIAL14B ACTION OPERACAO_AGENDA(2)
        //DEFINE BUTTON oBtnALTERAR    RESOURCE "BAR_EDITAR"     OF oBarMARCA PROMPT "Editar"           FONT ARIAL14B ACTION OPERACAO_AGENDA(3)
        //DEFINE BUTTON oBtnEXCLUIR    RESOURCE "BAR_EXCLUIR"    OF oBarMARCA PROMPT "Excluir"          FONT ARIAL14B ACTION OPERACAO_AGENDA(4)
        //DEFINE BUTTON oBtnRELATORIOS RESOURCE "BAR_RELATORIOS" OF oBarMARCA PROMPT "Relatórios" GROUP FONT ARIAL14B //ACTION PRODUTOS()    
        //DEFINE BUTTON oBtnAJUSTES    RESOURCE "BAR_AJUSTES"    OF oBarMARCA PROMPT "Ajustar CdEst/CdPad" GROUP FONT ARIAL14B //ACTION PRODUTOS()    
        //DEFINE BUTTON oBtnSAIR       RESOURCE "BAR_SAIR"       OF oBarMARCA PROMPT "Sair"       GROUP FONT ARIAL14B //ACTION PRODUTOS()
       
    //    oBarMARCA:oBtnAJUSTES:nBtnWidth  := 128

ACTIVATE WINDOW oWndMARCA

return nil


FUNCTION OPERACAO_AGENDA( Pos )

return nil

FUNCTION PRODUTOS()

return nil

 


best regards
Uwe :D
Last edited by ukoenig on Sat Sep 19, 2020 9:29 am, edited 1 time 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: Different width buttonbar

Postby ctoas » Fri Sep 18, 2020 7:11 pm

Thanks ukoenig for your answer, perfect!

:D :D :D
Christiano Augusto Silveira
christiano.silveira@gmail.com

MaxxTech Soluções em TI
http://www.maxxtech.com.br
User avatar
ctoas
 
Posts: 115
Joined: Wed Oct 26, 2005 2:38 pm
Location: São Paulo - Brasil


Return to FiveWin for Harbour/xHarbour

Who is online

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