]> git.saurik.com Git - wxWidgets.git/commitdiff
Added demo for Stock Buttons
authorRobin Dunn <robin@alldunn.com>
Wed, 1 Sep 2004 23:26:51 +0000 (23:26 +0000)
committerRobin Dunn <robin@alldunn.com>
Wed, 1 Sep 2004 23:26:51 +0000 (23:26 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29002 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

wxPython/demo/Main.py
wxPython/demo/StockButtons.py [new file with mode: 0644]

index 8fe436f9948a3a657a12c38f98657715f1c0ed86..21f66b777b34e2d48bed15f274715000a70560c7 100644 (file)
@@ -47,6 +47,7 @@ import images
 _treeList = [
     # new stuff
     ('Recent Additions/Updates', [
+        'StockButtons',
         'Ticker',
         ]),
 
diff --git a/wxPython/demo/StockButtons.py b/wxPython/demo/StockButtons.py
new file mode 100644 (file)
index 0000000..f65062c
--- /dev/null
@@ -0,0 +1,108 @@
+
+import wx 
+
+#----------------------------------------------------------------------
+
+
+stockIDs = [
+    wx.ID_ADD,
+    wx.ID_APPLY,
+    wx.ID_BOLD,
+    wx.ID_CANCEL,
+    wx.ID_CLEAR,
+    wx.ID_CLOSE,
+    wx.ID_COPY,
+    wx.ID_CUT,
+    wx.ID_DELETE,
+    wx.ID_FIND,
+    wx.ID_REPLACE,
+    wx.ID_BACKWARD,
+    wx.ID_DOWN,
+    wx.ID_FORWARD,
+    wx.ID_UP,
+    wx.ID_HELP,
+    wx.ID_HOME,
+    wx.ID_INDENT,
+    wx.ID_INDEX,
+    wx.ID_ITALIC,
+    wx.ID_JUSTIFY_CENTER,
+    wx.ID_JUSTIFY_FILL,
+    wx.ID_JUSTIFY_LEFT,
+    wx.ID_JUSTIFY_RIGHT,
+    wx.ID_NEW,
+    wx.ID_NO,
+    wx.ID_OK,
+    wx.ID_OPEN,
+    wx.ID_PASTE,
+    wx.ID_PREFERENCES,
+    wx.ID_PRINT,
+    wx.ID_PREVIEW,
+    wx.ID_PROPERTIES,
+    wx.ID_EXIT,
+    wx.ID_REDO,
+    wx.ID_REFRESH,
+    wx.ID_REMOVE,
+    wx.ID_REVERT_TO_SAVED,
+    wx.ID_SAVE,
+    wx.ID_SAVEAS,
+    wx.ID_STOP,
+    wx.ID_UNDELETE,
+    wx.ID_UNDERLINE,
+    wx.ID_UNDO,
+    wx.ID_UNINDENT,
+    wx.ID_YES,
+    wx.ID_ZOOM_100,
+    wx.ID_ZOOM_FIT,
+    wx.ID_ZOOM_IN,
+    wx.ID_ZOOM_OUT,
+
+    ]
+
+class TestPanel(wx.Panel):
+    def __init__(self, parent, log):
+        self.log = log
+        wx.Panel.__init__(self, parent, -1)
+
+        sizer = wx.FlexGridSizer(cols=5, hgap=4, vgap=4)
+        for ID in stockIDs:
+            b = wx.Button(self, ID)
+            sizer.Add(b)
+
+        self.SetSizer(sizer)
+        
+
+#----------------------------------------------------------------------
+
+def runTest(frame, nb, log):
+    win = TestPanel(nb, log)
+    return win
+
+#----------------------------------------------------------------------
+
+
+
+overview = """<html><body>
+<h2><center>Stock Buttons</center></h2>
+
+It is now possible to create \"stock\" buttons.  Basically this means
+that you only have to provide one of the stock IDs (and an empty
+label) when creating the button and wxWidgets will choose the stock
+label to go with it automatically.  Additionally on the platforms that
+have a native concept of a stock button (currently only GTK2) then the
+native stock button will be used.
+
+<p>This sample shows buttons for all of the currenlty available stock
+IDs.  Notice that when the button is created that no label is given,
+and compare that with the button that is created.
+
+
+</body></html>
+"""
+
+
+
+if __name__ == '__main__':
+    import sys,os
+    import run
+    run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])
+