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