Ardour  9.0-pre0-350-gf17a656217
floating_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 <gtkmm/entry.h>
23 #include <gtkmm/window.h>
24 
26 {
27 public:
28  FloatingTextEntry (Gtk::Window* parent, const std::string& initial_contents);
29 
30  /* 1st argument to handler is the new text
31  * 2nd argument is 0, 1 or -1 to indicate:
32  * - do not move to next editable field
33  * - move to next editable field
34  * - move to previous editable field.
35  */
36  sigc::signal2<void,std::string,int> use_text;
37 
38 private:
41 
42  /* handlers for Entry events */
46  void activated ();
48  void changed ();
51 
52  std::list<sigc::connection> _connections;
53 
54  /* handlers for window events */
55 
56  void on_realize ();
57  void on_hide ();
58 };
59 
bool button_press(GdkEventButton *)
void on_hide()
This is a default handler for the signal signal_hide().
bool key_press(GdkEventKey *)
FloatingTextEntry(Gtk::Window *parent, const std::string &initial_contents)
sigc::signal2< void, std::string, int > use_text
bool key_release(GdkEventKey *)
bool entry_focus_out(GdkEventFocus *)
std::list< sigc::connection > _connections
void disconect_signals()
void on_realize()
This is a default handler for the signal signal_realize().