WX_FORWARD_TO_INPUT_CONSUMER(wxTopLevelWindow)
-
// ============================================================================
// implementation
// ============================================================================
wxWindowID id,
const wxString& title,
const wxPoint& pos,
- const wxSize& sizeOrig,
+ const wxSize& size,
long style,
const wxString &name)
{
styleOrig = style;
exstyleOrig = GetExtraStyle();
- style &= ~(wxCAPTION | wxMINIMIZE_BOX | wxMAXIMIZE_BOX |
- wxSYSTEM_MENU | wxRESIZE_BORDER | wxFRAME_TOOL_WINDOW |
+ style &= ~(wxCAPTION | wxMINIMIZE_BOX | wxMAXIMIZE_BOX |
+ wxSYSTEM_MENU | wxRESIZE_BORDER | wxFRAME_TOOL_WINDOW |
wxTHICK_FRAME);
style = wxSIMPLE_BORDER;
- SetExtraStyle(exstyleOrig &
+ SetExtraStyle(exstyleOrig &
~(wxFRAME_EX_CONTEXTHELP | wxDIALOG_EX_CONTEXTHELP));
}
- if ( !wxTopLevelWindowNative::Create(parent, id, title, pos,
- sizeOrig, style, name) )
+ if ( !wxTopLevelWindowNative::Create(parent, id, title, pos,
+ size, style, name) )
+ return FALSE;
+
+ // FIXME: to be removed as soon as wxTLW/wxFrame/wxDialog creation code in
+ // wxMSW is rationalized
+#ifdef __WXMSW__
+ extern const wxChar *wxFrameClassName;
+ if ( !MSWCreate(id, NULL, wxFrameClassName, this, title,
+ pos.x, pos.y, size.x, size.y, style) )
return FALSE;
+#endif // __WXMSW__
if ( ms_drawDecorations )
{
m_windowStyle = styleOrig;
m_exStyle = exstyleOrig;
}
-
+
return TRUE;
}
bool wxTopLevelWindow::ShowFullScreen(bool show, long style)
{
if ( show == IsFullScreen() ) return FALSE;
-
+
if ( ms_drawDecorations )
{
if ( show )
style |= wxTOPLEVEL_BORDER;
if ( m_windowStyle & (wxRESIZE_BORDER | wxTHICK_FRAME) )
style |= wxTOPLEVEL_RESIZEABLE;
-
+
if ( IsMaximized() )
style |= wxTOPLEVEL_MAXIMIZED;
if ( GetIcon().Ok() )
wxTopLevelWindowNative::DoGetClientSize(&w, &h);
wxRect rect = wxRect(wxTopLevelWindowNative::GetClientAreaOrigin(),
wxSize(w, h));
- rect = m_renderer->GetFrameClientArea(rect,
+ rect = m_renderer->GetFrameClientArea(rect,
GetDecorationsStyle());
return rect.GetPosition();
}
wxTopLevelWindowNative::DoGetClientSize(&w, &h);
wxRect rect = wxRect(wxTopLevelWindowNative::GetClientAreaOrigin(),
wxSize(w, h));
- rect = m_renderer->GetFrameClientArea(rect,
+ rect = m_renderer->GetFrameClientArea(rect,
GetDecorationsStyle());
if ( width )
*width = rect.width;
{
if ( ms_drawDecorations )
{
- wxSize size = m_renderer->GetFrameTotalSize(wxSize(width, height),
+ wxSize size = m_renderer->GetFrameTotalSize(wxSize(width, height),
GetDecorationsStyle());
wxTopLevelWindowNative::DoSetClientSize(size.x, size.y);
}
rect.height = size.y;
wxWindowDC dc(this);
- m_renderer->DrawFrameTitleBar(dc, rect,
+ m_renderer->DrawFrameTitleBar(dc, rect,
GetTitle(), m_titlebarIcon,
GetDecorationsStyle(),
m_pressedButton,
int w, h;
wxTopLevelWindowNative::DoGetClientSize(&w, &h);
wxRect rect(wxTopLevelWindowNative::GetClientAreaOrigin(), wxSize(w, h));
-
+
return m_renderer->HitTestFrame(rect, pt, GetDecorationsStyle());
}
if ( !m_renderer ) return;
wxSize size = m_renderer->GetFrameIconSize();
-
+
if ( !icon.Ok() || size.x == -1 )
m_titlebarIcon = icon;
else
}
#endif
break;
-
+
default:
wxFAIL_MSG(wxT("incorrect button specification"));
}
long numArg,
const wxString& strArg)
{
+ bool isActive = numArg != 0;
+
if ( action == wxACTION_TOPLEVEL_ACTIVATE )
{
- if ( m_isActive != (bool)numArg )
+ if ( m_isActive != isActive )
{
Refresh();
- m_isActive = (bool)numArg;
+ m_isActive = isActive;
wxNcPaintEvent event(GetId());
event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event);
}
return TRUE;
}
-
+
else if ( action == wxACTION_TOPLEVEL_BUTTON_PRESS )
{
m_pressedButton = numArg;
RefreshTitleBar();
return TRUE;
}
-
+
else if ( action == wxACTION_TOPLEVEL_BUTTON_RELEASE )
{
m_pressedButton = 0;
RefreshTitleBar();
return TRUE;
}
-
+
else if ( action == wxACTION_TOPLEVEL_BUTTON_CLICK )
{
m_pressedButton = 0;
ClickTitleBarButton(numArg);
return TRUE;
}
-
+
else
return FALSE;
}
{
wxTopLevelWindow *w = wxStaticCast(consumer->GetInputWindow(), wxTopLevelWindow);
long hit = w->HitTest(event.GetPosition());
-
+
if ( hit & wxHT_TOPLEVEL_ANY_BUTTON )
{
m_winCapture = w;
return wxStdInputHandler::HandleMouse(consumer, event);
}
-bool wxStdFrameInputHandler::HandleMouseMove(wxInputConsumer *consumer,
+bool wxStdFrameInputHandler::HandleMouseMove(wxInputConsumer *consumer,
const wxMouseEvent& event)
{
// we only have to do something when the mouse leaves/enters the pressed
consumer->PerformAction(wxACTION_TOPLEVEL_BUTTON_RELEASE, m_winPressed);
else
consumer->PerformAction(wxACTION_TOPLEVEL_BUTTON_PRESS, m_winPressed);
-
+
m_winHitTest = hit;
return TRUE;
}
return wxStdInputHandler::HandleMouseMove(consumer, event);
}
-bool wxStdFrameInputHandler::HandleActivation(wxInputConsumer *consumer,
+bool wxStdFrameInputHandler::HandleActivation(wxInputConsumer *consumer,
bool activated)
{
consumer->PerformAction(wxACTION_TOPLEVEL_ACTIVATE, activated);