Changeset 4753fc2 in sasview


Ignore:
Timestamp:
Feb 2, 2011 2:43:57 PM (13 years ago)
Author:
Gervaise Alina <gervyh@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
52725d6
Parents:
2096e78
Message:

update dummy example

Location:
guiframe
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • guiframe/dummyapp.py

    rd955bf19 r4753fc2  
    44""" 
    55import gui_manager 
     6from sans.guiframe.gui_style import GUIFRAME 
     7from sans.guiframe.plugin_base import PluginBase 
    68 
    7 class TestPlugin(gui_manager.Plugin): 
     9class DummyView(gui_manager.ViewApp): 
     10    """ 
     11    """ 
     12    PROG_SPLASH_PATH = None 
     13    STYLE = GUIFRAME.SINGLE_APPLICATION 
    814     
    9     def populate_menu(self, id, parent): 
     15class TestPlugin(PluginBase): 
     16     
     17    def populate_menu(self, parent): 
    1018        """ 
    1119        Create and return the list of application menu 
    1220        items for the plug-in.  
    13          
    14         :param id: deprecated. Un-used. 
    1521        :param parent: parent window 
    1622         
     
    3238     
    3339        # Returns the menu and a name for it. 
    34         return [(id, plug_menu, "DummyApp")]     
     40        return [(plug_menu, "DummyApp")]     
    3541     
    3642    def get_panels(self, parent): 
     
    103109        Initialization 
    104110        """ 
    105         self.gui = gui_manager.ViewApp(0) 
     111        self.gui = DummyView(0) 
    106112         
    107113        fitting_plug = TestPlugin() 
  • guiframe/gui_manager.py

    r3385795 r4753fc2  
    5353GUIFRAME_WIDTH = 1000 
    5454GUIFRAME_HEIGHT = 800 
     55PROG_SPLASH_SCREEN = "images/danse_logo.png"  
    5556 
    5657class ViewerFrame(wx.Frame): 
     
    6061     
    6162    def __init__(self, parent, title,  
    62                  size=(GUIFRAME_WIDTH,GUIFRAME_HEIGHT), 
     63                 size=(GUIFRAME_WIDTH, GUIFRAME_HEIGHT), 
    6364                 gui_style=GUIFRAME.DEFAULT_STYLE,  
    6465                 pos=wx.DefaultPosition): 
     
    581582            for (menu, name) in self._plotting_plugin.populate_menu(self): 
    582583                self._window_menu.AppendSubMenu(menu, name) 
    583         self._window_menu.AppendSeparator() 
    584584        self._menubar.Append(self._window_menu, '&Window') 
    585585      
     
    590590            wx.EVT_MENU(self, id, self.show_data_panel) 
    591591             
    592         id = wx.NewId() 
    593         preferences_menu = wx.Menu() 
    594         hint = "Plot panels will floating" 
    595         preferences_menu.Append(id, '&Floating Plot Panel', hint) 
    596         wx.EVT_MENU(self, id, self.set_plotpanel_floating) 
    597         id = wx.NewId() 
    598         hint = "Plot panels will displayed within the frame" 
    599         preferences_menu.Append(id, '&Fixed Plot Panel', hint) 
    600         wx.EVT_MENU(self, id, self.set_plotpanel_fixed) 
    601         id = wx.NewId() 
    602         self._window_menu.AppendSubMenu(preferences_menu,'&Preferences') 
     592        style = self.__gui_style & GUIFRAME.PLOTTING_ON 
     593        if style == GUIFRAME.PLOTTING_ON: 
     594            self._window_menu.AppendSeparator() 
     595            id = wx.NewId() 
     596            preferences_menu = wx.Menu() 
     597            hint = "Plot panels will floating" 
     598            preferences_menu.Append(id, '&Floating Plot Panel', hint) 
     599            wx.EVT_MENU(self, id, self.set_plotpanel_floating) 
     600            id = wx.NewId() 
     601            hint = "Plot panels will displayed within the frame" 
     602            preferences_menu.Append(id, '&Fixed Plot Panel', hint) 
     603            wx.EVT_MENU(self, id, self.set_plotpanel_fixed) 
     604            id = wx.NewId() 
     605            self._window_menu.AppendSubMenu(preferences_menu,'&Preferences') 
    603606        #wx.EVT_MENU(self, id, self.show_preferences_panel)    
    604607        """ 
     
    670673        wx.EVT_MENU(self, data_file_id, self._load_data) 
    671674        style = self.__gui_style & GUIFRAME.MULTIPLE_APPLICATIONS 
    672         style1 = self.__gui_style & GUIFRAME.SINGLE_APPLICATION 
     675        style1 = self.__gui_style & GUIFRAME.DATALOADER_ON 
    673676        if style == GUIFRAME.MULTIPLE_APPLICATIONS: 
    674677            #menu for data from folder 
     
    679682            wx.EVT_MENU(self, data_folder_id, self._load_folder) 
    680683            self._menubar.Append(self._data_menu, '&Data') 
    681         elif style1 == GUIFRAME.SINGLE_APPLICATION: 
     684        elif style1 == GUIFRAME.DATALOADER_ON: 
    682685            self._menubar.Append(self._data_menu, '&Data') 
    683686         
     
    12361239    CENTER_PANE = True 
    12371240 
    1238 PROG_SPLASH_SCREEN = "images/danse_logo.png"  
     1241 
    12391242# Toy application to test this Frame 
    12401243class ViewApp(wx.App): 
Note: See TracChangeset for help on using the changeset viewer.