[Kst] [Bug 115664] Match X axis only, not Y function
George Staikos
staikos at kde.org
Fri Nov 4 18:17:11 CET 2005
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=115664
staikos kde org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
------- Additional Comments From staikos kde org 2005-11-04 18:17 -------
SVN commit 477668 by staikos:
Add a match X axis tool - will reorganize menu later possibly.
FEATURE: 115664
M +27 -5 kst2dplot.cpp
M +2 -1 kst2dplot.h
--- trunk/extragear/graphics/kst/kst/kst2dplot.cpp #477667:477668
@ -3098,7 +3098,7 @
}
-void Kst2DPlot::matchAxis(int id) {
+void Kst2DPlot::matchAxes(int id) {
Kst2DPlotPtr p = (Kst2DPlot*)_plotMap[id];
if (p) {
double x0, x1, y0, y1;
@ -3117,6 +3117,23 @
}
+void Kst2DPlot::matchXAxis(int id) {
+ Kst2DPlotPtr p = (Kst2DPlot*)_plotMap[id];
+ if (p) {
+ double x0, x1, y0, y1;
+ p->getScale(x0, y0, x1, y1);
+ setLog(p->isXLog(), isYLog());
+ setXScaleMode(FIXED);
+ setXScale(x0, x1);
+ pushScale();
+ setDirty();
+ if (_menuView) {
+ _menuView->paint();
+ }
+ }
+}
+
+
void Kst2DPlot::copyObject() {
if (_layoutMenuView) {
KstTopLevelViewPtr tlv = _layoutMenuView->viewObject();
@ -3173,21 +3190,26 @
KstViewObject::popupMenu(menu, pos, topLevelParent);
KPopupMenu *submenu = new KPopupMenu(menu);
- int id = menu->insertItem(i18n("&Match Axis"), submenu);
+ KPopupMenu *submenu2 = new KPopupMenu(menu);
Kst2DPlotList pl = globalPlotList();
int i = 0;
_plotMap.clear();
- for (Kst2DPlotList::Iterator j = pl.begin(); j != pl.end(); ++j) {
+ for (Kst2DPlotList::ConstIterator j = pl.begin(); j != pl.end(); ++j) {
if ((*j).data() != this) {
_plotMap[i] = *j; // don't think there is any way around this.
// We have to hope that it's safe until the menu is
// done.
submenu->insertItem((*j)->tagName(), i);
- submenu->connectItem(i++, this, SLOT(matchAxis(int)));
+ submenu->connectItem(i, this, SLOT(matchAxes(int)));
+ submenu2->insertItem((*j)->tagName(), i);
+ submenu2->connectItem(i++, this, SLOT(matchXAxis(int)));
hasEntry = true;
}
}
+ int id = menu->insertItem(i18n("&Match Axes"), submenu);
menu->setItemEnabled(id, hasEntry);
+ id = menu->insertItem(i18n("&Match X Axis"), submenu2);
+ menu->setItemEnabled(id, hasEntry);
hasEntry = false;
submenu = new KPopupMenu(menu);
@ -3262,7 +3284,7 @
// Fit menu
KPopupMenu *submenu4 = new KPopupMenu(menu);
// Filter menu
- KPopupMenu *submenu2 = new KPopupMenu(menu);
+ submenu2 = new KPopupMenu(menu);
// Remove menu
KPopupMenu *submenu3 = new KPopupMenu(menu);
hasEntry = false;
--- trunk/extragear/graphics/kst/kst/kst2dplot.h #477667:477668
@ -364,7 +364,8 @
void editObject(int id);
void editVector(int id);
void editMatrix(int id);
- void matchAxis(int id);
+ void matchAxes(int id);
+ void matchXAxis(int id);
void fitCurve(int id);
void filterCurve(int id);
void removeCurve(int id);
More information about the Kst
mailing list