26 GtkWidget *
title = gtk_label_new(
"");
27 gtk_label_set_markup(GTK_LABEL(title),
view->
getString(
"DecisionTitle"));
29 TabAdd(gtk_hseparator_new());
35 GtkWidget *hbox_decision = gtk_hbox_new(
false, 0);
37 this->updating_view =
false;
38 this->num_decision = 0;
39 this->selected_decision =
"";
40 combo_decision = gtk_combo_box_new_text();
43 gtk_combo_box_set_active(GTK_COMBO_BOX(combo_decision),0);
44 g_signal_connect(G_OBJECT(combo_decision),
46 G_CALLBACK(CB_ChangeDecision),
49 gtk_box_pack_start(GTK_BOX(hbox_decision), combo_decision,
false,
false, 0);
54 panel_box = gtk_hbox_new(
false, 0);
63 if(gtk_combo_box_get_active(GTK_COMBO_BOX(combo_decision))==-1)
64 gtk_combo_box_set_active(GTK_COMBO_BOX(combo_decision),0);
74 this->updating_view =
true;
84 this->selected_decision = model_selected_decision;
85 this->decision_names = names;
86 for(
int i = this->num_decision-1; i >= 0; i--)
88 gtk_combo_box_remove_text(GTK_COMBO_BOX(combo_decision),i);
90 this->num_decision = names.size();
93 for(
unsigned int i=0;i<names.size();i++)
95 gtk_combo_box_append_text(GTK_COMBO_BOX(combo_decision),names[i].c_str());
96 if(names[i]==model_selected_decision)
98 gtk_combo_box_set_active(GTK_COMBO_BOX(combo_decision),i);
103 if (this->panel != NULL)
105 gtk_container_remove(GTK_CONTAINER(this->panel_box),this->panel->
getContainer());
111 if(model_selected_decision !=
"")
115 std::map<std::string, CEBL::Param> params = model->
decisionGetParams(model_selected_decision);
121 cerr <<
"ERROR: exception occured when trying to get parameters for decision.\n";
124 if (this->panel != NULL)
126 gtk_container_add(GTK_CONTAINER(this->panel_box),this->panel->
getContainer());
127 gtk_widget_show_all(this->panel_box);
132 this->updating_view =
false;
139 if(this->panel != NULL){
155 void TabDecision::CB_ChangeDecision(GtkWidget *w, gpointer data)
162 if(tab->num_decision > 0 && !tab->updating_view)
164 string decision = gtk_combo_box_get_active_text(GTK_COMBO_BOX(tab->combo_decision));
167 if(decision != tab->selected_decision)
170 if(tab->panel != NULL){
180 cerr <<
"Error selecting decision.\n";