JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3RbrJFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbrў fFc@sdZddlTGdddeZGdddeZGdddeZGd d d eZed kre Z ee d d dgddde Z e j dededeee jd jddddj ee jd jddddj ee jdjddj ee Zee dddddZee dddddZee ddZej d d!dd!ej d d!dd!ej d d!ej d d!e jnd"S(#uAn implementation of tabbed pages using only standard Tkinter. Originally developed for use in IDLE. Based on tabpage.py. Classes exported: TabbedPageSet -- A Tkinter implementation of a tabbed-page widget. TabSet -- A widget containing tabs (buttons) in one or more rows. i(u*cBs|EeZdZdS(uInvalidNameErrorN(u__name__u __module__u __qualname__(u __locals__((u8/opt/alt/python33/lib64/python3.3/idlelib/tabbedpages.pyuInvalidNameError suInvalidNameErrorcBs|EeZdZdS(uAlreadyExistsErrorN(u__name__u __module__u __qualname__(u __locals__((u8/opt/alt/python33/lib64/python3.3/idlelib/tabbedpages.pyuAlreadyExistsError suAlreadyExistsErrorcBs|EeZdZdZddddddZddZdd Zd d Z d d Z ddZ ddZ Gddde ZdS(uTabSetujA widget containing tabs (buttons) in one or more rows. Only one tab may be selected at a time. iic Kstj|||||_||_||_||_||_i|_i|_|rjt ||_ n g|_ d |_ g|_ t|dddddtd|jd|_|jjdtdtd d |jd S( uConstructor arguments: select_command -- A callable which will be called when a tab is selected. It is called with the name of the selected tab as an argument. tabs -- A list of strings, the names of the tabs. Should be specified in the desired tab order. The first tab will be the default and first active tab. If tabs is None or empty, the TabSet will be initialized empty. n_rows -- Number of rows of tabs to be shown. If n_rows <= 0 or is None, then the number of rows will be decided by TabSet. See _arrange_tabs() for details. max_tabs_per_row -- Used for deciding how many rows of tabs are needed, when the number of rows is not constant. See _arrange_tabs() for details. uheightiu borderwidthiureliefu backgroundusideufilluexpandNF(uFrameu__init__uselect_commandun_rowsumax_tabs_per_rowu expand_tabsupage_setu_tabsu_tab2rowulistu _tab_namesuNoneu _selected_tabu _tab_rowsuFLATucgetu padding_frameupackuTOPuXuFalseu _arrange_tabs(uselfupage_setuselect_commandutabsun_rowsumax_tabs_per_rowu expand_tabsukw((u8/opt/alt/python33/lib64/python3.3/idlelib/tabbedpages.pyu__init__s$           uTabSet.__init__cCsY|std|n||jkr;td|n|jj||jdS(u.Add a new tab with the name given in tab_name.uInvalid Tab name: '%s'uTab named '%s' already existsN(uInvalidNameErroru _tab_namesuAlreadyExistsErroruappendu _arrange_tabs(uselfutab_name((u8/opt/alt/python33/lib64/python3.3/idlelib/tabbedpages.pyuadd_tabDs uTabSet.add_tabcCs@||jkr"td|n|jj||jdS(uRemove the tab named uNo such Tab: '%sN(u _tab_namesuKeyErroruremoveu _arrange_tabs(uselfutab_name((u8/opt/alt/python33/lib64/python3.3/idlelib/tabbedpages.pyu remove_tabNsuTabSet.remove_tabcCs||jkrdS|dk rA||jkrAtd|n|jdk rg|j|jjnd|_|dk r||_|j|}|j|j|}|j|jdt dt ddndS(u1Show the tab named as the selected oneNuNo such Tab: '%susideufilluexpandi( u _selected_tabuNoneu_tabsuKeyErroru set_normalu set_selectedu_tab2rowu pack_forgetupackuTOPuX(uselfutab_nameutabutab_row((u8/opt/alt/python33/lib64/python3.3/idlelib/tabbedpages.pyuset_selected_tabVs       uTabSet.set_selected_tabcCs|s dSt|}|jdtdtdd|jj|xx|D]p}tj||j||}|r|jdt dtddn|jdt ||j |<||j |dS|jdk rh|jdkrh|j}nt|jd|jd}|j p|dk}d}xht |D]Z}t|j|d||d}|j|||}||7}|j ||qW|j }|j d||jkrA|j |ndS(uW Arrange the tabs in rows, in the order in which they were added. If n_rows >= 1, this will be the number of rows used. Otherwise the number of rows will be calculated according to the number of tabs and max_tabs_per_row. In this case, the number of rows may change when adding/removing tabs. iNi(u_tabsupopitemudestroyu_reset_tab_rowsu _tab_namesun_rowsuNoneulenumax_tabs_per_rowu expand_tabsurangeu _add_tab_rowu _selected_tabuset_selected_tab(uselfun_rowsu expand_tabsuiu row_indexun_tabsu tab_namesuselected((u8/opt/alt/python33/lib64/python3.3/idlelib/tabbedpages.pyu _arrange_tabss&    #   uTabSet._arrange_tabscBsk|EeZdZdZdZddZddZddZd d Zd d Z dd dZ dS(uTabSet.TabButtonuA simple tab-like widget.icCstj||d|jdt||_||_||_d|_t |d|d|j ddddd t d t d d d ddd  |_ |j j dtdtdd|j|jdS(uConstructor arguments: name -- The tab's name, which will appear in its button. select_command -- The command to be called upon selection of the tab. It is called with the tab's name as an argument. u borderwidthureliefutextucommandupadxiupadyiu takefocusu indicatoronuhighlightthicknessiu selectcoloruusideufilluexpandNFT(uFrameu__init__ubwuRAISEDunameuselect_commandutab_setuFalseuis_last_in_rowu Radiobuttonu _select_eventuFALSEubuttonupackuLEFTuXuTrueu _init_masksu set_normal(uselfunameuselect_commandutab_rowutab_set((u8/opt/alt/python33/lib64/python3.3/idlelib/tabbedpages.pyu__init__s      uTabSet.TabButton.__init__cGs|j|jdS(usEvent handler for tab selection. With TabbedPageSet, this calls TabbedPageSet.change_page, so that selecting a tab changes the page. Note that this does -not- call set_selected -- it will be called by TabSet.set_selected_tab, which should be called when whatever the tabs are related to changes. N(uselect_commanduname(uselfuargs((u8/opt/alt/python33/lib64/python3.3/idlelib/tabbedpages.pyu _select_events uTabSet.TabButton._select_eventcCs|jdddS(uAssume selected lookuselectedNT(u _place_masksuTrue(uself((u8/opt/alt/python33/lib64/python3.3/idlelib/tabbedpages.pyu set_selectedsuTabSet.TabButton.set_selectedcCs|jdddS(uAssume normal lookuselectedNF(u _place_masksuFalse(uself((u8/opt/alt/python33/lib64/python3.3/idlelib/tabbedpages.pyu set_normalsuTabSet.TabButton.set_normalc Cs|jj}|jjd}t|dddtd||_t|dddtd||_t|jd|jdt |j_ |jj j ddd|j dd|jd |jd t|dddtd||_ t|j d|jdt |j _ dS( Nu backgroundu borderwidthiureliefuxuyuwidthiuheighti(utab_setupage_setu pages_frameucgetuFrameuFLATumaskumsklubwuRAISEDumluplaceumskrumr(uselfupage_setu background((u8/opt/alt/python33/lib64/python3.3/idlelib/tabbedpages.pyu _init_maskss    uTabSet.TabButton._init_maskscCs|j}|r||j7}n|jjd|ddddddddd dd dd dd | |jjd|ddd|j ddddd dd |jd dd | |jj}|r|j s|j|j|j|jkr||j8}n|j jd|ddddddddd dd |jd dd | |j j jd|j d|j d d |jd ||jd |jj dS(Nuin_urelxguxiurelyg?uyurelwidthuwidthu relheightuheighti( ubwumaskuplaceumsklutab_setupage_setuis_last_in_rowu winfo_rootxu winfo_widthumskrumrulower(uselfuselecteduheightupage_set((u8/opt/alt/python33/lib64/python3.3/idlelib/tabbedpages.pyu _place_maskss4           #uTabSet.TabButton._place_masksNF( u__name__u __module__u __qualname__u__doc__ubwu__init__u _select_eventu set_selectedu set_normalu _init_masksuFalseu _place_masks(u __locals__((u8/opt/alt/python33/lib64/python3.3/idlelib/tabbedpages.pyu TabButtons     u TabButtonNF(u__name__u __module__u __qualname__u__doc__uNoneuFalseu__init__uadd_tabu remove_tabuset_selected_tabu _add_tab_rowu_reset_tab_rowsu _arrange_tabsuFrameu TabButton(u __locals__((u8/opt/alt/python33/lib64/python3.3/idlelib/tabbedpages.pyuTabSets ,     (uTabSetcBs|EeZdZdZGdddeZGdddeZGdddeZGdd d eZded d dd d Z ddZ ddZ ddZdS(u TabbedPageSetujA Tkinter tabbed-pane widget. Constains set of 'pages' (or 'panes') with tabs above for selecting which page is displayed. Only one page will be displayed at a time. Pages may be accessed through the 'pages' attribute, which is a dictionary of pages, using the name given as the key. A page is an instance of a subclass of Tk's Frame widget. The page widgets will be created (and destroyed when required) by the TabbedPageSet. Do not call the page's pack/place/grid/destroy methods. Pages may be added or removed at any time using the add_page() and remove_page() methods. cBsD|EeZdZdZd ZddZddZddZdS( uTabbedPageSet.Pageu{Abstract base class for TabbedPageSet's pages. Subclasses must override the _show() and _hide() methods. cCst|dddt|_dS(Nu borderwidthiurelief(uFrameuRAISEDuframe(uselfupage_set((u8/opt/alt/python33/lib64/python3.3/idlelib/tabbedpages.pyu__init__9suTabbedPageSet.Page.__init__cCs tdS(N(uNotImplementedError(uself((u8/opt/alt/python33/lib64/python3.3/idlelib/tabbedpages.pyu_show<suTabbedPageSet.Page._showcCs tdS(N(uNotImplementedError(uself((u8/opt/alt/python33/lib64/python3.3/idlelib/tabbedpages.pyu_hide?suTabbedPageSet.Page._hideNF( u__name__u __module__u __qualname__u__doc__uFalseu uses_gridu__init__u_showu_hide(u __locals__((u8/opt/alt/python33/lib64/python3.3/idlelib/tabbedpages.pyuPage1s   uPagecBs8|EeZdZdZdZddZddZdS(uTabbedPageSet.PageRemoveuAPage class using the grid placement manager's "remove" mechanism.cCs#|jjdddddtdS(Nurowiucolumnusticky(uframeugriduNSEW(uself((u8/opt/alt/python33/lib64/python3.3/idlelib/tabbedpages.pyu_showFsuTabbedPageSet.PageRemove._showcCs|jjdS(N(uframeu grid_remove(uself((u8/opt/alt/python33/lib64/python3.3/idlelib/tabbedpages.pyu_hideIsuTabbedPageSet.PageRemove._hideNT(u__name__u __module__u __qualname__u__doc__uTrueu uses_gridu_showu_hide(u __locals__((u8/opt/alt/python33/lib64/python3.3/idlelib/tabbedpages.pyu PageRemoveBs u PageRemovecsJ|EeZdZdZdZfddZddZddZS( uTabbedPageSet.PageLiftu?Page class using the grid placement manager's "lift" mechanism.csIttj|j||jjdddddt|jjdS(Nurowiucolumnusticky(usuperu TabbedPageSetuPageLiftu__init__uframeugriduNSEWulower(uselfupage_set(u __class__(u8/opt/alt/python33/lib64/python3.3/idlelib/tabbedpages.pyu__init__PsuTabbedPageSet.PageLift.__init__cCs|jjdS(N(uframeulift(uself((u8/opt/alt/python33/lib64/python3.3/idlelib/tabbedpages.pyu_showUsuTabbedPageSet.PageLift._showcCs|jjdS(N(uframeulower(uself((u8/opt/alt/python33/lib64/python3.3/idlelib/tabbedpages.pyu_hideXsuTabbedPageSet.PageLift._hideT( u__name__u __module__u __qualname__u__doc__uTrueu uses_gridu__init__u_showu_hide(u __locals__((u __class__u8/opt/alt/python33/lib64/python3.3/idlelib/tabbedpages.pyuPageLiftLs  uPageLiftcBs2|EeZdZdZddZddZdS(uTabbedPageSet.PagePackForgetuAPage class using the pack placement manager's "forget" mechanism.cCs|jjdtdddS(NufilluexpandT(uframeupackuBOTHuTrue(uself((u8/opt/alt/python33/lib64/python3.3/idlelib/tabbedpages.pyu_show]su"TabbedPageSet.PagePackForget._showcCs|jjdS(N(uframeu pack_forget(uself((u8/opt/alt/python33/lib64/python3.3/idlelib/tabbedpages.pyu_hide`su"TabbedPageSet.PagePackForget._hideN(u__name__u __module__u __qualname__u__doc__u_showu_hide(u __locals__((u8/opt/alt/python33/lib64/python3.3/idlelib/tabbedpages.pyuPagePackForget[s uPagePackForgetiic KsPtj|||||_i|_g|_d |_d |_|jddd|j dddt||_ |j j dddddt |jj r|j jddd|j j dddnt||jd|d|d ||_|rx|D]}|j|qWn|jj dddddt |j|jd S( uConstructor arguments: page_names -- A list of strings, each will be the dictionary key to a page's widget, and the name displayed on the page's tab. Should be specified in the desired page order. The first page will be the default and first active page. If page_names is None or empty, the TabbedPageSet will be initialized empty. n_rows, max_tabs_per_row -- Parameters for the TabSet which will manage the tabs. See TabSet's docs for details. page_class -- Pages can be shown/hidden using three mechanisms: * PageLift - All pages will be rendered one on top of the other. When a page is selected, it will be brought to the top, thus hiding all other pages. Using this method, the TabbedPageSet will not be resized when pages are switched. (It may still be resized when pages are added/removed.) * PageRemove - When a page is selected, the currently showing page is hidden, and the new page shown in its place. Using this method, the TabbedPageSet may resize when pages are changed. * PagePackForget - This mechanism uses the pack placement manager. When a page is shown it is packed, and when it is hidden it is unpacked (i.e. pack_forget). This mechanism may also cause the TabbedPageSet to resize when the page is changed. iuweightiurowucolumnustickyun_rowsumax_tabs_per_rowu expand_tabsN(uFrameu__init__u page_classupagesu _pages_orderuNoneu _current_pageu _default_pageucolumnconfigureu rowconfigureu pages_frameugriduNSEWu uses_griduTabSetu change_pageu_tab_setuadd_page( uselfuparentu page_namesu page_classun_rowsumax_tabs_per_rowu expand_tabsukwuname((u8/opt/alt/python33/lib64/python3.3/idlelib/tabbedpages.pyu__init__cs*         uTabbedPageSet.__init__cCs|std|n||jkr;td|n|j|j|j|<|jj||jj|t |jdkr||_ |j |ndS(u0Add a new page with the name given in page_name.uInvalid TabPage name: '%s'u!TabPage named '%s' already existsiN( uInvalidNameErrorupagesuAlreadyExistsErroru page_classu pages_frameu _pages_orderuappendu_tab_setuadd_tabulenu _default_pageu change_page(uselfu page_name((u8/opt/alt/python33/lib64/python3.3/idlelib/tabbedpages.pyuadd_pages uTabbedPageSet.add_pagecCs||jkr"td|n|jj|t|jdkrl||jkru|jd|_qun d|_||jkr|j|jn|j j ||jj |}|j j dS(u2Destroy the page whose name is given in page_name.uNo such TabPage: '%siN(upagesuKeyErroru _pages_orderuremoveulenu _default_pageuNoneu _current_pageu change_pageu_tab_setu remove_tabupopuframeudestroy(uselfu page_nameupage((u8/opt/alt/python33/lib64/python3.3/idlelib/tabbedpages.pyu remove_pages uTabbedPageSet.remove_pagecCs|j|krdS|dk rA||jkrAtd|n|jdk rg|j|jjnd|_|dk r||_|j|jn|jj|dS(u/Show the page whose name is given in page_name.NuNo such TabPage: '%s'(u _current_pageuNoneupagesuKeyErroru_hideu_showu_tab_setuset_selected_tab(uselfu page_name((u8/opt/alt/python33/lib64/python3.3/idlelib/tabbedpages.pyu change_pages   uTabbedPageSet.change_pageNF(u__name__u __module__u __qualname__u__doc__uobjectuPageu PageRemoveuPageLiftuPagePackForgetuNoneuFalseu__init__uadd_pageu remove_pageu change_page(u __locals__((u8/opt/alt/python33/lib64/python3.3/idlelib/tabbedpages.pyu TabbedPageSet s ;  u TabbedPageSetu__main__u page_namesuFoobaruBazun_rowsu expand_tabsusideuexpandufillutextuFooupadyiuBaruAdd PageucommandcCstjtjS(N(utabPageuadd_pageu entryPgNameuget(((u8/opt/alt/python33/lib64/python3.3/idlelib/tabbedpages.pyusuu Remove PagecCstjtjS(N(utabPageu remove_pageu entryPgNameuget(((u8/opt/alt/python33/lib64/python3.3/idlelib/tabbedpages.pyusuname of page to add/remove:upadxiN(u__doc__utkinteru ExceptionuInvalidNameErroruAlreadyExistsErroruFrameuTabSetu TabbedPageSetu__name__uTkurootuFalseutabPageupackuTOPuTRUEuBOTHuLabelupagesuframeuEntryu entryPgNameuButtonu buttonAddu buttonRemoveu labelPgNameumainloop(((u8/opt/alt/python33/lib64/python3.3/idlelib/tabbedpages.pyu s2    &&