Crazy Eddies GUI System 0.7.5
|
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 "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 00065 static const String EventListSelectionAccepted; 00066 00067 00078 virtual void initialiseComponents(void); 00079 00080 00099 void setArmed(bool setting) { d_armed = setting; } 00100 00101 00112 bool isArmed(void) const { return d_armed; } 00113 00114 00126 void setAutoArmEnabled(bool setting) { d_autoArm = setting; } 00127 00128 00137 bool isAutoArmEnabled(void) const { return d_autoArm; } 00138 00139 00140 /************************************************************************* 00141 Constructor & Destructor 00142 *************************************************************************/ 00147 ComboDropList(const String& type, const String& name); 00148 00149 00154 virtual ~ComboDropList(void); 00155 00156 00157 protected: 00168 virtual bool testClassName_impl(const String& class_name) const 00169 { 00170 if (class_name=="ComboDropList") return true; 00171 return Listbox::testClassName_impl(class_name); 00172 } 00173 00174 /************************************************************************* 00175 New event handlers 00176 *************************************************************************/ 00181 void onListSelectionAccepted(WindowEventArgs& e); 00182 00183 00184 /************************************************************************* 00185 Overridden Event handling 00186 *************************************************************************/ 00187 virtual void onMouseMove(MouseEventArgs& e); 00188 virtual void onMouseButtonDown(MouseEventArgs& e); 00189 virtual void onMouseButtonUp(MouseEventArgs& e); 00190 virtual void onCaptureLost(WindowEventArgs& e); 00191 virtual void onActivated(ActivationEventArgs& e); 00192 virtual void onListContentsChanged(WindowEventArgs& e); 00193 virtual void onSelectionChanged(WindowEventArgs& e); 00194 00195 /************************************************************************* 00196 Implementation Data 00197 *************************************************************************/ 00198 bool d_autoArm; 00199 bool d_armed; 00200 ListboxItem* d_lastClickSelected; 00201 }; 00202 00203 } // End of CEGUI namespace section 00204 00205 #if defined(_MSC_VER) 00206 # pragma warning(pop) 00207 #endif 00208 00209 #endif // end of guard _CEGUIComboDropList_h_