³ò
0ŽGc           @   sl   d  d k  Z  e  i d ƒ Z d e  i f d „  ƒ  YZ d „  Z d „  Z d „  Z d e  i f d	 „  ƒ  YZ d S(
   iÿÿÿÿNt   wxglade_widgett   _WidgetDataObjectc           B   s)   e  Z d  Z d „  Z d „  Z d „  Z RS(   s6       Object representig a widget in the clipboard.
    c         G   sA   t  i i |  t ƒ | o# t |  i | ƒ } |  i | ƒ n d  S(   N(   t   wxt   CustomDataObjectt   __init__t   _widget_data_formatt   applyt   _widget2reprt   SetData(   t   selft   argst   data(    (    s?   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\clipboard.pyR      s    c         G   sH   t  | ƒ d j p t ‚ d i g  } | D] } | t | ƒ q+ ~ ƒ S(   sr           Convert *args into a string and returns it.
        *args contains option, flag, border, xml_str.
        i   t   :(   t   lent   AssertionErrort   joint   str(   R	   R
   t   _[1]t   elem(    (    s?   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\clipboard.pyR      s    c         C   s“   |  i  ƒ  i d d ƒ } t | ƒ d j p t t d ƒ ‚ | d i d ƒ d } | d |  | d <x( t d ƒ D] } t | | ƒ | | <qq W| S(   sn           Convert a string into option, flag, border and xml_string
        and returns them in a list.
        R   i   i   s   Invalid data in the clipboardt   >i   (   t   GetDatat   splitR   R   t   _t   rfindt   ranget   int(   R	   t   rett   boundt   i(    (    s?   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\clipboard.pyt   GetWidgetData    s    # (   t   __name__t
   __module__t   __doc__R   R   R   (    (    (    s?   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\clipboard.pyR      s   		c      	   C   sÑ   d d k  l } | ƒ  } |  i i | d ƒ |  i ƒ  } |  i ƒ  } |  i ƒ  } t i i	 ƒ  o^ zI t
 | | | | i ƒ  ƒ } t i i | ƒ p t d ƒ GHt Sn t SWd t i i ƒ  Xn t d ƒ GHt Sd S(   s=       Copies widget and all its children to the clipboard.
    iÿÿÿÿ(   t   StringIOi    s"   Data can't be copied to clipboard.Ns   Clipboard can't be opened.(   t	   cStringIOR!   t   nodet   writet   get_int_flagt
   get_optiont
   get_borderR   t   TheClipboardt   OpenR   t   getvalueR   R   t   Falset   Truet   Close(   t   widgetR!   t   xml_strt   flagt   optiont   bordert   wdo(    (    s?   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\clipboard.pyt   copy0   s"    	c         C   s'   t  |  ƒ o |  i ƒ  t Sn t Sd S(   sW       Copies widget and all its children to the clipboard and then
    removes them.
    N(   R4   t   removeR,   R+   (   R.   (    (    s?   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\clipboard.pyt   cutI   s    
c   
      C   s   t  i i ƒ  oc zN t  i i t ƒ o3 t ƒ  } t  i i | ƒ p t d ƒ GHt Sq] n t SWd t  i i	 ƒ  Xn t d ƒ GHt S| i
 ƒ  \ } } } } | o[ d d k } z= t  i ƒ  | i |  | | | | | ƒ }	 |	 i | ƒ t SWd t  i ƒ  Xn t S(   sÐ       Copies a widget (and all its children) from the clipboard to the given
    destination (parent, sizer and position inside the sizer)
    returns True if there was something to paste, False otherwise.
    s$   Data can't be copied from clipboard.Ns   Clipboard can't be opened.iÿÿÿÿ(   R   R(   R)   t   IsSupportedR   R   R   R   R+   R-   R   t	   xml_parset   BeginBusyCursort   ClipboardXmlWidgetBuildert   parse_stringR,   t   EndBusyCursor(
   t   parentt   sizert   posR3   R1   R0   R2   R/   R8   t   parser(    (    s?   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\clipboard.pyt   pasteU   s,    	
t   FileDropTargetc           B   s   e  Z d  „  Z d „  Z RS(   c         C   s   t  i i |  ƒ | |  _ d  S(   N(   R   RB   R   R=   (   R	   R=   (    (    s?   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\clipboard.pyR   }   s    c         C   sp   t  | ƒ d j o  t i t d ƒ d t i ƒ n: | o2 | d } |  i i ƒ  o |  i i | ƒ ql n d  S(   Ni   s#   Please only drop one file at a timet   wxGladei    (   R   R   t
   MessageBoxR   t
   ICON_ERRORR=   t   ask_savet	   _open_app(   R	   t   xt   yt	   filenamest   path(    (    s?   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\clipboard.pyt   OnDropFiles   s    
(   R   R   R   RL   (    (    (    s?   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\clipboard.pyRB   |   s   	(	   R   t   CustomDataFormatR   R   R   R4   R6   RA   RB   (    (    (    s?   C:\Python25\Lib\site-packages\_spe\plugins\wxGlade\clipboard.pys   <module>	   s   "			'