Default flag parameters for OpenWindow

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Default flag parameters for OpenWindow

Post 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.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post 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...
oh... and have a nice day.
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

Post 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. :wink:

c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post 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.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Derek
Addict
Addict
Posts: 2354
Joined: Wed Apr 07, 2004 12:51 am
Location: England

Post 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. :wink:

Not the same as a default but pretty close.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

> just use $CA0001

True, I'll add this to my Residents file as a constant. Good idea! :)
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post 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
bhatkins2000
New User
New User
Posts: 9
Joined: Fri Apr 28, 2006 4:20 pm
Location: Missouri

FLAGS

Post 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.
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Re: FLAGS

Post 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.
--Kale

Image
User avatar
Joakim Christiansen
Addict
Addict
Posts: 2452
Joined: Wed Dec 22, 2004 4:12 pm
Location: Norway
Contact:

Post 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...
I like logic, hence I dislike humans but love computers.
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Post 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.
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post 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!
oh... and have a nice day.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post 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.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post 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.
oh... and have a nice day.
Post Reply