Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
timeline-zoom-scale.cpp
Go to the documentation of this file.
1/*
2 TimelineZoomScale - widget to control timeline zoom scale
3
4 Copyright (C)
5 2011, Michael R. Fisher <mfisher31@gmail.com>
6
7  **Lumiera** is free software; you can redistribute it and/or modify it
8  under the terms of the GNU General Public License as published by the
9  Free Software Foundation; either version 2 of the License, or (at your
10  option) any later version. See the file COPYING for further details.
11
12* *****************************************************************/
13
14
25
26
27namespace stage {
28namespace widget {
29
49 : HBox()
50 , adjustment(Gtk::Adjustment::create(0.5, 0.0, 1.0, 0.000001))
51 , slider()
52 , zoomIn(Gtk::Stock::ZOOM_IN)
53 , zoomOut(Gtk::Stock::ZOOM_OUT)
54 , button_step_size(0.03)
55 {
56 /* Setup the Slider Control */
57 slider.set_adjustment (adjustment);
58 slider.set_size_request (123,10);
59 slider.set_digits (6);
60
61 /* Inverted because smaller values "zoom in" */
62 slider.set_inverted (true);
63
64 slider.set_draw_value (false);
65
66 /* Make our connections */
67 zoomIn.signal_clicked().
68 connect (sigc::mem_fun(this, &TimelineZoomScale::on_zoom_in_clicked));
69 zoomOut.signal_clicked().
70 connect (sigc::mem_fun(this, &TimelineZoomScale::on_zoom_out_clicked));
71 adjustment->signal_value_changed().
72 connect (sigc::mem_fun(this, &TimelineZoomScale::on_zoom));
73
74 /* Add Our Widgets and show them */
75 pack_start (zoomOut,Gtk::PACK_SHRINK);
76 pack_start (slider, Gtk::PACK_SHRINK);
77 pack_start (zoomIn, Gtk::PACK_SHRINK);
78
79 show_all();
80 }
81
82
83 void
84 TimelineZoomScale::wireTimelineState (/* TODO what to pass here? */)
85 {
86// stateChangeSignal.connect (
87// sigc::mem_fun(this, &TimelineZoomScale::on_timeline_state_changed));
88 }
89
90
91 void
92 TimelineZoomScale::on_timeline_state_changed (/* TODO what to pass here? */)
93 {
94// adjustment->set_value (/* TODO how to represent the statte? */);
95 }
96
97
98 void
100 {
101 double newValue = adjustment->get_value() - button_step_size;
102 adjustment->set_value(newValue);
103 }
104
105
106 void
108 {
109 double newValue = adjustment->get_value() + button_step_size;
110 adjustment->set_value(newValue);
111 }
112
113
114 void
116 {
117 zoomSignal.emit (adjustment->get_value());
118 }
119
120
121 sigc::signal<void, double>
126
127
128}}// namespace stage::widget
void on_zoom()
Event handler for when the adjustment value is changed.
Glib::RefPtr< Gtk::Adjustment > adjustment
void on_zoom_in_clicked()
Event handler for when the zoomIn Button is clicked.
sigc::signal< void, double > signal_zoom()
TimelineZoomScale()
A widget to control the timeline zoom state.
void on_timeline_state_changed()
Update the slider position when the timeline state is changed.
sigc::signal< void, double > zoomSignal
void on_zoom_out_clicked()
Event handler for when the zoomIn Button is clicked.
Lumiera GTK UI implementation root.
Definition guifacade.cpp:37
Widget to control timeline zoom scale.