Enable different tools in different modes.

--HG--
branch : feature
This commit is contained in:
dismine 2013-12-21 14:57:20 +02:00
parent 66c9e35e0b
commit 05b8cf4eba
2 changed files with 33 additions and 18 deletions

View File

@ -845,7 +845,9 @@ void MainWindow::ActionDraw(bool checked)
verScrollBar->setValue(currentScene->getVerScrollBar()); verScrollBar->setValue(currentScene->getVerScrollBar());
mode = Draw::Calculation; mode = Draw::Calculation;
SetEnableTool(true);
doc->setCurrentData(); doc->setCurrentData();
ui->toolBox->setCurrentIndex(0);
} }
else else
{ {
@ -872,6 +874,8 @@ void MainWindow::ActionDetails(bool checked)
verScrollBar = view->verticalScrollBar(); verScrollBar = view->verticalScrollBar();
verScrollBar->setValue(currentScene->getVerScrollBar()); verScrollBar->setValue(currentScene->getVerScrollBar());
mode = Draw::Modeling; mode = Draw::Modeling;
SetEnableTool(true);
ui->toolBox->setCurrentIndex(4);
} }
else else
{ {
@ -1068,23 +1072,34 @@ void MainWindow::ClosedActionHistory()
void MainWindow::SetEnableTool(bool enable) void MainWindow::SetEnableTool(bool enable)
{ {
ui->toolButtonEndLine->setEnabled(enable); bool drawTools = false;
ui->toolButtonLine->setEnabled(enable); bool modelingTools = false;
ui->toolButtonAlongLine->setEnabled(enable); if(mode == Draw::Calculation)
ui->toolButtonShoulderPoint->setEnabled(enable); {
ui->toolButtonNormal->setEnabled(enable); drawTools = enable;
ui->toolButtonBisector->setEnabled(enable); }
ui->toolButtonLineIntersect->setEnabled(enable); else
ui->toolButtonSpline->setEnabled(enable); {
ui->toolButtonArc->setEnabled(enable); modelingTools = enable; // Soon we will have some tools for modeling.
ui->toolButtonSplinePath->setEnabled(enable); }
ui->toolButtonPointOfContact->setEnabled(enable); //Drawing Tools
ui->toolButtonNewDetail->setEnabled(enable); ui->toolButtonEndLine->setEnabled(drawTools);
ui->toolButtonHeight->setEnabled(enable); ui->toolButtonLine->setEnabled(drawTools);
ui->toolButtonTriangle->setEnabled(enable); ui->toolButtonAlongLine->setEnabled(drawTools);
ui->toolButtonPointOfIntersection->setEnabled(enable); ui->toolButtonShoulderPoint->setEnabled(drawTools);
ui->toolButtonSplineCutPoint->setEnabled(enable); ui->toolButtonNormal->setEnabled(drawTools);
ui->toolButtonSplinePathCutPoint->setEnabled(enable); ui->toolButtonBisector->setEnabled(drawTools);
ui->toolButtonLineIntersect->setEnabled(drawTools);
ui->toolButtonSpline->setEnabled(drawTools);
ui->toolButtonArc->setEnabled(drawTools);
ui->toolButtonSplinePath->setEnabled(drawTools);
ui->toolButtonPointOfContact->setEnabled(drawTools);
ui->toolButtonNewDetail->setEnabled(drawTools);
ui->toolButtonHeight->setEnabled(drawTools);
ui->toolButtonTriangle->setEnabled(drawTools);
ui->toolButtonPointOfIntersection->setEnabled(drawTools);
ui->toolButtonSplineCutPoint->setEnabled(drawTools);
ui->toolButtonSplinePathCutPoint->setEnabled(drawTools);
} }
void MainWindow::MinimumScrollBar() void MainWindow::MinimumScrollBar()

View File

@ -40,7 +40,7 @@
<string/> <string/>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>2</number> <number>4</number>
</property> </property>
<widget class="QWidget" name="page"> <widget class="QWidget" name="page">
<property name="geometry"> <property name="geometry">