diff options
author | David Robillard <d@drobilla.net> | 2011-03-17 06:32:50 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-03-17 06:32:50 +0000 |
commit | 08a6a9058d114a3208f5304799e2c84576e52f90 (patch) | |
tree | 87d103383c852535c63105d89fa27d906779f313 /src/gui/Port.cpp | |
parent | 69191cb00b87c5fda9e65d592a3b73ce80da9b0e (diff) | |
download | ingen-08a6a9058d114a3208f5304799e2c84576e52f90.tar.gz ingen-08a6a9058d114a3208f5304799e2c84576e52f90.tar.bz2 ingen-08a6a9058d114a3208f5304799e2c84576e52f90.zip |
Show plugin/port documentation in side pane when selected.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3103 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui/Port.cpp')
-rw-r--r-- | src/gui/Port.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/gui/Port.cpp b/src/gui/Port.cpp index 4102a52c..949e459d 100644 --- a/src/gui/Port.cpp +++ b/src/gui/Port.cpp @@ -253,6 +253,30 @@ Port::dash() return _dash; } +void +Port::set_selected(bool b) +{ + if (b != selected()) { + FlowCanvas::Port::set_selected(b); + SharedPtr<PortModel> pm = _port_model.lock(); + if (pm && b) { + const App& app = App::instance(); + SharedPtr<NodeModel> node = PtrCast<NodeModel>(pm->parent()); + PatchWindow* win = app.window_factory()->parent_patch_window(node); + if (win) { + const std::string& doc = node->plugin_model()->port_documentation( + pm->index()); + if (!doc.empty()) { + win->doc_textview()->get_buffer()->set_text(doc); + win->doc_textview()->show(); + } else { + win->doc_textview()->hide(); + } + } + } + } +} + } // namespace GUI } // namespace Ingen |