mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-08 07:45:00 +01:00
Add text control type for LuaDialog, based on Gtk::TextView
This commit is contained in:
parent
a76d4b4c82
commit
1155da84dd
1 changed files with 35 additions and 0 deletions
|
|
@ -591,6 +591,35 @@ protected:
|
||||||
Gtk::FileChooserWidget _fc;
|
Gtk::FileChooserWidget _fc;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class LuaDialogText : public LuaDialogWidget
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
LuaDialogText (std::string const& key, std::string const& title, std::string const& dflt)
|
||||||
|
: LuaDialogWidget (key, title)
|
||||||
|
{
|
||||||
|
_text_view.set_wrap_mode (Gtk::WRAP_WORD);
|
||||||
|
_text_view.get_buffer()->set_text (dflt);
|
||||||
|
|
||||||
|
_scrolled_window.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
|
||||||
|
|
||||||
|
_scrolled_window.add(_text_view);
|
||||||
|
}
|
||||||
|
|
||||||
|
Gtk::Widget* widget ()
|
||||||
|
{
|
||||||
|
return &_scrolled_window;
|
||||||
|
}
|
||||||
|
|
||||||
|
void assign (luabridge::LuaRef* rv) const
|
||||||
|
{
|
||||||
|
(*rv)[_key] = std::string (_text_view.get_buffer()->get_text());
|
||||||
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
Gtk::TextView _text_view;
|
||||||
|
Gtk::ScrolledWindow _scrolled_window;
|
||||||
|
};
|
||||||
|
|
||||||
/* *****************************************************************************
|
/* *****************************************************************************
|
||||||
* Lua Parameter Dialog
|
* Lua Parameter Dialog
|
||||||
*/
|
*/
|
||||||
|
|
@ -659,6 +688,12 @@ Dialog::Dialog (std::string const& title, luabridge::LuaRef lr)
|
||||||
dflt = i.value ()["default"].cast<std::string> ();
|
dflt = i.value ()["default"].cast<std::string> ();
|
||||||
}
|
}
|
||||||
w = new LuaDialogEntry (key, title, dflt);
|
w = new LuaDialogEntry (key, title, dflt);
|
||||||
|
} else if (type == "textarea") {
|
||||||
|
std::string dflt;
|
||||||
|
if (i.value ()["default"].isString ()) {
|
||||||
|
dflt = i.value ()["default"].cast<std::string> ();
|
||||||
|
}
|
||||||
|
w = new LuaDialogText (key, title, dflt);
|
||||||
} else if (type == "radio") {
|
} else if (type == "radio") {
|
||||||
std::string dflt;
|
std::string dflt;
|
||||||
if (!i.value ()["values"].isTable ()) {
|
if (!i.value ()["values"].isTable ()) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue