/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/UI/mainwindow.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/Thuban/UI/mainwindow.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 188 by bh, Tue May 28 12:38:45 2002 UTC revision 191 by bh, Tue May 28 16:04:49 2002 UTC
# Line 54  class MainWindow(wxFrame): Line 54  class MainWindow(wxFrame):
54    
55          self.init_ids()          self.init_ids()
56    
57          #main_menu.print_menu()          # creat the menubar from the main_menu description
58          self.SetMenuBar(self.build_menu_bar(main_menu))          self.SetMenuBar(self.build_menu_bar(main_menu))
59    
60          # toolbar          # Similarly, create the toolbar from main_toolbar
61          toolbar = self.CreateToolBar(wxTB_3DBUTTONS)          toolbar = self.build_toolbar(main_toolbar)
   
         # set the size of the tools' bitmaps. Not needed on wxGTK, but  
         # on Windows. We probably shouldn't hardwire the bitmap size  
         # here  
         toolbar.SetToolBitmapSize(wxSize(24, 24))  
   
         for name in ["map_zoom_in_tool", "map_zoom_out_tool", "map_pan_tool",  
                      "map_identify_tool", "map_label_tool", "map_full_extent"]:  
             self.add_toolbar_command(toolbar, name)  
62          # call Realize to make sure that the tools appear.          # call Realize to make sure that the tools appear.
63          toolbar.Realize()          toolbar.Realize()
64    
# Line 130  class MainWindow(wxFrame): Line 121  class MainWindow(wxFrame):
121              last = item              last = item
122          return wxmenu          return wxmenu
123    
124        def build_toolbar(self, toolbardesc):
125            """Build and return the main toolbar window from a toolbar description
126    
127            The parameter should be an instance of the Menu class but it
128            should not contain submenus.
129            """
130            toolbar = self.CreateToolBar(wxTB_3DBUTTONS)
131    
132            # set the size of the tools' bitmaps. Not needed on wxGTK, but
133            # on Windows, although it doesn't work very well there. It seems
134            # that only 16x16 icons are really supported on windows.
135            # We probably shouldn't hardwire the bitmap size here.
136            toolbar.SetToolBitmapSize(wxSize(24, 24))
137    
138            for item in toolbardesc.items:
139                if item is None:
140                    toolbar.AddSeparator()
141                else:
142                    # assume it's a string.
143                    self.add_toolbar_command(toolbar, item)
144    
145            return toolbar
146    
147      def add_menu_command(self, menu, name):      def add_menu_command(self, menu, name):
148          """Add the command with name name to the menu menu.          """Add the command with name name to the menu menu.
149    
# Line 592  main_menu = Menu("<main>", "<main>", Line 606  main_menu = Menu("<main>", "<main>",
606                          "layer_show_table"]),                          "layer_show_table"]),
607                    Menu("help", "&Help",                    Menu("help", "&Help",
608                         ["help_about"])])                         ["help_about"])])
609    
610    # the main toolbar
611    
612    main_toolbar = Menu("<toolbar>", "<toolbar>",
613                        ["map_zoom_in_tool", "map_zoom_out_tool", "map_pan_tool",
614                         "map_identify_tool", "map_label_tool", "map_full_extent"])

Legend:
Removed from v.188  
changed lines
  Added in v.191

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26