Page 1 of 1
Default flag parameters for OpenWindow
Posted: Sun Apr 08, 2007 3:58 am
by PB
The docs say for OpenWindow say:
If the optional Flags parameter is not specified, #PB_Window_SystemMenu will be used.
Can I request that this has a couple of additional default flags, specifically:
#PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_MinimizeGadget
The reason being is that 99% of apps with a window have a Minimize gadget,
so it'd be handy to have it there for the user's convenience, and opening in
the center of the Desktop is always nice too. What do you think? If anyone
doesn't want these as defaults then they can always specify their desired
flags themselves.
Posted: Sun Apr 08, 2007 8:23 am
by Kaeru Gaman
I think it's a good idea. agree with the 99% assumption...
BTW
do the PB-Constants really every StatusBit avaliable CrossPlatform?
...I think there are a few StatusBits under windows that are currently not PB-supported
(only by the constants, of course you can use API-constants)
and there are StatusBits supported in combination that are not supported single...
Posted: Sun Apr 08, 2007 8:26 am
by nco2k
we had this discussion already once and came to the conclusion, that there is absolutely no point in overriding the x, y parameters by default. as for the #PB_Window_MinimizeGadget, everyone has a different taste, some would like a min, others a min+max and others a max only. because of that, i think having only #PB_Window_SystemMenu is a good choice. i also doubt that this feature was meant as a replacement for the flags, but more like an easy and fast way to test some code, without the need for extra typing.
c ya,
nco2k
Posted: Sun Apr 08, 2007 10:53 am
by PB
> [this feature was] more like an easy and fast way to test some code,
> without the need for extra typing
Agreed, which is why I like the extra flags that I mentioned. It means I don't
have to specify an X/Y position, which, if left to the Windows default, usually
makes my window underneath something else, such as the Debugger window.
Then I have to drag my test window out, which is annoying; or specify precise
X/Y positions (such as 200,200) to ensure my Debugger doesn't cover it.
> there is absolutely no point in overriding the x, y parameters by default
True, I forgot about that.
Posted: Sun Apr 08, 2007 1:00 pm
by Derek
I know that you will know this but you can always just use $CA0001 instead of the three flags you mention, saves a bit of typing.
Not the same as a default but pretty close.
Posted: Sun Apr 08, 2007 2:53 pm
by PB
> just use $CA0001
True, I'll add this to my Residents file as a constant. Good idea!

Posted: Sun Apr 08, 2007 8:43 pm
by Trond
How about something like #PB_Window_All or #PB_Window_Testing that included all "positive" flags (i.e. not invisible and borderless)? So #PB_Window_All = #PB_Window_ScreenCentered | #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget
FLAGS
Posted: Wed Jun 20, 2007 4:49 am
by bhatkins2000
I'm fairly new to PB. It seems that there is tremendous power in using the right flags with the code. Where do I find out that kind of info?
Thanks.
Re: FLAGS
Posted: Wed Jun 20, 2007 8:04 am
by Kale
bhatkins2000 wrote:I'm fairly new to PB. It seems that there is tremendous power in using the right flags with the code. Where do I find out that kind of info?
Thanks.
In the Help File.
Posted: Fri Dec 12, 2008 4:59 am
by Joakim Christiansen
I think the default parameters now are plain silly (I have never used them), why can't we just have this (as PB suggested)?
Code: Select all
#PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_MinimizeGadget
Anyone else agree with me? I always end up writing them manually anyway...
Posted: Fri Dec 12, 2008 5:43 am
by Mistrel
If new windows used the #PB_Window_ScreenCentered parameter by default then we will need a new parameter "#PB_Window_NotScreenCentered". It's the programmer's responsibility to specify the flags they want.
Posted: Fri Dec 12, 2008 1:02 pm
by Kaeru Gaman
since the topic is popped again, I got to revise my old posting:
meanwhile for me ScreenCentered is no defaultlike parameter anymore.
I rather use #PB_Ignore for the Coordinates.
so, I'm happy with SystemMenu being default!
Posted: Fri Dec 12, 2008 1:39 pm
by PB
> If new windows used the #PB_Window_ScreenCentered parameter by
> default then we will need a new parameter "#PB_Window_NotScreenCentered"
No, because the idea is that if you specify an X,Y position then it uses that,
and ignores the #PB_Window_ScreenCentered flag in that case. Otherwise,
you can use #PB_Ignore for X,Y and the window will be centred automatically.
Posted: Fri Dec 12, 2008 1:57 pm
by Kaeru Gaman
> No, because the idea is that if you specify an X,Y position then it uses that,
> and ignores the #PB_Window_ScreenCentered flag in that case. Otherwise,
> you can use #PB_Ignore for X,Y and the window will be centred automatically.
that is not possible!
a set ScreenCentered-Flag will ignore the coordinates, also Ignore-Coordinates.
an Ignore for the Coordinates without ScreenCentered will place the Window on the actual cascaded position.
this topic is about altering the default flag,
not about changing the default behaviour reacting to the flags.
the latter is not at all possible because it's an OS issue.