the dialog where the folder is located will shrink depending on whether the end user selects a folder tab, obviously this must be an option
I needed this because in some tabs I have to put a lot of information while in others the information is less and you risk inserting some space that is ugly to see
for now I resolve in this mode but I don't know if it's a right solution
- Code: Select all Expand view
#include "fivewin.ch"
Function test()
local oDlg,oFolder
local oFontDialog,oFontBold
local oBarDialog
local nHeight:= 600
DEFINE FONT oFontDialog NAME 'Tahoma' SIZE 0, -16
DEFINE FONT oFontBold NAME 'Tahoma' SIZE 0, -14 BOLD
DEFINE DIALOG oDlg ;
TITLE "test folder size" ;
SIZE 960,nHeight PIXEL TRUEPIXEL ; // RESIZABLE
COLOR CLR_BLACK, nRgb( 245,244,234)
DEFINE BUTTONBAR oBarDialog OF oDlg SIZE 80, 80 2015 BOTTOM NOBORDER
DEFINE BUTTON oBtnAnnulla OF oBarDialog ;
FILENAME "no.png";
PROMPT "Annulla" TOOLTIP "Esci" ;
ACTION ( oDlg:end( IDCANCEL ) )
DEFINE BUTTON oBtnAiuto OF oBarDialog ;
FILENAME "Aiuto.png";
PROMPT "Aiuto" TOOLTIP "Aiuto" ;
ACTION NIL GROUP
DEFINE BUTTON oBtnConferma OF oBarDialog BTNRIGHT ;
FILENAME "ok.png";
PROMPT "Conferma" ;
TOOLTIP "Conferma i dati" ;
ACTION ( oDlg:end( IDOK ) )
oBarDialog:bClrGrad := { | lPressed | If( ! lPressed,;
{ { 1, nRgb(233,229,206),nRgb(233,229,206) } },;
{ { 1, nRgb( 245,244,234), nRgb( 245,244,234) } } ) }
@3,0 FOLDEREX oFolder PROMPTS "Azienda","Generale","Contabilità","Articoli e Documenti","Vendita touch","Riparazioni" ;
SIZE oDlg:nWidth,oDlg:nHeight-oBarDialog:nheight PIXEL ;
FONT oFontDialog ;
COLOR nRgb( 245,244,234)
oFolder:bAction := { || IF(oFolder:nOption=3 .or. oFolder:nOption=6 ,oDlg:nHeight:=400,oDlg:nHeight:=nHeight) }
oDlg:bResized := <||
local oRect := oDlg:GetCliRect()
oFolder:nTop := oRect:ntop+10
oFolder:nHeight := oRect:nbottom-110
oFolder:nWidth := oRect:nWidth
oBarDialog:GoDown()
oBarDialog:refresh()
return nil
>
ACTIVATE DIALOG oDlg CENTER ;
ON INIT ( EVAL( oDlg:bResized),;
ChangeButtons( oBarDialog ),oBarDialog:refresh())
RETURN NIL
//-------------------------------------------------------------------------//
function ChangeButtons( oBar )
AEval( oBar:aControls, { | oCtrl | oCtrl:nTop += 4, oCtrl:nHeight -= 4 } )
return .T
If I press the folder 6
PROBLEM
the problem I have on init is I not see the buttonbar down
If I select a tab then I see the buttonbar
how I can resolve ?