00001 /* 00002 ----------------------------------------------------------------------------- 00003 This source file is part of OGRE 00004 (Object-oriented Graphics Rendering Engine) 00005 For the latest info, see http://www.ogre3d.org/ 00006 00007 Copyright © 2000-2002 The OGRE Team 00008 Also see acknowledgements in Readme.html 00009 00010 This program is free software; you can redistribute it and/or modify it under 00011 the terms of the GNU Lesser General Public License as published by the Free Software 00012 Foundation; either version 2 of the License, or (at your option) any later 00013 version. 00014 00015 This program is distributed in the hope that it will be useful, but WITHOUT 00016 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00017 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. 00018 00019 You should have received a copy of the GNU Lesser General Public License along with 00020 this program; if not, write to the Free Software Foundation, Inc., 59 Temple 00021 Place - Suite 330, Boston, MA 02111-1307, USA, or go to 00022 http://www.gnu.org/copyleft/lesser.txt. 00023 ----------------------------------------------------------------------------- 00024 */ 00025 #ifndef __ScrollBarElement_H__ 00026 #define __ScrollBarElement_H__ 00027 00028 #include "OgreGuiElementPrerequisites.h" 00029 #include "OgrePanelGuiElement.h" 00030 #include "OgreButtonGuiElement.h" 00031 #include "OgreEventListeners.h" 00032 #include "OgreScrollTarget.h" 00033 00034 namespace Ogre { 00035 00036 00057 class _OgreGuiElementExport ScrollBarGuiElement : public PanelGuiElement, ActionListener, public ScrollTarget, public MouseMotionListener, public MouseListener 00058 { 00059 public : 00060 // void addBaseParameters(void); 00061 00062 ScrollBarGuiElement(const String& name); 00063 00065 class CmdUpButton : public ParamCommand 00066 { 00067 public: 00068 String doGet(const void* target) const; 00069 void doSet(void* target, const String& val); 00070 }; 00072 class CmdDownButton : public ParamCommand 00073 { 00074 public: 00075 String doGet(const void* target) const; 00076 void doSet(void* target, const String& val); 00077 }; 00078 00080 class CmdScrollBit : public ParamCommand 00081 { 00082 public: 00083 String doGet(const void* target) const; 00084 void doSet(void* target, const String& val); 00085 }; 00086 00087 virtual void setUpButtonName(const String& val); 00088 virtual void setDownButtonName(const String& val); 00089 virtual void setScrollBitName(const String& val); 00090 virtual String getUpButtonName() const; 00091 virtual String getDownButtonName() const; 00092 virtual String getScrollBitName() const; 00093 00094 virtual void setLimits(size_t first, size_t visibleRange, size_t total); 00095 virtual void layoutItems(); 00096 virtual void updateScrollBit(); 00097 virtual void scrollToIndex(size_t index); 00098 00100 virtual const String& getTypeName(void) const; 00101 void actionPerformed(ActionEvent* e) ; 00102 void fireScrollPerformed(); 00103 void processEvent(InputEvent* e) ; 00104 void mouseMoved(MouseEvent* e); 00105 void mouseDragged(MouseEvent* e); 00106 void mouseClicked(MouseEvent* e) {}; 00107 void mouseEntered(MouseEvent* e) {}; 00108 void mouseExited(MouseEvent* e) {}; 00109 void mousePressed(MouseEvent* e) ; 00110 void mouseReleased(MouseEvent* e) ; 00111 void moveScrollBitTo(Real moveY); 00112 00113 protected: 00114 00115 void addBaseParameters(void); 00116 static CmdUpButton msCmdUpButton; 00117 static CmdDownButton msCmdDownButton; 00118 static CmdScrollBit msCmdScrollBit; 00119 static String msTypeName; 00120 00121 String mUpButtonName, mDownButtonName, mScrollBitName; 00122 00123 ButtonGuiElement *mUpButton, *mDownButton; 00124 PanelGuiElement *mScrollBit; 00125 00126 size_t mTotalItems, mStartingItem, mVisibilityRange; 00127 Real mSpacing; 00128 Real mouseHeldAtY; 00129 }; 00130 00131 } 00132 00133 00134 #endif // __ScrollBarGuiElement_H__ 00135
Copyright © 2002-2003 by The OGRE Team
Last modified Wed Jan 21 00:10:27 2004