Skip to content

Commit fa2287b

Browse files
author
Henning Kiel
committed
make OMNotebook usable on OSX again
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@25574 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
1 parent 0feaf92 commit fa2287b

File tree

5 files changed

+409
-456
lines changed

5 files changed

+409
-456
lines changed

OMNotebook/OMNotebookGUI/cell.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -619,11 +619,7 @@ namespace IAEX
619619
if(!treeView_)
620620
throw logic_error("SetHeight(const int height): TreeView is not set.");
621621

622-
#ifdef __APPLE_CC__
623-
setMinimumHeight(h);
624-
#else
625622
setFixedHeight(h);
626-
#endif
627623

628624
treeView_->setFixedHeight(h);
629625

OMNotebook/OMNotebookGUI/notebookcommands.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,7 @@ namespace IAEX
505505
* \author Anders Fernström
506506
* \date 2006-03-02
507507
*
508-
* Updates all chapter counter in a documetn
508+
* Updates all chapter counter in a document
509509
*/
510510
class UpdateChapterCounters : public Command
511511
{

OMNotebook/OMSketch/Draw_LineArrow.h

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,15 @@ class Draw_LineArrow:public QGraphicsPathItem
5454

5555
//checking the mouse position to resize and move line
5656
bool isMouseClickedOnStartHandle(const QPointF pnt);
57-
bool isMouseClickedOnEndHandle(const QPointF pnt);
58-
bool isMouseClickedOnRotateHandle(const QPointF pnt);
57+
bool isMouseClickedOnEndHandle(const QPointF pnt);
58+
bool isMouseClickedOnRotateHandle(const QPointF pnt);
5959
bool isMouseClickedOnShape(const QPointF pnt);
6060
bool get_line(QPointF pnt);
61-
bool isClickedOnHandleOrShape(QPointF point);
61+
bool isClickedOnHandleOrShape(QPointF point);
6262

6363
QPainterPath getLineArrow(QPointF pnt);
64-
//writes the shapes and shapes attributes to an image
65-
void drawImage(QPainter *painter,QString &text,QPointF point);
64+
//writes the shapes and shapes attributes to an image
65+
void drawImage(QPainter *painter,QString &text,QPointF point);
6666

6767
void setEdgeRects();
6868
void updateEdgeRects();
@@ -74,17 +74,17 @@ class Draw_LineArrow:public QGraphicsPathItem
7474
void setRotate(const QPointF &pnt,const QPointF &pnt1);
7575
void setScale(float x,float y);
7676

77-
//show handles
78-
void showHandles();
79-
//hide handles
80-
void hideHandles();
77+
//show handles
78+
void showHandles();
79+
//hide handles
80+
void hideHandles();
8181

82-
//rotate the shapes
83-
void rotateShape(float angle);
82+
//rotate the shapes
83+
void rotateShape(float angle);
8484

85-
//gets the min and max of linearrow points
86-
QPointF getMinPoint();
87-
QPointF getMaxPoint();
85+
//gets the min and max of linearrow points
86+
QPointF getMinPoint();
87+
QPointF getMaxPoint();
8888

8989
virtual QPointF getTranslate(){return QPointF(0,0);}
9090
virtual float getRotate(float angle){return 0;}
@@ -100,7 +100,7 @@ class Draw_LineArrow:public QGraphicsPathItem
100100
void print();
101101

102102
float angle;
103-
bool isObjectSelected;
103+
bool isObjectSelected;
104104
QVector<QPointF> arrow_pnts;
105105
~Draw_LineArrow(){}
106106

OMNotebook/OMSketch/Graph_Scene.cpp

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,16 +1340,15 @@ void Graph_Scene::draw_line_move(QPointF pnt,QPointF pnt1)
13401340

13411341
void Graph_Scene::draw_line_state(QPointF pnt, QPointF pnt1)
13421342
{
1343-
13441343
if(line && (lines.isEmpty())&&!line->getPolyLineDrawn() && objectToDraw==1)
13451344
{
1346-
line->setEndPoint(pnt1);
1345+
line->setEndPoint(pnt1);
13471346
}
13481347

1349-
if((lines.size()>=1)&&!line->getPolyLineDrawn() && objectToDraw==1)
1348+
if(line && (lines.size()>=1)&&!line->getPolyLineDrawn() && objectToDraw==1)
13501349
{
1351-
line->setEndPoint(pnt1);
1352-
line->setPolyLineDrawn(false);
1350+
line->setEndPoint(pnt1);
1351+
line->setPolyLineDrawn(false);
13531352
}
13541353

13551354
if(line && line->getPolyLineDrawn())
@@ -1542,56 +1541,56 @@ void Graph_Scene::draw_linearrow_state(QPointF pnt, QPointF pnt1)
15421541
if(linearrow && linearrow->getMode()==false && objectToDraw==7)
15431542
{
15441543

1545-
Draw_LineArrow *linearrow2 = new Draw_LineArrow();
1546-
linearrow2=linearrow;
1544+
Draw_LineArrow *linearrow2 = new Draw_LineArrow();
1545+
linearrow2=linearrow;
15471546

1548-
removeItem(linearrow2->item);
1549-
removeItem(linearrow->item);
1547+
removeItem(linearrow2->item);
1548+
removeItem(linearrow->item);
15501549
last_pnt=pnt1;
15511550

15521551

1553-
//qDebug()<<"line strt point "<<linearrow2->getStartPnt()<<"\n";
1552+
//qDebug()<<"line strt point "<<linearrow2->getStartPnt()<<"\n";
15541553
linearrow2->bounding_strt_pnt = linearrow2->getStartPnt();
15551554
linearrow2->bounding_end_pnt = linearrow2->getEndPnt();
1556-
//qDebug()<<"return items coords "<<linearrow2->getLineArrow(linearrow2->getStartPnt()).boundingRect().bottomRight()<<"\n";
1557-
linearrow2->item = new QGraphicsPathItem(linearrow2->getLineArrow(linearrow2->getStartPnt()));
1558-
addItem(linearrow2->item);
1559-
linearrow2->setEdgeRects();
1560-
//qDebug()<<"line arrow item "<<linearrow2->item->boundingRect().topLeft()<<" "<<linearrow2->item->boundingRect().bottomRight()<<"\n";
1555+
//qDebug()<<"return items coords "<<linearrow2->getLineArrow(linearrow2->getStartPnt()).boundingRect().bottomRight()<<"\n";
1556+
linearrow2->item = new QGraphicsPathItem(linearrow2->getLineArrow(linearrow2->getStartPnt()));
1557+
addItem(linearrow2->item);
1558+
linearrow2->setEdgeRects();
1559+
//qDebug()<<"line arrow item "<<linearrow2->item->boundingRect().topLeft()<<" "<<linearrow2->item->boundingRect().bottomRight()<<"\n";
15611560

15621561
addItem(linearrow2->Strt_Rect);
15631562
addItem(linearrow2->End_Rect);
15641563
addItem(linearrow2->Rot_Rect);
15651564

1566-
linearrow->setMode(true);
1565+
linearrow->setMode(true);
15671566

1568-
linearrow2->setMode(true);
1569-
linearrow2->isObjectSelected=true;
1567+
linearrow2->setMode(true);
1568+
linearrow2->isObjectSelected=true;
15701569

1571-
//qDebug()<<"line length "<<linearrow2->arrow_pnts[0]<<" "<<linearrow2->arrow_pnts[1]<<" "<<linearrow2->arrow_pnts[3]<<"\n";
1570+
//qDebug()<<"line length "<<linearrow2->arrow_pnts[0]<<" "<<linearrow2->arrow_pnts[1]<<" "<<linearrow2->arrow_pnts[3]<<"\n";
15721571

1573-
qDebug()<<"line ptns "<<linearrow2->getMinPoint()<<" "<<linearrow2->getMaxPoint()<<"\n";
1572+
qDebug()<<"line ptns "<<linearrow2->getMinPoint()<<" "<<linearrow2->getMaxPoint()<<"\n";
15741573

1575-
linearrows[linearrows.size()-1] = linearrow2;
1576-
object->setObjectPos(linearrow2->getMinPoint(),linearrow2->getMaxPoint());
1577-
object->pnts=linearrow->arrow_pnts;
1574+
linearrows[linearrows.size()-1] = linearrow2;
1575+
object->setObjectPos(linearrow2->getMinPoint(),linearrow2->getMaxPoint());
1576+
object->pnts=linearrow->arrow_pnts;
15781577
object->setObjects(7,linearrows.size()-1);
15791578
object->ObjectIndx=linearrows.size()-1;
15801579
object->pen=pen;
15811580
objects.push_back(object);
1582-
objectToDraw=0;
1583-
objectToEdit=7;
1584-
}
1581+
objectToDraw=0;
1582+
objectToEdit=7;
1583+
}
15851584

15861585
if(linearrow && linearrow->getMode()==true)
15871586
{
15881587

15891588
if(linearrow->getState()==1)
15901589
{
1591-
object7->setObjectPos(linearrow->item->boundingRect().topLeft(),linearrow->item->boundingRect().bottomRight());
1592-
object7->pnts=linearrow->arrow_pnts;
1590+
object7->setObjectPos(linearrow->item->boundingRect().topLeft(),linearrow->item->boundingRect().bottomRight());
1591+
object7->pnts=linearrow->arrow_pnts;
15931592
linearrow->setState(0);
1594-
objectToEdit=7;
1593+
objectToEdit=7;
15951594
}
15961595

15971596
if(linearrow->getState()==2)

0 commit comments

Comments
 (0)