- Your Widget Set For OpenGL
Main Page | Namespace List | Class Hierarchy | Class List | File List | Class Members | Related Pages

ucompound.hpp

00001 /*************************************************************************** 00002 LibUFO - UI For OpenGL 00003 copyright : (C) 2001-2005 by Johannes Schmidt 00004 email : schmidtjf at users.sourceforge.net 00005 ------------------- 00006 00007 file : include/ufo/widgets/ucompound.hpp 00008 begin : Fri Mar 7 2003 00009 $Id: ucompound.hpp,v 1.10 2005/06/21 09:27:23 schmidtjf Exp $ 00010 ***************************************************************************/ 00011 00012 /*************************************************************************** 00013 * This library is free software; you can redistribute it and/or * 00014 * modify it under the terms of the GNU Lesser General Public * 00015 * License as published by the Free Software Foundation; either * 00016 * version 2.1 of the License, or (at your option) any later version. * 00017 * * 00018 * This library is distributed in the hope that it will be useful, * 00019 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00020 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00021 * Lesser General Public License for more details. * 00022 * * 00023 * You should have received a copy of the GNU Lesser General Public * 00024 * License along with this library; if not, write to the Free Software * 00025 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 00026 ***************************************************************************/ 00027 00028 #ifndef UCOMPOUND_HPP 00029 #define UCOMPOUND_HPP 00030 00031 #include "uwidget.hpp" 00032 00033 #include "../uicon.hpp" 00034 00035 namespace ufo { 00036 00037 class UCompoundModel; 00038 00046 class UFO_EXPORT UCompound : public UWidget { 00047 UFO_DECLARE_DYNAMIC_CLASS(UCompound) 00048 public: 00049 UCompound(); 00050 UCompound(const std::string & text); 00051 UCompound(UIcon * icon); 00052 UCompound(const std::string & text, UIcon * icon); 00053 00058 virtual void setText(const std::string & text); 00059 00064 std::string getText() const; 00065 00066 // 00067 // ICON section 00068 // 00069 00072 void setIcon(UIcon * icon); 00073 00077 UIcon * getDefaultIcon() const; 00078 00082 virtual UIcon * getIcon() const; 00083 00086 void setDisabledIcon(UIcon * icon); 00090 UIcon * getDisabledIcon() const; 00091 00092 00095 void setIconTextGap(int iconTextGap); 00098 int getIconTextGap() const; 00099 00100 protected: // Overrides UWidget 00101 virtual std::ostream & paramString(std::ostream & os) const; 00102 virtual void processStateChangeEvent(uint32_t state); 00103 virtual void processStyleHintChange(uint32_t styleHint); 00104 00105 protected: // Protected methods 00106 UCompoundModel * getCompoundModel() const; 00107 void updateMnemonic(); 00108 00109 private: // Protected attributes 00111 UIcon * m_icon; 00113 UIcon * m_disabledIcon; 00115 int m_iconTextGap; 00116 }; 00117 00118 // 00119 // inline implementation 00120 // 00121 00122 inline UIcon * 00123 UCompound::getDisabledIcon() const { 00124 return m_disabledIcon; 00125 } 00126 00127 00128 inline int 00129 UCompound::getIconTextGap() const { 00130 return m_iconTextGap; 00131 } 00132 00133 } // namespace ufo 00134 00135 #endif // UCOMPOUND_HPP

The libUFO Project - written by Johannes Schmidt