Author: bugman Date: Fri Jul 29 09:49:05 2011 New Revision: 13981 URL: http://svn.gna.org/viewcvs/relax?rev=13981&view=rev Log: Improvements to the free file format GUI elements (window and element). This includes specifying fonts, button sizes, and a fix for the button sizer in the GUI element. Modified: branches/gui_testing/gui/settings.py branches/gui_testing/gui/wizard.py Modified: branches/gui_testing/gui/settings.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/settings.py?rev=13981&r1=13980&r2=13981&view=diff ============================================================================== --- branches/gui_testing/gui/settings.py (original) +++ branches/gui_testing/gui/settings.py Fri Jul 29 09:49:05 2011 @@ -72,6 +72,9 @@ # A border. BORDER = 10 + # Sizes. + SIZE_BUTTON = (100, 33) + def __init__(self, parent=None, id=-1, title='', heading='', style=wx.DEFAULT_FRAME_STYLE): """Set up the window.""" @@ -123,7 +126,8 @@ # The save button. button = wx.lib.buttons.ThemedGenBitmapTextButton(self, -1, None, " Save") button.SetBitmapLabel(wx.Bitmap(paths.icon_22x22.save, wx.BITMAP_TYPE_ANY)) - button.SetToolTipString("Save the settings") + button.SetToolTipString("Save the free file format settings within the relax data store.") + button.SetMinSize(self.SIZE_BUTTON) button_sizer.Add(button, 0, wx.ADJUST_MINSIZE, 0) self.Bind(wx.EVT_BUTTON, self.save, button) @@ -133,6 +137,8 @@ # The reset button. button = wx.lib.buttons.ThemedGenBitmapTextButton(self, -1, None, " Reset") button.SetBitmapLabel(wx.Bitmap(paths.icon_22x22.edit_delete, wx.BITMAP_TYPE_ANY)) + button.SetToolTipString("Reset the free file format settings to the original values.") + button.SetMinSize(self.SIZE_BUTTON) button_sizer.Add(button, 0, wx.ADJUST_MINSIZE, 0) self.Bind(wx.EVT_BUTTON, self.reset, button) @@ -142,6 +148,7 @@ # The cancel button. button = wx.lib.buttons.ThemedGenBitmapTextButton(self, -1, None, " Cancel") button.SetBitmapLabel(wx.Bitmap(paths.icon_22x22.dialog_cancel, wx.BITMAP_TYPE_ANY)) + button.SetMinSize(self.SIZE_BUTTON) button_sizer.Add(button, 0, wx.ADJUST_MINSIZE, 0) self.Bind(wx.EVT_BUTTON, self.cancel, button) @@ -243,9 +250,6 @@ # Execute the base class method. self._free_file_format_reset(event) - # Update the values. - self._free_file_format_set_vals(data_cols=True) - def save(self, event): """Save the free file format widget contents into the relax data store. Modified: branches/gui_testing/gui/wizard.py URL: http://svn.gna.org/viewcvs/relax/branches/gui_testing/gui/wizard.py?rev=13981&r1=13980&r2=13981&view=diff ============================================================================== --- branches/gui_testing/gui/wizard.py (original) +++ branches/gui_testing/gui/wizard.py Fri Jul 29 09:49:05 2011 @@ -36,6 +36,7 @@ # relax GUI module imports. from gui.controller import Redirect_text from gui.filedialog import openfile +from gui.fonts import font from gui.icons import relax_icons from gui.misc import add_border, bool_to_gui, gui_to_int, int_to_gui, protected_exec, str_to_gui from gui.message import Question @@ -115,6 +116,7 @@ height_element = 27 image_path = paths.IMAGE_PATH + "relax.gif" main_text = '' + size_button = (100, 33) title = '' def __init__(self, parent): @@ -237,7 +239,11 @@ # Reset. if Question('Would you really like to reset the free file format settings?', parent=self).ShowModal() == wx.ID_YES: + # First reset. ds.relax_gui.free_file_format.reset() + + # Then update the values. + self._free_file_format_set_vals(data_cols=True) def _free_file_format_save(self, event): @@ -653,6 +659,7 @@ # A static box to hold all the widgets. box = wx.StaticBox(self, -1, "Free format file settings") + box.SetFont(font.subtitle) # Init. sub_sizer = wx.StaticBoxSizer(box, wx.VERTICAL) @@ -676,47 +683,44 @@ # Set the values. self._free_file_format_set_vals(data_cols=data_cols) - # Add a save button. - if save: + # Buttons! + if save or reset: # A sizer. button_sizer = wx.BoxSizer(wx.HORIZONTAL) - # Build the button. - button = buttons.ThemedGenBitmapTextButton(self, -1, None, " Save") - button.SetBitmapLabel(wx.Bitmap(paths.icon_22x22.save, wx.BITMAP_TYPE_ANY)) - button.SetToolTipString("Save the free file format settings within the relax data store.") - - # Add the button. - button_sizer.Add(button, 0, wx.ADJUST_MINSIZE, 0) - - # Right padding. - button_sizer.AddSpacer(padding) - - # Bind the click event. - self.Bind(wx.EVT_BUTTON, self._free_file_format_save, button) - - # Add the button sizer to the widget (with spacing). - sub_sizer.AddSpacer(padding) - sub_sizer.Add(button_sizer, 0, wx.ALIGN_RIGHT|wx.ALL, 0) - - # Add a reset button. - if reset: - # A sizer. - button_sizer = wx.BoxSizer(wx.HORIZONTAL) - - # Build the button. - button = buttons.ThemedGenBitmapTextButton(self, -1, None, " Reset") - button.SetBitmapLabel(wx.Bitmap(paths.icon_22x22.edit_delete, wx.BITMAP_TYPE_ANY)) - button.SetToolTipString("Reset the free file format settings to the original values.") - - # Add the button. - button_sizer.Add(button, 0, wx.ADJUST_MINSIZE, 0) - - # Right padding. - button_sizer.AddSpacer(padding) - - # Bind the click event. - self.Bind(wx.EVT_BUTTON, self._free_file_format_reset, button) + # Add a save button. + if save: + # Build the button. + button = buttons.ThemedGenBitmapTextButton(self, -1, None, " Save") + button.SetBitmapLabel(wx.Bitmap(paths.icon_22x22.save, wx.BITMAP_TYPE_ANY)) + button.SetToolTipString("Save the free file format settings within the relax data store.") + button.SetMinSize(self.size_button) + + # Add the button. + button_sizer.Add(button, 0, wx.ADJUST_MINSIZE, 0) + + # Right padding. + button_sizer.AddSpacer(padding) + + # Bind the click event. + self.Bind(wx.EVT_BUTTON, self._free_file_format_save, button) + + # Add a reset button. + if reset: + # Build the button. + button = buttons.ThemedGenBitmapTextButton(self, -1, None, " Reset") + button.SetBitmapLabel(wx.Bitmap(paths.icon_22x22.edit_delete, wx.BITMAP_TYPE_ANY)) + button.SetToolTipString("Reset the free file format settings to the original values.") + button.SetMinSize(self.size_button) + + # Add the button. + button_sizer.Add(button, 0, wx.ADJUST_MINSIZE, 0) + + # Right padding. + button_sizer.AddSpacer(padding) + + # Bind the click event. + self.Bind(wx.EVT_BUTTON, self._free_file_format_reset, button) # Add the button sizer to the widget (with spacing). sub_sizer.AddSpacer(padding)