File: MainWindow.h

package info (click to toggle)
quickplot 0.8.6-1.1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,548 kB
  • ctags: 1,019
  • sloc: cpp: 10,052; sh: 7,597; makefile: 176
file content (122 lines) | stat: -rw-r--r-- 3,003 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
/* Copyright (c) 1998, 1999, 2003, 2004  Lance Arsenault, (GNU GPL (v2+))
 */


class GraphsNotebook : public Notebook
{
public:

  GraphsNotebook(MainWindow *mainWindow_in);

  // call this to copy the graphs from one notebook to another.
  void copy(GraphsNotebook *graphNotebook);
  // internal use only.  Needs to be public foe gtk callback stuff.
  void _copyLater(GraphsNotebook *graphNotebook);
  
  // this overrides Gtk::Notebook::set_show_tabs() because we need it
  // to "signal" the View Menu in MainMenuBar.cpp, to add a runtime
  // "show/hide tabs option.  Is there a signal_show_tabs() or like
  // method???  It's not listed.
  void set_show_tabs(bool show_tabs = true);

  SigC::Signal1<void, Graph *> signal_tabLabelChanged(void);
  SigC::Signal1<void, Graph *> m_signal_tabLabelChanged;
  
private:
  MainWindow *mainWindow;
};

class Source;
class PlotLister;
class PlotConfig;
class GraphConfig;
class Graph;
class StatusBar;
class Plot;

// Class MainWindow: is managed by App.  Use App::createMainWindow(),
// App::destroyMainWindow() and the globel currentMainWindow.  Do not
// call delete mainWindow. That is called in App::destroyMainWindow().
// Do not call 'new MainWindow', that is called in
// App::createMainWindow().


class MainWindow: public Window
{
 public:
  
  MainWindow(bool makeGraph=true);
  virtual ~MainWindow(void);

  void show(void);

  // Optional Graph Configuration Window.
  GraphConfig *graphConfig;
  Graph *currentGraph;
  PlotLister *plotLister;
  GraphsNotebook graphsNotebook;

  void savePNGFile(void);
  
  void showGraphConfig(void);
  void showPlotLister(void);
  void makePlotConfig(Plot *plot);
  void deletePlotConfig(PlotConfig *plotConfig);

  // the number of MainWindows that have been created when this one
  // was created, including this one.  So the first one is 1.
  int mainWindowNumber;

  
  void deleteLater(void);
  
protected:
  
  bool on_focus_in_event(GdkEventFocus* event);
  
  // looks at the files loaded and sets the title.
  void setTitle(Source *); // slot
  
  bool on_expose_event(GdkEventExpose *e);
  
private:
  VBox mainVBox, topVBox;

public:

  bool commonKeyPress(GdkEventKey* event);

  // create statusBar before menuBar
  StatusBar statusBar;
  MainMenuBar menuBar;
  ButtonBar buttonBar;

  void on_help(void); // slot
  void on_about(void); // slot
  void on_license(void); // slot
  
  
  void makeNewGraphTab(void); // slot
  void removeGraphTab(Graph *graph);
  
  void makeNewGraphTabWithGraph(Graph *graph);
  void makeNewGraphWithGraphConfig(void);
  void on_notebookFlip(GtkNotebookPage* page, guint page_num); //slot

private:

  FileSelection *savePNGDialog;
  int graphTabAddCount;
  
  void on_removedPlot(Graph *graph, Plot *plot);
  
  int numPlotConfigs;
  PlotConfig *plotConfigs[NUMPLOTCONFIGS];
  int plotConfigXY[2][NUMPLOTCONFIGS];


  // used to set the start up window geometry.
  int startX, startY, startXSign, startYSign;

  bool on_key_press_event(GdkEventKey* event);
};