%pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
%pragma(python) addtomethod = "wxPreBitmapButton:val._setOORInfo(val)"
- wxBitmap& GetBitmapLabel();
- wxBitmap& GetBitmapDisabled();
- wxBitmap& GetBitmapFocus();
- wxBitmap& GetBitmapSelected();
+ wxBitmap GetBitmapLabel();
+ wxBitmap GetBitmapDisabled();
+ wxBitmap GetBitmapFocus();
+ wxBitmap GetBitmapSelected();
void SetBitmapDisabled(const wxBitmap& bitmap);
void SetBitmapFocus(const wxBitmap& bitmap);
void SetBitmapSelected(const wxBitmap& bitmap);
//----------------------------------------------------------------------
+// wxGTK's wxComboBox doesn't derive from wxChoice like wxMSW, or
+// even wxControlWithItems, so we have to duplicate the methods
+// here... <blech!>
+
+#ifdef __WXGTK__
+class wxComboBox : public wxControl
+{
+public:
+ wxComboBox(wxWindow* parent, wxWindowID id, char* value = "",
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ int LCOUNT=0, wxString* choices=NULL,
+ long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ char* name = "comboBox");
+ %name(wxPreComboBox)wxComboBox();
+
+ bool Create(wxWindow* parent, wxWindowID id, char* value = "",
+ const wxPoint& pos = wxDefaultPosition,
+ const wxSize& size = wxDefaultSize,
+ int LCOUNT=0, wxString* choices=NULL,
+ long style = 0,
+ const wxValidator& validator = wxDefaultValidator,
+ char* name = "comboBox");
+
+ %pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
+ %pragma(python) addtomethod = "wxPreComboBox:val._setOORInfo(val)"
+
+ void Copy();
+ void Cut();
+ long GetInsertionPoint();
+ long GetLastPosition();
+ wxString GetValue();
+ void Paste();
+ void Replace(long from, long to, const wxString& text);
+ void Remove(long from, long to);
+ void SetInsertionPoint(long pos);
+ void SetInsertionPointEnd();
+ void SetSelection(int n);
+ %name(SetMark)void SetSelection(long from, long to);
+ void SetValue(const wxString& text);
+ void SetEditable(bool editable);
+
+
+ void Clear();
+ void Delete(int n);
+
+ int GetCount();
+ %pragma(python) addtoclass = "Number = GetCount"
+ wxString GetString(int n);
+ int FindString(const wxString& s);
+
+ //void SetString(int n, const wxString& s); *** No equivalent for wxGTK!!!
+
+ // void Select(int n);
+ %pragma(python) addtoclass = "Select = SetSelection"
+
+ int GetSelection();
+ wxString GetStringSelection() const;
+
+ // void Append(const wxString& item);
+ // void Append(const wxString& item, char* clientData);
+ // char* GetClientData(const int n);
+ // void SetClientData(const int n, char* data);
+ %addmethods {
+ void Append(const wxString& item, PyObject* clientData=NULL) {
+ if (clientData) {
+ wxPyClientData* data = new wxPyClientData(clientData);
+ self->Append(item, data);
+ } else
+ self->Append(item);
+ }
+
+ PyObject* GetClientData(int n) {
+ wxPyClientData* data = (wxPyClientData*)self->GetClientObject(n);
+ if (data) {
+ Py_INCREF(data->m_obj);
+ return data->m_obj;
+ } else {
+ Py_INCREF(Py_None);
+ return Py_None;
+ }
+ }
+
+ void SetClientData(int n, PyObject* clientData) {
+ wxPyClientData* data = new wxPyClientData(clientData);
+ self->SetClientObject(n, data);
+ }
+ }
+
+};
+
+
+
+#else // For all but wxGTK
+
+
class wxComboBox : public wxChoice {
public:
wxComboBox(wxWindow* parent, wxWindowID id, char* value = "",
void SetValue(const wxString& text);
void SetEditable(bool editable);
};
+#endif
+
//----------------------------------------------------------------------
bool HasBackgroundColour() const;
bool HasFont() const;
- const wxColour& GetTextColour() const;
- const wxColour& GetBackgroundColour() const;
- const wxFont& GetFont() const;
+ wxColour GetTextColour() const;
+ wxColour GetBackgroundColour() const;
+ wxFont GetFont() const;
// returns false if we have any attributes set, true otherwise
bool IsDefault();
+
+ // return the attribute having the valid font and colours: it uses the
+ // attributes set in attr and falls back first to attrDefault and then to
+ // the text control font/colours for those attributes which are not set
+ static wxTextAttr Combine(const wxTextAttr& attr,
+ const wxTextAttr& attrDef,
+ const wxTextCtrl *text);
};
self->AppendText(text);
}
}
+
+ // TODO: replace this when the method is really added to wxTextCtrl
+ %addmethods {
+ wxString GetString(long from, long to) {
+ return self->GetValue().Mid(from, to-from);
+ }
+ }
};
//----------------------------------------------------------------------
int GetThumbPosition();
int GetThumbSize();
%name(GetThumbLength) int GetThumbSize(); // to match the docs
+
+ bool IsVertical();
+
void SetThumbPosition(int viewStart);
void SetScrollbar(int position, int thumbSize,
int range, int pageSize,
%pragma(python) addtomethod = "__init__:self._setOORInfo(self)"
%pragma(python) addtomethod = "wxPreStaticBitmap:val._setOORInfo(val)"
- const wxBitmap& GetBitmap();
+ wxBitmap GetBitmap();
void SetBitmap(const wxBitmap& bitmap);
void SetIcon(const wxIcon& icon);
};