Minimize main app window vs. modal
Minimize main app window vs. modal
Hi,
My problem : I have main app window with menu, toolbar... from it was called other windows which are modal
It is OK, because I do not want to open several windows but only one for work.
But I want minimize application with minimize button. It is not possible if some modal window is open.
How can do it ?
this is used for main application window
...
DCGETOPTIONS WINDOWWIDTH aSize[1] ;
WINDOWHEIGHT aSize[2] ;
WINDOWCOL aPos[1] ;
WINDOWROW aPos[2] ;
BITMAP oBitmap ;
ICON ICON_EXPRESS ;
NOBUSY ;
FONT fontnt ;
EVAL { || SetAppWindow(oMenuBarh), ;
oTimer1 := DC_SetTimerEvent():new( 10,{ || _UpdateStats(GetList) } )}
DCREAD GUI SETAPPWINDOW ;
OPTIONS GetOptions
...
and this is other window
...
DCGETOPTIONS PIXEL ;
WINDOWCOL aPosx+5 ;
WINDOWROW aPosy+5 ;
WINDOWWIDTH aSize[1]*0.98 ;
WINDOWHEIGHT aSize[2]*0.95 ;
TABSTOP AUTORESIZE ;
SAYWIDTH 0 ;
FONT fontnt
DCREAD GUI ;
OPTIONS GetOptions ;
TITLE "[ ZMENOVÉ ZÁZNAMY] - [ "+nazku+" ] - [ "+nazovdbf20+" ]" ;
MODAL ;
EVAL {|o|SetAppFocus(oBrowsezz:GoTop())}
My problem : I have main app window with menu, toolbar... from it was called other windows which are modal
It is OK, because I do not want to open several windows but only one for work.
But I want minimize application with minimize button. It is not possible if some modal window is open.
How can do it ?
this is used for main application window
...
DCGETOPTIONS WINDOWWIDTH aSize[1] ;
WINDOWHEIGHT aSize[2] ;
WINDOWCOL aPos[1] ;
WINDOWROW aPos[2] ;
BITMAP oBitmap ;
ICON ICON_EXPRESS ;
NOBUSY ;
FONT fontnt ;
EVAL { || SetAppWindow(oMenuBarh), ;
oTimer1 := DC_SetTimerEvent():new( 10,{ || _UpdateStats(GetList) } )}
DCREAD GUI SETAPPWINDOW ;
OPTIONS GetOptions
...
and this is other window
...
DCGETOPTIONS PIXEL ;
WINDOWCOL aPosx+5 ;
WINDOWROW aPosy+5 ;
WINDOWWIDTH aSize[1]*0.98 ;
WINDOWHEIGHT aSize[2]*0.95 ;
TABSTOP AUTORESIZE ;
SAYWIDTH 0 ;
FONT fontnt
DCREAD GUI ;
OPTIONS GetOptions ;
TITLE "[ ZMENOVÉ ZÁZNAMY] - [ "+nazku+" ] - [ "+nazovdbf20+" ]" ;
MODAL ;
EVAL {|o|SetAppFocus(oBrowsezz:GoTop())}
Re: Minimize main app window vs. modal
If you have a pointer to the main window as a variable, you can minimize it this way:
oMainWindow:setFrameState( XBPDLG_FRAMESTAT_MAXIMIZED )
oMainWindow:setFrameState( XBPDLG_FRAMESTAT_MAXIMIZED )
The eXpress train is coming - and it has more cars.
Re: Minimize main app window vs. modal
Hi,
Please, I do not know how can I do it ?
I have main window , and other windows are modal. Other windows must be modal. I want minimalize main window with all "child" windows.
I used eXpress functions (DCREAD, DCGETOPTIONS, DCSTATIC...for menus, ..)
If I have open application, and some other "child" window which is modal, and click to minimalize button, then mail windows blinking, and cannot minimalize.
I must create some object for main window ?
Thanks
Please, I do not know how can I do it ?
I have main window , and other windows are modal. Other windows must be modal. I want minimalize main window with all "child" windows.
I used eXpress functions (DCREAD, DCGETOPTIONS, DCSTATIC...for menus, ..)
If I have open application, and some other "child" window which is modal, and click to minimalize button, then mail windows blinking, and cannot minimalize.
I must create some object for main window ?
Thanks
Re: Minimize main app window vs. modal
Your main window already IS an object. You only need to have a variable that points to the object.I must create some object for main window ?
This is one way to do it. You can use a PUBLIC variable:
PUBLIC oMainWindow
// This is the DCREAD GUI that creates your main window:
DCREAD GUI EVAL {|o|oMainWindow := o}
Then you can minimize the main window, anywhere in the program with:
oMainWindow:setFrameState( XBPDLG_FRAMESTAT_MINIMIZED )
You can set it back again to normal state with:
oMainWindow:setFrameState( XBPDLG_FRAMESTAT_NORMALIZED )
The eXpress train is coming - and it has more cars.
Re: Minimize main app window vs. modal
Hi,
I tryed this, but how can I maximize this main windows again , if no other window is open ?
Main window disappear, and I not see any on bar, and also on screen.
I want to minimize main window to bottom bar.
Maybe is any mistake in my source.
A reason is, user run application, set some parameters and run some process, which running long time, minimize this application, and work anything other for example write in word. After time maximize application and continue.
I want try disable MODAL parameter and also disable MIN and MAX buttons to prevent user to close child windows.
I tryed this, but how can I maximize this main windows again , if no other window is open ?
Main window disappear, and I not see any on bar, and also on screen.
I want to minimize main window to bottom bar.
Maybe is any mistake in my source.
A reason is, user run application, set some parameters and run some process, which running long time, minimize this application, and work anything other for example write in word. After time maximize application and continue.
I want try disable MODAL parameter and also disable MIN and MAX buttons to prevent user to close child windows.
Re: Minimize main app window vs. modal
There is no reason that your main window should disappear.
It should be showing on taskbar unless you are using NOTASKBAR in your DCGETOPTIONS.
I need to see some of your code.
It should be showing on taskbar unless you are using NOTASKBAR in your DCGETOPTIONS.
I need to see some of your code.
The eXpress train is coming - and it has more cars.
Re: Minimize main app window vs. modal
here is part of source, in INFOKAT.PRG is MAIN. from it is calling APPMENU2 .
After select MENUITEM is calling WIC() in IK12.PRG
I left there only the most important part, to see, how I opening window.
Please, look to it, if you have little time
After select MENUITEM is calling WIC() in IK12.PRG
I left there only the most important part, to see, how I opening window.
Please, look to it, if you have little time
Re: Minimize main app window vs. modal
Did you intend to attach a file?
The eXpress train is coming - and it has more cars.
Re: Minimize main app window vs. modal
sorry, here is attach file, 

- Attachments
-
- ModalAppWin.zip
- (2.84 KiB) Downloaded 669 times
Re: Minimize main app window vs. modal
I made a few changes to your source code.
I could not compile and run it because there is a lot missing but I think these changes will work for you.
1. Your WIC() window should NOT be a Modal window. Instead, it should be a child window of the main window. Also, it should be running in its own thread. I made the following changes to accomplish this:
Run in new thread and pass the drawingArea of the main window.
Remove EVAL clause of DCGETOPTIONS. Add EVAL clause to DCREAD GUI.
Receive a pointer to the main window drawingArea as oAppWindow
Make this window a child of oAppWindow. Cannot be MODAL.
I could not compile and run it because there is a lot missing but I think these changes will work for you.
1. Your WIC() window should NOT be a Modal window. Instead, it should be a child window of the main window. Also, it should be running in its own thread. I made the following changes to accomplish this:
Run in new thread and pass the drawingArea of the main window.
Code: Select all
DCMENUITEM "&B-Parcely registra C" PARENT oUdajeKatastra ;
ACTION {||o := Thread():new(), ;
o:start({||Zvku(),Wic(oDlg:drawingArea),unblokokno()})}
Code: Select all
DCGETOPTIONS WINDOWWIDTH aSize[1] ;
WINDOWHEIGHT aSize[2] ;
WINDOWCOL aPos[1] ;
WINDOWROW aPos[2] ;
BITMAP oBitmap ;
ICON ICON_EXPRESS ;
NOBUSY ;
FONT fontnt ;
;// EVAL { |o|oDlg SetAppWindow(oMenuBarh), ;
;// oTimer1 := DC_SetTimerEvent():new( 100,{ || _UpdateStats(GetList) } )}
DCREAD GUI SETAPPWINDOW ;]
TITLE "INFOKAT Win"+verzia ;
OPTIONS GetOptions ;
EVAL {|o|oDlg := o, ;
oTimer1 := DC_SetTimerEvent():new( 100,{ || _UpdateStats(GetList) }
Code: Select all
FUNCTION wic( oAppWindow )
Code: Select all
DCREAD GUI ;
OPTIONS GetOptions ;
TITLE "[ PARCELY REGISTRA C ] - [ "+nazku+" ] - [ "+nazovdbf1+" ]" ;
;// MODAL ;
APPWINDOW oAppWindow ;
EVAL {|o| ;
SetAppFocus(oBrowsepa:GetColumn(1)),;
oBrowsepa:RefreshAll(),;
oBrowsevl:RefreshAll(),;
oBrowsecs:RefreshAll(),;
if(zoompor=.T.,({oBrowsepa_a:RefreshAll()}),({})) ;
- Attachments
-
- ModalAppWin.zip
- (2.92 KiB) Downloaded 692 times
The eXpress train is coming - and it has more cars.