5 #ifndef __I_GUI_ENVIRONMENT_H_INCLUDED__
6 #define __I_GUI_ENVIRONMENT_H_INCLUDED__
47 class IGUIFileOpenDialog;
48 class IGUIColorSelectDialog;
56 class IGUIContextMenu;
61 class IGUIElementFactory;
174 bool useAlphaChannel ) = 0;
233 IGUIElement* parent=0,
s32 id=-1,
const wchar_t* text=0,
const wchar_t* tooltiptext = 0) = 0;
301 bool useAlphaChannel=
true,
IGUIElement* parent=0,
s32 id=-1,
const wchar_t* text=0) = 0;
315 IGUIElement* parent=0,
s32 id=-1,
const wchar_t* text=0,
bool useAlphaChannel=
true) = 0;
352 bool scrollBarVertical =
true,
bool scrollBarHorizontal =
false) = 0;
409 bool border=
false,
bool wordWrap=
true,
IGUIElement* parent=0,
s32 id=-1,
410 bool fillBackground =
false) = 0;
469 bool border=
true,
s32 id=-1) = 0;
Interface of an object which can receive events.
The Operating system operator provides operation system specific methods and informations.
Base class of most objects of the Irrlicht Engine.
Specifies a 2 dimensional size.
Standard color chooser dialog.
Single line edit box for editing simple text.
Interface making it possible to dynamically create GUI elements.
Base class of all GUI elements.
GUI Environment. Used as factory and manager of all other GUI elements.
virtual IGUIElement * getHovered() const =0
Returns the element which was last under the mouse cursor.
virtual u32 getRegisteredGUIElementFactoryCount() const =0
Get amount of registered gui element factories.
virtual IGUIContextMenu * addMenu(IGUIElement *parent=0, s32 id=-1)=0
Adds a menu to the environment.
virtual IGUIImage * addImage(const core::rect< s32 > &rectangle, IGUIElement *parent=0, s32 id=-1, const wchar_t *text=0, bool useAlphaChannel=true)=0
Adds an image element.
virtual IGUIElementFactory * getDefaultGUIElementFactory() const =0
Get the default element factory which can create all built-in elements.
virtual IGUIElement * addGUIElement(const c8 *elementName, IGUIElement *parent=0)=0
Adds a GUI element by its name.
virtual IGUISpriteBank * getSpriteBank(const io::path &filename)=0
Returns pointer to the sprite bank with the specified file name.
virtual IGUIFont * getFont(const io::path &filename)=0
Returns pointer to the font with the specified filename.
virtual bool loadGUI(io::IReadFile *file, IGUIElement *parent=0)=0
Loads the gui. Note that the current gui is not cleared before.
virtual void setUserEventReceiver(IEventReceiver *evr)=0
This sets a new event receiver for gui events.
virtual IGUIComboBox * addComboBox(const core::rect< s32 > &rectangle, IGUIElement *parent=0, s32 id=-1)=0
Adds a combo box to the environment.
virtual bool setFocus(IGUIElement *element)=0
Sets the focus to an element.
virtual IGUIFont * addFont(const io::path &name, IGUIFont *font)=0
Adds an externally loaded font to the font list.
virtual void writeGUIElement(io::IXMLWriter *writer, IGUIElement *node)=0
writes an element
virtual IGUIImage * addImage(video::ITexture *image, core::position2d< s32 > pos, bool useAlphaChannel=true, IGUIElement *parent=0, s32 id=-1, const wchar_t *text=0)=0
Adds an image element.
virtual IGUIElement * getRootGUIElement()=0
Returns the root gui element.
virtual bool saveGUI(io::IWriteFile *file, IGUIElement *start=0)=0
Saves the current gui into a file.
virtual IGUIElementFactory * getGUIElementFactory(u32 index) const =0
Get a gui element factory by index.
virtual IGUITreeView * addTreeView(const core::rect< s32 > &rectangle, IGUIElement *parent=0, s32 id=-1, bool drawBackground=false, bool scrollBarVertical=true, bool scrollBarHorizontal=false)=0
Adds a tree view element.
virtual void removeFont(IGUIFont *font)=0
remove loaded font
virtual video::IVideoDriver * getVideoDriver() const =0
Returns the current video driver.
virtual IGUIMeshViewer * addMeshViewer(const core::rect< s32 > &rectangle, IGUIElement *parent=0, s32 id=-1, const wchar_t *text=0)=0
Adds a mesh viewer. Not 100% implemented yet.
virtual IGUIContextMenu * addContextMenu(const core::rect< s32 > &rectangle, IGUIElement *parent=0, s32 id=-1)=0
Adds a context menu to the environment.
virtual IGUISkin * getSkin() const =0
Returns pointer to the current gui skin.
virtual IGUIElement * getFocus() const =0
Returns the element which holds the focus.
virtual IGUISpriteBank * addEmptySpriteBank(const io::path &name)=0
Adds an empty sprite bank to the manager.
virtual void serializeAttributes(io::IAttributes *out, io::SAttributeReadWriteOptions *options=0) const =0
Writes attributes of the gui environment.
virtual void registerGUIElementFactory(IGUIElementFactory *factoryToAdd)=0
Adds an element factory to the gui environment.
virtual IGUIButton * addButton(const core::rect< s32 > &rectangle, IGUIElement *parent=0, s32 id=-1, const wchar_t *text=0, const wchar_t *tooltiptext=0)=0
Adds a button element.
virtual IGUITab * addTab(const core::rect< s32 > &rectangle, IGUIElement *parent=0, s32 id=-1)=0
Adds tab to the environment.
virtual IGUITable * addTable(const core::rect< s32 > &rectangle, IGUIElement *parent=0, s32 id=-1, bool drawBackground=false)=0
Adds a table to the environment.
virtual bool loadGUI(const io::path &filename, IGUIElement *parent=0)=0
Loads the gui. Note that the current gui is not cleared before.
virtual IGUIColorSelectDialog * addColorSelectDialog(const wchar_t *title=0, bool modal=true, IGUIElement *parent=0, s32 id=-1)=0
Adds a color select dialog.
virtual void clear()=0
Removes all elements from the environment.
virtual IGUISkin * createSkin(EGUI_SKIN_TYPE type)=0
Creates a new GUI Skin based on a template.
virtual IGUICheckBox * addCheckBox(bool checked, const core::rect< s32 > &rectangle, IGUIElement *parent=0, s32 id=-1, const wchar_t *text=0)=0
Adds a checkbox element.
virtual void deserializeAttributes(io::IAttributes *in, io::SAttributeReadWriteOptions *options=0)=0
Reads attributes of the gui environment.
virtual bool hasFocus(IGUIElement *element) const =0
Returns whether the element has focus.
virtual IGUIFont * getBuiltInFont() const =0
Returns the default built-in font.
virtual IGUIElement * addModalScreen(IGUIElement *parent)=0
Adds a modal screen.
virtual IGUIInOutFader * addInOutFader(const core::rect< s32 > *rectangle=0, IGUIElement *parent=0, s32 id=-1)=0
Adds an element for fading in or out.
virtual IGUIToolBar * addToolBar(IGUIElement *parent=0, s32 id=-1)=0
Adds a toolbar to the environment.
virtual void drawAll()=0
Draws all gui elements by traversing the GUI environment starting at the root node.
virtual IGUIFileOpenDialog * addFileOpenDialog(const wchar_t *title=0, bool modal=true, IGUIElement *parent=0, s32 id=-1, bool restoreCWD=false, io::path::char_type *startDir=0)=0
Adds a file open dialog.
virtual IGUIWindow * addMessageBox(const wchar_t *caption, const wchar_t *text=0, bool modal=true, s32 flags=EMBF_OK, IGUIElement *parent=0, s32 id=-1, video::ITexture *image=0)=0
Adds a message box.
virtual bool removeFocus(IGUIElement *element)=0
Removes the focus from an element.
virtual IGUIEditBox * addEditBox(const wchar_t *text, const core::rect< s32 > &rectangle, bool border=true, IGUIElement *parent=0, s32 id=-1)=0
Adds an edit box.
virtual IGUISpinBox * addSpinBox(const wchar_t *text, const core::rect< s32 > &rectangle, bool border=true, IGUIElement *parent=0, s32 id=-1)=0
Adds a spin box.
virtual IGUIWindow * addWindow(const core::rect< s32 > &rectangle, bool modal=false, const wchar_t *text=0, IGUIElement *parent=0, s32 id=-1)=0
Adds an empty window element.
virtual bool saveGUI(const io::path &filename, IGUIElement *start=0)=0
Saves the current gui into a file.
virtual void readGUIElement(io::IXMLReader *reader, IGUIElement *node)=0
reads an element
virtual io::IFileSystem * getFileSystem() const =0
Returns the file system.
virtual IGUIStaticText * addStaticText(const wchar_t *text, const core::rect< s32 > &rectangle, bool border=false, bool wordWrap=true, IGUIElement *parent=0, s32 id=-1, bool fillBackground=false)=0
Adds a static text.
virtual void setSkin(IGUISkin *skin)=0
Sets a new GUI Skin.
virtual IGUITabControl * addTabControl(const core::rect< s32 > &rectangle, IGUIElement *parent=0, bool fillbackground=false, bool border=true, s32 id=-1)=0
Adds a tab control to the environment.
virtual IGUIImageList * createImageList(video::ITexture *texture, core::dimension2d< s32 > imageSize, bool useAlphaChannel)=0
Creates the image list from the given texture.
virtual IGUIListBox * addListBox(const core::rect< s32 > &rectangle, IGUIElement *parent=0, s32 id=-1, bool drawBackground=false)=0
Adds a list box element.
virtual IOSOperator * getOSOperator() const =0
returns a pointer to the OS operator
virtual bool postEventFromUser(const SEvent &event)=0
Posts an input event to the environment.
virtual IGUIScrollBar * addScrollBar(bool horizontal, const core::rect< s32 > &rectangle, IGUIElement *parent=0, s32 id=-1)=0
Adds a scrollbar.
Standard file chooser dialog.
GUI element displaying an image.
Element for fading out or in.
Default list box GUI element.
3d mesh viewing GUI element.
A skin modifies the look of the GUI elements.
Single line edit box + spin buttons.
Multi or single line text label.
A tab-page, onto which other gui elements could be added.
Default list box GUI element.
Default tree view GUI element.
Default moveable window GUI element with border, caption and close icons.
Provides a generic interface for attributes and their values and the possiblity to serialize them.
The FileSystem manages files and archives and provides access to them.
Interface providing easy read access to a XML file.
Interface providing read acess to a file.
Interface providing write access to a file.
Interface providing methods for making it easier to write XML files.
Interface of a Video Driver dependent Texture.
Interface to driver which is able to perform 2d and 3d graphics functions.
EGUI_SKIN_TYPE
Enumeration of available default skins.
@ EMBF_OK
Flag for the ok button.
Everything in the Irrlicht Engine can be found in this namespace.
unsigned int u32
32 bit unsigned variable.
char c8
8 bit character variable.
signed int s32
32 bit signed variable.
SEvents hold information about an event. See irr::IEventReceiver for details on event handling.
struct holding data describing options