]> git.saurik.com Git - wxWidgets.git/commitdiff
Fixed drawing sample compilo for wxMotif (doesn't have wxRegion::Offset)
authorJulian Smart <julian@anthemion.co.uk>
Mon, 22 Apr 2002 11:19:11 +0000 (11:19 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Mon, 22 Apr 2002 11:19:11 +0000 (11:19 +0000)
Put m_ok earlier in SelectBitmap, else get assert after SelectObject(wxNullBitmap)
'Fixed' longlong to long conversion messages by redefinging GetMillisecondsTime

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15233 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

samples/drawing/drawing.cpp
src/generic/timer.cpp
src/motif/dcmemory.cpp
src/x11/app.cpp
src/x11/window.cpp

index 5c71ee2b096971e5c04c2ddd013dd27ca761bc76..4b7f12ac5e05f636194d669c5f790763af1949fe 100644 (file)
@@ -878,9 +878,10 @@ void MyCanvas::DrawRegionsHelper(wxDC& dc, wxCoord x, bool firstTime)
     dc.DestroyClippingRegion();
 
     wxRegion region(x + 110, y + 20, 100, 270);
+#ifndef __WXMOTIF__
     if ( !firstTime )
         region.Offset(10, 10);
-
+#endif
     dc.SetClippingRegion(region);
 
     dc.SetBrush( *wxGREY_BRUSH );
index 39974a6b8e361efac41926879df2acce05aea7cb..7294f94ee31d552c36a3f79fed73f73fe714fe6b 100644 (file)
     extern "C" ulong _EVT_getTicks();
     #define GetMillisecondsTime() _EVT_getTicks()
 #else
-    #define GetMillisecondsTime() wxGetLocalTimeMillis().ToLong()
+//    #define GetMillisecondsTime() wxGetLocalTimeMillis().ToLong()
+    // Suppresses the debug warning in ToLong. FIXME: check
+    // that we don't drastically lose precision
+    #define GetMillisecondsTime() (unsigned long) wxGetLocalTimeMillis().GetValue()
 #endif
 
 // ----------------------------------------------------------------------------
index 8694f0b6eccd70854984e0fecd501adf0f9e4702..bdbd68f7276480c5dfb3086495819b04d181bf01 100644 (file)
@@ -119,6 +119,7 @@ void wxMemoryDC::SelectObject( const wxBitmap& bitmap )
             &gcvalues);
         
         m_backgroundPixel = (int) gcvalues.background;
+        m_ok = TRUE;
         
         // Get the current Font so we can set it back later
         XGCValues valReturn;
@@ -133,7 +134,6 @@ void wxMemoryDC::SelectObject( const wxBitmap& bitmap )
         
         SetOptimization(oldOpt);
         
-        m_ok = TRUE;
     }
     else
     {
index 1ca16bb8e24da0060046a068fd46fee85aeb2aa8..050ac895fbb21878d37b4f3c7d3de3ad15caeb75 100644 (file)
@@ -782,7 +782,12 @@ bool wxApp::ProcessXEvent(WXEvent* _event)
 #endif
                 {
                     // wxLogDebug( "FocusIn from %s of type %s", win->GetName().c_str(), win->GetClassInfo()->GetClassName() );
-
+#if 0
+                    wxString msg;
+                    msg.Printf( "FocusIn from %s of type %s\n", win->GetName().c_str(), win->GetClassInfo()->GetClassName() );
+                    printf(msg.c_str());
+#endif
+                    
                     wxFocusEvent focusEvent(wxEVT_SET_FOCUS, win->GetId());
                     focusEvent.SetEventObject(win);
                     focusEvent.SetWindow( g_prevFocus );
index 493e7d51c3b05cc176a670d065d60e283e0a81a0..b04be864ebc75da7a3ecc444b221de574eb2c387 100644 (file)
@@ -393,6 +393,11 @@ void wxWindowX11::SetFocus()
     {
         m_needsInputFocus = TRUE;
     }
+#if 0
+    wxString msg;
+    msg.Printf("SetFocus: %s\n", GetClassInfo()->GetClassName());
+    printf(msg.c_str());
+#endif
 }
 
 // Get the window with the focus
@@ -1232,7 +1237,15 @@ void wxWindowX11::OnInternalIdle()
     // Set the input focus if couldn't do it before
     if (m_needsInputFocus)
     {
+#if 0
+        wxString msg;
+        msg.Printf("Setting focus for %s from OnInternalIdle\n", GetClassInfo()->GetClassName());
+        printf(msg.c_str());
+#endif        
        SetFocus();
+        // If it couldn't set the focus now, there's
+        // no point in trying again.
+        m_needsInputFocus = FALSE;
     }
 }