]> git.saurik.com Git - wxWidgets.git/blobdiff - contrib/src/fl/toolwnd.cpp
wxWindowMSW now eats EVT_CHAR if the key was handled in EVT_KEY_DOWN
[wxWidgets.git] / contrib / src / fl / toolwnd.cpp
index 1a8c7b617fc5817978c53bc77ca36516dca0ce2f..a018ce3c5c15292177629530557b9b693d0080b0 100644 (file)
@@ -41,9 +41,9 @@ static const unsigned char _gCheckerImg[16] = { _IMG_A,_IMG_B,_IMG_C,_IMG_D,
 
 /***** Implementation for class wxToolWindow *****/
 
-IMPLEMENT_DYNAMIC_CLASS( wxToolWindow, wxWindow )
+IMPLEMENT_DYNAMIC_CLASS( wxToolWindow, wxFrame)
 
-BEGIN_EVENT_TABLE( wxToolWindow, wxWindow )
+BEGIN_EVENT_TABLE( wxToolWindow, wxFrame )
 
        EVT_PAINT    ( wxToolWindow::OnPaint )
        EVT_MOTION   ( wxToolWindow::OnMotion )
@@ -165,15 +165,17 @@ void wxToolWindow::OnPaint( wxPaintEvent& event )
        int w,h;
        GetSize( &w, &h );
 
-       dc.SetBrush( *wxLIGHT_GREY_BRUSH );
-       dc.SetPen( *wxTRANSPARENT_PEN );
+    wxBrush backGround( wxSystemSettings::GetSystemColour(wxSYS_COLOUR_BTNFACE), wxSOLID );
+    //dc.SetBrush( *wxLIGHT_GREY_BRUSH );
+    dc.SetBrush( backGround ); 
+    dc.SetPen( *wxTRANSPARENT_PEN );
 
-       int y = mWndVertGap + mTitleHeight + mClntVertGap + 1;
-       dc.DrawRectangle( 0,0, w, y );
-       dc.DrawRectangle( 0,y-1, mWndHorizGap + mClntHorizGap + 1, h - y );
-       dc.DrawRectangle( w - ( mWndHorizGap + mClntHorizGap ), y-1,
-                                         mWndHorizGap + mClntHorizGap, h - y );
-       dc.DrawRectangle( 0, h - mWndVertGap - mClntVertGap, w, mWndVertGap + mClntVertGap );
+    int y = mWndVertGap + mTitleHeight + mClntVertGap;
+    dc.DrawRectangle( 0,0, w, y );                                      // Top grey part.
+    dc.DrawRectangle( 0,y-1, mWndHorizGap + mClntHorizGap, h - y );     // Left grey part.
+    dc.DrawRectangle( w - ( mWndHorizGap + mClntHorizGap ), y-1,
+                      mWndHorizGap + mClntHorizGap, h - y );            // Right grey part.
+    dc.DrawRectangle( 0, h - mWndVertGap - mClntVertGap, w, mWndVertGap + mClntVertGap ); // Bottom grey part.
 
        // draw shades
        dc.SetPen( *wxLIGHT_GREY_PEN );
@@ -336,21 +338,20 @@ void wxToolWindow::DrawHintRect( const wxRect& r )
 
 void wxToolWindow::SetHintCursor( int type )
 {
-       if ( mResizeStarted ) return;
+       if ( mResizeStarted )
+        return;
 
        if ( type == HITS_WND_NOTHING || type == HITS_WND_CLIENT )
        {
                // the cursor is out of window - reset to arrow
 
-               if ( mMouseCaptured && !mResizeStarted )
+               if ( mMouseCaptured )
                {
                        ReleaseMouse();
                        mMouseCaptured = FALSE;
                }
 
-               if ( mCursorType == HITS_WND_NOTHING && !mResizeStarted )
-
-                       SetCursor( wxCURSOR_ARROW );
+               SetCursor( wxCURSOR_ARROW );
 
                mCursorType = type;
 
@@ -679,14 +680,12 @@ void wxToolWindow::OnSize( wxSizeEvent& event )
                int x = mWndHorizGap + mClntHorizGap;
                int y = mWndVertGap  + mTitleHeight + mClntVertGap;
 
-#if 1
-               mpClientWnd->SetSize( x -1, y -1, 
-                                                         w - 2*(mWndHorizGap + mClntHorizGap),
-                                                         h - y - mClntVertGap - mWndVertGap, 
-                                                         0  
-                                                       );
-#endif
-       }
+        mpClientWnd->SetSize( x-1, y-1, 
+                              w - 2*(mWndHorizGap + mClntHorizGap),
+                              h - y - mClntVertGap - mWndVertGap, 
+                              0  
+                            );
+    }
 
        LayoutMiniButtons();
 }
@@ -868,7 +867,7 @@ void cbMiniButton::Reset()
 
 void cbCloseBox::Draw( wxDC& dc )
 {
-#ifdef __WXGTK__
+#if defined(__WXGTK__) || defined(__WXX11__)
 
     cbMiniButton::Draw( dc );