]> git.saurik.com Git - wxWidgets.git/commitdiff
minor wxMGL fixes -- controls sample is now OK
authorVáclav Slavík <vslavik@fastmail.fm>
Sun, 28 Oct 2001 23:25:35 +0000 (23:25 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Sun, 28 Oct 2001 23:25:35 +0000 (23:25 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12194 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/mgl/toplevel.h
include/wx/mgl/window.h
src/mgl/clipbrd.cpp
src/mgl/evtloop.cpp
src/mgl/timer.cpp
src/mgl/toplevel.cpp
src/mgl/window.cpp

index 859d9a3849fc12757935cdb58760fcc5396f0cdc..87537029586aa2dccf1caf5e7cc2967c6cb36bc8 100644 (file)
@@ -71,16 +71,19 @@ protected:
     void Init();
 
     wxString      m_title;
-    bool          m_fsIsShowing;         /* full screen */
+    bool          m_fsIsShowing:1;         /* full screen */
     long          m_fsSaveStyle;
     long          m_fsSaveFlag;
     wxRect        m_fsSaveFrame;
 
     // is the frame currently iconized?
-    bool          m_isIconized;
+    bool          m_isIconized:1;
     // and maximized?
-    bool          m_isMaximized;
+    bool          m_isMaximized:1;
     wxRect        m_savedFrame;
+
+    // did we sent wxSizeEvent at least once?
+    bool          m_sizeSet:1;
 };
 
 #endif // __WX_TOPLEVEL_H__
index 6fc01f5d827915be797e37bcdf189110d5370192..5bf12728de000e9bb2990bba37fb64ed6bd90382 100644 (file)
@@ -111,8 +111,8 @@ protected:
     struct window_t      *m_wnd;
     // whether there should be wxEraseEvent before wxPaintEvent or not
     // (see wxWindow::Refresh)
-    bool                  m_frozen;
-    bool                  m_refreshAfterThaw;
+    bool                  m_frozen:1;
+    bool                  m_refreshAfterThaw:1;
     int                   m_eraseBackground;
 
     // implement the base class pure virtuals
index 6dc37376589ec57e542ecd94e2ec8ef0ab434e2c..ae9430e41df420c0eb4aeabe69dc79a3db039687 100644 (file)
@@ -15,6 +15,7 @@
 
 #if wxUSE_CLIPBOARD
 
+// FIXME_MGL
 
 IMPLEMENT_DYNAMIC_CLASS(wxClipboard,wxObject)
 
index 7f3971cfe50d3f4668720c0a28ed0c7565f0d254..d19bd8639cfb6c8d60a9cc5025188b2e6bcb12b4 100644 (file)
@@ -152,6 +152,10 @@ void wxEventLoop::Exit(int rc)
 
     m_impl->SetExitCode(rc);
     m_impl->SetKeepLooping(FALSE);
+    
+    // Send a dummy event so that the app won't block in EVT_halt if there
+    // are no user-generated events in the queue:
+    EVT_post(0, EVT_USEREVT, 0, 0);
 }
 
 // ----------------------------------------------------------------------------
index f4c026db15d3d26f2fc7bae935bd2e163a00c5cb..dbef60e5ddd016deeb036f260c0d976368420e5e 100644 (file)
@@ -21,3 +21,4 @@
 
 IMPLEMENT_ABSTRACT_CLASS(wxTimer,wxObject)
 
+// FIXME_MGL
index 3f2bbcd209f4d9f904cb33430b9fa8cf3dcf32b8..f1cbc37ca7a28b9775c920f90266723c570ef6d0 100644 (file)
@@ -55,6 +55,7 @@ void wxTopLevelWindowMGL::Init()
     m_isIconized = FALSE;
     m_isMaximized = FALSE;
     m_fsIsShowing = FALSE;
+    m_sizeSet = FALSE;
 }
 
 bool wxTopLevelWindowMGL::Create(wxWindow *parent,
@@ -140,6 +141,17 @@ bool wxTopLevelWindowMGL::ShowFullScreen(bool show, long style)
 bool wxTopLevelWindowMGL::Show(bool show)
 {
     bool ret = wxTopLevelWindowBase::Show(show);
+
+    // If this is the first time Show was called, send size event,
+    // so that the frame can adjust itself (think auto layout or single child)
+    if ( !m_sizeSet )
+    {
+        m_sizeSet = TRUE;
+        wxSizeEvent event(GetSize(), GetId());
+        event.SetEventObject(this);
+        GetEventHandler()->ProcessEvent(event);
+    }
+
     if ( ret && show && AcceptsFocus() )
         SetFocus();
         // FIXME_MGL -- don't do this for popup windows?
index dac506d5186ae21523d726edc4ca99391bd0fa6d..cb44a8ad2666cdda6a500d764633a19b4fe0f04f 100644 (file)
@@ -1129,7 +1129,7 @@ void wxWindowMGL::HandlePaint(MGLDevCtx *dc)
 #if 0 // FIXME_MGL -- debugging stuff!
     dc->setColorRGB(255,0,255);
     dc->fillRect(-1000,-1000,2000,2000);
-    wxUsleep(100);
+    wxUsleep(50);
 #endif
 
     MGLRegion clip;