[Implemented] Constants for network events

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

Missing constants added.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

Fred wrote:
Trond wrote:or something, so that you didn't have to type everything everytime. It would of course also be nice if constants could be removed from the chain, for example if you could remove #PB_Window_ScreenCentered and add #PB_Window_WindowCentered (this may already be possible for all I know).
Yes, you can using the xor binary operator:

Code: Select all

#PB_Window_Standard = #PB_Window_MaximizeGadget | #PB_Window_ScreenCentered | #PB_Window_SizeGadget | #PB_Window_SystemMenu | #PB_Window_MinimizeGadget

OpenWindow(0, 0, 0, 640, 480, #PB_Window_Standard & ~#PB_Window_SizeGadget, "Test")

Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
1. That's not the xor binary operator. This is the xor binary operator: !
2. It doesn't work:

Code: Select all

#PB_Window_Standard = #PB_Window_MaximizeGadget | #PB_Window_ScreenCentered | #PB_Window_SizeGadget | #PB_Window_SystemMenu | #PB_Window_MinimizeGadget 

OpenWindow(0, 0, 0, 640, 480, #PB_Window_Standard & ~#PB_Window_MaximizeGadget, "Test") 

Repeat 
Until WaitWindowEvent() = #PB_Event_CloseWindow
3. The xor binary operator (which I tested before posting) doesn't work either:

Code: Select all

#PB_Window_Standard = #PB_Window_MaximizeGadget | #PB_Window_ScreenCentered | #PB_Window_SizeGadget | #PB_Window_SystemMenu | #PB_Window_MinimizeGadget 

OpenWindow(0, 0, 0, 640, 480, #PB_Window_Standard ! #PB_Window_MaximizeGadget, "Test") 

Repeat 
Until WaitWindowEvent() = #PB_Event_CloseWindow
So what did you mean, because it would be interresting to know. :)
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

Fred wrote:Missing constants added.
Thank you.
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

Post by nco2k »

perhaps this?

Code: Select all

#PB_Window_Standard = #PB_Window_SystemMenu ! #PB_Window_SizeGadget ! #PB_Window_MinimizeGadget ! #PB_Window_MaximizeGadget 

OpenWindow(0, 0, 0, 640, 480, #PB_Window_Standard | #PB_Window_ScreenCentered, "Test") 

Repeat 
Until WaitWindowEvent() = #PB_Event_CloseWindow
c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

That's ADDING to the constant, not removing from it.
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

true, it's the 'not' operator. May be it doesn't work because Maximize is a combined constant. Theorically, it should work tough.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

But it doesn't.
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

Maximize is defined like this, that's why it doesn't work:

Code: Select all

#PB_Window_MaximizeGadget = $10000 | #PB_Window_TitleBar | #PB_Window_SystemMenu
.
Intrigued
Enthusiast
Enthusiast
Posts: 501
Joined: Thu Jun 02, 2005 3:55 am
Location: U.S.A.

Post by Intrigued »

Fred wrote:
Trond wrote:or something, so that you didn't have to type everything everytime. It would of course also be nice if constants could be removed from the chain, for example if you could remove #PB_Window_ScreenCentered and add #PB_Window_WindowCentered (this may already be possible for all I know).
Yes, you can using the xor binary operator:

Code: Select all

#PB_Window_Standard = #PB_Window_MaximizeGadget | #PB_Window_ScreenCentered | #PB_Window_SizeGadget | #PB_Window_SystemMenu | #PB_Window_MinimizeGadget

OpenWindow(0, 0, 0, 640, 480, #PB_Window_Standard & ~#PB_Window_SizeGadget, "Test")

Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
Useful, thanks for sharing this a ways back!
Intrigued - Registered PureBasic, lifetime updates user
Post Reply