Ardour
9.0-pre0-582-g084a23a80d
prompter.h
Go to the documentation of this file.
1
/*
2
* Copyright (C) 1999 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
#ifndef _WIDGETS_PROMPTER_H_
21
#define _WIDGETS_PROMPTER_H_
22
23
#include <string>
24
#include <
gtkmm/box.h
>
25
#include <
gtkmm/button.h
>
26
#include <
gtkmm/entry.h
>
27
#include <
gtkmm/label.h
>
28
#include <
gtkmm/dialog.h
>
29
#include <sigc++/sigc++.h>
30
31
#include "
widgets/visibility.h
"
32
33
namespace
Gtk
{
34
class
Window
;
35
}
36
37
namespace
ArdourWidgets
{
38
39
class
LIBWIDGETS_API
Prompter
:
public
Gtk::Dialog
40
{
41
public
:
42
Prompter
(
bool
modal =
false
,
bool
with_cancel_button =
true
);
43
Prompter
(
Gtk::Window
& parent,
bool
modal =
false
,
bool
with_cancel_button =
true
);
44
~Prompter
() {};
45
46
void
set_prompt
(std::string prompt) {
47
entryLabel.set_label (prompt);
48
}
49
50
void
set_initial_text
(std::string txt,
bool
allow_replace =
false
);
51
void
set_default_text
(std::string
const
& txt);
52
53
void
change_labels
(std::string ok, std::string cancel);
54
55
void
get_result
(std::string &str,
bool
strip=
true
);
56
void
set_allow_empty
(
bool
yn =
true
);
57
58
protected
:
59
Gtk::Entry
&
the_entry
() {
return
entry; }
60
61
void
on_entry_changed
();
62
void
on_show
();
63
64
private
:
65
Gtk::Entry
entry
;
66
Gtk::HBox
entryBox
;
67
Gtk::Label
entryLabel
;
68
Gtk::Button
resetButton
;
69
bool
first_show
;
70
bool
can_accept_from_entry
;
71
bool
allow_empty
;
72
std::string
default_text
;
73
74
void
init
(
bool
with_cancel);
75
void
entry_activated
();
76
};
77
78
}
/* namespace */
79
80
#endif
ArdourWidgets::Prompter
Definition:
prompter.h:40
ArdourWidgets::Prompter::set_default_text
void set_default_text(std::string const &txt)
ArdourWidgets::Prompter::on_show
void on_show()
This is a default handler for the signal signal_show().
ArdourWidgets::Prompter::init
void init(bool with_cancel)
ArdourWidgets::Prompter::change_labels
void change_labels(std::string ok, std::string cancel)
ArdourWidgets::Prompter::entryBox
Gtk::HBox entryBox
Definition:
prompter.h:66
ArdourWidgets::Prompter::Prompter
Prompter(bool modal=false, bool with_cancel_button=true)
ArdourWidgets::Prompter::set_allow_empty
void set_allow_empty(bool yn=true)
ArdourWidgets::Prompter::first_show
bool first_show
Definition:
prompter.h:69
ArdourWidgets::Prompter::entry_activated
void entry_activated()
ArdourWidgets::Prompter::on_entry_changed
void on_entry_changed()
ArdourWidgets::Prompter::resetButton
Gtk::Button resetButton
Definition:
prompter.h:68
ArdourWidgets::Prompter::allow_empty
bool allow_empty
Definition:
prompter.h:71
ArdourWidgets::Prompter::the_entry
Gtk::Entry & the_entry()
Definition:
prompter.h:59
ArdourWidgets::Prompter::default_text
std::string default_text
Definition:
prompter.h:72
ArdourWidgets::Prompter::entry
Gtk::Entry entry
Definition:
prompter.h:65
ArdourWidgets::Prompter::~Prompter
~Prompter()
Definition:
prompter.h:44
ArdourWidgets::Prompter::entryLabel
Gtk::Label entryLabel
Definition:
prompter.h:67
ArdourWidgets::Prompter::set_prompt
void set_prompt(std::string prompt)
Definition:
prompter.h:46
ArdourWidgets::Prompter::can_accept_from_entry
bool can_accept_from_entry
Definition:
prompter.h:70
ArdourWidgets::Prompter::Prompter
Prompter(Gtk::Window &parent, bool modal=false, bool with_cancel_button=true)
ArdourWidgets::Prompter::get_result
void get_result(std::string &str, bool strip=true)
ArdourWidgets::Prompter::set_initial_text
void set_initial_text(std::string txt, bool allow_replace=false)
Gtk::Button
Definition:
tk/ytkmm/ytkmm/gtkmm/button.h:60
Gtk::Dialog
Definition:
dialog.h:126
Gtk::Entry
Definition:
entry.h:101
Gtk::HBox
Definition:
tk/ytkmm/ytkmm/gtkmm/box.h:588
Gtk::Label
Definition:
label.h:55
Gtk::Window
Definition:
ytkmm/ytkmm/gtkmm/window.h:159
Window
Definition:
Window.h:41
dialog.h
entry.h
label.h
ArdourWidgets
Definition:
ardour_ui.h:192
Gtk
Definition:
ardour_ui.h:188
box.h
button.h
visibility.h
LIBWIDGETS_API
#define LIBWIDGETS_API
Definition:
widgets/widgets/visibility.h:39
libs
widgets
widgets
prompter.h
Generated on Wed Dec 25 2024 05:44:45 for Ardour by
1.9.1