Attachment 'cheat_sheet.xml'

Download

   1 <?xml version="1.0" encoding="utf-8"?>
   2 <xwPython-CheatSheet api="wxPython" package="wx">
   3 	<category name="App">
   4 		<wxclass name="App">
   5 			<description>The gui itself. Controls the event loop.</description>
   6 			<notes>
   7 				<note>Top-level windows can not be created before the app object.</note>
   8 				<note>Over-ride <code>OnInit</code>. Don't know why it's undocumented.</note>
   9                 <note>OnInit should return a boolean value. (And don't forget to call <code>Frame.Show(True)</code>.)</note>
  10 				<note>Call <code>MainLoop</code></note>
  11 			</notes>
  12 			<methods>
  13 				<method name="__init__">
  14 					<args>
  15 						<arg>redirect=False</arg>
  16 						<arg>filename=None</arg>
  17 						<arg>clearSigInt=True</arg>
  18 						<arg>useBestVisual=False</arg>
  19 					</args>
  20 				</method>
  21 				<method name="MainLoop">
  22 					<description>Execute the main GUI event loop.</description>
  23 				</method>
  24 				<method name="SetTopWindow">
  25 					<args>
  26 						<arg>frame</arg>
  27 					</args>
  28 				</method>
  29 			</methods>
  30 		</wxclass>
  31 		<wxclass name="PySimpleApp">
  32 			<description>When you don't feel like over-riding Init.</description>
  33 			<notes>
  34 				<note>Make the app before the frames!</note>
  35 			</notes>
  36 			<methods>
  37 				<method name="__init__">
  38 					<args>
  39 						<arg>redirect</arg>
  40 						<arg>filename</arg>
  41 						<arg>useBestVisual</arg>
  42 						<arg>clearSigInt</arg>
  43 					</args>
  44 				</method>
  45 			</methods>
  46 		</wxclass>
  47 	</category>
  48 	<category name="Window">
  49 		<wxclass name="Window">
  50 			<description>Abstract parent of all visible elements.</description>
  51 			<events>
  52 				<event>EVT_WINDOW_CREATE</event>
  53 				<event>EVT_WINDOW_DESTROY</event>
  54 				<event>EVT_SIZE</event>
  55 				<event>EVT_CLOSE</event>
  56 			</events>
  57 			<methods>
  58                 <method name="__init__">
  59                     <args>
  60                         <arg>parent</arg>
  61                         <arg>id=-1</arg>
  62                         <arg>pos=wx.DefaultPosition</arg>
  63                         <arg>size=wx.DefaultSize</arg>
  64                         <arg>style=0</arg>
  65                         <arg>name=wx.PanelNameStr</arg>
  66                     </args>
  67 					<styles>
  68                         <style>wx.BORDER_SIMPLE</style>
  69                         <style>wx.BORDER_DOUBLE</style>
  70                         <style>wx.BORDER_SUNKEN</style>
  71                         <style>wx.BORDER_RAISED</style>
  72                         <style>wx.BORDER_STATIC</style>
  73                         <style>wx.BORDER_THEME</style>
  74                         <style>wx.BORDER_NONE</style>
  75                         <style>wx.TRANSPARENT_WINDOW</style>
  76                         <style>wx.TAB_TRAVERSAL</style>
  77                         <style>wx.WANTS_CHARS</style>
  78                         <style>wx.VSCROLL</style>
  79                         <style>wx.HSCROLL</style>
  80                         <style>wx.CLIP_CHILDREN</style>
  81                         <style>wx.FULL_REPAINT_ON_RESIZE</style>
  82 					</styles>
  83                 </method>
  84                 <method name="GetFont"></method>
  85                 <method name="SetFont">
  86                     <args>
  87                         <arg>font</arg>
  88                     </args>
  89                 </method>
  90 				<method name="GetTextExtent">
  91                     <description>Gets the dimensions of the string as it would be drawn on the window with the currently selected font.</description>
  92                     <args>
  93                         <arg>string</arg>
  94                     </args>
  95 				</method>				
  96 				<method name="Layout">
  97 					<description>Invokes the constraint-based layout algorith or the sizer-based algorithm for this window.</description>
  98 				</method>
  99 				<method name="SetAutoLayout">
 100 					<args>
 101 						<arg>autoLayout</arg>
 102 					</args>
 103 					<description>If autoLayout is True <code>Layout</code> is called every time there is an EVT_SIZE event for the window.</description>
 104 				</method>
 105                 <method name="SetSize"><args><arg>size</arg></args></method>
 106                 <method name="SetMinSize"><args><arg>size</arg></args></method>
 107                 <method name="SetMaxSize"><args><arg>size</arg></args></method>
 108 				<method name="Show">
 109 					<description>Shows or hides the window.</description>
 110 					<args>
 111 						<arg>show=True</arg>
 112 					</args>
 113 				</method>
 114             </methods>
 115         </wxclass>
 116         <wxclass name="TopLevelWindow">
 117             <methods>        
 118                 <method name="SetSizeHints">
 119                     <args>
 120                         <arg>minW</arg><arg>minH</arg>
 121                         <arg>maxW=-1</arg><arg>maxH=-1</arg>
 122                     </args>
 123                 </method>
 124                 <method name="SetTitle"><args><arg>title</arg></args></method>
 125             </methods>
 126         </wxclass>
 127 		<wxclass name="Frame">
 128 			<notes>
 129 				<note>If you add a window (i.e. a control or panel) without using a sizer it's size info will be ignored and it will fill the frame.</note>
 130 			</notes>
 131 			<methods>
 132 				<method name="__init__">
 133 					<args>
 134 						<arg>parent</arg>
 135 						<arg>id=-1</arg>
 136 						<arg>title=""</arg>
 137 						<arg>pos=wx.DefaultPosition</arg>
 138 						<arg>size=wx.DefaultSize</arg>
 139 						<arg>style=wx.DEFAULT_FRAME_STYLE</arg>
 140 						<arg>name=wx.FrameNameStr</arg>
 141 					</args>
 142 					<styles>
 143 						<style default="True">wx.CAPTION</style>
 144 						<style default="True">wx.MINIMIZE_BOX</style>
 145 						<style default="True">wx.MAXIMIZE_BOX</style>
 146 						<style default="True">wx.CLOSE_BOX</style>
 147 						<style>wx.STAY_ON_TOP</style>
 148 						<style>wx.SYSTEM_MENU</style>
 149 						<style>wx.RESIZE_BORDER</style>
 150 						<style>wx.FRAME_TOOL_WINDOW</style>
 151 						<style>wx.FRAME_NO_TASKBAR</style>
 152 						<style>wx.FRAME_FLOAT_ON_PARENT</style>
 153 					</styles>
 154                     <notes>
 155                         <note>Setting the parent to <code>None</code> makes the frame a 'top level' window.</note>
 156                     </notes>
 157 				</method>
 158                 <method name="GetMenuBar"></method>
 159 				<method name="CreateStatusBar">
 160 					<args>
 161 						<arg>number=1</arg>
 162 						<arg>style=wx.ST_SIZEGRIP|wx.FULLREPAINT_ON_RESIZE</arg>
 163 						<arg>id=0</arg>
 164 						<arg>name="statusBar"</arg>
 165 					</args>
 166 					<notes>
 167 						<note>A multi-field status bar can be created by providing a number > 1</note>
 168 					</notes>
 169 				</method>
 170                 <method name="GetLabel"></method>
 171 				<method name="CreateToolBar">
 172 					<args>
 173 						<arg>style=wx.NO_BORDER|wx.TB_HORIZONTAL</arg>
 174 						<arg>id=-1</arg>
 175 						<arg>name="toolBar"</arg>
 176 					</args>
 177 				</method>
 178                 
 179 				<method name="GetToolBar"></method>
 180                 <method name="SetLabel">
 181                     <args>
 182                         <arg>label</arg>
 183                     </args>
 184                 </method>
 185 				<method name="SetMenuBar">
 186 					<args>
 187 						<arg>menuBar</arg>
 188 					</args>
 189 				</method>              
 190 				<method name="SetSizer">
 191 					<args>
 192 						<arg>sizer</arg>
 193 						<arg>deleteOld=True</arg>
 194 					</args>
 195 					<notes>
 196 						<note>According to the docs, <code>SetAutoLayout</code> is called implicitly.</note>
 197 					</notes>
 198 				</method>
 199 				<method name="SetStatusBar">
 200 					<args>
 201 						<arg>statusBar</arg>
 202 					</args>
 203 				</method>
 204 				<method name="SetStatusText">
 205 					<args>
 206 						<arg>text</arg>
 207 						<arg>number=0</arg>
 208 					</args>
 209 					<notes>
 210 						<note>number: The status field.</note>
 211 					</notes>
 212 				</method>
 213                 <method name="SetToolBar">
 214 					<args>
 215 						<arg>toolBar</arg>
 216 					</args>
 217 				</method>
 218 			</methods>
 219 		</wxclass>
 220 		<wxclass name="Panel">
 221 			<methods>
 222 				<method name="__init__">
 223 					<args>
 224 						<arg>parent</arg>
 225 						<arg>id=-1</arg>
 226 						<arg>title=""</arg>
 227 						<arg>pos=wx.DefaultPosition</arg>
 228 						<arg>size=wx.DefaultSize</arg>
 229 						<arg>style=wx.TAB_TRAVERSAL | wx.NO_BORDER</arg>
 230 						<arg>name=wx.PanelNameStr</arg>
 231 					</args>
 232 					<styles>
 233 						<style>See Window</style>
 234 					</styles>
 235 				</method>
 236 			</methods>
 237 		</wxclass>
 238 		<wxclass name="Dialog">
 239 			<methods>
 240 				<method name="__init__">
 241 					<args>
 242 						<arg>parent</arg>
 243 						<arg>id=-1</arg>
 244 						<arg>title=""</arg>
 245 						<arg>pos=wx.DefaultPosition</arg>
 246 						<arg>size=wx.DefaultSize</arg>
 247 						<arg>style=wx.DEFAULT_DIALOG_STYLE</arg>
 248 						<arg>name=wx.DialogNameStr</arg>
 249 					</args>
 250 				</method>
 251 				<method name="ShowModal"></method>
 252 			</methods>
 253 		</wxclass>
 254         <wxclass name="MessageDialog">
 255             <description>When you want some combination of Yes/No/Ok/Cancel.</description>
 256             <notes>
 257                 <note>Returns one of: <code>wx.ID_OK</code>, <code>wx.ID_CANCEL</code>, <code>wx.ID_YES</code>, or <code>wx.ID_NO</code></note>
 258                 <note>Alternative: <code>wx.MessageBox(message, caption="Message", style=wx.OK)</code></note>
 259             </notes>
 260             <methods>
 261                 <method name="__init__">
 262                     <args><arg>parent</arg><arg>message</arg><arg>caption="Message Box"</arg>
 263                           <arg>style=wx.OK | wx.Cancel</arg><arg>pos=wx.DefaultPosition</arg>
 264                     </args>
 265                     <styles>
 266                         <style>wx.CANCEL</style><style>wx.NO_DEFAULT</style><style>wx.OK</style><style>wx.YES_DEFAULT</style>
 267                         <style>wx.YES_NO</style><style>wx.ICON_ERROR</style><style>wx.ICON_EXCLAMATION</style><style>wx.ICON_HAND</style>
 268                         <style>wx.ICON_INFORMATION</style><style>wx.ICON_QUESTION</style>
 269                     </styles>
 270                 </method>
 271             </methods>
 272         </wxclass>
 273         <wxclass name="ProgressDialog">
 274             <methods>
 275                 <method name="__init__">
 276                     <args>
 277                         <arg>title</arg><arg>message</arg><arg>maximum=100</arg><arg>parent=None</arg>
 278                         <arg>style=wx.PD_AUTO_HIDE|wx.PD_APP_MODAL</arg>
 279                     </args>
 280                     <styles>
 281                         <style>wx.PD_APP_MODAL</style><style>wx.PD_AUTO_HIDE</style><style>wx.PD_SMOOTH</style>
 282                         <style>wx.PD_CAN_ABORD</style><style>wx.PD_CAN_SKIP</style><style>wx.PD_ELAPSED_TIME</style>
 283                         <style>wx.PD_ESTIMATED_TIME</style><style>wx.PD_REMAINING_TIME</style>
 284                     </styles>
 285                 </method>
 286                 <method name="Pulse">
 287                     <args><arg>newmsg=""</arg></args>
 288                     <notes><note>Returns (keep_going, skip)</note></notes>
 289                 </method>
 290                 <method name="Update">
 291                     <args><arg>value</arg><arg>newmsg=""</arg></args>
 292                     <notes><note>Returns (keep_going, skip)</note></notes>
 293                 </method>
 294             </methods>
 295         </wxclass>
 296 	</category>
 297 	<category name="Sizer">
 298 		<wxclass name="Sizer">
 299 			<description>The abstract parent wxclass for sizers.</description>
 300 			<methods>
 301 				<method name="__init__"></method>
 302 				<method name="Add">
 303 					<args>
 304 						<arg>item</arg>
 305 						<arg>proportion=0</arg>
 306 						<arg>flag=0</arg>
 307 						<arg>border=0</arg>
 308 						<arg>userData=None</arg>
 309 					</args>
 310 					<notes>
 311 						<note>'item' is a window, a sizer, or the dimensions of a spacer.</note>
 312                         <note>'proprotion' is the share of space taken if the item is set to EXPAND.</note>
 313                         <note>'border' is just the border width</note>
 314                         <note>border flags: wx.TOP/BOTTOM/LEFT/RIGHT/ALL</note>
 315                         <note>resize flags: wx.EXPAND(or GROW)/SHAPED. 'shaped' means 'expand with aspect ratio'</note>
 316                         <note>align flags: wx.ALIGN_CENTER/ALIGN_LEFT/ALIGN_RIGHT/ALIGN_TOP/ALIGN_BOTTOM/ALIGN_CENTER_VERTICAL/ALIGN_CENTER_HORIZONTAL</note>
 317 					</notes>
 318 				</method>
 319 				<method name="Fit">
 320 					<args>
 321 						<arg>window</arg>
 322 					</args>
 323 					<description>Resizes the window to the sizer's minimal size.</description>
 324 				</method>
 325 			</methods>
 326 		</wxclass>
 327 		<wxclass name="BoxSizer">
 328 			<description>Simple rows or columns.</description>
 329 			<methods>
 330 				<method name="__init__">
 331 					<args>
 332 						<arg>orient=wx.HORIZONTAL</arg>
 333 					</args>
 334 					<notes>
 335 						<note>orient may be wx.HORIZONTAL or wx.VERTICAL</note>
 336 					</notes>
 337 				</method>
 338 			</methods>
 339 		</wxclass>
 340 		<wxclass name="StaticBoxSizer">
 341 			<description>A <code>BoxSizer</code> with a static box around the sizer.</description>
 342 			<notes>
 343 				<note>The sizer owns the <code>StaticBox</code>.</note>
 344 			</notes>
 345 			<methods>
 346 				<method name="__init__">
 347 					<args>
 348 						<arg>box</arg>
 349 						<arg>orient=wx.HORIZONTAL</arg>
 350 					</args>
 351 				</method>
 352 			</methods>
 353 		</wxclass>
 354 		<wxclass name="GridSizer">
 355 			<description>Think calculator. Number pad. Ect.</description>
 356 			<notes>
 357 				<note>The width of all fields is the width of the widest child.</note>
 358 				<note>The height of all fields is the height of the tallest child.</note>
 359 			</notes>
 360 			<methods>
 361 				<method name="__init__">
 362 					<args>
 363 						<arg>rows=1</arg>
 364 						<arg>cols=0</arg>
 365 						<arg>vgap=0</arg>
 366 						<arg>hgap=0</arg>
 367 					</args>
 368 					<notes>
 369 						<note>If rows or cols is 0, it will be calculated dynamically.</note>
 370 					</notes>
 371 				</method>
 372 			</methods>
 373 		</wxclass>
 374 		<wxclass name="FlexGridSizer">
 375 			<description>Think table.</description>
 376 			<notes>
 377 				<note>Not all rows or columns are necessarily the same height or width.</note>
 378 			</notes>
 379 			<methods>
 380 				<method name="__init__">
 381 					<args>
 382 						<arg>rows=1</arg>
 383 						<arg>cols=0</arg>
 384 						<arg>vgap=0</arg>
 385 						<arg>hgap=0</arg>
 386 					</args>
 387 				</method>
 388 				<method name="AddGrowableCol">
 389 					<description>Specifies that column idx (starting from 0) should be grown if there is extra space available to the sizer. If all proportions are 0, then all columns are resized equally (instead of not being resized at all).</description>
 390 					<args>
 391 						<arg>idx</arg>
 392 						<arg>proportion=0</arg>
 393 					</args>
 394 				</method>
 395 				<method name="AddGrowableRow">
 396 					<description>As above.</description>
 397 				</method>
 398 			</methods>
 399 		</wxclass>
 400         <wxclass name="GridBagSizer">
 401             <description>Table with cells that can span multiple rows or cols.</description>
 402             <methods>
 403                 <method name="__init__">
 404                     <args>
 405                         <arg>vgap=0</arg>
 406                         <arg>hgap=0</arg>
 407                     </args>
 408                 </method>
 409                 <method name="Add">
 410                     <args>
 411                         <arg>item</arg>
 412                         <arg>pos</arg>
 413                         <arg>span=wx.DefaultSpan</arg>
 414                         <arg>flag=0</arg>
 415                         <arg>border=0</arg>
 416                         <arg>userData=None</arg>
 417                     </args>
 418                     <notes>
 419                         <note>to place a widget in the second row, first column and have it take up three rows and two columns, you would use the call <code>Add(widget, (1, 0), (3, 2))</code>.</note>
 420                     </notes>
 421                 </method>
 422             </methods>
 423         </wxclass>
 424 	</category>
 425 	<category name="Control">
 426         <wxclass name="Control">
 427             <description>Base class for all controls</description>
 428             <methods>
 429                 <method name="__init__">
 430                     <args>
 431                         <arg>parent</arg>
 432                         <arg>id=-1</arg>
 433                         <arg>pos=wx.DefaultPosition</arg>
 434                         <arg>size=wx.DefaultSize</arg>
 435                         <arg>style=0</arg>
 436                         <arg>validator=wx.DefaultValidator</arg>
 437                         <arg>name=wx.ControlNameStr</arg>
 438                     </args>
 439                 </method>
 440                 <method name="Command">
 441                     <description>Simulates the effect of the user issuing a command to the item.</description>
 442                     <args>
 443                         <arg>event</arg>
 444                     </args>
 445                 </method>
 446                 <method name="GetLabelText">
 447                     <description><code>wx.Window</code>'s <code>GetLabel</code> method will return the &amp; characters.</description>
 448                 </method>
 449             </methods>
 450         </wxclass>
 451 		<wxclass name="Button">
 452 			<events>
 453 				<event>wx.EVT_BUTTON</event>
 454 			</events>
 455 			<methods>
 456 				<method name="__init__">
 457 					<args>
 458 						<arg>parent</arg>
 459 						<arg>id=-1</arg>
 460 						<arg>label=EmptyString</arg>
 461 						<arg>pos=wx.DefaultPosition</arg>
 462 						<arg>size=wx.DefaultSize</arg>
 463 						<arg>style=0</arg>
 464 						<arg>validator=wx.DefaultValidator</arg>
 465 						<arg>name=wx.ButtonNameStr</arg>
 466 					</args>
 467 					<styles>
 468 						<style>wx.BU_LEFT</style>
 469 						<style>wx.BU_TOP</style>
 470 						<style>wx.BU_RIGHT</style>
 471 						<style>wx.BU_BOTTOM</style>
 472 						<style>wx.BU_EXACTFICT</style>
 473 					</styles>
 474 					<notes>
 475 						<note>Preferred creation method is to use a standard ID and an empty label. See the list of <a href="http://docs.wxwidgets.org/stable/wx_stockitems.html">Stock IDs</a> at wxWidgets.</note>
 476 					</notes>
 477 				</method>
 478 			</methods>
 479 		</wxclass>      
 480         <wxclass name="ToggleButton">
 481             <events><event>wx.EVT_TOGGLEBUTTON</event></events>
 482             <notes>
 483                 <note>"Value" refers to the boolean value of the button's state.</note>
 484             </notes>
 485             <methods>
 486                 <method name="GetValue"></method>
 487                 <method name="SetValue"><args><arg>value</arg></args></method>
 488             </methods>
 489         </wxclass>
 490         <wxclass name="RadioButton"></wxclass>
 491         <wxclass name="CheckBox">
 492             <events><event>wx.EVT_CHECKBOX</event></events>
 493             <methods>
 494                 <method name="__init__">
 495                     <styles><style>wx.ALIGN_RIGHT</style></styles>
 496                     <args>
 497                         <arg>parent</arg><arg>id=-1</arg><arg>label=""</arg><arg>pos=wx.DefaultPosition</arg>
 498                         <arg>size=wx.DefaultSize</arg><arg>style=0</arg><arg>validator=wx.DefaultValidator</arg>
 499                         <arg>name=wx.CheckBoxNameStr</arg>
 500                     </args>
 501                 </method>
 502                 <method name="GetValue"></method>
 503                 <method name="IsChecked"></method>
 504                 <method name="SetValue"><args><arg>state</arg></args></method>
 505             </methods>
 506         </wxclass>    
 507         <wxclass name="RadioBox"></wxclass>
 508         <wxclass name="StaticBitmap">
 509             <description>Meant for the display of small icons.</description>
 510             <notes>
 511                 <note>Under Windows 9x the size of bitmap is limited to 64*64 pixels</note>
 512             </notes>
 513             <methods>
 514                 <method name="__init__">
 515                     <args>
 516                         <arg>parent</arg>
 517                         <arg>id=-1</arg>
 518                         <arg>bitmap=wx.NullBitmap</arg>
 519                         <arg>pos=wx.DefaultPosition</arg>
 520                         <arg>size=wx.DefaultSize</arg>
 521                         <arg>style=0</arg>
 522                         <arg>name=wx.StaticBitmapNameStr</arg>
 523                     </args>
 524                 </method>
 525                 <method name="GetBitmap"></method>
 526                 <method name="SetBitmap"><args><arg>bitmap</arg></args></method>
 527             </methods>
 528         </wxclass>
 529         <wxclass name="StaticPicture"></wxclass>
 530         <wxclass name="StaticText">
 531             <notes>
 532                 <note>Inherits <code>GetLabel</code> and <code>SetLabel</code> from Window.</note>
 533             </notes>
 534             <methods>
 535                 <method name="__init__">
 536                     <args>
 537                         <arg>parent</arg>
 538                         <arg>id=-1</arg>
 539                         <arg>label=EmptyString</arg>
 540                         <arg>pos=wx.DefaultPosition</arg>
 541                         <arg>size=wx.DefaultSize</arg>
 542                         <arg>style=0</arg>
 543                         <arg>name=StaticTextNameStr</arg>
 544                     </args>
 545                 </method>
 546                 <method name="GetLabel"></method>
 547                 <method name="SetLabel"><args><arg>label</arg></args></method>
 548                 <method name="Wrap">
 549                     <args>
 550                         <arg>width</arg>
 551                     </args>
 552                 </method>
 553             </methods>
 554         </wxclass>
 555 		<wxclass name="TextCtrl">
 556 			<description>Uses <code>\n</code> to seperate lines. Never use the indices returned by a multiline <code>wx.TextCtrl</code> as indices into the string it contains, but only as arguments to be passed back to the other <code>wx.TextCtrl</code> methods.</description>
 557 			<events>
 558 				<event>wx.EVT_TEXT</event>
 559 				<event>wx.EVT_CHAR</event>
 560 				<event>wx.EVT_TEXT_ENTER</event>
 561 				<event>wx.EVT_TEXT_URL</event>
 562 				<event>wx.EVT_TEXT_MAXLEN</event>
 563 			</events>
 564 			<methods>
 565 				<method name="__init__">
 566 					<args>
 567 						<arg>parent</arg>
 568 						<arg>id=-1</arg>
 569 						<arg>value=""</arg>
 570 						<arg>pos=wx.DefaultPosition</arg>
 571 						<arg>size=wx.DefaultSize</arg>
 572 						<arg>style=0</arg>
 573 						<arg>validator=DefaultValidator</arg>
 574 						<arg>name=wx.TextCtrlNameStr</arg>
 575 					</args>
 576 					<styles>
 577 						<style>wx.TE_PROCESS_ENTER</style>
 578 						<style>wx.TE_PROCESS_TAB</style>
 579 						<style>wx.TE_MULTILINE</style>
 580 						<style>wx.TE_PASSWORD</style>
 581 						<style>wx.TE_READONLY</style>
 582 						<style>wx.TE_LEFT</style>
 583 						<style>wx.TE_CENTRE</style>
 584 						<style>wx.TE_RIGHT</style>
 585 						<style>wx.TE_DONTWRAP</style>
 586 						<style>wx.TE_BESTWRAP</style>
 587 					</styles>
 588 				</method>
 589                 <method name="SetMaxLength">
 590                     <description>Limit the number of input characters.</description>
 591                     <args>
 592                         <arg>len</arg>
 593                     </args>
 594                 </method>
 595                 <method name="GetValue">
 596                     <notes>
 597                         <note>If multiline, string uses <code>\n</code>, not <code>\r\n</code>.</note>
 598                     </notes>
 599                 </method>
 600                 <method name="ChangeValue"><args><arg>value</arg></args></method>
 601 			</methods>
 602 		</wxclass>
 603         <wxclass name="Gauge">
 604             <description>A progress bar.</description>
 605             <methods>
 606                 <method name="__init__">
 607                     <args>
 608                         <arg>parent</arg><arg>id=-1</arg><arg>range=100</arg>
 609                         <arg>pos=wx.DefaultPosition</arg><arg>size=wx.DefaultSize</arg>
 610                         <arg>style=wx.GA_HORIZONTAL</arg><arg>validator=wx.DefaultValidator</arg>
 611                         <arg>name=wx.GaugeNameStr</arg>
 612                     </args>
 613                     <styles>
 614                         <style>wx.GA_HORIZONTAL</style>
 615                         <style>wx.GA_VERTICAL</style>
 616                     </styles>
 617                 </method>
 618                 <method name="Pulse">
 619                     <description>Each call pulses it a bit. See wx.Timer</description>
 620                 </method>
 621                 <method name="SetRange"><args><arg>range</arg></args></method>
 622                 <method name="SetValue"><args><arg>pos</arg></args></method>
 623                 <method name="GetRange"></method><method name="GetValue"></method>
 624             </methods>
 625         </wxclass>
 626         <wxclass name="RichTextCtrl"></wxclass>
 627         <wxclass name="ListCtrl"></wxclass>
 628         <wxclass name="TreeCtrl"></wxclass>
 629 	</category>
 630     <category name="ItemContainer(Control)">
 631         <wxclass name="ItemContainer">
 632             <description>Abstract parent of ListBox, CheckListBox, Choice, and ComboBox</description>
 633             <methods>
 634                 <method name="FindString"><args><arg>s</arg></args></method>
 635                 <method name="GetSelection"><description>Returns integer or <code>wx.NOT_FOUND</code>. You kept a reference to the list, right?</description></method>
 636                 <method name="GetStringSelection"><description>List? What list?</description></method>
 637                 <method name="SetSelection"><args><arg>n</arg><arg>select=True</arg></args></method>
 638                 <method name="SetStringSelection"><args><arg>string</arg></args></method>
 639             </methods>
 640         </wxclass>
 641         <wxclass name="Choice">
 642             <description>A pulldown menu.</description>
 643             <events>
 644                 <event>wx.EVT_CHOICE</event>
 645             </events>
 646             <methods>
 647                 <method name="__init__">
 648                     <args>
 649                         <arg>parent</arg>
 650                         <arg>id</arg>
 651                         <arg>pos=wx.DefaultPosition</arg>
 652                         <arg>size=wx.DefaultSize</arg>
 653                         <arg>choices=[]</arg>
 654                         <arg>style=0</arg>
 655                         <arg>validator=wx.DefaultValidator</arg>
 656                         <arg>name=wx.ChoiceNameStr</arg>
 657                     </args>
 658                     <notes>
 659                         <note>I don't know why there is no default value (-1) for id.</note>
 660                     </notes>
 661                 </method>
 662                 <method name="GetSelection">
 663                     <description>Returns the last selected value.</description>
 664                 </method>
 665                 <method name="GetCurrentSelection">
 666                     <description>Returns the currently selected option in the drop-down.</description>
 667                 </method>
 668             </methods>
 669         </wxclass>
 670         <wxclass name="ListBox">
 671             <description>An <code>ItemContainer</code>.</description>
 672             <events>
 673                 <event>wx.EVT_LISTBOX(id, func) / wx.wxEVT_COMMAND_LISTBOX_SELECTED</event>
 674                 <event>wx.EVT_LISTBOX_DCLICK(id, func) / wx.wxEVT_COMMAND_LISTBOX_DOUBLECLICKED</event>
 675             </events>
 676             <methods>
 677                 <method name="__init__">
 678                     <args>
 679                         <arg>parent</arg>
 680                         <arg>id=-1</arg>
 681                         <arg>pos=wx.DefaultPosition</arg>
 682                         <arg>size=wx.DefaultSize</arg>
 683                         <arg>choices=[]</arg>
 684                         <arg>style=0</arg>
 685                         <arg>validator=wx.DefaultValidator</arg>
 686                         <arg>name=wx.ListBoxNameStr</arg>
 687                     </args>
 688                     <styles>
 689                         <style>wx.LB_SINGLE</style>
 690                         <style>wx.LB_MULTIPLE</style>
 691                         <style>wx.LB_EXTENDED</style>
 692                         <style>wx.LB_HSCROLL</style>
 693                         <style>wx.LB_ALWAYS_SB</style>
 694                         <style>wx.LB_NEEDED_LB</style>
 695                         <style>wx.LB_SORT</style>
 696                     </styles>
 697                 </method>
 698                 <method name="AppendAndEnsureVisible"><args><arg>s</arg></args></method>
 699                 <method name="Deselect"><args><arg>n</arg></args></method>
 700                 <method name="DeselectAll"><args><arg>itemToLeaveSelected=-1</arg></args></method>
 701                 <method name="EnsureVisible"><args><arg>n</arg></args></method>
 702                 <method name="GetSelections"><description>Returns list of integers</description></method>
 703                 <method name="InsertItems"><args><arg>items</arg><arg>pos</arg></args></method>
 704                 <method name="IsSelected"><args><arg>n</arg></args></method>
 705                 <method name="Set"><args><arg>s</arg></args><description>Clears and sets strings</description></method>
 706                 <method name="SetItemBackgroundColour"><args><arg>item</arg><arg>c</arg></args></method>
 707                 <method name="SetItemFont"><args><arg>item</arg><arg>f</arg></args></method>
 708                 <method name="SetItemForegroundColour"><args><arg>item</arg><arg>c</arg></args></method>
 709             </methods>
 710         </wxclass>
 711     </category>
 712 	<category name="Event">
 713 		<wxclass name="EvtHandler">
 714 			<description>All windows (and therefore controls) are event handlers.</description>
 715 			<notes>
 716 				<note>When events are received, <code>wx.EvtHandler</code> invokes the method listed in the event table using itself as the object.</note>
 717 			</notes>
 718 			<methods>
 719 				<method name="Bind">
 720 					<args>
 721 						<arg>event</arg>
 722 						<arg>handler</arg>
 723 						<arg>source</arg>
 724 						<arg>id1=1</arg>
 725 						<arg>id2=-1</arg>
 726 					</args>
 727 					<notes>
 728 						<note>event: One of the wx.EVT_* objects that specifies the type of event to bind.</note>
 729 						<note>handler: the function to call when the event is delivered to self.</note>
 730 						<note>source: the object (control) that generated the event.</note>
 731 					</notes>
 732 				</method>
 733 			</methods>
 734 		</wxclass>
 735 		<wxclass name="Event">
 736 			<description>Abstract parent of all events.</description>
 737 			<methods>
 738 				<method name="__init__">
 739 					<args>
 740 						<arg>id=0</arg>
 741 						<arg>eventType=wx.wxEVT_NULL</arg>
 742 					</args>
 743 				</method>
 744 				<method name="GetEventType"></method>
 745 			</methods>
 746 		</wxclass>
 747         <wxclass name="ActivateEvent">
 748             <events>
 749                 <event>wx.EVT_ACTIVATE</event>
 750                 <event>wx.EVT_ACTIVATE_APP</event>
 751             </events>
 752             <description>Sent when top-level window or entire application activated or deactivated.</description>
 753             <notes>
 754                 <note>Don't confuse this with <code>wx.FocusEvent</code>.</note>
 755                 <note>Calling <code>event.Skip()</code> when handling is a good idea.</note>
 756             </notes>
 757             <methods>
 758                 <method name="GetActive">
 759                     <description>Returns true when activated.</description>
 760                 </method>
 761             </methods>
 762         </wxclass>
 763         <wxclass name="CloseEvent"></wxclass>
 764         <wxclass name="CommandEvent"></wxclass>
 765         <wxclass name="MouseEvent"></wxclass>
 766         <wxclass name="MenuEvent"></wxclass>
 767         <wxclass name="IdleEvent"></wxclass>
 768         <wxclass name="PaintEvent"></wxclass>
 769         <wxclass name="ShowEvent"></wxclass>
 770     </category>
 771     <category name="Font">
 772 		<wxclass name="Font">
 773 			<methods>
 774 				<method name="__init__">
 775 					<args>
 776 						<arg>pointSize</arg>
 777 						<arg>family</arg>
 778 						<arg>style</arg>
 779 						<arg>weight</arg>
 780 						<arg>underline</arg>
 781 					</args>
 782 					<notes>
 783 						<note>See constructor for family and weight constants</note>
 784 					</notes>
 785 				</method>
 786 			</methods>
 787 		</wxclass>
 788 	</category>
 789     <category name="Image">
 790         <wxclass name="Image">
 791             <description>Can be loaded from file but not drawn to a <code>wx.DC</code></description>
 792             <notes><note>Use <code>ConvertToBitmap</code> method to draw to a <code>wx.DC</code></note></notes>
 793             <methods>
 794                 <method name="__init__">
 795                     <args>
 796                         <arg>name</arg>
 797                         <arg>type=wx.BITMAP_TYPE_ANY</arg>
 798                         <arg>index=-1</arg>
 799                     </args>
 800                     <notes>
 801                         <note>name is the filename</note>
 802                         <note>index is for multipage gif, ico, or tifs</note>
 803                     </notes>
 804                 </method>
 805                 <method name="CanRead"></method>
 806                 <method name="LoadFile">
 807                     <args>
 808                         <arg>name</arg><arg>type</arg><arg>index</arg>
 809                     </args>
 810                 </method>
 811                 <method name="SaveFile"><args><arg>name</arg><arg>type</arg></args></method>
 812                 <method name="Ok"></method>
 813                 <method name="Copy"></method>
 814                 <method name="ConvertToBitmap">
 815                     <args><arg>depth=?samedepth?</arg></args>
 816                     <notes><note>The docs don't show it, but 'depth' is optional</note></notes>
 817                 </method>
 818                 <method name="GetData">
 819                     <description>Returns a string of the RGB bytes of the image.</description>
 820                 </method>
 821                 <method name="SetData"><args><arg>str</arg></args></method>
 822                 <method name="GetSize"></method>
 823                 <method name="Rescale">
 824                     <args>
 825                         <arg>width</arg><arg>height</arg>
 826                         <arg>quality=wx.IMAGE_QUALITY_NORMAL</arg>
 827                     </args>
 828                     <notes><note>Returns a new <code>wx.Image</code></note></notes>
 829                 </method>
 830                 <method name="GetSubImage"><args><arg>rect</arg></args></method>
 831                 <method name="Resize">
 832                     <args>
 833                         <arg>size</arg><arg>pos</arg>
 834                         <arg>red=-1</arg><arg>green=-1</arg><arg>blue=-1</arg>
 835                     </args>
 836                 </method>
 837             </methods>
 838         </wxclass>
 839         <wxclass name="Bitmap">
 840             <methods><method name="ConvertToImage"></method></methods>
 841         </wxclass>
 842     </category>
 843     <category name="DC">
 844         <wxclass name="DC"></wxclass>
 845         <wxclass name="BufferedDC"></wxclass>
 846         <wxclass name="MemoryDC"></wxclass>
 847     </category> 
 848 </xwPython-CheatSheet>

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2013-07-14 17:57:12, 33.3 KB) [[attachment:cheat_sheet.xml]]
  • [get | view] (2013-07-09 15:32:33, 6.8 KB) [[attachment:models.py]]
  • [get | view] (2013-07-14 17:56:55, 5.4 KB) [[attachment:xml_parser.py]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.

NOTE: To edit pages in this wiki you must be a member of the TrustedEditorsGroup.