当前位置: 首页>>代码示例>>Python>>正文


Python table.Table类代码示例

本文整理汇总了Python中efl.elementary.table.Table的典型用法代码示例。如果您正苦于以下问题:Python Table类的具体用法?Python Table怎么用?Python Table使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Table类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

    def __init__(self, parent, commit, show_full_msg=False):
        self.commit = commit

        Table.__init__(self, parent,  padding=(5,5))
        self.show()

        pic = GravatarPict(self)
        pic.size_hint_align = 0.0, 0.0
        pic.email_set(commit.author_email)
        self.pack(pic, 0, 0, 1, 1)
        pic.show()

        if commit.committer and commit.committer != commit.author:
            committed = '<name>Committed by:</name> <b>{}</b><br>'.format(
                        commit.committer)
        else:
            committed = ''
        text = '<name>{}</name>  <b>{}</b>  {}<br>{}<br>{}'.format(
                commit.sha[:9], commit.author, format_date(commit.commit_date), 
                committed, utf8_to_markup(commit.title))
        if show_full_msg:
            text += '<br><br>{}'.format(utf8_to_markup(commit.message))
        en = Entry(self, text=text, line_wrap=ELM_WRAP_NONE,
                   size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
        self.pack(en, 1, 0, 1, 1)
        en.show()
开发者ID:DaveMDS,项目名称:egitu,代码行数:26,代码来源:utils.py

示例2: photo_clicked

def photo_clicked(obj):
    win = StandardWindow("photo", "Photo test", autodel=True, size=(300, 300))
    if obj is None:
        win.callback_delete_request_add(lambda o: elementary.exit())

    elementary.need_ethumb()

    tb = Table(win, size_hint_weight=EXPAND_BOTH)
    tb.show()

    sc = Scroller(win, size_hint_weight=EXPAND_BOTH, content=tb)
    win.resize_object_add(sc)
    sc.show()

    n = 0
    for j in range(12):
        for i in range(12):
            ph = Photo(win, aspect_fixed=False, size=80, editable=True,
                size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
            name = os.path.join(img_path, images[n])
            n += 1
            if n >= 9: n = 0
            if n == 8:
                ph.thumb = name
            else:
                ph.file = name
            if n in [2, 3]:
                ph.fill_inside = True
                ph.style = "shadow"

            tb.pack(ph, i, j, 1, 1)
            ph.show()

    win.show()
开发者ID:maikodaraine,项目名称:EnlightenmentUbuntu,代码行数:34,代码来源:test_photo.py

示例3: video_clicked

def video_clicked(obj):
    win = StandardWindow("video", "video", autodel=True, size=(800, 600))
    win.alpha = True # Needed to turn video fast path on

    video = Video(win, size_hint_weight=EXPAND_BOTH)
    win.resize_object_add(video)
    video.show()

    player = Player(win, content=video)
    player.show()

    notify = Notify(win, orient=ELM_NOTIFY_ORIENT_BOTTOM, timeout=3.0)
    notify.content = player

    tb = Table(win, size_hint_weight=EXPAND_BOTH)
    win.resize_object_add(tb)

    bt = FileselectorButton(win, text="Select Video",
        size_hint_weight=EXPAND_BOTH, size_hint_align=(0.5, 0.1))
    bt.callback_file_chosen_add(my_bt_open, video)
    tb.pack(bt, 0, 0, 1, 1)
    bt.show()

    tb.show()

    video.event_callback_add(EVAS_CALLBACK_MOUSE_MOVE, notify_show, notify)
    video.event_callback_add(EVAS_CALLBACK_MOUSE_IN, notify_block, notify)
    video.event_callback_add(EVAS_CALLBACK_MOUSE_OUT, notify_unblock, notify)

    win.show()
开发者ID:maikodaraine,项目名称:EnlightenmentUbuntu,代码行数:30,代码来源:test_video.py

示例4: __init__

    def __init__(self, parent, session):
        Frame.__init__(self, parent)

        self.text = "Limits"
        self.size_hint_align = FILL_HORIZ

        base = 1024
        units = ( "bytes/s", "KiB/s", "MiB/s", "GiB/s", "TiB/s" )

        t = Table(parent)
        for r, values in enumerate((
            ("Upload limit", session.upload_rate_limit, session.set_upload_rate_limit),
            ("Download limit", session.download_rate_limit, session.set_download_rate_limit),
            ("Upload limit for local connections", session.local_upload_rate_limit, session.set_local_upload_rate_limit),
            ("Download limit for local connections", session.local_download_rate_limit, session.set_local_download_rate_limit),
        )):
            title, rfunc, wfunc = values

            l = Label(parent)
            l.text = title
            l.size_hint_align = FILL_HORIZ
            t.pack(l, 0, r, 1, 1)
            l.show()

            usw = UnitSpinner(parent, base, units)
            usw.size_hint_weight = EXPAND_HORIZ
            usw.size_hint_align = FILL_HORIZ
            usw.set_value(rfunc())
            usw.callback_changed_add(wfunc, delay=2.0)
            t.pack(usw, 1, r, 1, 1)
            usw.show()

        self.content = t
开发者ID:maikodaraine,项目名称:EnlightenmentUbuntu,代码行数:33,代码来源:Preferences.py

示例5: __init__

    def __init__(self, parent, *args, **kargs):
        self.repo = None
        self.win = parent
        self.themef = theme_file_get()
        self.colors = [(0,100,0,100), (0,0,100,100), (100,0,0,100),
                      (100,100,0,100), (0,100,100,100), (100,0,100,100)]

        Table.__init__(self, parent, homogeneous=True, padding=(0,0))
开发者ID:simotek,项目名称:egitu,代码行数:8,代码来源:dagview.py

示例6: __init__

    def __init__(self, win, url=None):
        Popup.__init__(self, win)
        self.win = win

        # title
        self.part_text_set('title,text', 'Recent Repositories')
        ic = Icon(self, file=theme_resource_get('egitu.png'))
        self.part_content_set('title,icon', ic)

        # content: recent list
        li = List(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
        li.callback_activated_add(self.recent_selected_cb)

        recents = recent_history_get()
        if recents:
            for recent_url in recents:
                path, name = os.path.split(recent_url)
                item = li.item_append(name)
                item.data['url'] = recent_url
        else:
            item = li.item_append('no recent repository')
            item.disabled = True
        li.show()

        # table+rect to respect min size :/
        tb = Table(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
        r = Rectangle(self.evas, color=(0,0,0,0), size_hint_min=(200,200),
                      size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
        tb.pack(r, 0, 0, 1, 1)
        tb.pack(li, 0, 0, 1, 1)
        self.content = tb

        # popup auto-list - not expand well :(
        # self.size_hint_weight = EXPAND_BOTH
        # self.size_hint_align = FILL_BOTH
        # self.size_hint_min = 400, 400
        # self.item_append('no recent repos', None)
        # self.item_append('asd2', None)
        # self.item_append('asd2', None)

        # buttons
        bt = Button(self, text='Open')
        bt.callback_clicked_add(self.load_btn_cb)
        self.part_content_set('button1', bt)

        bt = Button(self, text='Clone (TODO)')
        bt.disabled = True
        self.part_content_set('button2', bt)

        bt = Button(self, text='Create (TODO)')
        bt.disabled = True
        self.part_content_set('button3', bt)

        if url is not None:
            self.try_to_load(url)
        else:
            self.callback_block_clicked_add(lambda p: p.delete())
            self.show()
开发者ID:simotek,项目名称:egitu,代码行数:58,代码来源:gui.py

示例7: table4_clicked

def table4_clicked(obj, item=None):
    win = StandardWindow("table4", "Table 4", autodel=True)

    tb = Table(win, size_hint_weight=EXPAND_BOTH)
    win.resize_object_add(tb)
    win.data["tb"] = tb
    tb.show()

    bt = Button(win, text="Button 1", size_hint_weight=(0.25, 0.25),
        size_hint_align=FILL_BOTH)
    tb.pack(bt, 0, 0, 1, 1)
    win.data["b1"] = bt
    bt.callback_clicked_add(my_tb_ch, win)
    bt.show()

    bt = Button(win, text="Button 2", size_hint_weight=(0.75, 0.25),
        size_hint_align=FILL_BOTH)
    tb.pack(bt, 1, 0, 1, 1)
    win.data["b2"] = bt
    bt.callback_clicked_add(my_tb_ch, win)
    bt.show()

    bt = Button(win, text="Button 3", size_hint_weight=(0.25, 0.75),
        size_hint_align=FILL_BOTH)
    tb.pack(bt, 0, 1, 1, 1)
    win.data["b3"] = bt
    bt.callback_clicked_add(my_tb_ch, win)
    bt.show()

    win.show()
开发者ID:maikodaraine,项目名称:EnlightenmentUbuntu,代码行数:30,代码来源:test_table.py

示例8: __init__

    def __init__(self, parent_widget, titles=None, initial_sort=0,
        ascending=True, *args, **kwargs):

        self.header = titles
        self.sort_column = initial_sort
        self.sort_column_ascending = ascending

        self.rows = []
        self.header_row = []

        Table.__init__(self, parent_widget, *args, **kwargs)

        if titles is not None:
            self.header_row_pack(titles)
开发者ID:JeffHoogland,项目名称:eccess,代码行数:14,代码来源:sortedlist.py

示例9: __init__

    def __init__(self, parent, app):
        self.app = app
        self.commit = None
        self.win = parent

        Table.__init__(self, parent,  padding=(5,5))
        self.show()

        # description entry
        self.entry = Entry(self, text='Unknown', line_wrap=ELM_WRAP_MIXED,
                           size_hint_weight=EXPAND_BOTH,
                           size_hint_align=FILL_BOTH,
                           editable=False)
        self.pack(self.entry, 0, 0, 1, 1)
        self.entry.show()

        # gravatar picture
        self.picture = GravatarPict(self)
        self.picture.size_hint_align = 1.0, 0.0
        self.picture.show()
        self.pack(self.picture, 1, 0, 1, 1)

        # action buttons box
        self.action_box = Box(self, horizontal=True,
                              size_hint_weight=EXPAND_HORIZ,
                              size_hint_align=(1.0, 1.0))
        self.pack(self.action_box, 0, 1, 2, 1)
        self.action_box.show()

        # panes
        panes = Panes(self, content_left_size = 0.3, horizontal=True,
                      size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
        self.pack(panes, 0, 2, 2, 1)
        panes.show()

        # file list
        self.itc = GenlistItemClass(item_style='default',
                                    text_get_func=self._gl_text_get,
                                    content_get_func=self._gl_content_get)
        self.diff_list = Genlist(self, homogeneous=True, mode=ELM_LIST_COMPRESS,
                                 select_mode=ELM_OBJECT_SELECT_MODE_ALWAYS,
                                 size_hint_weight=EXPAND_BOTH,
                                 size_hint_align=FILL_BOTH)
        self.diff_list.callback_selected_add(self._list_selected_cb)
        panes.part_content_set('left', self.diff_list)

        # diff entry
        self.diff_entry = DiffedEntry(self)
        panes.part_content_set('right', self.diff_entry)
开发者ID:druonysus,项目名称:egitu,代码行数:49,代码来源:diffview.py

示例10: __init__

    def __init__(self, parent, repo):
        self.repo = repo
        self.commit = None
        self.win = parent

        Table.__init__(self, parent,  padding=(5,5))
        self.show()

        # gravatar picture
        self.picture = GravatarPict(self)
        self.picture.size_hint_align = 0.0, 0.0
        self.picture.show()
        self.pack(self.picture, 0, 0, 1, 2)

        # description entry
        self.entry = Entry(self, text="Unknown", line_wrap=ELM_WRAP_MIXED,
                           size_hint_weight=EXPAND_BOTH,
                           size_hint_align=FILL_BOTH,
                           editable=False)
        self.pack(self.entry, 1, 0, 1, 1)
        self.entry.show()

        # action buttons box
        self.action_box = Box(self, horizontal=True,
                              size_hint_weight=EXPAND_HORIZ,
                              size_hint_align=(0.98, 0.98))
        self.pack(self.action_box, 1, 1, 1, 1)
        self.action_box.show()

        # panes
        panes = Panes(self, content_left_size = 0.3, horizontal=True,
                      size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
        self.pack(panes, 0, 2, 2, 1)
        panes.show()

        # file list
        self.diff_list = List(self, size_hint_weight=EXPAND_BOTH,
                                    size_hint_align=FILL_BOTH)
        self.diff_list.callback_selected_add(self.change_selected_cb)
        panes.part_content_set("left", self.diff_list)

        # diff entry
        self.diff_entry = DiffedEntry(self)
        panes.part_content_set("right", self.diff_entry)
开发者ID:simotek,项目名称:egitu,代码行数:44,代码来源:diffview.py

示例11: fileExists

    def fileExists(self, filePath):

        self.confirmPopup = Popup(self.mainWindow,
                                  size_hint_weight=EXPAND_BOTH)

        # Add a table to hold dialog image and text to Popup
        tb = Table(self.confirmPopup, size_hint_weight=EXPAND_BOTH)
        self.confirmPopup.part_content_set("default", tb)
        tb.show()

        # Add dialog-error Image to table
        need_ethumb()
        icon = Icon(self.confirmPopup, thumb='True')
        icon.standard_set('dialog-question')
        # Using gksudo or sudo fails to load Image here
        #   unless options specify using preserving their existing environment.
        #   may also fail to load other icons but does not raise an exception
        #   in that situation.
        # Works fine using eSudo as a gksudo alternative,
        #   other alternatives not tested
        try:
            dialogImage = Image(self.confirmPopup,
                                size_hint_weight=EXPAND_HORIZ,
                                size_hint_align=FILL_BOTH,
                                file=icon.file_get())
            tb.pack(dialogImage, 0, 0, 1, 1)
            dialogImage.show()
        except RuntimeError:
            # An error message is displayed for this same error
            #   when aboutWin is initialized so no need to redisplay.
            pass
        # Add dialog text to table
        dialogLabel = Label(self.confirmPopup, line_wrap=ELM_WRAP_WORD,
                            size_hint_weight=EXPAND_HORIZ,
                            size_hint_align=FILL_BOTH)
        current_file = os.path.basename(filePath)
        dialogLabel.text = "'%s' already exists. Overwrite?<br><br>" \
                           % (current_file)
        tb.pack(dialogLabel, 1, 0, 1, 1)
        dialogLabel.show()

        # Close without saving button
        no_btt = Button(self.mainWindow)
        no_btt.text = "No"
        no_btt.callback_clicked_add(self.closePopup, self.confirmPopup)
        no_btt.show()
        # Save the file and then close button
        sav_btt = Button(self.mainWindow)
        sav_btt.text = "Yes"
        sav_btt.callback_clicked_add(self.doSelected)
        sav_btt.callback_clicked_add(self.closePopup, self.confirmPopup)
        sav_btt.show()

        # add buttons to popup
        self.confirmPopup.part_content_set("button1", no_btt)
        self.confirmPopup.part_content_set("button3", sav_btt)
        self.confirmPopup.show()
开发者ID:emctoo,项目名称:ePad,代码行数:57,代码来源:ePad.py

示例12: thumb_clicked

def thumb_clicked(obj):
    if not elementary.need_ethumb():
        print("Ethumb not available!")
        return

    images = (
        "panel_01.jpg",
        "plant_01.jpg",
        "rock_01.jpg",
        "rock_02.jpg",
        "sky_01.jpg",
        "sky_02.jpg",
        "sky_03.jpg",
        "sky_04.jpg",
        "wood_01.jpg",
        "mystrale.jpg",
        "mystrale_2.jpg"
    )

    win = StandardWindow("thumb", "Thumb", autodel=True, size=(600, 600))
    if obj is None:
        win.callback_delete_request_add(lambda o: elementary.exit())

    tb = Table(win, size_hint_weight=EXPAND_BOTH)

    n = 0
    for j in range(12):
        for i in range(12):
            n = (n + 1) % 11
            th = Thumb(win, file=os.path.join(img_path, images[n]),
                size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH,
                editable=True)
            tb.pack(th, i, j, 1, 1)
            th.show()

    sc = Scroller(win, size_hint_weight=EXPAND_BOTH, content=tb)
    win.resize_object_add(sc)

    tb.show()
    sc.show()

    win.show()
开发者ID:maikodaraine,项目名称:EnlightenmentUbuntu,代码行数:42,代码来源:test_thumb.py

示例13: _file_change

    def _file_change(self):
        # hack to make popup respect min_size
        rect = Rectangle(self.parent.evas, size_hint_min=(400,400))
        tb = Table(self.parent)
        tb.pack(rect, 0, 0, 1, 1)

        # show the fileselector inside a popup
        popup = Popup(self.top_widget, content=tb)
        popup.part_text_set('title,text', 'Choose the Todo.txt file to use')
        popup.show()

        # the fileselector widget
        fs = Fileselector(popup, is_save=False, expandable=False,
                        size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
        fs.callback_activated_add(self._file_change_done, popup)
        fs.callback_done_add(self._file_change_done, popup)
        try:
            fs.selected = options.txt_file
        except:
            fs.path = os.path.expanduser('~')
        fs.show()
        tb.pack(fs, 0, 0, 1, 1)
开发者ID:mwarchulinski,项目名称:edone,代码行数:22,代码来源:gui.py

示例14: __init__

    def __init__(self):
        """Creates the window and its contents.

        :attribute memory: The first operand.
        :attribute operand: The operand to join the both values.
        :attribute field: The input/display field.
        :attribute table: Formatting table holding the buttons.
        """
        # Create mathematical attributes.
        self.memory = ''
        self.operand = None
        self.display_is_result = False
        # Create the main window.
	self.window = StandardWindow("eCalculate", "eCalculate", autodel=True, size=(300, 300))
        # Create box that holds all GUI elements.
        box = Box(self.window, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
        self.window.resize_object_add(box)
        box.show()
        # Create Input field.
        self.field = Entry(self.window, single_line=True,
                           size_hint_weight=EXPAND_HORIZONTAL,
                           size_hint_align=FILL_HORIZONTAL)
        self.field.markup_filter_append(self.filter_markup)
        box.pack_end(self.field)
        self.field.show()
        # Create table holding the buttons.
        self.table = Table(self.window, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH)
        box.pack_end(self.table)
        self.table.show()
        # Create buttons.
        self.add_button(x=0, y=2, text='1', char='1') 
        self.add_button(x=1, y=2, text='2', char='2') 
        self.add_button(x=2, y=2, text='3', char='3') 
        self.add_button(x=0, y=1, text='4', char='4') 
        self.add_button(x=1, y=1, text='5', char='5') 
        self.add_button(x=2, y=1, text='6', char='6') 
        self.add_button(x=0, y=0, text='7', char='7') 
        self.add_button(x=1, y=0, text='8', char='8') 
        self.add_button(x=2, y=0, text='9', char='9') 
        self.add_button(x=0, y=3, text='0', char='0') 
        self.add_button(x=4, y=0, text='÷', char='/') 
        self.add_button(x=4, y=1, text='×', char='*') 
        self.add_button(x=4, y=2, text='−', char='-') 
        self.add_button(x=4, y=3, text='+', char='+') 
        self.add_button(x=2, y=3, text='=', char='=')
        self.add_button(x=1, y=3, text='.', char='.')
        # Finally show the window.
        self.window.show()
开发者ID:pyfisch,项目名称:ecalculate,代码行数:48,代码来源:ecalculate.py

示例15: errorPopup

def errorPopup(window, errorMsg):
    errorPopup = Popup(window, size_hint_weight=EXPAND_BOTH)
    errorPopup.callback_block_clicked_add(lambda obj: errorPopup.delete())

    # Add a table to hold dialog image and text to Popup
    tb = Table(errorPopup, size_hint_weight=EXPAND_BOTH)
    errorPopup.part_content_set("default", tb)
    tb.show()

    # Add dialog-error Image to table
    need_ethumb()
    icon = Icon(errorPopup, thumb='True')
    icon.standard_set('dialog-warning')
    # Using gksudo or sudo fails to load Image here
    #   unless options specify using preserving their existing environment.
    #   may also fail to load other icons but does not raise an exception
    #   in that situation.
    # Works fine using eSudo as a gksudo alternative,
    #   other alternatives not tested
    try:
        dialogImage = Image(errorPopup,
                            size_hint_weight=EXPAND_HORIZ,
                            size_hint_align=FILL_BOTH,
                            file=icon.file_get())
        tb.pack(dialogImage, 0, 0, 1, 1)
        dialogImage.show()
    except RuntimeError:
        # An error message is displayed for this same error
        #   when aboutWin is initialized so no need to redisplay.
        pass
    # Add dialog text to table
    dialogLabel = Label(errorPopup, line_wrap=ELM_WRAP_WORD,
                        size_hint_weight=EXPAND_HORIZ,
                        size_hint_align=FILL_BOTH)
    dialogLabel.text = errorMsg
    tb.pack(dialogLabel, 1, 0, 1, 1)
    dialogLabel.show()

    # Ok Button
    ok_btt = Button(errorPopup)
    ok_btt.text = "Ok"
    ok_btt.callback_clicked_add(lambda obj: errorPopup.delete())
    ok_btt.show()

    # add button to popup
    errorPopup.part_content_set("button3", ok_btt)
    errorPopup.show()
开发者ID:emctoo,项目名称:ePad,代码行数:47,代码来源:ePad.py


注:本文中的efl.elementary.table.Table类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。