[Kst] kdeextragear-2/kst/kst
George Staikos
staikos at kde.org
Fri Sep 12 00:31:58 CEST 2003
CVS commit by staikos:
put a title on the context menu
M +5 -2 kstview.cpp 1.26
M +2 -0 kstview.h 1.14
--- kdeextragear-2/kst/kst/kstview.cpp #1.25:1.26
@@ -65,4 +65,5 @@ KstView::KstView(KstApp *parent, const c
/* initialize the popup menu */
popupmenu = new KPopupMenu(this);
+ _titleId = popupmenu->insertTitle(i18n("Plot"));
popupmenu->insertItem(i18n("Zoom &Max"), this, SLOT(zoomMaxSlot()), Key_M);
popupmenu->insertItem(i18n("Zoom P&rev"), this, SLOT(zoomPrevSlot()), Key_R);
@@ -477,9 +478,11 @@ void KstView::mousePressEvent(QMouseEven
} else if (e->button() == Qt::RightButton) {
for (i = 0; i < KST::plotList.count(); i++) {
- win_rect = KST::plotList.at(i)->GetPlotRegion();
+ KstPlot *p = KST::plotList.at(i);
+ win_rect = p->GetPlotRegion();
if (win_rect.contains(e->pos())) {
MouseInfo->setMode(INACTIVE);
MouseInfo->setPressLocation(e->pos());
MouseInfo->setPlotNum(i);
+ popupmenu->changeTitle(_titleId, i18n("Plot: %1").arg(p->tagName()));
popupmenu->popup(mapToGlobal(e->pos()));
return;
@@ -487,5 +490,5 @@ void KstView::mousePressEvent(QMouseEven
}
} else if (e->button() == Qt::MidButton) {
- for (i=0; i < KST::plotList.count(); i++) {
+ for (i = 0; i < KST::plotList.count(); i++) {
win_rect = (KST::plotList.at(i))->GetPlotRegion();
if (win_rect.contains(e->pos())) {
--- kdeextragear-2/kst/kst/kstview.h #1.13:1.14
@@ -115,4 +115,6 @@ private:
int _minMove;
+ int _titleId;
+
signals:
void newStatusMsg(const QString &);
More information about the Kst
mailing list