
    kf                        d Z ddlmZ ddlmZ ddlmZ ddlT ddlT ddl	m
Z
  G d de          Zed	k    rH e                                            Zdd
lZe                    dg ej                    d
           d
S d
S )z3.3.0    )Widget)shapes)colors)*)Drawingc                   x   e Zd ZdZ ed4i d eed          d eed          d eed          d	 eed
          d eed          d eed          d eed          d eed          d eed          d eed          d eed          d eed          d edd          d ee	d          d  ee
d!          d" eed#          d$ eed%          d& e ed'd(          d)          d* e ed+d,d-d.          d)          Zd5d0Zd1 Zd2 Zd3 ZdS )6TableWidgetz%A two dimensions table of labels
    xz x position of left edge of table)descyz"y position of bottom edge of tablewidthztable widthheightztable heightborderStrokeColorztable border color	fillColorztable fill colorborderStrokeWidthzborder line widthhorizontalDividerStrokeColorz"table inner horizontal lines colorverticalDividerStrokeColorz table inner vertical lines colorhorizontalDividerStrokeWidthz"table inner horizontal lines widthverticalDividerStrokeWidthz table inner vertical lines widthdividerDashArrayzDash array for dividerLines.dataNz6a list of list of strings to be displayed in the cells	boxAnchorz%location of the table anchoring pointfontNameztext font in the tablefontSizezfont size of the table	fontColorz
font color	alignmentleftrightzAlignment of text within cells
textAnchorstartmiddleendnumeric
   c                 B   || _         || _        d| _        d| _        t          j        | _        d | _        d| _        t          j        | _	        t          j        | _
        d| _        d| _        d | _        g dg dg dg| _        d| _        d	| _        t          j        | _        d
| _        d| _        |                                D ]Z\  }}|t+          | j        j                                                  v rt3          | ||           Dt5          d| j        z            d S )N   d         ?g      ?)NorthSouthEastWest)r'   n   x      )ABCDnw   r   r    z&invalid argument supplied for class %s)r
   r   r   r   r   blackr   r   r   r   r   r   r   r   r   r   r   r   r   r   itemslist	__class___attrMapkeyssetattr
ValueError)selfr
   r   kwkvs         `/var/www/html/nettyfy-visnx/env/lib/python3.11/site-packages/reportlab/graphics/widgets/table.py__init__zTableWidget.__init__)   s$   
!'!$,2L)*0,',/)*.' $4445F5F5FGXGXGXY	 ! HHJJ 	Z 	ZDAqD055778888a#### !I$.!XYYY		Z 	Z    c                     t          dd          }t                      }|                    |d           d|j        _        d|j        _        d|j        _        t          j        |j        _	        |S )z3 returns a sample of this widget with data
        i  r&   table)name)         Nr   )
r   r	   addrF   r   r   r   r   redr   )r>   dts      rB   demozTableWidget.demoF   sa     CMM	ag#, -1*$%!$*J!rD   c           	         t          j                    }| j        s| j        rdt          j        | j        | j        | j        | j                  }| j        |_        | j        |_	        | j
        |_        |                    |           |                     | j                  }t          | j                  }t          | j        d                   }| j        t!          |          z  }| j        t!          |          z  }| j        rt%          |          D ]u}| j        }	| j        | j        z   }
| j        ||z  z   }t          j        |	||
|          }| j        |_        | j        |_        | j        |_	        |                    |           v| j        rt%          |          D ]u}| j        ||z  z   }| j        }| j        | j        z   }t          j        ||||          }| j        |_        | j        |_        | j        |_	        |                    |           v| j                                         t5          | j                  D ]\  }}| j        ||z  z   d|z  z   d| j        z  z
  }t5          |          D ]}\  }}|rv| j        ||z  z   d|z  z   }t          j        ||t;          |          | j                  }| j        |_        | j        |_        | j         |_        |                    |           ~|S )z# returns a group of shapes
        r   r(   )r   )!r   Groupr   r   Rectr
   r   r   r   strokeColorr   strokeWidthrK   preProcessDatar   lenfloatr   rangeLiner   strokeDashArrayr   r   r   reverse	enumerater   Stringstrr   r   r   )r>   grectr   rowscolsrow_stepcol_stepix1x2r   liner
   y1y2jrowdatumss                       rB   drawzTableWidget.drawR   s    LNN ! 	T^ 	;tvtvtz4;GGD!^DN#5D#5DEE$KKK ""49--49~~49Q<  ;t,:d+ , 
	4[[ 	 	VVdj(FXaZ'{2q"a00'+'<$#'#D #'#D d* 
	4[[ 	 	F8A:%VVdk){1b!R00'+'<$#'#B #'#B d 		!$),, 		 		HQ8#c(l2S4=5HHA'nn  
E 8+c(l:AaCJJ4?SSSA!%AJ!%AJ"&.AKEE!HHH rD   c                     |sdggS t          d |D                       }t          |          D ]A\  }}t          |          |k     r)|                    dg|t          |          z
  z             B|S )zpreprocess and return a new array with at least one row
        and column (use a None) if needed, and all rows the same
        length (adding Nones if needed)

        Nc                 ,    g | ]}t          |          S  )rV   ).0r
   s     rB   
<listcomp>z.TableWidget.preProcessData.<locals>.<listcomp>   s    ---1A---rD   )maxr\   rV   extend)r>   r   max_rowrowNorl   s        rB   rU   zTableWidget.preProcessData   s      	F8O-----//#D// 	6 	6JE33xx'!!

D673s88#34555rD   rr   )r$   r$   )__name__
__module____qualname____doc__AttrMapAttrMapValueisNumberisColorOrNoneisListOfNumbersOrNoneisBoxAnchorisStringOneOfr:   rC   rO   ro   rU   rr   rD   rB   r	   r	      s         w   L(JKKKKL(LMMMM XM:::: h^<<<<	
 )L=QRRRR !L5GHHHH )L8KLLLL (4|MHl'm'm'm'm &2\-Fh%i%i%i%i (4|HCg'h'h'h'h &2\(Ac%d%d%d%d (<(=Dbcccc |D'_```` !L3Z[[[[  </GHHHH   </GHHHH!" !L\BBBB#$ !Lvw!7!7>^____%& "\%%y"I"IPpqqqq'H,Z Z Z Z:
 
 
9 9 9v    rD   r	   __main__Npdf)formatsoutDirfnRoot)__version__reportlab.graphics.widgetbaser   reportlab.graphicsr   reportlab.libr   reportlab.lib.validatorsreportlab.lib.attrmapreportlab.graphics.shapesr   r	   ry   rO   rM   ossavegetcwdrr   rD   rB   <module>r      s   
  0 0 0 0 0 0 % % % % % %             & & & & # # # # - - - - - -K K K K K& K K K\ zAIIIFFE7)")++TF::::: rD   