Ardour  9.0-pre0-1699-gfaebc7ab35
automation_text_entry.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014-2016 Paul Davis <paul@linuxaudiosystems.com>
3  * Copyright (C) 2017 Robin Gareus <robin@gareus.org>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #pragma once
21 
22 #include <ytkmm/entry.h>
23 #include <ytkmm/window.h>
24 
26 {
27 public:
28  AutomationTextEntry (Gtk::Window* parent, std::string const& initial_contents);
30 
31  /* 1st argument to handler is the new text
32  * 2nd argument is 0, 1 or -1 to indicate:
33  * - do not move to next editable field
34  * - move to next editable field
35  * - move to previous editable field.
36  */
37  sigc::signal2<void,std::string,int> use_text;
39  sigc::signal1<void,AutomationTextEntry*> going_away;
40 
41  /* grabs focus to be setup for editing */
42  void activate_entry ();
43 
44 private:
48 
49  /* handlers for Entry events */
54  void activated ();
56  void changed ();
59 
60  std::list<sigc::connection> _connections;
61 
62  /* handlers for window events */
63 
64  void on_realize ();
65  void on_hide ();
66 
67  void split_units (std::string const &, std::string & numeric_part, std::string & units_part);
68 };
69 
std::list< sigc::connection > _connections
bool key_release(GdkEventKey *)
sigc::signal2< void, std::string, int > use_text
bool button_press(GdkEventButton *)
void on_realize()
This is a default handler for the signal signal_realize().
bool entry_focus_in(GdkEventFocus *)
void split_units(std::string const &, std::string &numeric_part, std::string &units_part)
bool key_press(GdkEventKey *)
void on_hide()
This is a default handler for the signal signal_hide().
bool entry_focus_out(GdkEventFocus *)
AutomationTextEntry(Gtk::Window *parent, std::string const &initial_contents)
sigc::signal1< void, AutomationTextEntry * > going_away