Page 1 of 1
buttonbar bottom size btns
Posted: Thu Nov 26, 2020 11:54 am
by Silvio.Falconi
I made this buttonbar on bottom of dialog
how can i do to create a lower button than the buttonbar?
If you look at the figure, if I press a button that is the same height as the buttonbar, how can I make it lower than the buttonbar?
that is, maybe I don't explain well
since I created the button with the color of the dialog when you press a button it is not clear where the height of the button ends
Re: buttonbar bottom size btns
Posted: Thu Nov 26, 2020 12:33 pm
by Antonio Linares
Dear Silvio,
You may do:
oBtn:nTop += 2
oBtn:nHeight -= 2
or
oBtn:SetSize( nWidth, nHeight )
if you post your source code we may be able to provide you a better help
Re: buttonbar bottom size btns
Posted: Thu Nov 26, 2020 12:41 pm
by Silvio.Falconi
Code: Select all
#include "fivewin.ch"
#include "constant.ch"
Function test()
Local nBottom := 55
Local nRight := 175
Local nWidth := Max( nRight * DLG_CHARPIX_W, 180 )
Local nHeight := nBottom * DLG_CHARPIX_H
local oDlgReport
local oFontDialog,oFontBold
DEFINE FONT oFontDialog NAME 'Tahoma' SIZE 0, -16
DEFINE FONT oFontBold NAME 'Tahoma' SIZE 0, -14 BOLD
DEFINE DIALOG oDlgReport ;
TITLE aTitle[ nMode ] + cReportNum ;
SIZE 960,580 PIXEL TRUEPIXEL RESIZABLE ;
COLOR CLR_BLACK, nRgb( 245,244,234)
oDlgReport:SetFont(oFontDialog)
DEFINE BUTTONBAR oBar OF oDlgReport SIZE 80, 80 2015 BOTTOM
DEFINE BUTTON OF oBar ;
RESOURCE "NO_DLG";
PROMPT "Annulla" TOOLTIP "Esci" ;
ACTION ( oDlgReport:end( IDCANCEL ) )
DEFINE BUTTON OF oBar BTNRIGHT ;
RESOURCE "OK_DLG" ;
PROMPT "Conferma" ;
TOOLTIP "Conferma i dati" ;
ACTION ( oDlgReport:end( IDOK ) )
oBar:bClrGrad := { | lPressed | If( ! lPressed,;
{ { 1, nRgb(233,229,206),nRgb(233,229,206) } },;
{ { 1, nRgb( 245,244,234), nRgb( 245,244,234) } } ) }
oDlgReport:aMinMaxInfo := { nil, nil, ,, 1020,600,1020,600 }
ACTIVATE DIALOG oDlgReport center
Re: buttonbar bottom size btns
Posted: Thu Nov 26, 2020 12:50 pm
by Antonio Linares
Code: Select all
ACTIVATE DIALOG oDlgReport center ;
ON INIT ChangeButtons( oBar )
...
function ChangeButtons( oBar )
AEval( oBar:aControls, { | oCtrl | oCtrl:nTop += 2, oCtrl:nHeight -= 2 } )
return .T.
Re: buttonbar bottom size btns
Posted: Fri Nov 27, 2020 8:52 am
by Silvio.Falconi
thanks