struct wxVisualAttributes
{
%extend {
- wxVisualAttributes() {}
- ~wxVisualAttributes() {}
+ wxVisualAttributes() { return new wxVisualAttributes; }
+ ~wxVisualAttributes() { delete self; }
}
// the font used for control label/text inside it
RefDoc(wxWindow, ""); // turn it off for the ctors
DocCtorStr(
- wxWindow(wxWindow* parent, const wxWindowID id,
+ wxWindow(wxWindow* parent, const wxWindowID id=-1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
DocDeclStr(
- bool , Create(wxWindow* parent, const wxWindowID id,
+ bool , Create(wxWindow* parent, const wxWindowID id=-1,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
anything if there are no subwindows.");
-
- DocDeclStr(
- virtual void , SetSizeHints( int minW, int minH,
- int maxW = -1, int maxH = -1,
- int incW = -1, int incH = -1 ),
+
+ %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
default values will be used. If this function is called, the user
will not be able to size the window outside the given bounds. The
resizing increments are only significant under Motif or Xt.");
-
+ virtual void SetSizeHints( int minW, int minH,
+ int maxW = -1, int maxH = -1,
+ int incW = -1, int incH = -1 );
+ void SetSizeHints( const wxSize& minSize,
+ const wxSize& maxSize=wxDefaultSize,
+ const wxSize& incSize=wxDefaultSize);
- DocDeclStr(
- virtual void , SetVirtualSizeHints( int minW, int minH,
- int maxW = -1, int maxH = -1 ),
+
+ %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.");
-
+ virtual void SetVirtualSizeHints( int minW, int minH,
+ int maxW = -1, int maxH = -1 );
+ void SetVirtualSizeHints( const wxSize& minSize,
+ const wxSize& maxSize=wxDefaultSize);
DocDeclStr(
virtual int , GetMinWidth() const,
"");
+ DocDeclStr(
+ virtual wxSize , GetMinSize() const,
+ "");
+
DocStr(SetVirtualSize,
"Set the the virtual size of a window in pixels. For most windows this
DocDeclStr(
virtual void , SetWindowStyleFlag( long style ),
- "Sets the style of the window. Please note that some styles cannot be
-changed after the window creation and that Refresh() might be called
-after changing the others for the change to take place immediately.");
+ "Sets the style of the window. Please note that some styles cannot
+be changed after the window creation and that Refresh() might
+need to be called after changing the others for the change to
+take place immediately.");
DocDeclStr(
virtual long , GetWindowStyleFlag() const,
virtual wxValidator *, GetValidator(),
"Returns a pointer to the current validator for the window, or None if
there is none.");
+
+
+ DocDeclStr(
+ virtual bool , Validate(),
+ "Validates the current values of the child controls using their
+validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY
+extra style flag set, the method will also call Validate() of all
+child windows. Returns false if any of the validations failed.");
+
+
+ DocDeclStr(
+ virtual bool , TransferDataToWindow(),
+ "Transfers values to child controls from data areas specified by
+their validators. If the window has wx.WS_EX_VALIDATE_RECURSIVELY
+extra style flag set, the method will also call
+TransferDataToWindow() of all child windows.");
+
+ DocDeclStr(
+ virtual bool , TransferDataFromWindow(),
+ "Transfers values from child controls to data areas specified by
+their validators. Returns false if a transfer failed. If the
+window has wx.WS_EX_VALIDATE_RECURSIVELY extra style flag set, the
+method will also call TransferDataFromWindow() of all child
+windows.");
+
+
+ DocDeclStr(
+ virtual void , InitDialog(),
+ "Sends an EVT_INIT_DIALOG event, whose handler usually transfers
+data to the dialog via validators.");
+
use EVT_HOTKEY with an id equal to hotkeyId. Returns True if the
hotkey was registered successfully.");
bool RegisterHotKey(int hotkeyId, int modifiers, int keycode) {
- #if wxUSE_HOTKEY
+ %#if wxUSE_HOTKEY
return self->RegisterHotKey(hotkeyId, modifiers, keycode);
- #else
+ %#else
return False;
- #endif
+ %#endif
}
DocDeclStr(
- wxVisualAttributes , GetDefaultAttributes() const,
+ virtual wxVisualAttributes , GetDefaultAttributes() const,
"Get the default attributes for an instance of this class. This
is useful if you want to use the same font or colour in your own
control as in a standard control -- which is a much better idea
window might not look equally well when used with themes, i.e GTK+'s
ability to change its look as the user wishes with run-time loadable
modules.");
+
+ DocDeclStr(
+ void , SetDefaultBackgroundColour(const wxColour& colour),
+ "");
+
+
DocDeclStr(
virtual bool , SetForegroundColour( const wxColour &colour ),
the window class; it may be the text colour or other colour, or it may
not be used at all.");
+ DocDeclStr(
+ void , SetDefaultForegroundColour(const wxColour& colour),
+ "");
+
+
DocDeclStr(
wxColour , GetBackgroundColour() const,
"Returns the background colour of the window.");
virtual bool , SetFont( const wxFont &font ),
"Sets the font for this window.");
+ DocDeclStr(
+ void , SetDefaultFont(const wxFont& font),
+ "");
+
+
+
DocDeclStr(
wxFont& , GetFont(),
"Returns the default font used for this window.");
+
+ DocDeclStr(
+ virtual void , InheritAttributes(),
+ "This function is (or should be, in case of custom controls)
+called during window creation to intelligently set up the window
+visual attributes, that is the font and the foreground and
+background colours.
+
+By 'intelligently' the following is meant: by default, all
+windows use their own default attributes. However if some of the
+parent's attributes are explicitly changed (that is, using
+SetFont and not SetDefaultFont) and if the corresponding
+attribute hadn't been explicitly set for this window itself, then
+this window takes the same 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 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 parent. However it was also deemed desirable
+to allow to simply change the attributes of all children at once
+by just changing the font or colour of their common parent, hence
+in this case we do inherit the parents attributes.");
+
+
+// TODO: Virtualize this with directors
+ DocDeclStr(
+ virtual bool , ShouldInheritColours() const,
+ "Return true from here to allow the colours of this window to be
+changed by InheritAttributes, returning false forbids inheriting
+them from the parent window.
+
+The base class version returns false, but this method is
+overridden in wxControl where it returns true.");
+
+
+
%pythoncode {
def PostCreate(self, pre):
"""