Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00033
00034 #pragma once
00035
00036 #include "../api_gui.h"
00037 #include "../gui_component.h"
00038 #include "../../Core/Signals/callback_v0.h"
00039 #include "../../Core/Signals/callback_v1.h"
00040 #include "../../Core/Signals/callback_1.h"
00041
00042 class CL_Sprite;
00043 class CL_ComboBox_Impl;
00044 class CL_PopupMenu;
00045
00049 class CL_API_GUI CL_ComboBox : public CL_GUIComponent
00050 {
00053 public:
00057 CL_ComboBox(CL_GUIComponent *parent);
00058
00059 virtual ~CL_ComboBox();
00060
00064 public:
00065 using CL_GUIComponent::get_named_item;
00066
00070 static CL_ComboBox *get_named_item(CL_GUIComponent *reference_component, const CL_StringRef &id);
00071
00075 bool is_editable() const;
00076
00080 int get_dropdown_height() const;
00081
00085 int get_selected_item() const;
00086
00090 CL_StringRef get_text() const;
00091
00097 CL_StringRef get_item(int index) const;
00098
00102 public:
00106 void set_editable(bool enable = true);
00107
00111 void set_dropdown_height(int height);
00112
00116 void set_dropdown_minimum_width(int min_width);
00117
00121 void set_text(const CL_StringRef &text);
00122
00126 void set_selected_item(int index);
00127
00131 void set_popup_menu(CL_PopupMenu &menu);
00132
00136 public:
00140 CL_Callback_v0 &func_dropdown_opened();
00141
00145 CL_Callback_v0 &func_dropdown_closed();
00146
00150 CL_Callback_v0 &func_enter_pressed();
00151
00155 CL_Callback_v0 &func_before_edit_changed();
00156
00160 CL_Callback_v0 &func_after_edit_changed();
00161
00165 CL_Callback_v1<int> &func_item_selected();
00166
00170 CL_Callback_v1<int> &func_selection_changed();
00171
00175 private:
00176 CL_SharedPtr<CL_ComboBox_Impl> impl;
00178 };
00179