]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/wxPython/lib/PyCrust/wxd/Controls.py
1d1fad0210ef9d9444fdf62ad5af67fd1278af72
1 """Decorator classes for documentation and shell scripting.
4 __author__
= "Patrick K. O'Brien <pobrien@orbtech.com>"
6 __revision__
= "$Revision$"[11:-2]
9 # These are not the real wxPython classes. These are Python versions
10 # for documentation purposes. They are also used to apply docstrings
11 # to the real wxPython classes, which are SWIG-generated wrappers for
15 from Base
import Object
16 import Parameters
as wx
17 from Window
import Window
26 class Control(Window
):
27 """Base class for a control or 'widget'.
29 A control is generally a small window which processes user input
30 and/or displays one or more item of data."""
32 def __init__(self
, parent
, id, pos
=wx
.DefaultPosition
,
33 size
=wx
.DefaultSize
, style
=0,
34 validator
=wx
.DefaultValidator
, name
='control'):
35 """Create a Control instance."""
38 def Command(self
, event
):
39 """Simulates the effect of the user issuing a command to the
40 item. See CommandEvent."""
43 def Create(self
, parent
, id, pos
=wx
.DefaultPosition
,
44 size
=wx
.DefaultSize
, style
=0,
45 validator
=wx
.DefaultValidator
, name
='control'):
46 """Create a Control instance."""
50 """Return the string label for the control."""
53 def SetLabel(self
, label
):
54 """Set the string label for the control."""
58 class PyControl(Control
):
65 def _setCallbackInfo(self
):
69 def base_AcceptsFocus(self
):
73 def base_AcceptsFocusFromKeyboard(self
):
77 def base_AddChild(self
):
81 def base_DoGetBestSize(self
):
85 def base_DoGetClientSize(self
):
89 def base_DoGetPosition(self
):
93 def base_DoGetSize(self
):
97 def base_DoGetVirtualSize(self
):
101 def base_DoMoveWindow(self
):
105 def base_DoSetClientSize(self
):
109 def base_DoSetSize(self
):
113 def base_DoSetVirtualSize(self
):
117 def base_GetMaxSize(self
):
121 def base_InitDialog(self
):
125 def base_RemoveChild(self
):
129 def base_TransferDataFromWindow(self
):
133 def base_TransferDataToWindow(self
):
137 def base_Validate(self
):
142 class ControlWithItems(Control
):
149 def AppendItems(self
):
157 def FindString(self
):
161 def GetClientData(self
):
169 def GetSelection(self
):
177 def GetStringSelection(self
):
189 def SetClientData(self
):
202 class Button(Control
):
203 """A button is a control that contains a text string, and is one
204 of the most common elements of a GUI. It may be placed on a
205 dialog box or panel, or indeed almost any other window.
210 BU_LEFT: Left-justifies the label. WIN32 only.
212 BU_TOP: Aligns the label to the top of the button. WIN32 only.
214 BU_RIGHT: Right-justifies the bitmap label. WIN32 only.
216 BU_BOTTOM: Aligns the label to the bottom of the button. WIN32
219 BU_EXACTFIT: Creates the button as small as possible instead of
220 making it of the standard size (which is the default behaviour.)
225 EVT_BUTTON(win,id,func): Sent when the button is clicked."""
227 def __init__(self
, parent
, id, label
, pos
=wx
.DefaultPosition
,
228 size
=wx
.DefaultSize
, style
=0,
229 validator
=wx
.DefaultValidator
, name
='button'):
230 """Create and show a button.
232 parent: Parent window. Must not be None.
233 id: Button identifier. A value of -1 indicates a default value.
234 label: The text to be displayed on the button.
235 pos: The button position on it's parent.
236 size: Button size. If the default size (-1, -1) is specified
237 then the button is sized appropriately for the text.
238 style: Window style. See Button.
239 validator: Window validator.
240 name: Window name."""
243 def Create(self
, parent
, id, label
, pos
=wx
.DefaultPosition
,
244 size
=wx
.DefaultSize
, style
=0,
245 validator
=wx
.DefaultValidator
, name
='button'):
246 """Create and show a button."""
249 def SetBackgroundColour(self
):
253 def SetDefault(self
):
254 """Set the button to be the default item for the panel or
257 Under Windows, only dialog box buttons respond to this
258 function. As normal under Windows and Motif, pressing return
259 causes the default button to be depressed when the return key
260 is pressed. See also Window.SetFocus which sets the keyboard
261 focus for windows and text panel items, and
262 Panel.SetDefaultItem."""
265 def SetForegroundColour(self
):
270 class BitmapButton(Button
):
277 def GetBitmapDisabled(self
):
281 def GetBitmapFocus(self
):
285 def GetBitmapLabel(self
):
289 def GetBitmapSelected(self
):
293 def GetMarginX(self
):
297 def GetMarginY(self
):
301 def SetBitmapDisabled(self
):
305 def SetBitmapFocus(self
):
309 def SetBitmapLabel(self
):
313 def SetBitmapSelected(self
):
317 def SetMargins(self
):
326 class CheckBox(Control
):
350 class Choice(ControlWithItems
):
365 def GetColumns(self
):
373 def SetColumns(self
):
377 def SetSelection(self
):
385 def SetStringSelection(self
):
390 class Gauge(Control
):
397 def GetBezelFace(self
):
405 def GetShadowWidth(self
):
413 def SetBezelFace(self
):
421 def SetShadowWidth(self
):
434 class GenericDirCtrl(Control
):
441 def ExpandPath(self
):
445 def GetDefaultPath(self
):
449 def GetFilePath(self
):
457 def GetFilterIndex(self
):
461 def GetFilterListCtrl(self
):
473 def GetShowHidden(self
):
477 def GetTreeCtrl(self
):
481 def SetDefaultPath(self
):
489 def SetFilterIndex(self
):
497 def ShowHidden(self
):
506 class ListBox(ControlWithItems
):
521 def GetSelections(self
):
525 def InsertItems(self
):
529 def IsSelected(self
):
541 def SetFirstItem(self
):
545 def SetFirstItemStr(self
):
549 def SetSelection(self
):
557 def SetStringSelection(self
):
566 class CheckListBox(ListBox
):
581 def GetItemHeight(self
):
593 def InsertItems(self
):
602 class ListCtrl(Control
):
613 def AssignImageList(self
):
621 def ClearColumnImage(self
):
629 def DeleteAllColumns(self
):
633 def DeleteAllItems(self
):
637 def DeleteColumn(self
):
641 def DeleteItem(self
):
645 def EnsureVisible(self
):
653 def FindItemAtPos(self
):
657 def FindItemData(self
):
669 def GetColumnCount(self
):
673 def GetColumnWidth(self
):
677 def GetCountPerPage(self
):
681 def GetFirstSelected(self
):
685 def GetFocusedItem(self
):
689 def GetImageList(self
):
697 def GetItemBackgroundColour(self
):
701 def GetItemCount(self
):
705 def GetItemData(self
):
709 def GetItemPosition(self
):
713 def GetItemRect(self
):
717 def GetItemSpacing(self
):
721 def GetItemState(self
):
725 def GetItemText(self
):
729 def GetItemTextColour(self
):
733 def GetMainWindow(self
):
737 def GetNextItem(self
):
741 def GetNextSelected(self
):
745 def GetSelectedItemCount(self
):
749 def GetTextColour(self
):
753 def GetTopItem(self
):
761 def InsertColumn(self
):
765 def InsertColumnInfo(self
):
769 def InsertImageItem(self
):
773 def InsertImageStringItem(self
):
777 def InsertItem(self
):
781 def InsertStringItem(self
):
785 def IsSelected(self
):
793 def RefreshItem(self
):
797 def RefreshItems(self
):
801 def ScrollList(self
):
809 def SetBackgroundColour(self
):
817 def SetColumnImage(self
):
821 def SetColumnWidth(self
):
825 def SetForegroundColour(self
):
829 def SetImageList(self
):
837 def SetItemBackgroundColour(self
):
841 def SetItemCount(self
):
845 def SetItemData(self
):
849 def SetItemImage(self
):
853 def SetItemPosition(self
):
857 def SetItemState(self
):
861 def SetItemText(self
):
865 def SetItemTextColour(self
):
869 def SetSingleStyle(self
):
873 def SetStringItem(self
):
877 def SetTextColour(self
):
881 def SetWindowStyleFlag(self
):
893 def _setCallbackInfo(self
):
898 class ListItem(Object
):
905 def ClearAttributes(self
):
913 def GetAttributes(self
):
917 def GetBackgroundColour(self
):
953 def GetTextColour(self
):
961 def HasAttributes(self
):
969 def SetBackgroundColour(self
):
1001 def SetStateMask(self
):
1009 def SetTextColour(self
):
1021 def __getattr__(self
):
1029 def __setattr__(self
):
1037 def GetBackgroundColour(self
):
1045 def GetTextColour(self
):
1049 def HasBackgroundColour(self
):
1057 def HasTextColour(self
):
1061 def SetBackgroundColour(self
):
1069 def SetTextColour(self
):
1078 class ListView(ListCtrl
):
1081 def ClearColumnImage(self
):
1093 def GetFirstSelected(self
):
1097 def GetFocusedItem(self
):
1101 def GetNextSelected(self
):
1105 def IsSelected(self
):
1113 def SetColumnImage(self
):
1122 class Notebook(Control
):
1124 def __init__(self
, parent
, id, pos
=wx
.DefaultPosition
,
1125 size
=wx
.DefaultSize
, style
=0, name
=wx
.PyNOTEBOOK_NAME
):
1129 def AddPage(self
, pPage
, strText
, bSelect
=False, imageId
=-1):
1133 def AdvanceSelection(self
, bForward
=True):
1137 def AssignImageList(self
, imageList
) :
1141 def Create(self
, parent
, id, pos
=wx
.DefaultPosition
,
1142 size
=wx
.DefaultSize
, style
=0, name
=wx
.PyNOTEBOOK_NAME
):
1146 def DeleteAllPages(self
):
1150 def DeletePage(self
, nPage
):
1154 def GetImageList(self
):
1158 def GetPage(self
, nPage
):
1162 def GetPageCount(self
):
1166 def GetPageImage(self
, nPage
):
1170 def GetPageText(self
, nPage
):
1174 def GetRowCount(self
):
1178 def GetSelection(self
):
1182 def InsertPage(self
, nPage
, pPage
, strText
, bSelect
=False, imageId
=-1):
1186 def RemovePage(self
, nPage
):
1190 def ResizeChildren(self
):
1194 def SetImageList(self
, imageList
):
1198 def SetPadding(self
, padding
):
1202 def SetPageImage(self
, nPage
, nImage
):
1206 def SetPageSize(self
, size
):
1210 def SetPageText(self
, nPage
, strText
):
1214 def SetSelection(self
, nPage
):
1219 class RadioBox(Control
):
1230 def EnableItem(self
):
1234 def FindString(self
):
1242 def GetItemLabel(self
):
1246 def GetSelection(self
):
1250 def GetString(self
):
1254 def GetStringSelection(self
):
1262 def SetItemLabel(self
):
1266 def SetSelection(self
):
1270 def SetStringSelection(self
):
1287 class RadioButton(Control
):
1307 class ScrollBar(Control
):
1314 def GetPageSize(self
):
1322 def GetThumbLength(self
):
1326 def GetThumbPosition(self
):
1330 def GetThumbSize(self
):
1334 def IsVertical(self
):
1338 def SetScrollbar(self
):
1342 def SetThumbPosition(self
):
1351 class Slider(Control
):
1358 def ClearTicks(self
):
1366 def GetLineSize(self
):
1378 def GetPageSize(self
):
1382 def GetSelEnd(self
):
1386 def GetSelStart(self
):
1390 def GetThumbLength(self
):
1394 def GetTickFreq(self
):
1402 def SetLineSize(self
):
1406 def SetPageSize(self
):
1414 def SetSelection(self
):
1418 def SetThumbLength(self
):
1426 def SetTickFreq(self
):
1439 class SpinButton(Control
):
1471 class SpinCtrl(SpinButton
):
1503 class StaticBitmap(Control
):
1510 def GetBitmap(self
):
1514 def SetBitmap(self
):
1527 class StaticBox(Control
):
1539 class StaticLine(Control
):
1551 class StaticText(Control
):
1574 def GetBackgroundColour(self
):
1582 def GetTextColour(self
):
1586 def HasBackgroundColour(self
):
1594 def HasTextColour(self
):
1598 def IsDefault(self
):
1602 def SetBackgroundColour(self
):
1610 def SetTextColour(self
):
1623 class TextCtrl(Control
):
1626 def AppendText(self
):
1666 def DiscardEdits(self
):
1670 def EmulateKeyPress(self
):
1674 def GetDefaultStyle(self
):
1678 def GetInsertionPoint(self
):
1682 def GetLastPosition(self
):
1686 def GetLineLength(self
):
1690 def GetLineText(self
):
1694 def GetNumberOfLines(self
):
1702 def GetSelection(self
):
1706 def GetString(self
):
1710 def GetStringSelection(self
):
1718 def IsEditable(self
):
1722 def IsModified(self
):
1726 def IsMultiLine(self
):
1730 def IsSingleLine(self
):
1742 def PositionToXY(self
):
1762 def SelectAll(self
):
1766 def SetDefaultStyle(self
):
1770 def SetEditable(self
):
1774 def SetInsertionPoint(self
):
1778 def SetInsertionPointEnd(self
):
1782 def SetMaxLength(self
):
1786 def SetSelection(self
):
1798 def ShowPosition(self
):
1806 def WriteText(self
):
1810 def XYToPosition(self
):
1823 class ToggleButton(Control
):