SetMaxWindowSize - with maximize window button?

BlitzMax Forums/MaxGUI Module/SetMaxWindowSize - with maximize window button?

Grisu(Posted 2010) [#1]
Hi there!

SetMaxWindowSize:
Calling this function will disable the Maximize button window hint.

Why that? Can't the window be maximised to the values of SetMaxWindowSize instead (when the button is used)?

Example:


^ In this example the window should be enlarged to MAINWINDOW_W,MAINWINDOW_H*2.

Is this possible?

Grisu


SebHoll(Posted 2010) [#2]
Can't the window be maximised to the values of SetMaxWindowSize instead

On Windows, 'maximized' is a state of a window (not just the size) which affects its behaviour and window frame. Remember that a maximized window on Windows behaves slightly differently to a window that is the same size as the desktop. The Microsoft Human Interface Guidelines (HIG) dictate that a maximized window is one that takes up an entire screen so if you set a maximum window size, the window shouldn't be able to enter into a maximized state. And programatically trying to maximize a window with a max size set makes it go into this strange limbo maximized state:
' createwindow.bmx

Import MaxGui.Drivers

Strict 

Local window:TGadget

window=CreateWindow("My Window",40,40,320,240)
SetMaxWindowSize(window,640,480)

MaximizeWindow window

While True
	WaitEvent 
	Print CurrentEvent.ToString()
	Select EventID()
		Case EVENT_WINDOWCLOSE
			End
	End Select
Wend

On Mac OS X, this isn't the case: the OS has no concept of a maximized window. The (+) pill in a window titlebar (known as 'Zoom') is supposed to "make the window the largest it should be for its contents". This subtlety can be rather annoying for long-established Windows users who venture onto the Mac for the first time. Anyhoo, on Mac, setting a maximum window size doesn't affect this button state, and all that happens is that clicking it has exactly the behaviour you requested. On OS X, that is what the 'Zoom' button is supposed to be there for.

In short, we need to respect the conventions for the platforms we are running on. If we got MaxGUI to do what you are requesting, we would have to hack into the window manager hooks and override the default Windows behaviour to make the maximize button no longer maximize, but instead, resize. A well behaved app. shouldn't really be doing that, and if I was using an app that didn't maximize when I click the maximize button, I would be a little confused.

Hopefully I've explained it clearly. I'm notoriously bad at these things. :P