Hi everyone !
I'm quite new here, it's my first post
My english isn't perfect so i'll be quick : there's a behavior of my window, I wish to avoid , I have noticed that when one makes a double click on the title bar, the window is resized ( not iconized ), and I'd like to avoid this , I really don't see which is the best way to do this, if there's a clean way. I want my window to stay "maximized", or iconized, but not resizeable .
Thanks in advance !
Peter
avoid minimize window double click title bar
Re: avoid minimize window double click title bar
Which platform?
Under Windows, doubleclicking the title bar does the same as clicking the "maximize" icon. You can avoid this by not passing the wxMAXIMIZE_BOX style flag when creating the frame.
The wxMAXIMIZE_BOX style flag is included in wxDEFAULT_FRAME_STYLE, so you could use
wxDEFAULT_FRAME_STYLE & ~wxMAXIMIZE_BOX instead.
Under Windows, doubleclicking the title bar does the same as clicking the "maximize" icon. You can avoid this by not passing the wxMAXIMIZE_BOX style flag when creating the frame.
The wxMAXIMIZE_BOX style flag is included in wxDEFAULT_FRAME_STYLE, so you could use
wxDEFAULT_FRAME_STYLE & ~wxMAXIMIZE_BOX instead.
Use the source, Luke!
Re: avoid minimize window double click title bar
MS Windows XP Professional SP3doublemax wrote:Which platform?
doublemax wrote:The wxMAXIMIZE_BOX style flag is included in wxDEFAULT_FRAME_STYLE, so you could usewxDEFAULT_FRAME_STYLE & ~wxMAXIMIZE_BOX instead
Code: Select all
// Here is the flags I use
wxCAPTION | wxMINIMIZE_BOX | wxCLOSE_BOX | wxSYSTEM_MENU
Code: Select all
// Here is the code I use at the application start
bool MyApp::OnInit( void )
{
if( wxApp::OnInit() )
{
MainWindow * main_window = new MainWindow( _T("MyApp") ) ;
main_window->Maximize() ;
main_window->Show() ;
return true ;
}
// ---- else ----
return false ;
}
Re: avoid minimize window double click title bar
This seems to be the "normal" behavior under Windows.
The only idea i have would be to disable the double click on the title bar at a low Windows level.
Override wxFrame::MSWWindowProc and put this code there:
I didn't test that very much, so it could have some unwanted side effects. Use at your own risk
The only idea i have would be to disable the double click on the title bar at a low Windows level.
Override wxFrame::MSWWindowProc and put this code there:
Code: Select all
WXLRESULT MyFrame::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
{
if(nMsg==WM_NCLBUTTONDBLCLK) {
return 0;
}
return wxFrame::MSWWindowProc(nMsg, wParam, lParam);
}
Use the source, Luke!
Re: avoid minimize window double click title bar
It works ! Thank you very much indeed