CGUIEditWindow.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. #ifndef __C_GUI_EDITOR_H_INCLUDED__
  2. #define __C_GUI_EDITOR_H_INCLUDED__
  3. #include "IGUIWindow.h"
  4. #include "CGUIAttributeEditor.h"
  5. //#include "IGUIStaticText.h"
  6. #include "IGUIButton.h"
  7. #include "IGUITreeView.h"
  8. #include "irrArray.h"
  9. #include "IAttributes.h"
  10. #include "EGUIEditTypes.h"
  11. namespace irr
  12. {
  13. namespace gui
  14. {
  15. class CGUIEditWindow : public IGUIWindow
  16. {
  17. public:
  18. //! constructor
  19. CGUIEditWindow(IGUIEnvironment* environment, core::rect<s32> rectangle, IGUIElement *parent);
  20. //! destructor
  21. ~CGUIEditWindow();
  22. //! this part draws the window
  23. virtual void draw();
  24. //! handles events
  25. virtual bool OnEvent(const SEvent &event);
  26. //! change selection
  27. virtual void setSelectedElement(IGUIElement *sel);
  28. //! get draggable
  29. virtual bool isDraggable() const;
  30. //! get draggable
  31. virtual void setDraggable(bool draggable);
  32. // not used
  33. virtual core::rect<s32> getClientRect() const;
  34. virtual IGUIButton* getCloseButton() const;
  35. virtual IGUIButton* getMinimizeButton() const;
  36. virtual IGUIButton* getMaximizeButton() const;
  37. virtual void setDrawBackground(bool draw) { }
  38. virtual bool getDrawBackground() const { return true; }
  39. virtual void setDrawTitlebar(bool draw) { }
  40. virtual bool getDrawTitlebar() const { return true; }
  41. IGUITreeView* getTreeView() const;
  42. CGUIAttributeEditor* getAttributeEditor() const;
  43. CGUIAttributeEditor* getOptionEditor() const;
  44. CGUIAttributeEditor* getEnvironmentEditor() const;
  45. //! Returns the type name of the gui element.
  46. virtual const c8* getTypeName() const
  47. {
  48. return GUIEditElementTypeNames[EGUIEDIT_GUIEDITWINDOW];
  49. }
  50. void updateTree();
  51. private:
  52. void addChildrenToTree(IGUIElement* parentElement, IGUITreeViewNode* treenode);
  53. IGUITreeViewNode* getTreeNode(IGUIElement* element, IGUITreeViewNode* searchnode);
  54. // for dragging the window
  55. bool Dragging;
  56. bool IsDraggable;
  57. bool Resizing;
  58. core::position2d<s32> DragStart;
  59. IGUIElement* SelectedElement; // current selected element
  60. CGUIAttributeEditor* AttribEditor; // edits the current attribute
  61. CGUIAttributeEditor* OptionEditor; // edits the options for the window
  62. CGUIAttributeEditor* EnvEditor; // edits attributes for the environment
  63. IGUITreeView* TreeView; // tree view of all elements in scene
  64. IGUIButton* ResizeButton;
  65. };
  66. } // end namespace gui
  67. } // end namespace irr
  68. #endif // __C_GUI_EDITOR_H_INCLUDED__