1 /////////////////////////////////////////////////////////////////////////////
 
   3 // Purpose:     SWIG interface for wxPyControl, See also _pywindows.i
 
   7 // Created:     2-June-1998
 
   9 // Copyright:   (c) 2003 by Total Control Software
 
  10 // Licence:     wxWindows license
 
  11 /////////////////////////////////////////////////////////////////////////////
 
  16 //---------------------------------------------------------------------------
 
  21 //---------------------------------------------------------------------------
 
  23 %{ // C++ version of Python aware wxControl
 
  24 class wxPyControl : public wxControl
 
  26     DECLARE_DYNAMIC_CLASS(wxPyControl)
 
  28     wxPyControl() : wxControl() {}
 
  29     wxPyControl(wxWindow* parent, const wxWindowID id,
 
  30                 const wxPoint& pos = wxDefaultPosition,
 
  31                 const wxSize& size = wxDefaultSize,
 
  33                 const wxValidator& validator=wxDefaultValidator,
 
  34                 const wxString& name = wxPyControlNameStr)
 
  35         : wxControl(parent, id, pos, size, style, validator, name) {}
 
  38     bool DoEraseBackground(wxDC* dc) {
 
  40         return wxWindow::DoEraseBackground(dc->GetHDC());
 
  42         dc->SetBackground(wxBrush(GetBackgroundColour()));
 
  48     DEC_PYCALLBACK_VOID_INT4(DoMoveWindow);
 
  49     DEC_PYCALLBACK_VOID_INT5(DoSetSize);
 
  50     DEC_PYCALLBACK_VOID_INTINT(DoSetClientSize);
 
  51     DEC_PYCALLBACK_VOID_INTINT(DoSetVirtualSize);
 
  53     DEC_PYCALLBACK_VOID_INTPINTP_const(DoGetSize);
 
  54     DEC_PYCALLBACK_VOID_INTPINTP_const(DoGetClientSize);
 
  55     DEC_PYCALLBACK_VOID_INTPINTP_const(DoGetPosition);
 
  57     DEC_PYCALLBACK_SIZE_const(DoGetVirtualSize);
 
  58     DEC_PYCALLBACK_SIZE_const(DoGetBestSize);
 
  60     DEC_PYCALLBACK__(InitDialog);
 
  61     DEC_PYCALLBACK_BOOL_(TransferDataFromWindow);
 
  62     DEC_PYCALLBACK_BOOL_(TransferDataToWindow);
 
  63     DEC_PYCALLBACK_BOOL_(Validate);
 
  65     DEC_PYCALLBACK_BOOL_const(AcceptsFocus);
 
  66     DEC_PYCALLBACK_BOOL_const(AcceptsFocusFromKeyboard);
 
  67     DEC_PYCALLBACK_SIZE_const(GetMaxSize);
 
  69     DEC_PYCALLBACK_VOID_WXWINBASE(AddChild);
 
  70     DEC_PYCALLBACK_VOID_WXWINBASE(RemoveChild);
 
  72     DEC_PYCALLBACK_BOOL_const(ShouldInheritColours);
 
  73     DEC_PYCALLBACK_VIZATTR_(GetDefaultAttributes);
 
  75     DEC_PYCALLBACK_BOOL_(HasTransparentBackground);
 
  77     DEC_PYCALLBACK_VOID_(OnInternalIdle);
 
  82 IMPLEMENT_DYNAMIC_CLASS(wxPyControl, wxControl);
 
  84 IMP_PYCALLBACK_VOID_INT4(wxPyControl, wxControl, DoMoveWindow);
 
  85 IMP_PYCALLBACK_VOID_INT5(wxPyControl, wxControl, DoSetSize);
 
  86 IMP_PYCALLBACK_VOID_INTINT(wxPyControl, wxControl, DoSetClientSize);
 
  87 IMP_PYCALLBACK_VOID_INTINT(wxPyControl, wxControl, DoSetVirtualSize);
 
  89 IMP_PYCALLBACK_VOID_INTPINTP_const(wxPyControl, wxControl, DoGetSize);
 
  90 IMP_PYCALLBACK_VOID_INTPINTP_const(wxPyControl, wxControl, DoGetClientSize);
 
  91 IMP_PYCALLBACK_VOID_INTPINTP_const(wxPyControl, wxControl, DoGetPosition);
 
  93 IMP_PYCALLBACK_SIZE_const(wxPyControl, wxControl, DoGetVirtualSize);
 
  94 IMP_PYCALLBACK_SIZE_const(wxPyControl, wxControl, DoGetBestSize);
 
  96 IMP_PYCALLBACK__(wxPyControl, wxControl, InitDialog);
 
  97 IMP_PYCALLBACK_BOOL_(wxPyControl, wxControl, TransferDataFromWindow);
 
  98 IMP_PYCALLBACK_BOOL_(wxPyControl, wxControl, TransferDataToWindow);
 
  99 IMP_PYCALLBACK_BOOL_(wxPyControl, wxControl, Validate);
 
 101 IMP_PYCALLBACK_BOOL_const(wxPyControl, wxControl, AcceptsFocus);
 
 102 IMP_PYCALLBACK_BOOL_const(wxPyControl, wxControl, AcceptsFocusFromKeyboard);
 
 103 IMP_PYCALLBACK_SIZE_const(wxPyControl, wxControl, GetMaxSize);
 
 105 IMP_PYCALLBACK_VOID_WXWINBASE(wxPyControl, wxControl, AddChild);
 
 106 IMP_PYCALLBACK_VOID_WXWINBASE(wxPyControl, wxControl, RemoveChild);
 
 108 IMP_PYCALLBACK_BOOL_const(wxPyControl, wxControl, ShouldInheritColours);
 
 109 IMP_PYCALLBACK_VIZATTR_(wxPyControl, wxControl, GetDefaultAttributes);
 
 111 IMP_PYCALLBACK_BOOL_(wxPyControl, wxControl, HasTransparentBackground);
 
 113 IMP_PYCALLBACK_VOID_(wxPyControl, wxControl, OnInternalIdle);
 
 116 // And now the one for SWIG to see
 
 117 MustHaveApp(wxPyControl);
 
 118 class wxPyControl : public wxControl
 
 121     %pythonAppend wxPyControl         "self._setOORInfo(self);"  setCallbackInfo(PyControl)
 
 122     %pythonAppend wxPyControl()       ""
 
 124     wxPyControl(wxWindow* parent, const wxWindowID id=-1,
 
 125                 const wxPoint& pos = wxDefaultPosition,
 
 126                 const wxSize& size = wxDefaultSize,
 
 128                 const wxValidator& validator=wxDefaultValidator,
 
 129                 const wxString& name = wxPyControlNameStr);
 
 131     %RenameCtor(PrePyControl,  wxPyControl());
 
 133     void _setCallbackInfo(PyObject* self, PyObject* _class);
 
 135     %pythoncode { SetBestSize = wx.Window.SetInitialSize }
 
 136     bool DoEraseBackground(wxDC* dc);
 
 138     void DoMoveWindow(int x, int y, int width, int height);
 
 139     void DoSetSize(int x, int y, int width, int height,
 
 140                         int sizeFlags = wxSIZE_AUTO);
 
 141     void DoSetClientSize(int width, int height);
 
 142     void DoSetVirtualSize( int x, int y );
 
 145         void, DoGetSize( int *OUTPUT, int *OUTPUT ) const,
 
 146         "DoGetSize() -> (width, height)");
 
 148         void, DoGetClientSize( int *OUTPUT, int *OUTPUT ) const,
 
 149         "DoGetClientSize() -> (width, height)");
 
 151         void, DoGetPosition( int *OUTPUT, int *OUTPUT ) const,
 
 152         "DoGetPosition() -> (x,y)");
 
 154     wxSize DoGetVirtualSize() const;
 
 155     wxSize DoGetBestSize() const;
 
 158     bool TransferDataToWindow();
 
 159     bool TransferDataFromWindow();
 
 162     bool AcceptsFocus() const;
 
 163     bool AcceptsFocusFromKeyboard() const;
 
 164     wxSize GetMaxSize() const;
 
 166     void AddChild(wxWindow* child);
 
 167     void RemoveChild(wxWindow* child);
 
 169     bool ShouldInheritColours() const;
 
 170     wxVisualAttributes GetDefaultAttributes();
 
 172     void OnInternalIdle();
 
 174     %MAKE_BASE_FUNC(PyScrolledWindow, DoMoveWindow);
 
 175     %MAKE_BASE_FUNC(PyScrolledWindow, DoSetSize);
 
 176     %MAKE_BASE_FUNC(PyScrolledWindow, DoSetClientSize);
 
 177     %MAKE_BASE_FUNC(PyScrolledWindow, DoSetVirtualSize);
 
 178     %MAKE_BASE_FUNC(PyScrolledWindow, DoGetSize);
 
 179     %MAKE_BASE_FUNC(PyScrolledWindow, DoGetClientSize);
 
 180     %MAKE_BASE_FUNC(PyScrolledWindow, DoGetPosition);
 
 181     %MAKE_BASE_FUNC(PyScrolledWindow, DoGetVirtualSize);
 
 182     %MAKE_BASE_FUNC(PyScrolledWindow, DoGetBestSize);
 
 183     %MAKE_BASE_FUNC(PyScrolledWindow, InitDialog);
 
 184     %MAKE_BASE_FUNC(PyScrolledWindow, TransferDataToWindow);
 
 185     %MAKE_BASE_FUNC(PyScrolledWindow, TransferDataFromWindow);
 
 186     %MAKE_BASE_FUNC(PyScrolledWindow, Validate);
 
 187     %MAKE_BASE_FUNC(PyScrolledWindow, AcceptsFocus);
 
 188     %MAKE_BASE_FUNC(PyScrolledWindow, AcceptsFocusFromKeyboard);
 
 189     %MAKE_BASE_FUNC(PyScrolledWindow, GetMaxSize);
 
 190     %MAKE_BASE_FUNC(PyScrolledWindow, AddChild);
 
 191     %MAKE_BASE_FUNC(PyScrolledWindow, RemoveChild);
 
 192     %MAKE_BASE_FUNC(PyScrolledWindow, ShouldInheritColours);
 
 193     %MAKE_BASE_FUNC(PyScrolledWindow, GetDefaultAttributes);
 
 194     %MAKE_BASE_FUNC(PyScrolledWindow, OnInternalIdle);
 
 199 //---------------------------------------------------------------------------
 
 200 //---------------------------------------------------------------------------