diff options
author | Robin Gareus <robin@gareus.org> | 2017-08-19 03:12:28 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2017-08-19 03:12:28 +0200 |
commit | 91a2cf79014812f75b49f65b0c9c29952d8784eb (patch) | |
tree | 1467bf0c5a82ee64cf357781d0216572af1ba3b9 /gtk2_ardour/luadialog.h | |
parent | d3b341d5c242755d4fa69463d36c78f861856045 (diff) |
Backwards compatible LuaDialog layout (+new colspan option)
Diffstat (limited to 'gtk2_ardour/luadialog.h')
-rw-r--r-- | gtk2_ardour/luadialog.h | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/gtk2_ardour/luadialog.h b/gtk2_ardour/luadialog.h index 16ee513199..a022a8b6f6 100644 --- a/gtk2_ardour/luadialog.h +++ b/gtk2_ardour/luadialog.h @@ -53,24 +53,31 @@ private: class LuaDialogWidget { public: - LuaDialogWidget (std::string const& key, std::string const& label, int col = 0) - : _key (key), _label (label), _col (col) - {} + LuaDialogWidget (std::string const& key, std::string const& label, int col = 0, int colspan = -1) + : _key (key), _label (label), _col (col), _colspan (colspan) + { + if (_colspan < 0) { + _colspan = label.empty () ? 1 : 2; + } + } virtual ~LuaDialogWidget () {} virtual Gtk::Widget* widget () = 0; virtual void assign (luabridge::LuaRef* rv) const = 0; std::string const& label () const { return _label; } - std::string const& key () const { return _key; } - int const& col () const { return _col; } + std::string const& key () const { return _key; } + int col () const { return _col; } + int span () const { return _colspan; } - void set_col (int col) { _col = col; } + void set_col (int col) { _col = col; } + void set_span (int span) { _colspan = span; } protected: std::string _key; std::string _label; int _col; + int _colspan; }; |