Exemple #1
0
    def __init__(self,
                 title,
                 item_value,
                 item_width=None,
                 font_size=DEFAULT_FONT_SIZE,
                 ):
        '''
        Initialize ComboTextItem class.

        @param title: Title of item, we use this for display name (include internationalization).
        @param item_value: The value of item, use for index item in program.
        @param item_width: The width of item, default is None to calculate width with item content.
        @param font_size: Font size of item, default is DEFAULT_FONT_SIZE.
        '''
        AbstractItem.__init__(self)
        self.column_index = 0
        self.item_height = 22
        self.spacing_x = 15
        self.padding_x = 5
        self.font_size = font_size
        if item_width == None:
            self.item_width, _ = get_content_size(title, font_size)
            self.item_width += self.spacing_x * 2
        else:
            self.item_width = item_width
        self.title = title
        self.item_value = item_value
Exemple #2
0
    def __init__(
        self,
        title,
        item_value,
        item_width=None,
        font_size=DEFAULT_FONT_SIZE,
    ):
        '''
        Initialize ComboTextItem class.

        @param title: Title of item, we use this for display name (include internationalization).
        @param item_value: The value of item, use for index item in program.
        @param item_width: The width of item, default is None to calculate width with item content.
        @param font_size: Font size of item, default is DEFAULT_FONT_SIZE.
        '''
        AbstractItem.__init__(self)
        self.column_index = 0
        self.item_height = 22
        self.spacing_x = 15
        self.padding_x = 5
        self.font_size = font_size
        if item_width == None:
            self.item_width, _ = get_content_size(title, font_size)
            self.item_width += self.spacing_x * 2
        else:
            self.item_width = item_width
        self.title = title
        self.item_value = item_value
 def __init__(self, title, content):
     TreeItem.__init__(self)
     self.title = title
     self.entry = None
     self.entry_buffer = EntryBuffer(content)
     self.entry_buffer.set_property('cursor-visible', False)
     self.entry_buffer.connect("changed", self.entry_buffer_changed)
     self.entry_buffer.connect("insert-pos-changed", self.entry_buffer_changed)
     self.entry_buffer.connect("selection-pos-changed", self.entry_buffer_changed)
     self.child_items = []
     self.height = 24
     self.ENTRY_COLUMN = 1
     self.is_double_click = False
Exemple #4
0
 def __init__(self, icon_dpixbufs, text, text_size=DEFAULT_FONT_SIZE, icon_width=16, padding_x=10, padding_y=6):
     """
     Initialize IconTextItem class.
     """
     # Init.
     TreeItem.__init__(self)
     (self.icon_normal_dpixbuf, self.icon_hover_dpixbuf, self.icon_disable_dpixbuf) = icon_dpixbufs
     self.item_width = 160
     self.text = text
     self.text_size = text_size
     self.icon_width = 16
     self.padding_x = padding_x
     self.padding_y = padding_y
     (self.text_width, self.text_height) = get_content_size(self.text)
Exemple #5
0
 def __init__(self, title, content):
     TreeItem.__init__(self)
     self.title = title
     self.entry = None
     self.entry_buffer = EntryBuffer(content)
     self.entry_buffer.set_property('cursor-visible', False)
     self.entry_buffer.connect("changed", self.entry_buffer_changed)
     self.entry_buffer.connect("insert-pos-changed",
                               self.entry_buffer_changed)
     self.entry_buffer.connect("selection-pos-changed",
                               self.entry_buffer_changed)
     self.child_items = []
     self.height = 24
     self.ENTRY_COLUMN = 1
     self.is_double_click = False
Exemple #6
0
 def __init__(self, gfile, column_index=0):
     '''
     Initialize FileItem class.
     '''
     TreeItem.__init__(self)
     self.gfile = gfile
     self.type = get_gfile_type(self.gfile)
     self.name = get_gfile_name(self.gfile)
     self.modification_time = get_gfile_modification_time(self.gfile)
     self.content_type = get_gfile_content_type(self.gfile)
     self.size = get_gfile_size(self.gfile)
     self.size_name = format_file_size(self.size)
     self.file_path = gfile.get_path()
     self.pixbuf = None
     self.column_index = column_index
     self.name_width = get_name_width(self.column_index, self.name)
     self.modification_time_width = get_modification_time_width(self.modification_time)
     self.content_type_width = get_type_width(self.content_type)
     self.size_width = get_size_width(self.size_name)
Exemple #7
0
 def __init__(self, gfile, column_index=0):
     '''
     Initialize FileItem class.
     '''
     TreeItem.__init__(self)
     self.gfile = gfile
     self.type = get_gfile_type(self.gfile)
     self.name = get_gfile_name(self.gfile)
     self.modification_time = get_gfile_modification_time(self.gfile)
     self.content_type = get_gfile_content_type(self.gfile)
     self.size = get_gfile_size(self.gfile)
     self.size_name = format_file_size(self.size)
     self.file_path = gfile.get_path()
     self.pixbuf = None
     self.column_index = column_index
     self.name_width = get_name_width(self.column_index, self.name)
     self.modification_time_width = get_modification_time_width(self.modification_time)
     self.content_type_width = get_type_width(self.content_type)
     self.size_width = get_size_width(self.size_name)
Exemple #8
0
 def __init__(self,
              icon_dpixbufs,
              text,
              text_size=DEFAULT_FONT_SIZE,
              icon_width=16,
              padding_x=10,
              padding_y=6):
     '''
     Initialize IconTextItem class.
     '''
     # Init.
     TreeItem.__init__(self)
     (self.icon_normal_dpixbuf, self.icon_hover_dpixbuf,
      self.icon_disable_dpixbuf) = icon_dpixbufs
     self.item_width = 160
     self.text = text
     self.text_size = text_size
     self.icon_width = 16
     self.padding_x = padding_x
     self.padding_y = padding_y
     (self.text_width, self.text_height) = get_content_size(self.text)
Exemple #9
0
 def __init__(self, gfile, column_index=0):
     '''
     Initialize DirItem class.
     '''
     # Init.
     TreeItem.__init__(self)
     self.gfile = gfile
     self.type = get_gfile_type(self.gfile)
     self.name = get_gfile_name(self.gfile)
     self.modification_time = get_gfile_modification_time(self.gfile)
     self.content_type = get_gfile_content_type(self.gfile)
     self.size = get_gfile_size(self.gfile)
     self.size_name = "%s 项" % (self.size)
     self.directory_path = gfile.get_path()
     self.pixbuf = None
     self.column_index = column_index
     self.is_expand = False
     self.load_status = self.LOADING_INIT
     self.name_width = get_name_width(self.column_index, self.name)
     self.modification_time_width = get_modification_time_width(self.modification_time)
     self.content_type_width = get_type_width(self.content_type)
     self.size_width = get_size_width(self.size_name)
Exemple #10
0
 def __init__(self, gfile, column_index=0):
     '''
     Initialize DirItem class.
     '''
     # Init.
     TreeItem.__init__(self)
     self.gfile = gfile
     self.type = get_gfile_type(self.gfile)
     self.name = get_gfile_name(self.gfile)
     self.modification_time = get_gfile_modification_time(self.gfile)
     self.content_type = get_gfile_content_type(self.gfile)
     self.size = get_gfile_size(self.gfile)
     self.size_name = "%s 项" % (self.size)
     self.directory_path = gfile.get_path()
     self.pixbuf = None
     self.column_index = column_index
     self.is_expand = False
     self.load_status = self.LOADING_INIT
     self.name_width = get_name_width(self.column_index, self.name)
     self.modification_time_width = get_modification_time_width(self.modification_time)
     self.content_type_width = get_type_width(self.content_type)
     self.size_width = get_size_width(self.size_name)
Exemple #11
0
 def __init__(self, column_index=0):
     '''
     Initialize EmptyItem class.
     '''
     TreeItem.__init__(self)
     self.column_index = column_index
Exemple #12
0
 def __init__(self, column_index=0):
     '''
     Initialize EmptyItem class.
     '''
     TreeItem.__init__(self)
     self.column_index = column_index