Capturing Previous Size Before Maximize Topic is solved
Capturing Previous Size Before Maximize
Hi. I'm trying to capture the previous size before my frame is maximized. I tried the EVT_MAXIMIZE, but it maximizes first, then gives me the size. The reason I want this is so when the program starts up and if the window is maximized, I can make the restore position the old size before it was maximized.
Yeah, the problem is that, when I close my app I save the size and stuff. But, let's say the windows is maximized. The saved size will be some big size and when I restart the program, it will be maximized, but the restore simply "slightly" sizes it lower than maximized. But, there may be an easier way to do this...
Hi, dude. The evt size isn't working either. It appears the function is called after the size change takes place. For instance, when my window is 800 x 600 and I maximized, by the time the evt size is called, it's already 1000 x 700 something or so. I need to get the size before it takes effect to the maximized size...
Usually it helps to read the relevant docs when trying to implement something. If you do a search for "size" in wxWindow docs you'll get a bunch of results that I think are very relevant:
DoGetBestSize()
GetEffectiveMinSize()
GetBestSize()
and even SetInitialSize might help.
My advice: read, try, take a while before giving up.
DoGetBestSize()
GetEffectiveMinSize()
GetBestSize()
and even SetInitialSize might help.
My advice: read, try, take a while before giving up.
Hi, Catalin. I want the size it was previously, regardless of what the program thinks is good. I read in MFC I need to look into an OnSizing() event as opposed to an OnSize() event. I'm thinking EVT_SIZE is more analogous to OnSize(). So, what is analogous to OnSizing(), the event when it's actually resizing?
Wait, one small glitch. When it starts up maximized, the status bar isn't at the bottom and is instead like in the middle of the window flickering. Here is the code I use:
Code: Select all
g_main_frame = new MainFrame;
g_main_frame->Initialize();
g_main_frame->SetSize(getField("window", 0), getField("window", 1));
g_main_frame->SetPosition(wxPoint(getField("window", 2), getField("window", 3)));
g_main_frame->splitter->SetSashPosition(getField("window", 4));
if (g_configuration->windowMaximized)
g_main_frame->Maximize(true);