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
00032
00033 #pragma once
00034
00035 #include "../api_gui.h"
00036 #include "../gui_component.h"
00037 #include "../../Display/Window/input_event.h"
00038 #include "popupmenu_item.h"
00039
00040 class CL_PixelBuffer;
00041 class CL_PopupMenu;
00042
00043 class CL_PopupMenu_Impl;
00044
00048 class CL_API_GUI CL_PopupMenu
00049 {
00052 public:
00053 CL_PopupMenu();
00054
00055 virtual ~CL_PopupMenu();
00056
00060 static CL_PopupMenu create_null_object();
00061
00065 public:
00069 bool is_null() const;
00070
00074 CL_String get_class_name() const;
00075
00081 CL_PopupMenuItem get_item(int id);
00082
00088 CL_PopupMenuItem get_item_at(int index);
00089
00093 int get_item_count() const;
00094
00098 int get_minimum_width() const;
00099
00103 virtual CL_Size get_preferred_size() const;
00104
00108 public:
00110 CL_Callback_v0 &func_close();
00111
00115 public:
00117 void start(CL_GUIComponent *parent, const CL_Point &pos);
00118
00126 CL_PopupMenuItem insert_item(const CL_StringRef &text, int id = -1, int index = -1);
00127
00134 CL_PopupMenuItem insert_item_accel(const CL_StringRef &text, const CL_StringRef &accel_text=cl_text(""), int id = -1, int index = -1);
00135
00141 CL_PopupMenuItem insert_separator(int index = -1);
00142
00146 void set_minimum_width(int width_pixels);
00147
00151 void set_maximum_height(int height_pixels);
00152
00156 void set_class_name(const CL_StringRef &class_name);
00157
00159 int find_item(const CL_StringRef &text, bool case_sensitive = false);
00160
00164 private:
00165 CL_SharedPtr<CL_PopupMenu_Impl> impl;
00166
00167 friend class CL_MenuBar;
00168 friend class CL_MenuBar_Impl;
00169 friend class CL_PopupMenuWindow;
00171 };
00172