Added wx.combo.BitmapComboBox

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43496 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2006-11-18 19:43:32 +00:00
parent 4532786ee2
commit f27895d289
16 changed files with 3201 additions and 558 deletions

View File

@@ -2,7 +2,7 @@
# Don't modify this file, modify the SWIG interface instead.
"""
ComboCtrl class that can have any type of popup widget, and also an
ComboCtrl class that can have any type ofconst wxBitmap& bitmap, popup widget, and also an
owner-drawn combobox control.
"""
@@ -299,7 +299,7 @@ class ComboCtrl(_core.Control):
Extends popup size horizontally, relative to the edges of the combo
control. Values are given in pixels, and the defaults are zero. It
is up to th epopup to fully take these values into account.
is up to the popup to fully take these values into account.
"""
return _combo.ComboCtrl_SetPopupExtents(*args, **kwargs)
@@ -498,6 +498,10 @@ class ComboCtrl(_core.Control):
"""SetCtrlMainWnd(self, Window wnd)"""
return _combo.ComboCtrl_SetCtrlMainWnd(*args, **kwargs)
def GetMainWindowOfCompositeControl(*args, **kwargs):
"""GetMainWindowOfCompositeControl(self) -> Window"""
return _combo.ComboCtrl_GetMainWindowOfCompositeControl(*args, **kwargs)
def GetFeatures(*args, **kwargs):
"""
GetFeatures() -> int
@@ -539,6 +543,21 @@ class ComboCtrl(_core.Control):
"""
return _combo.ComboCtrl_AnimateShow(*args, **kwargs)
PopupControl = property(GetPopupControl,SetPopupControl)
PopupWindow = property(GetPopupWindow)
TextCtrl = property(GetTextCtrl)
Button = property(GetButton)
Value = property(GetValue,SetValue)
InsertionPoint = property(GetInsertionPoint)
CustomPaintWidth = property(GetCustomPaintWidth,SetCustomPaintWidth)
ButtonSize = property(GetButtonSize)
TextIndent = property(GetTextIndent,SetTextIndent)
TextRect = property(GetTextRect)
BitmapNormal = property(GetBitmapNormal)
BitmapPressed = property(GetBitmapPressed)
BitmapHover = property(GetBitmapHover)
BitmapDisabled = property(GetBitmapDisabled)
PopupWindowState = property(GetPopupWindowState)
_combo.ComboCtrl_swigregister(ComboCtrl)
def PreComboCtrl(*args, **kwargs):
@@ -895,5 +914,91 @@ def PreOwnerDrawnComboBox(*args, **kwargs):
val = _combo.new_PreOwnerDrawnComboBox(*args, **kwargs)
return val
class BitmapComboBox(OwnerDrawnComboBox):
"""
A combobox that displays a bitmap in front of the list items. It
currently only allows using bitmaps of one size, and resizes itself so
that a bitmap can be shown next to the text field.
"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args, **kwargs):
"""
__init__(self, Window parent, int id=-1, String value=EmptyString,
Point pos=DefaultPosition, Size size=DefaultSize,
wxArrayString choices=wxPyEmptyStringArray,
long style=0, Validator validator=DefaultValidator,
String name=wxBitmapComboBoxNameStr) -> BitmapComboBox
Standard constructor
"""
_combo.BitmapComboBox_swiginit(self,_combo.new_BitmapComboBox(*args, **kwargs))
self._setOORInfo(self);
def Create(*args, **kwargs):
"""
Create(self, Window parent, int id=-1, String value=EmptyString,
Point pos=DefaultPosition, Size size=DefaultSize,
wxArrayString choices=wxPyEmptyStringArray,
long style=0, Validator validator=DefaultValidator,
String name=wxBitmapComboBoxNameStr) -> bool
Create the UI object, and other initialization.
"""
return _combo.BitmapComboBox_Create(*args, **kwargs)
def Append(*args, **kwargs):
"""
Append(self, String item, Bitmap bitmap=wxNullBitmap, PyObject clientData=None) -> int
Adds the item to the control, associating the given data with the item
if not None. The return value is the index of the newly added item.
"""
return _combo.BitmapComboBox_Append(*args, **kwargs)
def GetItemBitmap(*args, **kwargs):
"""
GetItemBitmap(self, unsigned int n) -> Bitmap
Returns the image of the item with the given index.
"""
return _combo.BitmapComboBox_GetItemBitmap(*args, **kwargs)
def Insert(*args, **kwargs):
"""
Insert(self, String item, Bitmap bitmap, unsigned int pos, PyObject clientData=None) -> int
Insert an item into the control before the item at the ``pos`` index,
optionally associating some data object with the item.
"""
return _combo.BitmapComboBox_Insert(*args, **kwargs)
def SetItemBitmap(*args, **kwargs):
"""
SetItemBitmap(self, unsigned int n, Bitmap bitmap)
Sets the image for the given item.
"""
return _combo.BitmapComboBox_SetItemBitmap(*args, **kwargs)
def GetBitmapSize(*args, **kwargs):
"""
GetBitmapSize(self) -> Size
Returns size of the image used in list.
"""
return _combo.BitmapComboBox_GetBitmapSize(*args, **kwargs)
_combo.BitmapComboBox_swigregister(BitmapComboBox)
def PreBitmapComboBox(*args, **kwargs):
"""
PreBitmapComboBox() -> BitmapComboBox
2-phase create constructor.
"""
val = _combo.new_PreBitmapComboBox(*args, **kwargs)
return val

File diff suppressed because one or more lines are too long

View File

@@ -1428,8 +1428,6 @@ def PreRichTextCtrl(*args, **kwargs):
val = _richtext.new_PreRichTextCtrl(*args, **kwargs)
return val
wxEVT_COMMAND_RICHTEXT_ITEM_SELECTED = _richtext.wxEVT_COMMAND_RICHTEXT_ITEM_SELECTED
wxEVT_COMMAND_RICHTEXT_ITEM_DESELECTED = _richtext.wxEVT_COMMAND_RICHTEXT_ITEM_DESELECTED
wxEVT_COMMAND_RICHTEXT_LEFT_CLICK = _richtext.wxEVT_COMMAND_RICHTEXT_LEFT_CLICK
wxEVT_COMMAND_RICHTEXT_RIGHT_CLICK = _richtext.wxEVT_COMMAND_RICHTEXT_RIGHT_CLICK
wxEVT_COMMAND_RICHTEXT_MIDDLE_CLICK = _richtext.wxEVT_COMMAND_RICHTEXT_MIDDLE_CLICK
@@ -1439,8 +1437,8 @@ wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGING = _richtext.wxEVT_COMMAND_RICHTEXT_ST
wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGED = _richtext.wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGED
wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACING = _richtext.wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACING
wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACED = _richtext.wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACED
EVT_RICHTEXT_ITEM_SELECTED = wx.PyEventBinder(wxEVT_COMMAND_RICHTEXT_ITEM_SELECTED, 1)
EVT_RICHTEXT_ITEM_DESELECTED = wx.PyEventBinder(wxEVT_COMMAND_RICHTEXT_ITEM_DESELECTED, 1)
wxEVT_COMMAND_RICHTEXT_CHARACTER = _richtext.wxEVT_COMMAND_RICHTEXT_CHARACTER
wxEVT_COMMAND_RICHTEXT_DELETE = _richtext.wxEVT_COMMAND_RICHTEXT_DELETE
EVT_RICHTEXT_LEFT_CLICK = wx.PyEventBinder(wxEVT_COMMAND_RICHTEXT_LEFT_CLICK, 1)
EVT_RICHTEXT_RIGHT_CLICK = wx.PyEventBinder(wxEVT_COMMAND_RICHTEXT_RIGHT_CLICK, 1)
EVT_RICHTEXT_MIDDLE_CLICK = wx.PyEventBinder(wxEVT_COMMAND_RICHTEXT_MIDDLE_CLICK, 1)
@@ -1450,6 +1448,8 @@ EVT_RICHTEXT_STYLESHEET_CHANGING = wx.PyEventBinder( wxEVT_COMMAND_RICHTEXT_STYL
EVT_RICHTEXT_STYLESHEET_CHANGED = wx.PyEventBinder( wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGED, 1)
EVT_RICHTEXT_STYLESHEET_REPLACING = wx.PyEventBinder( wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACING, 1)
EVT_RICHTEXT_STYLESHEET_REPLACED = wx.PyEventBinder( wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACED, 1)
EVT_RICHTEXT_CHARACTER = wx.PyEventBinder( wxEVT_COMMAND_RICHTEXT_CHARACTER, 1)
EVT_RICHTEXT_DELETE = wx.PyEventBinder( wxEVT_COMMAND_RICHTEXT_DELETE, 1)
class RichTextEvent(_core.NotifyEvent):
"""Proxy of C++ RichTextEvent class"""
@@ -1458,13 +1458,13 @@ class RichTextEvent(_core.NotifyEvent):
def __init__(self, *args, **kwargs):
"""__init__(self, EventType commandType=wxEVT_NULL, int winid=0) -> RichTextEvent"""
_richtext.RichTextEvent_swiginit(self,_richtext.new_RichTextEvent(*args, **kwargs))
def GetIndex(*args, **kwargs):
"""GetIndex(self) -> int"""
return _richtext.RichTextEvent_GetIndex(*args, **kwargs)
def GetPosition(*args, **kwargs):
"""GetPosition(self) -> int"""
return _richtext.RichTextEvent_GetPosition(*args, **kwargs)
def SetIndex(*args, **kwargs):
"""SetIndex(self, int n)"""
return _richtext.RichTextEvent_SetIndex(*args, **kwargs)
def SetPosition(*args, **kwargs):
"""SetPosition(self, int n)"""
return _richtext.RichTextEvent_SetPosition(*args, **kwargs)
def GetFlags(*args, **kwargs):
"""GetFlags(self) -> int"""
@@ -1475,7 +1475,7 @@ class RichTextEvent(_core.NotifyEvent):
return _richtext.RichTextEvent_SetFlags(*args, **kwargs)
Flags = property(GetFlags,SetFlags,doc="See `GetFlags` and `SetFlags`")
Index = property(GetIndex,SetIndex,doc="See `GetIndex` and `SetIndex`")
Index = property(GetPosition,SetPosition,doc="See `GetPosition` and `SetPosition`")
_richtext.RichTextEvent_swigregister(RichTextEvent)

View File

@@ -11906,7 +11906,7 @@ fail:
}
SWIGINTERN PyObject *_wrap_RichTextEvent_GetIndex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
SWIGINTERN PyObject *_wrap_RichTextEvent_GetPosition(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
wxRichTextEvent *arg1 = (wxRichTextEvent *) 0 ;
int result;
@@ -11918,12 +11918,12 @@ SWIGINTERN PyObject *_wrap_RichTextEvent_GetIndex(PyObject *SWIGUNUSEDPARM(self)
swig_obj[0] = args;
res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_wxRichTextEvent, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RichTextEvent_GetIndex" "', expected argument " "1"" of type '" "wxRichTextEvent const *""'");
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RichTextEvent_GetPosition" "', expected argument " "1"" of type '" "wxRichTextEvent const *""'");
}
arg1 = reinterpret_cast< wxRichTextEvent * >(argp1);
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
result = (int)((wxRichTextEvent const *)arg1)->GetIndex();
result = (int)((wxRichTextEvent const *)arg1)->GetPosition();
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) SWIG_fail;
}
@@ -11934,7 +11934,7 @@ fail:
}
SWIGINTERN PyObject *_wrap_RichTextEvent_SetIndex(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
SWIGINTERN PyObject *_wrap_RichTextEvent_SetPosition(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
PyObject *resultobj = 0;
wxRichTextEvent *arg1 = (wxRichTextEvent *) 0 ;
int arg2 ;
@@ -11948,20 +11948,20 @@ SWIGINTERN PyObject *_wrap_RichTextEvent_SetIndex(PyObject *SWIGUNUSEDPARM(self)
(char *) "self",(char *) "n", NULL
};
if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:RichTextEvent_SetIndex",kwnames,&obj0,&obj1)) SWIG_fail;
if (!PyArg_ParseTupleAndKeywords(args,kwargs,(char *)"OO:RichTextEvent_SetPosition",kwnames,&obj0,&obj1)) SWIG_fail;
res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_wxRichTextEvent, 0 | 0 );
if (!SWIG_IsOK(res1)) {
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RichTextEvent_SetIndex" "', expected argument " "1"" of type '" "wxRichTextEvent *""'");
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "RichTextEvent_SetPosition" "', expected argument " "1"" of type '" "wxRichTextEvent *""'");
}
arg1 = reinterpret_cast< wxRichTextEvent * >(argp1);
ecode2 = SWIG_AsVal_int(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RichTextEvent_SetIndex" "', expected argument " "2"" of type '" "int""'");
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "RichTextEvent_SetPosition" "', expected argument " "2"" of type '" "int""'");
}
arg2 = static_cast< int >(val2);
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
(arg1)->SetIndex(arg2);
(arg1)->SetPosition(arg2);
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) SWIG_fail;
}
@@ -12294,8 +12294,8 @@ static PyMethodDef SwigMethods[] = {
{ (char *)"RichTextCtrl_swigregister", RichTextCtrl_swigregister, METH_VARARGS, NULL},
{ (char *)"RichTextCtrl_swiginit", RichTextCtrl_swiginit, METH_VARARGS, NULL},
{ (char *)"new_RichTextEvent", (PyCFunction) _wrap_new_RichTextEvent, METH_VARARGS | METH_KEYWORDS, NULL},
{ (char *)"RichTextEvent_GetIndex", (PyCFunction)_wrap_RichTextEvent_GetIndex, METH_O, NULL},
{ (char *)"RichTextEvent_SetIndex", (PyCFunction) _wrap_RichTextEvent_SetIndex, METH_VARARGS | METH_KEYWORDS, NULL},
{ (char *)"RichTextEvent_GetPosition", (PyCFunction)_wrap_RichTextEvent_GetPosition, METH_O, NULL},
{ (char *)"RichTextEvent_SetPosition", (PyCFunction) _wrap_RichTextEvent_SetPosition, METH_VARARGS | METH_KEYWORDS, NULL},
{ (char *)"RichTextEvent_GetFlags", (PyCFunction)_wrap_RichTextEvent_GetFlags, METH_O, NULL},
{ (char *)"RichTextEvent_SetFlags", (PyCFunction) _wrap_RichTextEvent_SetFlags, METH_VARARGS | METH_KEYWORDS, NULL},
{ (char *)"RichTextEvent_swigregister", RichTextEvent_swigregister, METH_VARARGS, NULL},
@@ -14500,8 +14500,6 @@ SWIGEXPORT void SWIG_init(void) {
SWIG_Python_SetConstant(d, "TEXT_ATTR_CHARACTER",SWIG_From_int(static_cast< int >(wxTEXT_ATTR_CHARACTER)));
SWIG_Python_SetConstant(d, "TEXT_ATTR_PARAGRAPH",SWIG_From_int(static_cast< int >(wxTEXT_ATTR_PARAGRAPH)));
SWIG_Python_SetConstant(d, "TEXT_ATTR_ALL",SWIG_From_int(static_cast< int >(wxTEXT_ATTR_ALL)));
PyDict_SetItemString(d, "wxEVT_COMMAND_RICHTEXT_ITEM_SELECTED", PyInt_FromLong(wxEVT_COMMAND_RICHTEXT_ITEM_SELECTED));
PyDict_SetItemString(d, "wxEVT_COMMAND_RICHTEXT_ITEM_DESELECTED", PyInt_FromLong(wxEVT_COMMAND_RICHTEXT_ITEM_DESELECTED));
PyDict_SetItemString(d, "wxEVT_COMMAND_RICHTEXT_LEFT_CLICK", PyInt_FromLong(wxEVT_COMMAND_RICHTEXT_LEFT_CLICK));
PyDict_SetItemString(d, "wxEVT_COMMAND_RICHTEXT_RIGHT_CLICK", PyInt_FromLong(wxEVT_COMMAND_RICHTEXT_RIGHT_CLICK));
PyDict_SetItemString(d, "wxEVT_COMMAND_RICHTEXT_MIDDLE_CLICK", PyInt_FromLong(wxEVT_COMMAND_RICHTEXT_MIDDLE_CLICK));
@@ -14511,6 +14509,8 @@ SWIGEXPORT void SWIG_init(void) {
PyDict_SetItemString(d, "wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGED", PyInt_FromLong(wxEVT_COMMAND_RICHTEXT_STYLESHEET_CHANGED));
PyDict_SetItemString(d, "wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACING", PyInt_FromLong(wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACING));
PyDict_SetItemString(d, "wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACED", PyInt_FromLong(wxEVT_COMMAND_RICHTEXT_STYLESHEET_REPLACED));
PyDict_SetItemString(d, "wxEVT_COMMAND_RICHTEXT_CHARACTER", PyInt_FromLong(wxEVT_COMMAND_RICHTEXT_CHARACTER));
PyDict_SetItemString(d, "wxEVT_COMMAND_RICHTEXT_DELETE", PyInt_FromLong(wxEVT_COMMAND_RICHTEXT_DELETE));
wxRichTextModuleInit();