]> git.saurik.com Git - wxWidgets.git/commitdiff
Changes needed for new RTL methods, and also various other updates to
authorRobin Dunn <robin@alldunn.com>
Mon, 4 Sep 2006 23:52:47 +0000 (23:52 +0000)
committerRobin Dunn <robin@alldunn.com>
Mon, 4 Sep 2006 23:52:47 +0000 (23:52 +0000)
wx CVS.

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

wxPython/docs/CHANGES.txt
wxPython/src/_accel.i
wxPython/src/_app.i
wxPython/src/_defs.i
wxPython/src/_functions.i
wxPython/src/_intl.i
wxPython/src/_menu.i
wxPython/src/_sizers.i
wxPython/src/_window.i
wxPython/src/aui.i

index 8cdc4804478347fd4151cba735c42f7af41c6217..0fbd366d0bdbac2026c2600e15889e951eeaba45 100644 (file)
@@ -213,6 +213,9 @@ Added wx.NativePixelBuffer, wx.AlphPixelBuffer and related iterator
 and accessor classes.  They allow platform independent direct access
 to the platform specific pixel buffer inside of a wx.Bitmap object.
 
+The beginnings of support for RTL languages has been added, thanks to
+a Google SoC project.  
+
 
 
 
index cc39208d4b795f8c26746b52be54b4b97024479b..85f441e0b60a94e90475399f5d92939ad58d017d 100644 (file)
@@ -81,7 +81,25 @@ public:
     DocDeclStr(
         int , GetCommand(),
         "Get the AcceleratorEntry's command ID.", "");
+    
+    DocDeclStr(
+        bool , IsOk() const,
+        "", "");
+    
+    
+    DocDeclStr(
+        wxString , ToString() const,
+        "Returns a string representation for the this accelerator.  The string
+is formatted using the <flags>-<keycode> format where <flags> maybe a
+hyphen-separed list of \"shift|alt|ctrl\"
+", "");
+    
 
+    DocDeclStr(
+        bool , FromString(const wxString &str),
+        "Returns true if the given string correctly initialized this object.", "");
+    
+    
     %property(Command, GetCommand, doc="See `GetCommand`");
     %property(Flags, GetFlags, doc="See `GetFlags`");
     %property(KeyCode, GetKeyCode, doc="See `GetKeyCode`");
index 4ffdbe075d8145520444d561d1bdb22b90f42dcb..27790ba05e13989fa8c45ab3879fa7abf9f639c8 100644 (file)
@@ -153,6 +153,11 @@ all top level windows have been closed and destroyed.", "");
 :see: `wx.Exit`", "");
 
     
+    DocDeclStr(
+        virtual wxLayoutDirection , GetLayoutDirection() const,
+        "Return the layout direction for the current locale.", "");
+    
+    
     DocDeclStr(
         virtual void, ExitMainLoop(),
         "Exit the main GUI loop during the next iteration of the main
index db35ec1875a50212bded44949ba67c982318fd17..c2b5eb4fb2060a24d638c674b9412906566b7e75 100644 (file)
@@ -611,6 +611,7 @@ enum {
     wxID_CLOSE_ALL,
     wxID_PREFERENCES,
 
+    wxID_EDIT,
     wxID_CUT,
     wxID_COPY,
     wxID_PASTE,
@@ -633,6 +634,7 @@ enum {
     wxID_VIEW_SORTSIZE,
     wxID_VIEW_SORTTYPE,
 
+    wxID_FILE,
     wxID_FILE1,
     wxID_FILE2,
     wxID_FILE3,
index 70ec6dd4b13063e0108aa538e1128e6398f50a6a..533a0aa9577f7a7cb7798f951e1538c2fc6941ee 100644 (file)
@@ -38,11 +38,18 @@ bool wxIsStockID(wxWindowID id);
 // given ID
 bool wxIsStockLabel(wxWindowID id, const wxString& label);
 
+enum wxStockLabelQueryFlag
+{
+    wxSTOCK_NOFLAGS = 0,
+
+    wxSTOCK_WITH_MNEMONIC = 1,
+    wxSTOCK_WITH_ACCELERATOR = 2
+};
+
 // Returns label that should be used for given stock UI element (e.g. "&OK"
 // for wxID_OK):
 wxString wxGetStockLabel(wxWindowID id,
-                         bool withCodes = true,
-                         wxString accelerator = wxPyEmptyString);
+                         long flags = wxSTOCK_WITH_MNEMONIC);
  
 
 MustHaveApp(wxBell);
index 32b102bad91b751f23fa06a01234426fd4b109de..4b992086ee5642ed54dfe5657846e2f8454704f6 100644 (file)
 //---------------------------------------------------------------------------
 %newgroup
 
+enum wxLayoutDirection
+{
+    wxLayout_Default,
+    wxLayout_LeftToRight,
+    wxLayout_RightToLeft
+};
+
 
 enum wxLanguage
 {
index 3db6b187862d2cb582ff79d6704dea5cc62bd0a5..a0d58d7b40cfcf803475a6bbf4745bc2db690cb7 100644 (file)
@@ -33,7 +33,7 @@ public:
     
     // append any kind of item (normal/check/radio/separator)
     wxMenuItem* Append(int id,
-                       const wxString& text,
+                       const wxString& text = wxPyEmptyString,
                        const wxString& help = wxPyEmptyString,
                        wxItemKind kind = wxITEM_NORMAL);
 
@@ -76,7 +76,7 @@ public:
     // insert an item before given position
     wxMenuItem* Insert(size_t pos,
                        int id,
-                       const wxString& text,
+                       const wxString& text = wxPyEmptyString,
                        const wxString& help = wxPyEmptyString,
                        wxItemKind kind = wxITEM_NORMAL);
 
@@ -104,7 +104,7 @@ public:
 
     // prepend any item to the menu
     wxMenuItem* Prepend(int id,
-                        const wxString& text,
+                        const wxString& text = wxPyEmptyString,
                         const wxString& help = wxPyEmptyString,
                         wxItemKind kind = wxITEM_NORMAL);
 
index c7bb1356a6384475137658c24bef222e2dcb1676..a009cad8f178beca68757e831882376d53db5b17 100644 (file)
@@ -608,6 +608,7 @@ this sizer.  See `Add` for a description of the parameters.", "");
 //    virtual wxSizerItem* PrependSpacer(int size);
 //    virtual wxSizerItem* PrependStretchSpacer(int prop = 1);
 
+        
         DocAStr(Remove,
                 "Remove(self, item) -> bool",
                 "Removes an item from the sizer and destroys it.  This method does not
@@ -692,6 +693,48 @@ the item to be found.", "");
         }
     }
 
+    
+    %Rename(_ReplaceWin,
+            bool, Replace( wxWindow *oldwin, wxWindow *newwin, bool recursive = false ));
+    %Rename(_ReplaceSizer,
+            bool, Replace( wxSizer *oldsz, wxSizer *newsz, bool recursive = false ));
+    %Rename(_ReplaceItem,
+            bool, Replace( size_t index, wxSizerItem *newitem ));
+    %pythoncode {
+        def Replace(self, olditem, item, recursive=False):
+            """
+            Detaches the given ``olditem`` from the sizer and replaces it with
+            ``item`` which can be a window, sizer, or `wx.SizerItem`.  The
+            detached child is destroyed only if it is not a window, (because
+            windows are owned by their parent, not the sizer.)  The
+            ``recursive`` parameter can be used to search for the given
+            element recursivly in subsizers.
+
+            This method does not cause any layout or resizing to take place,
+            call `Layout` to do so.
+
+            Returns ``True`` if the child item was found and removed.
+            """
+            if isinstance(olditem, wx.Window):
+                return self._ReplaceWin(olditem, item, recursive)
+            elif isinstnace(olditem, wx.Sizer):
+                return self._ReplaceSizer(olditem, item, recursive)
+            elif isinstnace(olditem, int):
+                return self._ReplaceItem(olditem, item)
+            else:
+                raise TypeError("Expected Window, Sizer, or integer for first parameter.")
+    }
+    
+    
+    DocDeclStr(
+        void , SetContainingWindow(wxWindow *window),
+        "Set (or unset) the window this sizer is used in.", "");
+    
+    DocDeclStr(
+        wxWindow *, GetContainingWindow() const,
+        "Get the window this sizer is used in.", "");
+        
+
     %pythoncode {
     def SetItemMinSize(self, item, *args):
         """
index acce307be424becb8abbded3dd24d627713ba199..10844879f65825849bc6bac6ca3b5c265d33516d 100644 (file)
@@ -373,6 +373,25 @@ autogenerated) id", "");
 autogenerated) id", "");
     
 
+    DocDeclStr(
+        virtual wxLayoutDirection , GetLayoutDirection() const,
+        "Get the layout direction (LTR or RTL) for this window.  Returns
+``wx.Layout_Default`` if layout direction is not supported.", "");
+    
+    DocDeclStr(
+        virtual void , SetLayoutDirection(wxLayoutDirection dir),
+        "Set the layout direction (LTR or RTL) for this window.", "");
+    
+
+    DocDeclStr(
+        virtual wxCoord , AdjustForLayoutDirection(wxCoord x,
+                                             wxCoord width,
+                                                   wxCoord widthTotal) const,
+        "Mirror coordinates for RTL layout if this window uses it and if the
+mirroring is not done automatically like Win32.", "");
+    
+
+    
 
 
     // moving/resizing
@@ -2049,11 +2068,9 @@ opaque.", "");
     %property(ExtraStyle, GetExtraStyle, SetExtraStyle, doc="See `GetExtraStyle` and `SetExtraStyle`");
     %property(Font, GetFont, SetFont, doc="See `GetFont` and `SetFont`");
     %property(ForegroundColour, GetForegroundColour, SetForegroundColour, doc="See `GetForegroundColour` and `SetForegroundColour`");
-    %property(FullTextExtent, GetFullTextExtent, doc="See `GetFullTextExtent`");
     %property(GrandParent, GetGrandParent, doc="See `GetGrandParent`");
     %property(Handle, GetHandle, doc="See `GetHandle`");
     %property(HelpText, GetHelpText, SetHelpText, doc="See `GetHelpText` and `SetHelpText`");
-    %property(HelpTextAtPoint, GetHelpTextAtPoint, doc="See `GetHelpTextAtPoint`");
     %property(Id, GetId, SetId, doc="See `GetId` and `SetId`");
     %property(Label, GetLabel, SetLabel, doc="See `GetLabel` and `SetLabel`");
     %property(MaxHeight, GetMaxHeight, doc="See `GetMaxHeight`");
@@ -2068,12 +2085,8 @@ opaque.", "");
     %property(Rect, GetRect, SetRect, doc="See `GetRect` and `SetRect`");
     %property(ScreenPosition, GetScreenPosition, doc="See `GetScreenPosition`");
     %property(ScreenRect, GetScreenRect, doc="See `GetScreenRect`");
-    %property(ScrollPos, GetScrollPos, SetScrollPos, doc="See `GetScrollPos` and `SetScrollPos`");
-    %property(ScrollRange, GetScrollRange, doc="See `GetScrollRange`");
-    %property(ScrollThumb, GetScrollThumb, doc="See `GetScrollThumb`");
     %property(Size, GetSize, SetSize, doc="See `GetSize` and `SetSize`");
     %property(Sizer, GetSizer, SetSizer, doc="See `GetSizer` and `SetSizer`");
-    %property(TextExtent, GetTextExtent, doc="See `GetTextExtent`");
     %property(ThemeEnabled, GetThemeEnabled, SetThemeEnabled, doc="See `GetThemeEnabled` and `SetThemeEnabled`");
     %property(ToolTip, GetToolTip, SetToolTip, doc="See `GetToolTip` and `SetToolTip`");
     %property(UpdateClientRect, GetUpdateClientRect, doc="See `GetUpdateClientRect`");
@@ -2084,6 +2097,10 @@ opaque.", "");
     %property(WindowStyleFlag, GetWindowStyleFlag, SetWindowStyleFlag, doc="See `GetWindowStyleFlag` and `SetWindowStyleFlag`");
     %property(WindowVariant, GetWindowVariant, SetWindowVariant, doc="See `GetWindowVariant` and `SetWindowVariant`");
 
+    %property(Shown, IsShown, Show, doc="See `IsShown` and `Show`");
+    %property(Enabled, IsEnabled, Enable, doc="See `IsEnabled` and `Enable`");
+    %property(TopLevel, IsTopLevel, doc="See `IsTopLevel`");
+    
 };
 
 
index 2c5857c6f4f87d37cdeb067499c9f60eed35c0c1..68202adbf1405fa2af4fd98a32b546946617df11 100755 (executable)
@@ -264,6 +264,7 @@ class wxPyDockArt :  public wxDefaultDockArt
     DEC_PYCALLBACK__INTCOLOUR(SetColour);
 
     virtual void DrawSash(wxDC& dc,
+                          wxWindow* window,
                           int orientation,
                           const wxRect& rect)
     {
@@ -271,18 +272,20 @@ class wxPyDockArt :  public wxDefaultDockArt
         wxPyBlock_t blocked = wxPyBeginBlockThreads();
         if ((found = wxPyCBH_findCallback(m_myInst, "DrawSash"))) {
             PyObject* odc = wxPyMake_wxObject(&dc, false);
+            PyObject* owin = wxPyMake_wxObject(window, false);
             PyObject* orect = wxPyConstructObject((void*)&rect, wxT("wxRect"), 0);
-            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OiO)",
-                                                         odc, orientation, orect));
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOiO)",
+                                                         odc, owin, orientation, orect));
             Py_DECREF(odc);
             Py_DECREF(orect);
         }
         wxPyEndBlockThreads(blocked);
         if (! found)
-            wxDefaultDockArt::DrawSash(dc, orientation, rect);
+            wxDefaultDockArt::DrawSash(dc, window, orientation, rect);
     }
 
     virtual void DrawBackground(wxDC& dc,
+                          wxWindow* window,
                           int orientation,
                           const wxRect& rect)
     {
@@ -290,18 +293,20 @@ class wxPyDockArt :  public wxDefaultDockArt
         wxPyBlock_t blocked = wxPyBeginBlockThreads();
         if ((found = wxPyCBH_findCallback(m_myInst, "DrawBackground"))) {
             PyObject* odc = wxPyMake_wxObject(&dc, false);
+            PyObject* owin = wxPyMake_wxObject(window, false);
             PyObject* orect = wxPyConstructObject((void*)&rect, wxT("wxRect"), 0);
-            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OiO)",
-                                                         odc, orientation, orect));
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOiO)",
+                                                         odc, owin, orientation, orect));
             Py_DECREF(odc);
             Py_DECREF(orect);
         }
         wxPyEndBlockThreads(blocked);
         if (! found)
-            wxDefaultDockArt::DrawBackground(dc, orientation, rect);
+            wxDefaultDockArt::DrawBackground(dc, window, orientation, rect);
     }
 
     virtual void DrawCaption(wxDC& dc,
+                          wxWindow* window,
                           const wxString& text,
                           const wxRect& rect,
                           wxPaneInfo& pane)
@@ -310,11 +315,12 @@ class wxPyDockArt :  public wxDefaultDockArt
         wxPyBlock_t blocked = wxPyBeginBlockThreads();
         if ((found = wxPyCBH_findCallback(m_myInst, "DrawCaption"))) {
             PyObject* odc = wxPyMake_wxObject(&dc, false);
+            PyObject* owin = wxPyMake_wxObject(window, false);
             PyObject* otext = wx2PyString(text);
             PyObject* orect = wxPyConstructObject((void*)&rect, wxT("wxRect"), 0);
             PyObject* opane = wxPyConstructObject((void*)&pane, wxT("wxPaneInfo"), 0);
-            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOOO)",
-                                                         odc, otext, orect, opane));
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOOOO)",
+                                                         odc, owin, otext, orect, opane));
             Py_DECREF(odc);
             Py_DECREF(otext);
             Py_DECREF(orect);
@@ -322,10 +328,11 @@ class wxPyDockArt :  public wxDefaultDockArt
        }
         wxPyEndBlockThreads(blocked);
         if (! found)
-            wxDefaultDockArt::DrawCaption(dc, text, rect, pane);
+            wxDefaultDockArt::DrawCaption(dc, window, text, rect, pane);
     }
 
     virtual void DrawGripper(wxDC& dc,
+                          wxWindow* window,
                           const wxRect& rect,
                           wxPaneInfo& pane)
     {
@@ -333,19 +340,21 @@ class wxPyDockArt :  public wxDefaultDockArt
         wxPyBlock_t blocked = wxPyBeginBlockThreads();
         if ((found = wxPyCBH_findCallback(m_myInst, "DrawGripper"))) {
             PyObject* odc = wxPyMake_wxObject(&dc, false);
+            PyObject* owin = wxPyMake_wxObject(window, false);
             PyObject* orect = wxPyConstructObject((void*)&rect, wxT("wxRect"), 0);
             PyObject* opane = wxPyConstructObject((void*)&pane, wxT("wxPaneInfo"), 0);
-            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOO)", odc, orect, opane));
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOOO)", odc, owin, orect, opane));
             Py_DECREF(odc);
             Py_DECREF(orect);
             Py_DECREF(opane);
         }
         wxPyEndBlockThreads(blocked);
         if (! found)
-            wxDefaultDockArt::DrawGripper(dc, rect, pane);
+            wxDefaultDockArt::DrawGripper(dc, window, rect, pane);
     }
 
     virtual void DrawBorder(wxDC& dc,
+                          wxWindow* window,
                           const wxRect& rect,
                           wxPaneInfo& pane)
     {
@@ -353,6 +362,7 @@ class wxPyDockArt :  public wxDefaultDockArt
         wxPyBlock_t blocked = wxPyBeginBlockThreads();
         if ((found = wxPyCBH_findCallback(m_myInst, "DrawBorder"))) {
             PyObject* odc = wxPyMake_wxObject(&dc, false);
+            PyObject* owin = wxPyMake_wxObject(window, false);
             PyObject* orect = wxPyConstructObject((void*)&rect, wxT("wxRect"), 0);
             PyObject* opane = wxPyConstructObject((void*)&pane, wxT("wxPaneInfo"), 0);
             wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOO)", odc, orect, opane));
@@ -362,10 +372,11 @@ class wxPyDockArt :  public wxDefaultDockArt
        }
         wxPyEndBlockThreads(blocked);
         if (! found)
-            wxDefaultDockArt::DrawBorder(dc, rect, pane);
+            wxDefaultDockArt::DrawBorder(dc, window, rect, pane);
     }
 
     virtual void DrawPaneButton(wxDC& dc,
+                          wxWindow* window,
                           int button,
                           int button_state,
                           const wxRect& rect,
@@ -375,10 +386,11 @@ class wxPyDockArt :  public wxDefaultDockArt
         wxPyBlock_t blocked = wxPyBeginBlockThreads();
         if ((found = wxPyCBH_findCallback(m_myInst, "DrawPaneButton"))) {
             PyObject* odc = wxPyMake_wxObject(&dc, false);
+            PyObject* owin = wxPyMake_wxObject(window, false);
             PyObject* orect = wxPyConstructObject((void*)&rect, wxT("wxRect"), 0);
             PyObject* opane = wxPyConstructObject((void*)&pane, wxT("wxPaneInfo"), 0);
-            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OiIOO)",
-                                                         odc, button, button_state,
+            wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOiIOO)",
+                                                         odc, owin, button, button_state,
                                                          orect, opane));
             Py_DECREF(odc);
             Py_DECREF(orect);
@@ -386,7 +398,7 @@ class wxPyDockArt :  public wxDefaultDockArt
         }
         wxPyEndBlockThreads(blocked);
         if (! found)
-            wxDefaultDockArt::DrawPaneButton(dc, button, button_state, rect, pane);
+            wxDefaultDockArt::DrawPaneButton(dc, window, button, button_state, rect, pane);
     }
 
     PYPRIVATE;