TestControl: retrieve action arguments from the dialog controls
...and this also demonstrates how action code will typically be arranged within such a dialog page
This commit is contained in:
parent
10b9abd79b
commit
6b941b2c1e
2 changed files with 27 additions and 9 deletions
|
|
@ -47,6 +47,7 @@
|
|||
#include "lib/nocopy.hpp"
|
||||
|
||||
#include <utility>
|
||||
#include <string> /////////TODO
|
||||
|
||||
#if true /////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1099 : WIP-WIP-WIP
|
||||
namespace proc {
|
||||
|
|
@ -60,6 +61,7 @@ namespace proc {
|
|||
namespace gui {
|
||||
namespace dialog {
|
||||
|
||||
using std::string; ////////////TODO
|
||||
using std::forward;
|
||||
using lib::diff::GenNode;
|
||||
|
||||
|
|
@ -177,6 +179,13 @@ namespace dialog {
|
|||
Gtk::Box markParam_;
|
||||
Gtk::ComboBoxText actionID_{true}; // has free-text entry field
|
||||
|
||||
string
|
||||
getLogLevel()
|
||||
{
|
||||
return level_info_.get_active()? "NOTE_INFO" :
|
||||
level_warn_.get_active()? "NOTE_WARN" : "NOTE_ERROR";
|
||||
}
|
||||
|
||||
Page1(Bus bus)
|
||||
{
|
||||
content_.set_tooltip_markup (_("<b>Ticket #1099</b>:\n"
|
||||
|
|
@ -187,8 +196,6 @@ namespace dialog {
|
|||
trig_1_.set_label ("_display text");
|
||||
trig_1_.set_tooltip_markup (_("Trigger Proc-GUI <b>roundtrip</b>\n"
|
||||
"Proc invokes GuiNotification::displayInfo"));
|
||||
trig_1_.signal_clicked().connect(
|
||||
[&]{ demoGuiRoundtrip(bus); });
|
||||
|
||||
level_warn_.join_group(level_info_);
|
||||
level_erro_.join_group(level_info_);
|
||||
|
|
@ -225,7 +232,6 @@ namespace dialog {
|
|||
markParam_.pack_start(trig_4_);
|
||||
markParam_.pack_start(actionID_, Gtk::PACK_SHRINK);
|
||||
|
||||
|
||||
seg_1_.pack_start (trig_1_, Gtk::PACK_EXPAND_WIDGET);
|
||||
seg_1_.pack_start (level_info_, Gtk::PACK_SHRINK);
|
||||
seg_1_.pack_start (level_warn_, Gtk::PACK_SHRINK);
|
||||
|
|
@ -238,14 +244,24 @@ namespace dialog {
|
|||
pack_start (content_);
|
||||
pack_start (seg_1_);
|
||||
pack_start (seg_2_);
|
||||
|
||||
// define the action triggers...
|
||||
trig_1_.signal_clicked().connect(
|
||||
[&]{ demoGuiRoundtrip(bus, "displayInfo("+getLogLevel()+", \""+content_.get_text()+"\")"); });
|
||||
trig_2_.signal_clicked().connect(
|
||||
[&]{ demoGuiRoundtrip(bus, "markError(\""+content_.get_text()+"\")"); });
|
||||
trig_3_.signal_clicked().connect(
|
||||
[&]{ demoGuiRoundtrip(bus, "markNote(\""+content_.get_text()+"\")"); });
|
||||
trig_4_.signal_clicked().connect(
|
||||
[&]{ demoGuiRoundtrip(bus, "mark("+actionID_.get_entry_text()+", \""+content_.get_text()+"\")"); });
|
||||
}
|
||||
|
||||
void
|
||||
demoGuiRoundtrip (Bus bus)
|
||||
demoGuiRoundtrip (Bus bus, string placeholder)
|
||||
{
|
||||
TODO ("collect command arguments and then send the command message for #1099");
|
||||
ID errorLogID = proc::asset::meta::theErrorLog_ID;
|
||||
bus.mark (errorLogID, GenNode{"Message", "Lalü"});
|
||||
bus.mark (errorLogID, GenNode{"Message", placeholder});
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -2788,19 +2788,21 @@
|
|||
</node>
|
||||
<node COLOR="#338800" CREATED="1537836579647" ID="ID_951515368" MODIFIED="1537848122882" TEXT="Pling!">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
<node COLOR="#338800" CREATED="1537972817468" FOLDED="true" ID="ID_443954725" MODIFIED="1537977645522" TEXT="direkt den UI-Bus ansprechen">
|
||||
<node COLOR="#338800" CREATED="1537972817468" FOLDED="true" ID="ID_443954725" MODIFIED="1538176841339" TEXT="direkt den UI-Bus ansprechen">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
<node BACKGROUND_COLOR="#fdfdcf" COLOR="#ff0000" CREATED="1537973078631" ID="ID_476903403" MODIFIED="1537973140285" TEXT="*** first tangible action sent via UI-Bus ***">
|
||||
<font NAME="SansSerif" SIZE="28"/>
|
||||
<icon BUILTIN="yes"/>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#fdfdcf" COLOR="#ff0000" CREATED="1537848127378" ID="ID_1206004" MODIFIED="1537848141916" TEXT="Argument-Werte abgreifen">
|
||||
<icon BUILTIN="flag-pink"/>
|
||||
<node COLOR="#338800" CREATED="1537848127378" ID="ID_1206004" MODIFIED="1538176894784" TEXT="Argument-Werte abgreifen">
|
||||
<arrowlink COLOR="#47ebbb" DESTINATION="ID_1745090225" ENDARROW="Default" ENDINCLINATION="119;0;" ID="Arrow_ID_372783230" STARTARROW="None" STARTINCLINATION="-10;35;"/>
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1533689243871" ID="ID_1745090225" MODIFIED="1537834968776" TEXT="triggert Dummy-Command">
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1533689243871" ID="ID_1745090225" MODIFIED="1538176877674" TEXT="triggert Dummy-Command">
|
||||
<linktarget COLOR="#47ebbb" DESTINATION="ID_1745090225" ENDARROW="Default" ENDINCLINATION="119;0;" ID="Arrow_ID_372783230" SOURCE="ID_1206004" STARTARROW="None" STARTINCLINATION="-10;35;"/>
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1533689255174" ID="ID_821013695" MODIFIED="1537835685388" TEXT="Aufruf via Notification_Facade">
|
||||
|
|
|
|||
Loading…
Reference in a new issue