Added the wx.combo module, which contains the ComboCtrl and ComboPopup
classes. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43453 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
469
wxPython/demo/ComboCtrl.py
Normal file
469
wxPython/demo/ComboCtrl.py
Normal file
@@ -0,0 +1,469 @@
|
||||
|
||||
import wx
|
||||
import wx.combo
|
||||
import os
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
class NullLog:
|
||||
def write(*args):
|
||||
pass
|
||||
|
||||
|
||||
# This class is used to provide an interface between a ComboCtrl and a
|
||||
# ListCtrl that is used as the popoup for the combo widget. In this
|
||||
# case we use multiple inheritance to derive from both wx.ListCtrl and
|
||||
# wx.ComboPopup, but it also works well when deriving from just
|
||||
# ComboPopup and using a has-a relationship with the popup control,
|
||||
# you just need to be sure to return the control itself from the
|
||||
# GetControl method.
|
||||
|
||||
class ListCtrlComboPopup(wx.ListCtrl, wx.combo.ComboPopup):
|
||||
|
||||
def __init__(self, log=None):
|
||||
if log:
|
||||
self.log = log
|
||||
else:
|
||||
self.log = NullLog()
|
||||
|
||||
|
||||
# Since we are using multiple inheritance, and don't know yet
|
||||
# which window is to be the parent, we'll do 2-phase create of
|
||||
# the ListCtrl instead, and call its Create method later in
|
||||
# our Create method. (See Create below.)
|
||||
self.PostCreate(wx.PreListCtrl())
|
||||
|
||||
# Also init the ComboPopup base class.
|
||||
wx.combo.ComboPopup.__init__(self)
|
||||
|
||||
|
||||
def AddItem(self, txt):
|
||||
self.InsertStringItem(self.GetItemCount(), txt)
|
||||
|
||||
def OnMotion(self, evt):
|
||||
item, flags = self.HitTest(evt.GetPosition())
|
||||
if item >= 0:
|
||||
self.Select(item)
|
||||
self.curitem = item
|
||||
|
||||
def OnLeftDown(self, evt):
|
||||
self.value = self.curitem
|
||||
self.Dismiss()
|
||||
|
||||
|
||||
# The following methods are those that are overridable from the
|
||||
# ComboPopup base class. Most of them are not required, but all
|
||||
# are shown here for demonstration purposes.
|
||||
|
||||
|
||||
# This is called immediately after construction finishes. You can
|
||||
# use self.GetCombo if needed to get to the ComboCtrl instance.
|
||||
def Init(self):
|
||||
self.log.write("ListCtrlComboPopup.Init")
|
||||
self.value = -1
|
||||
self.curitem = -1
|
||||
|
||||
|
||||
# Create the popup child control. Return true for success.
|
||||
def Create(self, parent):
|
||||
self.log.write("ListCtrlComboPopup.Create")
|
||||
wx.ListCtrl.Create(self, parent,
|
||||
style=wx.LC_LIST|wx.LC_SINGLE_SEL|
|
||||
wx.LC_SORT_ASCENDING|wx.SIMPLE_BORDER)
|
||||
self.Bind(wx.EVT_MOTION, self.OnMotion)
|
||||
self.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown)
|
||||
return True
|
||||
|
||||
|
||||
# Return the widget that is to be used for the popup
|
||||
def GetControl(self):
|
||||
#self.log.write("ListCtrlComboPopup.GetControl")
|
||||
return self
|
||||
|
||||
# Called just prior to displaying the popup, you can use it to
|
||||
# 'select' the current item.
|
||||
def SetStringValue(self, val):
|
||||
self.log.write("ListCtrlComboPopup.SetStringValue")
|
||||
idx = self.FindItem(-1, val)
|
||||
if idx != wx.NOT_FOUND:
|
||||
self.Select(idx)
|
||||
|
||||
# Return a string representation of the current item.
|
||||
def GetStringValue(self):
|
||||
self.log.write("ListCtrlComboPopup.GetStringValue")
|
||||
if self.value >= 0:
|
||||
return self.GetItemText(self.value)
|
||||
return ""
|
||||
|
||||
# Called immediately after the popup is shown
|
||||
def OnPopup(self):
|
||||
self.log.write("ListCtrlComboPopup.OnPopup")
|
||||
wx.combo.ComboPopup.OnPopup(self)
|
||||
|
||||
# Called when popup is dismissed
|
||||
def OnDismiss(self):
|
||||
self.log.write("ListCtrlComboPopup.OnDismiss")
|
||||
wx.combo.ComboPopup.OnDismiss(self)
|
||||
|
||||
# This is called to custom paint in the combo control itself
|
||||
# (ie. not the popup). Default implementation draws value as
|
||||
# string.
|
||||
def PaintComboControl(self, dc, rect):
|
||||
self.log.write("ListCtrlComboPopup.PaintComboControl")
|
||||
wx.combo.ComboPopup.PaintComboControl(self, dc, rect)
|
||||
|
||||
# Receives key events from the parent ComboCtrl. Events not
|
||||
# handled should be skipped, as usual.
|
||||
def OnComboKeyEvent(self, event):
|
||||
self.log.write("ListCtrlComboPopup.OnComboKeyEvent")
|
||||
wx.combo.ComboPopup.OnComboKeyEvent(self, event)
|
||||
|
||||
# Implement if you need to support special action when user
|
||||
# double-clicks on the parent wxComboCtrl.
|
||||
def OnComboDoubleClick(self):
|
||||
self.log.write("ListCtrlComboPopup.OnComboDoubleClick")
|
||||
wx.combo.ComboPopup.OnComboDoubleClick(self)
|
||||
|
||||
# Return final size of popup. Called on every popup, just prior to OnPopup.
|
||||
# minWidth = preferred minimum width for window
|
||||
# prefHeight = preferred height. Only applies if > 0,
|
||||
# maxHeight = max height for window, as limited by screen size
|
||||
# and should only be rounded down, if necessary.
|
||||
def GetAdjustedSize(self, minWidth, prefHeight, maxHeight):
|
||||
self.log.write("ListCtrlComboPopup.GetAdjustedSize: %d, %d, %d" % (minWidth, prefHeight, maxHeight))
|
||||
return wx.combo.ComboPopup.GetAdjustedSize(self, minWidth, prefHeight, maxHeight)
|
||||
|
||||
# Return true if you want delay the call to Create until the popup
|
||||
# is shown for the first time. It is more efficient, but note that
|
||||
# it is often more convenient to have the control created
|
||||
# immediately.
|
||||
# Default returns false.
|
||||
def LazyCreate(self):
|
||||
self.log.write("ListCtrlComboPopup.LazyCreate")
|
||||
return wx.combo.ComboPopup.LazyCreate(self)
|
||||
|
||||
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
# This class is a popup containing a TreeCtrl. This time we'll use a
|
||||
# has-a style (instead of is-a like above.)
|
||||
|
||||
class TreeCtrlComboPopup(wx.combo.ComboPopup):
|
||||
|
||||
# overridden ComboPopup methods
|
||||
|
||||
def Init(self):
|
||||
self.value = None
|
||||
self.curitem = None
|
||||
|
||||
|
||||
def Create(self, parent):
|
||||
self.tree = wx.TreeCtrl(parent, style=wx.TR_HIDE_ROOT
|
||||
|wx.TR_HAS_BUTTONS
|
||||
|wx.TR_SINGLE
|
||||
|wx.TR_LINES_AT_ROOT
|
||||
|wx.SIMPLE_BORDER)
|
||||
self.tree.Bind(wx.EVT_MOTION, self.OnMotion)
|
||||
self.tree.Bind(wx.EVT_LEFT_DOWN, self.OnLeftDown)
|
||||
|
||||
|
||||
def GetControl(self):
|
||||
return self.tree
|
||||
|
||||
|
||||
def GetStringValue(self):
|
||||
if self.value:
|
||||
return self.tree.GetItemText(self.value)
|
||||
return ""
|
||||
|
||||
|
||||
def OnPopup(self):
|
||||
if self.value:
|
||||
self.tree.EnsureVisible(self.value)
|
||||
self.tree.SelectItem(self.value)
|
||||
|
||||
|
||||
def SetStringValue(self, value):
|
||||
# this assumes that item strings are unique...
|
||||
root = self.tree.GetRootItem()
|
||||
if not root:
|
||||
return
|
||||
found = self.FindItem(root, value)
|
||||
if found:
|
||||
self.value = found
|
||||
self.tree.SelectItem(found)
|
||||
|
||||
|
||||
def GetAdjustedSize(self, minWidth, prefHeight, maxHeight):
|
||||
return wx.Size(minWidth, min(200, maxHeight))
|
||||
|
||||
|
||||
# helpers
|
||||
|
||||
def FindItem(self, parentItem, text):
|
||||
item, cookie = self.tree.GetFirstChild(parentItem)
|
||||
while item:
|
||||
if self.tree.GetItemText(item) == text:
|
||||
return item
|
||||
if self.tree.ItemHasChildren(item):
|
||||
item = self.FindItem(item, text)
|
||||
item, cookie = self.tree.GetNextChild(parentItem, cookie)
|
||||
return wx.TreeItemId();
|
||||
|
||||
|
||||
def AddItem(self, value, parent=None):
|
||||
if not parent:
|
||||
root = self.tree.GetRootItem()
|
||||
if not root:
|
||||
root = self.tree.AddRoot("<hidden root>")
|
||||
parent = root
|
||||
|
||||
item = self.tree.AppendItem(parent, value)
|
||||
return item
|
||||
|
||||
|
||||
def OnMotion(self, evt):
|
||||
# have the selection follow the mouse, like in a real combobox
|
||||
item, flags = self.tree.HitTest(evt.GetPosition())
|
||||
if item and flags & wx.TREE_HITTEST_ONITEMLABEL:
|
||||
self.tree.SelectItem(item)
|
||||
self.curitem = item
|
||||
evt.Skip()
|
||||
|
||||
|
||||
def OnLeftDown(self, evt):
|
||||
# do the combobox selection
|
||||
item, flags = self.tree.HitTest(evt.GetPosition())
|
||||
if item and flags & wx.TREE_HITTEST_ONITEMLABEL:
|
||||
self.curitem = item
|
||||
self.value = item
|
||||
self.Dismiss()
|
||||
evt.Skip()
|
||||
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
# Here we subclass wx.combo.ComboCtrl to do some custom popup animation
|
||||
|
||||
CUSTOM_COMBOBOX_ANIMATION_DURATION = 200
|
||||
|
||||
class ComboCtrlWithCustomPopupAnim(wx.combo.ComboCtrl):
|
||||
def __init__(self, *args, **kw):
|
||||
wx.combo.ComboCtrl.__init__(self, *args, **kw)
|
||||
self.Bind(wx.EVT_TIMER, self.OnTimer)
|
||||
self.aniTimer = wx.Timer(self)
|
||||
|
||||
|
||||
def AnimateShow(self, rect, flags):
|
||||
self.aniStart = wx.GetLocalTimeMillis()
|
||||
self.aniRect = wx.Rect(*rect)
|
||||
self.aniFlags = flags
|
||||
|
||||
dc = wx.ScreenDC()
|
||||
bmp = wx.EmptyBitmap(rect.width, rect.height)
|
||||
mdc = wx.MemoryDC(bmp)
|
||||
mdc.Blit(0, 0, rect.width, rect.height, dc, rect.x, rect.y)
|
||||
del mdc
|
||||
self.aniBackBitmap = bmp
|
||||
|
||||
self.aniTimer.Start(10, wx.TIMER_CONTINUOUS)
|
||||
self.OnTimer(None)
|
||||
return False
|
||||
|
||||
|
||||
def OnTimer(self, evt):
|
||||
stopTimer = False
|
||||
popup = self.GetPopupControl().GetControl()
|
||||
rect = self.aniRect
|
||||
dc = wx.ScreenDC()
|
||||
|
||||
if self.IsPopupWindowState(self.Hidden):
|
||||
stopTimer = True
|
||||
else:
|
||||
pos = wx.GetLocalTimeMillis() - self.aniStart
|
||||
if pos < CUSTOM_COMBOBOX_ANIMATION_DURATION:
|
||||
# Actual animation happens here
|
||||
width = rect.width
|
||||
height = rect.height
|
||||
|
||||
center_x = rect.x + (width/2)
|
||||
center_y = rect.y + (height/2)
|
||||
|
||||
dc.SetPen( wx.BLACK_PEN )
|
||||
dc.SetBrush( wx.TRANSPARENT_BRUSH )
|
||||
|
||||
w = (((pos*256)/CUSTOM_COMBOBOX_ANIMATION_DURATION)*width)/256
|
||||
ratio = float(w) / float(width)
|
||||
h = int(height * ratio)
|
||||
|
||||
dc.DrawBitmap( self.aniBackBitmap, rect.x, rect.y )
|
||||
dc.DrawRectangle( center_x - w/2, center_y - h/2, w, h )
|
||||
else:
|
||||
stopTimer = True
|
||||
|
||||
if stopTimer:
|
||||
dc.DrawBitmap( self.aniBackBitmap, rect.x, rect.y )
|
||||
popup.Move( (0, 0) )
|
||||
self.aniTimer.Stop()
|
||||
self.DoShowPopup( rect, self.aniFlags )
|
||||
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
# FileSelectorCombo displays a dialog instead of a popup control, it
|
||||
# also uses a custom bitmap on the combo button.
|
||||
|
||||
class FileSelectorCombo(wx.combo.ComboCtrl):
|
||||
def __init__(self, *args, **kw):
|
||||
wx.combo.ComboCtrl.__init__(self, *args, **kw)
|
||||
|
||||
# make a custom bitmap showing "..."
|
||||
bw, bh = 16, 16
|
||||
bmp = wx.EmptyBitmap(bw,bh)
|
||||
dc = wx.MemoryDC(bmp)
|
||||
|
||||
# clear to a specific background colour
|
||||
bgcolor = wx.Colour(255,0,255)
|
||||
dc.SetBackground(wx.Brush(bgcolor))
|
||||
dc.Clear()
|
||||
|
||||
# draw the label onto the bitmap
|
||||
label = "..."
|
||||
font = wx.SystemSettings.GetFont(wx.SYS_DEFAULT_GUI_FONT)
|
||||
font.SetWeight(wx.FONTWEIGHT_BOLD)
|
||||
dc.SetFont(font)
|
||||
tw,th = dc.GetTextExtent(label)
|
||||
print tw, th
|
||||
dc.DrawText(label, (bw-tw)/2, (bw-tw)/2)
|
||||
del dc
|
||||
|
||||
# now apply a mask using the bgcolor
|
||||
bmp.SetMaskColour(bgcolor)
|
||||
|
||||
# and tell the ComboCtrl to use it
|
||||
self.SetButtonBitmaps(bmp, True)
|
||||
|
||||
|
||||
# Overridden from ComboCtrl, called when the combo button is clicked
|
||||
def OnButtonClick(self):
|
||||
path = ""
|
||||
name = ""
|
||||
if self.GetValue():
|
||||
path, name = os.path.split(self.GetValue())
|
||||
|
||||
dlg = wx.FileDialog(self, "Choose File", path, name,
|
||||
"All files (*.*)|*.*", wx.FD_OPEN)
|
||||
if dlg.ShowModal() == wx.ID_OK:
|
||||
self.SetValue(dlg.GetPath())
|
||||
dlg.Destroy()
|
||||
|
||||
|
||||
# Overridden from ComboCtrl to avoid assert since there is no ComboPopup
|
||||
def DoSetPopupControl(self, popup):
|
||||
pass
|
||||
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
|
||||
class TestPanel(wx.Panel):
|
||||
def __init__(self, parent, log):
|
||||
self.log = log
|
||||
wx.Panel.__init__(self, parent, -1)
|
||||
|
||||
fgs = wx.FlexGridSizer(cols=3, hgap=10, vgap=10)
|
||||
|
||||
cc = self.MakeLCCombo(log=self.log)
|
||||
fgs.Add(cc)
|
||||
fgs.Add((10,10))
|
||||
fgs.Add(wx.StaticText(self, -1, "wx.ComboCtrl with a ListCtrl popup"))
|
||||
|
||||
cc = self.MakeLCCombo(style=wx.CB_READONLY)
|
||||
fgs.Add(cc)
|
||||
fgs.Add((10,10))
|
||||
fgs.Add(wx.StaticText(self, -1, " Read-only"))
|
||||
|
||||
cc = self.MakeLCCombo()
|
||||
cc.SetButtonPosition(side=wx.LEFT)
|
||||
fgs.Add(cc)
|
||||
fgs.Add((10,10))
|
||||
fgs.Add(wx.StaticText(self, -1, " Button on the left"))
|
||||
|
||||
cc = self.MakeLCCombo()
|
||||
cc.SetPopupMaxHeight(250)
|
||||
fgs.Add(cc)
|
||||
fgs.Add((10,10))
|
||||
fgs.Add(wx.StaticText(self, -1, " Max height of popup set"))
|
||||
|
||||
cc = wx.combo.ComboCtrl(self, size=(250,-1))
|
||||
tcp = TreeCtrlComboPopup()
|
||||
cc.SetPopupControl(tcp)
|
||||
fgs.Add(cc)
|
||||
fgs.Add((10,10))
|
||||
fgs.Add(wx.StaticText(self, -1, "TreeCtrl popup"))
|
||||
# add some items to the tree
|
||||
for i in range(5):
|
||||
item = tcp.AddItem('Item %d' % (i+1))
|
||||
for j in range(15):
|
||||
tcp.AddItem('Subitem %d-%d' % (i+1, j+1), parent=item)
|
||||
|
||||
cc = ComboCtrlWithCustomPopupAnim(self, size=(250, -1))
|
||||
popup = ListCtrlComboPopup()
|
||||
cc.SetPopupMaxHeight(150)
|
||||
cc.SetPopupControl(popup)
|
||||
fgs.Add(cc)
|
||||
fgs.Add((10,10))
|
||||
fgs.Add(wx.StaticText(self, -1, "Custom popup animation"))
|
||||
for word in "How cool was that!? Way COOL!".split():
|
||||
popup.AddItem(word)
|
||||
|
||||
|
||||
cc = FileSelectorCombo(self, size=(250, -1))
|
||||
fgs.Add(cc)
|
||||
fgs.Add((10,10))
|
||||
fgs.Add(wx.StaticText(self, -1, "Custom popup action, and custom button bitmap"))
|
||||
|
||||
|
||||
box = wx.BoxSizer()
|
||||
box.Add(fgs, 1, wx.EXPAND|wx.ALL, 20)
|
||||
self.SetSizer(box)
|
||||
|
||||
|
||||
def MakeLCCombo(self, log=None, style=0):
|
||||
# Create a ComboCtrl
|
||||
cc = wx.combo.ComboCtrl(self, style=style, size=(250,-1))
|
||||
|
||||
# Create a Popup
|
||||
popup = ListCtrlComboPopup(log)
|
||||
|
||||
# Associate them with each other. This also triggers the
|
||||
# creation of the ListCtrl.
|
||||
cc.SetPopupControl(popup)
|
||||
|
||||
# Add some items to the listctrl.
|
||||
for x in range(75):
|
||||
popup.AddItem("Item-%02d" % x)
|
||||
|
||||
return cc
|
||||
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
def runTest(frame, nb, log):
|
||||
win = TestPanel(nb, log)
|
||||
return win
|
||||
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
overview = """<html><body>
|
||||
<h2><center>wx.combo.ComboCtrl</center></h2>
|
||||
|
||||
</body></html>
|
||||
"""
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
import sys,os
|
||||
import run
|
||||
run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])
|
@@ -70,6 +70,7 @@ _treeList = [
|
||||
'AlphaDrawing',
|
||||
'GraphicsContext',
|
||||
'CollapsiblePane',
|
||||
'ComboCtrl',
|
||||
]),
|
||||
|
||||
# managed windows == things with a (optional) caption you can close
|
||||
@@ -113,6 +114,7 @@ _treeList = [
|
||||
'CheckListBox',
|
||||
'Choice',
|
||||
'ComboBox',
|
||||
'ComboCtrl',
|
||||
'Gauge',
|
||||
'Grid',
|
||||
'Grid_MegaExample',
|
||||
@@ -179,6 +181,7 @@ _treeList = [
|
||||
'CalendarCtrl',
|
||||
'CheckListCtrlMixin',
|
||||
'CollapsiblePane',
|
||||
'ComboCtrl',
|
||||
'ContextHelp',
|
||||
'DatePickerCtrl',
|
||||
'DynamicSashWindow',
|
||||
|
@@ -12,6 +12,14 @@ Added wx.CollapsiblePane. On wxGTK it uses a native expander widget,
|
||||
on the other platforms a regular button is used to control the
|
||||
collapsed/expanded state.
|
||||
|
||||
Added the wx.combo module, which contains the ComboCtrl and ComboPopup
|
||||
classes. These classes allow you to implement a wx.ComboBox-like
|
||||
widget where the popup can be nearly any kind of widget, and where you
|
||||
have a lot of control over other aspects of the combo widget as well.
|
||||
It works very well on GTK and MSW, using native renderers for drawing
|
||||
the combo button, but is unfortunatly still a bit klunky on OSX...
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -378,7 +386,7 @@ were worked around in the wrapper code.
|
||||
|
||||
Added wx.lib.delayedresult from Oliver Schoenborn.
|
||||
|
||||
Added wx.lib.expando, a multi-line textctrl that exands as more lines
|
||||
Added wx.lib.expando, a multi-line textctrl that expands as more lines
|
||||
are needed.
|
||||
|
||||
wx.Image.Scale and Rescale methods now take an extra parameter
|
||||
|
@@ -1660,6 +1660,25 @@ extern wxPyApp *wxPythonApp;
|
||||
return rval; \
|
||||
}
|
||||
|
||||
|
||||
|
||||
#define DEC_PYCALLBACK_BOOL_WXWIN_pure(CBNAME) \
|
||||
bool CBNAME(wxWindow* a)
|
||||
|
||||
#define IMP_PYCALLBACK_BOOL_WXWIN_pure(CLASS, PCLASS, CBNAME) \
|
||||
bool CLASS::CBNAME(wxWindow* a) { \
|
||||
bool rval=false; \
|
||||
bool found; \
|
||||
wxPyBlock_t blocked = wxPyBeginBlockThreads(); \
|
||||
if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
|
||||
PyObject* obj = wxPyMake_wxObject(a,false); \
|
||||
rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", obj)); \
|
||||
Py_DECREF(obj); \
|
||||
} \
|
||||
wxPyEndBlockThreads(blocked); \
|
||||
return rval; \
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
#define DEC_PYCALLBACK_BOOL_WXWINDC(CBNAME) \
|
||||
@@ -2296,9 +2315,26 @@ extern wxPyApp *wxPythonApp;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
#define DEC_PYCALLBACK_COORD_SIZET_constpure(CBNAME) \
|
||||
#define DEC_PYCALLBACK_COORD_SIZET_const(CBNAME) \
|
||||
wxCoord CBNAME(size_t a) const
|
||||
|
||||
#define IMP_PYCALLBACK_COORD_SIZET_const(CLASS, PCLASS, CBNAME) \
|
||||
wxCoord CLASS::CBNAME(size_t a) const { \
|
||||
wxCoord rval=0; \
|
||||
bool found; \
|
||||
wxPyBlock_t blocked = wxPyBeginBlockThreads(); \
|
||||
if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
|
||||
rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(i)", a)); \
|
||||
} \
|
||||
wxPyEndBlockThreads(blocked); \
|
||||
if (! found) \
|
||||
rval = PCLASS::CBNAME(a); \
|
||||
return rval; \
|
||||
} \
|
||||
|
||||
|
||||
#define DEC_PYCALLBACK_COORD_SIZET_constpure(CBNAME) \
|
||||
wxCoord CBNAME(size_t a) const
|
||||
|
||||
#define IMP_PYCALLBACK_COORD_SIZET_constpure(CLASS, PCLASS, CBNAME) \
|
||||
wxCoord CLASS::CBNAME(size_t a) const { \
|
||||
@@ -2427,6 +2463,67 @@ extern wxPyApp *wxPythonApp;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
#define DEC_PYCALLBACK__DCRECTINTINT_const(CBNAME) \
|
||||
void CBNAME(wxDC& a, const wxRect& b, int c, int d) const
|
||||
|
||||
#define IMP_PYCALLBACK__DCRECTINTINT_const(CLASS, PCLASS, CBNAME) \
|
||||
void CLASS::CBNAME(wxDC& a, const wxRect& b, int c, int d) const { \
|
||||
bool found; \
|
||||
wxPyBlock_t blocked = wxPyBeginBlockThreads(); \
|
||||
if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
|
||||
PyObject* obj = wxPyMake_wxObject(&a,false); \
|
||||
PyObject* ro = wxPyConstructObject((void*)&b, wxT("wxRect"), 0); \
|
||||
wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OOii)", obj, ro, c, d)); \
|
||||
Py_DECREF(obj); Py_DECREF(ro); \
|
||||
} \
|
||||
wxPyEndBlockThreads(blocked); \
|
||||
if (! found) \
|
||||
PCLASS::CBNAME(a,b,c,d); \
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
#define DEC_PYCALLBACK__RECTINT(CBNAME) \
|
||||
void CBNAME(const wxRect& a, int b)
|
||||
|
||||
#define IMP_PYCALLBACK__RECTINT(CLASS, PCLASS, CBNAME) \
|
||||
void CLASS::CBNAME(const wxRect& a, int b) { \
|
||||
bool found; \
|
||||
wxPyBlock_t blocked = wxPyBeginBlockThreads(); \
|
||||
if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
|
||||
PyObject* ro = wxPyConstructObject((void*)&a, wxT("wxRect"), 0); \
|
||||
wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oi)", ro, b)); \
|
||||
Py_DECREF(ro); \
|
||||
} \
|
||||
wxPyEndBlockThreads(blocked); \
|
||||
if (! found) \
|
||||
PCLASS::CBNAME(a,b); \
|
||||
}
|
||||
|
||||
|
||||
#define DEC_PYCALLBACK_BOOL_RECTINT(CBNAME) \
|
||||
bool CBNAME(const wxRect& a, int b)
|
||||
|
||||
#define IMP_PYCALLBACK_BOOL_RECTINT(CLASS, PCLASS, CBNAME) \
|
||||
bool CLASS::CBNAME(const wxRect& a, int b) { \
|
||||
bool found; \
|
||||
bool rval = false; \
|
||||
wxPyBlock_t blocked = wxPyBeginBlockThreads(); \
|
||||
if ((found = wxPyCBH_findCallback(m_myInst, #CBNAME))) { \
|
||||
PyObject* ro = wxPyConstructObject((void*)&a, wxT("wxRect"), 0); \
|
||||
rval = wxPyCBH_callCallback(m_myInst, Py_BuildValue("(Oi)", ro, b));\
|
||||
Py_DECREF(ro); \
|
||||
} \
|
||||
wxPyEndBlockThreads(blocked); \
|
||||
if (! found) \
|
||||
rval = PCLASS::CBNAME(a,b); \
|
||||
return rval; \
|
||||
}
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
#define DEC_PYCALLBACK_STRING_SIZET(CBNAME) \
|
||||
wxString CBNAME(size_t a) const
|
||||
|
||||
|
@@ -361,6 +361,20 @@ ext = Extension('_calendar', swig_sources,
|
||||
wxpExtensions.append(ext)
|
||||
|
||||
|
||||
swig_sources = run_swig(['combo.i'], 'src', GENDIR, PKGDIR,
|
||||
USE_SWIG, swig_force, swig_args, swig_deps)
|
||||
ext = Extension('_combo', swig_sources,
|
||||
include_dirs = includes,
|
||||
define_macros = defines,
|
||||
library_dirs = libdirs,
|
||||
libraries = libs,
|
||||
extra_compile_args = cflags,
|
||||
extra_link_args = lflags,
|
||||
**depends
|
||||
)
|
||||
wxpExtensions.append(ext)
|
||||
|
||||
|
||||
swig_sources = run_swig(['grid.i'], 'src', GENDIR, PKGDIR,
|
||||
USE_SWIG, swig_force, swig_args, swig_deps)
|
||||
ext = Extension('_grid', swig_sources,
|
||||
|
713
wxPython/src/combo.i
Normal file
713
wxPython/src/combo.i
Normal file
@@ -0,0 +1,713 @@
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// Name: combo.i
|
||||
// Purpose: SWIG interface for the owner-drawn combobox classes
|
||||
//
|
||||
// Author: Robin Dunn
|
||||
//
|
||||
// Created: 11-Nov-2006
|
||||
// RCS-ID: $Id$
|
||||
// Copyright: (c) 2006 by Total Control Software
|
||||
// Licence: wxWindows license
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
%define DOCSTRING
|
||||
"ComboCtrl class that can have any type of popup widget, and also an
|
||||
owner-drawn combobox control."
|
||||
%enddef
|
||||
|
||||
%module(package="wx", docstring=DOCSTRING) combo
|
||||
|
||||
%{
|
||||
#include "wx/wxPython/wxPython.h"
|
||||
#include "wx/wxPython/pyclasses.h"
|
||||
|
||||
#include <wx/combo.h>
|
||||
#include <wx/odcombo.h>
|
||||
%}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
%import windows.i
|
||||
%pythoncode { wx = _core }
|
||||
%pythoncode { __docfilter__ = wx.__DocFilter(globals()) }
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
%newgroup
|
||||
|
||||
MAKE_CONST_WXSTRING_NOSWIG(ComboBoxNameStr);
|
||||
MAKE_CONST_WXSTRING_NOSWIG(EmptyString);
|
||||
|
||||
%{
|
||||
const wxArrayString wxPyEmptyStringArray;
|
||||
%}
|
||||
|
||||
|
||||
enum {
|
||||
// Button is preferred outside the border (GTK style)
|
||||
wxCC_BUTTON_OUTSIDE_BORDER = 0x0001,
|
||||
// Show popup on mouse up instead of mouse down (which is the Windows style)
|
||||
wxCC_POPUP_ON_MOUSE_UP = 0x0002,
|
||||
// All text is not automatically selected on click
|
||||
wxCC_NO_TEXT_AUTO_SELECT = 0x0004,
|
||||
};
|
||||
|
||||
|
||||
// Flags used by PreprocessMouseEvent and HandleButtonMouseEvent
|
||||
enum
|
||||
{
|
||||
wxCC_MF_ON_BUTTON = 0x0001, // cursor is on dropbutton area
|
||||
wxCC_MF_ON_CLICK_AREA = 0x0002 // cursor is on dropbutton or other area
|
||||
// that can be clicked to show the popup.
|
||||
};
|
||||
|
||||
|
||||
// Namespace for wxComboCtrl feature flags
|
||||
struct wxComboCtrlFeatures
|
||||
{
|
||||
enum
|
||||
{
|
||||
MovableButton = 0x0001, // Button can be on either side of control
|
||||
BitmapButton = 0x0002, // Button may be replaced with bitmap
|
||||
ButtonSpacing = 0x0004, // Button can have spacing from the edge
|
||||
// of the control
|
||||
TextIndent = 0x0008, // SetTextIndent can be used
|
||||
PaintControl = 0x0010, // Combo control itself can be custom painted
|
||||
PaintWritable = 0x0020, // A variable-width area in front of writable
|
||||
// combo control's textctrl can be custom
|
||||
// painted
|
||||
Borderless = 0x0040, // wxNO_BORDER window style works
|
||||
|
||||
// There are no feature flags for...
|
||||
// PushButtonBitmapBackground - if its in wxRendererNative, then it should be
|
||||
// not an issue to have it automatically under the bitmap.
|
||||
|
||||
All = MovableButton|BitmapButton|
|
||||
ButtonSpacing|TextIndent|
|
||||
PaintControl|PaintWritable|
|
||||
Borderless
|
||||
};
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
// C++ implemetation of Python aware wxComboCtrl
|
||||
%{
|
||||
class wxPyComboCtrl : public wxComboCtrl
|
||||
{
|
||||
DECLARE_ABSTRACT_CLASS(wxPyComboCtrl)
|
||||
public:
|
||||
wxPyComboCtrl() : wxComboCtrl() {}
|
||||
wxPyComboCtrl(wxWindow *parent,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxString& value = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxPyComboBoxNameStr)
|
||||
: wxComboCtrl(parent, id, value, pos, size, style, validator, name)
|
||||
{}
|
||||
|
||||
void DoSetPopupControl(wxComboPopup* popup)
|
||||
{
|
||||
bool found;
|
||||
wxPyBlock_t blocked = wxPyBeginBlockThreads();
|
||||
if ((found = wxPyCBH_findCallback(m_myInst, "DoSetPopupControl"))) {
|
||||
PyObject* obj = wxPyConstructObject(popup, wxT("wxComboPopup"), false);
|
||||
wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)",obj));
|
||||
Py_DECREF(obj);
|
||||
}
|
||||
wxPyEndBlockThreads(blocked);
|
||||
if (! found)
|
||||
wxComboCtrl::DoSetPopupControl(popup);
|
||||
}
|
||||
|
||||
enum
|
||||
{
|
||||
ShowBelow = 0x0000, // Showing popup below the control
|
||||
ShowAbove = 0x0001, // Showing popup above the control
|
||||
CanDeferShow = 0x0002 // Can only return true from AnimateShow if this is set
|
||||
};
|
||||
|
||||
|
||||
DEC_PYCALLBACK_VOID_(OnButtonClick);
|
||||
DEC_PYCALLBACK__RECTINT(DoShowPopup);
|
||||
DEC_PYCALLBACK_BOOL_RECTINT(AnimateShow);
|
||||
|
||||
PYPRIVATE;
|
||||
};
|
||||
|
||||
IMPLEMENT_ABSTRACT_CLASS(wxPyComboCtrl, wxComboCtrl);
|
||||
|
||||
IMP_PYCALLBACK_VOID_(wxPyComboCtrl, wxComboCtrl, OnButtonClick);
|
||||
IMP_PYCALLBACK__RECTINT(wxPyComboCtrl, wxComboCtrl, DoShowPopup);
|
||||
IMP_PYCALLBACK_BOOL_RECTINT(wxPyComboCtrl, wxComboCtrl, AnimateShow);
|
||||
|
||||
%}
|
||||
|
||||
|
||||
|
||||
// Now declare wxPyComboCtrl for Python
|
||||
MustHaveApp(wxPyComboCtrl);
|
||||
%rename(ComboCtrl) wxPyComboCtrl;
|
||||
|
||||
class wxPyComboCtrl : public wxControl
|
||||
{
|
||||
public:
|
||||
%pythonAppend wxPyComboCtrl "self._setOORInfo(self);" setCallbackInfo(ComboCtrl)
|
||||
%pythonAppend wxPyComboCtrl() "";
|
||||
|
||||
wxPyComboCtrl(wxWindow *parent,
|
||||
wxWindowID id = wxID_ANY,
|
||||
const wxString& value = wxEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxPyComboBoxNameStr);
|
||||
|
||||
%RenameCtor(PreComboCtrl, wxPyComboCtrl());
|
||||
|
||||
void _setCallbackInfo(PyObject* self, PyObject* _class);
|
||||
|
||||
// show/hide popup window
|
||||
virtual void ShowPopup();
|
||||
virtual void HidePopup();
|
||||
|
||||
// Override for totally custom combo action
|
||||
virtual void OnButtonClick();
|
||||
|
||||
// return true if the popup is currently shown
|
||||
bool IsPopupShown() const;
|
||||
|
||||
|
||||
// set interface class instance derived from wxComboPopup
|
||||
// NULL popup can be used to indicate default in a derived class
|
||||
%disownarg(wxPyComboPopup* popup);
|
||||
void SetPopupControl( wxPyComboPopup* popup );
|
||||
%cleardisown(wxPyComboPopup* popup);
|
||||
|
||||
|
||||
// get interface class instance derived from wxComboPopup
|
||||
wxPyComboPopup* GetPopupControl();
|
||||
|
||||
// get the popup window containing the popup control
|
||||
wxWindow *GetPopupWindow() const;
|
||||
|
||||
// Get the text control which is part of the combobox.
|
||||
wxTextCtrl *GetTextCtrl() const;
|
||||
|
||||
// get the dropdown button which is part of the combobox
|
||||
// note: its not necessarily a wxButton or wxBitmapButton
|
||||
wxWindow *GetButton() const;
|
||||
|
||||
// forward these methods to all subcontrols
|
||||
virtual bool Enable(bool enable = true);
|
||||
virtual bool Show(bool show = true);
|
||||
virtual bool SetFont(const wxFont& font);
|
||||
|
||||
// wxTextCtrl methods - for readonly combo they should return
|
||||
// without errors.
|
||||
virtual wxString GetValue() const;
|
||||
virtual void SetValue(const wxString& value);
|
||||
virtual void Copy();
|
||||
virtual void Cut();
|
||||
virtual void Paste();
|
||||
virtual void SetInsertionPoint(long pos);
|
||||
virtual void SetInsertionPointEnd();
|
||||
virtual long GetInsertionPoint() const;
|
||||
virtual long GetLastPosition() const;
|
||||
virtual void Replace(long from, long to, const wxString& value);
|
||||
virtual void Remove(long from, long to);
|
||||
virtual void Undo();
|
||||
|
||||
%Rename(SetMark, void , SetSelection(long from, long to));
|
||||
|
||||
// This method sets the text without affecting list selection
|
||||
// (ie. wxComboPopup::SetStringValue doesn't get called).
|
||||
void SetText(const wxString& value);
|
||||
|
||||
// This method sets value and also optionally sends EVT_TEXT
|
||||
// (needed by combo popups)
|
||||
void SetValueWithEvent(const wxString& value, bool withEvent = true);
|
||||
|
||||
//
|
||||
// Popup customization methods
|
||||
//
|
||||
|
||||
// Sets minimum width of the popup. If wider than combo control, it will
|
||||
// extend to the left.
|
||||
// Remarks:
|
||||
// * Value -1 indicates the default.
|
||||
// * Custom popup may choose to ignore this (wxOwnerDrawnComboBox does not).
|
||||
void SetPopupMinWidth( int width );
|
||||
|
||||
// Sets preferred maximum height of the popup.
|
||||
// Remarks:
|
||||
// * Value -1 indicates the default.
|
||||
// * Custom popup may choose to ignore this (wxOwnerDrawnComboBox does not).
|
||||
void SetPopupMaxHeight( int height );
|
||||
|
||||
// Extends popup size horizontally, relative to the edges of the combo control.
|
||||
// Remarks:
|
||||
// * Popup minimum width may override extLeft (ie. it has higher precedence).
|
||||
// * Values 0 indicate default.
|
||||
// * Custom popup may not take this fully into account (wxOwnerDrawnComboBox takes).
|
||||
void SetPopupExtents( int extLeft, int extRight );
|
||||
|
||||
// Set width, in pixels, of custom paint area in writable combo.
|
||||
// In read-only, used to indicate area that is not covered by the
|
||||
// focus rectangle (which may or may not be drawn, depending on the
|
||||
// popup type).
|
||||
void SetCustomPaintWidth( int width );
|
||||
int GetCustomPaintWidth() const;
|
||||
|
||||
// Set side of the control to which the popup will align itself.
|
||||
// Valid values are wxLEFT, wxRIGHT and 0. The default value 0 means
|
||||
// that the side of the button will be used.
|
||||
void SetPopupAnchor( int anchorSide );
|
||||
|
||||
// Set position of dropdown button.
|
||||
// width: button width. <= 0 for default.
|
||||
// height: button height. <= 0 for default.
|
||||
// side: wxLEFT or wxRIGHT, indicates on which side the button will be placed.
|
||||
// spacingX: empty space on sides of the button. Default is 0.
|
||||
// Remarks:
|
||||
// There is no spacingY - the button will be centered vertically.
|
||||
void SetButtonPosition( int width = -1,
|
||||
int height = -1,
|
||||
int side = wxRIGHT,
|
||||
int spacingX = 0 );
|
||||
|
||||
// Returns current size of the dropdown button.
|
||||
wxSize GetButtonSize();
|
||||
|
||||
//
|
||||
// Sets dropbutton to be drawn with custom bitmaps.
|
||||
//
|
||||
// bmpNormal: drawn when cursor is not on button
|
||||
// pushButtonBg: Draw push button background below the image.
|
||||
// NOTE! This is usually only properly supported on platforms with appropriate
|
||||
// method in wxRendererNative.
|
||||
// bmpPressed: drawn when button is depressed
|
||||
// bmpHover: drawn when cursor hovers on button. This is ignored on platforms
|
||||
// that do not generally display hover differently.
|
||||
// bmpDisabled: drawn when combobox is disabled.
|
||||
void SetButtonBitmaps( const wxBitmap& bmpNormal,
|
||||
bool pushButtonBg = false,
|
||||
const wxBitmap& bmpPressed = wxNullBitmap,
|
||||
const wxBitmap& bmpHover = wxNullBitmap,
|
||||
const wxBitmap& bmpDisabled = wxNullBitmap );
|
||||
|
||||
//
|
||||
// This will set the space in pixels between left edge of the control and the
|
||||
// text, regardless whether control is read-only (ie. no wxTextCtrl) or not.
|
||||
// Platform-specific default can be set with value-1.
|
||||
// Remarks
|
||||
// * This method may do nothing on some native implementations.
|
||||
void SetTextIndent( int indent );
|
||||
|
||||
// Returns actual indentation in pixels.
|
||||
wxCoord GetTextIndent() const;
|
||||
|
||||
// Returns area covered by the text field.
|
||||
const wxRect& GetTextRect() const;
|
||||
|
||||
// Call with enable as true to use a type of popup window that guarantees ability
|
||||
// to focus the popup control, and normal function of common native controls.
|
||||
// This alternative popup window is usually a wxDialog, and as such it's parent
|
||||
// frame will appear as if the focus has been lost from it.
|
||||
void UseAltPopupWindow( bool enable = true );
|
||||
|
||||
// Call with false to disable popup animation, if any.
|
||||
void EnablePopupAnimation( bool enable = true );
|
||||
|
||||
//
|
||||
// Utilies needed by the popups or native implementations
|
||||
//
|
||||
|
||||
// Returns true if given key combination should toggle the popup.
|
||||
// NB: This is a separate from other keyboard handling because:
|
||||
// 1) Replaceability.
|
||||
// 2) Centralized code (otherwise it'd be split up between
|
||||
// wxComboCtrl key handler and wxVListBoxComboPopup's
|
||||
// key handler).
|
||||
virtual bool IsKeyPopupToggle(const wxKeyEvent& event) const;
|
||||
|
||||
// Prepare background of combo control or an item in a dropdown list
|
||||
// in a way typical on platform. This includes painting the focus/disabled
|
||||
// background and setting the clipping region.
|
||||
// Unless you plan to paint your own focus indicator, you should always call this
|
||||
// in your wxComboPopup::PaintComboControl implementation.
|
||||
// In addition, it sets pen and text colour to what looks good and proper
|
||||
// against the background.
|
||||
// flags: wxRendererNative flags: wxCONTROL_ISSUBMENU: is drawing a list item instead of combo control
|
||||
// wxCONTROL_SELECTED: list item is selected
|
||||
// wxCONTROL_DISABLED: control/item is disabled
|
||||
virtual void PrepareBackground( wxDC& dc, const wxRect& rect, int flags ) const;
|
||||
|
||||
// Returns true if focus indicator should be drawn in the control.
|
||||
bool ShouldDrawFocus() const;
|
||||
|
||||
// These methods return references to appropriate dropbutton bitmaps
|
||||
const wxBitmap& GetBitmapNormal() const;
|
||||
const wxBitmap& GetBitmapPressed() const;
|
||||
const wxBitmap& GetBitmapHover() const;
|
||||
const wxBitmap& GetBitmapDisabled() const;
|
||||
|
||||
// Return internal flags
|
||||
wxUint32 GetInternalFlags() const;
|
||||
|
||||
// Return true if Create has finished
|
||||
bool IsCreated() const;
|
||||
|
||||
// common code to be called on popup hide/dismiss
|
||||
void OnPopupDismiss();
|
||||
|
||||
// PopupShown states
|
||||
enum
|
||||
{
|
||||
Hidden = 0,
|
||||
//Closing = 1,
|
||||
Animating = 2,
|
||||
Visible = 3
|
||||
};
|
||||
|
||||
bool IsPopupWindowState( int state ) const;
|
||||
|
||||
int GetPopupWindowState() const;
|
||||
|
||||
// Set value returned by GetMainWindowOfCompositeControl
|
||||
void SetCtrlMainWnd( wxWindow* wnd );
|
||||
|
||||
static int GetFeatures();
|
||||
|
||||
|
||||
// Flags for DoShowPopup and AnimateShow
|
||||
enum
|
||||
{
|
||||
ShowBelow = 0x0000, // Showing popup below the control
|
||||
ShowAbove = 0x0001, // Showing popup above the control
|
||||
CanDeferShow = 0x0002 // Can only return true from AnimateShow if this is set
|
||||
};
|
||||
|
||||
// Shows and positions the popup.
|
||||
virtual void DoShowPopup( const wxRect& rect, int flags );
|
||||
|
||||
// Implement in derived class to create a drop-down animation.
|
||||
// Return true if finished immediately. Otherwise popup is only
|
||||
// shown when the derived class call DoShowPopup.
|
||||
// Flags are same as for DoShowPopup.
|
||||
virtual bool AnimateShow( const wxRect& rect, int flags );
|
||||
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
%newgroup
|
||||
|
||||
|
||||
// C++ implemetation of Python aware wxComboCtrl
|
||||
%{
|
||||
class wxPyComboPopup : public wxComboPopup
|
||||
{
|
||||
public:
|
||||
wxPyComboPopup() : wxComboPopup() {}
|
||||
~wxPyComboPopup() {}
|
||||
|
||||
|
||||
DEC_PYCALLBACK_VOID_(Init);
|
||||
DEC_PYCALLBACK_BOOL_WXWIN_pure(Create);
|
||||
DEC_PYCALLBACK_VOID_(OnPopup);
|
||||
DEC_PYCALLBACK_VOID_(OnDismiss);
|
||||
DEC_PYCALLBACK__STRING(SetStringValue);
|
||||
DEC_PYCALLBACK_STRING__constpure(GetStringValue);
|
||||
DEC_PYCALLBACK_VOID_(OnComboDoubleClick);
|
||||
DEC_PYCALLBACK_BOOL_(LazyCreate);
|
||||
|
||||
virtual wxWindow *GetControl()
|
||||
{
|
||||
wxWindow* rval = NULL;
|
||||
const char* errmsg = "GetControl should return an object derived from wx.Window.";
|
||||
wxPyBlock_t blocked = wxPyBeginBlockThreads();
|
||||
if (wxPyCBH_findCallback(m_myInst, "GetControl")) {
|
||||
PyObject* ro;
|
||||
ro = wxPyCBH_callCallbackObj(m_myInst, Py_BuildValue("()"));
|
||||
if (ro) {
|
||||
if (!wxPyConvertSwigPtr(ro, (void**)&rval, wxT("wxWindow")))
|
||||
PyErr_SetString(PyExc_TypeError, errmsg);
|
||||
Py_DECREF(ro);
|
||||
}
|
||||
}
|
||||
else
|
||||
PyErr_SetString(PyExc_TypeError, errmsg);
|
||||
wxPyEndBlockThreads(blocked);
|
||||
return rval;
|
||||
}
|
||||
|
||||
|
||||
virtual void PaintComboControl( wxDC& dc, const wxRect& rect )
|
||||
{
|
||||
bool found;
|
||||
wxPyBlock_t blocked = wxPyBeginBlockThreads();
|
||||
if ((found = wxPyCBH_findCallback(m_myInst, "PaintComboControl"))) {
|
||||
PyObject* odc = wxPyMake_wxObject(&dc,false);
|
||||
PyObject* orect = wxPyConstructObject((void*)&rect, wxT("wxRect"), 0);
|
||||
wxPyCBH_callCallback(m_myInst, Py_BuildValue("(OO)", odc, orect));
|
||||
Py_DECREF(odc);
|
||||
Py_DECREF(orect);
|
||||
}
|
||||
wxPyEndBlockThreads(blocked);
|
||||
if (! found)
|
||||
wxComboPopup::PaintComboControl(dc, rect);
|
||||
}
|
||||
|
||||
|
||||
virtual void OnComboKeyEvent( wxKeyEvent& event )
|
||||
{
|
||||
bool found;
|
||||
wxPyBlock_t blocked = wxPyBeginBlockThreads();
|
||||
if ((found = wxPyCBH_findCallback(m_myInst, "OnComboKeyEvent"))) {
|
||||
PyObject* oevt = wxPyConstructObject((void*)&event, wxT("wxKeyEvent"), 0);
|
||||
wxPyCBH_callCallback(m_myInst, Py_BuildValue("(O)", oevt));
|
||||
Py_DECREF(oevt);
|
||||
}
|
||||
wxPyEndBlockThreads(blocked);
|
||||
if (! found)
|
||||
wxComboPopup::OnComboKeyEvent(event);
|
||||
}
|
||||
|
||||
|
||||
virtual wxSize GetAdjustedSize( int minWidth, int prefHeight, int maxHeight )
|
||||
{
|
||||
const char* errmsg = "GetAdjustedSize should return a wx.Size or a 2-tuple of integers.";
|
||||
bool found;
|
||||
wxSize rval(0,0);
|
||||
wxSize* rptr = &rval;
|
||||
wxPyBlock_t blocked = wxPyBeginBlockThreads();
|
||||
if ((found = wxPyCBH_findCallback(m_myInst, "GetAdjustedSize"))) {
|
||||
PyObject* ro;
|
||||
ro = wxPyCBH_callCallbackObj(
|
||||
m_myInst, Py_BuildValue("(iii)", minWidth, prefHeight, maxHeight));
|
||||
if (ro) {
|
||||
if (! wxSize_helper(ro, &rptr))
|
||||
PyErr_SetString(PyExc_TypeError, errmsg);
|
||||
else
|
||||
rval = *rptr;
|
||||
Py_DECREF(ro);
|
||||
}
|
||||
}
|
||||
wxPyEndBlockThreads(blocked);
|
||||
if (! found)
|
||||
rval = wxComboPopup::GetAdjustedSize(minWidth, prefHeight, maxHeight);
|
||||
return rval;
|
||||
}
|
||||
|
||||
wxComboCtrl* GetCombo() { return (wxComboCtrl*)m_combo; }
|
||||
|
||||
PYPRIVATE;
|
||||
};
|
||||
|
||||
|
||||
IMP_PYCALLBACK_VOID_(wxPyComboPopup, wxComboPopup, Init);
|
||||
IMP_PYCALLBACK_BOOL_WXWIN_pure(wxPyComboPopup, wxComboPopup, Create);
|
||||
IMP_PYCALLBACK_VOID_(wxPyComboPopup, wxComboPopup, OnPopup);
|
||||
IMP_PYCALLBACK_VOID_(wxPyComboPopup, wxComboPopup, OnDismiss);
|
||||
IMP_PYCALLBACK__STRING(wxPyComboPopup, wxComboPopup, SetStringValue);
|
||||
IMP_PYCALLBACK_STRING__constpure(wxPyComboPopup, wxComboPopup, GetStringValue);
|
||||
IMP_PYCALLBACK_VOID_(wxPyComboPopup, wxComboPopup, OnComboDoubleClick);
|
||||
IMP_PYCALLBACK_BOOL_(wxPyComboPopup, wxComboPopup, LazyCreate);
|
||||
|
||||
%}
|
||||
|
||||
|
||||
|
||||
// Now declare wxPyComboCtrl for Python
|
||||
MustHaveApp(wxPyComboPopup);
|
||||
%rename(ComboPopup) wxPyComboPopup;
|
||||
|
||||
class wxPyComboPopup
|
||||
{
|
||||
public:
|
||||
%pythonAppend wxPyComboPopup setCallbackInfo(ComboPopup);
|
||||
|
||||
wxPyComboPopup();
|
||||
~wxPyComboPopup();
|
||||
|
||||
void _setCallbackInfo(PyObject* self, PyObject* _class);
|
||||
|
||||
// This is called immediately after construction finishes. m_combo member
|
||||
// variable has been initialized before the call.
|
||||
// NOTE: It is not in constructor so the derived class doesn't need to redefine
|
||||
// a default constructor of its own.
|
||||
virtual void Init();
|
||||
|
||||
// Create the popup child control.
|
||||
// Return true for success.
|
||||
virtual bool Create(wxWindow* parent);
|
||||
|
||||
// We must have an associated control which is subclassed by the combobox.
|
||||
virtual wxWindow *GetControl();
|
||||
|
||||
// Called immediately after the popup is shown
|
||||
virtual void OnPopup();
|
||||
|
||||
// Called when popup is dismissed
|
||||
virtual void OnDismiss();
|
||||
|
||||
// Called just prior to displaying popup.
|
||||
// Default implementation does nothing.
|
||||
virtual void SetStringValue( const wxString& value );
|
||||
|
||||
// Gets displayed string representation of the value.
|
||||
virtual wxString GetStringValue() const;
|
||||
|
||||
// This is called to custom paint in the combo control itself (ie. not the popup).
|
||||
// Default implementation draws value as string.
|
||||
virtual void PaintComboControl( wxDC& dc, const wxRect& rect );
|
||||
|
||||
// Receives key events from the parent wxComboCtrl.
|
||||
// Events not handled should be skipped, as usual.
|
||||
virtual void OnComboKeyEvent( wxKeyEvent& event );
|
||||
|
||||
// Implement if you need to support special action when user
|
||||
// double-clicks on the parent wxComboCtrl.
|
||||
virtual void OnComboDoubleClick();
|
||||
|
||||
// Return final size of popup. Called on every popup, just prior to OnPopup.
|
||||
// minWidth = preferred minimum width for window
|
||||
// prefHeight = preferred height. Only applies if > 0,
|
||||
// maxHeight = max height for window, as limited by screen size
|
||||
// and should only be rounded down, if necessary.
|
||||
virtual wxSize GetAdjustedSize( int minWidth, int prefHeight, int maxHeight );
|
||||
|
||||
// Return true if you want delay call to Create until the popup is shown
|
||||
// for the first time. It is more efficient, but note that it is often
|
||||
// more convenient to have the control created immediately.
|
||||
// Default returns false.
|
||||
virtual bool LazyCreate();
|
||||
|
||||
//
|
||||
// Utilies
|
||||
//
|
||||
|
||||
// Hides the popup
|
||||
void Dismiss();
|
||||
|
||||
// Returns true if Create has been called.
|
||||
bool IsCreated() const;
|
||||
|
||||
// Default PaintComboControl behaviour
|
||||
static void DefaultPaintComboControl( wxComboCtrlBase* combo,
|
||||
wxDC& dc,
|
||||
const wxRect& rect );
|
||||
|
||||
wxPyComboCtrl* GetCombo();
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
%newgroup
|
||||
|
||||
|
||||
enum {
|
||||
wxODCB_DCLICK_CYCLES,
|
||||
wxODCB_STD_CONTROL_PAINT,
|
||||
wxODCB_PAINTING_CONTROL,
|
||||
wxODCB_PAINTING_SELECTED
|
||||
};
|
||||
|
||||
|
||||
|
||||
// C++ implemetation of Python aware wxOwnerDrawnComboBox
|
||||
%{
|
||||
class wxPyOwnerDrawnComboBox : public wxOwnerDrawnComboBox
|
||||
{
|
||||
public:
|
||||
wxPyOwnerDrawnComboBox() : wxOwnerDrawnComboBox() {}
|
||||
wxPyOwnerDrawnComboBox(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxString& value,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
const wxArrayString& choices,
|
||||
long style,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxPyComboBoxNameStr)
|
||||
: wxOwnerDrawnComboBox(parent, id, value, pos, size, choices, style,
|
||||
validator, name)
|
||||
{}
|
||||
|
||||
DEC_PYCALLBACK__DCRECTINTINT_const(OnDrawItem);
|
||||
DEC_PYCALLBACK_COORD_SIZET_const(OnMeasureItem);
|
||||
DEC_PYCALLBACK_COORD_SIZET_const(OnMeasureItemWidth);
|
||||
DEC_PYCALLBACK__DCRECTINTINT_const(OnDrawBackground);
|
||||
|
||||
|
||||
PYPRIVATE;
|
||||
};
|
||||
|
||||
IMP_PYCALLBACK__DCRECTINTINT_const(wxPyOwnerDrawnComboBox, wxOwnerDrawnComboBox, OnDrawItem);
|
||||
IMP_PYCALLBACK_COORD_SIZET_const(wxPyOwnerDrawnComboBox, wxOwnerDrawnComboBox, OnMeasureItem);
|
||||
IMP_PYCALLBACK_COORD_SIZET_const(wxPyOwnerDrawnComboBox, wxOwnerDrawnComboBox, OnMeasureItemWidth);
|
||||
IMP_PYCALLBACK__DCRECTINTINT_const(wxPyOwnerDrawnComboBox, wxOwnerDrawnComboBox, OnDrawBackground);
|
||||
|
||||
%}
|
||||
|
||||
|
||||
|
||||
// Now declare wxPyComboCtrl for Python
|
||||
MustHaveApp(wxPyOwnerDrawnComboBox);
|
||||
%rename(OwnerDrawnComboBox) wxPyOwnerDrawnComboBox;
|
||||
|
||||
class wxPyOwnerDrawnComboBox : public wxPyComboCtrl,
|
||||
public wxItemContainer
|
||||
{
|
||||
public:
|
||||
%pythonAppend wxPyOwnerDrawnComboBox "self._setOORInfo(self);" setCallbackInfo(OwnerDrawnComboBox)
|
||||
%pythonAppend wxPyOwnerDrawnComboBox() "";
|
||||
|
||||
wxPyOwnerDrawnComboBox(wxWindow *parent,
|
||||
wxWindowID id = -1,
|
||||
const wxString& value = wxPyEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const wxArrayString& choices = wxPyEmptyStringArray,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxPyComboBoxNameStr);
|
||||
|
||||
%RenameCtor(PreOwnerDrawnComboBox, wxPyOwnerDrawnComboBox());
|
||||
|
||||
|
||||
bool Create(wxWindow *parent,
|
||||
wxWindowID id = -1,
|
||||
const wxString& value = wxPyEmptyString,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
const wxArrayString& choices = wxPyEmptyStringArray,
|
||||
long style = 0,
|
||||
const wxValidator& validator = wxDefaultValidator,
|
||||
const wxString& name = wxPyComboBoxNameStr);
|
||||
|
||||
// Return the widest item width (recalculating it if necessary)
|
||||
virtual int GetWidestItemWidth();
|
||||
|
||||
// Return the index of the widest item (recalculating it if necessary)
|
||||
virtual int GetWidestItem();
|
||||
|
||||
void SetSelection(int n);
|
||||
%Rename(SetMark, void , SetSelection(long from, long to));
|
||||
};
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
%init %{
|
||||
// Map renamed classes back to their common name for OOR
|
||||
wxPyPtrTypeMap_Add("wxComboCtrl", "wxPyComboCtrl");
|
||||
wxPyPtrTypeMap_Add("wxComboPopup", "wxPyComboPopup");
|
||||
%}
|
||||
//---------------------------------------------------------------------------
|
||||
|
480
wxPython/src/gtk/combo.py
Normal file
480
wxPython/src/gtk/combo.py
Normal file
@@ -0,0 +1,480 @@
|
||||
# This file was created automatically by SWIG 1.3.29.
|
||||
# Don't modify this file, modify the SWIG interface instead.
|
||||
|
||||
"""
|
||||
ComboCtrl class that can have any type of popup widget, and also an
|
||||
owner-drawn combobox control.
|
||||
"""
|
||||
|
||||
import _combo
|
||||
import new
|
||||
new_instancemethod = new.instancemethod
|
||||
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
|
||||
if (name == "thisown"): return self.this.own(value)
|
||||
if (name == "this"):
|
||||
if type(value).__name__ == 'PySwigObject':
|
||||
self.__dict__[name] = value
|
||||
return
|
||||
method = class_type.__swig_setmethods__.get(name,None)
|
||||
if method: return method(self,value)
|
||||
if (not static) or hasattr(self,name):
|
||||
self.__dict__[name] = value
|
||||
else:
|
||||
raise AttributeError("You cannot add attributes to %s" % self)
|
||||
|
||||
def _swig_setattr(self,class_type,name,value):
|
||||
return _swig_setattr_nondynamic(self,class_type,name,value,0)
|
||||
|
||||
def _swig_getattr(self,class_type,name):
|
||||
if (name == "thisown"): return self.this.own()
|
||||
method = class_type.__swig_getmethods__.get(name,None)
|
||||
if method: return method(self)
|
||||
raise AttributeError,name
|
||||
|
||||
def _swig_repr(self):
|
||||
try: strthis = "proxy of " + self.this.__repr__()
|
||||
except: strthis = ""
|
||||
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
|
||||
|
||||
import types
|
||||
try:
|
||||
_object = types.ObjectType
|
||||
_newclass = 1
|
||||
except AttributeError:
|
||||
class _object : pass
|
||||
_newclass = 0
|
||||
del types
|
||||
|
||||
|
||||
def _swig_setattr_nondynamic_method(set):
|
||||
def set_attr(self,name,value):
|
||||
if (name == "thisown"): return self.this.own(value)
|
||||
if hasattr(self,name) or (name == "this"):
|
||||
set(self,name,value)
|
||||
else:
|
||||
raise AttributeError("You cannot add attributes to %s" % self)
|
||||
return set_attr
|
||||
|
||||
|
||||
import _windows
|
||||
import _core
|
||||
wx = _core
|
||||
__docfilter__ = wx.__DocFilter(globals())
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
CC_BUTTON_OUTSIDE_BORDER = _combo.CC_BUTTON_OUTSIDE_BORDER
|
||||
CC_POPUP_ON_MOUSE_UP = _combo.CC_POPUP_ON_MOUSE_UP
|
||||
CC_NO_TEXT_AUTO_SELECT = _combo.CC_NO_TEXT_AUTO_SELECT
|
||||
CC_MF_ON_BUTTON = _combo.CC_MF_ON_BUTTON
|
||||
CC_MF_ON_CLICK_AREA = _combo.CC_MF_ON_CLICK_AREA
|
||||
class ComboCtrlFeatures(object):
|
||||
"""Proxy of C++ ComboCtrlFeatures class"""
|
||||
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
|
||||
def __init__(self): raise AttributeError, "No constructor defined"
|
||||
__repr__ = _swig_repr
|
||||
MovableButton = _combo.ComboCtrlFeatures_MovableButton
|
||||
BitmapButton = _combo.ComboCtrlFeatures_BitmapButton
|
||||
ButtonSpacing = _combo.ComboCtrlFeatures_ButtonSpacing
|
||||
TextIndent = _combo.ComboCtrlFeatures_TextIndent
|
||||
PaintControl = _combo.ComboCtrlFeatures_PaintControl
|
||||
PaintWritable = _combo.ComboCtrlFeatures_PaintWritable
|
||||
Borderless = _combo.ComboCtrlFeatures_Borderless
|
||||
All = _combo.ComboCtrlFeatures_All
|
||||
_combo.ComboCtrlFeatures_swigregister(ComboCtrlFeatures)
|
||||
|
||||
class ComboCtrl(_core.Control):
|
||||
"""Proxy of C++ ComboCtrl class"""
|
||||
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=ID_ANY, String value=wxEmptyString,
|
||||
Point pos=DefaultPosition, Size size=DefaultSize,
|
||||
long style=0, Validator validator=DefaultValidator,
|
||||
String name=wxPyComboBoxNameStr) -> ComboCtrl
|
||||
"""
|
||||
_combo.ComboCtrl_swiginit(self,_combo.new_ComboCtrl(*args, **kwargs))
|
||||
self._setOORInfo(self);ComboCtrl._setCallbackInfo(self, self, ComboCtrl)
|
||||
|
||||
def _setCallbackInfo(*args, **kwargs):
|
||||
"""_setCallbackInfo(self, PyObject self, PyObject _class)"""
|
||||
return _combo.ComboCtrl__setCallbackInfo(*args, **kwargs)
|
||||
|
||||
def ShowPopup(*args, **kwargs):
|
||||
"""ShowPopup(self)"""
|
||||
return _combo.ComboCtrl_ShowPopup(*args, **kwargs)
|
||||
|
||||
def HidePopup(*args, **kwargs):
|
||||
"""HidePopup(self)"""
|
||||
return _combo.ComboCtrl_HidePopup(*args, **kwargs)
|
||||
|
||||
def OnButtonClick(*args, **kwargs):
|
||||
"""OnButtonClick(self)"""
|
||||
return _combo.ComboCtrl_OnButtonClick(*args, **kwargs)
|
||||
|
||||
def IsPopupShown(*args, **kwargs):
|
||||
"""IsPopupShown(self) -> bool"""
|
||||
return _combo.ComboCtrl_IsPopupShown(*args, **kwargs)
|
||||
|
||||
def SetPopupControl(*args, **kwargs):
|
||||
"""SetPopupControl(self, ComboPopup popup)"""
|
||||
return _combo.ComboCtrl_SetPopupControl(*args, **kwargs)
|
||||
|
||||
def GetPopupControl(*args, **kwargs):
|
||||
"""GetPopupControl(self) -> ComboPopup"""
|
||||
return _combo.ComboCtrl_GetPopupControl(*args, **kwargs)
|
||||
|
||||
def GetPopupWindow(*args, **kwargs):
|
||||
"""GetPopupWindow(self) -> Window"""
|
||||
return _combo.ComboCtrl_GetPopupWindow(*args, **kwargs)
|
||||
|
||||
def GetTextCtrl(*args, **kwargs):
|
||||
"""GetTextCtrl(self) -> wxTextCtrl"""
|
||||
return _combo.ComboCtrl_GetTextCtrl(*args, **kwargs)
|
||||
|
||||
def GetButton(*args, **kwargs):
|
||||
"""GetButton(self) -> Window"""
|
||||
return _combo.ComboCtrl_GetButton(*args, **kwargs)
|
||||
|
||||
def GetValue(*args, **kwargs):
|
||||
"""GetValue(self) -> String"""
|
||||
return _combo.ComboCtrl_GetValue(*args, **kwargs)
|
||||
|
||||
def SetValue(*args, **kwargs):
|
||||
"""SetValue(self, String value)"""
|
||||
return _combo.ComboCtrl_SetValue(*args, **kwargs)
|
||||
|
||||
def Copy(*args, **kwargs):
|
||||
"""Copy(self)"""
|
||||
return _combo.ComboCtrl_Copy(*args, **kwargs)
|
||||
|
||||
def Cut(*args, **kwargs):
|
||||
"""Cut(self)"""
|
||||
return _combo.ComboCtrl_Cut(*args, **kwargs)
|
||||
|
||||
def Paste(*args, **kwargs):
|
||||
"""Paste(self)"""
|
||||
return _combo.ComboCtrl_Paste(*args, **kwargs)
|
||||
|
||||
def SetInsertionPoint(*args, **kwargs):
|
||||
"""SetInsertionPoint(self, long pos)"""
|
||||
return _combo.ComboCtrl_SetInsertionPoint(*args, **kwargs)
|
||||
|
||||
def SetInsertionPointEnd(*args, **kwargs):
|
||||
"""SetInsertionPointEnd(self)"""
|
||||
return _combo.ComboCtrl_SetInsertionPointEnd(*args, **kwargs)
|
||||
|
||||
def GetInsertionPoint(*args, **kwargs):
|
||||
"""GetInsertionPoint(self) -> long"""
|
||||
return _combo.ComboCtrl_GetInsertionPoint(*args, **kwargs)
|
||||
|
||||
def GetLastPosition(*args, **kwargs):
|
||||
"""GetLastPosition(self) -> long"""
|
||||
return _combo.ComboCtrl_GetLastPosition(*args, **kwargs)
|
||||
|
||||
def Replace(*args, **kwargs):
|
||||
"""Replace(self, long from, long to, String value)"""
|
||||
return _combo.ComboCtrl_Replace(*args, **kwargs)
|
||||
|
||||
def Remove(*args, **kwargs):
|
||||
"""Remove(self, long from, long to)"""
|
||||
return _combo.ComboCtrl_Remove(*args, **kwargs)
|
||||
|
||||
def Undo(*args, **kwargs):
|
||||
"""Undo(self)"""
|
||||
return _combo.ComboCtrl_Undo(*args, **kwargs)
|
||||
|
||||
def SetMark(*args, **kwargs):
|
||||
"""SetMark(self, long from, long to)"""
|
||||
return _combo.ComboCtrl_SetMark(*args, **kwargs)
|
||||
|
||||
def SetText(*args, **kwargs):
|
||||
"""SetText(self, String value)"""
|
||||
return _combo.ComboCtrl_SetText(*args, **kwargs)
|
||||
|
||||
def SetValueWithEvent(*args, **kwargs):
|
||||
"""SetValueWithEvent(self, String value, bool withEvent=True)"""
|
||||
return _combo.ComboCtrl_SetValueWithEvent(*args, **kwargs)
|
||||
|
||||
def SetPopupMinWidth(*args, **kwargs):
|
||||
"""SetPopupMinWidth(self, int width)"""
|
||||
return _combo.ComboCtrl_SetPopupMinWidth(*args, **kwargs)
|
||||
|
||||
def SetPopupMaxHeight(*args, **kwargs):
|
||||
"""SetPopupMaxHeight(self, int height)"""
|
||||
return _combo.ComboCtrl_SetPopupMaxHeight(*args, **kwargs)
|
||||
|
||||
def SetPopupExtents(*args, **kwargs):
|
||||
"""SetPopupExtents(self, int extLeft, int extRight)"""
|
||||
return _combo.ComboCtrl_SetPopupExtents(*args, **kwargs)
|
||||
|
||||
def SetCustomPaintWidth(*args, **kwargs):
|
||||
"""SetCustomPaintWidth(self, int width)"""
|
||||
return _combo.ComboCtrl_SetCustomPaintWidth(*args, **kwargs)
|
||||
|
||||
def GetCustomPaintWidth(*args, **kwargs):
|
||||
"""GetCustomPaintWidth(self) -> int"""
|
||||
return _combo.ComboCtrl_GetCustomPaintWidth(*args, **kwargs)
|
||||
|
||||
def SetPopupAnchor(*args, **kwargs):
|
||||
"""SetPopupAnchor(self, int anchorSide)"""
|
||||
return _combo.ComboCtrl_SetPopupAnchor(*args, **kwargs)
|
||||
|
||||
def SetButtonPosition(*args, **kwargs):
|
||||
"""SetButtonPosition(self, int width=-1, int height=-1, int side=RIGHT, int spacingX=0)"""
|
||||
return _combo.ComboCtrl_SetButtonPosition(*args, **kwargs)
|
||||
|
||||
def GetButtonSize(*args, **kwargs):
|
||||
"""GetButtonSize(self) -> Size"""
|
||||
return _combo.ComboCtrl_GetButtonSize(*args, **kwargs)
|
||||
|
||||
def SetButtonBitmaps(*args, **kwargs):
|
||||
"""
|
||||
SetButtonBitmaps(self, Bitmap bmpNormal, bool pushButtonBg=False, Bitmap bmpPressed=wxNullBitmap,
|
||||
Bitmap bmpHover=wxNullBitmap,
|
||||
Bitmap bmpDisabled=wxNullBitmap)
|
||||
"""
|
||||
return _combo.ComboCtrl_SetButtonBitmaps(*args, **kwargs)
|
||||
|
||||
def SetTextIndent(*args, **kwargs):
|
||||
"""SetTextIndent(self, int indent)"""
|
||||
return _combo.ComboCtrl_SetTextIndent(*args, **kwargs)
|
||||
|
||||
def GetTextIndent(*args, **kwargs):
|
||||
"""GetTextIndent(self) -> int"""
|
||||
return _combo.ComboCtrl_GetTextIndent(*args, **kwargs)
|
||||
|
||||
def GetTextRect(*args, **kwargs):
|
||||
"""GetTextRect(self) -> Rect"""
|
||||
return _combo.ComboCtrl_GetTextRect(*args, **kwargs)
|
||||
|
||||
def UseAltPopupWindow(*args, **kwargs):
|
||||
"""UseAltPopupWindow(self, bool enable=True)"""
|
||||
return _combo.ComboCtrl_UseAltPopupWindow(*args, **kwargs)
|
||||
|
||||
def EnablePopupAnimation(*args, **kwargs):
|
||||
"""EnablePopupAnimation(self, bool enable=True)"""
|
||||
return _combo.ComboCtrl_EnablePopupAnimation(*args, **kwargs)
|
||||
|
||||
def IsKeyPopupToggle(*args, **kwargs):
|
||||
"""IsKeyPopupToggle(self, KeyEvent event) -> bool"""
|
||||
return _combo.ComboCtrl_IsKeyPopupToggle(*args, **kwargs)
|
||||
|
||||
def PrepareBackground(*args, **kwargs):
|
||||
"""PrepareBackground(self, DC dc, Rect rect, int flags)"""
|
||||
return _combo.ComboCtrl_PrepareBackground(*args, **kwargs)
|
||||
|
||||
def ShouldDrawFocus(*args, **kwargs):
|
||||
"""ShouldDrawFocus(self) -> bool"""
|
||||
return _combo.ComboCtrl_ShouldDrawFocus(*args, **kwargs)
|
||||
|
||||
def GetBitmapNormal(*args, **kwargs):
|
||||
"""GetBitmapNormal(self) -> Bitmap"""
|
||||
return _combo.ComboCtrl_GetBitmapNormal(*args, **kwargs)
|
||||
|
||||
def GetBitmapPressed(*args, **kwargs):
|
||||
"""GetBitmapPressed(self) -> Bitmap"""
|
||||
return _combo.ComboCtrl_GetBitmapPressed(*args, **kwargs)
|
||||
|
||||
def GetBitmapHover(*args, **kwargs):
|
||||
"""GetBitmapHover(self) -> Bitmap"""
|
||||
return _combo.ComboCtrl_GetBitmapHover(*args, **kwargs)
|
||||
|
||||
def GetBitmapDisabled(*args, **kwargs):
|
||||
"""GetBitmapDisabled(self) -> Bitmap"""
|
||||
return _combo.ComboCtrl_GetBitmapDisabled(*args, **kwargs)
|
||||
|
||||
def GetInternalFlags(*args, **kwargs):
|
||||
"""GetInternalFlags(self) -> unsigned int"""
|
||||
return _combo.ComboCtrl_GetInternalFlags(*args, **kwargs)
|
||||
|
||||
def IsCreated(*args, **kwargs):
|
||||
"""IsCreated(self) -> bool"""
|
||||
return _combo.ComboCtrl_IsCreated(*args, **kwargs)
|
||||
|
||||
def OnPopupDismiss(*args, **kwargs):
|
||||
"""OnPopupDismiss(self)"""
|
||||
return _combo.ComboCtrl_OnPopupDismiss(*args, **kwargs)
|
||||
|
||||
Hidden = _combo.ComboCtrl_Hidden
|
||||
Animating = _combo.ComboCtrl_Animating
|
||||
Visible = _combo.ComboCtrl_Visible
|
||||
def IsPopupWindowState(*args, **kwargs):
|
||||
"""IsPopupWindowState(self, int state) -> bool"""
|
||||
return _combo.ComboCtrl_IsPopupWindowState(*args, **kwargs)
|
||||
|
||||
def GetPopupWindowState(*args, **kwargs):
|
||||
"""GetPopupWindowState(self) -> int"""
|
||||
return _combo.ComboCtrl_GetPopupWindowState(*args, **kwargs)
|
||||
|
||||
def SetCtrlMainWnd(*args, **kwargs):
|
||||
"""SetCtrlMainWnd(self, Window wnd)"""
|
||||
return _combo.ComboCtrl_SetCtrlMainWnd(*args, **kwargs)
|
||||
|
||||
def GetFeatures(*args, **kwargs):
|
||||
"""GetFeatures() -> int"""
|
||||
return _combo.ComboCtrl_GetFeatures(*args, **kwargs)
|
||||
|
||||
GetFeatures = staticmethod(GetFeatures)
|
||||
ShowBelow = _combo.ComboCtrl_ShowBelow
|
||||
ShowAbove = _combo.ComboCtrl_ShowAbove
|
||||
CanDeferShow = _combo.ComboCtrl_CanDeferShow
|
||||
def DoShowPopup(*args, **kwargs):
|
||||
"""DoShowPopup(self, Rect rect, int flags)"""
|
||||
return _combo.ComboCtrl_DoShowPopup(*args, **kwargs)
|
||||
|
||||
def AnimateShow(*args, **kwargs):
|
||||
"""AnimateShow(self, Rect rect, int flags) -> bool"""
|
||||
return _combo.ComboCtrl_AnimateShow(*args, **kwargs)
|
||||
|
||||
_combo.ComboCtrl_swigregister(ComboCtrl)
|
||||
|
||||
def PreComboCtrl(*args, **kwargs):
|
||||
"""PreComboCtrl() -> ComboCtrl"""
|
||||
val = _combo.new_PreComboCtrl(*args, **kwargs)
|
||||
return val
|
||||
|
||||
def ComboCtrl_GetFeatures(*args):
|
||||
"""ComboCtrl_GetFeatures() -> int"""
|
||||
return _combo.ComboCtrl_GetFeatures(*args)
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
class ComboPopup(object):
|
||||
"""Proxy of C++ ComboPopup class"""
|
||||
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) -> ComboPopup"""
|
||||
_combo.ComboPopup_swiginit(self,_combo.new_ComboPopup(*args, **kwargs))
|
||||
ComboPopup._setCallbackInfo(self, self, ComboPopup)
|
||||
|
||||
__swig_destroy__ = _combo.delete_ComboPopup
|
||||
__del__ = lambda self : None;
|
||||
def _setCallbackInfo(*args, **kwargs):
|
||||
"""_setCallbackInfo(self, PyObject self, PyObject _class)"""
|
||||
return _combo.ComboPopup__setCallbackInfo(*args, **kwargs)
|
||||
|
||||
def Init(*args, **kwargs):
|
||||
"""Init(self)"""
|
||||
return _combo.ComboPopup_Init(*args, **kwargs)
|
||||
|
||||
def Create(*args, **kwargs):
|
||||
"""Create(self, Window parent) -> bool"""
|
||||
return _combo.ComboPopup_Create(*args, **kwargs)
|
||||
|
||||
def GetControl(*args, **kwargs):
|
||||
"""GetControl(self) -> Window"""
|
||||
return _combo.ComboPopup_GetControl(*args, **kwargs)
|
||||
|
||||
def OnPopup(*args, **kwargs):
|
||||
"""OnPopup(self)"""
|
||||
return _combo.ComboPopup_OnPopup(*args, **kwargs)
|
||||
|
||||
def OnDismiss(*args, **kwargs):
|
||||
"""OnDismiss(self)"""
|
||||
return _combo.ComboPopup_OnDismiss(*args, **kwargs)
|
||||
|
||||
def SetStringValue(*args, **kwargs):
|
||||
"""SetStringValue(self, String value)"""
|
||||
return _combo.ComboPopup_SetStringValue(*args, **kwargs)
|
||||
|
||||
def GetStringValue(*args, **kwargs):
|
||||
"""GetStringValue(self) -> String"""
|
||||
return _combo.ComboPopup_GetStringValue(*args, **kwargs)
|
||||
|
||||
def PaintComboControl(*args, **kwargs):
|
||||
"""PaintComboControl(self, DC dc, Rect rect)"""
|
||||
return _combo.ComboPopup_PaintComboControl(*args, **kwargs)
|
||||
|
||||
def OnComboKeyEvent(*args, **kwargs):
|
||||
"""OnComboKeyEvent(self, KeyEvent event)"""
|
||||
return _combo.ComboPopup_OnComboKeyEvent(*args, **kwargs)
|
||||
|
||||
def OnComboDoubleClick(*args, **kwargs):
|
||||
"""OnComboDoubleClick(self)"""
|
||||
return _combo.ComboPopup_OnComboDoubleClick(*args, **kwargs)
|
||||
|
||||
def GetAdjustedSize(*args, **kwargs):
|
||||
"""GetAdjustedSize(self, int minWidth, int prefHeight, int maxHeight) -> Size"""
|
||||
return _combo.ComboPopup_GetAdjustedSize(*args, **kwargs)
|
||||
|
||||
def LazyCreate(*args, **kwargs):
|
||||
"""LazyCreate(self) -> bool"""
|
||||
return _combo.ComboPopup_LazyCreate(*args, **kwargs)
|
||||
|
||||
def Dismiss(*args, **kwargs):
|
||||
"""Dismiss(self)"""
|
||||
return _combo.ComboPopup_Dismiss(*args, **kwargs)
|
||||
|
||||
def IsCreated(*args, **kwargs):
|
||||
"""IsCreated(self) -> bool"""
|
||||
return _combo.ComboPopup_IsCreated(*args, **kwargs)
|
||||
|
||||
def DefaultPaintComboControl(*args, **kwargs):
|
||||
"""DefaultPaintComboControl(wxComboCtrlBase combo, DC dc, Rect rect)"""
|
||||
return _combo.ComboPopup_DefaultPaintComboControl(*args, **kwargs)
|
||||
|
||||
DefaultPaintComboControl = staticmethod(DefaultPaintComboControl)
|
||||
def GetCombo(*args, **kwargs):
|
||||
"""GetCombo(self) -> ComboCtrl"""
|
||||
return _combo.ComboPopup_GetCombo(*args, **kwargs)
|
||||
|
||||
_combo.ComboPopup_swigregister(ComboPopup)
|
||||
|
||||
def ComboPopup_DefaultPaintComboControl(*args, **kwargs):
|
||||
"""ComboPopup_DefaultPaintComboControl(wxComboCtrlBase combo, DC dc, Rect rect)"""
|
||||
return _combo.ComboPopup_DefaultPaintComboControl(*args, **kwargs)
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
ODCB_DCLICK_CYCLES = _combo.ODCB_DCLICK_CYCLES
|
||||
ODCB_STD_CONTROL_PAINT = _combo.ODCB_STD_CONTROL_PAINT
|
||||
ODCB_PAINTING_CONTROL = _combo.ODCB_PAINTING_CONTROL
|
||||
ODCB_PAINTING_SELECTED = _combo.ODCB_PAINTING_SELECTED
|
||||
class OwnerDrawnComboBox(ComboCtrl,_core.ItemContainer):
|
||||
"""Proxy of C++ OwnerDrawnComboBox class"""
|
||||
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=wxPyComboBoxNameStr) -> OwnerDrawnComboBox
|
||||
"""
|
||||
_combo.OwnerDrawnComboBox_swiginit(self,_combo.new_OwnerDrawnComboBox(*args, **kwargs))
|
||||
self._setOORInfo(self);OwnerDrawnComboBox._setCallbackInfo(self, self, OwnerDrawnComboBox)
|
||||
|
||||
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=wxPyComboBoxNameStr) -> bool
|
||||
"""
|
||||
return _combo.OwnerDrawnComboBox_Create(*args, **kwargs)
|
||||
|
||||
def GetWidestItemWidth(*args, **kwargs):
|
||||
"""GetWidestItemWidth(self) -> int"""
|
||||
return _combo.OwnerDrawnComboBox_GetWidestItemWidth(*args, **kwargs)
|
||||
|
||||
def GetWidestItem(*args, **kwargs):
|
||||
"""GetWidestItem(self) -> int"""
|
||||
return _combo.OwnerDrawnComboBox_GetWidestItem(*args, **kwargs)
|
||||
|
||||
def SetMark(*args, **kwargs):
|
||||
"""SetMark(self, long from, long to)"""
|
||||
return _combo.OwnerDrawnComboBox_SetMark(*args, **kwargs)
|
||||
|
||||
_combo.OwnerDrawnComboBox_swigregister(OwnerDrawnComboBox)
|
||||
|
||||
def PreOwnerDrawnComboBox(*args, **kwargs):
|
||||
"""PreOwnerDrawnComboBox() -> OwnerDrawnComboBox"""
|
||||
val = _combo.new_PreOwnerDrawnComboBox(*args, **kwargs)
|
||||
return val
|
||||
|
||||
|
||||
|
8364
wxPython/src/gtk/combo_wrap.cpp
Normal file
8364
wxPython/src/gtk/combo_wrap.cpp
Normal file
File diff suppressed because one or more lines are too long
480
wxPython/src/mac/combo.py
Normal file
480
wxPython/src/mac/combo.py
Normal file
@@ -0,0 +1,480 @@
|
||||
# This file was created automatically by SWIG 1.3.29.
|
||||
# Don't modify this file, modify the SWIG interface instead.
|
||||
|
||||
"""
|
||||
ComboCtrl class that can have any type of popup widget, and also an
|
||||
owner-drawn combobox control.
|
||||
"""
|
||||
|
||||
import _combo
|
||||
import new
|
||||
new_instancemethod = new.instancemethod
|
||||
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
|
||||
if (name == "thisown"): return self.this.own(value)
|
||||
if (name == "this"):
|
||||
if type(value).__name__ == 'PySwigObject':
|
||||
self.__dict__[name] = value
|
||||
return
|
||||
method = class_type.__swig_setmethods__.get(name,None)
|
||||
if method: return method(self,value)
|
||||
if (not static) or hasattr(self,name):
|
||||
self.__dict__[name] = value
|
||||
else:
|
||||
raise AttributeError("You cannot add attributes to %s" % self)
|
||||
|
||||
def _swig_setattr(self,class_type,name,value):
|
||||
return _swig_setattr_nondynamic(self,class_type,name,value,0)
|
||||
|
||||
def _swig_getattr(self,class_type,name):
|
||||
if (name == "thisown"): return self.this.own()
|
||||
method = class_type.__swig_getmethods__.get(name,None)
|
||||
if method: return method(self)
|
||||
raise AttributeError,name
|
||||
|
||||
def _swig_repr(self):
|
||||
try: strthis = "proxy of " + self.this.__repr__()
|
||||
except: strthis = ""
|
||||
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
|
||||
|
||||
import types
|
||||
try:
|
||||
_object = types.ObjectType
|
||||
_newclass = 1
|
||||
except AttributeError:
|
||||
class _object : pass
|
||||
_newclass = 0
|
||||
del types
|
||||
|
||||
|
||||
def _swig_setattr_nondynamic_method(set):
|
||||
def set_attr(self,name,value):
|
||||
if (name == "thisown"): return self.this.own(value)
|
||||
if hasattr(self,name) or (name == "this"):
|
||||
set(self,name,value)
|
||||
else:
|
||||
raise AttributeError("You cannot add attributes to %s" % self)
|
||||
return set_attr
|
||||
|
||||
|
||||
import _windows
|
||||
import _core
|
||||
wx = _core
|
||||
__docfilter__ = wx.__DocFilter(globals())
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
CC_BUTTON_OUTSIDE_BORDER = _combo.CC_BUTTON_OUTSIDE_BORDER
|
||||
CC_POPUP_ON_MOUSE_UP = _combo.CC_POPUP_ON_MOUSE_UP
|
||||
CC_NO_TEXT_AUTO_SELECT = _combo.CC_NO_TEXT_AUTO_SELECT
|
||||
CC_MF_ON_BUTTON = _combo.CC_MF_ON_BUTTON
|
||||
CC_MF_ON_CLICK_AREA = _combo.CC_MF_ON_CLICK_AREA
|
||||
class ComboCtrlFeatures(object):
|
||||
"""Proxy of C++ ComboCtrlFeatures class"""
|
||||
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
|
||||
def __init__(self): raise AttributeError, "No constructor defined"
|
||||
__repr__ = _swig_repr
|
||||
MovableButton = _combo.ComboCtrlFeatures_MovableButton
|
||||
BitmapButton = _combo.ComboCtrlFeatures_BitmapButton
|
||||
ButtonSpacing = _combo.ComboCtrlFeatures_ButtonSpacing
|
||||
TextIndent = _combo.ComboCtrlFeatures_TextIndent
|
||||
PaintControl = _combo.ComboCtrlFeatures_PaintControl
|
||||
PaintWritable = _combo.ComboCtrlFeatures_PaintWritable
|
||||
Borderless = _combo.ComboCtrlFeatures_Borderless
|
||||
All = _combo.ComboCtrlFeatures_All
|
||||
_combo.ComboCtrlFeatures_swigregister(ComboCtrlFeatures)
|
||||
|
||||
class ComboCtrl(_core.Control):
|
||||
"""Proxy of C++ ComboCtrl class"""
|
||||
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=ID_ANY, String value=wxEmptyString,
|
||||
Point pos=DefaultPosition, Size size=DefaultSize,
|
||||
long style=0, Validator validator=DefaultValidator,
|
||||
String name=wxPyComboBoxNameStr) -> ComboCtrl
|
||||
"""
|
||||
_combo.ComboCtrl_swiginit(self,_combo.new_ComboCtrl(*args, **kwargs))
|
||||
self._setOORInfo(self);ComboCtrl._setCallbackInfo(self, self, ComboCtrl)
|
||||
|
||||
def _setCallbackInfo(*args, **kwargs):
|
||||
"""_setCallbackInfo(self, PyObject self, PyObject _class)"""
|
||||
return _combo.ComboCtrl__setCallbackInfo(*args, **kwargs)
|
||||
|
||||
def ShowPopup(*args, **kwargs):
|
||||
"""ShowPopup(self)"""
|
||||
return _combo.ComboCtrl_ShowPopup(*args, **kwargs)
|
||||
|
||||
def HidePopup(*args, **kwargs):
|
||||
"""HidePopup(self)"""
|
||||
return _combo.ComboCtrl_HidePopup(*args, **kwargs)
|
||||
|
||||
def OnButtonClick(*args, **kwargs):
|
||||
"""OnButtonClick(self)"""
|
||||
return _combo.ComboCtrl_OnButtonClick(*args, **kwargs)
|
||||
|
||||
def IsPopupShown(*args, **kwargs):
|
||||
"""IsPopupShown(self) -> bool"""
|
||||
return _combo.ComboCtrl_IsPopupShown(*args, **kwargs)
|
||||
|
||||
def SetPopupControl(*args, **kwargs):
|
||||
"""SetPopupControl(self, ComboPopup popup)"""
|
||||
return _combo.ComboCtrl_SetPopupControl(*args, **kwargs)
|
||||
|
||||
def GetPopupControl(*args, **kwargs):
|
||||
"""GetPopupControl(self) -> ComboPopup"""
|
||||
return _combo.ComboCtrl_GetPopupControl(*args, **kwargs)
|
||||
|
||||
def GetPopupWindow(*args, **kwargs):
|
||||
"""GetPopupWindow(self) -> Window"""
|
||||
return _combo.ComboCtrl_GetPopupWindow(*args, **kwargs)
|
||||
|
||||
def GetTextCtrl(*args, **kwargs):
|
||||
"""GetTextCtrl(self) -> wxTextCtrl"""
|
||||
return _combo.ComboCtrl_GetTextCtrl(*args, **kwargs)
|
||||
|
||||
def GetButton(*args, **kwargs):
|
||||
"""GetButton(self) -> Window"""
|
||||
return _combo.ComboCtrl_GetButton(*args, **kwargs)
|
||||
|
||||
def GetValue(*args, **kwargs):
|
||||
"""GetValue(self) -> String"""
|
||||
return _combo.ComboCtrl_GetValue(*args, **kwargs)
|
||||
|
||||
def SetValue(*args, **kwargs):
|
||||
"""SetValue(self, String value)"""
|
||||
return _combo.ComboCtrl_SetValue(*args, **kwargs)
|
||||
|
||||
def Copy(*args, **kwargs):
|
||||
"""Copy(self)"""
|
||||
return _combo.ComboCtrl_Copy(*args, **kwargs)
|
||||
|
||||
def Cut(*args, **kwargs):
|
||||
"""Cut(self)"""
|
||||
return _combo.ComboCtrl_Cut(*args, **kwargs)
|
||||
|
||||
def Paste(*args, **kwargs):
|
||||
"""Paste(self)"""
|
||||
return _combo.ComboCtrl_Paste(*args, **kwargs)
|
||||
|
||||
def SetInsertionPoint(*args, **kwargs):
|
||||
"""SetInsertionPoint(self, long pos)"""
|
||||
return _combo.ComboCtrl_SetInsertionPoint(*args, **kwargs)
|
||||
|
||||
def SetInsertionPointEnd(*args, **kwargs):
|
||||
"""SetInsertionPointEnd(self)"""
|
||||
return _combo.ComboCtrl_SetInsertionPointEnd(*args, **kwargs)
|
||||
|
||||
def GetInsertionPoint(*args, **kwargs):
|
||||
"""GetInsertionPoint(self) -> long"""
|
||||
return _combo.ComboCtrl_GetInsertionPoint(*args, **kwargs)
|
||||
|
||||
def GetLastPosition(*args, **kwargs):
|
||||
"""GetLastPosition(self) -> long"""
|
||||
return _combo.ComboCtrl_GetLastPosition(*args, **kwargs)
|
||||
|
||||
def Replace(*args, **kwargs):
|
||||
"""Replace(self, long from, long to, String value)"""
|
||||
return _combo.ComboCtrl_Replace(*args, **kwargs)
|
||||
|
||||
def Remove(*args, **kwargs):
|
||||
"""Remove(self, long from, long to)"""
|
||||
return _combo.ComboCtrl_Remove(*args, **kwargs)
|
||||
|
||||
def Undo(*args, **kwargs):
|
||||
"""Undo(self)"""
|
||||
return _combo.ComboCtrl_Undo(*args, **kwargs)
|
||||
|
||||
def SetMark(*args, **kwargs):
|
||||
"""SetMark(self, long from, long to)"""
|
||||
return _combo.ComboCtrl_SetMark(*args, **kwargs)
|
||||
|
||||
def SetText(*args, **kwargs):
|
||||
"""SetText(self, String value)"""
|
||||
return _combo.ComboCtrl_SetText(*args, **kwargs)
|
||||
|
||||
def SetValueWithEvent(*args, **kwargs):
|
||||
"""SetValueWithEvent(self, String value, bool withEvent=True)"""
|
||||
return _combo.ComboCtrl_SetValueWithEvent(*args, **kwargs)
|
||||
|
||||
def SetPopupMinWidth(*args, **kwargs):
|
||||
"""SetPopupMinWidth(self, int width)"""
|
||||
return _combo.ComboCtrl_SetPopupMinWidth(*args, **kwargs)
|
||||
|
||||
def SetPopupMaxHeight(*args, **kwargs):
|
||||
"""SetPopupMaxHeight(self, int height)"""
|
||||
return _combo.ComboCtrl_SetPopupMaxHeight(*args, **kwargs)
|
||||
|
||||
def SetPopupExtents(*args, **kwargs):
|
||||
"""SetPopupExtents(self, int extLeft, int extRight)"""
|
||||
return _combo.ComboCtrl_SetPopupExtents(*args, **kwargs)
|
||||
|
||||
def SetCustomPaintWidth(*args, **kwargs):
|
||||
"""SetCustomPaintWidth(self, int width)"""
|
||||
return _combo.ComboCtrl_SetCustomPaintWidth(*args, **kwargs)
|
||||
|
||||
def GetCustomPaintWidth(*args, **kwargs):
|
||||
"""GetCustomPaintWidth(self) -> int"""
|
||||
return _combo.ComboCtrl_GetCustomPaintWidth(*args, **kwargs)
|
||||
|
||||
def SetPopupAnchor(*args, **kwargs):
|
||||
"""SetPopupAnchor(self, int anchorSide)"""
|
||||
return _combo.ComboCtrl_SetPopupAnchor(*args, **kwargs)
|
||||
|
||||
def SetButtonPosition(*args, **kwargs):
|
||||
"""SetButtonPosition(self, int width=-1, int height=-1, int side=RIGHT, int spacingX=0)"""
|
||||
return _combo.ComboCtrl_SetButtonPosition(*args, **kwargs)
|
||||
|
||||
def GetButtonSize(*args, **kwargs):
|
||||
"""GetButtonSize(self) -> Size"""
|
||||
return _combo.ComboCtrl_GetButtonSize(*args, **kwargs)
|
||||
|
||||
def SetButtonBitmaps(*args, **kwargs):
|
||||
"""
|
||||
SetButtonBitmaps(self, Bitmap bmpNormal, bool pushButtonBg=False, Bitmap bmpPressed=wxNullBitmap,
|
||||
Bitmap bmpHover=wxNullBitmap,
|
||||
Bitmap bmpDisabled=wxNullBitmap)
|
||||
"""
|
||||
return _combo.ComboCtrl_SetButtonBitmaps(*args, **kwargs)
|
||||
|
||||
def SetTextIndent(*args, **kwargs):
|
||||
"""SetTextIndent(self, int indent)"""
|
||||
return _combo.ComboCtrl_SetTextIndent(*args, **kwargs)
|
||||
|
||||
def GetTextIndent(*args, **kwargs):
|
||||
"""GetTextIndent(self) -> int"""
|
||||
return _combo.ComboCtrl_GetTextIndent(*args, **kwargs)
|
||||
|
||||
def GetTextRect(*args, **kwargs):
|
||||
"""GetTextRect(self) -> Rect"""
|
||||
return _combo.ComboCtrl_GetTextRect(*args, **kwargs)
|
||||
|
||||
def UseAltPopupWindow(*args, **kwargs):
|
||||
"""UseAltPopupWindow(self, bool enable=True)"""
|
||||
return _combo.ComboCtrl_UseAltPopupWindow(*args, **kwargs)
|
||||
|
||||
def EnablePopupAnimation(*args, **kwargs):
|
||||
"""EnablePopupAnimation(self, bool enable=True)"""
|
||||
return _combo.ComboCtrl_EnablePopupAnimation(*args, **kwargs)
|
||||
|
||||
def IsKeyPopupToggle(*args, **kwargs):
|
||||
"""IsKeyPopupToggle(self, KeyEvent event) -> bool"""
|
||||
return _combo.ComboCtrl_IsKeyPopupToggle(*args, **kwargs)
|
||||
|
||||
def PrepareBackground(*args, **kwargs):
|
||||
"""PrepareBackground(self, DC dc, Rect rect, int flags)"""
|
||||
return _combo.ComboCtrl_PrepareBackground(*args, **kwargs)
|
||||
|
||||
def ShouldDrawFocus(*args, **kwargs):
|
||||
"""ShouldDrawFocus(self) -> bool"""
|
||||
return _combo.ComboCtrl_ShouldDrawFocus(*args, **kwargs)
|
||||
|
||||
def GetBitmapNormal(*args, **kwargs):
|
||||
"""GetBitmapNormal(self) -> Bitmap"""
|
||||
return _combo.ComboCtrl_GetBitmapNormal(*args, **kwargs)
|
||||
|
||||
def GetBitmapPressed(*args, **kwargs):
|
||||
"""GetBitmapPressed(self) -> Bitmap"""
|
||||
return _combo.ComboCtrl_GetBitmapPressed(*args, **kwargs)
|
||||
|
||||
def GetBitmapHover(*args, **kwargs):
|
||||
"""GetBitmapHover(self) -> Bitmap"""
|
||||
return _combo.ComboCtrl_GetBitmapHover(*args, **kwargs)
|
||||
|
||||
def GetBitmapDisabled(*args, **kwargs):
|
||||
"""GetBitmapDisabled(self) -> Bitmap"""
|
||||
return _combo.ComboCtrl_GetBitmapDisabled(*args, **kwargs)
|
||||
|
||||
def GetInternalFlags(*args, **kwargs):
|
||||
"""GetInternalFlags(self) -> unsigned int"""
|
||||
return _combo.ComboCtrl_GetInternalFlags(*args, **kwargs)
|
||||
|
||||
def IsCreated(*args, **kwargs):
|
||||
"""IsCreated(self) -> bool"""
|
||||
return _combo.ComboCtrl_IsCreated(*args, **kwargs)
|
||||
|
||||
def OnPopupDismiss(*args, **kwargs):
|
||||
"""OnPopupDismiss(self)"""
|
||||
return _combo.ComboCtrl_OnPopupDismiss(*args, **kwargs)
|
||||
|
||||
Hidden = _combo.ComboCtrl_Hidden
|
||||
Animating = _combo.ComboCtrl_Animating
|
||||
Visible = _combo.ComboCtrl_Visible
|
||||
def IsPopupWindowState(*args, **kwargs):
|
||||
"""IsPopupWindowState(self, int state) -> bool"""
|
||||
return _combo.ComboCtrl_IsPopupWindowState(*args, **kwargs)
|
||||
|
||||
def GetPopupWindowState(*args, **kwargs):
|
||||
"""GetPopupWindowState(self) -> int"""
|
||||
return _combo.ComboCtrl_GetPopupWindowState(*args, **kwargs)
|
||||
|
||||
def SetCtrlMainWnd(*args, **kwargs):
|
||||
"""SetCtrlMainWnd(self, Window wnd)"""
|
||||
return _combo.ComboCtrl_SetCtrlMainWnd(*args, **kwargs)
|
||||
|
||||
def GetFeatures(*args, **kwargs):
|
||||
"""GetFeatures() -> int"""
|
||||
return _combo.ComboCtrl_GetFeatures(*args, **kwargs)
|
||||
|
||||
GetFeatures = staticmethod(GetFeatures)
|
||||
ShowBelow = _combo.ComboCtrl_ShowBelow
|
||||
ShowAbove = _combo.ComboCtrl_ShowAbove
|
||||
CanDeferShow = _combo.ComboCtrl_CanDeferShow
|
||||
def DoShowPopup(*args, **kwargs):
|
||||
"""DoShowPopup(self, Rect rect, int flags)"""
|
||||
return _combo.ComboCtrl_DoShowPopup(*args, **kwargs)
|
||||
|
||||
def AnimateShow(*args, **kwargs):
|
||||
"""AnimateShow(self, Rect rect, int flags) -> bool"""
|
||||
return _combo.ComboCtrl_AnimateShow(*args, **kwargs)
|
||||
|
||||
_combo.ComboCtrl_swigregister(ComboCtrl)
|
||||
|
||||
def PreComboCtrl(*args, **kwargs):
|
||||
"""PreComboCtrl() -> ComboCtrl"""
|
||||
val = _combo.new_PreComboCtrl(*args, **kwargs)
|
||||
return val
|
||||
|
||||
def ComboCtrl_GetFeatures(*args):
|
||||
"""ComboCtrl_GetFeatures() -> int"""
|
||||
return _combo.ComboCtrl_GetFeatures(*args)
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
class ComboPopup(object):
|
||||
"""Proxy of C++ ComboPopup class"""
|
||||
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) -> ComboPopup"""
|
||||
_combo.ComboPopup_swiginit(self,_combo.new_ComboPopup(*args, **kwargs))
|
||||
ComboPopup._setCallbackInfo(self, self, ComboPopup)
|
||||
|
||||
__swig_destroy__ = _combo.delete_ComboPopup
|
||||
__del__ = lambda self : None;
|
||||
def _setCallbackInfo(*args, **kwargs):
|
||||
"""_setCallbackInfo(self, PyObject self, PyObject _class)"""
|
||||
return _combo.ComboPopup__setCallbackInfo(*args, **kwargs)
|
||||
|
||||
def Init(*args, **kwargs):
|
||||
"""Init(self)"""
|
||||
return _combo.ComboPopup_Init(*args, **kwargs)
|
||||
|
||||
def Create(*args, **kwargs):
|
||||
"""Create(self, Window parent) -> bool"""
|
||||
return _combo.ComboPopup_Create(*args, **kwargs)
|
||||
|
||||
def GetControl(*args, **kwargs):
|
||||
"""GetControl(self) -> Window"""
|
||||
return _combo.ComboPopup_GetControl(*args, **kwargs)
|
||||
|
||||
def OnPopup(*args, **kwargs):
|
||||
"""OnPopup(self)"""
|
||||
return _combo.ComboPopup_OnPopup(*args, **kwargs)
|
||||
|
||||
def OnDismiss(*args, **kwargs):
|
||||
"""OnDismiss(self)"""
|
||||
return _combo.ComboPopup_OnDismiss(*args, **kwargs)
|
||||
|
||||
def SetStringValue(*args, **kwargs):
|
||||
"""SetStringValue(self, String value)"""
|
||||
return _combo.ComboPopup_SetStringValue(*args, **kwargs)
|
||||
|
||||
def GetStringValue(*args, **kwargs):
|
||||
"""GetStringValue(self) -> String"""
|
||||
return _combo.ComboPopup_GetStringValue(*args, **kwargs)
|
||||
|
||||
def PaintComboControl(*args, **kwargs):
|
||||
"""PaintComboControl(self, DC dc, Rect rect)"""
|
||||
return _combo.ComboPopup_PaintComboControl(*args, **kwargs)
|
||||
|
||||
def OnComboKeyEvent(*args, **kwargs):
|
||||
"""OnComboKeyEvent(self, KeyEvent event)"""
|
||||
return _combo.ComboPopup_OnComboKeyEvent(*args, **kwargs)
|
||||
|
||||
def OnComboDoubleClick(*args, **kwargs):
|
||||
"""OnComboDoubleClick(self)"""
|
||||
return _combo.ComboPopup_OnComboDoubleClick(*args, **kwargs)
|
||||
|
||||
def GetAdjustedSize(*args, **kwargs):
|
||||
"""GetAdjustedSize(self, int minWidth, int prefHeight, int maxHeight) -> Size"""
|
||||
return _combo.ComboPopup_GetAdjustedSize(*args, **kwargs)
|
||||
|
||||
def LazyCreate(*args, **kwargs):
|
||||
"""LazyCreate(self) -> bool"""
|
||||
return _combo.ComboPopup_LazyCreate(*args, **kwargs)
|
||||
|
||||
def Dismiss(*args, **kwargs):
|
||||
"""Dismiss(self)"""
|
||||
return _combo.ComboPopup_Dismiss(*args, **kwargs)
|
||||
|
||||
def IsCreated(*args, **kwargs):
|
||||
"""IsCreated(self) -> bool"""
|
||||
return _combo.ComboPopup_IsCreated(*args, **kwargs)
|
||||
|
||||
def DefaultPaintComboControl(*args, **kwargs):
|
||||
"""DefaultPaintComboControl(wxComboCtrlBase combo, DC dc, Rect rect)"""
|
||||
return _combo.ComboPopup_DefaultPaintComboControl(*args, **kwargs)
|
||||
|
||||
DefaultPaintComboControl = staticmethod(DefaultPaintComboControl)
|
||||
def GetCombo(*args, **kwargs):
|
||||
"""GetCombo(self) -> ComboCtrl"""
|
||||
return _combo.ComboPopup_GetCombo(*args, **kwargs)
|
||||
|
||||
_combo.ComboPopup_swigregister(ComboPopup)
|
||||
|
||||
def ComboPopup_DefaultPaintComboControl(*args, **kwargs):
|
||||
"""ComboPopup_DefaultPaintComboControl(wxComboCtrlBase combo, DC dc, Rect rect)"""
|
||||
return _combo.ComboPopup_DefaultPaintComboControl(*args, **kwargs)
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
ODCB_DCLICK_CYCLES = _combo.ODCB_DCLICK_CYCLES
|
||||
ODCB_STD_CONTROL_PAINT = _combo.ODCB_STD_CONTROL_PAINT
|
||||
ODCB_PAINTING_CONTROL = _combo.ODCB_PAINTING_CONTROL
|
||||
ODCB_PAINTING_SELECTED = _combo.ODCB_PAINTING_SELECTED
|
||||
class OwnerDrawnComboBox(ComboCtrl,_core.ItemContainer):
|
||||
"""Proxy of C++ OwnerDrawnComboBox class"""
|
||||
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=wxPyComboBoxNameStr) -> OwnerDrawnComboBox
|
||||
"""
|
||||
_combo.OwnerDrawnComboBox_swiginit(self,_combo.new_OwnerDrawnComboBox(*args, **kwargs))
|
||||
self._setOORInfo(self);OwnerDrawnComboBox._setCallbackInfo(self, self, OwnerDrawnComboBox)
|
||||
|
||||
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=wxPyComboBoxNameStr) -> bool
|
||||
"""
|
||||
return _combo.OwnerDrawnComboBox_Create(*args, **kwargs)
|
||||
|
||||
def GetWidestItemWidth(*args, **kwargs):
|
||||
"""GetWidestItemWidth(self) -> int"""
|
||||
return _combo.OwnerDrawnComboBox_GetWidestItemWidth(*args, **kwargs)
|
||||
|
||||
def GetWidestItem(*args, **kwargs):
|
||||
"""GetWidestItem(self) -> int"""
|
||||
return _combo.OwnerDrawnComboBox_GetWidestItem(*args, **kwargs)
|
||||
|
||||
def SetMark(*args, **kwargs):
|
||||
"""SetMark(self, long from, long to)"""
|
||||
return _combo.OwnerDrawnComboBox_SetMark(*args, **kwargs)
|
||||
|
||||
_combo.OwnerDrawnComboBox_swigregister(OwnerDrawnComboBox)
|
||||
|
||||
def PreOwnerDrawnComboBox(*args, **kwargs):
|
||||
"""PreOwnerDrawnComboBox() -> OwnerDrawnComboBox"""
|
||||
val = _combo.new_PreOwnerDrawnComboBox(*args, **kwargs)
|
||||
return val
|
||||
|
||||
|
||||
|
8364
wxPython/src/mac/combo_wrap.cpp
Normal file
8364
wxPython/src/mac/combo_wrap.cpp
Normal file
File diff suppressed because one or more lines are too long
480
wxPython/src/msw/combo.py
Normal file
480
wxPython/src/msw/combo.py
Normal file
@@ -0,0 +1,480 @@
|
||||
# This file was created automatically by SWIG 1.3.29.
|
||||
# Don't modify this file, modify the SWIG interface instead.
|
||||
|
||||
"""
|
||||
ComboCtrl class that can have any type of popup widget, and also an
|
||||
owner-drawn combobox control.
|
||||
"""
|
||||
|
||||
import _combo
|
||||
import new
|
||||
new_instancemethod = new.instancemethod
|
||||
def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
|
||||
if (name == "thisown"): return self.this.own(value)
|
||||
if (name == "this"):
|
||||
if type(value).__name__ == 'PySwigObject':
|
||||
self.__dict__[name] = value
|
||||
return
|
||||
method = class_type.__swig_setmethods__.get(name,None)
|
||||
if method: return method(self,value)
|
||||
if (not static) or hasattr(self,name):
|
||||
self.__dict__[name] = value
|
||||
else:
|
||||
raise AttributeError("You cannot add attributes to %s" % self)
|
||||
|
||||
def _swig_setattr(self,class_type,name,value):
|
||||
return _swig_setattr_nondynamic(self,class_type,name,value,0)
|
||||
|
||||
def _swig_getattr(self,class_type,name):
|
||||
if (name == "thisown"): return self.this.own()
|
||||
method = class_type.__swig_getmethods__.get(name,None)
|
||||
if method: return method(self)
|
||||
raise AttributeError,name
|
||||
|
||||
def _swig_repr(self):
|
||||
try: strthis = "proxy of " + self.this.__repr__()
|
||||
except: strthis = ""
|
||||
return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
|
||||
|
||||
import types
|
||||
try:
|
||||
_object = types.ObjectType
|
||||
_newclass = 1
|
||||
except AttributeError:
|
||||
class _object : pass
|
||||
_newclass = 0
|
||||
del types
|
||||
|
||||
|
||||
def _swig_setattr_nondynamic_method(set):
|
||||
def set_attr(self,name,value):
|
||||
if (name == "thisown"): return self.this.own(value)
|
||||
if hasattr(self,name) or (name == "this"):
|
||||
set(self,name,value)
|
||||
else:
|
||||
raise AttributeError("You cannot add attributes to %s" % self)
|
||||
return set_attr
|
||||
|
||||
|
||||
import _windows
|
||||
import _core
|
||||
wx = _core
|
||||
__docfilter__ = wx.__DocFilter(globals())
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
CC_BUTTON_OUTSIDE_BORDER = _combo.CC_BUTTON_OUTSIDE_BORDER
|
||||
CC_POPUP_ON_MOUSE_UP = _combo.CC_POPUP_ON_MOUSE_UP
|
||||
CC_NO_TEXT_AUTO_SELECT = _combo.CC_NO_TEXT_AUTO_SELECT
|
||||
CC_MF_ON_BUTTON = _combo.CC_MF_ON_BUTTON
|
||||
CC_MF_ON_CLICK_AREA = _combo.CC_MF_ON_CLICK_AREA
|
||||
class ComboCtrlFeatures(object):
|
||||
"""Proxy of C++ ComboCtrlFeatures class"""
|
||||
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
|
||||
def __init__(self): raise AttributeError, "No constructor defined"
|
||||
__repr__ = _swig_repr
|
||||
MovableButton = _combo.ComboCtrlFeatures_MovableButton
|
||||
BitmapButton = _combo.ComboCtrlFeatures_BitmapButton
|
||||
ButtonSpacing = _combo.ComboCtrlFeatures_ButtonSpacing
|
||||
TextIndent = _combo.ComboCtrlFeatures_TextIndent
|
||||
PaintControl = _combo.ComboCtrlFeatures_PaintControl
|
||||
PaintWritable = _combo.ComboCtrlFeatures_PaintWritable
|
||||
Borderless = _combo.ComboCtrlFeatures_Borderless
|
||||
All = _combo.ComboCtrlFeatures_All
|
||||
_combo.ComboCtrlFeatures_swigregister(ComboCtrlFeatures)
|
||||
|
||||
class ComboCtrl(_core.Control):
|
||||
"""Proxy of C++ ComboCtrl class"""
|
||||
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=ID_ANY, String value=wxEmptyString,
|
||||
Point pos=DefaultPosition, Size size=DefaultSize,
|
||||
long style=0, Validator validator=DefaultValidator,
|
||||
String name=wxPyComboBoxNameStr) -> ComboCtrl
|
||||
"""
|
||||
_combo.ComboCtrl_swiginit(self,_combo.new_ComboCtrl(*args, **kwargs))
|
||||
self._setOORInfo(self);ComboCtrl._setCallbackInfo(self, self, ComboCtrl)
|
||||
|
||||
def _setCallbackInfo(*args, **kwargs):
|
||||
"""_setCallbackInfo(self, PyObject self, PyObject _class)"""
|
||||
return _combo.ComboCtrl__setCallbackInfo(*args, **kwargs)
|
||||
|
||||
def ShowPopup(*args, **kwargs):
|
||||
"""ShowPopup(self)"""
|
||||
return _combo.ComboCtrl_ShowPopup(*args, **kwargs)
|
||||
|
||||
def HidePopup(*args, **kwargs):
|
||||
"""HidePopup(self)"""
|
||||
return _combo.ComboCtrl_HidePopup(*args, **kwargs)
|
||||
|
||||
def OnButtonClick(*args, **kwargs):
|
||||
"""OnButtonClick(self)"""
|
||||
return _combo.ComboCtrl_OnButtonClick(*args, **kwargs)
|
||||
|
||||
def IsPopupShown(*args, **kwargs):
|
||||
"""IsPopupShown(self) -> bool"""
|
||||
return _combo.ComboCtrl_IsPopupShown(*args, **kwargs)
|
||||
|
||||
def SetPopupControl(*args, **kwargs):
|
||||
"""SetPopupControl(self, ComboPopup popup)"""
|
||||
return _combo.ComboCtrl_SetPopupControl(*args, **kwargs)
|
||||
|
||||
def GetPopupControl(*args, **kwargs):
|
||||
"""GetPopupControl(self) -> ComboPopup"""
|
||||
return _combo.ComboCtrl_GetPopupControl(*args, **kwargs)
|
||||
|
||||
def GetPopupWindow(*args, **kwargs):
|
||||
"""GetPopupWindow(self) -> Window"""
|
||||
return _combo.ComboCtrl_GetPopupWindow(*args, **kwargs)
|
||||
|
||||
def GetTextCtrl(*args, **kwargs):
|
||||
"""GetTextCtrl(self) -> wxTextCtrl"""
|
||||
return _combo.ComboCtrl_GetTextCtrl(*args, **kwargs)
|
||||
|
||||
def GetButton(*args, **kwargs):
|
||||
"""GetButton(self) -> Window"""
|
||||
return _combo.ComboCtrl_GetButton(*args, **kwargs)
|
||||
|
||||
def GetValue(*args, **kwargs):
|
||||
"""GetValue(self) -> String"""
|
||||
return _combo.ComboCtrl_GetValue(*args, **kwargs)
|
||||
|
||||
def SetValue(*args, **kwargs):
|
||||
"""SetValue(self, String value)"""
|
||||
return _combo.ComboCtrl_SetValue(*args, **kwargs)
|
||||
|
||||
def Copy(*args, **kwargs):
|
||||
"""Copy(self)"""
|
||||
return _combo.ComboCtrl_Copy(*args, **kwargs)
|
||||
|
||||
def Cut(*args, **kwargs):
|
||||
"""Cut(self)"""
|
||||
return _combo.ComboCtrl_Cut(*args, **kwargs)
|
||||
|
||||
def Paste(*args, **kwargs):
|
||||
"""Paste(self)"""
|
||||
return _combo.ComboCtrl_Paste(*args, **kwargs)
|
||||
|
||||
def SetInsertionPoint(*args, **kwargs):
|
||||
"""SetInsertionPoint(self, long pos)"""
|
||||
return _combo.ComboCtrl_SetInsertionPoint(*args, **kwargs)
|
||||
|
||||
def SetInsertionPointEnd(*args, **kwargs):
|
||||
"""SetInsertionPointEnd(self)"""
|
||||
return _combo.ComboCtrl_SetInsertionPointEnd(*args, **kwargs)
|
||||
|
||||
def GetInsertionPoint(*args, **kwargs):
|
||||
"""GetInsertionPoint(self) -> long"""
|
||||
return _combo.ComboCtrl_GetInsertionPoint(*args, **kwargs)
|
||||
|
||||
def GetLastPosition(*args, **kwargs):
|
||||
"""GetLastPosition(self) -> long"""
|
||||
return _combo.ComboCtrl_GetLastPosition(*args, **kwargs)
|
||||
|
||||
def Replace(*args, **kwargs):
|
||||
"""Replace(self, long from, long to, String value)"""
|
||||
return _combo.ComboCtrl_Replace(*args, **kwargs)
|
||||
|
||||
def Remove(*args, **kwargs):
|
||||
"""Remove(self, long from, long to)"""
|
||||
return _combo.ComboCtrl_Remove(*args, **kwargs)
|
||||
|
||||
def Undo(*args, **kwargs):
|
||||
"""Undo(self)"""
|
||||
return _combo.ComboCtrl_Undo(*args, **kwargs)
|
||||
|
||||
def SetMark(*args, **kwargs):
|
||||
"""SetMark(self, long from, long to)"""
|
||||
return _combo.ComboCtrl_SetMark(*args, **kwargs)
|
||||
|
||||
def SetText(*args, **kwargs):
|
||||
"""SetText(self, String value)"""
|
||||
return _combo.ComboCtrl_SetText(*args, **kwargs)
|
||||
|
||||
def SetValueWithEvent(*args, **kwargs):
|
||||
"""SetValueWithEvent(self, String value, bool withEvent=True)"""
|
||||
return _combo.ComboCtrl_SetValueWithEvent(*args, **kwargs)
|
||||
|
||||
def SetPopupMinWidth(*args, **kwargs):
|
||||
"""SetPopupMinWidth(self, int width)"""
|
||||
return _combo.ComboCtrl_SetPopupMinWidth(*args, **kwargs)
|
||||
|
||||
def SetPopupMaxHeight(*args, **kwargs):
|
||||
"""SetPopupMaxHeight(self, int height)"""
|
||||
return _combo.ComboCtrl_SetPopupMaxHeight(*args, **kwargs)
|
||||
|
||||
def SetPopupExtents(*args, **kwargs):
|
||||
"""SetPopupExtents(self, int extLeft, int extRight)"""
|
||||
return _combo.ComboCtrl_SetPopupExtents(*args, **kwargs)
|
||||
|
||||
def SetCustomPaintWidth(*args, **kwargs):
|
||||
"""SetCustomPaintWidth(self, int width)"""
|
||||
return _combo.ComboCtrl_SetCustomPaintWidth(*args, **kwargs)
|
||||
|
||||
def GetCustomPaintWidth(*args, **kwargs):
|
||||
"""GetCustomPaintWidth(self) -> int"""
|
||||
return _combo.ComboCtrl_GetCustomPaintWidth(*args, **kwargs)
|
||||
|
||||
def SetPopupAnchor(*args, **kwargs):
|
||||
"""SetPopupAnchor(self, int anchorSide)"""
|
||||
return _combo.ComboCtrl_SetPopupAnchor(*args, **kwargs)
|
||||
|
||||
def SetButtonPosition(*args, **kwargs):
|
||||
"""SetButtonPosition(self, int width=-1, int height=-1, int side=RIGHT, int spacingX=0)"""
|
||||
return _combo.ComboCtrl_SetButtonPosition(*args, **kwargs)
|
||||
|
||||
def GetButtonSize(*args, **kwargs):
|
||||
"""GetButtonSize(self) -> Size"""
|
||||
return _combo.ComboCtrl_GetButtonSize(*args, **kwargs)
|
||||
|
||||
def SetButtonBitmaps(*args, **kwargs):
|
||||
"""
|
||||
SetButtonBitmaps(self, Bitmap bmpNormal, bool pushButtonBg=False, Bitmap bmpPressed=wxNullBitmap,
|
||||
Bitmap bmpHover=wxNullBitmap,
|
||||
Bitmap bmpDisabled=wxNullBitmap)
|
||||
"""
|
||||
return _combo.ComboCtrl_SetButtonBitmaps(*args, **kwargs)
|
||||
|
||||
def SetTextIndent(*args, **kwargs):
|
||||
"""SetTextIndent(self, int indent)"""
|
||||
return _combo.ComboCtrl_SetTextIndent(*args, **kwargs)
|
||||
|
||||
def GetTextIndent(*args, **kwargs):
|
||||
"""GetTextIndent(self) -> int"""
|
||||
return _combo.ComboCtrl_GetTextIndent(*args, **kwargs)
|
||||
|
||||
def GetTextRect(*args, **kwargs):
|
||||
"""GetTextRect(self) -> Rect"""
|
||||
return _combo.ComboCtrl_GetTextRect(*args, **kwargs)
|
||||
|
||||
def UseAltPopupWindow(*args, **kwargs):
|
||||
"""UseAltPopupWindow(self, bool enable=True)"""
|
||||
return _combo.ComboCtrl_UseAltPopupWindow(*args, **kwargs)
|
||||
|
||||
def EnablePopupAnimation(*args, **kwargs):
|
||||
"""EnablePopupAnimation(self, bool enable=True)"""
|
||||
return _combo.ComboCtrl_EnablePopupAnimation(*args, **kwargs)
|
||||
|
||||
def IsKeyPopupToggle(*args, **kwargs):
|
||||
"""IsKeyPopupToggle(self, KeyEvent event) -> bool"""
|
||||
return _combo.ComboCtrl_IsKeyPopupToggle(*args, **kwargs)
|
||||
|
||||
def PrepareBackground(*args, **kwargs):
|
||||
"""PrepareBackground(self, DC dc, Rect rect, int flags)"""
|
||||
return _combo.ComboCtrl_PrepareBackground(*args, **kwargs)
|
||||
|
||||
def ShouldDrawFocus(*args, **kwargs):
|
||||
"""ShouldDrawFocus(self) -> bool"""
|
||||
return _combo.ComboCtrl_ShouldDrawFocus(*args, **kwargs)
|
||||
|
||||
def GetBitmapNormal(*args, **kwargs):
|
||||
"""GetBitmapNormal(self) -> Bitmap"""
|
||||
return _combo.ComboCtrl_GetBitmapNormal(*args, **kwargs)
|
||||
|
||||
def GetBitmapPressed(*args, **kwargs):
|
||||
"""GetBitmapPressed(self) -> Bitmap"""
|
||||
return _combo.ComboCtrl_GetBitmapPressed(*args, **kwargs)
|
||||
|
||||
def GetBitmapHover(*args, **kwargs):
|
||||
"""GetBitmapHover(self) -> Bitmap"""
|
||||
return _combo.ComboCtrl_GetBitmapHover(*args, **kwargs)
|
||||
|
||||
def GetBitmapDisabled(*args, **kwargs):
|
||||
"""GetBitmapDisabled(self) -> Bitmap"""
|
||||
return _combo.ComboCtrl_GetBitmapDisabled(*args, **kwargs)
|
||||
|
||||
def GetInternalFlags(*args, **kwargs):
|
||||
"""GetInternalFlags(self) -> unsigned int"""
|
||||
return _combo.ComboCtrl_GetInternalFlags(*args, **kwargs)
|
||||
|
||||
def IsCreated(*args, **kwargs):
|
||||
"""IsCreated(self) -> bool"""
|
||||
return _combo.ComboCtrl_IsCreated(*args, **kwargs)
|
||||
|
||||
def OnPopupDismiss(*args, **kwargs):
|
||||
"""OnPopupDismiss(self)"""
|
||||
return _combo.ComboCtrl_OnPopupDismiss(*args, **kwargs)
|
||||
|
||||
Hidden = _combo.ComboCtrl_Hidden
|
||||
Animating = _combo.ComboCtrl_Animating
|
||||
Visible = _combo.ComboCtrl_Visible
|
||||
def IsPopupWindowState(*args, **kwargs):
|
||||
"""IsPopupWindowState(self, int state) -> bool"""
|
||||
return _combo.ComboCtrl_IsPopupWindowState(*args, **kwargs)
|
||||
|
||||
def GetPopupWindowState(*args, **kwargs):
|
||||
"""GetPopupWindowState(self) -> int"""
|
||||
return _combo.ComboCtrl_GetPopupWindowState(*args, **kwargs)
|
||||
|
||||
def SetCtrlMainWnd(*args, **kwargs):
|
||||
"""SetCtrlMainWnd(self, Window wnd)"""
|
||||
return _combo.ComboCtrl_SetCtrlMainWnd(*args, **kwargs)
|
||||
|
||||
def GetFeatures(*args, **kwargs):
|
||||
"""GetFeatures() -> int"""
|
||||
return _combo.ComboCtrl_GetFeatures(*args, **kwargs)
|
||||
|
||||
GetFeatures = staticmethod(GetFeatures)
|
||||
ShowBelow = _combo.ComboCtrl_ShowBelow
|
||||
ShowAbove = _combo.ComboCtrl_ShowAbove
|
||||
CanDeferShow = _combo.ComboCtrl_CanDeferShow
|
||||
def DoShowPopup(*args, **kwargs):
|
||||
"""DoShowPopup(self, Rect rect, int flags)"""
|
||||
return _combo.ComboCtrl_DoShowPopup(*args, **kwargs)
|
||||
|
||||
def AnimateShow(*args, **kwargs):
|
||||
"""AnimateShow(self, Rect rect, int flags) -> bool"""
|
||||
return _combo.ComboCtrl_AnimateShow(*args, **kwargs)
|
||||
|
||||
_combo.ComboCtrl_swigregister(ComboCtrl)
|
||||
|
||||
def PreComboCtrl(*args, **kwargs):
|
||||
"""PreComboCtrl() -> ComboCtrl"""
|
||||
val = _combo.new_PreComboCtrl(*args, **kwargs)
|
||||
return val
|
||||
|
||||
def ComboCtrl_GetFeatures(*args):
|
||||
"""ComboCtrl_GetFeatures() -> int"""
|
||||
return _combo.ComboCtrl_GetFeatures(*args)
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
class ComboPopup(object):
|
||||
"""Proxy of C++ ComboPopup class"""
|
||||
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) -> ComboPopup"""
|
||||
_combo.ComboPopup_swiginit(self,_combo.new_ComboPopup(*args, **kwargs))
|
||||
ComboPopup._setCallbackInfo(self, self, ComboPopup)
|
||||
|
||||
__swig_destroy__ = _combo.delete_ComboPopup
|
||||
__del__ = lambda self : None;
|
||||
def _setCallbackInfo(*args, **kwargs):
|
||||
"""_setCallbackInfo(self, PyObject self, PyObject _class)"""
|
||||
return _combo.ComboPopup__setCallbackInfo(*args, **kwargs)
|
||||
|
||||
def Init(*args, **kwargs):
|
||||
"""Init(self)"""
|
||||
return _combo.ComboPopup_Init(*args, **kwargs)
|
||||
|
||||
def Create(*args, **kwargs):
|
||||
"""Create(self, Window parent) -> bool"""
|
||||
return _combo.ComboPopup_Create(*args, **kwargs)
|
||||
|
||||
def GetControl(*args, **kwargs):
|
||||
"""GetControl(self) -> Window"""
|
||||
return _combo.ComboPopup_GetControl(*args, **kwargs)
|
||||
|
||||
def OnPopup(*args, **kwargs):
|
||||
"""OnPopup(self)"""
|
||||
return _combo.ComboPopup_OnPopup(*args, **kwargs)
|
||||
|
||||
def OnDismiss(*args, **kwargs):
|
||||
"""OnDismiss(self)"""
|
||||
return _combo.ComboPopup_OnDismiss(*args, **kwargs)
|
||||
|
||||
def SetStringValue(*args, **kwargs):
|
||||
"""SetStringValue(self, String value)"""
|
||||
return _combo.ComboPopup_SetStringValue(*args, **kwargs)
|
||||
|
||||
def GetStringValue(*args, **kwargs):
|
||||
"""GetStringValue(self) -> String"""
|
||||
return _combo.ComboPopup_GetStringValue(*args, **kwargs)
|
||||
|
||||
def PaintComboControl(*args, **kwargs):
|
||||
"""PaintComboControl(self, DC dc, Rect rect)"""
|
||||
return _combo.ComboPopup_PaintComboControl(*args, **kwargs)
|
||||
|
||||
def OnComboKeyEvent(*args, **kwargs):
|
||||
"""OnComboKeyEvent(self, KeyEvent event)"""
|
||||
return _combo.ComboPopup_OnComboKeyEvent(*args, **kwargs)
|
||||
|
||||
def OnComboDoubleClick(*args, **kwargs):
|
||||
"""OnComboDoubleClick(self)"""
|
||||
return _combo.ComboPopup_OnComboDoubleClick(*args, **kwargs)
|
||||
|
||||
def GetAdjustedSize(*args, **kwargs):
|
||||
"""GetAdjustedSize(self, int minWidth, int prefHeight, int maxHeight) -> Size"""
|
||||
return _combo.ComboPopup_GetAdjustedSize(*args, **kwargs)
|
||||
|
||||
def LazyCreate(*args, **kwargs):
|
||||
"""LazyCreate(self) -> bool"""
|
||||
return _combo.ComboPopup_LazyCreate(*args, **kwargs)
|
||||
|
||||
def Dismiss(*args, **kwargs):
|
||||
"""Dismiss(self)"""
|
||||
return _combo.ComboPopup_Dismiss(*args, **kwargs)
|
||||
|
||||
def IsCreated(*args, **kwargs):
|
||||
"""IsCreated(self) -> bool"""
|
||||
return _combo.ComboPopup_IsCreated(*args, **kwargs)
|
||||
|
||||
def DefaultPaintComboControl(*args, **kwargs):
|
||||
"""DefaultPaintComboControl(wxComboCtrlBase combo, DC dc, Rect rect)"""
|
||||
return _combo.ComboPopup_DefaultPaintComboControl(*args, **kwargs)
|
||||
|
||||
DefaultPaintComboControl = staticmethod(DefaultPaintComboControl)
|
||||
def GetCombo(*args, **kwargs):
|
||||
"""GetCombo(self) -> ComboCtrl"""
|
||||
return _combo.ComboPopup_GetCombo(*args, **kwargs)
|
||||
|
||||
_combo.ComboPopup_swigregister(ComboPopup)
|
||||
|
||||
def ComboPopup_DefaultPaintComboControl(*args, **kwargs):
|
||||
"""ComboPopup_DefaultPaintComboControl(wxComboCtrlBase combo, DC dc, Rect rect)"""
|
||||
return _combo.ComboPopup_DefaultPaintComboControl(*args, **kwargs)
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
ODCB_DCLICK_CYCLES = _combo.ODCB_DCLICK_CYCLES
|
||||
ODCB_STD_CONTROL_PAINT = _combo.ODCB_STD_CONTROL_PAINT
|
||||
ODCB_PAINTING_CONTROL = _combo.ODCB_PAINTING_CONTROL
|
||||
ODCB_PAINTING_SELECTED = _combo.ODCB_PAINTING_SELECTED
|
||||
class OwnerDrawnComboBox(ComboCtrl,_core.ItemContainer):
|
||||
"""Proxy of C++ OwnerDrawnComboBox class"""
|
||||
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=wxPyComboBoxNameStr) -> OwnerDrawnComboBox
|
||||
"""
|
||||
_combo.OwnerDrawnComboBox_swiginit(self,_combo.new_OwnerDrawnComboBox(*args, **kwargs))
|
||||
self._setOORInfo(self);OwnerDrawnComboBox._setCallbackInfo(self, self, OwnerDrawnComboBox)
|
||||
|
||||
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=wxPyComboBoxNameStr) -> bool
|
||||
"""
|
||||
return _combo.OwnerDrawnComboBox_Create(*args, **kwargs)
|
||||
|
||||
def GetWidestItemWidth(*args, **kwargs):
|
||||
"""GetWidestItemWidth(self) -> int"""
|
||||
return _combo.OwnerDrawnComboBox_GetWidestItemWidth(*args, **kwargs)
|
||||
|
||||
def GetWidestItem(*args, **kwargs):
|
||||
"""GetWidestItem(self) -> int"""
|
||||
return _combo.OwnerDrawnComboBox_GetWidestItem(*args, **kwargs)
|
||||
|
||||
def SetMark(*args, **kwargs):
|
||||
"""SetMark(self, long from, long to)"""
|
||||
return _combo.OwnerDrawnComboBox_SetMark(*args, **kwargs)
|
||||
|
||||
_combo.OwnerDrawnComboBox_swigregister(OwnerDrawnComboBox)
|
||||
|
||||
def PreOwnerDrawnComboBox(*args, **kwargs):
|
||||
"""PreOwnerDrawnComboBox() -> OwnerDrawnComboBox"""
|
||||
val = _combo.new_PreOwnerDrawnComboBox(*args, **kwargs)
|
||||
return val
|
||||
|
||||
|
||||
|
8364
wxPython/src/msw/combo_wrap.cpp
Normal file
8364
wxPython/src/msw/combo_wrap.cpp
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user