Exemplo n.º 1
0
    def SetValue(self, key, t=None, v=None, text=''):
        """ Set a new couple key/(type,typed-value,text). """

        if key not in self._prefs:
            self._prefs[key] = sppasWxOption(t, v, text)

        self._prefs[key].set_value(v)
Exemplo n.º 2
0
    def Copy(self):
        """ Return a deep copy of self.

        :returns: (Preferences_IO)

        """
        #import copy
        #return copy.deepcopy( self._prefs ) -->
        #BUG: TypeError: object.__new__(PySwigObject) is not safe, use PySwigObject.__new__()

        cpref = Preferences_IO()

        for key in self._prefs.keys():
            if key == 'THEME':
                cpref.SetTheme(self._prefs[key])
            else:
                t = self._prefs[key].get_type()
                v = self._prefs[key].get_untypedvalue()
                txt = self._prefs[key].get_text()
                opt = sppasWxOption(t, v, txt)
                cpref.SetOption(key, opt)

        return cpref
Exemplo n.º 3
0
    def __init__(self):

        sppasTheme.__init__(self)

        # Display
        self._choice['D_TIME_MIN']      = sppasWxOption('float', 0.0,  'Minimum time value (in seconds) of the displayed period at start-up')
        self._choice['D_TIME_MAX']      = sppasWxOption('float', 2.0,  'Maximum time value (in seconds) of the displayed period at start-up')
        self._choice['D_TIME_ZOOM_MIN'] = sppasWxOption('float', 0.2, 'Minimum duration (in seconds) of the displayed period')
        self._choice['D_TIME_ZOOM_MAX'] = sppasWxOption('float', 300.0, 'Maximum duration (in seconds) of the displayed period')

        self._choice['D_H_ZOOM'] = sppasWxOption('float', 50.0, 'Time zoom (percentage)')
        self._choice['D_SCROLL'] = sppasWxOption('float', 75.0, 'Time scroll (percentage)')
        self._choice['D_V_ZOOM'] = sppasWxOption('float', 10.0, 'Vertical zoom (percentage)')

        # spControl
        self._choice['O_PEN_WIDTH']   = sppasWxOption('int', 1)
        self._choice['O_PEN_STYLE']   = sppasWxOption('int', wx.SOLID)
        self._choice['O_BRUSH_STYLE'] = sppasWxOption('int', wx.SOLID)
        self._choice['O_MARGIN']      = sppasWxOption('int', 2, 'Margin around objects')

        # Ruler
        self._choice['R_BG_COLOUR']      = sppasWxOption('wx.Colour', (255,255,255), 'Ruler background color')
        self._choice['R_FG_COLOUR']      = sppasWxOption('wx.Colour', (10,10,140))
        self._choice['R_HANDLES_COLOUR'] = sppasWxOption('wx.Colour', (10,10,140))
        self._choice['R_FONT']           = sppasWxOption('wx.Font', (8, wx.FONTFAMILY_TELETYPE, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, '', wx.FONTENCODING_UTF8))
        self._choice['R_FONT_COLOUR']    = sppasWxOption('wx.Colour', (10, 10, 140))
        self._choice['R_HEIGHT']         = sppasWxOption('int', 30, 'Initial height of the ruler')

        # Separator
        self._choice['S_COLOUR']         = sppasWxOption('wx.Colour', (123,15,28))
        self._choice['S_PEN_WIDTH']      = sppasWxOption('int', 4)

        # Tier
        self._choice['T_BG_COLOUR']      = sppasWxOption('wx.Colour', None, 'Tier background color') # Pick randomly
        self._choice['T_FG_COLOUR']      = sppasWxOption('wx.Colour', (10,60,10), 'Tier foreground color')
        self._choice['T_RADIUS_COLOUR']  = sppasWxOption('wx.Colour', (20,20,80), 'Color for the radius of points')
        self._choice['T_HANDLES_COLOUR'] = sppasWxOption('wx.Colour', (140,10,10), 'Color of the handles of a transcription')
        self._choice['T_FONT']           = sppasWxOption('wx.Font', (9, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, '', wx.FONTENCODING_UTF8))
        self._choice['T_FONT_COLOUR']    = sppasWxOption('wx.Colour', (140, 10, 10), 'Font color')
        self._choice['T_LABEL_ALIGN']    = sppasWxOption('wx.ALIGN', 'center', 'Text alignment for labels')
        self._choice['T_HEIGHT']         = sppasWxOption('int', 30, 'Initial height of a tier')

        # Wave
        self._choice['W_BG_COLOUR']      = sppasWxOption('wx.Colour', (255,255,255), 'Wave background color')
        self._choice['W_FG_COLOUR']      = sppasWxOption('wx.Colour', (10,140,10), 'Wave foreground color')
        self._choice['W_BG_GRADIENT_COLOUR'] = sppasWxOption('wx.Colour', (228,228,228), 'Wave background gradient color')
        self._choice['W_HANDLES_COLOUR'] = sppasWxOption('wx.Colour', (10,140,10), 'Color of the handles of a wave')
        self._choice['W_FONT']           = sppasWxOption('wx.Font', (9, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, '', wx.FONTENCODING_UTF8))
        self._choice['W_FONT_COLOUR']    = sppasWxOption('wx.Colour', (10, 140, 10), 'Font color')
        self._choice['W_FG_DISCO']       = sppasWxOption('bool', False, 'Foreground in a Disco style')
        self._choice['W_AUTOSCROLL']     = sppasWxOption('bool', True, 'Automatic vertical scroll of speech')
        self._choice['W_HEIGHT']         = sppasWxOption('int', 100, 'Initial height of a wave')
Exemplo n.º 4
0
    def __init__(self):

        ThemeDefault.__init__(self)

        # Ruler
        self._choice['R_BG_COLOUR'] = sppasWxOption('wx.Colour', (255,255,255))
        self._choice['R_FG_COLOUR'] = sppasWxOption('wx.Colour', (105,105,205))
        self._choice['R_HANDLES_COLOUR'] = sppasWxOption('wx.Colour', (167,42,152))
        self._choice['R_FONT']        = sppasWxOption('wx.Font', (10, wx.FONTFAMILY_TELETYPE, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, '', wx.FONTENCODING_UTF8))
        self._choice['R_FONT_COLOUR'] = sppasWxOption('wx.Colour', (105, 105, 205))

        # Separator
        self._choice['S_COLOUR']    = sppasWxOption('wx.Colour', (123,15,28))
        self._choice['S_PEN_WIDTH'] = sppasWxOption('int', 4)

        # Tiers:
        self._choice['T_BG_COLOUR']   = sppasWxOption('wx.Colour', (232,185,229))
        self._choice['T_RADIUS_COLOUR'] = sppasWxOption('wx.Colour', (167,42,152))
        self._choice['T_FG_COLOUR']   = sppasWxOption('wx.Colour', (167,42,152))
        self._choice['T_FONT']        = sppasWxOption('wx.Font', (9, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, '', wx.FONTENCODING_UTF8))
        self._choice['T_FONT_COLOUR'] = sppasWxOption('wx.Colour', (10, 20, 10))

        # Wave
        self._choice['W_FG_DISCO']  = sppasWxOption('bool', True)
        self._choice['W_BG_GRADIENT_COLOUR'] = sppasWxOption('wx.Colour', (232,185,229))
        self._choice['W_FG_COLOUR'] = sppasWxOption('wx.Colour', (167,42,152))
        self._choice['W_BG_COLOUR'] = sppasWxOption('wx.Colour', (255,255,255))
        self._choice['W_FONT']      = sppasWxOption('wx.Font', (8, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, '', wx.FONTENCODING_UTF8))
Exemplo n.º 5
0
    def __init__(self):

        ThemeDefault.__init__(self)

        # Ruler
        self._choice['R_BG_COLOUR'] = sppasWxOption('wx.Colour', (166,166,166))
        self._choice['R_FG_COLOUR'] = sppasWxOption('wx.Colour', (20,20,20))
        self._choice['R_HANDLES_COLOUR'] = sppasWxOption('wx.Colour', (0,0,211))
        self._choice['R_FONT']        = sppasWxOption('wx.Font', (10, wx.FONTFAMILY_SWISS, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, '', wx.FONTENCODING_UTF8))
        self._choice['R_FONT_COLOUR'] = sppasWxOption('wx.Colour', (20, 20, 20))

        # Separator
        self._choice['S_COLOUR']    = sppasWxOption('wx.Colour', (166,216,246))
        self._choice['S_PEN_WIDTH'] = sppasWxOption('int', 2)

        # Tiers:
        self._choice['T_BG_COLOUR']   = sppasWxOption('wx.Colour', (225,225,225))
        self._choice['T_RADIUS_COLOUR'] = sppasWxOption('wx.Colour', (0,0,211))
        self._choice['T_FG_COLOUR']   = sppasWxOption('wx.Colour', (10,10,10))
        self._choice['T_FONT']        = sppasWxOption('wx.Font', (10, wx.FONTFAMILY_ROMAN, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, '', wx.FONTENCODING_UTF8))
        self._choice['T_FONT_COLOUR'] = sppasWxOption('wx.Colour', (0, 0, 0))

        # Wave
        self._choice['W_FG_DISCO']  = sppasWxOption('bool', False)
        self._choice['W_BG_GRADIENT_COLOUR'] = sppasWxOption('wx.Colour', (255,255,255))
        self._choice['W_FG_COLOUR'] = sppasWxOption('wx.Colour', (10,10,10))
        self._choice['W_BG_COLOUR'] = sppasWxOption('wx.Colour', (225,225,225))
        self._choice['W_FONT']      = sppasWxOption('wx.Font', (8, wx.FONTFAMILY_ROMAN, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, '', wx.FONTENCODING_UTF8))
Exemplo n.º 6
0
    def __init__(self):

        ThemeDefault.__init__(self)

        # Ruler
        self._choice['R_BG_COLOUR'] = sppasWxOption('wx.Colour', (235,238,233))
        self._choice['R_FG_COLOUR'] = sppasWxOption('wx.Colour', (123,15,28))
        self._choice['R_HANDLES_COLOUR'] = sppasWxOption('wx.Colour', (130,40,10))
        self._choice['R_FONT'] = sppasWxOption('wx.Font', (10, wx.FONTFAMILY_TELETYPE, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, '', wx.FONTENCODING_UTF8))
        self._choice['R_FONT_COLOUR'] = sppasWxOption('wx.Colour', (130,130,130))

        # Separator
        self._choice['S_COLOUR']    = sppasWxOption('wx.Colour', (123,15,28))
        self._choice['S_PEN_WIDTH'] = sppasWxOption('int', 2)

        # Tier
        self._choice['T_BG_COLOUR'] = sppasWxOption('wx.Colour', (135,138,133))
        self._choice['T_RADIUS_COLOUR'] = sppasWxOption('wx.Colour', (252,175,62))
        self._choice['T_FG_COLOUR'] = sppasWxOption('wx.Colour', (252,175,62))
        self._choice['T_FONT'] = sppasWxOption('wx.Font', (10, wx.FONTFAMILY_MODERN, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, '', wx.FONTENCODING_UTF8))
        self._choice['T_FONT_COLOUR'] = sppasWxOption('wx.Colour', (50, 50, 50))

        # Wave
        self._choice['W_FG_DISCO']   = sppasWxOption('bool', False)
        self._choice['W_BG_COLOUR'] = sppasWxOption('wx.Colour', (135,138,133))
        self._choice['W_FG_COLOUR'] = sppasWxOption('wx.Colour', (252,175,62))
        self._choice['W_BG_GRADIENT_COLOUR'] = sppasWxOption('wx.Colour', (86, 88, 84))
        self._choice['T_FONT'] = sppasWxOption('wx.Font', (8, wx.FONTFAMILY_MODERN, wx.FONTSTYLE_NORMAL, wx.FONTWEIGHT_NORMAL, False, '', wx.FONTENCODING_UTF8))
Exemplo n.º 7
0
    def set_default(self):
        """Fix a set of default settings for a Graphical User Interface."""

        self._choice['M_BG_COLOUR'] = sppasWxOption('wx.Colour',
                                                    sppasTheme.COLOR1_BG,
                                                    "Main background color")
        self._choice['M_FG_COLOUR'] = sppasWxOption('wx.Colour',
                                                    sppasTheme.COLOR1_FG,
                                                    "Main foreground color")
        self._choice['M_FONT'] = sppasWxOption('wx.Font', sppasTheme.MAIN_FONT,
                                               "Font")

        self._choice['M_TIPS'] = sppasWxOption('bool', True,
                                               'Show tips at start-up')
        self._choice['M_OUTPUT_EXT'] = sppasWxOption('str', '.xra',
                                                     "Output file format")
        self._choice['M_ICON_THEME'] = sppasWxOption('str', 'Default',
                                                     "Icons theme")

        self._choice['M_BGD_COLOUR'] = sppasWxOption(
            'wx.Colour', sppasTheme.COLOR2_FG,
            "Secondary main background color")
        self._choice['M_FGD_COLOUR'] = sppasWxOption(
            'wx.Colour', sppasTheme.COLOR2_BG,
            "Secondary main foreground color")

        self._choice['F_SPACING'] = sppasWxOption('int', 2)

        self._choice['M_BUTTON_ICONSIZE'] = sppasWxOption('int', 32)
        self._choice['M_TREE_ICONSIZE'] = sppasWxOption('int', 16)

        # Menu
        self._choice['M_BGM_COLOUR'] = sppasWxOption('wx.Colour',
                                                     sppasTheme.COLOR2_BG,
                                                     "Menu background color")
        self._choice['M_FGM_COLOUR'] = sppasWxOption('wx.Colour',
                                                     sppasTheme.COLOR2_FG,
                                                     "Menu foreground color")
        self._choice['M_MENU_ICONSIZE'] = sppasWxOption('int', 32)

        # Toolbar
        self._choice['M_TOOLBAR_ICONSIZE'] = sppasWxOption('int', 24)
        self._choice['M_TOOLBAR_FONT'] = sppasWxOption('wx.Font',
                                                       sppasTheme.TOOLBAR_FONT,
                                                       "Font")

        # Title
        self._choice['M_HEADER_FONT'] = sppasWxOption('wx.Font',
                                                      sppasTheme.HEADER_FONT,
                                                      "Font")