
0Gc        	   @   s   d  d k  Z  d  d k Z d  d k Z d  d k l Z d  d k Td  d k l Z l Z d e	 f d     YZ
 d e
 e f d     YZ d	 e
 e f d
     YZ d g d  Z d d  Z d d  Z d   Z d S(   iN(   t   Tree(   t   *(   t   ManagedBaset   TopLevelBaset	   PanelBasec           B   s   e  Z e Z e i 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(   c         C   s  t  t |   i   d |  _ t |  _ |  i |  i f |  i	 d <t
 |  d d t d  |  i d <| |  _ |  i |  i f |  i	 d <t i t i t i t i t i t i t i t i t i t i t i t i g |  _ d t d  d d d	 d
 d d d d d d d d f } t |  d d |  |  i d <|  i |  i  f |  i	 d <t |  _! t
 |  d d d t d  |  i d <d |  _" |  i# |  i$ f |  i	 d <t% |  d d d t& d t d  |  i d <d S(   s0           Class to handle wxPanel objects
        t   no_custom_classt   labels)   Don't generate code for this custom classt   styles	   #section#t   Stylet   wxSIMPLE_BORDERt   wxDOUBLE_BORDERt   wxSUNKEN_BORDERt   wxRAISED_BORDERt   wxSTATIC_BORDERt   wxNO_BORDERt   wxNO_3Dt   wxTAB_TRAVERSALt   wxWANTS_CHARSt   wxNO_FULL_REPAINT_ON_RESIZEt   wxFULL_REPAINT_ON_RESIZEt   wxCLIP_CHILDRENt
   scrollablei
   t   scroll_ratet   can_disableN(   i
   i
   ('   t   superR   t   __init__t   Nonet	   top_sizert   FalseR   t   get_no_custom_classt   set_no_custom_classt   access_functionst   CheckBoxPropertyt   _t
   propertiesR   t	   get_stylet	   set_stylet   wxt   SIMPLE_BORDERt   DOUBLE_BORDERt   SUNKEN_BORDERt   RAISED_BORDERt   STATIC_BORDERt	   NO_BORDERt   NO_3Dt   TAB_TRAVERSALt   WANTS_CHARSt   NO_FULL_REPAINT_ON_RESIZEt   FULL_REPAINT_ON_RESIZEt   CLIP_CHILDRENt	   style_post   CheckListPropertyt   get_scrollablet   set_scrollableR   R   t   get_scroll_ratet   set_scroll_ratet   TextPropertyt   True(   t   selfR   t   style_labels(    (    sI   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\widgets\panel\panel.pyR      sH    							"		c         C   s   t  t |   i d |  i  |  i p |  i i d d  n |  i i |  i   |  i i d d t i	  p t
 d  GHn t i |  i |  i  d  S(   Nt   sel_marker_parenti    is1   EditPanel: Unable to disconnect the event hanlder(   R   R   t   finish_widget_creationt   widgetR   t   SetScrollRateR   t
   DisconnectR%   t   wxEVT_LEFT_DOWNR!   t   EVT_LEFT_DOWNt
   drop_sizer(   R:   (    (    sI   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\widgets\panel\panel.pyR=   >   s    

c            sN     f d   }   i  i } |   i  _   i i   |   i  _ | i   d  S(   Nc             s<     i  i   \ }  }   i  i   \ } } |  | | | f S(   N(   R>   t   GetPositiont   GetViewStart(   t   xt   yt   xxt   yy(   R:   (    sI   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\widgets\panel\panel.pyt   get_posM   s    (   R>   RD   t
   sel_markert   updatet   Skip(   R:   t   eventRJ   t   old(    (   R:   sI   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\widgets\panel\panel.pyt   _update_markersL   s    c         C   s  t  t |   i   t i |  i d d t i } | i d d  t i t i	  } |  i
 d i |  | i |  i
 d i d t i  |  i
 d i } | i t i t d    |  i
 d i |  | i |  i
 d i d t i  |  i
 d i |  | i |  i
 d i d t i  |  i
 d i |  | i |  i
 d i d t i  | i t  | i |  | i |  |  i i | d	  d  S(
   NiR   i   R   i    sk   If this is a custom class, setting this property prevents wxGlade
from generating the class definition codeR   R   t   Widget(   R   R   t   create_propertiesR%   t   ScrolledWindowt   notebookR-   R?   t   BoxSizert   VERTICALR"   t   displayt   Addt   panelt   EXPANDt   cbt
   SetToolTipt   ToolTipR!   t   SetAutoLayoutR9   t   SetSizert   Fitt   AddPage(   R:   RY   t   szrR   (    (    sI   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\widgets\panel\panel.pyRR   X   s&        c         C   sC   |  i  o! t i o |  i i t i  n |  i i t i  d  S(   N(   R   t   commont   adding_sizerR>   t	   SetCursorR%   t   CROSS_CURSORt   STANDARD_CURSOR(   R:   RN   (    (    sI   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\widgets\panel\panel.pyt   on_entero   s    c         C   s   | |  _  |  i  oN |  i  i oA |  i o7 |  i i t  |  i i |  i  i  |  i i   n/ |  i  d  j o |  i o |  i i d   n d  S(   N(   R   R>   R^   R9   R_   t   LayoutR   (   R:   t   sizer(    (    sI   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\widgets\panel\panel.pyt	   set_sizeru   s    	!c         C   s   |  i  p t i o |  i |  d  Sn |  i i t i  t i t i	 |  d  d   t t _ t _ d  t _	 t t i i _ d  S(   N(   R   Rc   Rd   t   on_set_focusR>   Re   R%   t
   NullCursort   widgetst   widget_to_addR   R   t   adding_widgett   app_treet   appt   saved(   R:   RN   (    (    sI   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\widgets\panel\panel.pyRC   ~   s    	c         C   sK   |  i  o. |  i i   o |  i  i   |  i i   Sn t i i |  i  S(   N(   R   R>   t   GetSizert
   fit_parentt   GetSizeR%   RS   t   GetBestSize(   R:   (    (    sI   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\widgets\panel\panel.pyt   get_widget_best_size   s    c         C   sw   d g t  |  i  } yG x@ t t  |  i   D]) } |  i |  i | @o d | | <q/ q/ WWn t j
 o n X| S(   Ni    i   (   t   lenR2   t   rangeR   t   AttributeError(   R:   t   retvalt   i(    (    sI   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\widgets\panel\panel.pyR#      s     c         C   se   |  i  d i |  } d |  _ x? t t |   D]+ } | | o |  i |  i | O_ q2 q2 Wd  S(   NR   i    (   R"   t   prepare_valueR   Rz   Ry   R2   (   R:   t   valuet   v(    (    sI   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\widgets\panel\panel.pyR$      s    	 c         C   s   |  i  S(   N(   R   (   R:   (    (    sI   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\widgets\panel\panel.pyR4      s    c         C   s   t  t |   |  _ |  i o4 |  i d j o  d |  _ |  i i |  i  q n1 |  i d j o  d |  _ |  i i |  i  n |  i p d  Sn |  i o+ |  i d i t	  |  i i
 |  i   n( |  i d i t  |  i i
 d d  d  S(   Nt   wxPanelt   wxScrolledWindowR   i    (   t   boolt   intR   t   klasst
   klass_propt	   set_valueR>   R"   t   toggle_activeR9   R?   R   R   (   R:   R   (    (    sI   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\widgets\panel\panel.pyR5      s    
		
c         C   s   d |  i  S(   Ns   %d, %d(   R   (   R:   (    (    sI   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\widgets\panel\panel.pyR6      s    c         C   s   t  } ya g  } | i d d  D] } | t |  q  ~ \ } } | d j  p | d j  o
 t } n Wn t } n X| o" |  i d i |  i    d  Sn | | f |  _ |  i o |  i i	 | |  n d  S(   Nt   ,i   i    R   (
   R   t   splitR   R9   R"   R   R6   R   R>   R?   (   R:   R   t   invalidt   _[1]t   tt   srxt   sry(    (    sI   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\widgets\panel\panel.pyR7      s    9

c         C   s   |  i  S(   N(   R   (   R:   (    (    sI   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\widgets\panel\panel.pyR      s    c         C   s   t  t |   |  _ d  S(   N(   R   R   R   (   R:   R   (    (    sI   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\widgets\panel\panel.pyR      s    (   t   __name__t
   __module__R9   t   _custom_base_classesR%   R-   R   R=   RP   RR   Rh   Rk   RC   Rx   R#   R$   R4   R5   R6   R7   R   R   (    (    (    sI   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\widgets\panel\panel.pyR      s"   +							
		
						t	   EditPanelc           B   sG   e  Z e e i d   Z d   Z d   Z d   Z d   Z	 d   Z
 RS(   c	   	      C   s<   t  i |  | d | | | | | d | t i |  |  d S(   s0           Class to handle wxPanel objects
        R   t   showN(   R   R   R   (	   R:   t   namet   parentt   idRj   t   post   property_windowR   R   (    (    sI   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\widgets\panel\panel.pyR      s    c            s|   t  i   i i   i d d   _ t  i   i   i    i   i _   i	 i
   o   f d   } |   i _ n d  S(   NR   i    c              sD     i  o'   i  i   o   i  i   i   Sn t i i   i   S(   N(   R>   Rt   t
   GetMinSizeR%   RS   Rw   (    (   R:   (    sI   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\widgets\panel\panel.pyRw      s    (   R%   RS   R   R>   R   t   EVT_ENTER_WINDOWRh   Rx   Rw   Rj   t
   is_virtual(   R:   Rw   (    (   R:   sI   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\widgets\panel\panel.pyt   create_widget   s    $c         C   sa   t  t |   i |  |  i o= |  i i o0 |  i o& |  i i |  i d |  i i   n d  S(   Nt   size(	   R   R   Rk   R   R>   Rj   t   set_itemR   Rw   (   R:   Rj   (    (    sI   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\widgets\panel\panel.pyRk      s    !c         C   s@   t  t |   i |  |  i o d |  _ n |  i i |  _ d  S(   Nt   EditScrolledWindow(   R   R   R5   R   t
   _classnamet	   __class__R   (   R:   R   (    (    sI   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\widgets\panel\panel.pyR5      s    
c   
      C   s  |  i  o|  i pg  } t d  D] } | t i   q% ~ \ } } } t i |  i  |  _ t i |  i | t	 d  t i
  t i |  i | t	 d  t i  t i |  i | t	 d  t i  d   } t i |  i  | | |  i   t i |  i  | | |  i   t i |  i  | | |  i   t i   } t i |  i | t	 d  t i  t i |  i  | | |  i   t i   }	 |  i i   t i |  i |	 t	 d   t i |  i  |	 | |  i   n |  i   |  i  i |  i | i    n d  S(   Ni   s
   Remove	Dels   Copy	Ctrl+Cs
   Cut	Ctrl+Xc            s     f d   S(   Nc            s   t  i    S(    (   t   misct   wxCallAfter(   t   e(   t   method(    sI   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\widgets\panel\panel.pyt   <lambda>  s    (    (   R   (    (   R   sI   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\widgets\panel\panel.pyt   bind   s    s   Paste	Ctrl+Vt   Preview(   R>   t   _rmenuRz   R%   t   NewIdR   t   wxGladePopupMenuR   t   append_itemR!   t
   ART_DELETEt   ART_COPYt   ART_CUTt   EVT_MENUt   removet   clipboard_copyt   clipboard_cutt	   ART_PASTEt   clipboard_pastet   AppendSeparatort   preview_parentt   setup_preview_menut	   PopupMenuRD   (
   R:   RN   R   R}   t   COPY_IDt	   REMOVE_IDt   CUT_IDR   t   PASTE_IDt
   PREVIEW_ID(    (    sI   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\widgets\panel\panel.pyt
   popup_menu   s0    

6


	
#
c      	   G   s   d d  k  } d d  k } |  i i   } y= | i |  d  d  o# t t i i	 _
 |  i i |  n Wn# | i j
 o } t d  GHn Xd  S(   Nii    s0   
wxGlade-WARNING: only sizers can be pasted here(   t	   clipboardt	   xml_parseR>   Rv   t   pasteR   R   Rc   Rq   Rr   Rs   t   SetSizet   XmlParsingErrorR!   (   R:   t   argsR   R   R   R   (    (    sI   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\widgets\panel\panel.pyR     s    (   R   R   R9   R%   R-   R   R   Rk   R5   R   R   (    (    (    sI   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\widgets\panel\panel.pyR      s   			
	t   EditTopLevelPanelc           B   sb   e  Z e Z d  e e i d  Z d   Z d   Z	 d   Z
 d   Z d   Z d   Z d   Z RS(	   R   c         C   sN   t  i |  | | | | | d | d t t i |  |  d |  _ t |  _ d  S(   NR   t	   has_titleR   (   R   R   R   R   t   baset   skip_on_size(   R:   R   R   R   R   R   R   R   (    (    sI   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\widgets\panel\panel.pyR   #  s
    	c         C   s   t  i t i d t i |  i  d d
 } d d  k } t  i   } | i	 i
 t i d d  } | i t i |   | i |  t  i | |  i d d |  _ t  i |  i |  i  |  i |  i _ t  i | |  i  t  i d	 j o | i   n d  S(   NiR   i  i,  t   iconss	   panel.xpmR   i    t	   __WXMSW__(   i  i,  (   R%   t   FrameRc   t   paletteR   t   design_titleR   t   ost	   EmptyIcont   patht   joint   wxglade_patht   CopyFromBitmapt   get_xpm_bitmapt   SetIconRS   R   R>   R   Rh   Rx   Rw   t	   EVT_CLOSEt   hide_widgett   Platformt   CentreOnScreen(   R:   t   winR   t   icont   xpm(    (    sI   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\widgets\panel\panel.pyR   +  s    !	c         C   s   |  i    } t t |   i |  |  i oQ | o0 |  i d i   o |  i o |  i i   n |  i i	   i
 |  n |  i |  d  S(   NR   (   t   get_sizeR   R   t   show_widgetR>   R"   t	   is_activeR   Ru   t	   GetParentt   Showt   set_size(   R:   t   yest   oldval(    (    sI   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\widgets\panel\panel.pyR   ;  s    

c         G   s-   t  t |   i |   |  i i   i   d  S(   N(   R   R   R   R>   R   t   Hide(   R:   R   (    (    sI   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\widgets\panel\panel.pyR   E  s    c         C   sJ   t  t |   i |  |  i o& |  i i   i t i |  i   n d  S(   N(	   R   R   t   set_nameR>   R   t   SetTitleR   R   R   (   R:   R   (    (    sI   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\widgets\panel\panel.pyR   I  s    
c         C   sU   d  } |  i o |  i i   } n t t |   i   | d  j	 o | i   n d  S(   N(   R   R>   R   R   R   t   deletet   Destroy(   R:   R   (    (    sI   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\widgets\panel\panel.pyR   N  s    c         C   s   | i    \ } } |  i o t |  _ d  Sn t t |   i |  t |  _ |  i i   i	   | | f j o( |  i i   i
 | d | d f  n d  S(   Ni   (   Rv   R   R   R   R   t   on_sizeR9   R>   R   t   GetClientSizet   SetClientSize(   R:   RN   t   wt   h(    (    sI   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\widgets\panel\panel.pyR   T  s    
		"c         C   s@   t  t |   i |  |  i o d |  _ n |  i i |  _ d  S(   Nt   EditTopLevelScrolledWindow(   R   R   R5   R   R   R   R   (   R:   R   (    (    sI   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\widgets\panel\panel.pyR5   ^  s    
(   R   R   R   t   _is_toplevelR9   R%   R-   R   R   R   R   R   R   R   R5   (    (    (    sI   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\widgets\panel\panel.pyR     s   		
				
i   c         C   s   d | d } x6 t  i i |  o" | d c d 7<d | d } q Wt | |  t i   | | t  i  } t i |  } | | _	 | i
 d  | i d  | i t  t  i i | | i	 | d  | i | i d t i  d S(   s0       factory function for EditPanel objects.
    s   panel_%di    i   t   wxEXPANDN(   Rc   Rq   t   has_nameR   R%   R   t   property_panelR    t   Nodet   nodet
   set_optiont   set_flagR   R9   t   insertR   R   RZ   (   R   Rj   R   t   numberR   RY   R   (    (    sI   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\widgets\panel\panel.pyt   builderk  s    	c   	      C   s  d d k  l } y |  d } Wn" t j
 o | t d   n X| p | o | t d   n t | | t i   | | t i t	 d d } | i
 | i d | i d	 | i d
 | i t i |  } | | _ | d j o t i i | | i  n t i i | | i | d  | S(   s<       factory to build EditPanel objects from an xml file
    i(   R   R   s   'name' attribute missings(   sizer or sizeritem object cannot be NoneR   i    t   optiont   flagt   borderi   N(   R   R   t   KeyErrorR!   R   R%   R   Rc   R   R9   R   R   R   R   R   R    R   R   R   Rq   t   addR   (	   t   attrsR   Rj   t	   sizeritemR   R   R   RY   R   (    (    sI   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\widgets\panel\panel.pyt   xml_builder  s    "!
	'c   	      C   s   d d k  l } y |  d } Wn" t j
 o | t d   n Xt | | t i   t i d t	 d d } t
 i |  } | | _ t i i |  | S(   Ni(   R   R   s   'name' attribute missingR   R   i    (   R   R   R   R!   R   R%   R   Rc   R   R   R    R   R   Rq   R  (	   R  R   Rj   R  R   R   R   RY   R   (    (    sI   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\widgets\panel\panel.pyt   xml_toplevel_builder  s    "	c          C   s
  t  t i d <t t i d <t t i d <t t i d <t t i d <d d k l }  d d k } | i	 i
 t i d  } | |  i d <| |  i d <| |  i d <t t i d	 <| i	 i
 t i d  |  i d	 <t t i d
 <| i	 i
 t i d  |  i d
 <t i d d d d S(   sn       initialization function for the module: returns a wxBitmapButton to be
    added to the main palette.
    R   R   R   R   i(   t
   WidgetTreeNs   icons/panel.xpmt   SplitterPanet   NotebookPanet   tips   Add a Panel/ScrolledWindow(   R   Rc   Rn   R  t   widgets_from_xmlR  t   treeR  t   os.pathR   R   R   t   imagest   make_object_button(   R  R   R   (    (    sI   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\widgets\panel\panel.pyt
   initialize  s&    (   R%   Rc   R   R  R    t   widget_propertiest   edit_windowsR   R   t   objectR   R   R   R   R   R  R  R  (    (    (    sI   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\widgets\panel\panel.pys   <module>   s   
PL