Game Development Community

How to get Min/max/close widgets to show on window?

by Peter Siedle · in General Discussion · 01/27/2006 (4:26 am) · 2 replies

Hi Guys

does anyone know how to get the minimize / maximize / close control widgets to appear in the torque application window?

I guess it's in a script pref file somewhere, but can't seem to track it down!
I've also done a search of the forums, but with no luck.

Anyway, thanks in advance for any help

Cheers

Pete

------latest------

Okay so I added '| WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX' to the 'windowstyle' var used in the various 'CreateWindow' func's of the demo tutorail app!
Re-compiled and the app's now have the min / max / close widgets :o)

Now I just have to sus out how to get the app to fill the whole window when maximized!?!?!?
Anyone?

Guess this should really now be in the programming forum >:o|

-----a solution for fullscreen with no window frame----
just pick up the MAXIMIZE widget press & use the provided toggleFullScreen func:
case WM_SYSCOMMAND:
switch(wParam)
{
case SC_MAXIMIZE:
Video::toggleFullScreen();
break;

-------a solution, to max the window & still have the window frame------
in winWindow.cc

added at the top:
static bool mOnResize = false;

then in WindowProc func added:

case WM_SYSCOMMAND:
switch(wParam)
{
case SC_RESTORE:
mOnResize = true; // make resize in WM_SIZE event
break;

case SC_MAXIMIZE:
mOnResize = true; // make resize in WM_SIZE event
break;

......leave rest as is.....

added a WM_SIZE case:
case WM_SIZE:
{
if(mOnResize)
{
mOnResize = false;

RECT rcClient;
GetClientRect( hWnd, &rcClient );

Video::setResolution((U32) (rcClient.right - rcClient.left),
(U32) (rcClient.bottom - rcClient.top),
DisplayDevice::getResolution().bpp);

}
}
break;

For some reason the setScreenMode methods in winOGLVideo & winD3DVideo don't let you resize a window to max resolution, so to get it to do it you need to change the line at about 645 & 231 respectively from:

if ( !newFullScreen && ( newRes.w >= winState.desktopWidth || newRes.h >= winState.desktopHeight ) )
{

to

if ( !newFullScreen && ( newRes.w > winState.desktopWidth || newRes.h > winState.desktopHeight ) )
{

then all seems to work okay.

I know this post is in the wrong forum, but thought I'd furnish my solution for those interested.
Can this post be moved to programming forum!?!?? I'd do it myself but this doesn't seem to be an available option in the edit tools.

Cheers & hope someone finds this of help

Pete

#1
01/27/2006 (10:35 am)
Should have been in the public forum to begin with. This is not a torque forum.

I would make a function that changes the resolution based on if you maximize it or not. Check what max res is of the desktop, change res and repaint canvas.
#2
01/27/2006 (9:11 pm)
@Peter: Track down the 'apply' button on the options dialog in game. We know that button redraws the window and activates the new size. So, that would be a good place to start.

B--