@@ -69,14 +69,14 @@ def xcol():
6969
7070 self .dicLiJG = {"A" : self .alm .lijg , "W" : self .alm .lijgW , "B" : self .alm .lijgB }
7171 grid_all = Grid .Grid (self , xcol (), siSelecFilas = True , xid = "A" , siCabeceraMovible = False )
72- ancho_grid = grid_all .fixMinWidth ()
72+ ancho_grid = grid_all .anchoColumnas ()
7373 self .register_grid (grid_all )
7474 grid_w = Grid .Grid (self , xcol (), siSelecFilas = True , xid = "W" , siCabeceraMovible = False )
75- ancho_grid = max (grid_w .fixMinWidth (), ancho_grid )
75+ ancho_grid = max (grid_w .anchoColumnas (), ancho_grid )
7676 self .register_grid (grid_w )
77- gridB = Grid .Grid (self , xcol (), siSelecFilas = True , xid = "B" , siCabeceraMovible = False )
78- ancho_grid = max (gridB . fixMinWidth (), ancho_grid )
79- self .register_grid (gridB )
77+ grid_b = Grid .Grid (self , xcol (), siSelecFilas = True , xid = "B" , siCabeceraMovible = False )
78+ ancho_grid = max (grid_b . anchoColumnas (), ancho_grid ) + 24
79+ self .register_grid (grid_b )
8080
8181 font = Controles .FontType (puntos = Code .configuration .x_sizefont_infolabels )
8282
@@ -98,25 +98,20 @@ def xcol():
9898 w_moves = QtWidgets .QWidget ()
9999 w_moves .setLayout (ly )
100100
101- self .tabGrid = tabGrid = Controles .Tab ()
102- tabGrid .new_tab (grid_all , _ ("All moves" ))
103- tabGrid .new_tab (grid_w , _ ("White" ))
104- tabGrid .new_tab (gridB , _ ("Black" ))
105- tabGrid .new_tab (w_idx , _ ("Indexes" ))
106- tabGrid .new_tab (w_elo , _ ("Elo" ))
107- tabGrid .new_tab (w_moves , _ ("Moves" ))
108- tabGrid .dispatchChange (self .tabChanged )
101+ self .tab_grid = tab_grid = Controles .Tab ()
102+ tab_grid .new_tab (grid_all , _ ("All moves" ))
103+ tab_grid .new_tab (grid_w , _ ("White" ))
104+ tab_grid .new_tab (grid_b , _ ("Black" ))
105+ tab_grid .new_tab (w_idx , _ ("Indexes" ))
106+ tab_grid .new_tab (w_elo , _ ("Elo" ))
107+ tab_grid .new_tab (w_moves , _ ("Moves" ))
108+ tab_grid .dispatchChange (self .tabChanged )
109109 self .tabActive = 0
110110
111- config_board = Code .configuration .config_board ("ANALISISGRAPH" , 48 )
111+ config_board = Code .configuration .config_board ("ANALISISGRAPH" , 60 )
112112 self .board = Board .Board (self , config_board )
113113 self .board .crea ()
114114 self .board .set_side_bottom (alm .is_white_bottom )
115- self .board .dispatchSize (self .boardSizeChanged )
116-
117- # self.capturas = WCapturas.CapturaLista(self, self.board)
118- ly_tc = Colocacion .H ().control (self .board )
119- # .control(self.capturas)
120115
121116 self .rbShowValues = Controles .RB (self , _ ("Values" ), rutina = self .cambiadoShow ).activa (True )
122117 self .rbShowElo = Controles .RB (self , _ ("Elo average" ), rutina = self .cambiadoShow )
@@ -133,41 +128,61 @@ def xcol():
133128 .control (self .chbShowLostPoints )
134129 .relleno (1 )
135130 )
136-
137- layout = Colocacion .G ()
138- layout .controlc (tabGrid , 0 , 0 )
139- layout .otroc (ly_rb , 1 , 0 )
140- layout .otroc (ly_tc , 0 , 1 , numFilas = 2 )
131+ ly_left = Colocacion .V ().control (tab_grid ).otro (ly_rb ).margen (0 )
132+ ly_up = Colocacion .H ().otro (ly_left ).control (self .board )
141133
142134 Controles .Tab ().set_position ("W" )
143135 ancho = self .board .width () + ancho_grid
144136 self .htotal = [
145137 Histogram .Histogram (self , alm .hgame , grid_all , ancho , True ),
146138 Histogram .Histogram (self , alm .hwhite , grid_w , ancho , True ),
147- Histogram .Histogram (self , alm .hblack , gridB , ancho , True ),
139+ Histogram .Histogram (self , alm .hblack , grid_b , ancho , True ),
148140 Histogram .Histogram (self , alm .hgame , grid_all , ancho , False , alm .eloT ),
149141 Histogram .Histogram (self , alm .hwhite , grid_w , ancho , False , alm .eloW ),
150- Histogram .Histogram (self , alm .hblack , gridB , ancho , False , alm .eloB ),
142+ Histogram .Histogram (self , alm .hblack , grid_b , ancho , False , alm .eloB ),
151143 ]
152144 lh = Colocacion .V ()
145+
146+ f = Controles .FontType (puntos = 8 )
147+ bt_left = Controles .PB (self , "←" , rutina = self .scale_left ).set_font (f )
148+ bt_down = Controles .PB (self , "↓" , rutina = self .scale_down ).set_font (f )
149+ bt_reset = Controles .PB (self , "=" , rutina = self .scale_reset ).set_font (f )
150+ bt_up = Controles .PB (self , "↑" , rutina = self .scale_up ).set_font (f )
151+ bt_right = Controles .PB (self , "→" , rutina = self .scale_right ).set_font (f )
152+ ly_bt = Colocacion .H ().relleno ().control (bt_left ).control (bt_down ).control (bt_reset )
153+ ly_bt .control (bt_up ).control (bt_right ).margen (0 )
154+
153155 for x in range (6 ):
154156 lh .control (self .htotal [x ])
155157 if x :
156158 self .htotal [x ].hide ()
159+ lh .espacio (- 7 ).otro (ly_bt )
160+
161+ w_up = QtWidgets .QWidget (self )
162+ w_up .setLayout (ly_up .margen (3 ))
163+
164+ w_down = QtWidgets .QWidget (self )
165+ w_down .setLayout (lh .margen (3 ))
166+
167+ splitter = QtWidgets .QSplitter ()
168+ splitter .setOrientation (QtCore .Qt .Vertical )
169+ splitter .addWidget (w_up )
170+ splitter .addWidget (w_down )
171+ self .register_splitter (splitter , "all" )
172+
173+ layout = Colocacion .V ().margen (3 ).control (splitter )
157174
158- layout .otroc (lh , 2 , 0 , 1 , 3 )
159175 self .setLayout (layout )
160176
161- self .restore_video ()
177+ dic_def = {'_SIZE_' : '1064,900' , 'SP_all' : [536 , 354 ]}
178+ self .restore_video (dicDef = dic_def )
162179
163180 grid_all .gotop ()
164- gridB .gotop ()
181+ grid_b .gotop ()
165182 grid_w .gotop ()
166183 self .grid_left_button (grid_all , 0 , None )
167- th = self .board .height ()
168- self .tabGrid .setFixedHeight (th )
169- self .adjustSize ()
170- self .emIndexes .setFixedHeight (th - 72 )
184+
185+ self .scale_init ()
171186
172187 def valorShowLostPoints (self ):
173188 # Llamada from_sq histogram
@@ -183,14 +198,14 @@ def getShowLostPoints(self):
183198 return dic .get ("SHOWLOSTPOINTS" , True ) if dic else True
184199
185200 def cambiadoShow (self ):
186- self .tabChanged (self .tabGrid .currentIndex ())
201+ self .tabChanged (self .tab_grid .currentIndex ())
187202
188- def boardSizeChanged (self ):
189- th = self .board .height ()
190- self .tabGrid .setFixedHeight (th )
191- self .emIndexes .setFixedHeight (th - 72 )
192- self .adjustSize ()
193- self .cambiadoShow ()
203+ # def boardSizeChanged(self):
204+ # th = self.board.height()
205+ # self.tab_grid .setFixedHeight(th)
206+ # self.emIndexes.setFixedHeight(th - 72)
207+ # self.adjustSize()
208+ # self.cambiadoShow()
194209
195210 def tabChanged (self , ntab ):
196211 QtWidgets .QApplication .processEvents ()
@@ -200,7 +215,7 @@ def tabChanged(self, ntab):
200215 for n in range (6 ):
201216 self .htotal [n ].setVisible (False )
202217 self .htotal [tab_vis ].setVisible (True )
203- self .adjustSize ()
218+ # self.adjustSize()
204219 self .tabActive = ntab
205220
206221 def grid_cambiado_registro (self , grid , row , column ):
@@ -333,7 +348,46 @@ def grid_dato(self, grid, row, o_column):
333348 def closeEvent (self , event ):
334349 self .save_video ()
335350
351+ def hscale (self , p_width , p_height ):
352+ key = "HISTOGRAM"
353+ dic = Code .configuration .read_variables (key )
354+ scale_width = p_width * dic .get ("P_WIDTH" , 0.90 )
355+ scale_height = p_height * dic .get ("P_HEIGHT" , 0.80 )
356+ dic ["P_WIDTH" ] = scale_width
357+ dic ["P_HEIGHT" ] = scale_height
358+ Code .configuration .write_variables (key , dic )
359+
360+ for i in range (6 ):
361+ self .htotal [i ].resetMatrix ()
362+ self .htotal [i ].scale (scale_width , scale_height )
363+
364+ def scale_reset (self ):
365+ key = "HISTOGRAM"
366+ dic = Code .configuration .read_variables (key )
367+ dic ["P_WIDTH" ] = scale_width = 0.90
368+ dic ["P_HEIGHT" ] = scale_height = 0.80
369+ Code .configuration .write_variables (key , dic )
370+
371+ for i in range (6 ):
372+ self .htotal [i ].resetMatrix ()
373+ self .htotal [i ].scale (scale_width , scale_height )
374+
375+ def scale_left (self ):
376+ self .hscale (0.95 , 1.0 )
377+
378+ def scale_right (self ):
379+ self .hscale (1.05 , 1.0 )
380+
381+ def scale_up (self ):
382+ self .hscale (1.0 , 1.05 )
383+
384+ def scale_down (self ):
385+ self .hscale (1.0 , 0.95 )
386+
387+ def scale_init (self ):
388+ self .hscale (1.0 , 1.0 )
389+
336390
337- def showGraph (wowner , manager , alm , show_analysis ):
391+ def show_graph (wowner , manager , alm , show_analysis ):
338392 w = WAnalisisGraph (wowner , manager , alm , show_analysis )
339393 w .exec_ ()
0 commit comments