00001 /*********************************************************************** 00002 filename: CEGUIComboDropList.h 00003 created: 13/6/2004 00004 author: Paul D Turner 00005 00006 purpose: Interface for the Combobox Drop-List widget base class 00007 *************************************************************************/ 00008 /*************************************************************************** 00009 * Copyright (C) 2004 - 2006 Paul D Turner & The CEGUI Development Team 00010 * 00011 * Permission is hereby granted, free of charge, to any person obtaining 00012 * a copy of this software and associated documentation files (the 00013 * "Software"), to deal in the Software without restriction, including 00014 * without limitation the rights to use, copy, modify, merge, publish, 00015 * distribute, sublicense, and/or sell copies of the Software, and to 00016 * permit persons to whom the Software is furnished to do so, subject to 00017 * the following conditions: 00018 * 00019 * The above copyright notice and this permission notice shall be 00020 * included in all copies or substantial portions of the Software. 00021 * 00022 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 00023 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00024 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 00025 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 00026 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 00027 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 00028 * OTHER DEALINGS IN THE SOFTWARE. 00029 ***************************************************************************/ 00030 #ifndef _CEGUIComboDropList_h_ 00031 #define _CEGUIComboDropList_h_ 00032 00033 #include "elements/CEGUIListbox.h" 00034 00035 00036 #if defined(_MSC_VER) 00037 # pragma warning(push) 00038 # pragma warning(disable : 4251) 00039 #endif 00040 00041 00042 // Start of CEGUI namespace section 00043 namespace CEGUI 00044 { 00049 class CEGUIEXPORT ComboDropList : public Listbox 00050 { 00051 public: 00052 static const String EventNamespace; 00053 static const String WidgetTypeName; 00054 00055 00056 /************************************************************************* 00057 Constants 00058 *************************************************************************/ 00059 // Event names 00060 static const String EventListSelectionAccepted; 00061 00062 00073 virtual void initialiseComponents(void); 00074 00075 00094 void setArmed(bool setting) { d_armed = setting; } 00095 00096 00107 bool isArmed(void) const { return d_armed; } 00108 00109 00121 void setAutoArmEnabled(bool setting) { d_autoArm = setting; } 00122 00123 00132 bool isAutoArmEnabled(void) const { return d_autoArm; } 00133 00134 00135 /************************************************************************* 00136 Constructor & Destructor 00137 *************************************************************************/ 00142 ComboDropList(const String& type, const String& name); 00143 00144 00149 virtual ~ComboDropList(void); 00150 00151 00152 protected: 00163 virtual bool testClassName_impl(const String& class_name) const 00164 { 00165 if (class_name=="ComboDropList") return true; 00166 return Listbox::testClassName_impl(class_name); 00167 } 00168 00169 /************************************************************************* 00170 New event handlers 00171 *************************************************************************/ 00176 void onListSelectionAccepted(WindowEventArgs& e); 00177 00178 00179 /************************************************************************* 00180 Overridden Event handling 00181 *************************************************************************/ 00182 virtual void onMouseMove(MouseEventArgs& e); 00183 virtual void onMouseButtonDown(MouseEventArgs& e); 00184 virtual void onMouseButtonUp(MouseEventArgs& e); 00185 virtual void onCaptureLost(WindowEventArgs& e); 00186 virtual void onActivated(ActivationEventArgs& e); 00187 virtual void onListContentsChanged(WindowEventArgs& e); 00188 virtual void onSelectionChanged(WindowEventArgs& e); 00189 00190 /************************************************************************* 00191 Implementation Data 00192 *************************************************************************/ 00193 bool d_autoArm; 00194 bool d_armed; 00195 ListboxItem* d_lastClickSelected; 00196 }; 00197 00198 } // End of CEGUI namespace section 00199 00200 #if defined(_MSC_VER) 00201 # pragma warning(pop) 00202 #endif 00203 00204 #endif // end of guard _CEGUIComboDropList_h_