- if ( id == -1 )
- m_windowId = (int)NewControlId();
- else
- m_windowId = id;
-
- int x = pos.x;
- int y = pos.y;
- int width = size.x;
- int height = size.y;
-
- if (x < 0) x = wxDIALOG_DEFAULT_X;
- if (y < 0) y = wxDIALOG_DEFAULT_Y;
-
- m_windowStyle = style;
-
- m_isShown = FALSE;
- m_modalShowing = FALSE;
-
- if (width < 0)
- width = 500;
- if (height < 0)
- height = 500;
+ if ( id == -1 )
+ m_windowId = (int)NewControlId();
+ else
+ m_windowId = id;
+
+ int x = pos.x;
+ int y = pos.y;
+ int width = size.x;
+ int height = size.y;
+
+ if (x < 0) x = wxDIALOG_DEFAULT_X;
+ if (y < 0) y = wxDIALOG_DEFAULT_Y;
+
+ m_windowStyle = style;
+
+ m_isShown = FALSE;
+ m_modalShowing = FALSE;
+
+ if (width < 0)
+ width = 500;
+ if (height < 0)
+ height = 500;
+
+ WXDWORD extendedStyle = MakeExtendedStyle(m_windowStyle);
+ if (m_windowStyle & wxSTAY_ON_TOP)
+ extendedStyle |= WS_EX_TOPMOST;
+
+ // Allows creation of dialogs with & without captions under MSWindows,
+ // resizeable or not (but a resizeable dialog always has caption -
+ // otherwise it would look too strange)
+ const char *dlg;
+ if ( style & wxTHICK_FRAME )
+ dlg = "wxResizeableDialog";
+ else if ( style & wxCAPTION )
+ dlg = "wxCaptionDialog";
+ else
+ dlg = "wxNoCaptionDialog";
+ MSWCreate(m_windowId, parent, NULL, this, NULL,
+ x, y, width, height,
+ 0, // style is not used if we have dlg template
+ dlg,
+ extendedStyle);