Correct use of DC_GETOPTDEFAULT
Correct use of DC_GETOPTDEFAULT
I'm trying to remove all min/max buttons.
If I use just DC_GetOptDefaults() or use an OPTIONS CLAUSE in DCREAD they are removed in a window.
If I use NOMINBUTTON and NOMAXBUTTON in DC_GetOptDefaults() and also use an OPTIONS clause in the DCREAD they are not removed.
What is the correct way to use DC_GetOptDefaults() ?
// This does not remove min/max buttons:
DCGETOPTIONS ;
NOMINBUTTON ;
NOMAXBUTTON
DC_GETOPTDEFAULT(GetOptions)
DCGETOPTIONS ;
NOBUSYPOINTER ;
AUTORESIZE
DCREAD GUI FIT ;
APPWINDOW @oDialog ;
OPTIONS GetOptions ;
EVAL {|o| SetAppWindow(o) }
If I use just DC_GetOptDefaults() or use an OPTIONS CLAUSE in DCREAD they are removed in a window.
If I use NOMINBUTTON and NOMAXBUTTON in DC_GetOptDefaults() and also use an OPTIONS clause in the DCREAD they are not removed.
What is the correct way to use DC_GetOptDefaults() ?
// This does not remove min/max buttons:
DCGETOPTIONS ;
NOMINBUTTON ;
NOMAXBUTTON
DC_GETOPTDEFAULT(GetOptions)
DCGETOPTIONS ;
NOBUSYPOINTER ;
AUTORESIZE
DCREAD GUI FIT ;
APPWINDOW @oDialog ;
OPTIONS GetOptions ;
EVAL {|o| SetAppWindow(o) }
Last edited by GeneB on Mon Jul 21, 2014 9:17 am, edited 1 time in total.
Re: Correct use of DC_GETOPTDEFAULT
Hi, Gene.
Mostly correct.
If I set NOMIN-/NOMAXBUTTON there (at app start), no dialog has min- or maxbuttons anymore, even if they have own DCGET OPTIONS.
Mostly correct.
Code: Select all
FUNCTION SetDefOptions()
LOCAL GetOptions := {}
DCGET OPTIONS ...
DC_GetOptDefault(GetOptions)
RETURN NIL
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Re: Correct use of DC_GETOPTDEFAULT
Gene -
Unfortunately, the NOMINBUTTON and NOMAXBUTTON clauses do not work on non-modal windows.
This is a limitation of Windows.
Roger
Unfortunately, the NOMINBUTTON and NOMAXBUTTON clauses do not work on non-modal windows.
This is a limitation of Windows.
Roger
The eXpress train is coming - and it has more cars.
Re: Correct use of DC_GETOPTDEFAULT
Thank you both. That explains why it wouldn't work. Few of my windows are modal.
I found that I can use Tom's SetDefOptions() just prior to DCREAD GUI in each window and it works for that window.
Was tedious to change every DCREAD, but now inside SetDefOptions I have a system side user selectable option of whether to show min/max or not.
When my users would minimize a window, there was no visible toolbar to offer maximize left in the app window. They had to exit the blank app window with 'Escape' and reselect the window for the toolbar to be visible.
Any way to make the toolbar visible immediately after minimize is selected?
I found that I can use Tom's SetDefOptions() just prior to DCREAD GUI in each window and it works for that window.
Was tedious to change every DCREAD, but now inside SetDefOptions I have a system side user selectable option of whether to show min/max or not.
When my users would minimize a window, there was no visible toolbar to offer maximize left in the app window. They had to exit the blank app window with 'Escape' and reselect the window for the toolbar to be visible.
Any way to make the toolbar visible immediately after minimize is selected?
Re: Correct use of DC_GETOPTDEFAULT
Hi, Gene.
It should work for every window created after that. There must be something else inside your app preventing this system from working. Do you use DC_AutoRestoreWindow()?I found that I can use Tom's SetDefOptions() just prior to DCREAD GUI in each window and it works for that window.
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Re: Correct use of DC_GETOPTDEFAULT
Yes, I am using DC_AutoRestoreWindow()
But...
In the test program below, if I set the system defaults the min/max buttons are hidden.
But if I then add an OPTIONS to the DCREAD, the min/max buttons are not hidden.
This is the case whether the window is modal or not.
But...
In the test program below, if I set the system defaults the min/max buttons are hidden.
But if I then add an OPTIONS to the DCREAD, the min/max buttons are not hidden.
This is the case whether the window is modal or not.
Code: Select all
#include "dcdialog.ch"
FUNCTION Main()
local cAcct:=SPACE(4), GetOptions, getlist:={}
SetDefaultOptions()
@ 1,1 DCSAY "Acct" GET cAcct ;
PICTURE "!!!!" ;
SAYSIZE 8 GETSIZE 7
@ 3,1 DCSAY "Type" SAYSIZE 50
//DCGETOPTIONS AUTORESIZE
DCREAD GUI FIT ADDBUTTONS ;
// OPTIONS GetOptions
RETURN NIL
PROC AppSys() ; return
FUNCTION SetDefaultOptions()
local GetOptions
DCGETOPTIONS NOMINBUTTON NOMAXBUTTON
DC_GetOptDefault(GetOptions)
RETURN NIL
Re: Correct use of DC_GETOPTDEFAULT
Initialize GetOptions to an empty array wherever used:
Code: Select all
LOCAL GetOptions := {}
Best regards,
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Tom
"Did I offend you?"
"No."
"Okay, give me a second chance."
Re: Correct use of DC_GETOPTDEFAULT
Of course.
However, making that change in test.prg doesn't change the outcome.
However, making that change in test.prg doesn't change the outcome.
Re: Correct use of DC_GETOPTDEFAULT
It appears that nominbutton and nomaxbutton are the only defaults that won't hold their values in the above example.
I have set their value with a user function for each call of DCREAD, which allows the user to select the buttons or to hide the buttons, so I'll stay with that unless something easier comes along.
Thanks for the help.
I have set their value with a user function for each call of DCREAD, which allows the user to select the buttons or to hide the buttons, so I'll stay with that unless something easier comes along.
Thanks for the help.
-
- Posts: 605
- Joined: Thu Jan 28, 2010 9:11 pm
- Location: Steven Point, Wisconsin USA
- Contact:
Re: Correct use of DC_GETOPTDEFAULT
We disable the maximize button in our application via the EVAL clause of DCREAD. It makes calls to windows functions. You can also do for the minimize button. It might be something like Tom's function does.