combobox.h

Go to the documentation of this file.
00001 /*
00002 **  ClanLib SDK
00003 **  Copyright (c) 1997-2009 The ClanLib Team
00004 **
00005 **  This software is provided 'as-is', without any express or implied
00006 **  warranty.  In no event will the authors be held liable for any damages
00007 **  arising from the use of this software.
00008 **
00009 **  Permission is granted to anyone to use this software for any purpose,
00010 **  including commercial applications, and to alter it and redistribute it
00011 **  freely, subject to the following restrictions:
00012 **
00013 **  1. The origin of this software must not be misrepresented; you must not
00014 **     claim that you wrote the original software. If you use this software
00015 **     in a product, an acknowledgment in the product documentation would be
00016 **     appreciated but is not required.
00017 **  2. Altered source versions must be plainly marked as such, and must not be
00018 **     misrepresented as being the original software.
00019 **  3. This notice may not be removed or altered from any source distribution.
00020 **
00021 **  Note: Some of the libraries ClanLib may link to may have additional
00022 **  requirements or restrictions.
00023 **
00024 **  File Author(s):
00025 **
00026 **    Magnus Norddahl
00027 **    Harry Storbacka
00028 **    Kenneth Gangstoe
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 

Generated on Thu Dec 3 02:39:28 2009 for ClanLib by  doxygen 1.4.6