
    e7                        d Z ddlZddlZddlmZ ddlmZ ddl	m
Z
 ddlmZ  ej                  d      Z ej                         Z e
       Zej%                  e       ej'                  dd	       ej)                  d
        edd      Z eddd      Z edd      Z edd      Z edd      Z edd      Zej7                  ed       ej7                  ed       ej7                  ede       ej7                  ed       ej7                  ede       ej7                  ede       ej9                  ede       ej9                  ede       ej9                  ede        ej:                         Z ej>                  d      Z  ejB                  d      Z" ejB                  d      Z#e#jI                  d        ejK                  e dd!       ejK                  e"d"d!       ejK                  e#d#d!       ejK                  e       da&d$ Z'd% Z(e"jR                  jU                  e'       e#jR                  jU                  e(        e       Z+ejK                  e+       ejY                           ejZ                  d&'      Z.e.j_                  ej`                  jc                  d(             ejK                  e.        ejZ                  d)'      Z2e2j_                  ej`                  jc                  d(             ejK                  e2        ejf                         Z4e4jk                  ej`                  jc                  d*             ejK                  e4        ejZ                  d+'      Z6e6j_                  ej`                  jc                  d(             ejK                  e6       ejo                          e8d,k(  r ejr                          yy)-a  
This example demonstrates the use of pyqtgraph's dock widget system.

The dockarea system allows the design of user interfaces which can be rearranged by
the user at runtime. Docks can be moved, resized, stacked, and torn out of the main
window. This is similar in principle to the docking system built into Qt, but 
offers a more deterministic dock placement API (in Qt it is very difficult to 
programatically generate complex dock arrangements). Additionally, Qt's docks are 
designed to be used as small panels around the outer edge of a window. Pyqtgraph's 
docks were created with the notion that the entire window (or any portion of it) 
would consist of dockable components.
    N)ConsoleWidget)Dock)DockArea)	QtWidgetszDockArea Examplei    zpyqtgraph example: dockareaDock1)   r	   )sizezDock2 - Console)r   i,  T)r
   closableDock3)r   i  zDock4 (tabbed) - Plot)r      zDock5 - ImagezDock6 (tabbed) - Plotleftrightbottomtopabovea   -- DockArea Example -- 
This window has 6 Dock widgets in it. Each dock can be dragged
by its title bar to occupy a different space within the window 
but note that one dock has its title bar hidden). Additionally,
the borders between docks may be dragged to resize. Docks that are dragged on top
of one another are stacked in a tabbed layout. Double-click a dock title
bar to place it in its own window.
zSave dock statezRestore dock stateF)rowcolr	      c                  V    t         j                         at        j	                  d       y )NT)area	saveStatestate
restoreBtn
setEnabled     =/usr/lib/python3/dist-packages/pyqtgraph/examples/dockarea.pysaver   G   s    NNE$r   c                  6    t         j                  t               y )N)r   restoreStater   r   r   r   loadr"   K   s    er   z"Plot inside dock with no title bar)titled   zDock 4 plot)r$   r$   zDock 6 plot__main__):__doc__numpynp	pyqtgraphpgpyqtgraph.consoler   pyqtgraph.dockarea.Dockr   pyqtgraph.dockarea.DockArear   pyqtgraph.Qtr   mkQAppappQMainWindowwinr   setCentralWidgetresizesetWindowTitled1d2d3d4d5d6addDockmoveDockLayoutWidgetw1QLabellabelQPushButtonsaveBtnr   r   	addWidgetr   r   r"   clickedconnectw2hideTitleBar
PlotWidgetw3plotrandomnormalw4	ImageVieww5setImagew6show__name__execr   r   r   <module>rV      sN     + ( 0 "bii"#iz   T  

4    0 1
 
'	
)d;	'	"	
!	2	/	*	
!	2 R  R  R2  R  R  R  b%  b'2  b%  R__	  	  )

 1
2"Y""#78
 
  e  Uq ! W! # ZQA & R       
    4   _ R   R]]=> 		c" # R R]]' 		c" # R R\\^ BII), - R R]]' 		c" # R  
 zBGGI r   