%{
#include "helpers.h"
#include <wx/menuitem.h>
+#include <wx/tooltip.h>
%}
//----------------------------------------------------------------------
%pragma(python) code = "import wx"
+
+%{
+ static wxString wxPyEmptyStr("");
+%}
+
//---------------------------------------------------------------------------
-class wxEvtHandler {
+class wxEvtHandler : public wxObject {
public:
wxEvtHandler();
(wxObjectEventFunction)
&wxPyCallback::EventThunker);
}
-
}
- %pragma(python) addtoclass = "
- _prop_list_ = {}
- "
-
+// %pragma(python) addtoclass = "
+// _prop_list_ = {}
+// "
// %pragma(python) addtoclass = "
// def __getattr__(self, name):
// pl = self._prop_list_
wxWindow* GetWindow();
void SetWindow(wxWindow* window);
+ static bool IsSilent();
+ static void SetBellOnError(int doIt = TRUE);
+
// // Properties list
// %pragma(python) addtoclass = "
// _prop_list_ = {
// "
};
-%inline %{
- bool wxValidator_IsSilent() {
- return wxValidator::IsSilent();
- }
-
- void wxValidator_SetBellOnError(int doIt = TRUE) {
- wxValidator::SetBellOnError(doIt);
- }
-%}
//----------------------------------------------------------------------
%{
public:
wxPyValidator() {
}
-// wxPyValidator(const wxPyValidator& other);
~wxPyValidator() {
}
return ptr;
}
+
DEC_PYCALLBACK_BOOL_WXWIN(Validate);
DEC_PYCALLBACK_BOOL_(TransferToWindow);
DEC_PYCALLBACK_BOOL_(TransferFromWindow);
PYPRIVATE;
-// PyObject* m_data;
};
IMP_PYCALLBACK_BOOL_WXWIN(wxPyValidator, wxValidator, Validate);
class wxPyValidator : public wxValidator {
public:
wxPyValidator();
-// ~wxPyValidator();
-
- %addmethods { void Destroy() { delete self; } }
void _setSelf(PyObject* self, PyObject* _class, int incref=TRUE);
- %pragma(python) addtomethod = "__init__:self._setSelf(self, wxPyValidator, 0)"
+ %pragma(python) addtomethod = "__init__:self._setSelf(self, wxPyValidator, 1)"
};
public:
wxWindow(wxWindow* parent, const wxWindowID id,
- const wxPoint& pos = wxPyDefaultPosition,
- const wxSize& size = wxPyDefaultSize,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
long style = 0,
char* name = "panel");
bool Close(int force = FALSE);
bool Destroy();
void DestroyChildren();
+ bool IsBeingDeleted();
#ifdef __WXMSW__
void DragAcceptFiles(bool accept);
#endif
//void SetPalette(wxPalette* palette);
void SetCursor(const wxCursor&cursor);
void SetEventHandler(wxEvtHandler* handler);
+ void SetExtraStyle(long exStyle);
void SetTitle(const wxString& title);
bool Show(bool show);
bool TransferDataFromWindow();
void SetCaret(wxCaret *caret);
wxCaret *GetCaret();
- %pragma(python) addtoclass = "# replaces broken shadow methods
+ %pragma(python) addtoclass = "# replaces broken shadow method
def GetCaret(self, *_args, **_kwargs):
from misc2 import wxCaretPtr
val = apply(windowsc.wxWindow_GetCaret,(self,) + _args, _kwargs)
if val: val = wxCaretPtr(val)
return val
-
- def GetSizer(self, *_args, **_kwargs):
- from sizers import wxSizerPtr
- val = apply(windowsc.wxWindow_GetSizer,(self,) + _args, _kwargs)
- if val: val = wxSizerPtr(val)
- return val
-
- def GetToolTip(self, *_args, **_kwargs):
- from misc2 import wxToolTipPtr
- val = apply(windowsc.wxWindow_GetToolTip,(self,) + _args, _kwargs)
- if val: val = wxToolTipPtr(val)
- return val
"
public:
wxPanel(wxWindow* parent,
const wxWindowID id,
- const wxPoint& pos = wxPyDefaultPosition,
- const wxSize& size = wxPyDefaultSize,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
long style = wxTAB_TRAVERSAL,
const char* name = "panel");
wxButton* GetDefaultItem();
void SetDefaultItem(wxButton *btn);
- // fix some SWIG trouble...
- %pragma(python) addtoclass = "
- def GetDefaultItem(self):
- import controls
- val = windowsc.wxPanel_GetDefaultItem(self.this)
- val = controls.wxButtonPtr(val)
- return val
-"
};
//---------------------------------------------------------------------------
wxDialog(wxWindow* parent,
const wxWindowID id,
const wxString& title,
- const wxPoint& pos = wxPyDefaultPosition,
- const wxSize& size = wxPyDefaultSize,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_DIALOG_STYLE,
const char* name = "dialogBox");
int GetReturnCode();
void SetReturnCode(int retCode);
+
+ wxSizer* CreateTextSizer( const wxString &message );
+ wxSizer* CreateButtonSizer( long flags );
+
};
//---------------------------------------------------------------------------
public:
wxScrolledWindow(wxWindow* parent,
const wxWindowID id = -1,
- const wxPoint& pos = wxPyDefaultPosition,
- const wxSize& size = wxPyDefaultSize,
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
long style = wxHSCROLL | wxVSCROLL,
char* name = "scrolledWindow");
void CalcScrolledPosition( int x, int y, int *OUTPUT, int *OUTPUT);
void CalcUnscrolledPosition( int x, int y, int *OUTPUT, int *OUTPUT);
+ void SetScale(double xs, double ys);
+ double GetScaleX();
+ double GetScaleY();
+
+ void AdjustScrollbars();
};
//----------------------------------------------------------------------
//----------------------------------------------------------------------
-class wxMenuItem {
+class wxMenuItem : public wxObject {
public:
wxMenuItem(wxMenu* parentMenu=NULL, int id=wxID_SEPARATOR,
const wxString& text = wxPyEmptyStr,
wxAcceleratorEntry *GetAccel();
void SetAccel(wxAcceleratorEntry *accel);
+ static wxString GetLabelFromText(const wxString& text);
+
+ // wxOwnerDrawn methods
+#ifdef __WXMSW__
+ void SetFont(const wxFont& font);
+ wxFont& GetFont();
+ void SetTextColour(const wxColour& colText);
+ wxColour& GetTextColour();
+ void SetBackgroundColour(const wxColour& colBack);
+ wxColour& GetBackgroundColour();
+ void SetBitmaps(const wxBitmap& bmpChecked,
+ const wxBitmap& bmpUnchecked = wxNullBitmap);
+ void SetBitmap(const wxBitmap& bmpChecked);
+ const wxBitmap& GetBitmap(bool bChecked = TRUE);
+ void SetMarginWidth(int nWidth);
+ int GetMarginWidth();
+ static int GetDefaultMarginWidth();
+ //void SetName(const wxString& strName);
+ //const wxString& GetName();
+ //void SetCheckable(bool checkable);
+ //bool IsCheckable();
+ bool IsOwnerDrawn();
+ void ResetOwnerDrawn();
+#endif
};
//---------------------------------------------------------------------------