]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/wx/py/wxd/Controls.py
   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 DirFilterListCtrl(Choice
): 
 509     def __init__(self
, parent
, id=-1, pos
=wx
.DefaultPosition
, 
 510                  size
=wx
.DefaultSize
, style
=0): 
 514     def FillFilterList(filter, defaultFilter
): 
 519 class ListBox(ControlWithItems
): 
 534     def GetSelections(self
): 
 538     def InsertItems(self
): 
 542     def IsSelected(self
): 
 554     def SetFirstItem(self
): 
 558     def SetFirstItemStr(self
): 
 562     def SetSelection(self
): 
 570     def SetStringSelection(self
): 
 579 class CheckListBox(ListBox
): 
 594     def GetItemHeight(self
): 
 606     def InsertItems(self
): 
 615 class ListCtrl(Control
): 
 626     def AssignImageList(self
): 
 634     def ClearColumnImage(self
): 
 642     def DeleteAllColumns(self
): 
 646     def DeleteAllItems(self
): 
 650     def DeleteColumn(self
): 
 654     def DeleteItem(self
): 
 658     def EnsureVisible(self
): 
 666     def FindItemAtPos(self
): 
 670     def FindItemData(self
): 
 682     def GetColumnCount(self
): 
 686     def GetColumnWidth(self
): 
 690     def GetCountPerPage(self
): 
 694     def GetFirstSelected(self
): 
 698     def GetFocusedItem(self
): 
 702     def GetImageList(self
): 
 710     def GetItemBackgroundColour(self
): 
 714     def GetItemCount(self
): 
 718     def GetItemData(self
): 
 722     def GetItemPosition(self
): 
 726     def GetItemRect(self
): 
 730     def GetItemSpacing(self
): 
 734     def GetItemState(self
): 
 738     def GetItemText(self
): 
 742     def GetItemTextColour(self
): 
 746     def GetMainWindow(self
): 
 750     def GetNextItem(self
): 
 754     def GetNextSelected(self
): 
 758     def GetSelectedItemCount(self
): 
 762     def GetTextColour(self
): 
 766     def GetTopItem(self
): 
 774     def InsertColumn(self
): 
 778     def InsertColumnInfo(self
): 
 782     def InsertImageItem(self
): 
 786     def InsertImageStringItem(self
): 
 790     def InsertItem(self
): 
 794     def InsertStringItem(self
): 
 798     def IsSelected(self
): 
 806     def RefreshItem(self
): 
 810     def RefreshItems(self
): 
 814     def ScrollList(self
): 
 822     def SetBackgroundColour(self
): 
 830     def SetColumnImage(self
): 
 834     def SetColumnWidth(self
): 
 838     def SetForegroundColour(self
): 
 842     def SetImageList(self
): 
 850     def SetItemBackgroundColour(self
): 
 854     def SetItemCount(self
): 
 858     def SetItemData(self
): 
 862     def SetItemImage(self
): 
 866     def SetItemPosition(self
): 
 870     def SetItemState(self
): 
 874     def SetItemText(self
): 
 878     def SetItemTextColour(self
): 
 882     def SetSingleStyle(self
): 
 886     def SetStringItem(self
): 
 890     def SetTextColour(self
): 
 894     def SetWindowStyleFlag(self
): 
 906     def _setCallbackInfo(self
): 
 911 class ListItem(Object
): 
 918     def ClearAttributes(self
): 
 926     def GetAttributes(self
): 
 930     def GetBackgroundColour(self
): 
 966     def GetTextColour(self
): 
 974     def HasAttributes(self
): 
 982     def SetBackgroundColour(self
): 
1014     def SetStateMask(self
): 
1022     def SetTextColour(self
): 
1034     def __getattr__(self
): 
1042     def __setattr__(self
): 
1050     def GetBackgroundColour(self
): 
1058     def GetTextColour(self
): 
1062     def HasBackgroundColour(self
): 
1070     def HasTextColour(self
): 
1074     def SetBackgroundColour(self
): 
1082     def SetTextColour(self
): 
1091 class ListView(ListCtrl
): 
1094     def ClearColumnImage(self
): 
1106     def GetFirstSelected(self
): 
1110     def GetFocusedItem(self
): 
1114     def GetNextSelected(self
): 
1118     def IsSelected(self
): 
1126     def SetColumnImage(self
): 
1135 class Notebook(Control
): 
1137     def __init__(self
, parent
, id, pos
=wx
.DefaultPosition
, 
1138                  size
=wx
.DefaultSize
, style
=0, name
=wx
.PyNOTEBOOK_NAME
): 
1142     def AddPage(self
, page
, text
, select
=False, imageId
=-1): 
1146     def AdvanceSelection(self
, forward
=True): 
1150     def AssignImageList(self
, imageList
) : 
1154     def Create(self
, parent
, id, pos
=wx
.DefaultPosition
, 
1155                size
=wx
.DefaultSize
, style
=0, name
=wx
.PyNOTEBOOK_NAME
): 
1159     def DeleteAllPages(self
): 
1163     def DeletePage(self
, page
): 
1167     def GetImageList(self
): 
1171     def GetPage(self
, page
): 
1175     def GetPageCount(self
): 
1179     def GetPageImage(self
, page
): 
1183     def GetPageText(self
, page
): 
1187     def GetRowCount(self
): 
1191     def GetSelection(self
): 
1195     def InsertPage(self
, index
, page
, text
, select
=False, imageId
=-1): 
1199     def RemovePage(self
, page
): 
1203     def ResizeChildren(self
): 
1207     def SetImageList(self
, imageList
): 
1211     def SetPadding(self
, padding
): 
1215     def SetPageImage(self
, page
, image
): 
1219     def SetPageSize(self
, size
): 
1223     def SetPageText(self
, page
, text
): 
1227     def SetSelection(self
, page
): 
1232 class RadioBox(Control
): 
1243     def EnableItem(self
): 
1247     def FindString(self
): 
1255     def GetItemLabel(self
): 
1259     def GetSelection(self
): 
1263     def GetString(self
): 
1267     def GetStringSelection(self
): 
1275     def SetItemLabel(self
): 
1279     def SetSelection(self
): 
1283     def SetStringSelection(self
): 
1300 class RadioButton(Control
): 
1320 class ScrollBar(Control
): 
1327     def GetPageSize(self
): 
1335     def GetThumbLength(self
): 
1339     def GetThumbPosition(self
): 
1343     def GetThumbSize(self
): 
1347     def IsVertical(self
): 
1351     def SetScrollbar(self
): 
1355     def SetThumbPosition(self
): 
1364 class Slider(Control
): 
1371     def ClearTicks(self
): 
1379     def GetLineSize(self
): 
1391     def GetPageSize(self
): 
1395     def GetSelEnd(self
): 
1399     def GetSelStart(self
): 
1403     def GetThumbLength(self
): 
1407     def GetTickFreq(self
): 
1415     def SetLineSize(self
): 
1419     def SetPageSize(self
): 
1427     def SetSelection(self
): 
1431     def SetThumbLength(self
): 
1439     def SetTickFreq(self
): 
1452 class SpinButton(Control
): 
1484 class SpinCtrl(SpinButton
): 
1516 class StaticBitmap(Control
): 
1523     def GetBitmap(self
): 
1527     def SetBitmap(self
): 
1540 class StaticBox(Control
): 
1552 class StaticLine(Control
): 
1564 class StaticText(Control
): 
1587     def GetBackgroundColour(self
): 
1595     def GetTextColour(self
): 
1599     def HasBackgroundColour(self
): 
1607     def HasTextColour(self
): 
1611     def IsDefault(self
): 
1615     def SetBackgroundColour(self
): 
1623     def SetTextColour(self
): 
1636 class TextCtrl(Control
): 
1639     def AppendText(self
): 
1679     def DiscardEdits(self
): 
1683     def EmulateKeyPress(self
): 
1687     def GetDefaultStyle(self
): 
1691     def GetInsertionPoint(self
): 
1695     def GetLastPosition(self
): 
1699     def GetLineLength(self
): 
1703     def GetLineText(self
): 
1707     def GetNumberOfLines(self
): 
1715     def GetSelection(self
): 
1719     def GetString(self
): 
1723     def GetStringSelection(self
): 
1731     def IsEditable(self
): 
1735     def IsModified(self
): 
1739     def IsMultiLine(self
): 
1743     def IsSingleLine(self
): 
1755     def PositionToXY(self
): 
1775     def SelectAll(self
): 
1779     def SetDefaultStyle(self
): 
1783     def SetEditable(self
): 
1787     def SetInsertionPoint(self
): 
1791     def SetInsertionPointEnd(self
): 
1795     def SetMaxLength(self
): 
1799     def SetSelection(self
): 
1811     def ShowPosition(self
): 
1819     def WriteText(self
): 
1823     def XYToPosition(self
): 
1836 class ToggleButton(Control
):