
B3IHc           @   sz  d  Z  d Z d d k Z d d k l Z d d k i Z d d k Z d d k	 Z	 d d k
 Z
 d d k Z d Z d Z d Z d Z d	 Z d Z d Z d Z d	 Z d
 Z d Z d Z e e i BZ d Z d Z d Z d	 Z d
 Z e Z d Z  d Z! d Z" e i# d j o e i$ d d  Z% n
 e i& Z% d d f Z' d d f Z( e i) d d d  e i) d d d  g Z* e i) d d d  e i) d d d  g Z+ e i) d d d   e i) d! d" d#  g Z, e i) d$ d% d&  e i) d' d( d#  g Z- e i) d) d) d)  e i) d* d* d*  g Z. e i) d+ d+ d+  e i) d) d) d)  g Z/ e i) d* d, d  e i) d* d, d  e i) d- d* d,  e i) d- d* d,  e i) d. d d&  e i) d. d d&  e i) d( d d/  e i) d( d d/  e i) d0 d1 d2  e i) d0 d1 d2  e i) d3 d4 d  e i) d3 d4 d  e i) d5 d0 d.  e i) d5 d0 d.  g Z0 e i) d6 d6 d6  e i) d7 d7 d8  e i) d9 d9 d:  g Z1 e i) d; d; d<  e i) d; d; d<  g Z2 e i3   Z4 e i3   Z5 e i3   Z6 e i3   Z7 e i3   Z8 e i3   Z9 e i3   Z: e i; e4 d  Z< e i; e5 d  Z= e i; e6 d  Z> e i; e7 d  Z? e i; e8 d  Z@ e i; e9 d  ZA e i; e: d  ZB d= d> d? d@ dA dB dC dD dE dF dG dH dI dJ dK dL dM g ZC e iD dN j  o dO   e iE _F n dP   ZG dQ   ZH dR   ZI dS   ZJ dT   ZK dU   ZL dV e iM f dW     YZN dX f  dY     YZO dZ e iP f d[     YZQ d\ f  d]     YZR d^ f  d_     YZS d` e iT f da     YZU db e f dc     YZV dd eW f de     YZX df e iY f dg     YZZ dh e i[ f di     YZ\ dj f  dk     YZ] dl e] e i^ f dm     YZ_ dn e i` f do     YZa dp e] ea f dq     YZb dr e i` f ds     YZc dt e id f du     YZe d S(v   s  
A full-featured notebook control, worked out by Andrea Gavana And Julianne Sharer.

Description:

NotebookCtrl Mimics The Behavior Of wx.Notebook, And Most Of Its Functionalities
Are Implemented In NotebookCtrl. However, NotebookCtrl Has A Lot Of Options That
wx.Notebook Does Not Have, And It Is Therefore Quite Customizable.
wx.Notebook Styles Not Implemented in NotebookCtrl Are:

    - wx.NB_MULTILINE (But NotebookCtrl Has A SpinButton To Navigate 
      Through Tabs).

Supported Customizations For NotebookCtrl Include:

    - Setting Individual Tab Font And Text Colour;
    - Images On Tabs (Line wx.Notebook);
    - Setting Individual Tab Colours;
    - Disabling/Enabling Individual Tabs (Also Visually Effective); 
      Now Supports Grayed Out Icons When A Page Is Disabled;
    - Drawing Of A Small Closing "X" At The Right Of Every Tab, That Enable The User
      To Close A Tab With A Mouse Click (Like eMule Tab Style);
    - Enabling Highlighted Tabs On Selection;
    - Drawing Focus Indicator In Each Tab (Like wx.Notebook);
    - Ctrl-Tab Keyboard Navigation Between Pages;
    - Tab With Animated Icons (Animation On Tabs);
    - Drag And Drop Tabs In NotebookCtrl (Plus A Visual Arrow Effect
      To Indicate Dropping Position);
    - Drag And Drop Event;
    - ToolTips On Individual Tabs, With Customizable ToolTip Time
      Popup And ToolTip Window Size For Individual Tabs;
    - Possibility To Hide The TabCtrl There Is Only One Tab (Thus
      Maximizing The Corresponding Window);
    - Possibility To Convert The Tab Image Into A Close Button While
      Mouse Is Hovering On The Tab Image;
    - Popup Menus On Tabs (Popup Menus Specific To Each Tab);
    - Showing Pages In "Column/Row Mode", Which Means That All Pages
      Will Be Shown In NotebookCtrl While The Tabs Are Hidden. They
      Can Be Shown In Columns (Default) Or In Rows;
    - Possibility To Hide Tabs On User Request, Thus Showing Only The 
      Current Panel;
    - Multiple Tabs Selection (Hold Ctrl Key Down And Left Mouse
      Click), Useful When You Use The Show All The Panels In
      Columns/Rows. In This Case, Only The Selected Tabs Are Shown In
      Columns/Rows;
    - Events For Mouse Events (Left Double Click, Middle Click, Right Click);
    - Possibility To Reparent A NotebookCtrl Page To A Freshly Created
      Frame As A Simple Panel Or To A New NotebookCtrl Created Inside
      That New Frame.
    - Possibility To Add A Custom Panel To Show A Logo Or HTML
      Information Or Whatever You Like When There Are No Tabs In
      NotebookCtrl;
    - Possibility To Change The ToolTip Window Background Colour;
    - Possibility To Draw Vertical Or Horizontal Gradient Coloured Tabs 
      (2 Colours);
    - Themes On Tabs: Built-In Themes Are KDE (Unix/Linux), Metal,
      Aqua Light And Aqua Dark (MacOS), Windows Silver (Windows) Or
      Generic Gradient Coloured Tabs. It's Also Possible To Define A
      Separate Theme For Selected Tabs And Control Background (The
      Last Two Are Work In Progress);
    - Contour Line Colour Around Tabs Is Customizable;
    - Highlight Colour Of Selected Tab Is Customizable;
    - Each Tab Can Have Its Own Gradient Colouring (2 Colours For Every Tab);
    - Custom Images May Be Drawn As A "X" Close Buttons On Tabs;
    - Possibility To Hide A Particular Tab Using A wx.PopupMenu That
      Is Shown If You Call EnableHiding(True). Look At The Top Right
      Of NotebookCtrl;
    - Allows Drag And Drop Of Tabs/Pages Between Different
      NotebookCtrls In The Same Application.
    - Draw tabs on the left or right side, rotated or horizontal
    - Allow user to switch between rotated and horizontal displays of
      tabs on the left or right side.

  
Usage:

NotebookCtrl Construction Is Quite Similar To wx.Notebook::

    NotebookCtrl.__init__(self, parent, id, pos=wx.DefaultPosition,
                          size=wx.DefaultSize, style=style, sizer=nbsizer)

See L{NotebookCtrl.__init__} Method For The Definition Of Non Standard (Non
wxPython) Parameters.

NotebookCtrl Control Is Freeware And Distributed Under The wxPython License. 

Latest Revision: Andrea Gavana @ 06 Oct 2006, 18.10 GMT

@undocumented: NC_MAC*, topaqua*, botaqua*, distaqua*, disbaqua*,
    kdetheme, silvertheme*, wxEVT*, attrs, GetMenuButton*, NCDragInfo,
    NCDropTarget, TabbedPage, TabCtrl, TransientTipWindow,
    macPopupWindow, macTransientTipWindow, NCFrame, DEFAULT_SIZE,
    NotebookSpinButton, NotebookMenuButton
t   epytextiN(   t   GenBitmapButtoni    i   i   i   i   i   i    i@   i   t	   __WXMAC__i   i   i   i   i   ij   i   i   i|   i   i6   i   i   i   i   i   i   i   i   i   i   ix   i   i   i   i   i   i   i   i   i   i   i   i   i   i   i   i   i   i   i   i   i   i   i   i   t
   _backstylet   _backtooltipt
   _borderpent   _convertimaget   _drawxt   _drawxstylet   _enabledraggingt   _focusindpent   _hideonsingletabt
   _highlightt   _paddingt   _selectioncolourt	   _selstylet	   _tabstylet
   _upperhight	   _usefocust   _usegradientss   2.7c         C   s   t  i i |  |  S(    (   t   wxt   Rectt   Inside(   t   selft   point(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   <lambda>'  s    c           C   s   t  i d  S(   Ns   xsb``p	Ҝ $Ld R,N!@PÑ[x8HL`Ǡ|q۝'v}⫚:cľ+W%t,rb35f0xsJh -%1(   t   zlibt
   decompress(    (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   GetMenuButtonData+  s    c           C   s   t  i t    S(   N(   R   t   BitmapFromImaget   GetMenuButtonImage(    (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   GetMenuButtonBitmap6  s    c          C   s   t  i t    }  t i |   S(   N(   t	   cStringIOt   StringIOR   R   t   ImageFromStream(   t   stream(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR   ;  s    c         C   s   d } |  i    o% |  i   |  i   |  i   f } n d } t t t |  i     } x~ t	 d t
 |  d  D]d } | | | | d | | d f } t | | |  } x& t	 d  D] } | | | | | <q Wqr W|  i d i t t |    |  S(   sr   
    Convert The Given Image (In Place) To A Grayed-Out Version,
    Appropriate For A 'Disabled' Appearance.
    gffffff?i    i   i   i   t    N(   t   HasMaskt
   GetMaskRedt   GetMaskGreent   GetMaskBluet   Nonet   mapt   ordt   listt   GetDatat   ranget   lent   MakeGrayt   SetDatat   joint   chr(   t   anImaget   factort	   maskColort   datat   it   pixelt   x(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   GrayOutB  s    % # c            sY   |  \ } } } | | | f | j o# t    f d   | | | f  Sn | | | f Sd S(   s_   
    Make A Pixel Grayed-Out. If The Pixel Matches The MaskColor, It Won't Be
    Changed.
    c            s   t  d  |     |  S(   i   (   t   int(   R:   (   R5   (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR   e  s    N(   R*   (   t   .0R5   R6   t   rt   gt   b(    (   R5   s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR0   ^  s    #c          C   so   t    }  t i d j p t i d j o |  i t d  n/ t i d j o |  i t  n |  i t  |  S(   NR   t   __WXCOCOA__i   t	   __WXMSW__(   t
   ThemeStyleR   t   Platformt   EnableAquaThemet   Truet   EnableSilverThemet   EnableKDETheme(   t   tabstyle(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   GetDefaultTabStylei  s    	 t   NotebookCtrlEventc           B   sh   e  Z d  Z d d d d  Z d   Z d   Z d   Z d   Z d   Z d	   Z	 d
   Z
 d   Z RS(   sP   
    Represent details of the events that the L{NotebookCtrl} object sends.
    i   ic         C   s#   t  i i |  | |  | |  _ d S(   s    Default Class Constructor. N(   R   t   PyCommandEventt   __init__t
   _eventType(   R   t	   eventTypet   idt   nSelt   nOldSel(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRM     s    c         C   s   | |  _  d S(   s    Sets Event Selection. N(   t
   _selection(   R   RQ   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   SetSelection  s    c         C   s   | |  _  d S(   s    Sets Old Event Selection. N(   t   _oldselection(   R   RR   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   SetOldSelection  s    c         C   s   |  i  S(   s    Returns Event Selection. (   RS   (   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   GetSelection  s    c         C   s   |  i  S(   s    Returns Old Event Selection (   RU   (   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   GetOldSelection  s    c         C   s   | |  _  d S(   s    Sets Old Event Position. N(   t   _oldposition(   R   t   pos(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   SetOldPosition  s    c         C   s   | |  _  d S(   s    Sets New Event Position. N(   t   _newposition(   R   RZ   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   SetNewPosition  s    c         C   s   |  i  S(   s    Returns Old Event Position. (   RY   (   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   GetOldPosition  s    c         C   s   |  i  S(   s    Returns New Event Position. (   R\   (   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   GetNewPosition  s    (   t   __name__t
   __module__t   __doc__RM   RT   RV   RW   RX   R[   R]   R^   R_   (    (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRK   {  s   							t
   NCDragInfoc           B   s/   e  Z e i   Z d    Z d   Z d   Z RS(   c         C   s,   t  |  |  _ | t i |  i <| |  _ d S(   s    Default Class Constructor. N(   RP   t   _idRc   t   _mapt
   _pageindex(   R   t	   containert	   pageindex(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRM     s    c         C   s   t  i i |  i d  S(   s2    Returns The NotebookCtrl Page (Usually A Panel). N(   Rc   Re   t   getRd   R)   (   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   GetContainer  s    c         C   s   |  i  S(   s0    Returns The Page Index Associated With A Page. (   Rf   (   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   GetPageIndex  s    (   R`   Ra   t   weakreft   WeakValueDictionaryRe   RM   Rj   Rk   (    (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRc     s   		t   NCDropTargetc           B   s   e  Z d    Z d   Z RS(   c         C   sH   t  i i |   | |  _ t  i t  i d   |  _ |  i |  i  d S(   s    Default Class Constructor. t   NotebookCtrlN(   R   t
   DropTargetRM   t   _parentt   CustomDataObjectt   CustomDataFormatt   _dataobjectt   SetDataObject(   R   t   parent(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRM     s    	c         C   s[   |  i    p t i Sn |  i i    } t i |  } |  i i | | | i   | i	    S(   s;    Handles The OnData() Method TO Call The Real DnD Routine. (
   R-   R   t   DragNoneRt   t   cPicklet   loadsRq   t   OnDropTargetRk   Rj   (   R   R:   t   yt   dragrest   draginfot   drginfo(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   OnData  s
    (   R`   Ra   RM   R   (    (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRn     s   	
RC   c           B   s   e  Z d  Z d Z d Z d Z d   Z d   Z e d d  Z	 e d  Z
 e d  Z e d d	  Z e d
  Z e d d  Z d d  Z d d  Z d d  Z d d  Z e d  Z e d  Z RS(   s;   
    Represent the style for rendering a notebook tab.
    i   i   i   c         C   s   |  i    d S(   s$    Default Constructor For This Class.N(   t   ResetDefaults(   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRM     s    c         C   s   t  |  _ t |  _ t |  _ t |  _ t |  _ t |  _ t |  _ t	 i
 |  _ t	 i t	 i  |  _ t	 i
 |  _ t	 i t	 i  |  _ d S(   s    Resets Default Theme. N(   RF   t   _normalt   Falset   _aquat   _metalt	   _macstylet	   _kdethemet   _silvert	   _gradientR   t   WHITEt   _firstcolourt   SystemSettings_GetColourt   SYS_COLOUR_BTNFACEt   _secondcolourt   _firstcolourselectedt   _secondcolourselected(   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR     s    							c         C   sW   | oC t  |  _ | |  _ t  |  _ t  |  _ t  |  _ t  |  _ t  |  _ n
 d |  _ d S(   s   
        Enables/Disables Mac Themes. style=1 Is The Light Style, While style=2
        Is The Dark Style. Mainly Used For Control Background Colour, Not For Tabs.
        i    N(   R   R   R   R   R   R   R   R   (   R   t   enablet   style(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   EnableMacTheme  s    						c         C   sN   | |  _  | o: t |  _ t |  _ t |  _ t |  _ t |  _ t |  _ n d S(   s9    Globally Enables/Disables Unix-Like KDE Theme For Tabs. N(   R   R   R   R   R   R   R   R   (   R   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRH   )  s    						c         C   sN   | |  _  | o: t |  _ t |  _ t |  _ t |  _ t |  _ t |  _ n d S(   s:    Globally Enables/Disables Mac-Like Metal Theme For Tabs. N(   R   R   R   R   R   R   R   R   (   R   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   EnableMetalTheme7  s    						c         C   sW   | oC | |  _  t |  _ t |  _ t |  _ t |  _ t |  _ t |  _ n
 d |  _  d S(   s9    Globally Enables/Disables Mac-Like Aqua Theme For Tabs. i    N(   R   R   R   R   R   R   R   R   (   R   R   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRE   E  s    						c         C   sN   | |  _  | o: t |  _ t |  _ t |  _ t |  _ t |  _ t |  _ n d S(   s:    Globally Enables/Disables Windows Silver Theme For Tabs. N(   R   R   R   R   R   R   R   R   (   R   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRG   T  s    						c         C   s   | o| t  |  _ | |  i @d j o% | |  i @d j o | |  i O} n | |  _ t  |  _ t  |  _ t  |  _ t  |  _ t  |  _	 n
 d |  _ d S(   s   
        Enables/Disables Gradient Drawing On Tabs. style=1 Is The Vertical Gradient,
        While style=2 Is The Horizontal Gradient.
        If style flag 4 is set, the style has a separate set of colors for the
        selected tab.
        i    N(
   R   R   t   GRADIENT_VERTICALt   GRADIENT_HORIZONTALR   R   R   R   R   R   (   R   R   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   EnableGradientStyleb  s    	(					c         C   s'   | d j o t i } n | |  _ d S(   s!    Sets The First Gradient Colour. N(   R)   R   R   R   (   R   t   colour(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   SetFirstGradientColourx  s    c         C   s'   | d j o t i } n | |  _ d S(   s4   Sets The First Gradient Colour For The Selected Tab.N(   R)   R   R   R   (   R   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   SetFirstGradientColourSelected  s    c         C   s   | d j o |  i   } t | i    t | i    t | i    } } } | d ?d | d ?d | d ?d f } t i | d | d | d  } n | |  _ d S(   s"    Sets The Second Gradient Colour. i   i   i    i   N(	   R)   t   GetBackgroundColourR<   t   Redt   Greent   BlueR   t   ColourR   (   R   R   t   colorR>   R?   R@   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   SetSecondGradientColour  s    8'%c         C   s   | d j o |  i   } t | i    t | i    t | i    } } } | d ?d | d ?d | d ?d f } t i | d | d | d  } n | |  _ d S(   s7    Sets The Second Gradient Colour For The Selected Tab. i   i   i    i   N(	   R)   R   R<   R   R   R   R   R   R   (   R   R   R   R>   R?   R@   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   SetSecondGradientColourSelected  s    8'%c         C   s.   | o |  i  |  i @o |  i Sn |  i Sd S(   s$    Returns The First Gradient Colour. N(   R   t   DIFFERENT_GRADIENT_FOR_SELECTEDR   R   (   R   t   selected(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   GetFirstGradientColour  s    c         C   s.   | o |  i  |  i @o |  i Sn |  i Sd S(   s%    Returns The Second Gradient Colour. N(   R   R   R   R   (   R   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   GetSecondGradientColour  s    N(   R`   Ra   Rb   R   R   R   RM   R   RF   R   RH   R   RE   RG   R   R)   R   R   R   R   R   R   R   (    (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRC     s$   		t
   TabbedPagec           B   s   e  Z d  d e d  Z RS(   R$   ic   	      C   s9  | |  _  | |  _ t i t i  |  _ t i t i  |  _ t i |  _ t i	 t i
  |  _ t |  _ g  |  _ d |  _ d |  _ d |  _ d |  _ | |  _ t i |  _ } t | i    t | i    t | i    } } } | d ?d | d ?d | d ?d f } t i | d | d | d  } | |  _ d S(	   s    Default Class Constructor. R$   i  i  i   i   i    i   N(   t   _textt   _imageR   t   SystemSettings_GetFontt   SYS_DEFAULT_GUI_FONTt   _fontt   _secondaryfontt   BLACKt   _pagetextcolourR   R   t   _pagecolourRF   t   _enablet   _animationimagest   _tooltipt   _tooltiptimet   _winsizeR)   t   _menut	   _ishiddenR   R   R<   R   R   R   R   R   (	   R   t   textt   imaget   hiddenR   R>   R?   R@   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRM     s$    									8'!(   R`   Ra   R   RM   (    (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR     s   t   NotebookSpinButtonc           B   s;   e  Z e i e i e i e i d   Z d   Z d   Z	 RS(   c         C   sT   t  i i |  | | | | |  | |  _ d |  _ | |  _ |  i t  i |  i  d S(   s    Default Class Constructor. i    N(	   R   t
   SpinButtonRM   t   _nbt	   _oldvaluet   _stylet   Bindt   EVT_SPINt   OnSpin(   R   Rv   RP   RZ   t   sizeR   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRM     s
    			c         C   s5   t  t |   i   } |  i t i @o | } n | S(   N(   t   superR   t   GetValueR   R   t   SP_VERTICAL(   R   t   result(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR     s    c         C   sf  t  |  t  d  j o | i   } n | } | |  i   j  o |  i |  i    d Sn t  |  t  d  j oh |  i i oJ | |  i j  o
 d } n d } x' |  i i | i o | | } q Wn |  i |  n |  i i	   o^ |  i
 t i @o |  i | j  p! |  i
 t i @o( |  i | j o |  i |  i  d SqLn | |  _ |  i i   d S(   s.    Handles The User's Clicks On The SpinButton. i   Ni(   t   typet   GetPositiont   GetMint   SetValueR   t   _enablehidingR   t   _pagesR   t   IsLastVisibleR   R   t   SP_HORIZONTALR   t   Refresh(   R   t   eventRZ   t   incr(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR     s,    
 !!	(
   R`   Ra   R   t   ID_ANYt   DefaultPositiont   DefaultSizeR   RM   R   R   (    (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR     s   		t   NotebookMenuButtonc           B   sD   e  Z d  e i d	 d d  Z d   Z d   Z d   Z d   Z RS(
   ii   i   i    c         C   s   t    } t i |  | | | | | |  |  i t  |  i d  |  i   |  _ | |  _ |  i	 t
 i |  i  |  i	 t
 i |  i  |  i	 t
 i |  i  |  i	 t
 i |  i  d S(   s    Default Class Constructor. i   N(   R   t   BitmapButtonRM   t   SetUseFocusIndicatorR   t   SetBezelWidthR   t   _originalcolourR   R   R   t
   EVT_BUTTONt   OnButtont   EVT_ENTER_WINDOWt   OnEnterWindowt   EVT_LEAVE_WINDOWt   OnLeaveWindowt   EVT_MENUt   OnMenu(   R   Rv   RP   RZ   R   R   t   bmp(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRM     s    		c         C   s3  |  i  i   } | d j o d Sn t i   } t i   } g  } x t |  D] } | d } | i |  |  i  i |  } |  i  i | i	 o d } t
 }	 n d } t }	 t i | | | | t i  }
 | i |
  |  i  i | i	 p |
 i   n | i | |  qO W| |  _ |  i |  | i   d S(   sK    Handles The wx.EVT_BUTTON For NotebookMenuButton (Opens The wx.PopupMenu) i    Ni   s   Page Hiddens
   Page Shown(   R   t   GetPageCountR   t   Menut   NewIdt   xranget   appendt   GetPageTextR   R   R   RF   t   MenuItemt
   ITEM_CHECKt
   AppendItemt   Checkt   SetHelpStringt   _myidst	   PopupMenut   Skip(   R   R   t   countt   menuRP   t   myidst   iit   namet   msgt   checkt   item(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR   %  s0     

	c         C   sV   |  i  i | i    } | i   i | i    } |  i i | |  | i   d S(   sB    Handles The wx.EVT_MENU For NotebookMenuButton. Calls HideTab(). N(   R   t   indext   GetIdt   GetEventObjectt	   IsCheckedR   t   HideTabR   (   R   R   t   indxt   checked(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR   M  s    c         C   s   |  i    } | i   } | i   } | i   } | i   d j o | i   d } n | i   d j o | i   d } n | i   d j o | i   d } n t i | d | d | d  } |  i |  |  i   | i   d S(   ss   
        Changes The NotebookMenuButton Background Colour When The Mouse
        Enters The Button Region.
        i   i(   i   N(	   R   R   R   R   R   R   t   SetBackgroundColourR   R   (   R   R   t   entercolourt   firstcolourt   secondcolourt   thirdcolour(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR   X  s    !
c         C   s(   |  i  |  i  |  i   | i   d S(   ss   
        Restore The NotebookMenuButton Background Colour When The Mouse
        Leaves The Button Region.
        N(   R   R   R   R   (   R   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR   r  s    
(   i   i   (	   R`   Ra   R   R   RM   R   R   R   R   (    (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR     s   	(		t   _TabCtrlPaintToolsc           B   s   e  Z d    Z RS(   c         C   s^   | |  _  | |  _ | |  _ | |  _ | |  _ | |  _ | |  _ | |  _ |	 |  _ |
 |  _	 d  S(   N(
   t	   BackBrusht   BackPent	   BorderPent   HighlightPent	   ShadowPent   UpperHighlightPent   SelectionPent   SelectionEdgePent   XPent   FocusPen(   R   t	   backBrusht   backPent	   borderPent   highlightPent	   shadowPent   upperHighlightPent   selectionPent   selectionEdgePent   xPent   focusPen(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRM     s    									(   R`   Ra   RM   (    (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR  }  s   t   TabCtrlc           B   s  e  Z e i e i e e e i d  d  Z d   Z	 d   Z
 d d  Z d   Z d   Z d   Z e d e d	  Z e d e d
  Z d   Z e d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z  d   Z! d   Z" d d  Z# d d  Z$ d d  Z% d   Z& d d  Z' d    Z( d d!  Z) d"   Z* d d#  Z+ d$   Z, e d%  Z- d&   Z. e d'  Z/ d(   Z0 e d)  Z1 d*   Z2 d+ d, d- d.  Z3 d/   Z4 e d0  Z5 d1   Z6 d d2  Z7 e d3  Z8 d d4  Z9 d d5  Z: d6   Z; d7   Z< d8   Z= e d9  Z> d d:  Z? d;   Z@ d<   ZA d=   ZB d>   ZC d?   ZD d@   ZE e dA  ZF dB dC  ZG e dD  ZH e dE  ZI dF   ZJ dG   ZK dH   ZL d, dI  ZM dJ   ZN e dK d d dL  ZO dM   ZP dN   ZQ dO   ZR e dP  ZS dQ   ZT dR   ZU e dS  ZV e dT  ZW dU   ZX dV   ZY dW   ZZ dX   Z[ dY   Z\ dZ   Z] d[   Z^ d\   Z_ d d]  Z` d^   Za d_   Zb d`   Zc d da  Zd d db  Ze d dc  Zf dd   Zg de   Zh df   Zi dg   Zj dh   Zk di   Zl dj   Zm dk   Zn dl   Zo dm   Zp dn   Zq do   Zr dp   Zs dq   Zt dr   Zu ds   Zv dt   Zw du   Zx dv   Zy dw   Zz dx   Z{ dy   Z| dz   Z} d{   Z~ d|   Z d}   Z d~   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z RS(   R  c      	   C   s  t  i i |  | | | | t  i t  i B| |  d |  _ d |  _ | |  _ t |  _	 g  |  _
 g  |  _ t  i d d  |  _ d |  _ g  |  _ t |  _ t |  _ t |  _ t  i t  i  |  _ t |  _ | |  _ t |  _ t |  _ t |  _ d |  _ t |  _ d |  _ t |  _ t |  _  t |  _! t |  _" t |  _# t  i$ d d d  |  _% t  i$ d	 d
 d  |  _& t'   |  _( t'   |  _) t'   |  _* t |  _+ d |  _, t |  _- t |  _. d |  _0 t  i1 |  i2  |  _3 t  i$ d d d	  |  _4 t  i5 t  i6  |  _7 t  i5 t  i8  |  _9 g  |  _: g  |  _; t  i< t  i=  |  _> t  i   |  _? t |  _@ d |  _A d |  _B t |  _C | tD @p | tE @oB | tF @o7 |  iG |  |  iH |  i |  i	 |  i(  |  iI   n
 d |  _J |  iK   | tL @p | tM @o& |  iN d  t  i d d  |  _O n1 |  iN d  t  i d d |  iP   d  |  _O t  iQ t  i t  iR   |  _S t  iQ t  i t  iT   |  _U t  iQ d  |  _V t  iQ t  i t  iT   |  _W t  iQ t  i t  iX  d  |  _Y |  iY iZ t  i[  |  iV iZ t  i[  |  iU iZ t  i[  t  i\ d j o" t  iQ t  i] d t  i^  |  __ nH t  iQ t  i] d t  i`  |  __ |  i_ ia d d g  |  i_ iZ t  i[  |  ib t  ic |  id  |  ib t  ie |  if  |  ib t  ig |  ih  |  ib t  ii |  ij  |  ib t  ik |  il  |  ib t  im |  in  |  ib t  io |  ip  |  ib t  iq |  ir  |  ib t  is |  it  |  ib t  iu d    |  ib t  iv |  iw  |  ib t  ix |  iy  |  ib t  iz |  i{  t| |   |  _} |  i~ |  i}  d S(   sa   
        Default Class Constructor.
        Used Internally. Do Not Call It Explicitely!
        ii    i   i   i   i   i   i<   i   i   i,   i   i   i   i   i   i   R   c         S   s   d  S(   N(   R)   (   R:   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR     s    N(   ii   (   i   i(   i   i   i   (   R   t	   PyControlRM   t	   NO_BORDERt   WANTS_CHARSRS   t   _imglistR   R   t	   _expandedR   t   _enabledpagest   PointR   t
   _spacetabst   _xrectt   _xrefreshedt   _imageconvertedR   R   t   SYS_COLOUR_GRAYTEXTt   _disabledcolourt   _hoverRq   RF   t
   _firsttimet   _somethingchangedt   _isdraggingt   _tabIDR	   t   _olddragpost   _fromdndt
   _isleavingR   R   R   R   R   t   _selectionedgecolourRC   R   R   R   R   t
   _insidetabt   _showtooltipt   _istooltipshownR)   t
   _tipwindowt   PyTimert   OnShowToolTipt	   _tiptimerR   t   SystemSettings_GetMetrict   SYS_SCREEN_Xt   _xvideot   SYS_SCREEN_Yt   _yvideot   _selectedtabst   _timerst   StockCursort   CURSOR_HANDt   _dragcursort   _dragstartposR   R   t   _pmenuR   t   NC_LEFTt   NC_RIGHTt   NC_EXPANDABLEt   _InitExpandableStylest   _InitExpandableTabStylest   _CreateSizeToggleButtont   _sizeToggleButtont   SetDefaultPaget   NC_TOPt	   NC_BOTTOMt   SetBestSizet   _firsttabpost   _CalcSizeToggleBestSizet   Pent   SYS_COLOUR_BTNSHADOWR   t   SYS_COLOUR_WINDOWt   _highlightpen2t   _highlightpenR   t   SYS_COLOUR_3DDKSHADOWt
   _shadowpent   SetCapt   CAP_BUTTRD   R   t   SOLIDR
   t	   USER_DASHt	   SetDashesR   t   EVT_LEFT_DOWNt   OnMouseLeftDownt   EVT_LEFT_DCLICKt   OnMouseLeftDClickt
   EVT_MOTIONt   OnMouseMotiont   EVT_LEFT_UPt   OnMouseLeftUpt   EVT_RIGHT_UPt   OnMouseRightUpt   EVT_RIGHT_DOWNt   OnMouseRightDownt   EVT_MIDDLE_DOWNt   OnMouseMiddleDownt   EVT_SIZEt   OnSizet	   EVT_PAINTt   OnPaintt   EVT_ERASE_BACKGROUNDt	   EVT_TIMERt
   AnimateTabt   EVT_KEY_DOWNt	   OnKeyDownR   R   Rn   t   _droptargett   SetDropTarget(   R   Rv   RP   RZ   R   R   t	   validatorR   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRM     s    %
																																			!	
#!"c         C   s*   |  i  t @o |  i o |  i   n d  S(   N(   R   RF  R  t   _ToggleSize(   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   Contract  s    c         C   s+   |  i  t @o |  i o |  i   n d  S(   N(   R   RF  R  Rw  (   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   Expand  s    c         C   s   |  i  t @o@ |  i o5 |  i |  _  |  i |  _ t |  _ |  i i d  nN |  i  t @o? |  i o5 |  i	 |  _  |  i
 |  _ t |  _ |  i i d  n |  i   d  S(   Ns   <<s   >>(   R   RF  R  t   _expandedstylet   _expandedtabstyleR   RF   RJ  t   SetLabelt   _contractedstylet   _contractedtabstyleR   t   _OnStyleChange(   R   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRw    s    		c   %      C   sL  |  i  t i | |   } | i   } |  i   } | | j o| d j o| |  i j ot |  _ d |  _ t t	 |  i
    } | i |  i  | i |  | i |   |  i   i |  o4 d |  _ d |  _ |  i t i  |  i   d Sn |  i i   y |  i |  i  }	 |  i |  i  }
 |  i |  i  } |  i |  i  } |  i |  i  } |  i |  i  } |  i |  i  } |  i |  i  \ } } } |  i |  i  } |  i |  i  } |  i |  i  } |  i  |  i i! } Wn1 |  i i"   d |  _ |  i t i  d Sn Xd } |  i# |  i i$   o  d } |  i# |  i i%   } n |  i& |  i  |  i' |  i  } t( |  i)    } | } | i* |  i  | i+ | |  i  g  } |  i)   d } xJ t, |  i)    D]6 } | i- |  i i. |   |  i i/ i0 | |  qWd } g  |  i _1 xo | D]g }  |  i i/ i2 | |  d t i3 t i4 Bd  |  i i/ i5 | t  |  i i1 i- | |   | d } q6W|  i6 |  i  | oD t7 |  i)   j o |  i8 |	 t9 |
  q<|  i: | |	 t9 |
  nA t7 |  i)   j o |  i8 |	 t |
  n |  i: | |	 t |
  |  i; | |
  |  i< | |	  |  i= | |  |  i> | |  |  i? | |  |  i@ | |  |  iA | |  |  iB | | | |  |  iC | |  |  iD | |  |  iE | |  | |  i  | _! | o7 tF |  d j o$ |  iG | |  |  iH | |  n | o |  i i/ i5 | t9  n` |  iI   }! |! d j o
 d }! n |  i i/ i5 | t  |  i iJ |!  |  i i/ i5 |! t9  |  i i/ iK   |  i i"   n t |  _ d |  _ t9 |  _L |  i   d |  _ |  i t i  d Sn | d j o| d j o| i. |  }" |" ot t	 | i
    } | i |  | i |  | i |  | i   i |  o: d | iM _ d | iM _ | i t i  | i   d Sn | i   | iN |  }# |# d }	 |# d }
 |# d }$ |" iO |  | i: | |" |	 t9 |
 |$  | iP | |#  | iM i6 |  | i/ i0 |  | i/ iK   | iQ iK   | i1 iR |  | iS   | i)   d j oo | iT tU @o* | iQ i5 d t  | iQ i5 d t  n' | iQ i5 d t  | iQ i5 d t  | iQ iK   n | i"   | i   qEn t iV S(	   sM    Handles The OnDrop Action For Drag And Drop Between Different NotebookCtrl. i    iNi   i   R   R   t   ishidden(W   t   HitTestR   R!  t	   GetParentR,  R   R+  R-  RK   t   wxEVT_NOTEBOOKCTRL_PAGE_DNDR   R[   R]   t   SetEventObjectt   GetEventHandlert   ProcessEventt	   SetCursort   STANDARD_CURSORR   Rq   t   FreezeR   t   GetPageImaget   GetPageTextFontt   GetPageTextSecondaryFontt   GetPageTextColourt   GetPageColourt   IsPageEnabledt   GetPageToolTipt   GetPagePopupMenut   GetPageFirstGradientColourt   GetPageSecondGradientColourR   R   t   ThawR>  t	   IsRunningt   GetIntervalt   StopAnimationt   GetAnimationImagesR.   R   t   removet   insertR   R   t   GetPaget   bsizert   Detacht   _notebookpagest   Addt   EXPANDt   ALLt   Showt
   DeletePageRP   t   AddPageRF   t
   InsertPaget   SetPageImaget   SetPageTextt   SetPageTextFontt   SetPageTextSecondaryFontt   SetPageTextColourt   SetPageColourt
   EnablePaget   SetPageToolTipt   SetPagePopupMenut   SetPageFirstGradientColourt   SetPageSecondGradientColourR/   t   SetAnimationImagest   StartAnimationRW   RT   t   LayoutR.  t   nbt   GetPageInfot   Reparentt   SetPageInfot   sizert   popt   AdvanceSelectionR   RL  t   DragMove(%   R   R:   R{   t   nPaget   oldcontt   wheret   oldNotebookt   newNotebookt   eventOutR   R   t   font1t   font2t
   fontcolourt
   pagecolourt   enabledt   tooltipt   ontimet   winsizeR   t   firstcolt	   secondcolR  t
   isanimatedt   timert   animatedimagest	   pageranget   newranget   newpagest   counterR   t   cct   jjt   selt   panelt   infosR   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRz   (  s   				
	  *
			
	






c         C   s   |  i  o |  i o |  i i |  i  } t | |  i  } t i |  } t i	 t i
 d   } | i |  t i |   } | i |  | i t i  t |  _ |  i   q n |  i o$ |  i i   t |  _ |  i   n | i   d S(   s5    Handles The wx.EVT_LEAVE_WINDOW Events For TabCtrl. Ro   N(   R	   R+  Rq   R  R,  Rc   Rx   t   dumpsR   Rr   Rs   R1   t
   DropSourcet
   DoDragDropt   Drag_DefaultMoveRF   R/  R   R3  R4  t   DestroyR   R   (   R   R   t   pageR}   R~   t
   dataobjectt
   dragSource(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR     s"    

	
	c         C   s   | i    t i j o | i   o |  i   } | |  i   d j o
 d } n | d } x@ |  i |  p/ | d } | |  i   d j o
 d } q] q] W|  i i |  q n | i	   d S(   s   
        Handles The wx.EVT_KEY_DOWN Event For TabCtrl. This Is Only Processed If
        The User Navigate Through Tabs With Ctrl-Tab Keyboard Navigation.
        i   i    N(
   t
   GetKeyCodeR   t   WXK_TABt   ControlDownRW   R   R  Rq   RT   R   (   R   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRs    s    

 
ic         C   s   |  i  i t | | |   t |  _ t |  _ |  i i t i |    |  i	 t
 @p |  i	 t @o) |  i |  i t i |    d f  n |  i   d S(   s   
        Add A Page To The Notebook.
        
        @param text: The Tab Text;
        @param select: Whether The Page Should Be Selected Or Not;
        @param img: Specifies The Optional Image Index For The New Page.
        iN(   R   R   R   RF   R*  R)  R>  R   t   TimerR   RD  RE  RN  t   _CalcBestWidtht   ClientDCR   (   R   R   t   selectt   imgR   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s    				)c         C   sL  | d j  p& |  i    d j o+ | |  i   j o d t |  d  n |  i    } |  i i | t | | |   |  i i | t i |    t	 |  _
 t	 |  _ | p |  i    d j o | |  _ |  i |  n" | | j o |  i d |  _ n |  i t @p |  i t @o) |  i |  i t i |    d f  n |  i   d S(   s)  
        Insert A Page Into The Notebook.
        
        @param nPage: Specifies The Position For The New Page;
        @param text: The Tab Text;
        @param select: Whether The Page Should Be Selected Or Not;
        @param img: Specifies The Optional Image Index For The New Page.
        i    s.   
ERROR: Invalid Notebook Page In InsertPage: (t   )ii   N(   RW   R   t   strR   R  R   R>  R   R  RF   R*  R)  RS   RT   R   RD  RE  RN  R  R  R   (   R   R  R   R  R  R   t   oldselection(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR  -  s    
3			)c         C   st   x6 |  i  D]+ } | i   o | i   n | i   q
 Wg  |  _  g  |  _ d |  _ t |  _ t |  _ |  i	   d S(   s!    Deletes All NotebookCtrl Pages. iN(
   R>  R  t   StopR  R   RS   RF   R*  R)  R   (   R   t   tims(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   DeleteAllPagesO  s    
 					c         C   sd  | d j  p | |  i    j o d t |  d  n |  i   } |  i i |  |  i | i   o |  i | i   n |  i | i   |  i	 o |  i
 i   t |  _	 n | p$ t |  _ t |  _ |  i   d Sn | |  i j  o |  i d |  _ nD |  i | j o* |  i |  i    j o |  i d |  _ n
 | |  _ t |  _ t |  _ |  i   d S(   s4    Deletes The Page nPage, And The Associated Window. i    s.   
ERROR: Invalid Notebook Page In DeletePage: (R  Ni   (   R   R  RW   R   R  R>  R  R  R  R3  R4  R   RF   R*  R)  R   RS   (   R   R  t
   oncontinueR  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR  `  s.     
		
&			c         C   s  | d j  p | |  i    j o d t |  d  n |  i } | |  i j o>|  i |  p d Sn t t |  i    } | i |  | i |  i  | i	 |   |  i
   i |  p t |  d  o t |  _ n | |  _ | i t  | i |  i  |  i
   i |  | d j o |  i i i | t  n |  i |  i  |  i i i |  i t  |  i i i   |  i   | |  _ qn d S(   s   
        Sets The Current Tab Selection To The Given nPage. This Call Generates The
        EVT_NOTEBOOKCTRL_PAGE_CHANGING Event.
        i    s0   
ERROR: Invalid Notebook Page In SetSelection: (R  Nt	   _initrecti(   R   R  RS   R  RK   t    wxEVT_NOTEBOOKCTRL_PAGE_CHANGINGR   RT   RV   R  R  R  t   hasattrR   R)  t   SetEventTypet   wxEVT_NOTEBOOKCTRL_PAGE_CHANGEDRq   R  R  t   EnsureVisibleRF   R  R   t   _shown(   R   R  R  R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRT     s0     		
c         C   s  |  i    d j  o d  Sn |  i   p d  Sn |  i   } |  i d | !i d  } | |  i | } | t |  i  j o( t |  i  d } | |  i | } n |  i | } |  i i	   } |  i
 | } |  i t @p |  i t @o | i } | i }	 d }
 n | i } | i }	 d }
 d } xT| |	 | |
 |  i i   |
 j o-|  i t @p |  i t @o | | i 8} n | | i 8} |  i p | d } nc | } | |  i d | !i d  } | | j o | d } n | t |  i
  j o | d } n |  i
 | } |  i t @p |  i t @o& |  i i |  |  i i |  n! |  i i |  |  i i |  d } q&W| o |  i   n d  S(   Ni   i    i   (   R   t   HasSpinButtont   GetClientSizet   _tabvisibleR   t   _firstvisibleR/   t   _tabrectt   _spinbuttonR   R  R   RD  RE  R{   t   heightR:   t   widtht   GetSizeR   R   R   R   (   R   t	   selectiont   fullrectR   t   sindext   currectt   spinvalt	   firstrectRZ   R   t   posIndext	   torefresht
   oldspinval(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    sV    		
		 &
c         C   s   t  |  i  S(   s.    Returns The Number Of Pages In NotebookCtrl. (   R/   R   (   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR     s    c         C   s   |  i  S(   s     Returns The Current Selection. (   RS   (   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRW     s    c         C   s   |  i  S(   s:    Returns The Image List Associated With The NotebookCtrl. (   R  (   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   GetImageList  s    c         C   s   | |  _  t i d d t d  |  _ xc t | i    D]O } | i |  } t i |  } t	 |  } t i
 |  } |  i i |  q7 Wd S(   s*    Associate An Image List To NotebookCtrl. i   i    N(   R  R   t	   ImageListRF   t   _grayedlistR   t   GetImageCountt	   GetBitmapt   ImageFromBitmapR;   R   R  (   R   t	   imagelistR   R   R   t   newbmp(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   SetImageList  s    	 c         C   s   | |  _  t i d d t d  |  _ xc t | i    D]O } | i |  } t i |  } t	 |  } t i
 |  } |  i i |  q7 Wd S(   s*    Associate An Image List To NotebookCtrl. i   i    N(   R  R   R	  RF   R
  R   R  R  R  R;   R   R  (   R   R  R   R   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   AssignImageList  s    	 c         C   s   |  i  S(   sE    Returns The (Horizontal, Vertical) Padding Of The Text Inside Tabs. (   R   (   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt
   GetPadding   s    c         C   s)   | |  _  t |  _ t |  _ |  i   d S(   sB    Sets The (Horizontal, Vertical) Padding Of The Text Inside Tabs. N(   R   RF   R*  R)  R   (   R   t   padding(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt
   SetPadding&  s    			c         C   sF   | d j  p | |  i    j o d t |  d  n |  i | i S(   s.    Returns The String For The Given Page nPage. i    s/   
ERROR: Invalid Notebook Page In GetPageText: (R  (   R   R  R   R   (   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR   /  s     c         C   s   | d j  p | |  i    j o d t |  d  n |  i | i | j o0 | |  i | _ t |  _ t |  _ |  i   n d S(   s+    Sets The String For The Given Page nPage. i    s/   
ERROR: Invalid Notebook Page In SetPageText: (R  N(   R   R  R   R   RF   R*  R)  R   (   R   R  R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR  8  s     		c         C   sF   | d j  p | |  i    j o d t |  d  n |  i | i S(   s3    Returns The Image Index For The Given Page nPage. i    s0   
ERROR: Invalid Notebook Page In GetPageImage: (R  (   R   R  R   R   (   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR  E  s     c         C   s   | d j  p | |  i    j o d t |  d  n |  i | i | j o | |  i | _ t |  _ t |  _ |  i t @p |  i t	 @o< |  i
 |  i t i |    d f  |  i i   i   n |  i   n d S(   s0    Sets The Image Index For The Given Page nPage. i    s0   
ERROR: Invalid Notebook Page In SetPageImage: (R  iN(   R   R  R   R   RF   R*  R)  R   RD  RE  RN  R  R   R  Rq   t   GetSizerR  R   (   R   R  R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR  N  s     		%c         C   s  | d j  p | |  i    j o d t |  d  n | d j o t i t i  } n t i t i  } | |  i | _ | | j o7 |  i i	   i
   t |  _ t |  _ |  i   d Sn t i |   } | i |  | i d  \ } } | i |  | i d  \ } } d \ }	 }
 t |  i | d  o0 | i |  i | i  | i d  \ }	 }
 n t | |
  } | | j  o$ t |  _ t |  _ |  i   d Sn | d |  i i d j  o
 d } n | d |  i i } |  i   } | | d	 j  o | d	 } n |  i t @p |  i t @o |  i d
 | f  n |  i |  i |  d
 f  |  i i	   i
   t |  _ t |  _ |  i   d S(   s1    Sets The Primary Font For The Given Page nPage. i    s3   
ERROR: Invalid Notebook Page In SetPageTextFont: (R  Nt   AqR   i   i   i   i(   i    i    (   R   R  R)   R   R   R   R   R   Rq   R  R  RF   R*  R)  R   R  t   SetFontt   GetTextExtentR  R   t   maxR   R{   R  R   RL  RM  RN  R  (   R   R  t   fontt
   normalfontt   dct   w1t   h1t   wnt   hnt   w2t   h2t   ht	   newheightt   oldsize(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR  `  sP     		
		

		i   c         C   s@   |  i  t @p |  i  t @o  |  i d | f  | |  _ n d S(   s    Sets The Tabs Height. iN(   R   RL  RM  RN  t	   _bestsize(   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   SetTabHeight  s    c         C   s>   | d j o t i t i  } n |  i |  |  i   d S(   s7    Sets The TabCtrl Background Colour (Behind The Tabs). N(   R)   R   R   t   SYS_COLOUR_3DFACER   R   (   R   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   SetControlBackgroundColour  s    c         C   sF   | d j  p | |  i    j o d t |  d  n |  i | i S(   s4    Returns The Primary Font For The Given Page nPage. i    s3   
ERROR: Invalid Notebook Page In GetPageTextFont: (R  (   R   R  R   R   (   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s     c         C   sz  | d j  p | |  i    j o d t |  d  n | d j o t i t i  } n t i t i  } | |  i | _ | | j o$ t |  _	 t |  _
 |  i   d Sn t i |   } | i |  | i d  \ } } | i |  | i d  \ } } d
 \ }	 }
 t |  i | d  o0 | i |  i | i  | i d  \ }	 }
 n t | |
  } | | j  o$ t |  _	 t |  _
 |  i   d Sn | d |  i i d j  o
 d } n | d |  i i } |  i   } | | d	 j  o | d	 } n |  i t @p |  i t @o |  i d	 | f  n |  i |  i |  d	 f  |  i i   i   t |  _	 t |  _
 |  i   d S(   s3    Sets The Secondary Font For The Given Page nPage. i    s<   
ERROR: Invalid Notebook Page In SetPageTextSecondaryFont: (R  NR  R   i   i   i(   i    i    (   R   R  R)   R   R   R   R   R   RF   R*  R)  R   R  R  R  R  R   R  R   R{   R  R   RL  RM  RN  R  Rq   R  R  (   R   R  R  R  R  R  R  R  R   R!  R"  R#  R$  R%  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    sN     		
		

		c         C   sF   | d j  p | |  i    j o d t |  d  n |  i | i S(   s6    Returns The Secondary Font For The Given Page nPage. i    s<   
ERROR: Invalid Notebook Page In GetPageTextSecondaryFont: (R  (   R   R  R   R   (   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s     c         C   sy   | d j  p | |  i    j o d t |  d  n | d j o t i } n | |  i | _ t |  _ |  i	   d S(   s0    Sets The Text Colour For The Given Page nPage. i    s5   
ERROR: Invalid Notebook Page In SetPageTextColour: (R  N(
   R   R  R)   R   R   R   R   RF   R*  R   (   R   R  R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s     	c         C   sF   | d j  p | |  i    j o d t |  d  n |  i | i S(   s3    Returns The Text Colour For The Given Page nPage. i    s5   
ERROR: Invalid Notebook Page In GetPageTextColour: (R  (   R   R  R   R   (   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s     c         C   s   | d j  p | |  i    j o d t |  d  n | d j o t i t i  } n | |  i | _ t |  _	 |  i
   d S(   s:    Sets The Tab Background Colour For The Given Page nPage. i    s1   
ERROR: Invalid Notebook Page In SetPageColour: (R  N(   R   R  R)   R   R   R   R   R   RF   R*  R   (   R   R  R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s     	c         C   s   | d j  p | |  i    j o d t |  d  n |  i i p
 |  i o) |  i o |  i i Sq |  i |  Sn |  i | i Sd S(   s=    Returns The Tab Background Colour For The Given Page nPage. i    s1   
ERROR: Invalid Notebook Page In GetPageColour: (R  N(	   R   R  R   R   R   R   t   _GetThemePageColourR   R   (   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s     
c         C   s   | d j  p | |  i    j o d t |  d  n | |  i | _ | o |  i   | j ot |  i   } | d j  o |  i   q | |  i    j o |  i   q | | j o |  i   q |  i |  n |  i   d S(   s&    Enable/Disable The Given Page nPage. i    s.   
ERROR: Invalid Notebook Page In EnablePage: (R  N(	   R   R  R   R   RW   t   GetDefaultPageR  RT   R   (   R   R  R   t   defpage(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR  -  s     c         C   sF   | d j  p | |  i    j o d t |  d  n |  i | i S(   s+    Returns Whether A Page Is Enabled Or Not. i    s1   
ERROR: Invalid Notebook Page In IsPageEnabled: (R  (   R   R  R   R   (   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR  E  s     c         C   s   | |  _  |  i   d S(   s>    Globally Enables/Disables Tab Highlighting On Tab Selection. N(   R   R   (   R   t	   highlight(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   SetHighlightSelectionN  s    	c         C   s   |  i  S(   sN    Returns Globally Enable/Disable State For Tab Highlighting On Tab Selection. (   R   (   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   GetHighlightSelectionU  s    c         C   s   | |  _  |  i   d S(   s0    Globally Enables/Disables Tab Focus Indicator. N(   R   R   (   R   t   focus(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR   [  s    	c         C   s   |  i  S(   s@    Returns Globally Enable/Disable State For Tab Focus Indicator. (   R   (   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   GetUseFocusIndicatorb  s    R$   i  i  c         C   sl   | d j  p | |  i    j o d t |  d  n | |  i | _ | |  i | _ | |  i | _ d S(   s  
        Sets A ToolTip For The Given Page nPage.
        
        @param nPage: The Given Page;
        @param tooltip: The ToolTip String;
        @param timer: The Timer After Which The Tip Window Is Popped Up;
        @param winsize: The Maximum Width Of The Tip Window.
        i    s2   
ERROR: Invalid Notebook Page In SetPageToolTip: (R  N(   R   R  R   R   R   R   (   R   R  R  R  R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR  h  s
    
 c         C   sc   | d j  p | |  i    j o d t |  d  n |  i | i |  i | i |  i | i f S(   s3    Returns A Tuple With All Page ToolTip Parameters. i    s2   
ERROR: Invalid Notebook Page In GetPageToolTip: (R  (   R   R  R   R   R   R   (   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR  z  s     c         C   s   | |  _  | o= y t i |   t |  _ Wq t j
 o t |  _ q XnP |  i o$ |  i i   t	 |  _ |  i
   n |  i i   o |  i i   n d S(   s)    Globally Enables/Disables Tab ToolTips. N(   R2  R   t   PopupWindowt   TransientTipWindowt   NotImplementedErrort   macTransientTipWindowR3  R4  R  R   R   R7  R  R  (   R   t   show(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   EnableToolTip  s    	
	c         C   s   |  i  S(   s/    Returns The ToolTip Window Background Colour. (   R   (   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   GetToolTipBackgroundColour  s    c         C   s3   | d j o t i d d d  } n | |  _ d S(   s,    Sets The ToolTip Window Background Colour. i   i   N(   R)   R   R   R   (   R   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   SetToolTipBackgroundColour  s    c         C   s<   | |  _  | o |  i i   |  i i   n |  i   d S(   sK    Globally Enables/Disables Drawing Of Gradient Coloured Tabs For Each Tab. N(   R   R   R   R   R   (   R   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   EnableTabGradients  s
    	c         C   sp   | d j  p | |  i    j o d t |  d  n | d j o t i } n | |  i | _ |  i   d S(   s,    Sets The Single Tab First Gradient Colour. i    s>   
ERROR: Invalid Notebook Page In SetPageFirstGradientColour: (R  N(   R   R  R)   R   R   R   R   R   (   R   R  R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s     c         C   s   | d j  p | |  i    j o d t |  d  n | d j o |  i | i } t | i    t | i    t | i    } } } | d ?d | d ?d | d ?d f } t	 i
 | d | d | d  } n | |  i | _ |  i   d S(   s-    Sets The Single Tab Second Gradient Colour. i    s?   
ERROR: Invalid Notebook Page In SetPageSecondGradientColour: (R  i   i   i   N(   R   R  R)   R   R   R<   R   R   R   R   R   R   R   (   R   R  R   R   R>   R?   R@   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s     8'%c         C   sF   | d j  p | |  i    j o d t |  d  n |  i | i S(   s/    Returns The Single Tab First Gradient Colour. i    s>   
ERROR: Invalid Notebook Page In GetPageFirstGradientColour: (R  (   R   R  R   R   (   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s     c         C   sF   | d j  p | |  i    j o d t |  d  n |  i | i S(   s0    Returns The Single Tab Second Gradient Colour. i    s?   
ERROR: Invalid Notebook Page In GetPageSecondGradientColour: (R  (   R   R  R   R   (   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s     c         C   s2   |  i  o$ t |  _  |  i i   |  i   n d S(   s=    Destroys The Tip Window (Probably You Won't Need This One). N(   R3  R   R4  R  R   (   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt	   CancelTip  s    
	c         C   s  |  i    d j o d Sn |  i   } d } | o | |  i    d j o
 d } n | d } xS|  i |  p |  i o |  i | i o | d } | d } |  i o) |  i | i o | d } | d } n | |  i    d j o
 d } n | |  i    d j o d Sqb qb Wn | d j o |  i    d } n | d } xi |  i |  pX | d } | d } | d j o |  i    d } n | |  i    d j o d SqLqLW|  i i |  d S(   s   
        Cycles Through The Tabs. The Call To This Function Generates The
        EVT_NOTEBOOKCTRL_PAGE_CHANGING Event.
        i   Ni    (	   R   RW   R  R   R   R   R)   Rq   RT   (   R   t   forwardR  R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s@    

 




 

c         C   s8   | |  i    j o d t |  d  n | |  _ d S(   sw   
        Sets The Default Page That Will Be Selected When An Active And Selected
        Tab Is Made Inactive.
        s2   
ERROR: Invalid Notebook Page In SetDefaultPage: (R  N(   R   R  t   _defaultpage(   R   t   defaultpage(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRK  #  s    c         C   s   |  i  S(   s    Returns The Default Page. (   R=  (   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR+  /  s    c   	      C   s  |  i    } | d j o d Sn g  } | i |  i d d |  i d d  | i |  i d d |  i d d  |  i   } |  i t @p |  i t @o! t i } | d | d j } n t i	 } | d | d j } | ot
 |  d  pA t |  d d d
 | |  _ |  i i d  |  i i   |  _ n |  i i   } |  i t @p |  i t @oD | d | d } |  i t @o | d d | d } qd } n= | d | d } |  i t @o
 d } n | d | d } |  i   o |  i i d  n |  i i |  i  |  i i | | f  |  i i   |  i t @p |  i t @o |  i i | d d  q|  i i d | d  nB t
 |  d  o1 |  i i   o! |  i i   |  i i d  n d S(   s1    Update The NotebookSpinButton. Used Internally. i    Nii   i   i   R  RZ   i'  R   i   (   i'  i'  (   ii   (   R   R   R  R  R   RL  RM  R   R   R   R  R   R  R   R  t   _originalspinsizeRD  RE  t   HasMenuButtont   SetSizet   MoveR  t   SetRanget   IsShownt   Hide(	   R   R   t   nbsizet   clsizet	   spinstylet   showspint   sbsizet   ypost   xpos(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   UpdateSpinButton5  sN    ''		

 c         C   s   t  |  d  o |  i i   S(   s<    Returns Wheter The NotebookSpinButton Exists And Is Shown. R  (   R  R  RD  (   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR  q  s    c         C   s   |  i    o~ |  i t @p |  i t @o d \ } } n d \ } } |  i d | |  i d | } | |  i i   | j  o t Sq n t S(   s1    Returns Whether The Last Tab Is Visible Or Not. i   i   i    i   i(   i   i   (   i    i   (	   R  R   RD  RE  R  R  R   RF   R   (   R   RZ   R   t   lastpos(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR   w  s     c         C   sw  |  i    } | d j o d Sn t |  d  p d Sn | o t |  d  o d Sn t |  d  p t |  d d |  _ n |  i i   } g  } | i |  i d d |  i d d  | i |  i d d	 |  i d d
  |  i   } | d | d } | d	 | d	 } |  i   o" |  i i	 | d	 | d f  n |  i i	 | d	 | d	 f  |  i i
 |  d S(   sF    Updates The Notebook Menu Button To Show/Hide Tabs. Used Internally. i    NR  t   _menubuttonRZ   i'  ii   i   i   i   (   i'  i'  (   R   R  R   RO  R  R   R  R  R  RB  R  (   R   R6  R   RJ  RF  RG  RL  RK  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   UpdateMenuButton  s(    ''"c         C   s   t  |  d  o |  i i   S(   s<    Returns Wheter The NotebookMenuButton Exists And Is Shown. RO  (   R  RO  RD  (   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR@    s    c         C   sc   | o t  |  i | _ n t |  i | _ | |  i   j o |  i   n t  |  _ |  i   d S(   s"    Hides A Tab In The NotebookCtrl. N(   RF   R   R   R   RW   R  R)  R   (   R   R  t   hide(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR     s    	i    c      
   C   sX  |  i  t @} |  i   } t i |   } |  i d i } | o t i } n | i d j p | i | i j o# | o t i	 | f Sq t i	 Sn | i
 |  i d i
 j oA | i
 |  i d i
 | j  o# | o t i	 | f Sq t i	 Sn |  i i } |  i i
 } t |  i  }	 xt |  i |  i    D]}
 |  i p |  i |
 i o|  i | |
  } |  i |
  \ } } |  i |
 | | | | |  } | i |  oM| o
 t } n |  i   d oP |  i d |
 !i d  } | o, |  i |
 |  i | i |  o
 t } qn | oZ | d j oM t i t i |  i  |
 | | |    t i! | |   i |  o
 t" } n^ | oV t i t i |  i# |
 | |  i$ | |     t i! | |   i |  o
 t% } n | o |
 | f Sq|
 Sn |  i  t& @p |  i  t @o | | i' 7} q1| | i 7} q.q.W| o t i	 | f Sn t i	 Sd S(   s  
        Standard NotebookCtrl HitTest() Method. If Called With 2 Outputs, It
        Returns The Page Clicked (If Any) And One Of These Flags:

        NC_HITTEST_NOWHERE = 0   ==> Hit Not On Tab 
        NC_HITTEST_ONICON  = 1   ==> Hit On Icon 
        NC_HITTEST_ONLABEL = 2   ==> Hit On Label 
        NC_HITTEST_ONITEM  = 4   ==> Hit Generic, On Item
        NC_HITTEST_ONX = 8       ==> Hit On Closing "X" On Every Page
        i    N((   R   RM  R  R   R  R  R  t   NB_HITTEST_NOWHERER:   t	   NOT_FOUNDR{   RO  R  t   _maxtabwidthsR   R  R   R   R   R   t   _CalcTabTextWidtht   _CalcTabBitmapSizet   _CalcTabRectt   Containst   NC_HITTEST_ONITEMt   GetDrawXR  R   R#  t   NC_HITTEST_ONXt   RectPSR!  t   _CalcTabBitmapPositiont   Sizet   NC_HITTEST_ONICONt   _CalcTabTextPositiont   _CalcTabBitmapSpacet   NC_HITTEST_ONLABELRL  R  (   R   R   t   flagst   mirrorR   R  R  t   posxt   posyt   maxwidthR   R  t   bmpWidtht	   bmpHeightt   tabrectR   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s`    #9 
)

c         C   s   | |  _  d S(   s.    Globall Enables/Disables Tabs Drag And Drop. N(   R	   (   R   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   EnableDragAndDrop	  s    c         C   s0   | |  _  |  i |  t i d |  i |  d S(   s6    Globally Enables/Disables Hiding On Tabs In Runtime. i  N(   R   RP  R   t
   FutureCall(   R   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   EnableHiding	  s    	c         C   s   | d j  p | |  i    j o d t |  d  n | p d t |  d  n t |  d j  o d t t |   d  n t |  |  i   i   d j o< d t t |   d	 t |  i   i   d  d  n | |  i | _ d
 S(   s   
        Sets An Animation List Associated To The Given Page nPage.
        
        @param nPage: The Given Page
        @param imgarray: A List Of Image Indexes Of Images Inside The
          ImageList Associated To NotebookCtrl.
        i    s6   
ERROR: Invalid Notebook Page In SetAnimationImages: (R  s4   
ERROR: Invalid Image Array In SetAnimationImages: (sD   
ERROR: Invalid Image Array In SetAnimationImages: (Min(ImgArray) = s    < 0)i   sD   
ERROR: Invalid Image Array In SetAnimationImages: (Max(ImgArray) = s    > N(	   R   R  t   reprt   minR  R  R  R   R   (   R   R  t   imgarray(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR  #	  s    	 #<c         C   sF   | d j  p | |  i    j o d t |  d  n |  i | i S(   sG    Returns The Animation Images List Associated To The Given Page nPage. i    s6   
ERROR: Invalid Notebook Page In GetAnimationImages: (R  (   R   R  R   R   (   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR  =	  s     c         C   s   | i    } |  i i |  } |  i |  p d Sn |  i |  } |  i |  } | i |  } | | d j o
 d } n | d } |  i | | |  d S(   sD    Called When The Refreshing Animation Timer Expires. Used InternallyNii   (   R   R>  R   R  R  R  R  (   R   R   t   objR  R   t   imagest   myindx(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRq  F	  s    

c         C   s   | d j  p | |  i    j o d t |  d  n |  i |  } | p d t |  d  n t |  d j o d t |  d  n |  i | i |  d S(	   sL    Starts The Animation On The Given Page, With Refreshing Time Rate "timer". i    s2   
ERROR: Invalid Notebook Page In StartAnimation: (R  s+   
ERROR: No Images Array Defined For Page: (i   s#   
ERROR: Impossible To Animate Tab: s    With Only One ImageN(   R   R  R  R/   R>  t   Start(   R   R  R  Rr  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR  [	  s     c         C   se   | d j  p | |  i    j o d t |  d  n |  i | i   o |  i | i   n d S(   s.    Stops The Animation On The Given Page nPage. i    s1   
ERROR: Invalid Notebook Page In StopAnimation: (R  N(   R   R  R>  R  R  (   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR  l	  s     i   c         C   s   | |  _  | |  _ | d j o? t i d d t d  |  _ |  i i |  |  i i |  n |  i t @p |  i t	 @o< |  i
 |  i t i |    d f  |  i i   i   n |  i   d S(   s  
        Globally Enables/Disables The Drawing Of A Closing "X" In The Tab.
        
        @param drawx: C{True} to enable drawing a closing "X"; C{False} to
          disable it
        @param style: the style of the X to draw when C{drawx} is C{True};
          possible values are:
            - C{1}: Small "X" At The Top-Right Of The Tab;
            - C{2}: Bigger "X" In The Middle Vertical Of The Tab (Like Opera Notebook);
            - C{3}: Custom "X" Image Is Drawn On Tabs.
        @param image1: if C{style} is C{3}, the image to use when drawing
          the X on an unhighlighted tab
        @param image2: if C{style} is C{3}, the image to use when drawing
          the X on a highlighted tab
        i   i   i    iN(   R   R   R   R	  RF   t	   _imglist2R  R   RD  RE  RN  R  R  Rq   R  R  R   (   R   t   drawxR   t   image1t   image2(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   SetDrawXv	  s    		%c         C   s   |  i  |  i f S(   st   
        Returns The Enable/Disable State Of Drawing Of A Small "X" At The Top-Right Of
        Every Page.
        (   R   R   (   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRZ  	  s    c         C   s@   d } x3 |  i  D]( } | i |  o | Sn | d } q Wd S(   s4    Returns The Tab On Which The Mouse Is Hovering On. i    i   i(   R  RX  (   R   t   ptR   t   tabs(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   GetInsideTab	  s    
 c         C   s@   d } x3 |  i  D]( } | i |  o | Sn | d } q Wd S(   sC    Returns The Tab On Which The Mouse Is Hovering On The "X" Button. i    i   i(   R#  RX  (   R   Rz  R   t   rects(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt
   GetInsideX	  s    
 c         C   s   | |  _  d S(   sJ    Set Whether The Tab Icon Should Be Converted To The Close Button Or Not. N(   R   (   R   t   convert(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   SetImageToCloseButton	  s    c         C   s   |  i  S(   sJ    Get Whether The Tab Icon Should Be Converted To The Close Button Or Not. (   R   (   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   GetImageToCloseButton	  s    c         C   ss  |  i  |  } | d j  o d Sn |  i | } |  i   } |  i } t i |   } | i |  | i d  \ } } |  i i	 |  }	 | i
 |  i i
 }
 | i | d |  i i |	 i   d d } | i | |  i i d } | |  i i d d } | |  i   j o, |
 d }
 | d } | d } | d } n |  i |  } t i |
 | |	 i   |  i i
 |	 i    } | i t i |   | i t i  | i |  |  i |  } | i   } | i   } | i   } t d | d  t d | d  t d | d  } } } t i | | |  } t i } | | | |  i i d d } t i | i
 | i |  i i
 | d | | |  } | i t i | d   | i t i |   | i  | d  | i t i | d   | i! | d d | d d | d | d d | d | d d  | i! | d d | d | d d | d | d d | d d  d S(	   sE    Globally Converts The Page Image To The "Opera" Style Close Button. i    NR  i   i   i   i   i@   ("   R  R  R  t   _maxfontR   R  R  R  R  R  R:   R   R{   t	   GetHeightRW   R  R   t   GetWidtht   SetBrusht   Brusht   SetPent   TRANSPARENT_PENt   DrawRectangleRectR  R   R   R   Ro  R   R   R  RQ  t   DrawRoundedRectangleRectt   DrawLine(   R   R  t   bmpindexRj  R   t   maxfontR  t   pomR  R   t   bmpposxt   bmpposyRK  t   ysizeR   t   bmprectR>   R?   R@   t   hrt   hgt   hbt   back_colourt   yypost   xrect(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   ConvertImageToCloseButton	  sP    	-


.;	 %Fc         C   s5  |  i  |  } |  i   } d } | o | i   } | i   }	 | i   }
 t d | d  t d |	 d  t d |
 d  } } } t i | | |  } t i } d } n t i	 |   } |  i
 | } | d j o: | i t i | d   | i t i  | i |  n | d j o | i t i | d   | i t i |   | i | d  | i t i | d   | i | d d | d d | d | d d | d | d d  | i | d d | d | d d | d | d d | d d  n+ |  i i | | | d | d t i t  d S(   sF    Redraw The Closing "X" Accordingly To The Mouse "Hovering" Position. i    i   i@   i   i   i   N(   R  R   R   R   R   Ro  R   R   R   R  R#  R  RQ  R  t   TRANSPARENT_BRUSHR  R  R  R  Ru  t   Drawt   IMAGELIST_DRAW_TRANSPARENTRF   (   R   Rz  t   insidexRv  R-  R   R  R  R>   R?   R@   R  R  R  R  R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   RedrawClosingX
  s4    ;	
FJc         C   s   | |  _  d S(   s?    Hides The TabCtrl When There Is Only One Tab In NotebookCtrl. N(   R   (   R   RQ  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   HideOnSingleTab-
  s    c         C   sL   | d j  p | |  i    j o d t |  d  n | |  i | _ d S(   s-    Sets A Popup Menu Specific To A Single Tab. i    s4   
ERROR: Invalid Notebook Page In SetPagePopupMenu: (R  N(   R   R  R   R   (   R   R  R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR  3
  s     c         C   sF   | d j  p | |  i    j o d t |  d  n |  i | i S(   s4    Returns The Popup Menu Associated To A Single Tab. i    s4   
ERROR: Invalid Notebook Page In GetPagePopupMenu: (R  (   R   R  R   R   (   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR  <
  s     c         C   s#  |  i  p/ | d j  p | t |  i  j o d Sqt n< | d j  p& | t |  i  |  i i d  j o d Sn t i } t } |  i  o@ x= t |  D]+ } |  i	 | i
 o | d } t } q q Wn |  i | } | i d } | i d } | i }	 | d }
 | i d } | } t i |  i |   } |  i  p? | |  i j o+ | | i } |	 | i }	 | | i } qnT t i |  i |   } | |  i j o+ | | i } |	 | i }	 | | i } n | i t i t i d   | i |  | i | | f |	 |
 f | | f g  d S(   s   
        Draw An Insertion Arrow To Let The User Understand Where A Dragged Tab Will
        Be Dropped (Between Which Tabs).
        i    Ni   i   i   i   (   R   R/   R  R  R   R   R   R   R   R   R   RF   R:   R{   R  R  R,  R  R  RQ  R  t   DrawPolygon(   R   R  R  R   t
   somehiddenR   t   rectt   x1t   y1t   x2t   y2t   x3t   y3t   mybrush(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   DrawInsertionMarkE
  sD    
#3	
 
	

c         C   s  | i    } |  i o| i   o | i   o | i   o d } t | i |  i i  } t | i |  i i  } | | j o% | | j o |  i	 t
 i  d Sn |  i	 |  i  t |  _ t |  _ |  i |  } | d j o' | |  i j o | |  _ |  i   q+q/t |  _ |  i	 t
 i  n | i   p||  i   } | d o |  i |  } | d j o; |  i |  o' |  i | | | d t  t |  _ qq|  i pX |  i |  }	 |	 d j o8 |  i |	  o$ |  i | |	 | d  t |  _ qqqq|  i   o |  i | d  \ }
 } |
 d j on |  i |
  oZ | t j o( |  i p |  i |
  t |  _ qq|  i o |  i   t |  _ qqqqn |  i o@| i   p/| i   p|  i  } |  i |  |  _  |  i  d j o | |  i  j o |  i! o$ |  i" i#   t |  _! |  i   n |  i$ i%   o |  i$ i&   n |  i' |  i   \ } } } | i(   d j o, | |  _) | |  _* |  i$ i+ | t
 i,  qqq|  i! o$ |  i" i#   t |  _! |  i   qqqn | |  _- | i.   d S(   s.    Handles The wx.EVT_MOTION Event For TabCtrl. i   Ni    i   R$   (/   R   R	   t   Draggingt   RightIsDownt   MiddleIsDownt   absR:   RB  R{   R  R   R  RA  RF   R+  R   R/  R  R-  R   RZ  R~  R  R  R$  R|  R  R_  R%  R  R2  t   LeftDownR1  R3  R4  R  R7  R  R  R  t   stript   _currenttipt   _currentwinsizeRt  t   TIMER_ONE_SHOTt	   _mouseposR   (   R   R   Rz  t	   tolerancet   dxt   dyt   newposRv  R  t	   insidetabR  Rc  t	   oldinsidet   tipR  R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRb  w
  s    
)				




	
			"
		c   	      C   s  |  i  t i    } |  i } |  i |  |  _ |  i | j p |  i d j  o d Sn t |  _ |  i |  |  i |  i	  |  _
 |  i
 i   \ } } |  i |  i  \ } } | | |  i d j oD | | |  i d j o | | } | | } qH| | } | } nA | | |  i d j o | d } | | } n | d } | } | d j  o
 | } n | d j  o
 | } n |  i
 i | | f  |  i
 i   d S(   sA    Called When The Timer For The ToolTip Expires. Used Internally. i    Ni
   (   t   ScreenToClientR   t   GetMousePositionR1  R|  RF   R3  R3  R  R  R4  R  t   ClientToScreenR  R:  R<  t   SetPositionR  (	   R   Rz  R  t   xsizeR  RL  RK  Re  Rf  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR6  
  s6    	 	






c         C   sr  | i    } |  i | d  \ } } | |  _ | t i j o'|  i |  o| i oB | |  i j o |  i i |  n |  i i	 |  |  i
   q`g  |  _ | t j p | t j o |  i   o} t t |  i    } | i |  i  | i |  | i |   |  i   i |  p$ |  i i |  |  i i i   q\q`|  i |  | |  _ qdn | i   d S(   s1    Handles The wx.EVT_LEFT_DOWN Event For TabCtrl. i   N(   R   R  RB  R   RS  R  t   m_controlDownR=  R  R   R   R[  R_  R  RK   t   wxEVT_NOTEBOOKCTRL_PAGE_CLOSINGR   RV   RS   RT   R  R  R  Rq   R  R  R  R,  R   (   R   R   RZ   R  Rc  R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR^    s,    	
	'c         C   s   | i    } |  i |  } g  |  _ | t i j o d Sn |  i |  p d Sn t t |  i    } | i	 |  i
  | i |  | i |   |  i   i |  p d Sn | i   d S(   s3    Handles The wx.EVT_LEFT_DCLICK Event For TabCtrl. N(   R   R  R=  R   RS  R  RK   t   wxEVT_NOTEBOOKCTRL_PAGE_DCLICKR   RV   RS   RT   R  R  R  R   (   R   R   RZ   R  R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR`  (  s    	c         C   s\  |  i  p | i   d Sn |  i p" |  i t i  | i   d Sn |  i t i | i   | i	     } | d j o| |  i
 j ot |  _ d |  _ t t |  i    } | i |  i
  | i |  | i |   |  i   i |  o4 d |  _
 d |  _ |  i t i  |  i   d Sn |  i i   y |  i |  i
  } |  i |  i
  } |  i |  i
  } |  i |  i
  } |  i |  i
  } |  i |  i
  }	 |  i |  i
  }
 |  i |  i
  \ } } } |  i  |  i
  } |  i! |  i
  } |  i" |  i
  } |  i# |  i
 i$ } Wn1 |  i i%   d |  _
 |  i t i  d Sn Xd } |  i& |  i
 i'   o  d } |  i& |  i
 i(   } n |  i) |  i
  |  i* |  i
  } t+ |  i,    } | } | i- |  i
  | i. | |  i
  g  } |  i,   d } xJ t/ |  i,    D]6 } | i0 |  i i1 |   |  i i2 i3 | |  qWd } g  |  i _4 xo | D]g } |  i i2 i5 | | d t i6 t i7 Bd  |  i i2 i8 | t  |  i i4 i0 | |  | d } qeW|  i9 |  i
  |
 oD | |  i,   j o |  i: | t; |  qk|  i< | | t; |  nA | |  i,   j o |  i: | t |  n |  i< | | t |  |  i= | |  |  i> | |  |  i? | |  |  i@ | |  |  iA | |  |  iB | |	  |  iC | |
  |  iD | | | |  |  iE | |  |  iF | |  |  iG | |  | |  i# | _$ | o7 tH |  d j o$ |  iI | |  |  iJ | |  n |
 o |  i i2 i8 | t;  n` |  iK   } | d j o
 d } n |  i i2 i8 | t  |  i iL |  |  i i2 i8 | t;  |  i i2 iM   |  i i%   n t |  _ d |  _ t; |  _N |  i   d |  _
 |  i t i  | i   d S(   s/    Handles The wx.EVT_LEFT_UP Event For TabCtrl. Ni    ii   i   (O   R	   R   R+  R  R   R  R  R!  t   GetXt   GetYR,  R   R-  RK   R  R   R[   R]   R  R  R  R   Rq   R  R   R  R  R  R  R  R  R  R  R  R  R   R   R  R>  R  R  R  R  R.   R   R  R  R   R   R  R  R  R  R  R  R  R  R  R  RF   R  R  R  R  R  R  R  R  R  R  R  R  R/   R  R  RW   RT   R  R.  (   R   R   RP   R  R   R   R  R  R  R  R  R  R  R  R   R  R  R  R  R  R  R  R  R  R  R   R  R  R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRd  @  s    



'				
	  *
			
	c         C   ss   |  i  o@ |  i   d } |  i   d } |  i  i t i | |   n |  i   | d j	 o | i   n d S(   s,    Handles The wx.EVT_SIZE Event For TabCtrl. i    i   N(	   RJ  R  RP  RA  R   R^  R   R)   R   (   R   R   R  R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRl    s    
 
c         C   s~   | i    } |  i |  } g  |  _ | d j o? |  i |  o+ |  i |  } | o |  i |  ql qp n | i   d S(   s0    Handles The wx.EVT_RIGHT_UP Event For TabCtrl. i    N(   R   R  R=  R  R  R   R   (   R   R   Rz  RP   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRf    s    	c         C   s   | i    } |  i |  } g  |  _ | t i j o d Sn |  i |  p d Sn t t |  i    } | i	 |  i
  | i |  | i |   |  i   i |  p d Sn | i   d S(   s2    Handles The wx.EVT_RIGHT_DOWN Event For TabCtrl. N(   R   R  R=  R   RS  R  RK   t   wxEVT_NOTEBOOKCTRL_PAGE_RIGHTR   RV   RS   RT   R  R  R  R   (   R   R   RZ   R  R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRh    s    	c         C   s   | i    } |  i |  } g  |  _ | t i j o d Sn |  i |  p d Sn t t |  i    } | i	 |  i
  | i |  | i |   |  i   i |  p d Sn | i   d S(   s3    Handles The wx.EVT_MIDDLE_DOWN Event For TabCtrl. N(   R   R  R=  R   RS  R  RK   t   wxEVT_NOTEBOOKCTRL_PAGE_MIDDLER   RV   RS   RT   R  R  R  R   (   R   R   RZ   R  R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRj     s    	c         C   s3   | d j o t i d d d  } n | |  _ d S(   sC    Sets The Tab Selection Colour (Thin Line Above The Selected Tab). i   i   i    N(   R)   R   R   R   (   R   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   SetSelectionColour  s    c         C   s   | d j oG |  i i p
 |  i o t i d d d  } qT t i t i  } n |  i i p
 |  i o) t i |  |  _	 |  i	 i
 t i  n& t i |  |  _ |  i i
 t i  |  i   d S(   s;    Sets The Contour Line Colour (Controur Line Around Tabs). i   i   i   N(   R)   R   R   R   R   R   R   RS  RQ  RU  RX  RY  RT  R   (   R   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   SetContourLineColour"  s    c         C   s\   | d j o t   } n | |  _ |  i t @o |  i |  i |  i |  n |  i   d S(   s1    Applies A Particular Theme To Be Drawn On Tabs. N(   R)   RC   R   R   RF  RH  R  R   (   R   t   theme(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   ApplyTabTheme5  s    	c         C   s  | d j o t  \ } } n t \ } } t i | | |  } t i | | |  } | \ } }	 }
 } |  i t @o |
 p | } d } xt d | d  D] } | d d j o
 | } n | } | i t i |   | i	 t i
 |   |  i t @oI | d j o | i | | |	 d |
  q| i | | |	 d d  nI | d j o | i | |	 | |
 d  n | i | |	 | |
 d d  | d } q W| |  _ d S(   s0    Draws The Mac Theme On Tabs, If It Is Enabled. i   i    i   i   N(   t   NC_MAC_LIGHTt   NC_MAC_DARKR   R   R   t	   NC_ROTATER   R  R  R  RQ  t   DrawRectanglet   DrawRoundedRectanglet   _lastcolour(   R   R  Rj  R  t   col1t   col2t   colour1t   colour2R:   R{   t   wR#  t   endrangeR   R   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   DrawMacTheme@  s0     
c         C   s>  | \ } } } } |  i  t @oJ |  i  t @o< t d d d  } t d |  _ t i t d t i  } n3 t d  } t d |  _ t i t d t i  } | i	 |  x| D]}	 t i
 t |	  }
 | i |
  |  i  t @o |  i  t @op | i | d |	 | d | d |	 | | d  | i | | d |	 | d | | d |	 | | d  q6| i | d |	 | d | d |	 | | d  | i | | d |	 | d | | d |	 | | d  q | i | d | |	 | | d | |	  | i | d | | d |	 | | d | | d |	  q Wd S(   s%    Draws Unix-Style KDE Theme On Tabs. i   ii    i   i   i   N(   R   R  RE  R   t   kdethemeR  R   R  RZ  t   SetBackgroundRQ  R  R  (   R   R  R  R:   R{   R  R#  t	   bandranget   brusht   bandt   pen(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   DrawKDEThemeh  s*     2>2>*c          C   s  | \ } } } } | od t  d i   } t  d i   }	 t  d i   }
 t  d i   } t  d i   } t  d i   } n t d i   } t d i   }	 t d i   }
 t d i   } t d i   } t d i   } t d i   } t d i   } t d i   } |  i t @o t | d  } n t | d  } t | |  | } t | |	  | } t | |
  | } d \ } } } d } |  i t @oK |  i t @o t	 | | d | d  } q t	 | d | | d  } n t	 | d | |  } x| D]} t
 t | |   t
 t |	 |   t
 t |
 |   f } | i t i | t i   | i t i |   |  i t @ox | d j o | d } | d } n: | d j o | d } | d } n | d } | d } | i | | d |  nu | d j o | d } | d } n: | d j o | d } | d } n | d } | d } | i | | | d  | d } | | } | | } | | } | |  _ qW| o |  i t @o | i t i | | | f   | i t i | | | f   |  i t @o@ |  i t @o | | d } n | } | i | | d |  n | i | | | d | d  t i | | |  |  _ n d S(	   s%    Draws Windows XP Silver-Like Theme. i    i   i   ii   i   N(   i    i    i    (   t   silvertheme1R   R   R   t   silvertheme2R   R  t   floatRE  R   R<   t   roundR  R   R  RZ  R  RQ  R  R  RL  RD  R   (    R   R  R  R   R:   R{   R  R#  t   r1t   g1t   b1t   r2t   g2t   b2t   rendt   gendt   bendt   flrectt   rstept   gstept   bstept   rft   gft   bfR  R  R  t   currColRK  t   yendRL  t   xend(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   DrawSilverTheme  s     ?











c       	   C   s  | \ } } } } | o | d j od t  d i   }	 t  d i   }
 t  d i   } t  d i   } t  d i   } t  d i   } qNt d i   }	 t d i   }
 t d i   } t d i   } t d i   } t d i   } na t d i   }	 t d i   }
 t d i   } t d i   } t d i   } t d i   } t | d d  } t | |	  | } t | |
  | } t | |  | } d \ } } } d } | i t i	  |  i
 t @o | | } } n | | } } |  i
 t @o0 |  i
 t @o" t | | | | d d  } n t | d | | d  } x| D]} t t |	 |   t t |
 |   t t | |   f } | i t i | t i   |  i
 t @ox | d j o | d } | d } n: | d j o | d } | d } n | d } | d } | i | | d |  nu | d j o | d } | d } n: | d j o | d } | d } n | d } | d } | i | | | d  | d } | | } | | } | | } qOW| o | d j od t d i   }	 t d i   }
 t d i   } t d i   } t d i   } t d i   } qt d i   }	 t d i   }
 t d i   } t d i   } t d i   } t d i   } na t d i   }	 t d i   }
 t d i   } t d i   } t d i   } t d i   } t | d d  } t | |	  | } t | |
  | } t | |  | } d \ } } } d } |  i
 t @o0 |  i
 t @o" t | | d | d d  } n t | | d | |  } x | D] } t t |	 |   t t |
 |   t t | |   f } | i t i | t i   |  i
 t @o" | i | | d d | d  n | i | d | | d d  | | } | | } | | } qW| |  _ d S(	   s%    Draws Mac-Style Aqua Theme On Tabs. i   i    i   ii   N(   i    i    i    (   i    i    i    (   t   topaqua1R   R   R   t   topaqua2t   distaquaR  R  R   R  R   R  RE  R   R<   R  R  R  RZ  R  t   botaqua1t   botaqua2t   disbaquaR  (    R   R  R  R   R   R:   R{   R  R#  R  R  R  R  R  R  R  R  R  R  R  R  R  R  t
   startrangeR  R  R  R  RK  R  RL  R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   DrawAquaTheme  s    " ?










" ?"

c         C   s'  | \ } } } } | i  t i  d } |  i t @o t | d | |  } n t | d | |  } x| D]}	 |  i t @o d d | |	 | }
 n d d | |	 | }
 t i |
 |
 |
  } | i t i |   |  i t @o | d j o | d } | d } n: | d j o | d } | d } n | d } | d } |  i t	 @o" | i
 | | |	 | d |  q| i
 | |	 | d |  nu | d j o | d } | d } n: | d j o | d } | d } n | d } | d } | i
 | |	 | d  | d } qo W| |  _ d S(   s)    Draws Mac-Style Metal Gradient On Tabs. i    i   i   iP   i   i   N(   R  R   R  R   R  R   R   R  R  RE  R  R  (   R   R  R  R:   R{   R  R#  R  R  R  t   intensR   RK  R  RL  R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   DrawMetalThemeq  sH     



"



c            s  | i  t i    i i |   i   j  }   i i |   i   j  } t | i    t | i	    t | i
    } } } t | i    t | i	    t | i
    }	 }
 } t | i  } t |	 |  | } t |
 |  | } t | |  | } d \ } } } d } t | i d | i | i d  } t |   x | D] } | | | | | | f } | i t i | t i      f d   } | |  } | i | } | i | } | d } | i | | | d  | | } | | } | | } qSW|   _ d S(   s=    Gradient Fill From Colour 1 To Colour 2 From Top To Bottom. i    i   c            s  |  d j p |    d j o d Sn  i  t @p  i  t @o  i  t @o |  d j o  i  t @p |    d j o  i  t @o d Sq|  d j o  i  t @p |  t d j o  i  t @o d Sqd Sn7 |    d j o d Sn |    d j o d Sn d Sd  S(   Ni   i   i    i   (   R   RD  RE  R  t   lend(   R  (   t   lencR   (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt
   GetXAdjust  s    +N(   i    i    i    (   R  R   R  R   R   RW   R   R<   R   R   R   R  R  R   R{   R/   R  R  RZ  R:   R  R  R  (   R   R  R  R   R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R{   R  R  t   xadjustRL  R  (    (   R   R  s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   DrawVerticalGradient  s6    88$ 


c            s  | i  t i    i i |   i   j  }   i i |   i   j  } t | i    t | i	    t | i
    } } } t | i    t | i	    t | i
    }	 }
 } t | i  } t |	 |  | } t |
 |  | } t | |  | } d \ } } } d } t | i d | i | i d  } t |   x | D] } | | | | | | f } | i t i | t i      f d   } | |  } | i | } | i | } | d } | i | | d |  | | } | | } | | } qSW|   _ d S(   s=    Gradient Fill From Colour 1 To Colour 2 From Left To Right. i    i   c            s
  |  d j p |    d j o d Sn  i  t @p*  i  t @p  i  t @o  i  t @or |  d j p  |    d j o  i  t @o d Sq|  d j p  |    d j o  i  t @o d Sqd Sn7 |    d j o d Sn |    d j o d Sn d Sd  S(   Ni   i   i    i   (   R   RL  RM  RD  R  (   R  (   R  R   (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt
   GetYAdjust  s    --N(   i    i    i    (   R  R   R  R   R   RW   R   R<   R   R   R   R  R  R   R:   R/   R  R  RZ  R{   R  R  R  (   R   R  R  R   R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R:   R  R  t   yadjustRK  R  (    (   R   R  s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   DrawHorizontalGradient  s6    88$ 


c         C   s  g  |  _  g  |  _ g  |  _ g  |  _ g  |  _ d } xt |  i    D] } |  i |  } |  i |  } | i	 |  | i
 |  \ } } t | |  } |  i  i |  |  i i |  |  i |  } | i	 |  | i
 |  \ }	 }
 t | |
  } |  i i |	  |  i i |
  |  i i t |  i  | |  i |   qF Wt |  i  } |  i |  i i |   } t |  i  } |  i |  i i |   } t | |  } | | j o
 | } n | } |  i   d } | | f S(   s1    Returns All Tabs Text Extents. Used Internally. i    i   (   t   _mintabwidthsRT  t   _mintabheightst   _maxtabheightst	   _incrtextR   R   R   R  R  R  R  R   R  R  R   R  (   R   R  t	   minheightR   t   txtsR  R  R  R  R!  R"  t   mh1t   mh2t   mhendR  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   GetAllTextExtents&  s@    					 ,
c         C   s  | i  oo |  i i o# |  i | | | i  | | j  q|  i } t |  i _ |  i | |  i | | |  | |  _ nM| i o` |  i i o |  i | |  q|  i } t |  i _ |  i | |  i | | |  | |  _ n| i o` |  i i o |  i	 | |  q|  i } t |  i _ |  i | |  i | | |  | |  _ ny| i
 of |  i i o |  i | | | i
  q|  i } t |  i _ |  i | |  i | | |  | |  _ n	| i o |  i i o? | i t i @o |  i | | |  qN|  i | | |  q|  i } t |  i _ |  i | |  i | | |  | |  _ nt | i oi |  i i o |  i | | | | j  q|  i } t |  i _ |  i | |  i | | |  | |  _ n d S(   s*    Methods That Holds All The Theme Styles. N(   R   R   R   R  RF   t   DrawBuiltinStyleR   R  R   R  R   R  R   RC   R   R  R	  R   R  (   R   R  R   R  R   R  t   oldselstyle(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR  S  sX    
#










c         C   s  | i  t i  t | i    t | i    t | i    } } } t | i    t | i    t | i    } }	 }
 t | i  } t | |  | } t |	 |  | } t |
 |  | } d \ } } } d } xt	 | i
 d | i
 | i  D] } | | | | | | f } | i t i | t i   | d j o | i d } | i d } n> | d j o | i d } | i d } n | i } | i } | d } | i | | | d  | | } | | } | | } qW| |  _ d S(   s    Draw A Gradient Coloured Tab. i    i   i   i   N(   i    i    i    (   R  R   R  R<   R   R   R   R  R  R   R{   R  R  RZ  R:   R  R  R  (   R   R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R{   R  RL  R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   DrawGradientOnTab  s6    88! 		


c         C   s    t  |  i |  |  i   d  S(   Ni    (   R  t   _CalcMaxTabWidthRP  (   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s    c         C   sl   |  i  |  t |  i  } |  i i |  } |  i |  \ } } |  i | d d | | |  } | i d S(   Ni    i   (   t   _CalcMaxTextHeightR  RT  R   RV  RW  R  (   R   R  t	   textWidtht   tabIndexRh  Ri  Rj  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s    c         C   sv   |  i  o+ |  i |  \ } } | |  _ | |  _ n |  i } |  i } | i |  | i d  \ } } | |  _ d  S(   NR  (   R*  R  t
   _minheightR  R  R  t   _maxtextheight(   R   R  R  R  t   _R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s    
			c         C   s/   |  i  o |  i  i   Sn t i d d  Sd  S(   Ni    (   RJ  t   GetBestSizeR   R^  (   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRP    s    
c         C   s  |  i  t @o | i | i | d } |  i i } |  i  t @o& | d 7} | i | i | | } n | i | } | |  i   j o# | |  i  t @o d p d 7} qn[ | i |  i i } | i | i | d } | |  i   j o |  i  t	 @o | d 8} n | | f S(   Ni   i   i(
   R   R  R:   R  R   RD  R{   R  RW   RL  (   R   R  Rh  Ri  Rj  R  t   yoffsetR  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR]    s    
'!c         C   sH   d } |  i  |  } | i   } | o | i   | i   f } n | S(   Ni    (   i    i    (   t   _GetTabBitmapt   OkR  R  (   R   R  R   R   t   bmpOk(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRV    s    c         C   sJ   |  i  i } |  i t @o | p | } | o | |  i  i | } n | S(   N(   R   R:   R   R  (   R   Rh  Ri  t   spacet   bmpSpace(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRa    s
    c         C   s  | } |  i  t @o
 d } n= |  i  t @o( |  i   i |  i |  i i d } n | } | |  i | |  |  i i |  i	 | |  i
   }	 |  i |  i i d }
 |  i  t @o |
 d 7}
 n |  i  t @o |
 |	 }	 }
 n | |  i   j o |  i  t @p |  i  t @ob |	 |  i }	 | d j o | |  i } |	 |  i }	 n |  i  t @o | d 8} n |
 d }
 q|	 d 7}	 n |  i  t @o |  i   i |	 } n t i | | |	 |
  S(   Ni   i   i   i    (   R   RM  RL  R  R{   R  R   Ra  R:   R  t   _CalcXWidthR  RW   R"  RD  R  R   R   (   R   R  Re  Rf  R  Rh  Ri  RL  RK  R  R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRW    s4    
((c         C   s  | i  | |  i | d } |  i t @o |  i i } n | i |  i i d } | |  i   j o~ | d j o |  i t @p |  i t @o | |  i d d } n |  i t @o | d 7} q |  i t @o | d 8} q n |  i t	 @o | | i } | | i  } |  i t
 @o* | i  | d | i | i | } } qx| |  i   7} | i  | i | | i | } } n | | f S(   Ni   i   i    g       @(   R:   R  R   RM  R   R{   RW   RL  R"  R  RD  R  R%  R  (   R   R  Rj  R#  t   xtextpost   ytextpost   xoffsetR  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR`  !  s*    )c         C   sY   |  i  t @o t |  i  } n5 | i |  i |   | i |  i |   \ } } | S(   N(   R   t   NC_FIXED_WIDTHR  RT  R  R  R  R   (   R   R  R  R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRU  =  s
    c   
      C   s>  d  } |  i   \ } } | o| d j oW t |  i i |  i i  d } t | d  } | i | d } d } | d } }	 n |  i t @o6 | i |  i	 |  i i d d } |  i i d } n= | i |  i	 |  i i } | i
 |  i	 |  i i d d } |  i	 } }	 t i | i | | i | | |	  } n | S(   Ni   i   i   i   (   R)   RZ  Ro  R   R:   R{   R  R   R  R  R  R   R   (
   R   Rj  R   Rv  t   dxstylet   minsR(  R  R  R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt
   _CalcXRectE  s"    ""*c         C   s[   |  i    \ } } | o8 | d j o |  i i d } qW |  i i |  i } n d } | S(   Ni   i   i    (   RZ  R   R:   R  (   R   Rv  R*  t   xxspace(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR%  Z  s    c         C   s   | |  i    j } |  i t @o; | i | i | i | o | i d p | i d f } n |  i t @o& | i | i | i d | i f } n_ |  i t @o* | i | i d | i | i d f } n' | i d | i | i d | i f } | i	 |   d  S(   Ni   i   (
   RW   R   RL  R:   R{   R  R  RD  RM  t   SetClippingRegion(   R   R  Rj  R  R   t   cliprect(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   _ClipAtPaperEdgee  s    )&*&c      	   C   s   |  i  o d p d } t i |  t i   d t i d d  d | d t i |  _ |  i i   } | i   d j o! | i	 d  |  i i
 |  n |  i t i |  i |  i  d  S(   Ns   <<s   >>RZ   i    t   labelR   i   (   R  R   t   ButtonR   R!  t   BU_EXACTFITRJ  t   GetFontt   GetPointSizet   SetPointSizeR  R   R   Rw  (   R   t   buttonlabelR  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRI  r  s    'c         C   s   |  i    } | i | i  |  i t i @p@ | i | i  | i | i  | i	 d d | i
 | i  n= | i | i  | i	 d d | i
 | i  |  i | |  d  S(   Ni    (   R  R  R  R   R   R  R  R  R	  R  R:   R{   R  t   _DrawPageEdge(   R   R  t
   paintToolsR   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   _DrawBackground}  s     c         C   s   |  i    o} | i t i  | i | i  | i | i |  i i d | i	 |  i i	 d | i
 |  i i | i |  i i	 d d  n d  S(   Ni   (   R1  R  R   R  R  R  R  R:   R   R{   R  R  (   R   R  R9  Rj  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   _DrawFocusIndicator  s    .c         C   sH  |  i  t @oM | i | i  | i d |  i   i d |  i   i |  i   i d  n |  i i	 p
 |  i
 o | i | i  n | i | i  |  i  t @o# | i d d |  i   i d  n} |  i  t @o= | i |  i   i d d |  i   i d |  i   i  n2 |  i  t @o# | i d d d |  i   i  n d  S(   Ni    i   (   R   RL  R  R	  R  R  R{   R:   R   R   R   R  RM  RD  R  R  RE  (   R   R  R9  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR8    s    =#=c         C   s   |  i    } |  i | | | |  |  i | | | |  |  i | | | |  |  i | | | |  |  i | | |  |  i | | |  d  S(   N(   R  t   _DrawTabGradientOutlinet   _FillTabt   _DrawTabOutlinet   _DrawTabPageEdget   _HighlightTabEdget   _ShadowTabEdge(   R   R  R9  Rj  R  R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   _DrawTab  s    c         C   sk   |  i  |  } |  i |  o& |  i i | | | | t i t  n# |  i i | | | | t i t  d  S(   N(   R  R  R  R  R   R  RF   R
  (   R   R  R  R  R  R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   _DrawTabBitmap  s    c         C   s   |  i  i p
 |  i oz | |  i   j oc |  i t @oU | i t i  | i	 | i
  | i | i d | i d | i | i d d  q n d  S(   Ni   i   (   R   R   R   RW   R   RL  R  R   R  R  R
  R  R:   R{   R  R  (   R   R  R9  Rj  R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR<    s
    !c         C   s   |  i  i p
 |  i o$ | i t i  | i | i  nR | i t i |  i	 |    |  i
 t @o | i | i  n | i | i  |  i | | |  | i | i | i | i | i d  | i   d  S(   Ni   (   R   R   R   R  R   R  R  R	  R  R  R   RL  R  R0  R  R:   R{   R  R  t   DestroyClippingRegion(   R   R  R9  Rj  R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR>    s    %c         C   s;  |  i  i p
 |  i o | i } n% |  i t @o | i } n
 | i } | |  i   j o t i	 |  i
 |   } | i |  |  i t @o1 | i | i d | i | i | i | i  qP|  i t @oC | i | i | i d | i | i | i d | i | i  qP|  i t @o- | i | i | i | i | i | i  qPn | |  i   j oS |  i t @oA | i | i |  i   i d | i | i |  i   i d  qn | i |  |  i t @of | i | i | i | i | i d  | i | i | i d | i | i | i d | i d  n|  i t @o~ | i |  i   i d | i |  i   i | i  | i |  i   i d | i | i d |  i   i | i | i d  nu |  i t @of | i | i | i | i d | i  | i | i | i | i d | i d | i | i d  n d  S(   Ni   i   (   R   R   R   R	  R   RL  R  RW   R   RQ  R  R  RM  R  R:   R{   R  RD  R  RE  R  (   R   R  R9  Rj  R  t   edgePent	   cancelPen(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR?    s8    	1C1E&#2L&c         C   s   | i  |  i |   | i |  i |   | i t i  |  i t @o> |  i t	 @o d p d } | i
 |  i |  | | |  n | i |  i |  | |  d  S(   Ng     V@g     p@(   R  R  t   SetTextForegroundt   _GetTabTextColourR  R   R  R   R  RD  t   DrawRotatedTextR   t   DrawText(   R   R  R  R&  R'  t   angle(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   _DrawTabText  s    #c         C   s>  |  i    \ } } | o!| d j o t |  i i |  i i  d } t | d  } | i t i | d   | i t i	  | i
 | i | i | i | i d | i d |  | i
 | i | i | | i | i d | i d  | i | i | i | i | i  q:| d j o | i t i |   | i t i |   | i | i | i | i | i d  | i t i |  i   d   | i
 | i d | i d | i | i d | i | i d  | i
 | i d | i | i d | i | i d | i d  q:|  i i d | | i | i t i t  n d  S(   Ni   i   i   i   i    (   RZ  Ro  R   R:   R{   R  R   RQ  R  R  R  R  R  R  R  R  R   Ru  R  R  RF   (   R   R  Rj  R  t
   textColourRv  R*  R+  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   _DrawX  s$    55&%@Dc         C   s   | i  t i |  i |  d t i   | i t i  | i | i |  i	 i d d | i
 |  i	 i
 d d | i |  i	 i d | i |  i	 i
 d d d  d  S(   Ni   i   (   R  R   RQ  RH  t   DOT_DASHR  R  R  R:   R   R{   R  R  (   R   R  R  Rj  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   _EnhanceMultiSelectedTab  s    (c         C   s   | i  } | i } | i } |  i t @o | i | i d } n |  i t @o | i } n |  i | | |  |  i | | |  |  i	 | | |  d  S(   Ni   (
   R:   R  R  R   RM  R{   RL  t   _HighlightSelectedTabEdgeRA  R;  (   R   R  R9  Rj  t   xselpost   xselsizet   yselsizet   yselpos(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   _EnhanceSelectedTab  s    			c         C   so   |  i  o. |  i | | |  i | i |  i | i  n4 |  i i p& |  i | |  i | | |  i    n d  S(   N(	   R   R  R   R   R   R   R   R  RW   (   R   R  R9  Rj  R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR=  &  s    
c         C   s  |  i    } t i |  } t i |  } |  i } |  i } |  i i o |  i o |  i	 } n |  i
 } |  i } |  i   o( t i |  i  } t i |  i  }	 n d  } }	 |  i   d j o
 t i p d  }
 |  i   o
 |  i p d  } t | | | | | | | |	 |
 | 
 S(   Ni   (   R   R   R  RQ  R   RU  R   R   R   RT  RW  R   R/  R   R0  R)   RZ  t	   BLACK_PENR1  R
   R  (   R   R  t
   back_brusht   back_pent
   border_pent   highlightpent	   shadowpent   upperhighpent   selectionpenR  t   x_pent   focusindpen(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   _GetPaintTools.  s$    				
#c         C   sn   t  i } |  i |  d j oK |  i |  } |  i |  o |  i i |  } qj |  i i |  } n | S(   Ni    (   R   t
   NullBitmapR  R  R  R  R
  (   R   R  R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR   H  s    	c         C   s0   |  i  |  o |  i |  } n
 |  i } | S(   N(   R  R  R'  (   R   R  R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRH  R  s    	c         C   s  |  i  i o t Sn|  i  i o t d Sn|  i  i o+ | |  i   j o t d Sqt d Sno|  i  i	 oO d d |  i
 d i |  i
 d i d |  i
 d i } t i | | |  Sn|  i  i o+ | |  i   j o t d Sqt d Sn |  i  i o t i } |  i  i t i @oL |  i t @o |  i  i |  } q|  i t @o |  i  i |  } qn] |  i  i t i @oH |  i t @o: |  i t @o |  i  i |  } q|  i  i |  } n | Sn d  S(   Ni    i   iP   i   (   R   R   R  R   R  R   RW   R  R  R   R  R{   R  R   R   R   R  R  R   R   RC   R   R   RL  R   RM  R   R   R  RD  (   R   R   R   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR*  Y  s8    8	c   	      C   s  |  i  t @o:| i d } | i d } |  i  t @o | i | i d p | i } |  i   o | i | i	  | i
 | i  | i | | | | |  | i
 | i  x t d  D]Z } |  i  t @o | d 8} n | d 7} | d 8} | d 7} | i | | | | |  q Wq| i
 | i  | i | | | | |  n:| i d } | i d } |  i  t @o | i | i d } n4 | i } | i
 | i  | i | | | | |  |  i   o | i | i	  | i
 | i  | i | | | | |  | i
 | i  xl t d  D]Z } |  i  t @o | d 8} n | d 7} | d 8} | d 7} | i | | | | |  qWn d  S(   Ni   i   i   i   (   R   R  R{   R  RE  R:   R  R/  R  R  R  R  R  R  R.   R	  RM  (	   R   R  R9  Rj  RU  RT  RR  R  RS  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRQ  z  sN    , 


"	 


c         C   s   |  i  i p
 |  i o_ |  i t @oM | i | i  | i | i d | i	 d | i | i
 d | i	 d  q nT |  i t @oE | i | i  | i | i d | i	 | i | i
 d | i	  n d  S(   Ni   i   i   (   R   R   R   R   RL  R  R  R  R:   R{   R  R	  (   R   R  R9  Rj  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR@    s    Ac         C   sP   | t  @|  _ |  i o | |  _ | t  B|  _ n | |  _ | t  At B|  _ d  S(   N(   R  R  Rz  R}  R)  (   R   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRG    s    
		c   	      C   s  | i  ot   } | i   } | i   } | i  t i @o | t @o | p! | i  t i @o | t @o | } | o | | } } n | i  t i @o | i  t i At i B} n | i  t i At i B} | i t |  | i	 |  | i
 |  | i  t i @oT | i t  } | i t  } | o | | } } n | i |  | i |  n | o | |  _ | |  _ q| |  _ | |  _ n | |  _ | |  _ d  S(   N(   R   RC   R   R   R   RE  R   R   RF   R   R   R   R   R   R{  R~  (	   R   R   t   expandedRI   t   alternatestylet
   firstcolort   secondcolort
   swapcolorst   othergradient(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRH    s8    
	##			c         C   s   |  i  t @p |  i  t @o |  i d t f  n& |  i |  i t i |    d f  |  i i	   i
   t |  _ t |  _ |  i   d  S(   Ni(   R   RL  RM  RN  R$  R  R   R  Rq   R  R  RF   R*  R)  R   (   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s    %		c         C   s   | i  | i  |  i t @oC | i | i | i | i d | i | i | i | i d  nR |  i t	 @oC | i | i | i | i d | i | i | i | i d  n d  S(   Ni   i   i   (
   R  R
  R   RM  R  R:   R  R{   R  RL  (   R   R  R9  Rj  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRA    s    &c      
   C   sY  t  i |   } |  i   d j o | i   d Sn |  i   } | i   |  i | |  |  i |  |  i i	 } |  i i
 } |  i t @o
 d } n |  i or t |  d  p g  |  _ n |  i   o2 |  i o( |  i i   |  _ t |  _ t |  _ q?g  |  _ d |  _ n- |  i   o |  i i   |  _ n
 d |  _ |  i   } d } d g |  i   |  _ g  }	 |	 |  _ g  }
 xUt |  i |  D]A} |  i p |  i | i o| d } d |  i | <|  i | |  } |  i |  \ } } |	 i |  i | | | | | |   |  i  | | |	 d |  |  i! | | |  i" | |	 d |  i# | |    | o- |  i$ | | |  i% | | | |	 d   n |  i&   | | d g j o( |  i' | | |	 |  i&   |  i  n |  i(   d oE |
 i |  i) |	 d   |  i* | |	 d |
 d |  i+ |   n | |  i, j o |  i- | | |	 d  n |  i t. @p |  i t/ @o | |	 d i0 } n | |	 d i1 } |  i o |  i i |	 |  qqd |  i | <qW|
 |  _2 |  i o t |  _ n |  i3 |  i4    |  i5   |  i6 o0 |  i7 o" |  i8 o |  i9 | |  i:  qKn | i;   d S(   s-    Handles The wx.EVT_PAINT Event For TabCtrl. i    Ni   R  i(<   R   t   BufferedPaintDCR   R   Ra  t   BeginDrawingR:  R  RO  R:   R{   R   RD  R)  R  R  R  R.  R  R   R  R   R  R  R   R   R   R   RU  RV  R   RW  RB  RL  R`  Ra  RC  R]  RW   RV  RZ  R,  RN  RH  R=  RP  RL  RM  R  R  R#  RP  R@  RM  R	   R+  R/  R  R-  t
   EndDrawing(   R   R   R  Rz  Re  Rf  R  t   lastvisiblet   oncountRj  t   XrectR   t   newwidthRh  Ri  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRn    s    



				 
(
	


N(   R`   Ra   R   R   R   t   DEFAULT_SIZEt   NC_DEFAULT_STYLEt   DefaultValidatorRM   Rx  Ry  R)   Rw  Rz   R   Rs  R   R  R  R  RF   R  RT   R  R   RW   R  R  R  R  R  R   R  R  R  R  R'  R)  R  R  R  R  R  R  R  R  R  R.  R/  R   R1  R  R  R7  R8  R9  R:  R  R  R  R  R;  R  RK  R+  RM  R  R   RP  R@  R   R  Rk  Rm  R  R  Rq  R  R  Ry  RZ  R|  R~  R  R  R  R  R  R  R  R  Rb  R6  R^  R`  Rd  Rl  Rf  Rh  Rj  R  R  R  R  R  R  R  R  R  R	  R  R  R  R  R  R  RP  R]  RV  Ra  RW  R`  RU  R,  R%  R0  RI  R:  R;  R8  RB  RC  R<  R>  R?  RL  RN  RP  RV  R=  Ra  R   RH  R*  RQ  R@  RG  RH  R  RA  Rn  (    (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s  w					"	%	,	?														:
		;										
								4		<			"	W						
 						?'					2	b	+	$							(		_		5	B	>	-	=	)		
						%																%	
						
		!	.	
			!	
		Ro   c           B   s  e  Z d  Z e i e i e e i d d d  Z d   Z	 d   Z
 e d  Z d   Z d   Z e d	 e d
  Z e d	 e d  Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z e d  Z d   Z e d  Z d   Z  e d  Z! d   Z" d   Z# d   Z$ d d   Z% d!   Z& e d"  Z' e d#  Z( e d$ d^ d^ d%  Z* d&   Z+ e d'  Z, d(   Z- e d)  Z. d*   Z/ d+   Z0 d, d d- d.  Z1 d/   Z2 e d0  Z3 d1   Z4 d^ d2  Z5 e d3  Z6 d^ d4  Z7 d^ d5  Z8 d6   Z9 d7   Z: d8   Z; e d9  Z< d	 d:  Z= d;   Z> d<   Z? d=   Z@ d>   ZA d?   ZB d^ d@  ZC dA   ZD d^ dB  ZE dC   ZF d^ dD  ZG dE   ZH d^ dF  ZI dG   ZJ dH dI  ZK d^ dJ  ZL d^ dK  ZM d^ dL  ZN d^ dM  ZO e d^ dN  ZP e dO  ZQ dP   ZR dQ   ZS e dR  ZT d^ dS  ZU dT   ZV dU   ZW dV   ZX dW   ZY e dX  ZZ dY dZ  Z[ d[   Z\ d\   Z] d]   Z^ RS(_   s  
    Display one or more windows in a notebook.
    
    B{Events}:
        - B{EVT_NOTEBOOKCTRL_PAGE_CHANGING}: sent when the active 
            page in the notebook is changing
        - B{EVT_NOTEBOOKCTRL_PAGE_CHANGED}: sent when the active 
            page in the notebook has changed
        - B{EVT_NOTEBOOKCTRL_PAGE_CLOSING}: sent when a page in the 
            notebook is closing
        - B{EVT_NOTEBOOKCTRL_PAGE_DND}: sent when a page has been 
            dropped onto the notebook in a drag-drop operation
        - B{EVT_NOTEBOOKCTRL_PAGE_DCLICK}: sent when the user 
            double-clicks a tab in the notebook
        - B{EVT_NOTEBOOKCTRL_PAGE_RIGHT}: sent when the user
            clicks a tab in the notebook with the right mouse
            button
        - B{EVT_NOTEBOOKCTRL_PAGE_MIDDLE}: sent when the user
            clicks a tab in the notebook with the middle mouse
            button
    i   Ro   c	   
      C   sA  t  i i |  | d d t  i t  i Bd | t |  d | | |  |  _ g  |  _ | t @d j oA | t	 @d j o0 | t
 @d j o | t @d j o | t B} n | t  i @d j o% | t  i @d j o | t  i B} n | |  _ t |  _ t |  _ | |  _ d |  _ t |  _ d |  _ | t @p | t	 @o. t  i t  i  |  _ t  i t  i  |  _ n+ t  i t  i  |  _ t  i t  i  |  _ t  i |  |  _ | t @p | t	 @o t  i t  i B}	 n t  i  t  i! B}	 | t @p | t
 @oo |  i i" |  i d t  i# |	 Bd  |  i$ | |  |  i i" |  i d t  i#  |  i i" |  i d t  i#  n | t	 @p | t @oo |  i i" |  i d t  i#  |  i i" |  i d t  i# |	 Bd  |  i i" |  i d t  i#  |  i$ | |  n |  i% |  i  |  i i& |  i t  |  i i'   |  i( t  i) |  i*  |  i( t  i+ |  i,  d S(   s  
        Default Class Constructor.
        
        @param style: Style For The NotebookCtrl, Which May Be:
          a) NC_TOP: NotebookCtrl Placed On Top (Default);
          b) NC_BOTTOM: NotebookCtrl Placed At The Bottom;
          c) NC_LEFT: NotebookCtrl Placed At The Left;
          d) NC_RIGHT: NotebookCtrl Placed At The Right;
          e) NC_FIXED_WIDTH: All Tabs Have The Same Width;
          f) wx.NO_BORDER: Shows No Border For The Control (Default, Looks Better);
          g) wx.STATIC_BORDER: Shows A Static Border On The Control.
          
        @param sizer: The Sizer Orientation For The Sizer That Holds
          All The Panels: Changing This Style Is Only Useful When You
          Use The Tile Method. In This Case, If sizer=wx.HORIZONTAL,
          All The Panels Will Be Shown In Columns, While If
          sizer=wx.VERTICAL All The Panels Will Be Shown In Rows.

        @param margin: An Integer Number Of Pixels That Add Space
          Above TabCtrl If style=NC_TOP, Or Below It If
          style=NC_BOTTOM
        iR   R   i    i   i   N(-   R   t   PanelRM   t   NO_FULL_REPAINT_ON_RESIZEt   CLIP_CHILDRENR  R  R  RL  RM  RD  RE  R  t   STATIC_BORDERR   R   t   _showcolumnsRF   t	   _showtabst   _sizerstyleR)   t   _custompanelt   _focusswitcht	   _oldfocust   BoxSizert   VERTICALR  t   tabsizert
   HORIZONTALR  t   LEFTt   RIGHTt   TOPt   BOTTOMR  R  t
   _AddMargint   SetSizerR  R  R   Ra  Rb  Rr  Rs  (
   R   Rv   RP   RZ   R   R   R  t   marginR   t   tabBorderFlag(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRM     sR    	""							# #c         C   s   | i    t i j o | i   o |  i   } | |  i   d j o
 d } n | d } x@ |  i |  p/ | d } | |  i   d j o
 d } q] q] W|  i |  q n | i   d S(   s   
        Handles The wx.EVT_KEY_DOWN Event For NotebookCtrl. This Is Only Processed
        If The User Navigate Through Tabs With Ctrl-Tab Keyboard Navigation.
        i   i    N(	   R  R   R  R  RW   R   R  RT   R   (   R   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRs    s    

 
c         C   s  |  i  i o | i   o | i   o | i   o d } | i   } t | i |  i  i i  } t | i	 |  i  i i	  } | | j o% | | j o |  i
 t i  d Sn |  i
 |  i  i  t |  i  _ q t |  i  _ |  i
 t i  n |  i  i o |  i  i o | i   } |  i  i |  |  i  _ |  i  i d j  oG y  |  i  i i   t |  i  _ Wn t |  i  _ n X|  i  i   qqn | i   d S(   s3    Handles The wx.EVT_MOTION Event For NotebookCtrl. i   Ni    (   R  R	   R  R  R  R   R  R:   RB  R{   R  R   R  RA  RF   R+  R   R2  R3  R|  R1  R4  R  R   R   (   R   R   R  Rz  R  R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRb    s2    )c         C   s   | |  _  d S(   sL    Enables/Disables Sending EVT_NOTEBOOKCTRL_PAGE_CHANGING When In Tile Mode. N(   R{  (   R   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   EnableChildFocus  s    c         C   s@   x9 | |  i  j o | Sn y | i   } Wq d Sq Xq d S(   sF    Find Which NotebookCtrl Page Has The Focus Based On Its Child Focus. N(   R  R  R)   (   R   Rq  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   FindFocusedPage  s    c         C   s$  |  i  p | i   d Sn |  i | i    } | |  i j p | d j o | i   d Sn | |  _ t t |  i    } |  i	 i
 |  } | i |  | i |  i    | i |   |  i   i |  pC | |  i _ | i t  | i |  i i  |  i   i |  n | i   d S(   s8    Handles The wx.EVT_CHILD_FOCUS Event For NotebookCtrl. N(   R{  R   R  R   R|  R)   RK   R  R   R  R   RT   RV   RW   R  R  R  R  RS   R  R  (   R   R   t   newfocusR  R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   OnFocus'  s&    


	ic         C   s`  |  i    |  i i   } |  i   d j oK |  i   d j	 o4 |  i i |  i  |  i i	 t
  |  i i   qw n |  i i | d t i t i Bd  |  i i | | | |  |  i i |  | i t i |  i  | oX | d j o  |  i i	 |  i |  t
  n |  i i |  i   d  |  i i   n_ | d j o |  i i	 | t
  n; |  i i	 | t  |  i i |  i   d  |  i i   |  i   d j oR |  i i	 | t  |  i i o |  i t
  q|  i i	 t  |  i t  n |  i i	 t  |  i t  |  i i   |  i i   |  i   |  i |  i  |  i |  i   d S(   s  
        Add A Page To The Notebook.
        
        @param page: Specifies The New Page;
        @param text: The Tab Text;
        @param select: Whether The Page Should Be Selected Or Not;
        @param img: Specifies The Optional Image Index For The New Page.
        i    i   i   N(!   R  R  RW   R   t   GetCustomPageR)   R  R  Rz  R  R   R  R  R   R  R  R  R  R   R   t   EVT_CHILD_FOCUSR  R  RT   RF   R   t   _ShowTabCtrlR  R  t   TileRw  t   ShowTabsRx  (   R   R  R   R  R  R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR  H  sD    

# 
c   	      C   s  | d j  p& |  i    d j o+ | |  i   j o d t |  d  n |  i   |  i i    } |  i   d j o> |  i   d j	 o' |  i i |  i	  |  i	 i
 t  q n | d j o$ |  i i
 | t  |  i i   n | | j o | d } n |  i i | | | | |  |  i i | | d t i t i Bd  |  i i | |  |  i i   | i t i |  i  x- t |  i    D] } |  i i
 | t  qW|  i i   | o$ |  i i
 | t  |  i i   nE | d j o$ |  i i
 | t  |  i i   n |  i i
 | t  |  i i   |  i   d j o? |  i i o |  i t  q|  i i
 t  |  i t  n |  i i
 t  |  i t  |  i i   |  i   |  i |  i  |  i |  i   d S(   s  
        Insert A Page Into The Notebook.
        
        @param page: Specifies The New Page;
        @param nPage: Specifies The Position For The New Page;
        @param text: The Tab Text;
        @param select: Whether The Page Should Be Selected Or Not;
        @param img: Specifies The Optional Image Index For The New Page.
        @param hidden: C{True} to hide the page; C{False} to display it
        i    s.   
ERROR: Invalid Notebook Page In InsertPage: (R  i   i   N(!   RW   R   R  R  R  R  R)   R  R  Rz  R  R   R  R  t   InsertR   R  R  R  R  R   R  R  R   RF   R   R  R  R  R  Rw  R  Rx  (	   R   R  R  R   R  R  R   R  R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    sR    3
& 
c         C   sC   | d j  p | |  i    j o d t |  d  n |  i | S(   s1    Returns The Window At The Given Position nPage. i    s+   
ERROR: Invalid Notebook Page In GetPage: (R  (   R   R  R  (   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s     c         C   s  |  i    |  i   d } xK t |  i    D]7 } |  i i | |  |  i | |  } | i   q- W|  i i   g  |  _	 d |  i _
 |  i i t  |  i   } | d j	 o |  i |  | i t  n |  i i   |  i t  |  i i   |  i   d S(   s!    Deletes All NotebookCtrl Pages. i   iN(   R  R   R   R  R  R  R  R  R  R  RS   R  R   R  R)   t   SetCustomPageRF   R  R  R  R  (   R   R  R   t   panelst   custom(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s&    
 	c         C   s  | d j  p | |  i    j o d t |  d  n |  i   } |  i   |  i |  } |  i i |  |  i i   |  i i	 |  |  i
 i |  | i   |  i    d j ou | | j od |  i   d j o |  i |  i    q(|  i |  i    |  i i |  i    |  i i   q,n |  i    d j o |  i
 i t  |  i t  |  i   } | d j	 o4 |  i i | d t i t i Bd  | i t  n |  i i   |  i i   |  i   d Sn |  i    d j o? |  i
 i o |  i t  qD|  i
 i t  |  i t  n |  i
 i t  |  i t  |  i i   |  i   |  i |  i  |  i |  i  d S(   s4    Deletes The Page nPage, And The Associated Window. i    s.   
ERROR: Invalid Notebook Page In DeletePage: (R  i   i   N(   R   R  RW   R  R  R  R  R  R  R  R  R  R  RT   R  R   R  R  R)   R  R   R  R  RF   R  R  R   R  Rw  R  Rx  (   R   R  R  R  R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    sN     

#

c         C   s   | d j  p | |  i    j o d t |  d  n |  i   } | | j o d Sn |  i i |  |  i |  i  |  i |  i  d S(   s   
        Sets The Current Tab Selection To The Given nPage. This Call Generates The
        EVT_NOTEBOOKCTRL_PAGE_CHANGING Event.
        i    s0   
ERROR: Invalid Notebook Page In SetSelection: (R  N(	   R   R  RW   R  RT   R  Rw  R  Rx  (   R   R  R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRT   H  s     c         C   s   |  i  i   S(   s.    Returns The Number Of Pages In NotebookCtrl. (   R  R   (   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR   \  s    c         C   s   |  i  i   S(   s     Returns The Current Selection. (   R  RW   (   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRW   b  s    c         C   s   |  i  i   S(   s:    Returns The Image List Associated With The NotebookCtrl. (   R  R  (   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR  h  s    c         C   s   |  i  i |  d S(   s*    Associate An Image List To NotebookCtrl. N(   R  R  (   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR  n  s    c         C   s   |  i  i |  d S(   s*    Associate An Image List To NotebookCtrl. N(   R  R  (   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR  t  s    c         C   s   |  i  i   S(   sE    Returns The (Horizontal, Vertical) Padding Of The Text Inside Tabs. (   R  R  (   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR  z  s    c         C   s   |  i  i |  d S(   sB    Sets The (Horizontal, Vertical) Padding Of The Text Inside Tabs. N(   R  R  (   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s    c         C   s   |  i  i |  d S(   s0    Globally Enables/Disables Tab Focus Indicator. N(   R  R   (   R   R0  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR     s    c         C   s   |  i  i   S(   s@    Returns Globally Enable/Disable State For Tab Focus Indicator. (   R  R1  (   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR1    s    c         C   sO   | d j  p | |  i    j o d t |  d  n |  i i | |  d S(   s&    Enable/Disable The Given Page nPage. i    s.   
ERROR: Invalid Notebook Page In EnablePage: (R  N(   R   R  R  R  (   R   R  R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s     c         C   sH   | d j  p | |  i    j o d t |  d  n |  i i |  S(   s+    Returns Whether A Page Is Enabled Or Not. i    s1   
ERROR: Invalid Notebook Page In IsPageEnabled: (R  (   R   R  R  R  (   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s     c         C   s   |  i  i |  d S(   s>    Globally Enables/Disables Tab Highlighting On Tab Selection. N(   R  R.  (   R   R-  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR.    s    c         C   s   |  i  i   S(   sN    Returns Globally Enable/Disable State For Tab Highlighting On Tab Selection. (   R  R/  (   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR/    s    c         C   s   | d j  p | |  i    j o d t |  d  n | p d t |  d  n t |  d j  o d t t |   d  n t |  |  i   i   d j o< d t t |   d	 t |  i   i   d  d  n |  i i | |  d
 S(   s   
        Sets An Animation List Associated To The Given Page nPage.
        
        @param nPage: The Given Page;
        @param imgarray: A List Of Image Indexes Of Images Inside The
          ImageList Associated To NotebookCtrl.
        i    s6   
ERROR: Invalid Notebook Page In SetAnimationImages: (R  s4   
ERROR: Invalid Image Array In SetAnimationImages: (sD   
ERROR: Invalid Image Array In SetAnimationImages: (Min(ImgArray) = s    < 0)i   sD   
ERROR: Invalid Image Array In SetAnimationImages: (Max(ImgArray) = s    > N(	   R   R  Rn  Ro  R  R  R  R  R  (   R   R  Rp  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s    	 #<c         C   sH   | d j  p | |  i    j o d t |  d  n |  i i |  S(   sG    Returns The Animation Images List Associated To The Given Page nPage. i    s6   
ERROR: Invalid Notebook Page In GetAnimationImages: (R  (   R   R  R  R  (   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s     i  c         C   sO   | d j  p | |  i    j o d t |  d  n |  i i | |  d S(   sR    Starts The Animation On The Given Page nPage, With Refreshing Time Rate "timer". i    s2   
ERROR: Invalid Notebook Page In StartAnimation: (R  N(   R   R  R  R  (   R   R  R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s     c         C   sL   | d j  p | |  i    j o d t |  d  n |  i i |  d S(   s.    Stops The Animation On The Given Page nPage. i    s1   
ERROR: Invalid Notebook Page In StopAnimation: (R  N(   R   R  R  R  (   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s     c         C   s   |  i  i |  d S(   s.    Globall Enables/Disables Tabs Drag And Drop. N(   R  Rk  (   R   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRk    s    c         C   s   |  i  i |  d S(   s6    Globally Enables/Disables Hiding On Tabs In Runtime. N(   R  Rm  (   R   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRm    s    i   c         C   s   |  i  i | | | |  d S(   s  
        Globally Enables/Disables The Drawing Of A Closing "X" In The Tab.
        
        @param drawx: C{True} to enable drawing a closing "X"; C{False} to
          disable it
        @param style: the style of the X to draw when C{drawx} is C{True};
          possible values are:
            - C{1}: Small "X" At The Top-Right Of The Tab;
            - C{2}: Bigger "X" In The Middle Vertical Of The Tab (Like Opera Notebook);
            - C{3}: Custom "X" Image Is Drawn On Tabs.
        @param image1: if C{style} is C{3}, the image to use when drawing
          the X on an unhighlighted tab
        @param image2: if C{style} is C{3}, the image to use when drawing
          the X on a highlighted tab
        N(   R  Ry  (   R   Rv  R   Rw  Rx  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRy    s    c         C   s   |  i  i   S(   st   
        Returns The Enable/Disable State Of Drawing Of A Small "X" At The Top-Right Of
        Every Page.
        (   R  RZ  (   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRZ    s    c         C   s   |  i  i |  d S(   sJ    Set Whether The Tab Icon Should Be Converted To The Close Button Or Not. N(   R  R  (   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s    c         C   s
   |  i  i S(   sJ    Get Whether The Tab Icon Should Be Converted To The Close Button Or Not. (   R  R   (   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s    c         C   s]   |  i  i |  |  i   d j o6 | o |  i t  n |  i t  |  i i   n d S(   s?    Hides The TabCtrl When There Is Only One Tab In NotebookCtrl. i   N(   R  R  R   R  R   RF   R  R  (   R   RQ  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s    c         C   sO   | d j  p | |  i    j o d t |  d  n |  i i | |  d S(   s-    Sets A Popup Menu Specific To A Single Tab. i    s4   
ERROR: Invalid Notebook Page In SetPagePopupMenu: (R  N(   R   R  R  R  (   R   R  R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR  (  s     c         C   sH   | d j  p | |  i    j o d t |  d  n |  i i |  S(   s4    Returns The Popup Menu Associated To A Single Tab. i    s4   
ERROR: Invalid Notebook Page In GetPagePopupMenu: (R  (   R   R  R  R  (   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR  1  s     R$   i  c         C   sU   | d j  p | |  i    j o d t |  d  n |  i i | | | |  d S(   s  
        Sets A ToolTip For The Given Page nPage.
        
        @param nPage: The Given Page;
        @param tooltip: The ToolTip String;
        @param timer: The Timer After Which The Tip Window Is Popped Up;
        @param winsize: The Maximum Width Of The Tip Window.
        i    s2   
ERROR: Invalid Notebook Page In SetPageToolTip: (R  N(   R   R  R  R  (   R   R  R  R  R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR  :  s    
 c         C   sH   | d j  p | |  i    j o d t |  d  n |  i i |  S(   s3    Returns A Tuple With All Page ToolTip Parameters. i    s2   
ERROR: Invalid Notebook Page In GetPageToolTip: (R  (   R   R  R  R  (   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR  J  s     c         C   s   |  i  i |  d S(   s)    Globally Enables/Disables Tab ToolTips. N(   R  R7  (   R   R6  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR7  S  s    c         C   s   |  i  i   S(   s/    Returns The ToolTip Window Background Colour. (   R  R8  (   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR8  Y  s    c         C   s:   | d j o t i d d d  } n |  i i |  d S(   s,    Sets The ToolTip Window Background Colour. i   i   N(   R)   R   R   R  R9  (   R   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR9  _  s    c         C   s   |  i  i |  d S(   sK    Globally Enables/Disables Drawing Of Gradient Coloured Tabs For Each Tab. N(   R  R:  (   R   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR:  h  s    c         C   si   | d j  p | |  i    j o d t |  d  n | d j o t i } n |  i i | |  d S(   s,    Sets The Single Tab First Gradient Colour. i    s>   
ERROR: Invalid Notebook Page In SetPageFirstGradientColour: (R  N(   R   R  R)   R   R   R  R  (   R   R  R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR  n  s
     c         C   sO   | d j  p | |  i    j o d t |  d  n |  i i | |  d S(   s-    Sets The Single Tab Second Gradient Colour. i    s?   
ERROR: Invalid Notebook Page In SetPageSecondGradientColour: (R  N(   R   R  R  R  (   R   R  R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR  z  s     c         C   sH   | d j  p | |  i    j o d t |  d  n |  i i |  S(   s/    Returns The Single Tab First Gradient Colour. i    s>   
ERROR: Invalid Notebook Page In GetPageFirstGradientColour: (R  (   R   R  R  R  (   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s     c         C   sH   | d j  p | |  i    j o d t |  d  n |  i i |  S(   s0    Returns The Single Tab Second Gradient Colour. i    s?   
ERROR: Invalid Notebook Page In GetPageSecondGradientColour: (R  (   R   R  R  R  (   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s     c         C   s   |  i  i   d S(   s<    Destroys The Tip Window (Probably You Won't Need This One. N(   R  R;  (   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR;    s    c         C   s   |  i  i |  d S(   s   
        Cycles Through The Tabs. The Call To This Function Generates The
        EVT_NOTEBOOKCTRL_PAGE_CHANGING Event.
        N(   R  R  (   R   R<  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s    c         C   s?   | |  i    j o d t |  d  n |  i i |  d S(   sw   
        Sets The Default Page That Will Be Selected When An Active And Selected
        Tab Is Made Inactive.
        s2   
ERROR: Invalid Notebook Page In SetDefaultPage: (R  N(   R   R  R  RK  (   R   R>  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRK    s    c         C   s   |  i  i   S(   s    Returns The Default Page. (   R  R+  (   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR+    s    c         C   sH   | d j  p | |  i    j o d t |  d  n |  i i |  S(   s.    Returns The String For The Given Page nPage. i    s/   
ERROR: Invalid Notebook Page In GetPageText: (R  (   R   R  R  R   (   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR     s     c         C   sO   | d j  p | |  i    j o d t |  d  n |  i i | |  d S(   s+    Sets The String For The Given Page nPage. i    s/   
ERROR: Invalid Notebook Page In SetPageText: (R  N(   R   R  R  R  (   R   R  R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s     c         C   sH   | d j  p | |  i    j o d t |  d  n |  i i |  S(   s3    Returns The Image Index For The Given Page nPage. i    s0   
ERROR: Invalid Notebook Page In GetPageImage: (R  (   R   R  R  R  (   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s     c         C   sO   | d j  p | |  i    j o d t |  d  n |  i i | |  d S(   s0    Sets The Image Index For The Given Page nPage. i    s0   
ERROR: Invalid Notebook Page In SetPageImage: (R  N(   R   R  R  R  (   R   R  R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s     c         C   sr   | d j  p | |  i    j o d t |  d  n | d j o t i t i  } n |  i i | |  d S(   s1    Sets The Primary Font For The Given Page nPage. i    s3   
ERROR: Invalid Notebook Page In SetPageTextFont: (R  N(   R   R  R)   R   R   R   R  R  (   R   R  R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s
     c         C   sH   | d j  p | |  i    j o d t |  d  n |  i i |  S(   s4    Returns The Primary Font For The Given Page nPage. i    s3   
ERROR: Invalid Notebook Page In GetPageTextFont: (R  (   R   R  R  R  (   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s     c         C   sr   | d j  p | |  i    j o d t |  d  n | d j o t i t i  } n |  i i | |  d S(   s3    Sets The Secondary Font For The Given Page nPage. i    s<   
ERROR: Invalid Notebook Page In SetPageTextSecondaryFont: (R  N(   R   R  R)   R   R   R   R  R  (   R   R  R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s
     c         C   sH   | d j  p | |  i    j o d t |  d  n |  i i |  S(   s6    Returns The Secondary Font For The Given Page nPage. i    s<   
ERROR: Invalid Notebook Page In GetPageTextSecondaryFont: (R  (   R   R  R  R  (   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s     c         C   si   | d j  p | |  i    j o d t |  d  n | d j o t i } n |  i i | |  d S(   s0    Sets The Text Colour For The Given Page nPage. i    s5   
ERROR: Invalid Notebook Page In SetPageTextColour: (R  N(   R   R  R)   R   R   R  R  (   R   R  R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s
     c         C   sH   | d j  p | |  i    j o d t |  d  n |  i i |  S(   s3    Returns The Text Colour For The Given Page nPage. i    s5   
ERROR: Invalid Notebook Page In GetPageTextColour: (R  (   R   R  R  R  (   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s     c         C   sr   | d j  p | |  i    j o d t |  d  n | d j o t i t i  } n |  i i | |  d S(   s:    Sets The Tab Background Colour For The Given Page nPage. i    s1   
ERROR: Invalid Notebook Page In SetPageColour: (R  N(   R   R  R)   R   R   R   R  R  (   R   R  R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s
     c         C   sH   | d j  p | |  i    j o d t |  d  n |  i i |  S(   s=    Returns The Tab Background Colour For The Given Page nPage. i    s1   
ERROR: Invalid Notebook Page In GetPageColour: (R  (   R   R  R  R  (   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR  %  s     i   c         C   s+   | d j o
 d  n |  i  i |  d S(   s    Sets The Tabs Height. i    s*   
ERROR: Impossible To Set An Height <= 0. N(   R  R'  (   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR'  .  s    
c         C   s7   | d j o t i t i  } n |  i i |  d S(   s7    Sets The TabCtrl Background Colour (Behind The Tabs). N(   R)   R   R   R(  R  R   (   R   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR)  7  s    c         C   s.   | d j o t   } n |  i i |  d S(   s/    Apply A Particular Theme To Be Drawn On Tabs. N(   R)   RC   R  R  (   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR  @  s    c         C   s:   | d j o t i d d d  } n |  i i |  d S(   sC    Sets The Tab Selection Colour (Thin Line Above The Selected Tab). i   i   i    N(   R)   R   R   R  R  (   R   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR  I  s    c         C   s   |  i  i |  d S(   s;    Sets The Contour Line Colour (Controur Line Around Tabs). N(   R  R  (   R   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR  R  s    c      	   C   s  |  i    i   | j o | d j o d Sn |  i   | d j	 o1 | o* | t i j o t i } qv t i } n | d j	 oB| o;|  i i   } | | j ox4 t	 |  i
   d d d  D] } |  i i |  q W|  i i |  i  |  i i   t i |  |  _ xD t	 |  i
    D]0 } |  i i |  i | d t i t i Bd  q"W|  i t @o  |  i i |  i d t i  n  |  i i d |  i d t i  |  i i   |  i i   qn |  i   } | o.|  i t  |  i t @p |  i t @ot |  i i  d j o^ x t	 |  i
    D]C } | |  i i j o |  i i | t  q-|  i i | t  q-Wqxt	 |  i
    D]z } |  i  |  oQ |  i i! p |  i i" | i# o |  i i | t  q|  i i | t  q|  i i | t  qWqt |  i i  d j oK x t	 |  i
    D]0 } | |  i i j o |  i i | t  q9q9Wqxnt	 |  i
    D]z } |  i  |  oQ |  i i! p |  i i" | i# o |  i i | t  q|  i i | t  q|  i i | t  qWn |  i t  |  i t @p |  i t @o4 xa t	 |  i
    D] } |  i i | t  qBWn1 x- t	 |  i
    D] } |  i i | t  qvW| d j  o" |  i i   |  i i   d Sn! |  i i | t  |  i i   | |  _$ |  i i   |  i i   |  i%   d S(   sM    Shows Pages In Column/Row Mode (One Panel After The Other In Columns/Rows). Ni   ii   i    (&   t   _GetTabCtrlWindowRD  R)   R  R   R~  R  R  t   GetOrientationR   R   R  R  R  R}  R  R  R  R  R   RL  R  R  RW   R  R   RD  R/   R  R=  R  RF   R  R   R   R   Rw  R  (   R   R6  t   orientt   norientt
   origorientR   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR  W  s    &
  .   #  #  	c         C   sw   |  i    i   | j o d Sn |  i   d j o d Sn |  i   |  i |  | |  _ |  i i   |  i   d S(   s    Shows/Hides Tabs On Request. Ni    (	   R  RD  R   R  R  Rx  R  R  R  (   R   R6  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s    
	c         C   s(   | |  i  j o |  i  i |  Sn d S(   sJ    Returns The Page Index (Position) Based On The NotebookCtrl Page Passed. i(   R  R   (   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   GetIndex  s    c         C   sk   | d j  p& |  i    d j o+ | |  i   j o d t |  d  n |  i |  } | i |  d S(   s8    Reparents The NotebookCtrl Page nPage To A New Parent. i    s0   
ERROR: Invalid Notebook Page In ReparentPage: (R  N(   RW   R   R  R  R  (   R   R  t	   newParentR  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   ReparentPage  s    3c   
      C   s  | d j  p& |  i    d j o+ | |  i   j o d t |  d  n |  i   |  i |  } |  i |  } | d } | i   } t d d | d |  d | d | d	 | } | oF t	 | d d
 |  i
 d |  i } | i | d  |  i | |  nh |  i | |  |  i i | t  |  i i |  |  i i   |  i i   |  i i |  |  i   |  i   d j o |  i t  |  i i   n |  i   }	 |	 d j	 o |  i |	  n |  i   | i   d S(   s7    Reparents The NotebookCtrl Page nPage To A New Frame. i    s3   
ERROR: Invalid Notebook Page In ReparentToFrame: (R  R   iR  R  R  t	   oldparentR   R  R  N(   RW   R   R  R  R  R  R  t   NCFrameR)   Ro   R   Ry  R  t   ReparentToNotebookR  R  R  R   R  R  R  R  R  R  R  R  R  R  R  R  (
   R   R  t   createNotebookR  R  R   R  t   frameR  R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   ReparentToFrame  s6    3

*!

c         C   s  | d j  p& |  i    d j o+ | |  i   j o d t |  d  n | d j	 o+ | | i   j o d t |  d  n |  i   |  i |  } |  i |  } |  i | |  | d j o2 | i | | d t	 | d  | i
 d |  n x* t D]" } t | | t |  i |   qW|  i i | t	  |  i i |  |  i i   |  i i   |  i i |  |  i   |  i   d j o |  i t	  |  i i   n |  i   d S(   s>    Reparents The NotebookCtrl Page nPage To A New NotebookCtrl. i    s6   
ERROR: Invalid Notebook Page In ReparentToNotebook: (R  s:   
ERROR: Invalid Notebook New Page In ReparentToNotebook: (R   R   N(   RW   R   R  R)   R  R  R  R  R  R   R  t   attrst   setattrt   getattrR  R  R  R  R  R  R  R  R  R  R  (   R   R  t   notebookt   newPageR  R  t   attr(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s0    3 
  
c         C   s  | d j  p& |  i    d j o+ | |  i   j o d t |  d  n |  i |  } |  i |  } |  i |  } |  i |  } |  i |  } |  i |  } |  i	 |  } |  i
 |  \ }	 }
 } |  i |  } |  i |  } |  i |  } |  i i | i } d } d } |  i i | i   o  d } |  i i | i   } n |  i |  |  i |  } h  | d <| d <| d <| d <| d	 <| d
 <| d <|	 d <|
 d <| d <| d <| d <| d <| d <|  i i d <| d <| d <| d <} | S(   s5    Returns All The Style Information For A Given Page. i    s/   
ERROR: Invalid Notebook Page In GetPageInfo: (R  i   R   R   R  R  R  R  R  R  R  R  R   R  R  R  R  R  R  R  N(   RW   R   R  R   R  R  R  R  R  R  R  R  R  R  R  R   R   R)   R>  R  R  R  R  R  (   R   R  R   R   R  R  R  R  R  R  R  R  R   R  R  R  R  R  R  R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR  5  s8    3(c         C   sv  | d j  p& |  i    d j o+ | |  i   j o d t |  d  n |  i | | d  |  i | | d  |  i | | d  |  i | | d  |  i | | d  |  i | | d	 | d
 | d  |  i	 | | d  |  i
 | | d  |  i | | d  | d |  i i | _ | d oC t | d  d j o, |  i | | d  |  i | | d  n d S(   s2    Sets All The Style Information For A Given Page. i    s/   
ERROR: Invalid Notebook Page In SetPageInfo: (R  R  R  R  R  R  R  R  R  R   R  R  R  R  R  i   R  N(   RW   R   R  R  R  R  R  R  R  R  R  R  R  R   R   R/   R  R  (   R   R  R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR  \  s    3""c         C   s?  |  i    | d j o_ |  i d j	 o' |  i i |  i  |  i i t  n |  i   d j o |  i t  qn |  i   d j ox |  i d j	 o' |  i i |  i  |  i i t  n |  i i	 | d t
 i t
 i Bd  | i t  |  i t  n | i t  | |  _ |  i i   |  i i   |  i   d S(   sK    Sets A Custom Panel To Show When There Are No Pages Left In NotebookCtrl. i    i   i   N(   R  R)   Rz  R  R  R  R   R   R  R  R   R  R  RF   R  R  R  (   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR  r  s&    
#	c         C   s   |  i  S(   sK    Gets A Custom Panel To Show When There Are No Pages Left In NotebookCtrl. (   Rz  (   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s    c         C   s   |  i  i | |  d S(   s"    Hides A Tab In The NotebookCtrl. N(   R  R   (   R   R  RQ  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR     s    i    c         C   s   |  i  i | |  S(   s  
        Standard NotebookCtrl HitTest() Method. If Called With 2 Outputs, It
        Returns The Page Clicked (If Any) And One Of These Flags:

        NC_HITTEST_NOWHERE = 0   ==> Hit Not On Tab 
        NC_HITTEST_ONICON  = 1   ==> Hit On Icon 
        NC_HITTEST_ONLABEL = 2   ==> Hit On Label 
        NC_HITTEST_ONITEM  = 4   ==> Hit Generic, On Item
        NC_HITTEST_ONX = 8       ==> Hit On Closing "X" On Every Page
        (   R  R  (   R   R   Rc  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s    c         C   sj   | t  @p | t @o |  i i d | f d  n4 | t @p | t @o |  i i | d f d  n d  S(   Ni    (   RL  RM  R  R  RD  RE  (   R   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s    c         C   sD   |  i  t @p |  i  t @o |  i i d  Sn |  i i d  Sd  S(   Ni   i    (   R   RL  RD  R  t   GetItem(   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s    c         C   s<   |  i  t @o |  i i d |  n |  i i d |  d  S(   Ni    i   (   R   RL  R  R  (   R   R6  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s    N(_   R`   Ra   Rb   R   R   R   Rq  R  RM   Rs  Rb  RF   R  R  R  R   R  R  R  R  R  RT   R   RW   R  R  R  R  R  R   R1  R  R  R.  R/  R  R  R  R  Rk  Rm  R)   Ry  RZ  R  R  R  R  R  R  R  R7  R8  R9  R:  R  R  R  R  R;  R  RK  R+  R   R  R  R  R  R  R  R  R  R  R  R  R'  R)  R  R  R  R  R  R  R  R  R  R  R  R  R  R   R  R  R  R  (    (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRo   j  s   Q		'		!CO			!	D																																																										`			
.)	'					t   _PopupWindowc           B   s   e  Z d    Z RS(   c         C   s   t  i |  d  } |  i   i   } | i |  d } d } t |  } | } | i d  }	 t  i | d d i |	   }
 |
 i	   \ } } |
 i
 d  | i | d | d f  |  i | i    d  S(   Nii   i   s   
i   (   i   i   (   R   Rs  R  R8  R   R/   t   splitt
   StaticTextR2   R  R  RA  R  (   R   R  R  R  R   t   bordert   textPaddingt   max_lent   twt   mylinest   stst   sxt   sy(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   _Fill  s    (   R`   Ra   R  (    (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s   R3  c           B   s#   e  Z d    Z d   Z d   Z RS(   c         C   s0   t  i i |  | d t  i |  i | |  d  S(   NRc  (   R   R2  RM   t   SIMPLE_BORDERR  (   R   Rv   R  R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRM     s    c         C   s   t  S(   N(   R   (   R   t   evt(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   ProcessLeftDown  s    c         C   s   t  S(   N(   R   (   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt	   OnDismiss  s    (   R`   Ra   RM   R  R  (    (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR3    s   		t   macPopupWindowc           B   s&   e  Z d    Z e d  Z d   Z RS(   c         C   s   t  i i |  | d d d | t  i Bt  i Bt |  _ | |  _ x0 t o( |  i i	   } | o | |  _ qB PqB W|  i
 t  i |  i  d  S(   NRP   iR   (   R   t   FrameRM   t   FRAME_NO_TASKBARt   STAY_ON_TOPR   t   _hideOnActivatet   _parentFrameRF   R  R   t   EVT_ACTIVATEt
   OnActivate(   R   Rv   Rc  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRM     s    -		 c         C   s8   t  i i |  |  | o |  i i   t |  _ n d  S(   N(   R   R  R  R  t   RaiseRF   R  (   R   R6  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s    c         C   s%   |  i  o t i i |  t  n d S(   so   
        Let The User Hide The Tooltip By Clicking On It. 
        NotebookCtrl Will Destroy It Later.
        N(   R  R   R  R  R   (   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s    
(   R`   Ra   RM   RF   R  R  (    (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s   		R5  c           B   s   e  Z d    Z RS(   c         C   s-   t  i |  | d t i |  i | |  d  S(   NRc  (   R  RM   R   R  R  (   R   Rv   R  R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRM     s    (   R`   Ra   RM   (    (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR5    s   R  c        
   B   sA   e  Z e i d  e i e i e i d d d d d 	 Z d   Z	 RS(   R$   c         C   s`   t  i i |  | | | | | |  |	 |  _ | |  _ | |  _ |
 |  _ |  i t  i |  i	  d  S(   N(
   R   R  RM   t   _infosR   t   _panelt
   _oldparentR   t	   EVT_CLOSEt   OnClose(   R   Rv   RP   t   titleRZ   R   R   R  R  R  R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRM   !  s    "				c      	   C   s  y|  i  } |  i i |  i  |  i i |  i | d t | d  |  i i   d } |  i i | | d  |  i i	 | | d  |  i i
 | | d  |  i i | | d  |  i i | | d  |  i i | | d	 | d
 | d  |  i i | | d  |  i i | | d  |  i i | | d  | d |  i i | _ | d oI t | d  d j o2 |  i i | | d  |  i i | | d  n Wn |  i   | i   d  Sn X|  i   | i   d  S(   NR   R   i   R  R  R  R  R  R  R  R  R   R  R  R  R  R  R  (   R  R  R  R  R   R  R   R   R  R  R  R  R  R  R  R  R  R   R   R/   R  R  R  R   (   R   R   R  RP   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR  /  s0    	$%"


N(
   R`   Ra   R   R   R   R   t   DEFAULT_FRAME_STYLER)   RM   R  (    (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s   t   NotebookCtrlWindowHandlerc           B   sh   e  Z d  Z d   Z d   Z e i d  Z d   Z d d  Z	 d   Z
 d   Z d	   Z d
   Z RS(   s{  
    Create L{NotebookCtrl} windows defined in Xrc resources.
    
    Below is an example of a resource definition::
      <?xml version="1.0" encoding="ISO-8859-1"?>
      <resource>
        <object class="wxPanel" name="appPanel">
          <object class="wxBoxSizer">
            <orient>wxVERTICAL</orient>
            <object class="sizeritem">
              <option>1</option>
              <flag>wxEXPAND</flag>
              <object class="NotebookCtrl" name="notebook">
                <style>wxNO_BORDER | NC_RIGHT | NC_ROTATE | NC_EXPANDABLE </style>
                <focus>0</focus>
                <highlight>1</highlight>
                <tabstyle>NC_GRADIENT_HORIZONTAL | NC_GRADIENT_SELECTION</tabstyle>
                <color1>#DCDCDC</color1>
                <color2>#F5F5F5</color2>
                <selectedcolor1>#C4DADB</selectedcolor1>
                <selectedcolor2>#FFFFFF</selectedcolor2>
                <custompagecolor>#C0C0C0</custompagecolor>
              </object>
            </object>
          </object>
        </object>
      </resource>
    
    @undocumented: CanHandle, DoCreateResource, SetupWindow
    c         C   sD  t  i i |   |  i d t i  |  i d t i  |  i d t  |  i d t  |  i d t	  |  i d t
  |  i d t  |  i d t  |  i d	 t  |  i d
 t  |  i d t  |  i d t  |  i d t  |  i d t  |  i d t  |  i d t  |  i d t  |  i d t  |  i   d S(   s>   
        Create a NotebookCtrlWindowHandler instance.
        t   wxNO_BORDERt   wxTAB_TRAVERSALRL  RM  RD  RE  R)  R  RF  t   NC_AQUA_LIGHTt   NC_AQUA_DARKt   NC_AQUAt   NC_METALt	   NC_SILVERt   NC_KDEt   NC_GRADIENT_VERTICALt   NC_GRADIENT_HORIZONTALt   NC_GRADIENT_SELECTIONN(   t   xrct   XmlResourceHandlerRM   t   AddStyleR   R  t   TAB_TRAVERSALRL  RM  RD  RE  R)  R  RF  R  R  R  R  R  R  R  R  R  t   AddWindowStyles(   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyRM   o  s(    c      
   C   s(   t  | | | d | d | d | } | S(   NR   R   R   (   Ro   (   R   Rv   RP   t   positionR   R   R   t   window(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   _CreateResourceInstance  s    $c         C   s/   |  i  |  } | o |  i |  Sn | Sd  S(   N(   t   GetParamValuet	   GetColour(   R   t	   paramNamet   defaultValuet
   paramValue(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   _GetColorParamValue  s    c         C   s5   t  i | d d t  i } | i |  i d   | S(   NiR   t   custompagecolor(   R   t   WindowRv  R   R  (   R   R  t
   customPage(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   _GetCustomPage  s    i    c         C   s,   |  i  |  } | o t |  Sn | Sd  S(   N(   R  R<   (   R   R  R  R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   _GetIntParamValue  s    c         C   sB  |  i  d  } | ot   } | t @p | t @ol | i t |  | i |  i d   | i |  i d   | i	 |  i d   | i
 |  i d   q>| t @p | t @o& | i t | t @o d p d  q>| t @o | i t  q>| t @o | i t  q>| t @o | i t  q>n
 t   } | S(   NRI   t   color1t   color2t   selectedcolor1t   selectedcolor2i   i   (   t   GetStyleRC   R  R  R   RF   R   R  R   R   R   R  R  RE   R  R   R  RH   R  RG   RJ   (   R   RI   R   (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   _GetTabTheme  s&    	&	c         C   s   |  i  | d  S(   NRo   (   t	   IsOfClass(   R   t   node(    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt	   CanHandle  s    c         C   s   |  i    d  j p t  |  i |  i   |  i   |  i   |  i   |  i d t	  |  i
    } |  i |  |  i |  | S(   NR   (   t   GetInstanceR)   t   AssertionErrorR  t   GetParentAsWindowt   GetIDR   R  R  Rq  t   GetNamet   SetupWindowt   CreateChildren(   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyt   DoCreateResource  s    			c         C   s   t  t |   i |  | i |  i    | i |  i d d  d j  | i |  i d d  d j  | i |  i	 |   d  S(   NR-  i    R0  i   (
   R   R  R  R  R  R.  R  R   R  R  (   R   R  (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR    s
    (   R`   Ra   Rb   RM   R  R   R   R  R  R  R  R  R  R  (    (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pyR  P  s   						$(f   Rb   t   __docformat__R   t   wx.lib.buttonsR   R   t   wx.xrcR  R    R   Rx   Rl   t   NC_HITTEST_NOWHERER_  Rb  RY  R[  RL  RM  R)  RD  RE  R  RF  R  Rq  R  R  R  R  R  R  R  R  R  RD   R^  Rp  R   R  R  R   R  R  R  R  R  R  R  R  R  t   NewEventTypeR  R  R  R  R  R  R  t   PyEventBindert   EVT_NOTEBOOKCTRL_PAGE_CHANGEDt   EVT_NOTEBOOKCTRL_PAGE_CHANGINGt   EVT_NOTEBOOKCTRL_PAGE_CLOSINGt   EVT_NOTEBOOKCTRL_PAGE_DNDt   EVT_NOTEBOOKCTRL_PAGE_DCLICKt   EVT_NOTEBOOKCTRL_PAGE_RIGHTt   EVT_NOTEBOOKCTRL_PAGE_MIDDLER  t   VERSION_STRINGR   RX  R   R   R   R;   R0   RJ   RL   RK   Rc   Rp   Rn   RC   R   R   R   R   t   objectR  R  R  Rs  Ro   R  R2  R3  R  R  R5  R  R  R  (    (    (    s!   C:\py\_spe\sm\wxp\NotebookCtrl.pys   <module>   s   	******$$$$$$*$*						B ;n                  ^(1