]> git.saurik.com Git - wxWidgets.git/blob - wxPython/src/gtk/combo.py
reSWIGGed
[wxWidgets.git] / wxPython / src / gtk / combo.py
1 # This file was created automatically by SWIG 1.3.29.
2 # Don't modify this file, modify the SWIG interface instead.
3
4 """
5 ComboCtrl class that can have any type of popup widget, and also an
6 owner-drawn combobox control.
7 """
8
9 import _combo
10 import new
11 new_instancemethod = new.instancemethod
12 def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
13 if (name == "thisown"): return self.this.own(value)
14 if (name == "this"):
15 if type(value).__name__ == 'PySwigObject':
16 self.__dict__[name] = value
17 return
18 method = class_type.__swig_setmethods__.get(name,None)
19 if method: return method(self,value)
20 if (not static) or hasattr(self,name):
21 self.__dict__[name] = value
22 else:
23 raise AttributeError("You cannot add attributes to %s" % self)
24
25 def _swig_setattr(self,class_type,name,value):
26 return _swig_setattr_nondynamic(self,class_type,name,value,0)
27
28 def _swig_getattr(self,class_type,name):
29 if (name == "thisown"): return self.this.own()
30 method = class_type.__swig_getmethods__.get(name,None)
31 if method: return method(self)
32 raise AttributeError,name
33
34 def _swig_repr(self):
35 try: strthis = "proxy of " + self.this.__repr__()
36 except: strthis = ""
37 return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
38
39 import types
40 try:
41 _object = types.ObjectType
42 _newclass = 1
43 except AttributeError:
44 class _object : pass
45 _newclass = 0
46 del types
47
48
49 def _swig_setattr_nondynamic_method(set):
50 def set_attr(self,name,value):
51 if (name == "thisown"): return self.this.own(value)
52 if hasattr(self,name) or (name == "this"):
53 set(self,name,value)
54 else:
55 raise AttributeError("You cannot add attributes to %s" % self)
56 return set_attr
57
58
59 import _windows
60 import _core
61 wx = _core
62 __docfilter__ = wx.__DocFilter(globals())
63 #---------------------------------------------------------------------------
64
65 CC_BUTTON_OUTSIDE_BORDER = _combo.CC_BUTTON_OUTSIDE_BORDER
66 CC_POPUP_ON_MOUSE_UP = _combo.CC_POPUP_ON_MOUSE_UP
67 CC_NO_TEXT_AUTO_SELECT = _combo.CC_NO_TEXT_AUTO_SELECT
68 CC_MF_ON_BUTTON = _combo.CC_MF_ON_BUTTON
69 CC_MF_ON_CLICK_AREA = _combo.CC_MF_ON_CLICK_AREA
70 class ComboCtrlFeatures(object):
71 """
72 Namespace for `wx.combo.ComboCtrl` feature flags. See
73 `wx.combo.ComboCtrl.GetFeatures`.
74 """
75 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
76 def __init__(self): raise AttributeError, "No constructor defined"
77 __repr__ = _swig_repr
78 MovableButton = _combo.ComboCtrlFeatures_MovableButton
79 BitmapButton = _combo.ComboCtrlFeatures_BitmapButton
80 ButtonSpacing = _combo.ComboCtrlFeatures_ButtonSpacing
81 TextIndent = _combo.ComboCtrlFeatures_TextIndent
82 PaintControl = _combo.ComboCtrlFeatures_PaintControl
83 PaintWritable = _combo.ComboCtrlFeatures_PaintWritable
84 Borderless = _combo.ComboCtrlFeatures_Borderless
85 All = _combo.ComboCtrlFeatures_All
86 _combo.ComboCtrlFeatures_swigregister(ComboCtrlFeatures)
87
88 class ComboCtrl(_core.Control):
89 """
90 A combo control is a generic combobox that allows for a totally custom
91 popup. In addition it has other customization features. For instance,
92 position and size of the dropdown button can be changed.
93
94 To specify what to use for the popup control you need to derive a
95 class from `wx.combo.ComboPopup` and pass it to the ComboCtrl with
96 `SetPopupControl`. It doesn't derive from any widget class so it can
97 be used either as a mixin class combined with some standard or custom
98 widget, or you can use the derived ComboPopup to create and hold an
99 independent reference to the widget to be used for the popup.
100
101 """
102 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
103 __repr__ = _swig_repr
104 def __init__(self, *args, **kwargs):
105 """
106 __init__(self, Window parent, int id=ID_ANY, String value=wxEmptyString,
107 Point pos=DefaultPosition, Size size=DefaultSize,
108 long style=0, Validator validator=DefaultValidator,
109 String name=wxPyComboBoxNameStr) -> ComboCtrl
110 """
111 _combo.ComboCtrl_swiginit(self,_combo.new_ComboCtrl(*args, **kwargs))
112 self._setOORInfo(self);ComboCtrl._setCallbackInfo(self, self, ComboCtrl)
113
114 def _setCallbackInfo(*args, **kwargs):
115 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
116 return _combo.ComboCtrl__setCallbackInfo(*args, **kwargs)
117
118 def ShowPopup(*args, **kwargs):
119 """
120 ShowPopup(self)
121
122 Show the popup window.
123 """
124 return _combo.ComboCtrl_ShowPopup(*args, **kwargs)
125
126 def HidePopup(*args, **kwargs):
127 """
128 HidePopup(self)
129
130 Dismisses the popup window.
131 """
132 return _combo.ComboCtrl_HidePopup(*args, **kwargs)
133
134 def OnButtonClick(*args, **kwargs):
135 """
136 OnButtonClick(self)
137
138 Implement in a derived class to define what happens on dropdown button
139 click. Default action is to show the popup.
140 """
141 return _combo.ComboCtrl_OnButtonClick(*args, **kwargs)
142
143 def IsPopupShown(*args, **kwargs):
144 """
145 IsPopupShown(self) -> bool
146
147 Returns true if the popup is currently shown.
148 """
149 return _combo.ComboCtrl_IsPopupShown(*args, **kwargs)
150
151 def SetPopupControl(*args, **kwargs):
152 """
153 SetPopupControl(self, ComboPopup popup)
154
155 Set popup interface class derived from `wx.combo.ComboPopup`. This
156 method should be called as soon as possible after the control has been
157 created, unless `OnButtonClick` has been overridden.
158 """
159 return _combo.ComboCtrl_SetPopupControl(*args, **kwargs)
160
161 def GetPopupControl(*args, **kwargs):
162 """
163 GetPopupControl(self) -> ComboPopup
164
165 Returns the current popup interface that has been set with
166 `SetPopupControl`.
167 """
168 return _combo.ComboCtrl_GetPopupControl(*args, **kwargs)
169
170 def GetPopupWindow(*args, **kwargs):
171 """
172 GetPopupWindow(self) -> Window
173
174 Returns the popup window containing the popup control.
175 """
176 return _combo.ComboCtrl_GetPopupWindow(*args, **kwargs)
177
178 def GetTextCtrl(*args, **kwargs):
179 """
180 GetTextCtrl(self) -> wxTextCtrl
181
182 Get the text control which is part of the combo control.
183 """
184 return _combo.ComboCtrl_GetTextCtrl(*args, **kwargs)
185
186 def GetButton(*args, **kwargs):
187 """
188 GetButton(self) -> Window
189
190 Get the dropdown button which is part of the combobox. Note: it's not
191 necessarily a wx.Button or wx.BitmapButton.
192 """
193 return _combo.ComboCtrl_GetButton(*args, **kwargs)
194
195 def GetValue(*args, **kwargs):
196 """
197 GetValue(self) -> String
198
199 Returns text representation of the current value. For writable combo
200 control it always returns the value in the text field.
201 """
202 return _combo.ComboCtrl_GetValue(*args, **kwargs)
203
204 def SetValue(*args, **kwargs):
205 """
206 SetValue(self, String value)
207
208 Sets the text for the combo control text field. For a combo control
209 with wx.CB_READONLY style the string must be accepted by the popup (for
210 instance, exist in the dropdown list), otherwise the call to
211 SetValue is ignored.
212 """
213 return _combo.ComboCtrl_SetValue(*args, **kwargs)
214
215 def Copy(*args, **kwargs):
216 """Copy(self)"""
217 return _combo.ComboCtrl_Copy(*args, **kwargs)
218
219 def Cut(*args, **kwargs):
220 """Cut(self)"""
221 return _combo.ComboCtrl_Cut(*args, **kwargs)
222
223 def Paste(*args, **kwargs):
224 """Paste(self)"""
225 return _combo.ComboCtrl_Paste(*args, **kwargs)
226
227 def SetInsertionPoint(*args, **kwargs):
228 """SetInsertionPoint(self, long pos)"""
229 return _combo.ComboCtrl_SetInsertionPoint(*args, **kwargs)
230
231 def SetInsertionPointEnd(*args, **kwargs):
232 """SetInsertionPointEnd(self)"""
233 return _combo.ComboCtrl_SetInsertionPointEnd(*args, **kwargs)
234
235 def GetInsertionPoint(*args, **kwargs):
236 """GetInsertionPoint(self) -> long"""
237 return _combo.ComboCtrl_GetInsertionPoint(*args, **kwargs)
238
239 def GetLastPosition(*args, **kwargs):
240 """GetLastPosition(self) -> long"""
241 return _combo.ComboCtrl_GetLastPosition(*args, **kwargs)
242
243 def Replace(*args, **kwargs):
244 """Replace(self, long from, long to, String value)"""
245 return _combo.ComboCtrl_Replace(*args, **kwargs)
246
247 def Remove(*args, **kwargs):
248 """Remove(self, long from, long to)"""
249 return _combo.ComboCtrl_Remove(*args, **kwargs)
250
251 def Undo(*args, **kwargs):
252 """Undo(self)"""
253 return _combo.ComboCtrl_Undo(*args, **kwargs)
254
255 def SetMark(*args, **kwargs):
256 """SetMark(self, long from, long to)"""
257 return _combo.ComboCtrl_SetMark(*args, **kwargs)
258
259 def SetText(*args, **kwargs):
260 """
261 SetText(self, String value)
262
263 Sets the text for the text field without affecting the popup. Thus,
264 unlike `SetValue`, it works equally well with combo control using
265 wx.CB_READONLY style.
266 """
267 return _combo.ComboCtrl_SetText(*args, **kwargs)
268
269 def SetValueWithEvent(*args, **kwargs):
270 """
271 SetValueWithEvent(self, String value, bool withEvent=True)
272
273 Same as `SetValue`, but also sends a EVT_TEXT event if withEvent is true.
274 """
275 return _combo.ComboCtrl_SetValueWithEvent(*args, **kwargs)
276
277 def SetPopupMinWidth(*args, **kwargs):
278 """
279 SetPopupMinWidth(self, int width)
280
281 Sets minimum width of the popup. If wider than combo control, it will
282 extend to the left. A value of -1 indicates to use the default. The
283 popup implementation may choose to ignore this.
284 """
285 return _combo.ComboCtrl_SetPopupMinWidth(*args, **kwargs)
286
287 def SetPopupMaxHeight(*args, **kwargs):
288 """
289 SetPopupMaxHeight(self, int height)
290
291 Sets preferred maximum height of the popup. A value of -1 indicates to
292 use the default. The popup implementation may choose to ignore this.
293 """
294 return _combo.ComboCtrl_SetPopupMaxHeight(*args, **kwargs)
295
296 def SetPopupExtents(*args, **kwargs):
297 """
298 SetPopupExtents(self, int extLeft, int extRight)
299
300 Extends popup size horizontally, relative to the edges of the combo
301 control. Values are given in pixels, and the defaults are zero. It
302 is up to th epopup to fully take these values into account.
303 """
304 return _combo.ComboCtrl_SetPopupExtents(*args, **kwargs)
305
306 def SetCustomPaintWidth(*args, **kwargs):
307 """
308 SetCustomPaintWidth(self, int width)
309
310 Set width, in pixels, of custom painted area in control without
311 wx.CB_READONLY style. In read-only OwnerDrawnComboBox, this is used
312 to indicate the area that is not covered by the focus rectangle.
313 """
314 return _combo.ComboCtrl_SetCustomPaintWidth(*args, **kwargs)
315
316 def GetCustomPaintWidth(*args, **kwargs):
317 """GetCustomPaintWidth(self) -> int"""
318 return _combo.ComboCtrl_GetCustomPaintWidth(*args, **kwargs)
319
320 def SetPopupAnchor(*args, **kwargs):
321 """
322 SetPopupAnchor(self, int anchorSide)
323
324 Set side of the control to which the popup will align itself. Valid
325 values are wx.LEFT, wx.RIGHT and 0. The default value 0 means that the
326 most appropriate side is used (which, currently, is always wx.LEFT).
327 """
328 return _combo.ComboCtrl_SetPopupAnchor(*args, **kwargs)
329
330 def SetButtonPosition(*args, **kwargs):
331 """
332 SetButtonPosition(self, int width=-1, int height=-1, int side=RIGHT, int spacingX=0)
333
334 Set the position of the dropdown button.
335 """
336 return _combo.ComboCtrl_SetButtonPosition(*args, **kwargs)
337
338 def GetButtonSize(*args, **kwargs):
339 """
340 GetButtonSize(self) -> Size
341
342 Returns current size of the dropdown button.
343 """
344 return _combo.ComboCtrl_GetButtonSize(*args, **kwargs)
345
346 def SetButtonBitmaps(*args, **kwargs):
347 """
348 SetButtonBitmaps(self, Bitmap bmpNormal, bool pushButtonBg=False, Bitmap bmpPressed=wxNullBitmap,
349 Bitmap bmpHover=wxNullBitmap,
350 Bitmap bmpDisabled=wxNullBitmap)
351
352 Sets custom dropdown button graphics.
353
354 :param bmpNormal: Default button image
355 :param pushButtonBg: If ``True``, blank push button background is painted below the image.
356 :param bmpPressed: Depressed butotn image.
357 :param bmpHover: Button imate to use when the mouse hovers over it.
358 :param bmpDisabled: Disabled button image.
359
360 """
361 return _combo.ComboCtrl_SetButtonBitmaps(*args, **kwargs)
362
363 def SetTextIndent(*args, **kwargs):
364 """
365 SetTextIndent(self, int indent)
366
367 This will set the space in pixels between left edge of the control and
368 the text, regardless whether control is read-only or not. A value of -1 can
369 be given to indicate platform default.
370 """
371 return _combo.ComboCtrl_SetTextIndent(*args, **kwargs)
372
373 def GetTextIndent(*args, **kwargs):
374 """
375 GetTextIndent(self) -> int
376
377 Returns actual indentation in pixels.
378 """
379 return _combo.ComboCtrl_GetTextIndent(*args, **kwargs)
380
381 def GetTextRect(*args, **kwargs):
382 """
383 GetTextRect(self) -> Rect
384
385 Returns area covered by the text field (includes everything except
386 borders and the dropdown button).
387 """
388 return _combo.ComboCtrl_GetTextRect(*args, **kwargs)
389
390 def UseAltPopupWindow(*args, **kwargs):
391 """
392 UseAltPopupWindow(self, bool enable=True)
393
394 Enable or disable usage of an alternative popup window, which
395 guarantees ability to focus the popup control, and allows common
396 native controls to function normally. This alternative popup window is
397 usually a wxDialog, and as such, when it is shown, its parent
398 top-level window will appear as if the focus has been lost from it.
399 """
400 return _combo.ComboCtrl_UseAltPopupWindow(*args, **kwargs)
401
402 def EnablePopupAnimation(*args, **kwargs):
403 """
404 EnablePopupAnimation(self, bool enable=True)
405
406 Enables or disables popup animation, if any, depending on the value of
407 the argument.
408 """
409 return _combo.ComboCtrl_EnablePopupAnimation(*args, **kwargs)
410
411 def IsKeyPopupToggle(*args, **kwargs):
412 """
413 IsKeyPopupToggle(self, KeyEvent event) -> bool
414
415 Returns true if given key combination should toggle the popup.
416 """
417 return _combo.ComboCtrl_IsKeyPopupToggle(*args, **kwargs)
418
419 def PrepareBackground(*args, **kwargs):
420 """
421 PrepareBackground(self, DC dc, Rect rect, int flags)
422
423 Prepare background of combo control or an item in a dropdown list in a
424 way typical on platform. This includes painting the focus/disabled
425 background and setting the clipping region. Unless you plan to paint
426 your own focus indicator, you should always call this in your
427 wxComboPopup::PaintComboControl implementation. In addition, it sets
428 pen and text colour to what looks good and proper against the
429 background.
430
431 flags are the same as wx.RendererNative flags:
432
433 ====================== ============================================
434 wx.CONTROL_ISSUBMENU drawing a list item instead of combo control
435 wx.CONTROL_SELECTED list item is selected
436 wx.CONTROL_DISABLED control/item is disabled
437 ====================== ============================================
438
439 """
440 return _combo.ComboCtrl_PrepareBackground(*args, **kwargs)
441
442 def ShouldDrawFocus(*args, **kwargs):
443 """
444 ShouldDrawFocus(self) -> bool
445
446 Returns true if focus indicator should be drawn in the control.
447 """
448 return _combo.ComboCtrl_ShouldDrawFocus(*args, **kwargs)
449
450 def GetBitmapNormal(*args, **kwargs):
451 """GetBitmapNormal(self) -> Bitmap"""
452 return _combo.ComboCtrl_GetBitmapNormal(*args, **kwargs)
453
454 def GetBitmapPressed(*args, **kwargs):
455 """GetBitmapPressed(self) -> Bitmap"""
456 return _combo.ComboCtrl_GetBitmapPressed(*args, **kwargs)
457
458 def GetBitmapHover(*args, **kwargs):
459 """GetBitmapHover(self) -> Bitmap"""
460 return _combo.ComboCtrl_GetBitmapHover(*args, **kwargs)
461
462 def GetBitmapDisabled(*args, **kwargs):
463 """GetBitmapDisabled(self) -> Bitmap"""
464 return _combo.ComboCtrl_GetBitmapDisabled(*args, **kwargs)
465
466 def GetInternalFlags(*args, **kwargs):
467 """GetInternalFlags(self) -> unsigned int"""
468 return _combo.ComboCtrl_GetInternalFlags(*args, **kwargs)
469
470 def IsCreated(*args, **kwargs):
471 """
472 IsCreated(self) -> bool
473
474 Return true if Create has finished
475 """
476 return _combo.ComboCtrl_IsCreated(*args, **kwargs)
477
478 def OnPopupDismiss(*args, **kwargs):
479 """
480 OnPopupDismiss(self)
481
482 Common code to be called on popup hide/dismiss
483 """
484 return _combo.ComboCtrl_OnPopupDismiss(*args, **kwargs)
485
486 Hidden = _combo.ComboCtrl_Hidden
487 Animating = _combo.ComboCtrl_Animating
488 Visible = _combo.ComboCtrl_Visible
489 def IsPopupWindowState(*args, **kwargs):
490 """IsPopupWindowState(self, int state) -> bool"""
491 return _combo.ComboCtrl_IsPopupWindowState(*args, **kwargs)
492
493 def GetPopupWindowState(*args, **kwargs):
494 """GetPopupWindowState(self) -> int"""
495 return _combo.ComboCtrl_GetPopupWindowState(*args, **kwargs)
496
497 def SetCtrlMainWnd(*args, **kwargs):
498 """SetCtrlMainWnd(self, Window wnd)"""
499 return _combo.ComboCtrl_SetCtrlMainWnd(*args, **kwargs)
500
501 def GetFeatures(*args, **kwargs):
502 """
503 GetFeatures() -> int
504
505 Returns a bit-list of flags indicating which features of the ComboCtrl
506 functionality are implemented by this implemetation. See
507 `wx.combo.ComboCtrlFeatures`.
508 """
509 return _combo.ComboCtrl_GetFeatures(*args, **kwargs)
510
511 GetFeatures = staticmethod(GetFeatures)
512 ShowBelow = _combo.ComboCtrl_ShowBelow
513 ShowAbove = _combo.ComboCtrl_ShowAbove
514 CanDeferShow = _combo.ComboCtrl_CanDeferShow
515 def DoShowPopup(*args, **kwargs):
516 """
517 DoShowPopup(self, Rect rect, int flags)
518
519 Shows and positions the popup.
520
521 Flags:
522 ============ =====================================================
523 ShowBelow Showing popup below the control
524 ShowAbove Showing popup above the control
525 CanDeferShow Can only return true from AnimateShow if this is set
526 ============ =====================================================
527
528 """
529 return _combo.ComboCtrl_DoShowPopup(*args, **kwargs)
530
531 def AnimateShow(*args, **kwargs):
532 """
533 AnimateShow(self, Rect rect, int flags) -> bool
534
535 Implement in derived class to create a drop-down animation. Return
536 ``True`` if finished immediately. Otherwise the popup is only shown when the
537 derived class calls `DoShowPopup`. Flags are same as for `DoShowPopup`.
538
539 """
540 return _combo.ComboCtrl_AnimateShow(*args, **kwargs)
541
542 _combo.ComboCtrl_swigregister(ComboCtrl)
543
544 def PreComboCtrl(*args, **kwargs):
545 """PreComboCtrl() -> ComboCtrl"""
546 val = _combo.new_PreComboCtrl(*args, **kwargs)
547 return val
548
549 def ComboCtrl_GetFeatures(*args):
550 """
551 ComboCtrl_GetFeatures() -> int
552
553 Returns a bit-list of flags indicating which features of the ComboCtrl
554 functionality are implemented by this implemetation. See
555 `wx.combo.ComboCtrlFeatures`.
556 """
557 return _combo.ComboCtrl_GetFeatures(*args)
558
559 #---------------------------------------------------------------------------
560
561 class ComboPopup(object):
562 """
563 In order to use a custom popup with `wx.combo.ComboCtrl` an interface
564 class derived from wx.combo.ComboPopup is used to manage the interface
565 between the popup control and the popup. You can either derive a new
566 class from both the widget class and this ComboPopup class, or the
567 derived class can have a reference to the widget used for the popup.
568 In either case you simply need to return the widget from the
569 `GetControl` method to allow the ComboCtrl to interact with it.
570
571 Nearly all of the methods of this class are overridable in Python.
572 """
573 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
574 __repr__ = _swig_repr
575 def __init__(self, *args, **kwargs):
576 """
577 __init__(self) -> ComboPopup
578
579 Constructor
580 """
581 _combo.ComboPopup_swiginit(self,_combo.new_ComboPopup(*args, **kwargs))
582 ComboPopup._setCallbackInfo(self, self, ComboPopup)
583
584 __swig_destroy__ = _combo.delete_ComboPopup
585 __del__ = lambda self : None;
586 def _setCallbackInfo(*args, **kwargs):
587 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
588 return _combo.ComboPopup__setCallbackInfo(*args, **kwargs)
589
590 def Init(*args, **kwargs):
591 """
592 Init(self)
593
594 This method is called after the popup is contructed and has been
595 assigned to the ComboCtrl. Derived classes can override this to do
596 extra inialization or whatever.
597 """
598 return _combo.ComboPopup_Init(*args, **kwargs)
599
600 def Create(*args, **kwargs):
601 """
602 Create(self, Window parent) -> bool
603
604 The derived class must implement this method to create the popup
605 control. It should be a child of the ``parent`` passed in, but other
606 than that there is much flexibility in what the widget can be, its
607 style, etc. Return ``True`` for success, ``False`` otherwise. (NOTE:
608 this return value is not currently checked...)
609 """
610 return _combo.ComboPopup_Create(*args, **kwargs)
611
612 def GetControl(*args, **kwargs):
613 """
614 GetControl(self) -> Window
615
616 The derived class must implement this method and it should return a
617 reference to the widget created in the `Create` method. If the
618 derived class inherits from both the widget class and ComboPopup then
619 the return value is probably just ``self``.
620 """
621 return _combo.ComboPopup_GetControl(*args, **kwargs)
622
623 def OnPopup(*args, **kwargs):
624 """
625 OnPopup(self)
626
627 The derived class may implement this to do special processing when
628 popup is shown.
629 """
630 return _combo.ComboPopup_OnPopup(*args, **kwargs)
631
632 def OnDismiss(*args, **kwargs):
633 """
634 OnDismiss(self)
635
636 The derived class may implement this to do special processing when
637 popup is hidden.
638 """
639 return _combo.ComboPopup_OnDismiss(*args, **kwargs)
640
641 def SetStringValue(*args, **kwargs):
642 """
643 SetStringValue(self, String value)
644
645 Called just prior to displaying the popup. The derived class can
646 implement this to "select" the item in the popup that coresponds to
647 the passed in string value, if appropriate. The default
648 implementation does nothing.
649 """
650 return _combo.ComboPopup_SetStringValue(*args, **kwargs)
651
652 def GetStringValue(*args, **kwargs):
653 """
654 GetStringValue(self) -> String
655
656 Gets the string representation of the currently selected value to be
657 used to display in the combo widget.
658 """
659 return _combo.ComboPopup_GetStringValue(*args, **kwargs)
660
661 def PaintComboControl(*args, **kwargs):
662 """
663 PaintComboControl(self, DC dc, Rect rect)
664
665 This is called to custom paint in the combo control itself (ie. not
666 the popup). Default implementation draws the current value as string.
667 """
668 return _combo.ComboPopup_PaintComboControl(*args, **kwargs)
669
670 def OnComboKeyEvent(*args, **kwargs):
671 """
672 OnComboKeyEvent(self, KeyEvent event)
673
674 Receives key events from the parent ComboCtrl. Events not handled
675 should be skipped, as usual.
676 """
677 return _combo.ComboPopup_OnComboKeyEvent(*args, **kwargs)
678
679 def OnComboDoubleClick(*args, **kwargs):
680 """
681 OnComboDoubleClick(self)
682
683 Implement this method in the derived class if you need to support
684 special actions when the user double-clicks on the parent ComboCtrl.
685 """
686 return _combo.ComboPopup_OnComboDoubleClick(*args, **kwargs)
687
688 def GetAdjustedSize(*args, **kwargs):
689 """
690 GetAdjustedSize(self, int minWidth, int prefHeight, int maxHeight) -> Size
691
692 The derived class may implement this method to return adjusted size
693 for the popup control, according to the variables given. It is called
694 on every popup, just prior to `OnPopup`.
695
696 :param minWidth: Preferred minimum width.
697 :param prefHeight: Preferred height. May be -1 to indicate no preference.
698 :maxWidth: Max height for window, as limited by screen size, and
699 should only be rounded down, if necessary.
700
701 """
702 return _combo.ComboPopup_GetAdjustedSize(*args, **kwargs)
703
704 def LazyCreate(*args, **kwargs):
705 """
706 LazyCreate(self) -> bool
707
708 The derived class may implement this to return ``True`` if it wants to
709 delay the call to `Create` until the popup is shown for the first
710 time. It is more efficient, but on the other hand it is often more
711 convenient to have the control created immediately. The default
712 implementation returns ``False``.
713 """
714 return _combo.ComboPopup_LazyCreate(*args, **kwargs)
715
716 def Dismiss(*args, **kwargs):
717 """
718 Dismiss(self)
719
720 Hides the popup
721 """
722 return _combo.ComboPopup_Dismiss(*args, **kwargs)
723
724 def IsCreated(*args, **kwargs):
725 """
726 IsCreated(self) -> bool
727
728 Returns true if `Create` has been called.
729 """
730 return _combo.ComboPopup_IsCreated(*args, **kwargs)
731
732 def DefaultPaintComboControl(*args, **kwargs):
733 """
734 DefaultPaintComboControl(wxComboCtrlBase combo, DC dc, Rect rect)
735
736 Default PaintComboControl behaviour
737 """
738 return _combo.ComboPopup_DefaultPaintComboControl(*args, **kwargs)
739
740 DefaultPaintComboControl = staticmethod(DefaultPaintComboControl)
741 def GetCombo(*args, **kwargs):
742 """
743 GetCombo(self) -> ComboCtrl
744
745 Returns a reference to the `wx.combo.ComboCtrl` this ComboPopup object
746 is associated with.
747 """
748 return _combo.ComboPopup_GetCombo(*args, **kwargs)
749
750 _combo.ComboPopup_swigregister(ComboPopup)
751
752 def ComboPopup_DefaultPaintComboControl(*args, **kwargs):
753 """
754 ComboPopup_DefaultPaintComboControl(wxComboCtrlBase combo, DC dc, Rect rect)
755
756 Default PaintComboControl behaviour
757 """
758 return _combo.ComboPopup_DefaultPaintComboControl(*args, **kwargs)
759
760 #---------------------------------------------------------------------------
761
762 ODCB_DCLICK_CYCLES = _combo.ODCB_DCLICK_CYCLES
763 ODCB_STD_CONTROL_PAINT = _combo.ODCB_STD_CONTROL_PAINT
764 ODCB_PAINTING_CONTROL = _combo.ODCB_PAINTING_CONTROL
765 ODCB_PAINTING_SELECTED = _combo.ODCB_PAINTING_SELECTED
766 class OwnerDrawnComboBox(ComboCtrl,_core.ItemContainer):
767 """
768 wx.combo.OwnerDrawnComboBox is a combobox with owner-drawn list
769 items. In essence, it is a `wx.combo.ComboCtrl` with a `wx.VListBox`
770 popup and a `wx.ControlWithItems` API.
771
772 Implementing item drawing and measuring is similar to wx.VListBox.
773 The application needs to subclass wx.combo.OwnerDrawnComboBox and
774 implement the `OnDrawItem`, `OnMeasureItem` and `OnMeasureItemWidth`
775 methods.
776 """
777 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
778 __repr__ = _swig_repr
779 def __init__(self, *args, **kwargs):
780 """
781 __init__(self, Window parent, int id=-1, String value=EmptyString,
782 Point pos=DefaultPosition, Size size=DefaultSize,
783 wxArrayString choices=wxPyEmptyStringArray,
784 long style=0, Validator validator=DefaultValidator,
785 String name=wxPyComboBoxNameStr) -> OwnerDrawnComboBox
786
787 Standard constructor.
788 """
789 _combo.OwnerDrawnComboBox_swiginit(self,_combo.new_OwnerDrawnComboBox(*args, **kwargs))
790 self._setOORInfo(self);OwnerDrawnComboBox._setCallbackInfo(self, self, OwnerDrawnComboBox)
791
792 def _setCallbackInfo(*args, **kwargs):
793 """_setCallbackInfo(self, PyObject self, PyObject _class)"""
794 return _combo.OwnerDrawnComboBox__setCallbackInfo(*args, **kwargs)
795
796 def Create(*args, **kwargs):
797 """
798 Create(self, Window parent, int id=-1, String value=EmptyString,
799 Point pos=DefaultPosition, Size size=DefaultSize,
800 wxArrayString choices=wxPyEmptyStringArray,
801 long style=0, Validator validator=DefaultValidator,
802 String name=wxPyComboBoxNameStr) -> bool
803
804 Create the UI object, and other initialization.
805 """
806 return _combo.OwnerDrawnComboBox_Create(*args, **kwargs)
807
808 def GetWidestItemWidth(*args, **kwargs):
809 """
810 GetWidestItemWidth(self) -> int
811
812 Return the widest item width (recalculating it if necessary.)
813 """
814 return _combo.OwnerDrawnComboBox_GetWidestItemWidth(*args, **kwargs)
815
816 def GetWidestItem(*args, **kwargs):
817 """
818 GetWidestItem(self) -> int
819
820 Return the index of the widest item (recalculating it if necessary.)
821 """
822 return _combo.OwnerDrawnComboBox_GetWidestItem(*args, **kwargs)
823
824 def SetMark(*args, **kwargs):
825 """SetMark(self, long from, long to)"""
826 return _combo.OwnerDrawnComboBox_SetMark(*args, **kwargs)
827
828 def OnDrawItem(*args, **kwargs):
829 """
830 OnDrawItem(self, DC dc, Rect rect, int item, int flags)
831
832 The derived class may implement this function to actually draw the
833 item with the given index on the provided DC. If this method is not
834 overridden, the item text is simply drawn as if the control was a
835 normal combobox.
836
837 :param dc: The device context to use for drawing.
838 :param rect: The bounding rectangle for the item being drawn, the
839 DC's clipping region is set to this rectangle before
840 calling this method.
841 :param item: The index of the item to be drawn.
842
843 :param flags: ``wx.combo.ODCB_PAINTING_CONTROL`` (The Combo control itself
844 is being painted, instead of a list item. The ``item``
845 parameter may be ``wx.NOT_FOUND`` in this case.
846 ``wx.combo.ODCB_PAINTING_SELECTED`` (An item with
847 selection background is being painted. The DC's text colour
848 should already be correct.
849
850 """
851 return _combo.OwnerDrawnComboBox_OnDrawItem(*args, **kwargs)
852
853 def OnMeasureItem(*args, **kwargs):
854 """
855 OnMeasureItem(self, size_t item) -> int
856
857 The derived class may implement this method to return the height of
858 the specified item (in pixels). The default implementation returns
859 text height, as if this control was a normal combobox.
860 """
861 return _combo.OwnerDrawnComboBox_OnMeasureItem(*args, **kwargs)
862
863 def OnMeasureItemWidth(*args, **kwargs):
864 """
865 OnMeasureItemWidth(self, size_t item) -> int
866
867 The derived class may implement this method to return the width of the
868 specified item (in pixels). If -1 is returned, then the item text
869 width is used. The default implementation returns -1.
870 """
871 return _combo.OwnerDrawnComboBox_OnMeasureItemWidth(*args, **kwargs)
872
873 def OnDrawBackground(*args, **kwargs):
874 """
875 OnDrawBackground(self, DC dc, Rect rect, int item, int flags)
876
877 This method is used to draw the items background and, maybe, a border
878 around it.
879
880 The base class version implements a reasonable default behaviour which
881 consists in drawing the selected item with the standard background
882 colour and drawing a border around the item if it is either selected
883 or current. ``flags`` has the sam meaning as with `OnDrawItem`.
884 """
885 return _combo.OwnerDrawnComboBox_OnDrawBackground(*args, **kwargs)
886
887 _combo.OwnerDrawnComboBox_swigregister(OwnerDrawnComboBox)
888
889 def PreOwnerDrawnComboBox(*args, **kwargs):
890 """
891 PreOwnerDrawnComboBox() -> OwnerDrawnComboBox
892
893 2-phase create constructor.
894 """
895 val = _combo.new_PreOwnerDrawnComboBox(*args, **kwargs)
896 return val
897
898
899