// headers
// ----------------------------------------------------------------------------
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "toplevel.h"
#endif
#include "wx/module.h"
#include "wx/msw/private.h"
+#include "wx/msw/winundef.h"
+
+// This can't be undefed in winundef.h or
+// there are further errors
+#if defined(__WXWINCE__) && defined(CreateDialog)
+#undef CreateDialog
+#endif
#include "wx/display.h"
if ( style & wxFRAME_TOOL_WINDOW )
msflags |= WS_POPUP;
else
- msflags |= WS_OVERLAPPED;
+ {
+#ifdef __WXWINCE__
+ if (msflags & WS_BORDER)
+#endif
+ msflags |= WS_OVERLAPPED;
+ }
// border and caption styles
if ( style & wxRESIZE_BORDER )
+ {
+#ifndef __WXWINCE__
msflags |= WS_THICKFRAME;
+#endif
+ }
+ else if ( exflags && ((style & wxBORDER_DOUBLE) || (style & wxBORDER_RAISED)) )
+ *exflags |= WS_EX_DLGMODALFRAME;
else if ( !(style & wxBORDER_NONE) )
msflags |= WS_BORDER;
+#ifndef __WXWINCE__
else
msflags |= WS_POPUP;
+#endif
if ( style & wxCAPTION )
msflags |= WS_CAPTION;
+#ifndef __WXWINCE__
else
msflags |= WS_POPUP;
+#endif
// next translate the individual flags
if ( style & wxMINIMIZE_BOX )
msflags |= WS_MAXIMIZEBOX;
if ( style & wxSYSTEM_MENU )
msflags |= WS_SYSMENU;
+#ifndef __WXWINCE__
if ( style & wxMINIMIZE )
msflags |= WS_MINIMIZE;
if ( style & wxMAXIMIZE )
msflags |= WS_MAXIMIZE;
+#endif
// Keep this here because it saves recoding this function in wxTinyFrame
#if wxUSE_ITSY_BITSY && !defined(__WIN32__)
if ( exflags )
{
-#if !defined(__WIN16__)
+#if !defined(__WIN16__)
if ( !(GetExtraStyle() & wxTOPLEVEL_EX_DIALOG) )
{
if ( style & wxFRAME_TOOL_WINDOW )
{
// create the palette-like window
*exflags |= WS_EX_TOOLWINDOW;
+
+ // tool windows shouldn't appear on the taskbar (as documented)
+ style |= wxFRAME_NO_TASKBAR;
}
// We have to solve 2 different problems here:
// The second one is solved here by using WS_EX_APPWINDOW flag, the
// first one is dealt with in our MSWGetParent() method
// implementation
+#ifndef __WXWINCE__
if ( !(style & wxFRAME_NO_TASKBAR) && GetParent() )
{
// need to force the frame to appear in the taskbar
*exflags |= WS_EX_APPWINDOW;
}
+#endif
//else: nothing to do [here]
}
#endif // !Win16
if ( exflags )
{
::SetWindowLong(GetHwnd(), GWL_EXSTYLE, exflags);
- ::SetWindowPos(GetHwnd(), NULL, 0, 0, 0, 0,
+ ::SetWindowPos(GetHwnd(),
+ exflags & WS_EX_TOPMOST ? HWND_TOPMOST : 0,
+ 0, 0, 0, 0,
SWP_NOSIZE |
SWP_NOMOVE |
- SWP_NOZORDER |
+ (exflags & WS_EX_TOPMOST ? 0 : SWP_NOZORDER) |
SWP_NOACTIVATE);
}
bool wxTopLevelWindowMSW::IsMaximized() const
{
+#ifdef __WXWINCE__
+ return FALSE;
+#else
return ::IsZoomed(GetHwnd()) != 0;
+#endif
}
void wxTopLevelWindowMSW::Iconize(bool iconize)
bool wxTopLevelWindowMSW::IsIconized() const
{
+#ifdef __WXWINCE__
+ return FALSE;
+#else
// also update the current state
((wxTopLevelWindowMSW *)this)->m_iconized = ::IsIconic(GetHwnd()) != 0;
return m_iconized;
+#endif
}
void wxTopLevelWindowMSW::Restore()
LONG offFlags = 0;
if (style & wxFULLSCREEN_NOBORDER)
- offFlags |= WS_BORDER | WS_THICKFRAME;
+ {
+ offFlags |= WS_BORDER;
+#ifndef __WXWINCE__
+ offFlags |= WS_THICKFRAME;
+#endif
+ }
if (style & wxFULLSCREEN_NOCAPTION)
offFlags |= WS_CAPTION | WS_SYSMENU;
else // fall back to the main desktop
#else // wxUSE_DISPLAY
{
+ // FIXME: implement for WinCE
+#ifndef __WXWINCE__
// resize to the size of the desktop
wxCopyRECTToRect(wxGetWindowRect(::GetDesktopWindow()), rect);
+#endif
}
#endif // wxUSE_DISPLAY
bool wxTopLevelWindowMSW::EnableCloseButton(bool enable)
{
-#ifndef __WXMICROWIN__
+#if !defined(__WXMICROWIN__)
// get system (a.k.a. window) menu
- HMENU hmenu = ::GetSystemMenu(GetHwnd(), FALSE /* get it */);
+ HMENU hmenu = GetSystemMenu(GetHwnd(), FALSE /* get it */);
if ( !hmenu )
{
// no system menu at all -- ok if we want to remove the close button
bool wxTopLevelWindowMSW::SetShape(const wxRegion& region)
{
+#ifdef __WXWINCE__
+ return FALSE;
+#else
wxCHECK_MSG( HasFlag(wxFRAME_SHAPED), FALSE,
_T("Shaped windows must be created with the wxFRAME_SHAPED style."));
return FALSE;
}
return TRUE;
+#endif
}
// ----------------------------------------------------------------------------
if ( event.GetActive() )
{
// restore focus to the child which was last focused
- wxLogTrace(_T("focus"), _T("wxTLW %08x activated."), (int) m_hWnd);
+// wxLogTrace(_T("focus"), _T("wxTLW %08x activated."), (int) m_hWnd);
wxWindow *parent = m_winLastFocused ? m_winLastFocused->GetParent()
: NULL;
// the DialogProc for all wxWindows dialogs
LONG APIENTRY _EXPORT
-wxDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
+wxDlgProc(HWND WXUNUSED(hDlg),
+ UINT message,
+ WPARAM WXUNUSED(wParam),
+ LPARAM WXUNUSED(lParam))
{
switch ( message )
{