Skip to content

Commit

Permalink
Add QActionGroup to highlight the current map tool.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk@4485 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
telwertowski committed Jan 6, 2006
1 parent 3f82de3 commit df9d36a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/qgisapp.cpp
Expand Up @@ -232,6 +232,7 @@ static void setTitleBarText_( QWidget & qgisApp )
mSplash->showMessage("Setting up the GUI", Qt::AlignHCenter | Qt::AlignBottom);
qApp->processEvents();
createActions();
createActionGroups();
createMenus();
createToolBars();
createStatusBar();
Expand Down Expand Up @@ -613,6 +614,33 @@ void QgisApp::createActions()
connect(mActionCapturePolygon, SIGNAL(triggered()), this, SLOT(capturePolygon()));
}

void QgisApp::createActionGroups()
{
//
// Map Tool Group
mMapToolGroup = new QActionGroup(this);
mActionPan->setCheckable(true);
mMapToolGroup->addAction(mActionPan);
mActionZoomIn->setCheckable(true);
mMapToolGroup->addAction(mActionZoomIn);
mActionZoomOut->setCheckable(true);
mMapToolGroup->addAction(mActionZoomOut);
mActionIdentify->setCheckable(true);
mMapToolGroup->addAction(mActionIdentify);
mActionSelect->setCheckable(true);
mMapToolGroup->addAction(mActionSelect);
mActionMeasure->setCheckable(true);
mMapToolGroup->addAction(mActionMeasure);
mActionMeasureArea->setCheckable(true);
mMapToolGroup->addAction(mActionMeasureArea);
mActionCaptureLine->setCheckable(true);
mMapToolGroup->addAction(mActionCaptureLine);
mActionCapturePoint->setCheckable(true);
mMapToolGroup->addAction(mActionCapturePoint);
mActionCapturePolygon->setCheckable(true);
mMapToolGroup->addAction(mActionCapturePolygon);
}

void QgisApp::createMenus()
{
//
Expand Down
4 changes: 4 additions & 0 deletions src/qgisapp.h
Expand Up @@ -420,6 +420,7 @@ public slots:
void readSettings();
void writeSettings();
void createActions();
void createActionGroups();
void createMenus();
void createToolBars();
void createStatusBar();
Expand Down Expand Up @@ -487,6 +488,9 @@ public slots:
QAction *mActionInOverview;
QAction *mActionDraw;
//
//tool groups -------------------------------------
QActionGroup *mMapToolGroup;
//
//menus -----------------------------------------
QMenu *mFileMenu;
QMenu *mRecentProjectsMenu;
Expand Down

0 comments on commit df9d36a

Please sign in to comment.