- Allow tooltips longer than 64 (up to 128) characters in wxTaskBarIcon
- Fix centering wxFileDialog and allow positioning it
- Allow centering wxMessageDialog on its parent window (troelsk)
+- Show resize gripper on resizeable dialogs (Kolya Kosenko)
- Implement support for display enumeration under WinCE (Vince Harron)
- Use different Win32 class names in different wx instances (Thomas Hauk)
virtual void Raise();
+ virtual void SetWindowStyleFlag(long style);
+
#ifdef __POCKETPC__
// Responds to the OK button in a PocketPC titlebar. This
// can be overridden, or you can change the id used for
// common part of all ctors
void Init();
+ // these functions deal with the gripper window shown in the corner of
+ // resizeable dialogs
+ void CreateGripper();
+ void DestroyGripper();
+ void ShowGripper(bool show);
+ void ResizeGripper();
+
private:
wxWindow* m_oldFocus;
bool m_endModalCalled; // allow for closing within InitDialog
// this pointer is non-NULL only while the modal event loop is running
wxDialogModalData *m_modalData;
+ // gripper window for a resizable dialog, NULL if we're not resizable
+ WXHWND m_hGripper;
+
DECLARE_DYNAMIC_CLASS(wxDialog)
DECLARE_NO_COPY_CLASS(wxDialog)
};
#if wxUSE_TOOLBAR && defined(__POCKETPC__)
m_dialogToolBar = NULL;
#endif
+ m_hGripper = 0;
}
bool wxDialog::Create(wxWindow *parent,
CreateToolBar();
#endif
+ if( HasFlag(wxRESIZE_BORDER) )
+ CreateGripper();
+
return true;
}
// this will also reenable all the other windows for a modal dialog
Show(false);
+
+ DestroyGripper();
}
// ----------------------------------------------------------------------------
Hide();
}
+// ----------------------------------------------------------------------------
+// wxDialog gripper handling
+// ----------------------------------------------------------------------------
+
+void wxDialog::SetWindowStyleFlag(long style)
+{
+ wxDialogBase::SetWindowStyleFlag(style);
+
+ if( HasFlag(wxRESIZE_BORDER) )
+ CreateGripper();
+ else
+ DestroyGripper();
+}
+
+void wxDialog::CreateGripper()
+{
+ if( !m_hGripper )
+ {
+ m_hGripper = (WXHWND)::CreateWindow
+ (
+ wxT("SCROLLBAR"),
+ wxT(""),
+ WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS |
+ SBS_SIZEGRIP |
+ SBS_SIZEBOX |
+ SBS_SIZEBOXBOTTOMRIGHTALIGN,
+ 0, 0, 0, 0,
+ GetHwnd(),
+ 0,
+ wxGetInstance(),
+ NULL
+ );
+
+ // position the gripper correctly after creation
+ ResizeGripper();
+ }
+}
+
+void wxDialog::DestroyGripper()
+{
+ if ( m_hGripper )
+ {
+ ::DestroyWindow((HWND) m_hGripper);
+ m_hGripper = 0;
+ }
+}
+
+void wxDialog::ShowGripper(bool show)
+{
+ wxASSERT_MSG( m_hGripper, _T("shouldn't be called if we have no gripper") );
+
+ ::ShowWindow((HWND)m_hGripper, show ? SW_SHOW : SW_HIDE);
+}
+
+void wxDialog::ResizeGripper()
+{
+ wxASSERT_MSG( m_hGripper, _T("shouldn't be called if we have no gripper") );
+
+ HWND hwndGripper = (HWND)m_hGripper;
+
+ const wxRect rectGripper = wxRectFromRECT(wxGetWindowRect(hwndGripper));
+ const wxSize size = GetClientSize() - rectGripper.GetSize();
+
+ ::SetWindowPos(hwndGripper, HWND_BOTTOM,
+ size.x, size.y,
+ rectGripper.width, rectGripper.height,
+ SWP_NOACTIVATE);
+}
+
// ----------------------------------------------------------------------------
// wxWin event handlers
// ----------------------------------------------------------------------------
break;
case WM_SIZE:
+ if ( m_hGripper )
+ {
+ switch ( wParam )
+ {
+ case SIZE_MAXIMIZED:
+ ShowGripper(false);
+ break;
+
+ case SIZE_RESTORED:
+ ShowGripper(true);
+ // fall through
+
+ default:
+ ResizeGripper();
+ }
+ }
+
// the Windows dialogs unfortunately are not meant to be resizeable
// at all and their standard class doesn't include CS_[VH]REDRAW
// styles which means that the window is not refreshed properly