#include "wx/module.h"
#include "wx/msw/private.h"
-
#if defined(__WXWINCE__)
#include <ole2.h>
#include <shellapi.h>
#include "wx/msw/wince/missing.h"
#endif
+#include "wx/msw/missing.h"
#include "wx/msw/winundef.h"
// This can't be undefed in winundef.h or
m_iconized =
m_maximizeOnShow = FALSE;
- // unlike (almost?) all other windows, frames are created hidden
- m_isShown = FALSE;
-
// Data to save/restore when calling ShowFullScreen
m_fsStyle = 0;
m_fsOldWindowStyle = 0;
if ( exflags )
{
-#if !defined(__WIN16__)
if ( !(GetExtraStyle() & wxTOPLEVEL_EX_DIALOG) )
{
if ( style & wxFRAME_TOOL_WINDOW )
#endif
//else: nothing to do [here]
}
-#endif // !Win16
if ( style & wxSTAY_ON_TOP )
*exflags |= WS_EX_TOPMOST;
// move the dialog to its initial position without forcing repainting
int x, y, w, h;
- if ( !MSWGetCreateWindowCoords(pos, size, x, y, w, h) )
- {
- x =
- w = (int)CW_USEDEFAULT;
- }
-
- // we can't use CW_USEDEFAULT here as we're not calling CreateWindow()
- // and passing CW_USEDEFAULT to MoveWindow() results in resizing the
- // window to (0, 0) size which breaks quite a lot of things, e.g. the
- // sizer calculation in wxSizer::Fit()
- if ( w == (int)CW_USEDEFAULT )
- {
- // the exact number doesn't matter, the dialog will be resized
- // again soon anyhow but it should be big enough to allow
- // calculation relying on "totalSize - clientSize > 0" work, i.e.
- // at least greater than the title bar height
- w =
- h = 100;
- }
+ (void)MSWGetCreateWindowCoords(pos, size, x, y, w, h);
if ( x == (int)CW_USEDEFAULT )
{
const wxString& name)
{
bool ret wxDUMMY_INITIALIZE(false);
-
+ int w, h;
+
// init our fields
Init();
+ w = WidthDefault(size.x);
+ h = HeightDefault(size.y);
m_windowStyle = style;
if ( style & (wxRESIZE_BORDER | wxCAPTION) )
dlgTemplate->style |= DS_MODALFRAME;
- ret = CreateDialog(dlgTemplate, title, pos, size);
+ ret = CreateDialog(dlgTemplate, title, pos, wxSize(w,h));
free(dlgTemplate);
}
else // !dialog
{
- ret = CreateFrame(title, pos, size);
+ ret = CreateFrame(title, pos, wxSize(w,h));
}
if ( ret && !(GetWindowStyleFlag() & wxCLOSE_BOX) )
EnableCloseButton(false);
}
+ // for some reason we need to manually send ourselves this message as
+ // otherwise the mnemonics are always shown -- even if they're configured
+ // to be hidden until "Alt" is pressed in the control panel
+ //
+ // this could indicate a bug somewhere else but for now this is the only
+ // fix we have
+ if ( ret )
+ {
+ SendMessage
+ (
+ GetHwnd(),
+ WM_UPDATEUISTATE,
+ MAKEWPARAM(UIS_INITIALIZE, UISF_HIDEFOCUS | UISF_HIDEACCEL),
+ 0
+ );
+ }
+
return ret;
}
rect.x, rect.y, rect.width, rect.height,
flags);
-#if __WXWINCE__ && _WIN32_WCE < 400
+#if defined(__WXWINCE__) && _WIN32_WCE < 400
::SHFullScreen(GetHwnd(), SHFS_HIDETASKBAR | SHFS_HIDESIPBUTTON);
#endif
}
else // stop showing full screen
{
-#if __WXWINCE__ && _WIN32_WCE < 400
+#if defined(__WXWINCE__) && _WIN32_WCE < 400
::SHFullScreen(GetHwnd(), SHFS_SHOWTASKBAR | SHFS_SHOWSIPBUTTON);
#endif
Maximize(m_fsIsMaximized);