src/gui_actions.cpp

changeset 461
fbcc91ae1dd2
parent 460
b230ae09c8e5
child 464
3779a14d597c
equal deleted inserted replaced
460:b230ae09c8e5 461:fbcc91ae1dd2
35 #include "dialogs.h" 35 #include "dialogs.h"
36 #include "primitives.h" 36 #include "primitives.h"
37 #include "ui_newpart.h" 37 #include "ui_newpart.h"
38 #include "widgets.h" 38 #include "widgets.h"
39 39
40 extern_cfg (bool, gl_wireframe); 40 extern_cfg (Bool, gl_wireframe);
41 extern_cfg (bool, gl_colorbfc); 41 extern_cfg (Bool, gl_colorbfc);
42 42
43 // ============================================================================= 43 // =============================================================================
44 // ----------------------------------------------------------------------------- 44 // -----------------------------------------------------------------------------
45 DEFINE_ACTION (New, CTRL_SHIFT (N)) { 45 DEFINE_ACTION (New, CTRL_SHIFT (N)) {
46 QDialog* dlg = new QDialog (g_win); 46 QDialog* dlg = new QDialog (g_win);
436 delete[] imgdata; 436 delete[] imgdata;
437 } 437 }
438 438
439 // ============================================================================= 439 // =============================================================================
440 // ----------------------------------------------------------------------------- 440 // -----------------------------------------------------------------------------
441 extern_cfg (bool, gl_axes); 441 extern_cfg (Bool, gl_axes);
442 DEFINE_ACTION (Axes, 0) { 442 DEFINE_ACTION (Axes, 0) {
443 gl_axes = !gl_axes; 443 gl_axes = !gl_axes;
444 ACTION (Axes)->setChecked (gl_axes); 444 ACTION (Axes)->setChecked (gl_axes);
445 g_win->R()->update(); 445 g_win->R()->update();
446 } 446 }
561 DEFINE_ACTION (BFCView, SHIFT (B)) { 561 DEFINE_ACTION (BFCView, SHIFT (B)) {
562 gl_colorbfc = !gl_colorbfc; 562 gl_colorbfc = !gl_colorbfc;
563 ACTION (BFCView)->setChecked (gl_colorbfc); 563 ACTION (BFCView)->setChecked (gl_colorbfc);
564 g_win->R()->refresh(); 564 g_win->R()->refresh();
565 } 565 }
566
567 // =============================================================================
568 // -----------------------------------------------------------------------------
569 DEFINE_ACTION (JumpTo, CTRL (G)) {
570 bool ok;
571 int defval = 0;
572 LDObject* obj;
573
574 if (g_win->sel().size() == 1)
575 defval = g_win->sel()[0]->getIndex();
576
577 int idx = QInputDialog::getInt (null, "Go to line", "Go to line:", defval,
578 1, LDFile::current()->numObjs(), 1, &ok);
579
580 if (!ok || (obj = LDFile::current()->object (idx - 1)) == null)
581 return;
582
583 g_win->clearSelection();
584 g_win->sel() << obj;
585 g_win->updateSelection();
586 }

mercurial