[Avida-cvs] [avida-svn] r789 - branches/developers/avida-edward/source/python/AvidaGui2
jclune@myxo.css.msu.edu
jclune at myxo.css.msu.edu
Fri Jun 30 19:35:06 PDT 2006
Author: jclune
Date: 2006-06-30 22:35:06 -0400 (Fri, 30 Jun 2006)
New Revision: 789
Modified:
branches/developers/avida-edward/source/python/AvidaGui2/pyPetriCanvasView.py
branches/developers/avida-edward/source/python/AvidaGui2/pyPetriDishCtrl.py
branches/developers/avida-edward/source/python/AvidaGui2/to-do_list
Log:
scroll bars are now dynamicly set to the current petri canvas view size
Modified: branches/developers/avida-edward/source/python/AvidaGui2/pyPetriCanvasView.py
===================================================================
--- branches/developers/avida-edward/source/python/AvidaGui2/pyPetriCanvasView.py 2006-06-30 20:32:24 UTC (rev 788)
+++ branches/developers/avida-edward/source/python/AvidaGui2/pyPetriCanvasView.py 2006-07-01 02:35:06 UTC (rev 789)
@@ -1,10 +1,14 @@
from qt import QTextDrag
from qt import Qt, PYSIGNAL
from qtcanvas import QCanvasView
+from descr import descr
+
class pyPetriCanvasView(QCanvasView):
- def __init__(self,parent,name,f =2):
+ def __init__(self,parent, name, f =2,session_mdl = None):
QCanvasView.__init__(self,parent,name,f)
+ self.m_session_mdl = session_mdl
+
def contentsMousePressEvent(self,e): # QMouseEvent e
if e.button() != Qt.LeftButton: return
cell_id = None
@@ -19,4 +23,7 @@
org_clicked_on_item = item
self.emit(PYSIGNAL("orgClickedOnSig"), (org_clicked_on_item,))
-
+ def viewportResizeEvent(self,event):
+ petriCanvasSize = event.size()
+ self.m_session_mdl.m_session_mdtr.emit(PYSIGNAL("petriCanvasResizedSig"),(petriCanvasSize,))
+
Modified: branches/developers/avida-edward/source/python/AvidaGui2/pyPetriDishCtrl.py
===================================================================
--- branches/developers/avida-edward/source/python/AvidaGui2/pyPetriDishCtrl.py 2006-06-30 20:32:24 UTC (rev 788)
+++ branches/developers/avida-edward/source/python/AvidaGui2/pyPetriDishCtrl.py 2006-07-01 02:35:06 UTC (rev 789)
@@ -42,7 +42,7 @@
self.m_petri_dish_layout = pySquareVBoxLayout(self,0,0,"m_petri_dish_layout")
print "pyPetriDishCtrl.construct() self.m_petri_dish_layout.heightForWidth(20) :", self.m_petri_dish_layout.heightForWidth(20)
- self.m_canvas_view = pyPetriCanvasView(None, self,"m_canvas_view")
+ self.m_canvas_view = pyPetriCanvasView(None, self,"m_canvas_view",session_mdl)
#hiding the scroll bars, the pre-packaged ones were not working so we are adding them manually elsewhere
self.m_canvas_view.setVScrollBarMode(QScrollView.AlwaysOff)
@@ -54,6 +54,7 @@
self.m_petri_dish_ctrl_h_scrollBar = QScrollBar(0,371,0,20,185,Qt.Horizontal,self.m_canvas_view)
self.m_petri_dish_ctrl_v_scrollBar = QScrollBar(0,371,0,20,185,Qt.Vertical,self.m_canvas_view)
# end junk settings
+
self.m_petri_dish_ctrl_h_scrollBar.setGeometry(0,365, 380,self.m_scroll_bar_width)
self.m_petri_dish_ctrl_v_scrollBar.setGeometry(365,0,self.m_scroll_bar_width,365)
@@ -78,6 +79,9 @@
PYSIGNAL("orgClickedOnSig"), self.updateOrgClickedOutlineCellNumberSlot)
self.connect( self.m_session_mdl.m_session_mdtr,
PYSIGNAL("orgClickedOnSig"), self.setDragSlot)
+ self.connect(
+ self.m_session_mdl.m_session_mdtr, PYSIGNAL("petriCanvasResizedSig"),
+ self.petriCanvasResizedSlot)
self.connect(self.m_petri_dish_ctrl_h_scrollBar,
SIGNAL("valueChanged(int)"),
self.moveCanvasHorizontallySlot)
@@ -109,6 +113,16 @@
self.m_org_clicked_on_item = None
self.m_occupied_cells_ids = []
+ def petriCanvasResizedSlot(self,petriCanvasSize):
+ descr()
+ self.m_petri_dish_ctrl_h_scrollBar.setGeometry(0,petriCanvasSize.height()
+ -self.m_scroll_bar_width+2, petriCanvasSize.width()+2,self.m_scroll_bar_width)
+ self.m_petri_dish_ctrl_v_scrollBar.setGeometry(petriCanvasSize.width()
+ -self.m_scroll_bar_width+2,0,self.m_scroll_bar_width,
+ petriCanvasSize.height()-self.m_scroll_bar_width+2)
+
+
+
def setColorLookupFunctor(self, color_lookup_functor):
self.m_color_lookup_functor = color_lookup_functor
Modified: branches/developers/avida-edward/source/python/AvidaGui2/to-do_list
===================================================================
--- branches/developers/avida-edward/source/python/AvidaGui2/to-do_list 2006-06-30 20:32:24 UTC (rev 788)
+++ branches/developers/avida-edward/source/python/AvidaGui2/to-do_list 2006-07-01 02:35:06 UTC (rev 789)
@@ -53,11 +53,11 @@
************Jeff*******************
Priority High
--add a status page to the petri dish saying what is loaded (1/22/06)
-make scroll bars dynamic (1/26/05)
--make tasks reflect parent tasks (not real time) in org report (email rob first) (1/26/06)
+-make tasks reflect parent tasks (not real time) in org report (ask group first) (1/26/06)
Priority Medium
+-make the getting rid of the outline of the cells something that doesn't slow down the code at every step
-Use warning system
-make a warning that says you can't drag orgs into this view (1/26/06)
-the "that was a bad path" or "file does not exist" warnings for dragging and dropping should use this (10/01/05)
@@ -186,3 +186,6 @@
June
-Petri dish now outlines the organisms that are about to start that run
-Scroll bars are working again (though hard coded)
+-Scroll bars are now dynamic (30th)
+
+July
\ No newline at end of file
More information about the Avida-cvs
mailing list