[Kstars-devel] kdeedu/kstars/kstars/tools
Jason Harris
kstars at 30doradus.org
Sun Oct 24 01:57:54 CEST 2004
CVS commit by harris:
Adding keyboard commands to the Solar System tool:
Keys 0-9 center the display on one of the major planets, just as in the
SkyMap. 0 is the Sun, 1-9 are the planets from Mercury to Pluto.
CCMAIL: kstars-devel at kde.org
M +79 -0 planetviewer.cpp 1.15
--- kdeedu/kstars/kstars/tools/planetviewer.cpp #1.14:1.15
@@ -156,4 +156,6 @@ void PVPlotWidget::keyPressEvent( QKeyEv
double xstep = 0.01*(x2() - x());
double ystep = 0.01*(y2() - y());
+ double dx = 0.5*(x2() - x());
+ double dy = 0.5*(y2() - y());
switch ( e->key() ) {
@@ -196,4 +198,81 @@ void PVPlotWidget::keyPressEvent( QKeyEv
break;
+ case Key_0: //Sun
+ setLimits( -dx, dx, -dy, dy );
+ update();
+ break;
+
+ case Key_1: //Mercury
+ {
+ DPoint *p = object(10)->point(0);
+ setLimits( p->x() - dx, p->x() + dx, p->y() - dy, p->y() + dy );
+ update();
+ break;
+ }
+
+ case Key_2: //Venus
+ {
+ DPoint *p = object(12)->point(0);
+ setLimits( p->x() - dx, p->x() + dx, p->y() - dy, p->y() + dy );
+ update();
+ break;
+ }
+
+ case Key_3: //Earth
+ {
+ DPoint *p = object(14)->point(0);
+ setLimits( p->x() - dx, p->x() + dx, p->y() - dy, p->y() + dy );
+ update();
+ break;
+ }
+
+ case Key_4: //Mars
+ {
+ DPoint *p = object(16)->point(0);
+ setLimits( p->x() - dx, p->x() + dx, p->y() - dy, p->y() + dy );
+ update();
+ break;
+ }
+
+ case Key_5: //Jupiter
+ {
+ DPoint *p = object(18)->point(0);
+ setLimits( p->x() - dx, p->x() + dx, p->y() - dy, p->y() + dy );
+ update();
+ break;
+ }
+
+ case Key_6: //Saturn
+ {
+ DPoint *p = object(20)->point(0);
+ setLimits( p->x() - dx, p->x() + dx, p->y() - dy, p->y() + dy );
+ update();
+ break;
+ }
+
+ case Key_7: //Uranus
+ {
+ DPoint *p = object(22)->point(0);
+ setLimits( p->x() - dx, p->x() + dx, p->y() - dy, p->y() + dy );
+ update();
+ break;
+ }
+
+ case Key_8: //Neptune
+ {
+ DPoint *p = object(24)->point(0);
+ setLimits( p->x() - dx, p->x() + dx, p->y() - dy, p->y() + dy );
+ update();
+ break;
+ }
+
+ case Key_9: //Pluto
+ {
+ DPoint *p = object(26)->point(0);
+ setLimits( p->x() - dx, p->x() + dx, p->y() - dy, p->y() + dy );
+ update();
+ break;
+ }
+
default:
e->ignore();
More information about the Kstars-devel
mailing list