]> git.saurik.com Git - wxWidgets.git/blobdiff - src/univ/themes/gtk.cpp
added wxTreeEvent::GetKeyEvent() to allow to retrieve the key event flags from EVT_TR...
[wxWidgets.git] / src / univ / themes / gtk.cpp
index 23f371ec8ecbf707e8c5282b1d767f5cb85dc4de..4a0bcfdcc8e7fa919efb8441e6b99bcc673af0d8 100644 (file)
@@ -205,6 +205,37 @@ public:
                                    wxCoord y,
                                    const wxMenuGeometryInfo& geomInfo);
 #endif
+
+    virtual void DrawFrameTitleBar(wxDC& dc,
+                                   const wxRect& rect,
+                                   const wxString& title,
+                                   const wxIcon& icon,
+                                   int flags,
+                                   int pressedButtons = 0);
+    virtual void DrawFrameBorder(wxDC& dc,
+                                 const wxRect& rect,
+                                 int flags);
+    virtual void DrawFrameBackground(wxDC& dc,
+                                     const wxRect& rect,
+                                     int flags);
+    virtual void DrawFrameTitle(wxDC& dc,
+                                const wxRect& rect,
+                                const wxString& title,
+                                int flags);
+    virtual void DrawFrameIcon(wxDC& dc,
+                               const wxRect& rect,
+                               const wxIcon& icon,
+                               int flags);
+    virtual void DrawFrameButton(wxDC& dc,
+                                 wxCoord x, wxCoord y,
+                                 int button,
+                                 int flags = 0);
+
+    // titlebars
+    virtual wxRect GetFrameClientArea(const wxRect& rect, int flags) const;
+    virtual wxSize GetFrameTotalSize(const wxSize& clientSize, int flags) const;
+    virtual wxSize GetFrameIconSize() const;
+
     virtual void GetComboBitmaps(wxBitmap *bmpNormal,
                                  wxBitmap *bmpFocus,
                                  wxBitmap *bmpPressed,
@@ -419,12 +450,12 @@ class wxGTKInputHandler : public wxInputHandler
 public:
     wxGTKInputHandler(wxGTKRenderer *renderer);
 
-    virtual bool HandleKey(wxControl *control,
+    virtual bool HandleKey(wxInputConsumer *control,
                            const wxKeyEvent& event,
                            bool pressed);
-    virtual bool HandleMouse(wxControl *control,
+    virtual bool HandleMouse(wxInputConsumer *control,
                              const wxMouseEvent& event);
-    virtual bool HandleMouseMove(wxControl *control, const wxMouseEvent& event);
+    virtual bool HandleMouseMove(wxInputConsumer *control, const wxMouseEvent& event);
 
 protected:
     wxGTKRenderer *m_renderer;
@@ -470,7 +501,7 @@ public:
     wxGTKCheckboxInputHandler(wxInputHandler *handler)
         : wxStdCheckboxInputHandler(handler) { }
 
-    virtual bool HandleKey(wxControl *control,
+    virtual bool HandleKey(wxInputConsumer *control,
                            const wxKeyEvent& event,
                            bool pressed);
 };
@@ -481,7 +512,7 @@ public:
     wxGTKTextCtrlInputHandler(wxInputHandler *handler)
         : wxStdTextCtrlInputHandler(handler) { }
 
-    virtual bool HandleKey(wxControl *control,
+    virtual bool HandleKey(wxInputConsumer *control,
                            const wxKeyEvent& event,
                            bool pressed);
 };
@@ -2339,6 +2370,69 @@ void wxGTKRenderer::AdjustSize(wxSize *size, const wxWindow *window)
     }
 }
 
+// ----------------------------------------------------------------------------
+// top level windows
+// ----------------------------------------------------------------------------
+
+void wxGTKRenderer::DrawFrameTitleBar(wxDC& dc,
+                                      const wxRect& rect,
+                                      const wxString& title,
+                                      const wxIcon& icon,
+                                      int flags,
+                                      int pressedButtons = 0)
+{
+}
+
+void wxGTKRenderer::DrawFrameBorder(wxDC& dc,
+                                    const wxRect& rect,
+                                    int flags)
+{
+}
+
+void wxGTKRenderer::DrawFrameBackground(wxDC& dc,
+                                        const wxRect& rect,
+                                        int flags)
+{
+}
+
+void wxGTKRenderer::DrawFrameTitle(wxDC& dc,
+                                   const wxRect& rect,
+                                   const wxString& title,
+                                   int flags)
+{
+}
+
+void wxGTKRenderer::DrawFrameIcon(wxDC& dc,
+                                  const wxRect& rect,
+                                  const wxIcon& icon,
+                                  int flags)
+{
+}
+
+void wxGTKRenderer::DrawFrameButton(wxDC& dc,
+                                    wxCoord x, wxCoord y,
+                                    int button,
+                                    int flags = 0)
+{
+}
+
+wxRect wxGTKRenderer::GetFrameClientArea(const wxRect& rect, int flags) const
+{
+    return rect;
+}
+
+wxSize wxGTKRenderer::GetFrameTotalSize(const wxSize& clientSize, int flags) const
+{
+    return clientSize;
+}
+
+wxSize wxGTKRenderer::GetFrameIconSize() const
+{
+    return wxSize(-1, -1);
+}
+
+
+
 // ============================================================================
 // wxInputHandler
 // ============================================================================
@@ -2352,20 +2446,20 @@ wxGTKInputHandler::wxGTKInputHandler(wxGTKRenderer *renderer)
     m_renderer = renderer;
 }
 
-bool wxGTKInputHandler::HandleKey(wxControl *control,
+bool wxGTKInputHandler::HandleKey(wxInputConsumer *control,
                                   const wxKeyEvent& event,
                                   bool pressed)
 {
     return FALSE;
 }
 
-bool wxGTKInputHandler::HandleMouse(wxControl *control,
+bool wxGTKInputHandler::HandleMouse(wxInputConsumer *control,
                                     const wxMouseEvent& event)
 {
     // clicking on the control gives it focus
-    if ( event.ButtonDown() )
+    if ( event.ButtonDown() && wxWindow::FindFocus() != control->GetInputWindow() )
     {
-        control->SetFocus();
+        control->GetInputWindow()->SetFocus();
 
         return TRUE;
     }
@@ -2373,16 +2467,16 @@ bool wxGTKInputHandler::HandleMouse(wxControl *control,
     return FALSE;
 }
 
-bool wxGTKInputHandler::HandleMouseMove(wxControl *control,
+bool wxGTKInputHandler::HandleMouseMove(wxInputConsumer *control,
                                         const wxMouseEvent& event)
 {
     if ( event.Entering() )
     {
-        control->SetCurrent(TRUE);
+        control->GetInputWindow()->SetCurrent(TRUE);
     }
     else if ( event.Leaving() )
     {
-        control->SetCurrent(FALSE);
+        control->GetInputWindow()->SetCurrent(FALSE);
     }
     else
     {
@@ -2396,7 +2490,7 @@ bool wxGTKInputHandler::HandleMouseMove(wxControl *control,
 // wxGTKCheckboxInputHandler
 // ----------------------------------------------------------------------------
 
-bool wxGTKCheckboxInputHandler::HandleKey(wxControl *control,
+bool wxGTKCheckboxInputHandler::HandleKey(wxInputConsumer *control,
                                           const wxKeyEvent& event,
                                           bool pressed)
 {
@@ -2418,7 +2512,7 @@ bool wxGTKCheckboxInputHandler::HandleKey(wxControl *control,
 // wxGTKTextCtrlInputHandler
 // ----------------------------------------------------------------------------
 
-bool wxGTKTextCtrlInputHandler::HandleKey(wxControl *control,
+bool wxGTKTextCtrlInputHandler::HandleKey(wxInputConsumer *control,
                                           const wxKeyEvent& event,
                                           bool pressed)
 {