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:
00068 bool is_editable() const;
00069
00073 int get_dropdown_height() const;
00074
00078 int get_selected_item() const;
00079
00083 CL_StringRef get_text() const;
00084
00090 CL_StringRef get_item(int index) const;
00091
00095 public:
00099 void set_editable(bool enable = true);
00100
00104 void set_dropdown_height(int height);
00105
00109 void set_dropdown_minimum_width(int min_width);
00110
00114 void set_text(const CL_StringRef &text);
00115
00119 void set_selected_item(int index);
00120
00124 void set_popup_menu(CL_PopupMenu &menu);
00125
00129 public:
00133 CL_Callback_v0 &func_dropdown_opened();
00134
00138 CL_Callback_v0 &func_dropdown_closed();
00139
00143 CL_Callback_v0 &func_before_edit_changed();
00144
00148 CL_Callback_v0 &func_after_edit_changed();
00149
00153 CL_Callback_v1<int> &func_item_selected();
00154
00158 CL_Callback_v1<int> &func_selection_changed();
00159
00163 private:
00164 CL_SharedPtr<CL_ComboBox_Impl> impl;
00166 };
00167