Index: guiframe/data_panel.py
===================================================================
--- guiframe/data_panel.py	(revision 60fff67d87828caa340f66bfd44041f38871a09f)
+++ guiframe/data_panel.py	(revision adf44c254b67e1c8c055878d09f38a535dfc51b0)
@@ -49,7 +49,10 @@
 PLUGINS_WLIST = config.PLUGINS_WLIST
 APPLICATION_WLIST = config.APPLICATION_WLIST
-
-PANEL_WIDTH = 235
-PANEL_HEIGHT = 700
+try:
+    PANEL_WIDTH = config.DATA_PANEL_WIDTH
+    PANEL_HEIGHT = config.DATA_PANEL_HEIGHT
+except:
+    PANEL_WIDTH = 235
+    PANEL_HEIGHT = 700
 CBOX_WIDTH = 140
 BUTTON_WIDTH = 80
Index: guiframe/gui_manager.py
===================================================================
--- guiframe/gui_manager.py	(revision 60fff67d87828caa340f66bfd44041f38871a09f)
+++ guiframe/gui_manager.py	(revision adf44c254b67e1c8c055878d09f38a535dfc51b0)
@@ -17,18 +17,38 @@
 import xml
 
+
+# Try to find a local config
+import imp
+path = os.getcwd()
+if(os.path.isfile("%s/%s.py" % (path, 'local_config'))) or \
+    (os.path.isfile("%s/%s.pyc" % (path, 'local_config'))):
+    fObj, path_config, descr = imp.find_module('local_config', [path])
+    try:
+        config = imp.load_module('local_config', fObj, path_config, descr) 
+    except:
+        # Didn't find local config, load the default 
+        import config
+    finally:
+        if fObj:
+            fObj.close()
+else:
+    # Try simply importing local_config
+    import local_config as config
+PATH_APP = path
+#import compileall
+import py_compile
+c_name = os.path.join(path, 'custom_config.py')
+if(os.path.isfile("%s/%s.py" % (path, 'custom_config'))):
+    py_compile.compile(file=c_name)
+    #compileall.compile_dir(dir=path, force=True, quiet=0)
+    cfObj, path_cconfig, descr = imp.find_module('custom_config', [path]) 
 try:
-    # Try to find a local config
-    import imp
-    path = os.getcwd()
-    if(os.path.isfile("%s/%s.py" % (path, 'local_config'))) or \
-        (os.path.isfile("%s/%s.pyc" % (path, 'local_config'))):
-        fObj, path, descr = imp.find_module('local_config', [path])
-        config = imp.load_module('local_config', fObj, path, descr)  
-    else:
-        # Try simply importing local_config
-        import local_config as config
+    custom_config = imp.load_module('custom_config', cfObj, path_cconfig, descr)
 except:
-    # Didn't find local config, load the default 
-    import config
+    custom_config = None
+finally:
+    if cfObj:
+        cfObj.close()
+
     
 import warnings
@@ -56,13 +76,36 @@
 APPLICATION_NAME = config.__appname__
 SPLASH_SCREEN_PATH = config.SPLASH_SCREEN_PATH
-DEFAULT_STYLE = config.DEFAULT_STYLE
+
 SPLASH_SCREEN_WIDTH = config.SPLASH_SCREEN_WIDTH
 SPLASH_SCREEN_HEIGHT = config.SPLASH_SCREEN_HEIGHT
 SS_MAX_DISPLAY_TIME = config.SS_MAX_DISPLAY_TIME
-PLOPANEL_WIDTH = config.PLOPANEL_WIDTH
+
+try:
+    DATALOADER_SHOW = custom_config.DATALOADER_SHOW
+    TOOLBAR_SHOW = custom_config.TOOLBAR_SHOW
+    FIXED_PANEL = custom_config.FIXED_PANEL
+    WELCOME_PANEL_SHOW = custom_config.WELCOME_PANEL_SHOW
+    PLOPANEL_WIDTH = custom_config.PLOPANEL_WIDTH
+    DATAPANEL_WIDTH = custom_config.DATAPANEL_WIDTH
+    GUIFRAME_WIDTH = custom_config.GUIFRAME_WIDTH 
+    GUIFRAME_HEIGHT = custom_config.GUIFRAME_HEIGHT
+    DEFAULT_PERSPECTIVE = custom_config.DEFAULT_PERSPECTIVE
+except:
+    DATALOADER_SHOW = True
+    TOOLBAR_SHOW = True
+    FIXED_PANEL = True
+    WELCOME_PANEL_SHOW = False
+    PLOPANEL_WIDTH = config.PLOPANEL_WIDTH
+    DATAPANEL_WIDTH = config.DATAPANEL_WIDTH
+    GUIFRAME_WIDTH = config.GUIFRAME_WIDTH 
+    GUIFRAME_HEIGHT = config.GUIFRAME_HEIGHT
+    DEFAULT_PERSPECTIVE = None
+
+DEFAULT_STYLE = config.DEFAULT_STYLE
+
+
+
 PLOPANEL_HEIGTH = config.PLOPANEL_HEIGTH
-GUIFRAME_WIDTH = config.GUIFRAME_WIDTH 
-GUIFRAME_HEIGHT = config.GUIFRAME_HEIGHT
-DATAPANEL_WIDTH = 235
+DATAPANEL_HEIGHT = config.DATAPANEL_HEIGHT
 PLUGIN_STATE_EXTENSIONS =  config.PLUGIN_STATE_EXTENSIONS
 extension_list = []
@@ -87,5 +130,5 @@
     def __init__(self, parent, title, 
                  size=(GUIFRAME_WIDTH, GUIFRAME_HEIGHT),
-                 gui_style=GUIFRAME.DEFAULT_STYLE, 
+                 gui_style=DEFAULT_STYLE, 
                  pos=wx.DefaultPosition):
         """
@@ -99,5 +142,4 @@
         self._window_width, self._window_height = size
         self.__gui_style = gui_style
-        
         # Logging info
         logging.basicConfig(level=logging.DEBUG,
@@ -120,5 +162,5 @@
                 if os.path.isfile(ico_file):
                     self.SetIcon(wx.Icon(ico_file, wx.BITMAP_TYPE_ICO))
-        
+        self.path = PATH_APP
         ## Application manager
         self._input_file = None
@@ -193,5 +235,43 @@
         self.Bind(EVT_NEW_LOAD_DATA, self.on_load_data)
         
-        
+        self.setup_custom_conf()
+    
+    def setup_custom_conf(self):
+        """
+        Set up custom configuration if exists
+        """
+        if custom_config == None:
+            return
+        
+        if not FIXED_PANEL:
+            self.__gui_style &= (~GUIFRAME.FIXED_PANEL)
+            self.__gui_style |= GUIFRAME.FLOATING_PANEL
+
+        if not DATALOADER_SHOW:
+            self.__gui_style &= (~GUIFRAME.MANAGER_ON)
+
+        if not TOOLBAR_SHOW:
+            self.__gui_style &= (~GUIFRAME.TOOLBAR_ON)
+
+        if WELCOME_PANEL_SHOW:
+            self.__gui_style |= GUIFRAME.WELCOME_PANEL_ON   
+             
+    def set_custom_default_perspective(self):
+        """
+        Set default starting perspective
+        """
+        if custom_config == None:
+            return
+        for plugin in self.plugins:
+            try:
+                if plugin.sub_menu == DEFAULT_PERSPECTIVE:
+                    
+                    plugin.on_perspective(event=None)
+                    #self._check_applications_menu()
+                    break
+            except:
+                pass  
+        return          
+                
     def on_load_data(self, event):
         """
@@ -300,5 +380,16 @@
             self._data_panel.fill_cbox_analysis(self.plugins)
         self.post_init()
-        #self.show_welcome_panel(None)
+        # Set Custom default
+        self.set_custom_default_perspective()
+
+        style = self.__gui_style & GUIFRAME.TOOLBAR_ON
+        if (style == GUIFRAME.TOOLBAR_ON) & (not self._toolbar.IsShown()):
+            self._on_toggle_toolbar() 
+        
+        # Set Custom deafult start page
+        welcome_style = self.__gui_style & GUIFRAME.WELCOME_PANEL_ON
+        if welcome_style == GUIFRAME.WELCOME_PANEL_ON:
+            self.show_welcome_panel(None)
+  
         #self.Show(True)
         #self._check_update(None)
@@ -354,8 +445,9 @@
                 msg = "Plugin %s already loaded" % plugin.sub_menu
                 logging.info(msg)
-                is_loaded = True    
+                is_loaded = True  
         if not is_loaded:
+            
             self.plugins.append(plugin)
-            
+             
       
     def _get_local_plugins(self):
@@ -430,4 +522,5 @@
                                     self._current_perspective = plug
                                 plugins.append(plug)
+                                
                                 msg = "Found plug-in: %s" % module.PLUGIN_ID
                                 logging.info(msg)
@@ -658,5 +751,5 @@
                               BestSize(wx.Size(PLOPANEL_WIDTH, 
                                                PLOPANEL_HEIGTH)))
-                        
+        
             self._popup_fixed_panel(p)
     
@@ -670,4 +763,5 @@
                               BestSize(wx.Size(PLOPANEL_WIDTH, 
                                                PLOPANEL_HEIGTH)))
+
             self._popup_floating_panel(p)
             
@@ -801,5 +895,5 @@
         self._help_menu = wx.Menu()
         style = self.__gui_style & GUIFRAME.WELCOME_PANEL_ON
-        if style == GUIFRAME.WELCOME_PANEL_ON:
+        if style == GUIFRAME.WELCOME_PANEL_ON or custom_config != None:
             # add the welcome panel menu item
             if self.defaultPanel is not None:
@@ -851,6 +945,48 @@
             self._toolbar_menu = self._view_menu.Append(id,'&Show Toolbar', '')
         wx.EVT_MENU(self, id, self._on_toggle_toolbar)
-        self._menubar.Append(self._view_menu, '&View')
-        
+        
+        if custom_config != None:
+            self._view_menu.AppendSeparator()
+            id = wx.NewId()
+            preference_menu = self._view_menu.Append(id,'Startup Setting', '')
+            wx.EVT_MENU(self, id, self._on_preference_menu)
+            
+        self._menubar.Append(self._view_menu, '&View')   
+         
+    def _on_preference_menu(self, event):     
+        """
+        Build a panel to allow to edit Mask
+        """
+        
+        from sans.guiframe.startup_configuration \
+        import StartupConfiguration as ConfDialog
+        
+        self.panel = ConfDialog(parent=self, gui=self.__gui_style)
+        #self.panel.Bind(wx.EVT_CLOSE, self._draw_masked_model)
+        self.panel.ShowModal()
+        #wx.PostEvent(self.parent, event)
+        
+    def _draw_masked_model(self,event):
+        """
+        Draw model image w/mask
+        """
+        event.Skip()
+
+        is_valid_qrange = self._update_paramv_on_fit()
+
+        if is_valid_qrange:
+            # try re draw the model plot if it exists
+            self._draw_model()
+            self.panel.Destroy() # frame
+            self.set_npts2fit()
+        elif self.model == None:
+            self.panel.Destroy()
+            self.set_npts2fit()
+            msg= "No model is found on updating MASK in the model plot... "
+            wx.PostEvent(self.parent.parent, StatusEvent(status = msg ))
+        else:
+            msg = ' Please consider your Q range, too.'
+            self.panel.ShowMessage(msg)
+
     def _add_menu_window(self):
         """
@@ -1117,7 +1253,8 @@
                 self._mgr.GetPane(self.panels[id].window_name).IsShown()
                 self._mgr.GetPane(self.panels[id].window_name).Hide()
-            #if self._toolbar != None and not self._toolbar.IsShown():
+        style = self.__gui_style & GUIFRAME.TOOLBAR_ON
+        if (style == GUIFRAME.TOOLBAR_ON) & (self._toolbar.IsShown()):
             #    self._toolbar.Show(True)
-            #self._on_toggle_toolbar()
+            self._on_toggle_toolbar()
 
         self._mgr.Update()
@@ -1581,7 +1718,7 @@
         :param panels: list of panels
         """
-        style = self.__gui_style & GUIFRAME.TOOLBAR_ON
-        if (style == GUIFRAME.TOOLBAR_ON) & (not self._toolbar.IsShown()):
-            self._on_toggle_toolbar()
+        #style = self.__gui_style & GUIFRAME.TOOLBAR_ON
+        #if (style == GUIFRAME.TOOLBAR_ON) & (not self._toolbar.IsShown()):
+        #    self._on_toggle_toolbar()
         for item in self.panels:
             # Check whether this is a sticky panel
Index: guiframe/gui_style.py
===================================================================
--- guiframe/gui_style.py	(revision 5342eb8e5f8bbdee63859d3f901ce53b63036ab0)
+++ guiframe/gui_style.py	(revision adf44c254b67e1c8c055878d09f38a535dfc51b0)
@@ -19,5 +19,5 @@
     WELCOME_PANEL_ON = 128
     DEFAULT_STYLE = SINGLE_APPLICATION|DATALOADER_ON|PLOTTING_ON|FIXED_PANEL
-    MULTIPLE_APPLICATIONS = DEFAULT_STYLE|WELCOME_PANEL_ON
+    MULTIPLE_APPLICATIONS = DEFAULT_STYLE
     
 class GUIFRAME_ID:
Index: guiframe/local_perspectives/plotting/Plotter1D.py
===================================================================
--- guiframe/local_perspectives/plotting/Plotter1D.py	(revision 248b91849bcd48b1754a3367b8071778a645ac7b)
+++ guiframe/local_perspectives/plotting/Plotter1D.py	(revision adf44c254b67e1c8c055878d09f38a535dfc51b0)
@@ -74,5 +74,6 @@
        
         ## Default locations
-        self._default_save_location = os.getcwd()        
+        self._default_save_location = os.getcwd() 
+        self.size = None       
         ## Graph        
         self.graph = Graph()
@@ -144,5 +145,7 @@
         self.canvas.set_resizing(self.resizing)
         self.parent.set_schedule(True)
-        
+        pos_x, pos_y = self.GetPositionTuple()
+        if pos_x != 0 and pos_y != 0:
+            self.size, _ = self.GetClientSizeTuple()
         
     def set_resizing(self, resizing=False):
Index: guiframe/startup_configuration.py
===================================================================
--- guiframe/startup_configuration.py	(revision adf44c254b67e1c8c055878d09f38a535dfc51b0)
+++ guiframe/startup_configuration.py	(revision adf44c254b67e1c8c055878d09f38a535dfc51b0)
@@ -0,0 +1,183 @@
+
+################################################################################
+#This software was developed by the University of Tennessee as part of the
+#Distributed Data Analysis of Neutron Scattering Experiments (DANSE)
+#project funded by the US National Science Foundation. 
+#
+#See the license text in license.txt
+#
+#copyright 2009, University of Tennessee
+################################################################################
+import wx
+import os
+import sys
+import copy
+#import sans.guiframe.gui_manager as gui
+from sans.guiframe.events import StatusEvent  
+from sans.guiframe.gui_style import GUIFRAME
+# default configuration
+DEFAULT_STRINGS = {'GUIFRAME_WIDTH':1150,
+                   'GUIFRAME_HEIGHT':840,
+                   'PLOPANEL_WIDTH':415,
+                   'DATAPANEL_WIDTH':235,
+                   'DATALOADER_SHOW':True,
+                   'TOOLBAR_SHOW':True,
+                   'FIXED_PANEL':True,
+                   'WELCOME_PANEL_SHOW':False,
+                   'DEFAULT_PERSPECTIVE':'Fitting'}
+
+if sys.platform.count("win32") > 0:
+    PANEL_WIDTH = 265 
+    PANEL_HEIGHT = 235
+    FONT_VARIANT = 0
+else:
+    PANEL_WIDTH = 285
+    PANEL_HEIGHT = 255
+    FONT_VARIANT = 1
+    
+"""
+Dialog to set Appication startup configuration
+"""
+class StartupConfiguration(wx.Dialog):
+    """
+    Dialog for Startup Configuration
+    """
+    def __init__(self, parent, gui, id=-1, title="Startup Setting"):
+        wx.Dialog.__init__(self, parent, id, title, 
+                           size=(PANEL_WIDTH, PANEL_HEIGHT))
+        # parent
+        self.parent = parent
+        self.path = parent.path
+        self._gui = gui
+        # font size 
+        self.SetWindowVariant(variant=FONT_VARIANT)
+        self.current_string = copy.deepcopy(DEFAULT_STRINGS)
+        # build layout
+        panel = wx.Panel(self, -1)
+        vbox = wx.BoxSizer(wx.VERTICAL)
+        wx.StaticBox(panel, -1, 'Change Configuration', (5, 5),
+                      (PANEL_WIDTH*0.94, PANEL_HEIGHT*0.7))
+        default_bt = wx.RadioButton(panel, -1, 'Default View', (15, 30), 
+                                    style=wx.RB_GROUP)
+        default_bt.Bind(wx.EVT_RADIOBUTTON, self.OnDefault)
+        default_bt.SetValue(True)
+        current_bt = wx.RadioButton(panel, -1, 'Current View', (15, 55))
+        current_bt.SetValue(False)
+        current_bt.Bind(wx.EVT_RADIOBUTTON, self.OnCurrent)
+        msg = "\nThis new configuration will take effect on\n"
+        msg += "restarting this application..."
+        note_txt = wx.StaticText(panel, -1, msg, (15, 75))
+        
+        hbox = wx.BoxSizer(wx.HORIZONTAL)
+        cancelButton = wx.Button(self, -1, 'Cancel', size=(70, 25))
+        hbox.Add(cancelButton, 1, wx.RIGHT, 5)
+        cancelButton.Bind(wx.EVT_BUTTON, self.OnCancel)
+        okButton = wx.Button(self, -1, 'OK', size=(70, 25))
+        hbox.Add(okButton, 1, wx.RIGHT, 5)
+        okButton.Bind(wx.EVT_BUTTON, self.OnClose)
+        vbox.Add(panel)
+
+        vbox.Add(hbox, 1, wx.ALIGN_CENTER | wx.RIGHT | wx.BOTTOM, 5)
+        # set sizer
+        self.SetSizer(vbox)
+        #pos = self.parent.GetPosition()
+        #self.SetPosition(pos)
+        
+    def OnDefault(self, event=None):
+        """
+        Set to default
+        """
+        event.Skip()
+        # event object and selection
+        return DEFAULT_STRINGS
+        
+    def OnCurrent(self, event=None):
+        """
+        Set to curent setup
+        """
+        event.Skip()
+        
+        gui_pw, gui_ph = self.parent.GetSizeTuple()
+        self.current_string['GUIFRAME_WIDTH'] = gui_pw
+        self.current_string['GUIFRAME_HEIGHT'] = gui_ph
+        try:
+            p_size = None
+            for panel in self.parent.plot_panels.values():
+                if p_size == None or panel.size > p_size:
+                    p_size = panel.size
+            if p_size == None:
+                p_size = DEFAULT_STRINGS['PLOPANEL_WIDTH']
+            self.current_string['PLOPANEL_WIDTH'] = p_size
+            
+            data_pw, _ = self.parent.panels["data_panel"].GetSizeTuple()
+            if data_pw == None:
+                data_pw = DEFAULT_STRINGS['DATAPANEL_WIDTH']
+            self.current_string['DATAPANEL_WIDTH'] = data_pw
+            
+            label = self.parent._data_panel_menu.GetText()
+            if label == 'Data Explorer OFF':
+                self.current_string['DATALOADER_SHOW'] = True
+            else:
+                self.current_string['DATALOADER_SHOW'] = False
+                
+            if self.parent._toolbar.IsShown():
+                self.current_string['TOOLBAR_SHOW'] = True
+            else:
+                self.current_string['TOOLBAR_SHOW'] = False
+                
+            style = self._gui & GUIFRAME.FLOATING_PANEL
+            if style == GUIFRAME.FLOATING_PANEL: 
+                self.current_string['FIXED_PANEL'] = False
+            else:
+                self.current_string['FIXED_PANEL'] = True
+                
+            if self.parent._mgr.GetPane(self.parent.panels['default'].window_name).IsShown():
+                self.current_string['WELCOME_PANEL_SHOW'] = True
+            else:
+                self.current_string['WELCOME_PANEL_SHOW'] = False
+            
+            perspective = self.parent.get_current_perspective()
+            self.current_string['DEFAULT_PERSPECTIVE'] = str(perspective.sub_menu)
+            
+        except:
+            raise
+        # event object and selection
+        return self.current_string
+
+    def OnCancel(self, event):
+        """
+        Close event
+        """
+        # clear event
+        event.Skip()
+    
+        self.Destroy()
+    
+    def OnClose(self, event):
+        """
+        Close event
+        """
+        # clear event
+        event.Skip()
+        fname = os.path.join(self.path, 'custom_config.py')
+        self.write_string(fname, self.current_string)
+    
+        self.Destroy()
+
+    def write_string(self, fname, strings):
+        """
+        Write and Save file
+        """
+        
+        try:
+            out_f =  open(fname,'w')
+        except :
+            raise  #RuntimeError, "Error: Can not change the configuration..."
+        out_f.write("#Application appearance custom configuration\n" )
+        for key, item in strings.iteritems():
+            if key == 'DEFAULT_PERSPECTIVE':
+                out_f.write("%s = '%s'\n" % (key,str(item)))
+            else:
+                out_f.write("%s = %s\n" % (key,str(item)))
+    
+        out_f.close() 
