bool wxWindowMSW::HandlePaletteChanged(WXHWND hWndPalChange)
{
#if wxUSE_PALETTE
- // same as below except we don't respond to our own messages
- if (hWndPalChange != GetHWND()) {
+ // same as below except we don't respond to our own messages
+ if ( hWndPalChange != GetHWND() )
+ {
// check to see if we our our parents have a custom palette
wxWindow *win = this;
- while (!win->HasCustomPalette() && win->GetParent()) win = win->GetParent();
- if (win->HasCustomPalette()) {
- /* realize the palette to see whether redrawing is needed */
- HDC hdc = GetDC((HWND) hWndPalChange);
- win->m_palette.SetHPALETTE( (WXHPALETTE)
- ::SelectPalette(hdc, (HPALETTE) win->m_palette.GetHPALETTE(), false) );
+ while ( win && !win->HasCustomPalette() )
+ {
+ win = win->GetParent();
+ }
+
+ if ( win && win->HasCustomPalette() )
+ {
+ // realize the palette to see whether redrawing is needed
+ HDC hdc = ::GetDC((HWND) hWndPalChange);
+ win->m_palette.SetHPALETTE((WXHPALETTE)
+ ::SelectPalette(hdc, GetHpaletteOf(win->m_palette), FALSE));
int result = ::RealizePalette(hdc);
- /* restore the palette (before releasing the DC) */
- win->m_palette.SetHPALETTE( (WXHPALETTE)
- ::SelectPalette(hdc, (HPALETTE) win->m_palette.GetHPALETTE(), true) );
- RealizePalette(hdc);
- ReleaseDC((HWND) hWndPalChange, hdc);
- /* now check for the need to redraw */
+
+ // restore the palette (before releasing the DC)
+ win->m_palette.SetHPALETTE((WXHPALETTE)
+ ::SelectPalette(hdc, GetHpaletteOf(win->m_palette), FALSE));
+ ::RealizePalette(hdc);
+ ::ReleaseDC((HWND) hWndPalChange, hdc);
+
+ // now check for the need to redraw
if (result > 0)
InvalidateRect((HWND) hWndPalChange, NULL, TRUE);
- }
-
}
-#endif
+
+ }
+#endif // wxUSE_PALETTE
wxPaletteChangedEvent event(GetId());
event.SetEventObject(this);
/* realize the palette to see whether redrawing is needed */
HDC hdc = GetDC((HWND) GetHWND());
win->m_palette.SetHPALETTE( (WXHPALETTE)
- ::SelectPalette(hdc, (HPALETTE) win->m_palette.GetHPALETTE(), false) );
+ ::SelectPalette(hdc, (HPALETTE) win->m_palette.GetHPALETTE(), FALSE) );
int result = ::RealizePalette(hdc);
/* restore the palette (before releasing the DC) */
win->m_palette.SetHPALETTE( (WXHPALETTE)
- ::SelectPalette(hdc, (HPALETTE) win->m_palette.GetHPALETTE(), true) );
+ ::SelectPalette(hdc, (HPALETTE) win->m_palette.GetHPALETTE(), TRUE) );
::RealizePalette(hdc);
::ReleaseDC((HWND) GetHWND(), hdc);
/* now check for the need to redraw */
if (result > 0)
::InvalidateRect((HWND) GetHWND(), NULL, TRUE);
}
-#endif
+#endif // wxUSE_PALETTE
wxQueryNewPaletteEvent event(GetId());
event.SetEventObject(this);
MINMAXINFO *info = (MINMAXINFO *)mmInfo;
bool rc = FALSE;
+
+ int minWidth = GetMinWidth(),
+ minHeight = GetMinHeight(),
+ maxWidth = GetMaxWidth(),
+ maxHeight = GetMaxHeight();
- if ( m_minWidth != -1 )
+ if ( minWidth != -1 )
{
- info->ptMinTrackSize.x = m_minWidth;
+ info->ptMinTrackSize.x = minWidth;
rc = TRUE;
}
- if ( m_minHeight != -1 )
+ if ( minHeight != -1 )
{
- info->ptMinTrackSize.y = m_minHeight;
+ info->ptMinTrackSize.y = minHeight;
rc = TRUE;
}
- if ( m_maxWidth != -1 )
+ if ( maxWidth != -1 )
{
- info->ptMaxTrackSize.x = m_maxWidth;
+ info->ptMaxTrackSize.x = maxWidth;
rc = TRUE;
}
- if ( m_maxHeight != -1 )
+ if ( maxHeight != -1 )
{
- info->ptMaxTrackSize.y = m_maxHeight;
+ info->ptMaxTrackSize.y = maxHeight;
rc = TRUE;
}