X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5ec5b47f47d626c417486e2ce2d167e44b3b66b6..1d8acb7d4d9bd0a8343ee811f98f22388e08e2df:/wxPython/src/_window.i diff --git a/wxPython/src/_window.i b/wxPython/src/_window.i index 2f01f77332..2c3d50a741 100644 --- a/wxPython/src/_window.i +++ b/wxPython/src/_window.i @@ -34,15 +34,27 @@ struct wxVisualAttributes ~wxVisualAttributes() { delete self; } } - // the font used for control label/text inside it - wxFont font; - - // the foreground colour - wxColour colFg; +// // the font used for control label/text inside it +// wxFont font; +// // the foreground colour +// wxColour colFg; +// // the background colour, may be wxNullColour if the controls background +// // colour is not solid +// wxColour colBg; + + // Use our own getters and properties instead of the ones that SWIG will + // generate, so copies of the attributes will be made when they are + // accessed, instead of using a pointer to the one in the object which may + // be temporary. + %extend { + wxFont _get_font() { return self->font; } + wxColour _get_colFg() { return self->colFg; } + wxColour _get_colBg() { return self->colBg; } + } - // the background colour, may be wxNullColour if the controls background - // colour is not solid - wxColour colBg; + %property(font, _get_font) + %property(colFg, _get_colFg) + %property(colBg, _get_colBg) }; @@ -775,7 +787,16 @@ window had already been in the specified state.", ""); DocDeclStr( bool , IsEnabled() const, - "Returns true if the window is enabled for input, false otherwise.", ""); + "Returns true if the window is enabled for input, false otherwise. +This method takes into account the enabled state of parent windows up +to the top-level window.", ""); + + DocDeclStr( + bool , IsThisEnabled() const, + "Returns the internal enabled state independent of the parent(s) state, +i.e. the state in which the window would be if all of its parents are +enabled. Use `IsEnabled` to get the effective window state.", ""); + DocDeclStr( virtual bool , IsShownOnScreen() const, @@ -829,6 +850,9 @@ SetWindowStyleFlag()", ""); long , GetExtraStyle() const, "Returns the extra style bits for the window.", ""); + DocDeclStr( + bool , HasExtraStyle(int exFlag) const, + "Returns ``True`` if the given extra flag is set.", ""); DocDeclStr( @@ -892,6 +916,12 @@ or None.", ""); "Can this window have focus?", ""); + DocDeclStr( + bool , CanAcceptFocus() const, + "Can this window have focus right now?", ""); + + + DocDeclStr( virtual bool , AcceptsFocusFromKeyboard() const, "Can this window be given focus by keyboard navigation? if not, the @@ -899,13 +929,29 @@ only way to give it focus (provided it accepts it at all) is to click it.", ""); + + DocDeclStr( + bool , CanAcceptFocusFromKeyboard() const, + "Can this window be assigned focus from keyboard right now?", ""); + + + DocDeclStr( + virtual void , SetCanFocus(bool canFocus), + "", ""); + + + + DocDeclAStr( + virtual bool , NavigateIn(int flags = wxNavigationKeyEvent::IsForward), + "NavigateIn(self, int flags=NavigationKeyEvent.IsForward) -> bool", + "Navigates inside this window.", ""); DocDeclAStr( virtual bool , Navigate(int flags = wxNavigationKeyEvent::IsForward), "Navigate(self, int flags=NavigationKeyEvent.IsForward) -> bool", - "Does keyboard navigation from this window to another, by sending a -`wx.NavigationKeyEvent`.", " + "Does keyboard navigation starting from this window to another. This is +equivalient to self.GetParent().NavigateIn().", " :param flags: A combination of the ``IsForward`` or ``IsBackward`` and the ``WinChange`` values in the `wx.NavigationKeyEvent` @@ -973,8 +1019,16 @@ do not change.", ""); wxWindow *, GetGrandParent() const, "Returns the parent of the parent of this window, or None if there isn't one.", ""); - + + %extend { + DocDeclStr(wxWindow *, GetTopLevelParent(), + "Returns the first frame or dialog in this window's parental hierarchy.", "") + { + return wxGetTopLevelParent(self); + } + } + DocDeclStr( virtual bool , IsTopLevel() const, @@ -2072,9 +2126,15 @@ opaque.", ""); self.thisown = pre.thisown pre.thisown = 0 if hasattr(self, '_setOORInfo'): - self._setOORInfo(self) + try: + self._setOORInfo(self) + except TypeError: + pass if hasattr(self, '_setCallbackInfo'): - self._setCallbackInfo(self, pre.__class__) + try: + self._setCallbackInfo(self, pre.__class__) + except TypeError: + pass } %pythoncode { @@ -2084,7 +2144,6 @@ opaque.", ""); %property(AcceleratorTable, GetAcceleratorTable, SetAcceleratorTable, doc="See `GetAcceleratorTable` and `SetAcceleratorTable`"); - %property(AdjustedBestSize, GetAdjustedBestSize, doc="See `GetAdjustedBestSize`"); %property(AutoLayout, GetAutoLayout, SetAutoLayout, doc="See `GetAutoLayout` and `SetAutoLayout`"); %property(BackgroundColour, GetBackgroundColour, SetBackgroundColour, doc="See `GetBackgroundColour` and `SetBackgroundColour`"); %property(BackgroundStyle, GetBackgroundStyle, SetBackgroundStyle, doc="See `GetBackgroundStyle` and `SetBackgroundStyle`"); @@ -2109,6 +2168,7 @@ opaque.", ""); %property(Font, GetFont, SetFont, doc="See `GetFont` and `SetFont`"); %property(ForegroundColour, GetForegroundColour, SetForegroundColour, doc="See `GetForegroundColour` and `SetForegroundColour`"); %property(GrandParent, GetGrandParent, doc="See `GetGrandParent`"); + %property(TopLevelParent, GetTopLevelParent, doc="See `GetTopLevelParent`"); %property(Handle, GetHandle, doc="See `GetHandle`"); %property(HelpText, GetHelpText, SetHelpText, doc="See `GetHelpText` and `SetHelpText`"); %property(Id, GetId, SetId, doc="See `GetId` and `SetId`");