CGUIToolBar.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // Copyright (C) 2002-2012 Nikolaus Gebhardt
  2. // This file is part of the "Irrlicht Engine".
  3. // For conditions of distribution and use, see copyright notice in irrlicht.h
  4. #ifndef __C_GUI_TOOL_BAR_H_INCLUDED__
  5. #define __C_GUI_TOOL_BAR_H_INCLUDED__
  6. #include "IrrCompileConfig.h"
  7. #ifdef _IRR_COMPILE_WITH_GUI_
  8. #include "IGUIToolbar.h"
  9. namespace irr
  10. {
  11. namespace gui
  12. {
  13. //! Stays at the top of its parent like the menu bar and contains tool buttons
  14. class CGUIToolBar : public IGUIToolBar
  15. {
  16. public:
  17. //! constructor
  18. CGUIToolBar(IGUIEnvironment* environment, IGUIElement* parent, s32 id, core::rect<s32> rectangle);
  19. //! called if an event happened.
  20. virtual bool OnEvent(const SEvent& event);
  21. //! draws the element and its children
  22. virtual void draw();
  23. //! Updates the absolute position.
  24. virtual void updateAbsolutePosition();
  25. //! Adds a button to the tool bar
  26. virtual IGUIButton* addButton(s32 id=-1, const wchar_t* text=0,const wchar_t* tooltiptext=0,
  27. video::ITexture* img=0, video::ITexture* pressed=0,
  28. bool isPushButton=false, bool useAlphaChannel=false);
  29. private:
  30. s32 ButtonX;
  31. };
  32. } // end namespace gui
  33. } // end namespace irr
  34. #endif // _IRR_COMPILE_WITH_GUI_
  35. #endif