X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b39c3fa09a936e6a3f386a67c0fc7cfd84df0168..7f8c0d74d7025b6c677fbd88890ea10d302ef3d5:/wxPython/src/_window.i diff --git a/wxPython/src/_window.i b/wxPython/src/_window.i index b027f9f3b9..66932fa7cc 100644 --- a/wxPython/src/_window.i +++ b/wxPython/src/_window.i @@ -232,7 +232,7 @@ public: DocDeclStr( - bool , Close( bool force = False ), + bool , Close( bool force = false ), "This function simply generates a EVT_CLOSE event whose handler usually tries to close the window. It doesn't close the window itself, however. If force is False (the default) then the window's close @@ -389,11 +389,18 @@ autogenerated) id", ""); int sizeFlags = wxSIZE_AUTO ), "Sets the position and size of the window in pixels. The sizeFlags parameter indicates the interpretation of the other params if they are --1. wx.SIZE_AUTO*: a -1 indicates that a class-specific default -shoudl be used. wx.SIZE_USE_EXISTING: existing dimensions should be -used if -1 values are supplied. wxSIZE_ALLOW_MINUS_ONE: allow -dimensions of -1 and less to be interpreted as real dimensions, not -default values.", "", +equal to -1. + + ======================== ====================================== + wx.SIZE_AUTO A -1 indicates that a class-specific + default should be used. + wx.SIZE_USE_EXISTING Axisting dimensions should be used if + -1 values are supplied. + wxSIZE_ALLOW_MINUS_ONE Allow dimensions of -1 and less to be + interpreted as real dimensions, not + default values. + ======================== ====================================== +", "", SetDimensions); @@ -448,8 +455,8 @@ wx.Window.SetSize, since the application need not worry about what dimensions the border or title bar have when trying to fit the window around panel items, for example.", ""); void SetClientSize( const wxSize& size ); - %name(SetClientSizeWH) void SetClientSize( int width, int height ); - %name(SetClientRect) void SetClientSize(const wxRect& rect); + %Rename(SetClientSizeWH, void, SetClientSize( int width, int height )); + %Rename(SetClientRect, void, SetClientSize(const wxRect& rect)); DocStr(GetPosition, // sets the docstring for both @@ -588,7 +595,6 @@ anything if there are no subwindows.", ""); - %nokwargs SetSizeHints; DocStr(SetSizeHints, "Allows specification of minimum and maximum window sizes, and window size increments. If a pair of values is not set (or set to -1), the @@ -601,24 +607,25 @@ The resizing increments are only significant under Motif or Xt.", " :see: `GetMinSize`, `GetMaxSize`, `SetMinSize`, `SetMaxSize` "); - void SetSizeHints( const wxSize& minSize, - const wxSize& maxSize=wxDefaultSize, - const wxSize& incSize=wxDefaultSize); virtual void SetSizeHints( int minW, int minH, int maxW = -1, int maxH = -1, int incW = -1, int incH = -1 ); + %Rename(SetSizeHintsSz, void, SetSizeHints( const wxSize& minSize, + const wxSize& maxSize=wxDefaultSize, + const wxSize& incSize=wxDefaultSize)); - %nokwargs SetVirtualSizeHints; DocStr(SetVirtualSizeHints, "Allows specification of minimum and maximum virtual window sizes. If a pair of values is not set (or set to -1), the default values will be used. If this function is called, the user will not be able to size the virtual area of the window outside the given bounds.", ""); - void SetVirtualSizeHints( const wxSize& minSize, - const wxSize& maxSize=wxDefaultSize); virtual void SetVirtualSizeHints( int minW, int minH, int maxW = -1, int maxH = -1 ); + %Rename(SetVirtualSizeHintsSz, void, SetVirtualSizeHints( + const wxSize& minSize, const wxSize& maxSize=wxDefaultSize)); + + DocDeclStr( virtual wxSize , GetMaxSize() const, @@ -663,7 +670,7 @@ max size.", ""); is just the client area of the window, but for some like scrolled windows it is more or less independent of the screen window size.", ""); void SetVirtualSize(const wxSize& size ); - %name(SetVirtualSizeWH) void SetVirtualSize( int w, int h ); + %Rename(SetVirtualSizeWH, void, SetVirtualSize( int w, int h )); DocStr(GetVirtualSize, @@ -696,7 +703,7 @@ sizer, interior children, or other means)", ""); // ------------ DocDeclStr( - virtual bool , Show( bool show = True ), + virtual bool , Show( bool show = true ), "Shows or hides the window. You may need to call Raise for a top level window if you want to bring it to top, although this is not needed if Show is called immediately after the frame creation. Returns True if @@ -709,7 +716,7 @@ because it already was in the requested state.", ""); DocDeclStr( - virtual bool , Enable( bool enable = True ), + virtual bool , Enable( bool enable = true ), "Enable or disable the window for user input. Note that when a parent window is disabled, all of its children are disabled as well and they are reenabled again when the parent is. Returns true if the window @@ -772,7 +779,7 @@ SetWindowStyleFlag()", ""); DocDeclStr( - virtual void , MakeModal(bool modal = True), + virtual void , MakeModal(bool modal = true), "Disables all other windows in the application so that the user can only interact with this window. Passing False will reverse this effect.", ""); @@ -1015,7 +1022,7 @@ remove the event handler.", ""); DocDeclStr( - wxEvtHandler *, PopEventHandler( bool deleteHandler = False ), + wxEvtHandler *, PopEventHandler( bool deleteHandler = false ), "Removes and returns the top-most event handler on the event handler stack. If deleteHandler is True then the wx.EvtHandler object will be destroyed after it is popped.", ""); @@ -1110,7 +1117,7 @@ hotkey was registered successfully.", ""); %#if wxUSE_HOTKEY return self->RegisterHotKey(hotkeyId, modifiers, keycode); %#else - return False; + return false; %#endif } @@ -1121,7 +1128,7 @@ hotkey was registered successfully.", ""); #if wxUSE_HOTKEY return self->UnregisterHotKey(hotkeyId); #else - return False; + return false; #endif } } @@ -1138,10 +1145,10 @@ changes. For the x dimension, the dialog units are multiplied by the average character width and then divided by 4. For the y dimension, the dialog units are multiplied by the average character height and then divided by 8.", ""); - %name(ConvertDialogPointToPixels) wxPoint ConvertDialogToPixels(const wxPoint& pt); - %name(ConvertDialogSizeToPixels) wxSize ConvertDialogToPixels(const wxSize& sz); - %name(DLG_PNT) wxPoint ConvertDialogToPixels(const wxPoint& pt); - %name(DLG_SZE) wxSize ConvertDialogToPixels(const wxSize& sz); + %Rename(ConvertDialogPointToPixels, wxPoint, ConvertDialogToPixels(const wxPoint& pt)); + %Rename(ConvertDialogSizeToPixels, wxSize, ConvertDialogToPixels(const wxSize& sz)); + %Rename(DLG_PNT, wxPoint, ConvertDialogToPixels(const wxPoint& pt)); + %Rename(DLG_SZE, wxSize, ConvertDialogToPixels(const wxSize& sz)); DocStr(ConvertPixelPointToDialog, @@ -1151,8 +1158,8 @@ changes. For the x dimension, the dialog units are multiplied by the average character width and then divided by 4. For the y dimension, the dialog units are multiplied by the average character height and then divided by 8.", ""); - %name(ConvertPixelPointToDialog) wxPoint ConvertPixelsToDialog(const wxPoint& pt); - %name(ConvertPixelSizeToDialog) wxSize ConvertPixelsToDialog(const wxSize& sz); + %Rename(ConvertPixelPointToDialog, wxPoint, ConvertPixelsToDialog(const wxPoint& pt)); + %Rename(ConvertPixelSizeToDialog, wxSize, ConvertPixelsToDialog(const wxSize& sz)); @@ -1200,7 +1207,7 @@ release the mouse as many times as you capture it.", ""); // ------------------- DocDeclStr( - virtual void , Refresh( bool eraseBackground = True, + virtual void , Refresh( bool eraseBackground = true, const wxRect *rect = NULL ), "Mark the specified rectangle (or the whole window) as \"dirty\" so it will be repainted. Causes an EVT_PAINT event to be generated and sent @@ -1208,7 +1215,7 @@ to the window.", ""); DocDeclStr( - void , RefreshRect(const wxRect& rect), + void , RefreshRect(const wxRect& rect, bool eraseBackground = true), "Redraws the contents of the given rectangle: the area inside it will be repainted. This is the same as Refresh but has a nicer syntax.", ""); @@ -1277,8 +1284,8 @@ since the last repaint. Call this in an paint event handler to optimize redrawing by only redrawing those areas, which have been exposed.", ""); bool IsExposed( int x, int y, int w=1, int h=1 ) const; - %name(IsExposedPoint) bool IsExposed( const wxPoint& pt ) const; - %name(IsExposedRect) bool IsExposed( const wxRect& rect ) const; + %Rename(IsExposedPoint, bool, IsExposed( const wxPoint& pt ) const); + %Rename(IsExposedRect, bool, IsExposed( const wxRect& rect ) const); @@ -1355,10 +1362,56 @@ not be used at all.", ""); "Returns the foreground colour of the window. The interpretation of foreground colour is dependent on the window class; it may be the text colour or other colour, or it may not be used at all.", ""); + +// TODO: +// // if the window shouldn't inherit its colour from the parent, override +// // this function to return true +// // +// // this is currently only used by wxMSW and wxUniv but should be useful for +// // the other ports too +// virtual bool ProvidesBackground() const; + + + // Set/get the background style. + // Pass one of wxBG_STYLE_SYSTEM, wxBG_STYLE_COLOUR, wxBG_STYLE_CUSTOM + DocDeclStr( + virtual bool , SetBackgroundStyle(wxBackgroundStyle style), + "Returns the background style of the window. The background style +indicates how the background of the window is drawn. + + ====================== ======================================== + wx.BG_STYLE_SYSTEM The background colour or pattern should + be determined by the system + wx.BG_STYLE_COLOUR The background should be a solid colour + wx.BG_STYLE_CUSTOM The background will be implemented by the + application. + ====================== ======================================== + +On GTK+, use of wx.BG_STYLE_CUSTOM allows the flicker-free drawing of +a custom background, such as a tiled bitmap. Currently the style has +no effect on other platforms. + +:see: `GetBackgroundStyle`, `SetBackgroundColour`", ""); + DocDeclStr( + virtual wxBackgroundStyle , GetBackgroundStyle() const, + "Returns the background style of the window. +:see: `SetBackgroundStyle`", ""); + DocDeclStr( + bool , HasTransparentBackground(), + "Returns True if this window's background is transparent (as, for +example, for `wx.StaticText`) and should show the parent window's +background. + +This method is mostly used internally by the library itself and you +normally shouldn't have to call it. You may, however, have to override +it in your custom control classes to ensure that background is painted +correctly.", ""); + + DocDeclStr( virtual bool , SetCursor( const wxCursor &cursor ), "Sets the window's cursor. Notice that the window cursor also sets it @@ -1529,7 +1582,7 @@ and returns control when the user has dismissed the menu. If a menu item is selected, the corresponding menu event is generated and will be processed as usual. If the default position is given then the current position of the mouse cursor will be used.", ""); - %name(PopupMenuXY) bool PopupMenu(wxMenu *menu, int x=-1, int y=-1); + %Rename(PopupMenuXY, bool, PopupMenu(wxMenu *menu, int x=-1, int y=-1)); bool PopupMenu(wxMenu *menu, const wxPoint& pos=wxDefaultPosition); @@ -1545,6 +1598,20 @@ toplevel parent of the window.", ""); } } + DocStr( + AssociateHandle, + "Associate the window with a new native handle", ""); + %extend { + void AssociateHandle(long handle) { + self->AssociateHandle((WXWidget)handle); + } + } + + + DocDeclStr( + virtual void , DissociateHandle(), + "Dissociate the current native handle from the window", ""); + #ifdef __WXMSW__ @@ -1569,7 +1636,7 @@ toplevel parent of the window.", ""); int position, int thumbSize, int range, - bool refresh = True ), + bool refresh = true ), "Sets the scrollbar properties of a built-in scrollbar.", " :param orientation: Determines the scrollbar whose page size is to @@ -1586,7 +1653,7 @@ toplevel parent of the window.", ""); "); DocDeclStr( - virtual void , SetScrollPos( int orientation, int pos, bool refresh = True ), + virtual void , SetScrollPos( int orientation, int pos, bool refresh = true ), "Sets the position of one of the built-in scrollbars.", ""); DocDeclStr( @@ -1687,7 +1754,7 @@ wxHelpProvider implementation, and not in the window object itself.", ""); DocStr(SetToolTip, "Attach a tooltip to the window.", ""); - %name(SetToolTipString) void SetToolTip( const wxString &tip ); + %Rename(SetToolTipString, void, SetToolTip( const wxString &tip )); void SetToolTip( wxToolTip *tip ); DocDeclStr( @@ -1773,16 +1840,16 @@ handler when the window is resized.", ""); DocDeclStr( - void , SetSizer(wxSizer *sizer, bool deleteOld = True ), + void , SetSizer(wxSizer *sizer, bool deleteOld = true ), "Sets the window to have the given layout sizer. The window will then own the object, and will take care of its deletion. If an existing layout sizer object is already owned by the window, it will be deleted if the deleteOld parameter is true. Note that this function will also call SetAutoLayout implicitly with a True parameter if the sizer is -non-NoneL and False otherwise.", ""); +non-None, and False otherwise.", ""); DocDeclStr( - void , SetSizerAndFit( wxSizer *sizer, bool deleteOld = True ), + void , SetSizerAndFit( wxSizer *sizer, bool deleteOld = true ), "The same as SetSizer, except it also sets the size hints for the window based on the sizer's minimum size.", ""); @@ -1842,8 +1909,8 @@ value as used by the parent. In addition, if the window overrides ShouldInheritColours to return false, the colours will not be changed no matter what and only the font might. -This rather complicated logic is necessary in order to accomodate the -different usage scenarius. The most common one is when all default +This rather complicated logic is necessary in order to accommodate the +different usage scenarios. The most common one is when all default attributes are used and in this case, nothing should be inherited as in modern GUIs different controls use different fonts (and colours) than their siblings so they can't inherit the same value from the