Need Autorestore Window in @ .. DCDIALOG
Need Autorestore Window in @ .. DCDIALOG
Could you pls also integrate the Autorestore feature in Dialogs created with @ 1,1, DCDIALOG oWinDlg DrawingArea oDlg
still does not work
This was sent as an email to me by Michael Rudrich.
I am posting it here so it is not forgotten.
still does not work
This was sent as an email to me by Michael Rudrich.
I am posting it here so it is not forgotten.
The eXpress train is coming - and it has more cars.
Re: Need Autorestore Window in @ .. DCDIALOG
Michael -
This works for me:
This works for me:
Code: Select all
#INCLUDE "dcdialog.CH"
FUNCTION Main()
LOCAL GetList[0], oDlg
DC_AutoRestoreWindow( { HKEY_CURRENT_USER, 'Software\Donnay Software\eXpress++\Windows' } )
@ 0,0 DCDIALOG oDlg SIZE 300,300 PIXEL CAPTION 'My test dialog'
DCREAD GUI FIT ADDBUTTONS TITLE 'Some title'
RETURN nil
* ------------
PROC appsys ; return
The eXpress train is coming - and it has more cars.
-
- Posts: 33
- Joined: Wed Jan 27, 2010 10:23 pm
Re: Need Autorestore Window in @ .. DCDIALOG
Hi..
so what is wrong with this construct??
#include "dcdialog.ch"
STATIC oDialog
Procedure APPSYS()
RETURN
Function Main()
Local oHaupt, oSub, GetOptions, ;
GetList := {}, nEvent, mp1, mp2, oXbp, oAppWindow
Public nDialogNummer := 0
GUI ON
DC_AutoRestoreWindow ({HKEY_CURRENT_USER, '\SOFTWARE\Michael\Demo\Fenster'})
// Menu
DCMenuBar oHaupt
DCSubMenu oSub PROMPT "&Action" PARENT oHaupt
DCMenuItem "&Dialog" PARENT oSub;
ACTION {|| o:=Thread():new(),o:Start("Test1",oDialog) }
DCMenuItem "&End" PARENT oSub ;
ACTION {|| PostAppEvent(xbeP_Close) }
DCGETOPTIONS WINDOWHEIGHT 480 ;
WINDOWWIDTH 640 ;
TABSTOP
DCREAD GUI TITLE 'Test++' ;
OPTIONS GetOptions ;
EVAL {|o|SetAppWindow(o),SetAppFocus(o)};
PARENT @oDialog
DC_GetDestroy(Getlist)
RETURN nil
Function Test1(oDialog)
Local oDlg, oDlgWindow, Getlist := {}, lOK := .F.
Local GetOptions, oSession
Local oTabPage1,oTabPage2, oTabPage3
Local cVar1 := space(10)
Local cVar2 := space(10)
Local cVar3 := space(10)
nDialogNummer++
@ 1,1 DCDIALOG oDlgWindow DRAWINGAREA oDlg SIZE 50,17 ;
CAPTION 'Dialog ' + strzero(ThreadId(),2) NOMINBUTTON NORESIZE
@ 1,1 DCTABPAGE oTabPage1 CAPTION 'Tab 1';
SIZE 76,17 PREOFFSET 0 POSTOFFSET 86 PARENT oDlg
@ 0,0 DCTABPAGE oTabPage2 CAPTION 'Tab 2' ;
RELATIVE oTabPage1 PARENT oDlg
@ 0,0 DCTABPAGE oTabPage3 CAPTION 'Tab 3' ;
RELATIVE oTabPage2 PARENT oDlg
@ 2,2 DCSAY "Hello 1" GET cVar1 PARENT oTabPage1
@ 4,2 DCSAY "Hello 2" GET cVar2 PARENT oTabPage1
@ 2,2 DCSAY "Hello 2" GET cVar2 PARENT oTabPage2
@ 2,2 DCSAY "Hello 3" GET cVar3 PARENT oTabPage3
DCGETOPTIONS ;
CHECKGET;
TABSTOP;
CASCADE;
HILITEGETS GRA_CLR_RED NOMINBUTTON NOMAXBUTTON NORESIZE
//AUTORESIZE
DCREAD GUI ;
parent oDialog;
OPTIONS GetOptions;
HANDLER _DlgHandler;
TO lOK
DC_GetDestroy(Getlist)
nDialogNummer--
DbCLoseAll()
DbCommitAll()
RETURN (NIL)
STATIC FUNCTION _DlgHandler ( nEvent, mp1, mp2, oXbp, oDialog, GetList )
IF nEvent = xbeP_Close
RETURN(DCGUI_EXIT_OK)
ENDIF
RETURN DCGUI_NONE
- Michael
so what is wrong with this construct??
#include "dcdialog.ch"
STATIC oDialog
Procedure APPSYS()
RETURN
Function Main()
Local oHaupt, oSub, GetOptions, ;
GetList := {}, nEvent, mp1, mp2, oXbp, oAppWindow
Public nDialogNummer := 0
GUI ON
DC_AutoRestoreWindow ({HKEY_CURRENT_USER, '\SOFTWARE\Michael\Demo\Fenster'})
// Menu
DCMenuBar oHaupt
DCSubMenu oSub PROMPT "&Action" PARENT oHaupt
DCMenuItem "&Dialog" PARENT oSub;
ACTION {|| o:=Thread():new(),o:Start("Test1",oDialog) }
DCMenuItem "&End" PARENT oSub ;
ACTION {|| PostAppEvent(xbeP_Close) }
DCGETOPTIONS WINDOWHEIGHT 480 ;
WINDOWWIDTH 640 ;
TABSTOP
DCREAD GUI TITLE 'Test++' ;
OPTIONS GetOptions ;
EVAL {|o|SetAppWindow(o),SetAppFocus(o)};
PARENT @oDialog
DC_GetDestroy(Getlist)
RETURN nil
Function Test1(oDialog)
Local oDlg, oDlgWindow, Getlist := {}, lOK := .F.
Local GetOptions, oSession
Local oTabPage1,oTabPage2, oTabPage3
Local cVar1 := space(10)
Local cVar2 := space(10)
Local cVar3 := space(10)
nDialogNummer++
@ 1,1 DCDIALOG oDlgWindow DRAWINGAREA oDlg SIZE 50,17 ;
CAPTION 'Dialog ' + strzero(ThreadId(),2) NOMINBUTTON NORESIZE
@ 1,1 DCTABPAGE oTabPage1 CAPTION 'Tab 1';
SIZE 76,17 PREOFFSET 0 POSTOFFSET 86 PARENT oDlg
@ 0,0 DCTABPAGE oTabPage2 CAPTION 'Tab 2' ;
RELATIVE oTabPage1 PARENT oDlg
@ 0,0 DCTABPAGE oTabPage3 CAPTION 'Tab 3' ;
RELATIVE oTabPage2 PARENT oDlg
@ 2,2 DCSAY "Hello 1" GET cVar1 PARENT oTabPage1
@ 4,2 DCSAY "Hello 2" GET cVar2 PARENT oTabPage1
@ 2,2 DCSAY "Hello 2" GET cVar2 PARENT oTabPage2
@ 2,2 DCSAY "Hello 3" GET cVar3 PARENT oTabPage3
DCGETOPTIONS ;
CHECKGET;
TABSTOP;
CASCADE;
HILITEGETS GRA_CLR_RED NOMINBUTTON NOMAXBUTTON NORESIZE
//AUTORESIZE
DCREAD GUI ;
parent oDialog;
OPTIONS GetOptions;
HANDLER _DlgHandler;
TO lOK
DC_GetDestroy(Getlist)
nDialogNummer--
DbCLoseAll()
DbCommitAll()
RETURN (NIL)
STATIC FUNCTION _DlgHandler ( nEvent, mp1, mp2, oXbp, oDialog, GetList )
IF nEvent = xbeP_Close
RETURN(DCGUI_EXIT_OK)
ENDIF
RETURN DCGUI_NONE
- Michael
Re: Need Autorestore Window in @ .. DCDIALOG
What happens if you remove CASCADE from DCGETOPTIONS ?
The eXpress train is coming - and it has more cars.
-
- Posts: 33
- Joined: Wed Jan 27, 2010 10:23 pm
Re: Need Autorestore Window in @ .. DCDIALOG
Hi (from China)
same behaviour when I remove CASCADE
- Michael
same behaviour when I remove CASCADE
- Michael
Re: Need Autorestore Window in @ .. DCDIALOG
I wonder if the handler is interfering with the code that saves the coords.
You should see an entry in your registry under HKEY_CURRENT_USER\SOFTWARE\Michael\Demo\Fenster\Windows.
It will have the same name as the title (caption) of the window.
You should see an entry in your registry under HKEY_CURRENT_USER\SOFTWARE\Michael\Demo\Fenster\Windows.
It will have the same name as the title (caption) of the window.
The eXpress train is coming - and it has more cars.
-
- Posts: 33
- Joined: Wed Jan 27, 2010 10:23 pm
Re: Need Autorestore Window in @ .. DCDIALOG
Hi --
sorry, no entry...
- Michael
sorry, no entry...
- Michael
-
- Posts: 33
- Joined: Wed Jan 27, 2010 10:23 pm
Re: Need Autorestore Window in @ .. DCDIALOG
Hi again:
Could you compile and run the code?
So you might find out what's wrong..
- Michael
Could you compile and run the code?
So you might find out what's wrong..
- Michael
Re: Need Autorestore Window in @ .. DCDIALOG
Hallo Michael,
Remove the "\" from before the "SOFTWARE"
i.e.
was:
DC_AutoRestoreWindow ({HKEY_CURRENT_USER, '\SOFTWARE\Michael\Demo\Fenster'})
Should be:
DC_AutoRestoreWindow ({HKEY_CURRENT_USER, 'SOFTWARE\Michael\Demo\Fenster'})
Rick
Remove the "\" from before the "SOFTWARE"
i.e.
was:
DC_AutoRestoreWindow ({HKEY_CURRENT_USER, '\SOFTWARE\Michael\Demo\Fenster'})
Should be:
DC_AutoRestoreWindow ({HKEY_CURRENT_USER, 'SOFTWARE\Michael\Demo\Fenster'})
Rick
-
- Posts: 33
- Joined: Wed Jan 27, 2010 10:23 pm
Re: Need Autorestore Window in @ .. DCDIALOG
Hey Rick -
that does it!!!
Thank you..
man - what a trivial bug (
Thanks
- Michael
that does it!!!
Thank you..
man - what a trivial bug (
Thanks
- Michael