X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7e8f0df9532601e54e7b6bec7c97e2bf2b164bf1..6c3c55cf30584177001a3fdbfe0a011cac3f8996:/wxPython/src/_sizers.i?ds=sidebyside diff --git a/wxPython/src/_sizers.i b/wxPython/src/_sizers.i index 4544eac9dc..1846e410d0 100644 --- a/wxPython/src/_sizers.i +++ b/wxPython/src/_sizers.i @@ -56,7 +56,7 @@ methods are called. { wxPyUserData* data = NULL; if ( userData ) { - bool blocked = wxPyBeginBlockThreads(); + wxPyBlock_t blocked = wxPyBeginBlockThreads(); data = new wxPyUserData(userData); wxPyEndBlockThreads(blocked); } @@ -74,7 +74,7 @@ methods are called. { wxPyUserData* data = NULL; if ( userData ) { - bool blocked = wxPyBeginBlockThreads(); + wxPyBlock_t blocked = wxPyBeginBlockThreads(); data = new wxPyUserData(userData); wxPyEndBlockThreads(blocked); } @@ -91,7 +91,7 @@ methods are called. { wxPyUserData* data = NULL; if ( userData ) { - bool blocked = wxPyBeginBlockThreads(); + wxPyBlock_t blocked = wxPyBeginBlockThreads(); data = new wxPyUserData(userData); wxPyEndBlockThreads(blocked); } @@ -145,7 +145,7 @@ added, if needed.", ""); DocStr(SetRatio, "Set the ratio item attribute.", ""); %Rename(SetRatioWH, void, SetRatio( int width, int height )); - %Rename(SetRatioSize, void, SetRatio( wxSize size )); + %Rename(SetRatioSize, void, SetRatio( const wxSize& size )); void SetRatio( float ratio ); DocDeclStr( @@ -364,6 +364,12 @@ standard font as well as the overall design of Mac widgets requires more space than on Windows, then the initial size of a dialog using a sizer will automatically be bigger on Mac than on Windows.", " +Sizers may also be used to control the layout of custom drawn items on +the window. The `Add`, `Insert`, and `Prepend` functions return a +pointer to the newly added `wx.SizerItem`. Just add empty space of the +desired size and attributes, and then use the `wx.SizerItem.GetRect` +method to determine where the drawing operations should take place. + :note: If you wish to create a custom sizer class in wxPython you should derive the class from `wx.PySizer` in order to get Python-aware capabilities for the various virtual methods. @@ -450,7 +456,7 @@ public: |- wx.ALL | | | | | +----------------------------+------------------------------------------+ - |- wx.EXAPAND |The item will be expanded to fill | + |- wx.EXPAND |The item will be expanded to fill | | |the space allotted to the item. | +----------------------------+------------------------------------------+ |- wx.SHAPED |The item will be expanded as much as | @@ -490,7 +496,7 @@ public: PyObject* userData=NULL) { wxPyUserData* data = NULL; - bool blocked = wxPyBeginBlockThreads(); + wxPyBlock_t blocked = wxPyBeginBlockThreads(); wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, true, false); if ( userData && (info.window || info.sizer || info.gotSize) ) data = new wxPyUserData(userData); @@ -521,7 +527,7 @@ the item at index *before*. See `Add` for a description of the parameters.", "" int border=0, PyObject* userData=NULL) { wxPyUserData* data = NULL; - bool blocked = wxPyBeginBlockThreads(); + wxPyBlock_t blocked = wxPyBeginBlockThreads(); wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, true, false); if ( userData && (info.window || info.sizer || info.gotSize) ) data = new wxPyUserData(userData); @@ -553,7 +559,7 @@ this sizer. See `Add` for a description of the parameters.", ""); PyObject* userData=NULL) { wxPyUserData* data = NULL; - bool blocked = wxPyBeginBlockThreads(); + wxPyBlock_t blocked = wxPyBeginBlockThreads(); wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, true, false); if ( userData && (info.window || info.sizer || info.gotSize) ) data = new wxPyUserData(userData); @@ -589,7 +595,7 @@ and removed.", " instead. "); bool Remove(PyObject* item) { - bool blocked = wxPyBeginBlockThreads(); + wxPyBlock_t blocked = wxPyBeginBlockThreads(); wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, false, true); wxPyEndBlockThreads(blocked); if ( info.window ) @@ -611,7 +617,7 @@ do so. The *item* parameter can be either a window, a sizer, or the zero-based index of the item to be detached. Returns True if the child item was found and detached.", ""); bool Detach(PyObject* item) { - bool blocked = wxPyBeginBlockThreads(); + wxPyBlock_t blocked = wxPyBeginBlockThreads(); wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, false, true); wxPyEndBlockThreads(blocked); if ( info.window ) @@ -629,9 +635,9 @@ was found and detached.", ""); "GetItem(self, item) -> wx.SizerItem", "Returns the `wx.SizerItem` which holds the *item* given. The *item* parameter can be either a window, a sizer, or the zero-based index of -the item to be detached.", ""); +the item to be found.", ""); wxSizerItem* GetItem(PyObject* item) { - bool blocked = wxPyBeginBlockThreads(); + wxPyBlock_t blocked = wxPyBeginBlockThreads(); wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, false, true); wxPyEndBlockThreads(blocked); if ( info.window ) @@ -646,7 +652,7 @@ the item to be detached.", ""); void _SetItemMinSize(PyObject* item, const wxSize& size) { - bool blocked = wxPyBeginBlockThreads(); + wxPyBlock_t blocked = wxPyBeginBlockThreads(); wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, false, true); wxPyEndBlockThreads(blocked); if ( info.window ) @@ -889,7 +895,7 @@ parameter can be either a window, a sizer, or the zero-based index of the item. Use the recursive parameter to show or hide an item in a subsizer. Returns True if the item was found.", ""); bool Show(PyObject* item, bool show = true, bool recursive=false) { - bool blocked = wxPyBeginBlockThreads(); + wxPyBlock_t blocked = wxPyBeginBlockThreads(); wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, false, true); wxPyEndBlockThreads(blocked); if ( info.window ) @@ -909,7 +915,7 @@ item disappear or reappear, use Show followed by `Layout`. The *item* parameter can be either a window, a sizer, or the zero-based index of the item.", ""); bool IsShown(PyObject* item) { - bool blocked = wxPyBeginBlockThreads(); + wxPyBlock_t blocked = wxPyBeginBlockThreads(); wxPySizerItemInfo info = wxPySizerItemTypeHelper(item, false, false); wxPyEndBlockThreads(blocked); if ( info.window ) @@ -926,7 +932,7 @@ the item.", ""); %pythoncode { def Hide(self, item, recursive=False): """ - A convenience method for Show(item, False, recursive). + A convenience method for `Show` (item, False, recursive). """ return self.Show(item, False, recursive) } @@ -936,6 +942,10 @@ the item.", ""); void , ShowItems(bool show), "Recursively call `wx.SizerItem.Show` on all sizer items.", ""); + // TODO: + // void Show(bool show); + // bool IsShown(); + };