Example #1
0
def bool_to_gui(bool):
    """Convert the bool into the GUI string.

    @param bool:    The boolean value of True or False.
    @type bool:     bool
    @return:        The GUI string.
    @rtype:         unicode
    """

    # Convert.
    return unicode(bool)
Example #2
0
def bool_to_gui(bool):
    """Convert the bool into the GUI string.

    @param bool:    The boolean value of True or False.
    @type bool:     bool
    @return:        The GUI string.
    @rtype:         unicode
    """

    # Convert.
    return unicode(bool)
Example #3
0
def float_to_gui(num):
    """Convert the float into the GUI string.

    @param num:     The number in float or None form.
    @type num:      float or None
    @return:        The GUI string.
    @rtype:         unicode
    """

    # No input.
    if num == None:
        num = ''

    # Convert.
    return unicode(num)
Example #4
0
def tuple_to_gui(tuple):
    """Convert the tuple into the GUI string.

    @param tuple:   The Python tuple.
    @type tuple:    tuple or None
    @return:        The GUI string.
    @rtype:         unicode
    """

    # No input.
    if tuple == None:
        tuple = ''

    # Convert.
    return unicode(tuple)
Example #5
0
def str_to_gui(string):
    """Convert the string into the GUI string.

    @param string:  The string or None to convert.
    @type string:   str or None
    @return:        The GUI string.
    @rtype:         unicode
    """

    # No input.
    if string == None:
        string = ''

    # Convert.
    return unicode(string)
Example #6
0
def float_to_gui(num):
    """Convert the float into the GUI string.

    @param num:     The number in float or None form.
    @type num:      float or None
    @return:        The GUI string.
    @rtype:         unicode
    """

    # No input.
    if num == None:
        num = ''

    # Convert.
    return unicode(num)
Example #7
0
def tuple_to_gui(tuple):
    """Convert the tuple into the GUI string.

    @param tuple:   The Python tuple.
    @type tuple:    tuple or None
    @return:        The GUI string.
    @rtype:         unicode
    """

    # No input.
    if tuple == None:
        tuple = ''

    # Convert.
    return unicode(tuple)
Example #8
0
def str_to_gui(string):
    """Convert the string into the GUI string.

    @param string:  The string or None to convert.
    @type string:   str or None
    @return:        The GUI string.
    @rtype:         unicode
    """

    # No input.
    if string == None:
        string = ''

    # Convert.
    return unicode(string)
Example #9
0
def py_to_gui(value):
    """Super function for converting a Python object to a GUI string.

    @param value:   The value.
    @type value:    anything
    @return:        The Python object in GUI string form.
    @rtype:         unicode
    """

    # No input.
    if value == None:
        string = ''

    # All other types.
    else:
        string = unicode(value)

    # Return the GUI string.
    return string
Example #10
0
def list_to_gui(list):
    """Convert the list into the GUI string.

    @param list:    The Python list.
    @type list:     list or None
    @return:        The GUI string.
    @rtype:         unicode
    """

    # No input.
    if list == None:
        list = ''

    # Handle numpy arrays.
    if isinstance(list, ndarray):
        list = list.tolist()

    # Convert.
    return unicode(list)
Example #11
0
def py_to_gui(value):
    """Super function for converting a Python object to a GUI string.

    @param value:   The value.
    @type value:    anything
    @return:        The Python object in GUI string form.
    @rtype:         unicode
    """

    # No input.
    if value == None:
        string = ''

    # All other types.
    else:
        string = unicode(value)

    # Return the GUI string.
    return string
Example #12
0
def list_to_gui(list):
    """Convert the list into the GUI string.

    @param list:    The Python list.
    @type list:     list or None
    @return:        The GUI string.
    @rtype:         unicode
    """

    # No input.
    if list == None:
        list = ''

    # Handle numpy arrays.
    if isinstance(list, ndarray):
        list = list.tolist()

    # Convert.
    return unicode(list)
Example #13
0
    def create_subtitle(self, text):
        """Generate the subtitle wx.StaticText object.

        @param text:    The text of the subtitle.
        @type text:     str
        @return:        The subtitle object.
        @rtype:         wx.StaticText instance
        """

        # Unicode.
        text = unicode(text)

        # Fix for the '&' character.
        text = text.replace('&', '&&')

        # The object.
        obj = wx.StaticText(self.parent, -1, text)

        # Formatting.
        obj.SetFont(wx.Font(pointSize=16, family=wx.FONTFAMILY_ROMAN, style=wx.ITALIC, weight=wx.NORMAL, face='Times'))

        # Return the object.
        return obj