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
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:
00067 bool is_null() const { return !impl; }
00068
00070 void throw_if_null() const;
00071
00075 CL_String get_class_name() const;
00076
00082 CL_PopupMenuItem get_item(int id);
00083
00089 CL_PopupMenuItem get_item_at(int index);
00090
00094 int get_item_count() const;
00095
00099 int get_minimum_width() const;
00100
00104 virtual CL_Size get_preferred_size() const;
00105
00109 public:
00111 CL_Callback_v0 &func_close();
00112
00116 public:
00118 void start(CL_GUIComponent *parent, const CL_Point &pos);
00119
00127 CL_PopupMenuItem insert_item(const CL_StringRef &text, int id = -1, int index = -1);
00128
00135 CL_PopupMenuItem insert_item_accel(const CL_StringRef &text, const CL_StringRef &accel_text="", int id = -1, int index = -1);
00136
00142 CL_PopupMenuItem insert_separator(int index = -1);
00143
00147 void set_minimum_width(int width_pixels);
00148
00152 void set_maximum_height(int height_pixels);
00153
00157 void set_class_name(const CL_StringRef &class_name);
00158
00160 int find_item(const CL_StringRef &text, bool case_sensitive = false);
00161
00165 void clear();
00166
00170 private:
00171 CL_SharedPtr<CL_PopupMenu_Impl> impl;
00172
00173 friend class CL_MenuBar;
00174 friend class CL_MenuBar_Impl;
00175 friend class CL_PopupMenuWindow;
00177 };
00178