File: PlotSelector.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 (170 lines) | stat: -rw-r--r-- 2,982 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
/* Copyright (c) 1998, 1999, 2003, 2004  Lance Arsenault, (GNU GPL (v2+))
 */

class FieldButton;
class Source;
class PlotSelector;
class MainWindow;

#if 0
class SizingScrolledWindow: public ScrolledWindow
{
public:

  SizingScrolledWindow(Window *window,
                       Widget *child);
  
  void queueRedraw(bool needsResizing=true);

  
private:
  
  bool on_expose_event(GdkEventExpose *e);

  // returns 1 for needs more work, returns 0 for Okay.
  int checkSize(void);

  Window *window;
  Widget *child;

  int diffHeight, childHeight, oldWindowHeight, resizeCount;


  bool needsResizing;
};
#endif

class ConnectFieldsDrawingArea : public DrawingArea
{
public:
  ConnectFieldsDrawingArea(PlotSelector *ps);
  
  bool on_expose_event(GdkEventExpose*);
  
  void drawPlotLine(Plot *plot,
                    RadioButton *xRadioButton,
                    RadioButton *yRadioButton);

  void queueRedraw(void);

private:

  Glib::RefPtr<Gdk::Window> win;
  Glib::RefPtr<Gdk::GC> gc;
  Gdk::Color blobColor;


  PlotSelector *plotSelector;
};


extern "C"
{
  struct FixNoneButtons
  {
    PlotSelector *plotSelector;
  };
}


class PlotSelector : public VBox
{
public:
  
  PlotSelector(Window *graphConfig, MainWindow *mainWindow_in);
  virtual ~PlotSelector(void);
  
  std::list<FieldButton *> xFieldButtons;
  std::list<FieldButton *> yFieldButtons;
  std::list<Label *> labels;
 
  enum XY { X, Y};
  
  void radioButtonClicked(FieldButton *b);

  void queueRedraw(void);

protected:

  // We need to connect the signals after the widget is first drawn.
  virtual void on_map(void);
  
private:

  bool on_expose_event(GdkEventExpose *e);
  void on_addSource(Source *s);
  void on_removeSource(Source *s);

  RadioButton *newFieldButton(XY xy, Source *s, Field *f);

  Frame topLabelFrame;
  Label topLabel;
  
  HBox labelBox;
  Label xLabel, blankLabel, yLabel;
  HBox scrolledHBox;
  //SizingScrolledWindow scrolledWindow;
  
  ScrolledWindow scrolledWindow;
  
  VBox xBox, yBox;
  Frame xFrame, yFrame;
  RadioButton xNoneRadioButton, yNoneRadioButton;
  Frame drawAreaFrame;

public:

  ConnectFieldsDrawingArea drawArea;

  bool wasMapped;

private:
 
  int x,y;

    // make a new FieldButton and add it to the list.
  FieldButton *newFieldButton(XY XorY, Source *s,
                             Field *f, const char *label);

  Frame *newSourceButtons(XY xy, Source *s);

  void deleteWidgetChildren(Container *c);

  void on_notebookFlip(GtkNotebookPage* , guint );

  bool fixNoneButtons;

  MainWindow *mainWindow;

  friend class ConnectFieldsDrawingArea;
};


class FieldButton : public RadioButton
{
public:

  FieldButton(PlotSelector *ps,
              PlotSelector::XY xy, Source *s,
              Field *f, const char *label);
  
  void clicked(void);

  PlotSelector::XY xory;

  PlotSelector *plotSelector;
  Source *source;
  Field *field;

};

class SourceFrame : public Frame
{
public:

  SourceFrame(Source *s);

  Source *source;
};