/[svn]/gigedit/trunk/src/dimregionchooser.h
ViewVC logotype

Annotation of /gigedit/trunk/src/dimregionchooser.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1092 - (hide annotations) (download) (as text)
Sun Mar 11 15:21:58 2007 UTC (17 years, 1 month ago) by persson
File MIME type: text/x-c++hdr
File size: 2551 byte(s)
* implemented editing of dimension region upper limits

1 persson 1052 /* -*- c++ -*-
2     * Copyright (C) 2006, 2007 Andreas Persson
3     *
4     * This program is free software; you can redistribute it and/or
5     * modify it under the terms of the GNU General Public License as
6     * published by the Free Software Foundation; either version 2, or (at
7     * your option) any later version.
8     *
9     * This program is distributed in the hope that it will be useful, but
10     * WITHOUT ANY WARRANTY; without even the implied warranty of
11     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12     * General Public License for more details.
13     *
14     * You should have received a copy of the GNU General Public License
15     * along with program; see the file COPYING. If not, write to the Free
16     * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
17     * 02110-1301 USA.
18     */
19    
20     #ifndef GIGEDIT_DIMREGIONCHOOSER_H
21     #define GIGEDIT_DIMREGIONCHOOSER_H
22    
23     #include <gtkmm/drawingarea.h>
24     #include <gdkmm/colormap.h>
25     #include <gdkmm/window.h>
26    
27     #include <gig.h>
28    
29     class DimRegionChooser : public Gtk::DrawingArea
30     {
31     public:
32     DimRegionChooser();
33     virtual ~DimRegionChooser();
34    
35     void set_fromto(int from, int to);
36    
37     void set_instrument(gig::Instrument* instrument);
38     void set_region(gig::Region* region);
39     // void set_dimregno(int x);
40    
41     sigc::signal<void> signal_sel_changed();
42    
43     gig::DimensionRegion* get_dimregion() { return dimreg; }
44    
45     protected:
46     virtual void on_realize();
47     virtual bool on_expose_event(GdkEventExpose* e);
48     virtual void on_size_request(GtkRequisition* requisition);
49     virtual bool on_button_press_event(GdkEventButton* event);
50 persson 1092 virtual bool on_button_release_event(GdkEventButton* event);
51     virtual bool on_motion_notify_event(GdkEventMotion* event);
52 persson 1052 virtual bool on_focus(Gtk::DirectionType direction);
53    
54     Glib::RefPtr<Gdk::GC> gc;
55     Gdk::Color blue, red, black, white, green;
56    
57     gig::Instrument* instrument;
58     gig::Region* region;
59     int dimregno;
60    
61     sigc::signal<void> sel_changed_signal;
62    
63     gig::DimensionRegion* dimreg;
64     int focus_line;
65     int dimvalue_from[256];
66     int dimvalue_to[256];
67 persson 1078 int label_width;
68 persson 1089 int nbDimensions;
69 persson 1092
70     // information needed during a resize
71     struct {
72     bool active;
73     enum {
74     none,
75     left,
76     right
77     } selected;
78     int pos;
79     int min;
80     int max;
81     int dimension;
82     int offset;
83     } resize;
84    
85     bool cursor_is_resize;
86     bool is_in_resize_zone(double x, double y);
87    
88     int h;
89     int w;
90 persson 1052 };
91    
92     #endif

  ViewVC Help
Powered by ViewVC