%{
%}
+MAKE_CONST_WXSTRING(PanelNameStr);
+
//---------------------------------------------------------------------------
%newgroup
class wxWindow : public wxEvtHandler
{
public:
- %addtofunc wxWindow "self._setOORInfo(self)"
- %addtofunc wxWindow() ""
+ %pythonAppend wxWindow "self._setOORInfo(self)"
+ %pythonAppend wxWindow() ""
wxWindow(wxWindow* parent, const wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
// deleting the window
// -------------------
- // ask the window to close itself, return TRUE if the event handler
+ // ask the window to close itself, return True if the event handler
// honoured our request
- bool Close( bool force = FALSE );
+ bool Close( bool force = False );
- // delete window unconditionally (dangerous!), returns TRUE if ok
+ // delete window unconditionally (dangerous!), returns True if ok
virtual bool Destroy();
- // delete all children of this window, returns TRUE if ok
+ // delete all children of this window, returns True if ok
bool DestroyChildren();
// is the window being deleted?
%name(SetClientRect) void SetClientSize(const wxRect& rect);
- // get the window position
- wxPoint GetPosition() const;
- %name(GetPositionTuple) void GetPosition( int *OUTPUT, int *OUTPUT ) const;
+ DocStr(GetPosition, // sets the docstring for both
+ "Get the window's position.");
+ wxPoint GetPosition();
+ DocDeclAName(
+ void, GetPosition(int *OUTPUT, int *OUTPUT),
+ "GetPositionTuple() -> (x,y)",
+ GetPositionTuple);
- // get the window size
+
+ DocStr(GetSize, "Get the window size.");
wxSize GetSize() const;
- %name(GetSizeTuple) void GetSize( int *OUTPUT, int *OUTPUT ) const;
-
+ DocDeclAName(
+ void, GetSize( int *OUTPUT, int *OUTPUT ) const,
+ "GetSizeTuple() -> (width, height)",
+ GetSizeTuple);
+
+
// get the window position and size
wxRect GetRect() const;
- // get the window's client size
+ DocStr(GetClientSize, "Get the window's client size.");
wxSize GetClientSize() const;
- %name(GetClientSizeTuple) void GetClientSize( int *OUTPUT, int *OUTPUT ) const;
+ DocDeclAName(
+ void, GetClientSize( int *OUTPUT, int *OUTPUT ) const,
+ "GetClientSizeTuple() -> (width, height)",
+ GetClientSizeTuple);
// get the origin of the client area of the window relative to the
// get the client rectangle in window (i.e. client) coordinates
wxRect GetClientRect() const;
- // get the size best suited for the window (in fact, minimal
- // acceptable size using which it will still look "nice")
+ DocStr(GetBestSize,
+ "Get the size best suited for the window (in fact, minimal acceptable size\n"
+ "using which it will still look \"nice\")");
wxSize GetBestSize() const;
- %name(GetBestSizeTuple) void GetBestSize(int *OUTPUT, int *OUTPUT) const;
+ DocDeclAName(
+ void, GetBestSize(int *OUTPUT, int *OUTPUT) const,
+ "GetBestSizeTuple() -> (width, height)",
+ GetBestSizeTuple);
+
// There are times (and windows) where 'Best' size and 'Min' size
// are vastly out of sync. This should be remedied somehow, but in
// Override this method to control the values given to Sizers etc.
virtual wxSize GetMaxSize() const;
- // Methods for accessing the virtual size of a window. For most
- // windows this 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. You may override the DoXXXVirtual
- // methods below for classes where that is is the case.
- void SetVirtualSize( const wxSize &size );
+
+ DocStr(SetVirtualSize,
+ "Set the the virtual size of a window. For most windows this is just the\n"
+ "client area of the window, but for some like scrolled windows it is more or\n"
+ "less independent of the screen window size.");
+ void SetVirtualSize(const wxSize& size );
%name(SetVirtualSizeWH) void SetVirtualSize( int w, int h );
+
+ DocStr(GetVirtualSize,
+ "Get the the virtual size of the window. For most windows this is just\n"
+ "the client area of the window, but for some like scrolled windows it is\n"
+ "more or less independent of the screen window size.");
wxSize GetVirtualSize() const;
- %name(GetVirtualSizeTuple)void GetVirtualSize( int *OUTPUT, int *OUTPUT ) const;
+ DocDeclAName(
+ void, GetVirtualSize( int *OUTPUT, int *OUTPUT ) const,
+ "GetVirtualSizeTuple() -> (width, height)",
+ GetVirtualSizeTuple);
// TODO: using directors?
// window state
// ------------
- // returns TRUE if window was shown/hidden, FALSE if the nothing was
+ // returns True if window was shown/hidden, False if the nothing was
// done (window was already shown/hidden)
- virtual bool Show( bool show = TRUE );
+ virtual bool Show( bool show = True );
bool Hide();
- // returns TRUE if window was enabled/disabled, FALSE if nothing done
- virtual bool Enable( bool enable = TRUE );
+ // returns True if window was enabled/disabled, False if nothing done
+ virtual bool Enable( bool enable = True );
bool Disable();
bool IsShown() const;
long GetExtraStyle() const;
// make the window modal (all other windows unresponsive)
- virtual void MakeModal(bool modal = TRUE);
+ virtual void MakeModal(bool modal = True);
virtual void SetThemeEnabled(bool enableTheme);
virtual bool GetThemeEnabled() const;
// controls by default inherit the colours of their parents, if a
// particular control class doesn't want to do it, it can override
- // ShouldInheritColours() to return false
+ // ShouldInheritColours() to return False
virtual bool ShouldInheritColours() const;
// is this window a top level one?
virtual bool IsTopLevel() const;
- // change the real parent of this window, return TRUE if the parent
- // was changed, FALSE otherwise (error or newParent == oldParent)
+ // change the real parent of this window, return True if the parent
+ // was changed, False otherwise (error or newParent == oldParent)
virtual bool Reparent( wxWindow *newParent );
// implementation mostly
// push/pop event handler: allows to chain a custom event handler to
// alreasy existing ones
void PushEventHandler( wxEvtHandler *handler );
- wxEvtHandler *PopEventHandler( bool deleteHandler = FALSE );
+ wxEvtHandler *PopEventHandler( bool deleteHandler = False );
// find the given handler in the event handler chain and remove (but
- // not delete) it from the event handler chain, return TRUE if it was
- // found and FALSE otherwise (this also results in an assert failure so
+ // not delete) it from the event handler chain, return True if it was
+ // found and False otherwise (this also results in an assert failure so
// this function should only be called when the handler is supposed to
// be there)
bool RemoveEventHandler(wxEvtHandler *handler);
#if wxUSE_HOTKEY
return self->RegisterHotKey(hotkeyId, modifiers, keycode);
#else
- return FALSE;
+ return False;
#endif
}
#if wxUSE_HOTKEY
return self->UnregisterHotKey(hotkeyId);
#else
- return FALSE;
+ return False;
#endif
}
}
// mark the specified rectangle (or the whole window) as "dirty" so it
// will be repainted
- virtual void Refresh( bool eraseBackground = TRUE,
+ virtual void Refresh( bool eraseBackground = True,
const wxRect *rect = NULL );
// a less awkward wrapper for Refresh
// --------------------------
// set/retrieve the window colours (system defaults are used by
- // default): Set functions return TRUE if colour was changed
+ // default): Set functions return True if colour was changed
virtual bool SetBackgroundColour( const wxColour &colour );
virtual bool SetForegroundColour( const wxColour &colour );
wxColour GetBackgroundColour() const;
wxColour GetForegroundColour() const;
- // set/retrieve the cursor for this window (SetCursor() returns TRUE
+ // set/retrieve the cursor for this window (SetCursor() returns True
// if the cursor was really changed)
virtual bool SetCursor( const wxCursor &cursor );
wxCursor& GetCursor();
- // set/retrieve the font for the window (SetFont() returns TRUE if the
+ // set/retrieve the font for the window (SetFont() returns True if the
// font really changed)
virtual bool SetFont( const wxFont &font );
wxFont& GetFont();
virtual int GetCharHeight() const;
virtual int GetCharWidth() const;
- // get the width/height/... of the text using current or specified
- // font
- virtual void GetTextExtent(const wxString& string, int *OUTPUT, int *OUTPUT); // x, y
- %name(GetFullTextExtent) virtual void GetTextExtent(const wxString& string,
- int *OUTPUT, int *OUTPUT, // x, y
- int *OUTPUT, int* OUTPUT, // descent, externalLeading
- const wxFont* font = NULL);
+
+ DocDeclAStr(
+ void, GetTextExtent(const wxString& string, int *OUTPUT, int *OUTPUT),
+ "GetTextExtent(String string) -> (width, height)",
+ "Get the width and height of the text using the current font.");
+ DocDeclAStrName(
+ void, GetTextExtent(const wxString& string,
+ int *OUTPUT, int *OUTPUT, int *OUTPUT, int* OUTPUT,
+ const wxFont* font = NULL),
+ "GetFullTextExtent(String string, Font font=None) ->\n (width, height, descent, externalLeading)",
+ "Get the width, height, decent and leading of the text using the current or specified font.",
+ GetFullTextExtent);
+
// client <-> screen coords
// get border for the flags of this window
wxBorder GetBorder() const { return GetBorder(GetWindowStyleFlag()); }
- // send wxUpdateUIEvents to this window, and children if recurse is TRUE
+ // send wxUpdateUIEvents to this window, and children if recurse is True
virtual void UpdateWindowUI(long flags = wxUPDATE_UI_NONE);
// TODO: using directors?
int pos,
int thumbvisible,
int range,
- bool refresh = TRUE );
- virtual void SetScrollPos( int orient, int pos, bool refresh = TRUE );
+ bool refresh = True );
+ virtual void SetScrollPos( int orient, int pos, bool refresh = True );
virtual int GetScrollPos( int orient ) const;
virtual int GetScrollThumb( int orient ) const;
virtual int GetScrollRange( int orient ) const;
// scrolls window by line/page: note that not all controls support this
//
- // return TRUE if the position changed, FALSE otherwise
+ // return True if the position changed, False otherwise
virtual bool ScrollLines(int WXUNUSED(lines));
virtual bool ScrollPages(int WXUNUSED(pages));
wxString GetHelpText() const;
-
+#ifndef __WXX11__
// tooltips
// --------
// get the associated tooltip or NULL if none
wxToolTip* GetToolTip() const;
// LINK ERROR --> wxString GetToolTipText() const;
+#endif
-
+
+#ifndef __WXX11__
// drag and drop
// -------------
// set/retrieve the drop target associated with this window (may be
// NULL; it's owned by the window and will be deleted by it)
- %addtofunc SetDropTarget "args[1].thisown = 0"
- virtual void SetDropTarget( wxDropTarget *dropTarget );
- virtual wxDropTarget *GetDropTarget() const;
+ %apply SWIGTYPE *DISOWN { wxPyDropTarget *dropTarget };
+ virtual void SetDropTarget( wxPyDropTarget *dropTarget );
+ %clear wxPyDropTarget *dropTarget;
+
+ virtual wxPyDropTarget *GetDropTarget() const;
#ifdef __WXMSW__ // TODO: should I drop-kick this?
void DragAcceptFiles(bool accept);
#endif
-
+#endif
+
// constraints and sizers
// ----------------------
virtual bool Layout();
// sizers
- void SetSizer(wxSizer *sizer, bool deleteOld = TRUE );
- void SetSizerAndFit( wxSizer *sizer, bool deleteOld = TRUE );
+ void SetSizer(wxSizer *sizer, bool deleteOld = True );
+ void SetSizerAndFit( wxSizer *sizer, bool deleteOld = True );
wxSizer *GetSizer() const;
if y is None:
return win.ConvertDialogPointToPixels(point_or_x)
else:
- return win.ConvertDialogPointToPixels(wxPoint(point_or_x, y))
+ return win.ConvertDialogPointToPixels(wx.Point(point_or_x, y))
def DLG_SZE(win, size_width, height=None):
if height is None:
return win.ConvertDialogSizeToPixels(size_width)
else:
- return win.ConvertDialogSizeToPixels(wxSize(size_width, height))
+ return win.ConvertDialogSizeToPixels(wx.Size(size_width, height))
}
win->SubclassWin(hWnd);
return win;
#else
- PyErr_SetNone(PyExc_NotImplementedError);
+ wxPyRaiseNotImplemented();
return NULL;
#endif
}