
    %
i
                     \    d Z ddlZddlZddlmZ  G d dej                  Zd	dZd	dZdS )
z1Support for ActiveX control hosting in Pythonwin.    N   )windowc                   D    e Zd ZdZd Zd Zd Zd ZddZd Z	d	 Z
d
 ZdS )ControlzAn ActiveX control base class.  A new class must be derived from both
    this class and the Events class.  See the demos for more details.
    c                 X    d | j         d<   t          j                            |            d S )N	_dispobj_)__dict__r   Wnd__init__selfs    C:\Users\Dell Inspiron 16\Desktop\tws\AgrotaPowerBi\back-agrota-powerbi\mcp-client-agrota\venv\Lib\site-packages\pythonwin/pywin/mfc/activex.pyr   zControl.__init__   s*    %)k"
D!!!!!    c                     | j         S N)CLSIDr   s    r   _GetControlCLSIDzControl._GetControlCLSID   s
    zr   c                     | j         S r   )default_interfacer   s    r   _GetDispatchClasszControl._GetDispatchClass   s    %%r   c                     | j         j        S r   )default_source_dispid_to_func_r   s    r   _GetEventMapzControl._GetEventMap   s    "33r   Nc                 8   t          |                                           }t          j        ||||||d d|	  	        | j        d<   |                                 } |t          j        | j                            }	| 	                                 |	| j        d<   d S )NF_obj_r   )
strr   win32uiCreateControlr	   r   
win32uioleGetIDispatchForWindowr   HookOleEvents)
r   windowTitlestylerectparentid
lic_stringclsidklassdispobjs
             r   r   zControl.CreateControl   s    D))++,,!(!6;tVRuj"
 "
g &&((%
8DDEE%,k"""r   c                     |                                  }|                                D ]>\  }}t          | |          r)| j                            t          | |          |           ?d S r   )r   itemshasattrr   HookOleEventgetattr)r   dictdispid
methodNames       r   r"   zControl.HookOleEvents%   ss      """&**,, 	K 	KFJtZ(( K
''j(A(A6JJJ	K 	Kr   c                     	 t           j                            | |          S # t          $ r Y nw xY wt	          | j        |          S r   )r   r
   __getattr__AttributeErrorr0   r   )r   attrs     r   r5   zControl.__getattr__+   sQ    	:))$555 	 	 	D	t~t,,,s   " 
//c                     t          | j        |          r|| j        |<   d S 	 | j        r| j                            ||           d S n# t          $ r Y nw xY w|| j        |<   d S r   )r.   r	   r   __setattr__r6   )r   r7   values      r   r9   zControl.__setattr__3   s    4=$'' 	"'DM$F	~ **4777  	 	 	D	#ds   "A 
AAr   )__name__
__module____qualname____doc__r   r   r   r   r   r"   r5   r9    r   r   r   r   	   s         " " "  & & &4 4 4- - - -K K K- - -
$ 
$ 
$ 
$ 
$r   r   c                 J    || j         }t          d|z   t          | fi           S )aJ  Given a CoClass in a generated .py file, this function will return a Class
    object which can be used as an OCX control.

    This function is used when you do not want to handle any events from the OCX
    control.  If you need events, then you should derive a class from both the
    activex.Control class and the CoClass
    NOCX)r;   typer   controlClassnames     r   MakeControlClassrF   @   s,     |$w5r:::r   c                 2     t          | |                      S )z@As for MakeControlClass(), but returns an instance of the class.)rF   rC   s     r   MakeControlInstancerH   M   s    /L$//111r   r   )	r>   r   r     r   r
   r   rF   rH   r?   r   r   <module>rJ      s    7 7           4$ 4$ 4$ 4$ 4$fj 4$ 4$ 4$n
; 
; 
; 
;2 2 2 2 2 2r   