From: mkr Date: Mon, 25 Jul 2005 11:17:33 +0000 (+0000) Subject: Fix for bug IPAL9558 : Maintainance Mandrake porting: black rectangle in table view. X-Git-Tag: current25072005 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=21f42338a5a328977269d6e4ee57b9a672cd3bf5;p=modules%2Fsuperv.git Fix for bug IPAL9558 : Maintainance Mandrake porting: black rectangle in table view. --- diff --git a/src/SUPERVGUI/SUPERVGUI_ArrayView.cxx b/src/SUPERVGUI/SUPERVGUI_ArrayView.cxx index 63d7ac2..de53d8c 100644 --- a/src/SUPERVGUI/SUPERVGUI_ArrayView.cxx +++ b/src/SUPERVGUI/SUPERVGUI_ArrayView.cxx @@ -104,6 +104,12 @@ void SUPERVGUI_ArrayView::changeBackground() } } +void SUPERVGUI_ArrayView::resizeEvent( QResizeEvent* e) { + QCanvasView::resizeEvent( e ); + canvas()->resize( e->size().width() > canvas()->width() ? e->size().width() : canvas()->width(), + e->size().height() > canvas()->height() ? e->size().height() : canvas()->height() ); +} + void SUPERVGUI_ArrayView::contentsMousePressEvent(QMouseEvent* theEvent) { myGlobalPoint = theEvent->globalPos(); diff --git a/src/SUPERVGUI/SUPERVGUI_ArrayView.h b/src/SUPERVGUI/SUPERVGUI_ArrayView.h index e851d56..358c27d 100644 --- a/src/SUPERVGUI/SUPERVGUI_ArrayView.h +++ b/src/SUPERVGUI/SUPERVGUI_ArrayView.h @@ -37,6 +37,9 @@ class SUPERVGUI_ArrayView: public QCanvasView { void addToStudy(); void changeBackground(); + protected: + void resizeEvent( QResizeEvent* e); + private: void contentsMousePressEvent(QMouseEvent* theEvent); void contentsMouseMoveEvent(QMouseEvent* theEvent); diff --git a/src/SUPERVGUI/SUPERVGUI_Canvas.cxx b/src/SUPERVGUI/SUPERVGUI_Canvas.cxx index 732a0f9..156e748 100644 --- a/src/SUPERVGUI/SUPERVGUI_Canvas.cxx +++ b/src/SUPERVGUI/SUPERVGUI_Canvas.cxx @@ -86,7 +86,7 @@ SUPERVGUI_Canvas::SUPERVGUI_Canvas(SUPERVGUI_Main* m): Trace("SUPERVGUI_Canvas::SUPERVGUI_Canvas"); myIsControlView = false; // resize(GRAPH_WIDTH, GRAPH_HEIGHT); - resize(1000, 725); + resize(1050, 750); setDoubleBuffering(true); QColor aColor(MAIN_COLOR); diff --git a/src/SUPERVGUI/SUPERVGUI_CanvasArray.cxx b/src/SUPERVGUI/SUPERVGUI_CanvasArray.cxx index cf94047..01aeec5 100644 --- a/src/SUPERVGUI/SUPERVGUI_CanvasArray.cxx +++ b/src/SUPERVGUI/SUPERVGUI_CanvasArray.cxx @@ -18,6 +18,8 @@ using namespace std; #include #define TEXT_MARGIN 5 +#include //for debug only + #define ADDNODES(NodesName,LevelHasDiffNT) \ ncols = nodes->NodesName.length(); \ for (int co=0; cogetDataflow()->LevelMax(); + cout<<"-> myMain->getDataflow()->LevelMax() = "<getDataflow()->LevelMax()<getDataflow()->ThreadsMax(); + cout<<"-> myMain->getDataflow()->ThreadsMax() = "<getDataflow()->ThreadsMax()<setY(aRect.y() + aRect.height()/2 - aBRect.height()/2); aText->setZ(1); aText->show(); + + aMaxWidth = aRect.x() + aRect.width() + 50; } y = 60; @@ -202,6 +213,13 @@ bool SUPERVGUI_CanvasArray::create() { nodeX = 50; nodeY = y + CELL_HEIGHT*2; + aMaxHeight = nodeY; + + // if aMaxWidth and aMaxHeight is greater than the current size + // of the canvas, we resize canvas to these new width and height + if ( aMaxWidth > this->width() || aMaxHeight > this->height() ) + this->resize( aMaxWidth > this->width() ? aMaxWidth : this->width(), + aMaxHeight > this->height() ? aMaxHeight : this->height() ); return true; }