17#ifndef YWidgetActionHandler_h
18#define YWidgetActionHandler_h
22#include <microhttpd.h>
24#include <boost/algorithm/string.hpp>
26#define TreePathDelimiter "|"
27#define ShortcutChar "&"
29#include <yui/YCheckBoxFrame.h>
30#include <yui/YComboBox.h>
31#include <yui/YDateField.h>
32#include <yui/YInputField.h>
34#include <yui/YMenuItem.h>
35#include <yui/YMultiSelectionBox.h>
36#include <yui/YRadioButton.h>
37#include <yui/YSelectionBox.h>
38#include <yui/YTimeField.h>
39#include <yui/YWidget.h>
41#include "YHttpHandler.h"
42#include "YWidgetFinder.h"
79 template<
typename T,
typename I >
81 selector->activateItem( item );
84 virtual void activate_widget( YMultiSelectionBox * widget, YItem * item ) {};
87 std::function<void (T*)> get_item_selector_handler( T *widget,
const std::string &value,
const int state = -1 ) {
88 return [&] (T *selector) {
89 YItem * item = selector->findItem( value );
92 selector->setKeyboardFocus();
94 bool select = state < 0 ? !item->selected() : (state != 0);
97 select = !item->selected();
101 select = (state != 0);
103 item->setSelected( select );
104 selector->selectItem( item, select );
109 throw YUIException(
"Item: '" + value +
"' cannot be found in the item selector widget");
117 static std::string normalize_label(
const std::string & label);
120 static bool normalized_labels_equal(
const std::string & a,
const std::string & b)
122 std::string na = normalize_label(a);
123 std::string nb = normalize_label(b);