I have a dialog with a folder
depending on whether the user presses a tab the dialgog must change the height ( init 680),
When the user press the tab 3 or tab 6 the dialog must be of 400 height
the other the dialog must be 680 height
I need it because it is possible that in some tabs I do not put some information while in others the information is more than the others
it is possible that in some tabs I do not put some information while in others the information is more than the others
the problem is that when I press a tab the dialog moves up each time
i.e. it does not remain in the initial coordinates i.e. the dialog must always be in one point only the height must change according to the folder tab that is pressed
the sample code
- Code: Select all Expand view RUN
#include "fivewin.ch"
FUNCTION Main()
local oBrush, oFont
DEFINE FONT oFont NAME "TAHOMA" SIZE 0,-12
DEFINE BRUSH oBrush RESOURCE "background"
DEFINE WINDOW oWndMain TITLE "Moduli" MDI MENU BuildMenu() VSCROLL HSCROLL BRUSH oBrush
oWndMain:SetFont( oFont )
BuildMainBar()
DEFINE MSGBAR PROMPT "Easyrep app" ;
OF oWndMain 2015 KEYBOARD DATE
ACTIVATE WINDOW oWndMain MAXIMIZED
RELEASE BRUSH oBrush
Return nil
//-------------------------------------------------------------------------------//
static function BuildMenu()
local oMenu
MENU oMenu
MENUITEM "Tasks"
MENU
MENUITEM "Moduli" ACTION NIL
MENUITEM "Clients" ACTION NIL
MENUITEM "Items" ACTION NIL
SEPARATOR
MENUITEM "Exit" ACTION oWndMain:End()
ENDMENU
oMenu:AddMDI()
oMenu:AddHelp( " app", "(c) FiveTech Software" )
ENDMENU
return oMenu
//-------------------------------------------------------------------------------//
static function BuildMainBar()
* local oBar
DEFINE BUTTONBAR oBar OF oWndMain 2013 SIZE 70, 60 //70
DEFINE BUTTON OF oBar PROMPT "Config" RESOURCE "BTN_CONFIG" ;
ACTION Config()
return nil
//----------------------------------//
Function Config()
local oDlg,oFolder
local oFontDialog,oFontBold
local oBarDialog
local nHeight:= 680
local aFolder := {"Azienda","Generale","Contabilità","Articoli e Documenti","Vendita touch","Riparazioni"}
local oIcon
DEFINE FONT oFontDialog NAME 'Tahoma' SIZE 0, -14
DEFINE FONT oFontBold NAME 'Tahoma' SIZE 0, -14 BOLD
DEFINE DIALOG oDlg ;
TITLE "Configurazione" ;
SIZE 870,nHeight PIXEL TRUEPIXEL ; // RESIZABLE
COLOR CLR_BLACK, nRgb( 245,244,234) FONT oFontDialog ICON oIcon
DEFINE BUTTONBAR oBarDialog OF oDlg SIZE 80, 80 2015 BOTTOM NOBORDER
@0,0 FOLDEREX oFolder PROMPTS aFolder ;
SIZE oDlg:nWidth,oDlg:nHeight-oBarDialog:nheight PIXEL ;
FONT oFontDialog ;
COLOR nRgb( 245,244,234) ROUND 0
oFolder:bAction := { || IF(oFolder:nOption=3 .or. oFolder:nOption=6 ,oDlg:nHeight:=400,oDlg:nHeight:=680 ) }
oDlg:bResized := <||
local oRect := oDlg:GetCliRect()
oFolder:nTop := oRect:ntop+10
oFolder:nHeight := oRect:nbottom-90
oFolder:nWidth := oRect:nWidth
oBarDialog:GoDown()
oBarDialog:refresh()
return nil
>
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT ( Eval( oDlg:bResized),;
oBarDialog:refresh(),;
Eval(oFolder:baction) )
RETURN NIL