Navigation

Main Page
Download
Support
Installation
Tutorial
Examples
Reference Manual
   Version 1.0.6
      Class Index
      File List
   Version 1.0.5new_solver
   Version 1.0.5dev
   Version 1.0.5b
   Version 1.0.4dev
   Version 1.0.4
Publications


Hosted by Get Ion Beam Simulator at SourceForge.net. Fast, secure and Free Open Source software downloads
gtkframewindow.hpp
Go to the documentation of this file.
1 
5 /* Copyright (c) 2005-2013 Taneli Kalvas. All rights reserved.
6  *
7  * You can redistribute this software and/or modify it under the terms
8  * of the GNU General Public License as published by the Free Software
9  * Foundation; either version 2 of the License, or (at your option)
10  * any later version.
11  *
12  * This library is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this library (file "COPYING" included in the package);
19  * if not, write to the Free Software Foundation, Inc., 51 Franklin
20  * Street, Fifth Floor, Boston, MA 02110-1301 USA
21  *
22  * If you have questions about your rights to use or distribute this
23  * software, please contact Berkeley Lab's Technology Transfer
24  * Department at TTD@lbl.gov. Other questions, comments and bug
25  * reports should be sent directly to the author via email at
26  * taneli.kalvas@jyu.fi.
27  *
28  * NOTICE. This software was developed under partial funding from the
29  * U.S. Department of Energy. As such, the U.S. Government has been
30  * granted for itself and others acting on its behalf a paid-up,
31  * nonexclusive, irrevocable, worldwide license in the Software to
32  * reproduce, prepare derivative works, and perform publicly and
33  * display publicly. Beginning five (5) years after the date
34  * permission to assert copyright is obtained from the U.S. Department
35  * of Energy, and subject to any subsequent five (5) year renewals,
36  * the U.S. Government is granted for itself and others acting on its
37  * behalf a paid-up, nonexclusive, irrevocable, worldwide license in
38  * the Software to reproduce, prepare derivative works, distribute
39  * copies to the public, perform publicly and display publicly, and to
40  * permit others to do so.
41  */
42 
43 #ifndef GTKFRAMEWINDOW_HPP
44 #define GTKFRAMEWINDOW_HPP 1
45 
46 
47 #include <cairo.h>
48 #include <gtk/gtk.h>
49 #include "gtkwindow.hpp"
50 #include "gtkplotter.hpp"
51 #include "frame.hpp"
52 #include "graph3d.hpp"
53 
54 
55 
61 class GTKFrameWindow : public GTKWindow {
62 
63  size_t _width;
64  size_t _height;
65 
66  GtkWidget *_trackwindow;
67  GtkWidget *_tracklabel;
68 
69  cairo_t *_cairo;
70  cairo_surface_t *_surface;
71 
72  int _start[2];
73  int _end[2];
74  int _tool;
75 
76  void hardcopy( void );
77  void move( int action, double x, double y );
78  void track( int action, double x, double y );
79  void zoom_out( double x, double y );
80  void zoom_in( double x, double y );
81  void zoom_window( int action, double x, double y );
82 
83  void darea_motion( GdkEventMotion *event );
84  void darea_enter( GdkEventCrossing *event );
85  void darea_leave( GdkEventCrossing *event );
86  void darea_button( GdkEventButton *event );
87 
88  void configure( void );
89  void delete_window( void );
90 
91  void menuitem_tool_change( GtkToolButton *button );
92  void menuitem_preferences( GtkMenuItem *menuitem );
93 
94  void frame_draw( void );
95 
96  static gboolean window_delete_signal( GtkWidget *widget,
97  GdkEventExpose *event,
98  gpointer object );
99 
100  static void menuitem_quit_signal( GtkMenuItem *menuitem,
101  gpointer object );
102  static void menuitem_tool_change_signal( GtkToolButton *button,
103  gpointer object );
104  static void menuitem_hardcopy_signal( GtkToolButton *button,
105  gpointer object );
106  static void menuitem_zoom_fit_signal( GtkToolButton *button,
107  gpointer object );
108  static void menuitem_preferences_signal( GtkMenuItem *menuitem,
109  gpointer object );
110 
111  static gboolean darea_configure_signal( GtkWidget *widget,
112  GdkEventConfigure *event,
113  gpointer object );
114  static gboolean darea_draw_signal( GtkWidget *widget,
115  cairo_t *cairo,
116  gpointer object );
117  static gboolean darea_button_signal( GtkWidget *widget,
118  GdkEventButton *event,
119  gpointer object );
120  static gboolean darea_motion_signal( GtkWidget *widget,
121  GdkEventMotion *event,
122  gpointer object );
123  static gboolean darea_enter_signal( GtkWidget *widget,
124  GdkEventCrossing *event,
125  gpointer object );
126  static gboolean darea_leave_signal( GtkWidget *widget,
127  GdkEventCrossing *event,
128  gpointer object );
129 
130 protected:
131 
132  GTKPlotter &_plotter;
133 
134  Frame _frame;
135  GtkWidget *_window;
136  GtkWidget *_darea;
137  GtkWidget *_menubar;
138  GtkWidget *_menu_file;
139  GtkWidget *_toolbar;
140  GtkWidget *_statusbar;
141 
142  GtkToolItem *_radioitem;
143 
144  double _track_px; // Track x coordinate in pixels
145  double _track_py; // Track y coordinate in pixels
146 
147 
148  GTKFrameWindow( GTKPlotter &plotter );
149 
150  virtual void zoom_fit( void );
151 
157  virtual std::string track_text( double x, double y );
158 
159  void draw( cairo_t *cairo );
160  void expose( int x, int y, int width, int height );
161 
162 public:
163 
166  virtual ~GTKFrameWindow();
167 
168  virtual void *build_preferences( GtkWidget *notebook );
169  virtual void read_preferences( GtkWidget *notebook, void *pdata );
170 
171  void draw_and_expose( void );
172  void show( void );
173 };
174 
175 
176 #endif
Window for GTK plots.
Frame for plots
GTK Plotter class.
Definition: gtkplotter.hpp:66
virtual std::string track_text(double x, double y)
Function which providies tracking text at (x,y)
Definition: gtkframewindow.cpp:324
virtual ~GTKFrameWindow()
Destructor.
Definition: gtkframewindow.cpp:236
Base class for interactive plotters.
Definition: gtkwindow.hpp:49
Base for three dimensional plottable graphs.
GTK based plotters.
General purpose plotter frame for cairographics surfaces.
Definition: frame.hpp:107
Base class for interactive plotters.
Definition: gtkframewindow.hpp:61


Reference manual for Ion Beam Simulator 1.0.6
Generated by Doxygen 1.8.5 on Mon Jun 15 2015 09:59:32.