Index: sansguiframe/src/sans/guiframe/local_perspectives/plotting/Plotter1D.py
===================================================================
--- sansguiframe/src/sans/guiframe/local_perspectives/plotting/Plotter1D.py	(revision 940aca737db034347a7b2bcbe30f143b76e47cbc)
+++ sansguiframe/src/sans/guiframe/local_perspectives/plotting/Plotter1D.py	(revision f8be87db070c7bd182dfffe13bf0a045c543570c)
@@ -36,4 +36,5 @@
 from sans.guiframe.gui_style import GUIFRAME_ICON
 from binder import BindArtist
+from appearanceDialog import appearanceDialog
 
 DEFAULT_QMAX = 0.05
@@ -459,33 +460,7 @@
                 plot_menu.AppendSeparator()    
                 symbol_menu = wx.Menu()
-                for label in self._symbol_labels:
-                    id = wx.NewId()
-                    symbol_menu.Append(id, str(label), name)
-                    wx.EVT_MENU(self, id, self.onChangeSymbol)
-                id = wx.NewId()
-                plot_menu.AppendMenu(id,'&Modify Symbol', symbol_menu, name)
-                
-                color_menu = wx.Menu()
-                for label in self._color_labels:
-                    id = wx.NewId()
-                    color_menu.Append(id, str(label), name)
-                    wx.EVT_MENU(self, id, self.onChangeColor)
-                id = wx.NewId()
-                plot_menu.AppendMenu(id, '&Modify Symbol Color', 
-                                     color_menu, name)
-                
-                size_menu = wx.Menu()
-                for i in range(10):
-                    id = wx.NewId()
-                    size_menu.Append(id, str(i), name)
-                    wx.EVT_MENU(self, id, self.onChangeSize)
-                id = wx.NewId()
-                size_menu.Append(id, '&Custom', name)
-                wx.EVT_MENU(self, id, self.onChangeSize)
-                id = wx.NewId()
-                plot_menu.AppendMenu(id, '&Modify Symbol Size', 
-                                     size_menu, name)
                 
                 if plot.is_data:
+                    id = wx.NewId()
                     self.hide_menu = plot_menu.Append(id, 
                                                     "Hide Error Bar", name)
@@ -500,8 +475,12 @@
                     wx.EVT_MENU(self, id, self._ontoggle_hide_error)
                 
-                plot_menu.AppendSeparator()
+                    plot_menu.AppendSeparator()
+
                 id = wx.NewId()
-                plot_menu.Append(id, '&Edit Legend Label', name)
-                wx.EVT_MENU(self, id, self.onEditLabels)
+                plot_menu.Append(id, '&Modify graph properties', name)
+                wx.EVT_MENU(self, id, self.createAppDialog)
+
+
+
             id = wx.NewId()
             #plot_menu.SetTitle(name)
@@ -574,97 +553,4 @@
         self.parent.onfreeze([plot.id])
         
-    def onEditLabels(self, event):
-        """
-        Edit legend label
-        """
-        menu = event.GetEventObject()
-        id = event.GetId()
-        self.set_selected_from_menu(menu, id)
-        selected_plot = self.plots[self.graph.selected_plottable]
-        label = selected_plot.label
-        dial = LabelDialog(None, -1, 'Change Legend Label', label)
-        if dial.ShowModal() == wx.ID_OK:
-            newLabel = dial.getText() 
-            selected_plot.label = newLabel
-            # Updata Graph menu help string
-            pos = self.parent._window_menu.FindItem(self.window_caption)
-            helpString = 'Show/Hide Graph: '
-            for plot in  self.plots.itervalues():
-                helpString += (' ' + str(plot.label) +';')
-            self.parent._window_menu.SetHelpString(pos, helpString)
-            self._is_changed_legend_label = True
-            #break
-        dial.Destroy()
-        
-        ## render the graph
-        try:
-            self._onEVT_FUNC_PROPERTY()
-        except:
-            msg=" Encountered singular points..."
-            wx.PostEvent(self.parent, StatusEvent(status=\
-                    "Plotting Erorr: %s"% msg, info="error")) 
-    
-    def onChangeColor(self, event):
-        """
-        Changes the color of the graph when selected
-        """
-        menu = event.GetEventObject()
-        id = event.GetId()
-        self.set_selected_from_menu(menu, id)
-        label =  menu.GetLabel(id)
-        selected_plot = self.plots[self.graph.selected_plottable]
-        selected_plot.custom_color = self._color_labels[label]
-        ## Set the view scale for all plots
-        self._check_zoom_plot()
-        #self._onEVT_FUNC_PROPERTY()
-        #wx.PostEvent(self.parent,
-        #              NewColorEvent(color=selected_plot.custom_color,
-        #                                     id=selected_plot.id))
-    
-    def onChangeSize(self, event):
-        """
-        On Change size menu
-        """
-        menu = event.GetEventObject()
-        id = event.GetId()
-        self.set_selected_from_menu(menu, id)
-        label =  menu.GetLabel(id)
-        selected_plot = self.plots[self.graph.selected_plottable]
-        
-        if label == "&Custom":
-            sizedial = SizeDialog(None, -1, 'Change Marker Size')
-            if sizedial.ShowModal() == wx.ID_OK:
-                try:
-                    label = sizedial.getText()
-
-                except:
-                    msg = 'Symbol Size: Got an invalid Value.'
-                    wx.PostEvent( self.parent, 
-                          StatusEvent(status= msg, info='error'))
-            sizedial.Destroy()
-        try:
-            selected_plot.markersize = int(label)
-            self._check_zoom_plot()
-        except:
-            msg = 'Symbol Size: Got an invalid Value.'
-            wx.PostEvent( self.parent, 
-                          StatusEvent(status= msg, info='error'))
-
-    
-    def onChangeSymbol(self, event):
-        """
-        """
-        menu = event.GetEventObject()
-        id = event.GetId()
-        self.set_selected_from_menu(menu, id)
-        label =  menu.GetLabel(id)
-        selected_plot = self.plots[self.graph.selected_plottable]
-        selected_plot.symbol = self._symbol_labels[label]
-        ## Set the view scale for all plots
-        self._check_zoom_plot()
-        #self._onEVT_FUNC_PROPERTY()
-        ## render the graph
-        #self.graph.render(self)
-        #self.subplot.figure.canvas.draw_idle()
                        
     def _onSave(self, evt):
@@ -724,4 +610,44 @@
         if self.parent is not None:
             self.parent.hide_panel(self.uid)
-            
-            
+
+    def createAppDialog(self, event):
+        """
+        Create the custom dialog for fit appearance modification
+        """
+        menu = event.GetEventObject()
+        id = event.GetId()
+        self.set_selected_from_menu(menu,id)
+        self.appearance_selected_plot = self.plots[self.graph.selected_plottable]
+
+        # find current properties
+        curr_color = self.appearance_selected_plot.custom_color
+        curr_symbol = self.appearance_selected_plot.symbol
+        curr_size = self.appearance_selected_plot.markersize
+        curr_label = self.appearance_selected_plot.label
+
+        if curr_color == None:
+            curr_color = self._color_labels['Blue']
+            curr_symbol = 13
+
+        self.appD = appearanceDialog(self,'Modify graph properties')
+        self.appD.setDefaults(float(curr_size),int(curr_color),str(appearanceDialog.find_key(self.get_symbol_label(),int(curr_symbol))),curr_label)
+        self.appD.Bind(wx.EVT_CLOSE, self.on_AppDialog_close)    
+
+    def on_AppDialog_close(self,e):
+        if(self.appD.okay_clicked == True):
+            info = self.appD.getCurrentValues() # returns (size,color,symbol,datalabel)
+            self.appearance_selected_plot.custom_color = self._color_labels[info[1].encode('ascii','ignore')]
+
+            self.appearance_selected_plot.markersize = float(info[0])
+            self.appearance_selected_plot.symbol = self.get_symbol_label()[info[2]] # self._symbol_labels[info[2].encode('ascii','ignore')]
+            self.appearance_selected_plot.label = str(info[3])
+
+            pos = self.parent._window_menu.FindItem(self.window_caption)
+            helpString = 'Show/Hide Graph: '
+            for plot in  self.plots.itervalues():
+                helpString += (' ' + str(plot.label) +';')
+                self.parent._window_menu.SetHelpString(pos, helpString)
+                self._is_changed_legend_label = True
+                
+        self.appD.Destroy()
+        self._check_zoom_plot()
Index: sansguiframe/src/sans/guiframe/local_perspectives/plotting/appearanceDialog.py
===================================================================
--- sansguiframe/src/sans/guiframe/local_perspectives/plotting/appearanceDialog.py	(revision f8be87db070c7bd182dfffe13bf0a045c543570c)
+++ sansguiframe/src/sans/guiframe/local_perspectives/plotting/appearanceDialog.py	(revision f8be87db070c7bd182dfffe13bf0a045c543570c)
@@ -0,0 +1,269 @@
+#!/usr/bin/python
+
+"""
+
+Appearance of graph symbols and legend label dialog.
+
+
+/**
+	This software was developed by Institut Laue-Langevin as part of
+	Distributed Data Analysis of Neutron Scattering Experiments (DANSE).
+
+	Copyright 2012 Institut Laue-Langevin
+
+**/
+
+
+"""
+
+import wx
+import operator
+
+
+# main appearance dialog starts here:
+
+
+class appearanceDialog(wx.Frame):
+
+    def __init__(self,parent,title):
+        super(appearanceDialog,self).__init__(parent, title=title,size=(570,400))
+
+        self.okay_clicked = False
+
+        self.symbolLabels = self.get_symbol_label()
+        self.colorLabels = self.get_color_label()
+
+
+        self.InitUI()
+        self.Centre()
+        self.Show()
+
+  
+    def InitUI(self):
+
+        # create spacing needed
+        panel = wx.Panel(self)
+
+        vbox = wx.BoxSizer(wx.VERTICAL)
+
+        hbox1 = wx.BoxSizer(wx.HORIZONTAL)
+        hbox2 = wx.BoxSizer(wx.HORIZONTAL)
+        hbox3 = wx.BoxSizer(wx.HORIZONTAL)
+
+        ivbox1 = wx.BoxSizer(wx.VERTICAL)
+        ivbox2 = wx.BoxSizer(wx.VERTICAL)
+ 
+        ihbox1 = wx.BoxSizer(wx.HORIZONTAL)
+        ihbox2 = wx.BoxSizer(wx.HORIZONTAL)
+
+        symbolStaticBox = wx.StaticBox(panel, -1, 'Symbol')
+        symbolStaticBoxSizer = wx.StaticBoxSizer(symbolStaticBox, wx.VERTICAL)
+
+        # add widgets - reverse order!
+
+        # texts
+        symbolText = wx.StaticText(panel, label='Shape')
+        colorText = wx.StaticText(panel, label='Color')
+        sizeText = wx.StaticText(panel, label='Size')
+        labelText = wx.StaticText(panel, label='Legend label')
+
+        # selection widgets
+        self.symbolListBox = wx.ListBox(panel,-1,size=(200,200))
+        self.colorListBox = wx.ComboBox(panel,style=wx.CB_READONLY, size=(195,-1))
+        self.sizeComboBox = wx.ComboBox(panel,style=wx.CB_READONLY, size=(90,-1))
+        self.sizeComboBox.Bind(wx.EVT_COMBOBOX, self.combo_click)
+        self.sizeCustomButton = wx.Button(panel, label='Custom...')
+        self.sizeCustomButton.Bind(wx.EVT_BUTTON, self.customSize)
+        self.labelTextBox = wx.TextCtrl(panel,-1, "",size=(180,-1))
+
+        # buttons
+        OkButton = wx.Button(panel, label='OK')
+        OkButton.Bind(wx.EVT_BUTTON,self.onOK)
+        cancelButton = wx.Button(panel, label='Cancel')
+        cancelButton.Bind(wx.EVT_BUTTON, self.CloseDlg)
+
+        # now Add all the widgets to relevant spacer - tricky
+        ivbox1.Add(symbolText, flag =  wx.TOP | wx.LEFT | wx.ALIGN_LEFT ,border=10)
+        ivbox1.Add(self.symbolListBox, flag = wx.TOP | wx.LEFT | wx.ALIGN_LEFT ,border=10)
+
+        ihbox1.Add(sizeText, flag = wx.TOP | wx.LEFT | wx.ALIGN_LEFT , border=10)
+        ihbox1.Add((20,-1))
+        ihbox1.Add(self.sizeComboBox, flag =  wx.TOP | wx.LEFT | wx.ALIGN_LEFT , border=10)
+        ihbox1.Add((20,-1))
+        ihbox1.Add(self.sizeCustomButton, flag = wx.ALIGN_LEFT | wx.TOP, border=10)
+
+        ihbox2.Add(colorText,flag = wx.TOP |  wx.LEFT | wx.ALIGN_LEFT, border=10)
+        ihbox2.Add((20,-1))
+        ihbox2.Add(self.colorListBox, flag = wx.TOP | wx.LEFT | wx.ALIGN_LEFT, border=10)
+
+
+
+        ivbox2.Add(ihbox1, flag =  wx.TOP | wx.ALIGN_RIGHT,border=10)
+        ivbox2.Add(ihbox2, flag =  wx.TOP | wx.ALIGN_RIGHT,border=10)
+
+        
+        hbox1.Add((5,-1))
+        hbox1.Add(ivbox1,flag =  wx.EXPAND | wx.ALIGN_LEFT ,border=10)
+        hbox1.Add((5,-1))
+        hbox1.Add(ivbox2,flag =  wx.EXPAND | wx.ALIGN_RIGHT ,border=10)
+        hbox1.Add((5,-1))
+
+   
+        hbox2.Add(OkButton, flag = wx.RIGHT |  wx.ALIGN_RIGHT, border=10)
+        hbox2.Add(cancelButton, flag = wx.RIGHT | wx.ALIGN_RIGHT, border=10)
+
+        hbox3.Add(labelText, flag= wx.TOP | wx.LEFT | wx.ALIGN_LEFT, border=10)
+        hbox3.Add((20,-1))
+        hbox3.Add(self.labelTextBox, wx.TOP |wx.ALIGN_LEFT | wx.LEFT , border=10)
+        hbox3.Add((20,-1))
+  
+        vbox.Add((20,-1))
+        symbolStaticBoxSizer.Add(hbox1,flag = wx.TOP | wx.EXPAND,border=10)
+        vbox.Add(symbolStaticBoxSizer, flag = wx.TOP | wx.EXPAND,border=10)
+
+        vbox.Add((-1,20))
+        vbox.Add(hbox3,flag = wx.BOTTOM  | wx.ALIGN_RIGHT, border=20)
+
+
+        vbox.Add(hbox2,flag = wx.BOTTOM  | wx.ALIGN_RIGHT, border=20)
+
+
+        panel.SetSizer(vbox)
+
+        self.populateSymbol()
+        self.populateColor()
+        self.populateSize()
+
+        self.SetDefaultItem(self.symbolListBox)
+
+    def customSize(self,e):
+        dlg = wx.TextEntryDialog(self,
+                                 'Enter custom size',
+                                 'Custom size',
+                                 str(self.final_size))
+        if(dlg.ShowModal() == wx.ID_OK):
+            if(float(dlg.GetValue()) < 0):
+                dial = wx.MessageDialog(None, 
+                                        'Unfortunately imaginary icons are not yet supported. Please enter a positive value',
+                                        'Error',
+                                        wx.OK | wx.ICON_ERROR)
+                dial.ShowModal()
+                dlg.Destroy()
+                self.customSize(e)
+            else:
+                self.final_size = dlg.GetValue()
+                dlg.Destroy()
+        else:
+            dlg.Destroy()
+
+    def setDefaults(self,size,color,symbol,label):
+        self.final_size = size
+        # set up gui values
+        self.labelTextBox.SetValue(label)
+        if(size % 1 == 0 and size > 1 and size < 11):
+            self.sizeComboBox.SetSelection(int(size) - 1)
+        else:
+            self.sizeComboBox.SetSelection(4)
+        self.symbolListBox.SetSelection(self.sorted_sym_dic[symbol])
+        colorname = appearanceDialog.find_key(self.get_color_label(),color)
+        self.colorListBox.SetStringSelection(colorname)
+
+    def populateSymbol(self):
+        self.sorted_symbolLabels = sorted(self.symbolLabels.iteritems(),key=operator.itemgetter(1))
+        self.sorted_sym_dic = {}
+        i = 0
+        for label in self.sorted_symbolLabels:
+            self.symbolListBox.Append(str(label[0]))
+            self.sorted_sym_dic[str(label[0])] = i
+            i += 1
+
+    def populateColor(self):
+        sortedcolorLabels = sorted(self.colorLabels.iteritems(),key=operator.itemgetter(1))
+        
+        for color in sortedcolorLabels:
+             self.colorListBox.Append(str(color[0]))
+ 
+    def populateSize(self):
+
+        for i in range(1,11):
+            self.sizeComboBox.Append(str(i) + '.0')
+
+    def combo_click(self,e):
+        self.final_size = self.sizeComboBox.GetValue()
+
+    def CloseDlg(self,e):
+        self.Destroy()
+
+
+    def get_symbol_label(self):
+        """
+        Associates label to symbol
+        """
+        _labels = {}
+        i = 0
+        _labels['Circle'] = i
+        i += 1
+        _labels['Cross X '] = i
+        i += 1
+        _labels['Triangle Down'] = i
+        i += 1
+        _labels['Triangle Up'] = i
+        i += 1
+        _labels['Triangle Left'] = i
+        i += 1
+        _labels['Triangle Right'] = i
+        i += 1
+        _labels['Cross +'] = i
+        i += 1
+        _labels['Square'] = i
+        i += 1
+        _labels['Diamond'] = i
+        i += 1
+        _labels['Hexagon1'] = i
+        i += 1
+        _labels['Hexagon2'] = i
+        i += 1
+        _labels['Pentagon'] = i
+        i += 1
+        _labels['Line'] = i
+        return _labels
+    
+    def get_color_label(self):
+        """
+        Associates label to a specific color
+        """
+        _labels = {}
+        i = 0
+        _labels['Blue'] = i
+        i += 1
+        _labels['Green'] = i
+        i += 1
+        _labels['Red'] = i
+        i += 1
+        _labels['Cyan'] = i
+        i += 1
+        _labels['Magenta'] = i
+        i += 1
+        _labels['Yellow'] = i
+        i += 1
+        _labels['Black'] = i
+        return _labels
+
+    @staticmethod
+    def find_key(dic,val):
+        return [k for k, v in dic.iteritems() if v == val][0]
+        
+    def getCurrentValues(self): # returns (size,color,symbol,dataname)
+
+        size = float(self.final_size)
+        name = str(self.labelTextBox.GetValue())
+        selTuple = self.symbolListBox.GetSelections()
+        symbol = appearanceDialog.find_key(self.sorted_sym_dic,int(selTuple[0]))
+        color = str(self.colorListBox.GetValue()) 
+ 
+        return(size,color,symbol,name)
+
+    def onOK(self,e):
+        self.okay_clicked = True
+
+        self.Close()
