]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/cocoa/window.h
Implemented toolbar/statusbar positioning
[wxWidgets.git] / include / wx / cocoa / window.h
index b0542e1bfa63a2bb7ae6e018db3b8c95caeec4d9..1fbc20590b3662de771d2463560d00b4decbf0e3 100644 (file)
 
 #include "wx/cocoa/NSView.h"
 
+#ifdef __OBJC__
+    #import <Foundation/NSGeometry.h>
+#endif //def __OBJC__
+
+class wxWindowCocoaHider;
+class wxWindowCocoaScroller;
+
 // ========================================================================
 // wxWindowCocoa
 // ========================================================================
@@ -22,6 +29,8 @@ class WXDLLEXPORT wxWindowCocoa: public wxWindowBase, protected wxCocoaNSView
     DECLARE_DYNAMIC_CLASS(wxWindowCocoa)
     DECLARE_NO_COPY_CLASS(wxWindowCocoa)
     DECLARE_EVENT_TABLE()
+    friend wxWindow *wxWindowBase::GetCapture();
+    friend class wxWindowCocoaScroller;
 // ------------------------------------------------------------------------
 // initialization
 // ------------------------------------------------------------------------
@@ -50,14 +59,46 @@ protected:
 // Cocoa specifics
 // ------------------------------------------------------------------------
 public:
+    // Returns the content NSView (where children are added, drawing performed)
     inline WX_NSView GetNSView() { return m_cocoaNSView; }
+    // Returns the NSView suitable for use as a subview
+    WX_NSView GetNSViewForSuperview() const;
+    // Returns the NSView that may be hidden/is being hidden
+    WX_NSView GetNSViewForHiding() const;
     void CocoaAddChild(wxWindowCocoa *child);
     void CocoaRemoveFromParent(void);
-    virtual void Cocoa_FrameChanged(void);
 protected:
+    void CocoaCreateNSScrollView();
+    void InitMouseEvent(wxMouseEvent &event, WX_NSEvent cocoaEvent);
+    virtual void Cocoa_FrameChanged(void);
+    virtual bool Cocoa_drawRect(const NSRect &rect);
+    virtual bool Cocoa_mouseDown(WX_NSEvent theEvent);
+    virtual bool Cocoa_mouseDragged(WX_NSEvent theEvent);
+    virtual bool Cocoa_mouseUp(WX_NSEvent theEvent);
+    virtual bool Cocoa_mouseMoved(WX_NSEvent theEvent);
+    virtual bool Cocoa_mouseEntered(WX_NSEvent theEvent);
+    virtual bool Cocoa_mouseExited(WX_NSEvent theEvent);
+    virtual bool Cocoa_rightMouseDown(WX_NSEvent theEvent);
+    virtual bool Cocoa_rightMouseDragged(WX_NSEvent theEvent);
+    virtual bool Cocoa_rightMouseUp(WX_NSEvent theEvent);
+    virtual bool Cocoa_otherMouseDown(WX_NSEvent theEvent);
+    virtual bool Cocoa_otherMouseDragged(WX_NSEvent theEvent);
+    virtual bool Cocoa_otherMouseUp(WX_NSEvent theEvent);
     void SetNSView(WX_NSView cocoaNSView);
     WX_NSView m_cocoaNSView;
-    WX_NSView m_dummyNSView;
+    wxWindowCocoaHider *m_cocoaHider;
+    wxWindowCocoaScroller *m_cocoaScroller;
+    bool m_isInPaint;
+    static wxWindow *sm_capturedWindow;
+    virtual void CocoaReplaceView(WX_NSView oldView, WX_NSView newView);
+    void SetInitialFrameRect(const wxPoint& pos, const wxSize& size);
+#ifdef __OBJC__
+    inline NSRect MakeDefaultNSRect(const wxSize& size)
+    {
+        // NOTE: position is 10,10 to make it "obvious" that it's out of place
+        return NSMakeRect(10.0,10.0,WidthDefault(size.x),HeightDefault(size.y));
+    }
+#endif //def __OBJC__
 // ------------------------------------------------------------------------
 // Implementation
 // ------------------------------------------------------------------------
@@ -73,8 +114,6 @@ public:
     virtual void WarpPointer(int x_pos, int y_pos) ;
     // Send the window a refresh event
     virtual void Refresh(bool eraseBack = TRUE, const wxRect *rect = NULL);
-    // Clear the window
-    virtual void Clear();
     // Set/get the window's font
     virtual bool SetFont(const wxFont& f);
 //    inline virtual wxFont& GetFont() const;
@@ -93,6 +132,7 @@ public:
     virtual int GetScrollThumb(int orient) const;
     virtual int GetScrollRange(int orient) const;
     virtual void ScrollWindow(int dx, int dy, const wxRect *rect = NULL);
+    virtual void DoSetVirtualSize(int x, int y);
     // Get the private handle (platform-dependent)
     virtual WXWidget GetHandle() const;
     // Convert client to screen coordinates