// Copyright (C) 2002-2006 Nikolaus Gebhardt // This file is part of the "Irrlicht Engine". // For conditions of distribution and use, see copyright notice in irrlicht.h #pragma once #using using namespace System; #pragma unmanaged #include "..\\..\\include\\irrlicht.h" #pragma managed #include "IGUISkin.h" namespace Irrlicht { public __gc class IrrlichtDevice; namespace Video { public __gc class ITexture; } namespace GUI { public __gc class IGUIFont; public __gc class IGUIElement; public __gc class IGUISkin; public __gc class IGUIListBox; public __gc class IGUIStaticText; //! enumeration for message box layout flags __value public enum MessageBoxFlag { //! Flag for the ok button OK = 0x1, //! Flag for the cancel button CANCEL = 0x2, //! Flag for the yes button YES = 0x4, //! Flag for the no button NO = 0x8, //! This value is not used. It only forces this enumeration to compile in 32 bit. FORCE_32BIT = 0x7fffffff }; public __gc class IGUIEnvironment { public: /// /// You should access the IGUIEnvironment /// through the Irrlicht::IrrlichtDevice.GUIEnvironment property. Simply don't use /// this constructor. /// ///The real, unmanaged C++ GUI Environment IGUIEnvironment(irr::gui::IGUIEnvironment* env); ~IGUIEnvironment(); /// /// Returns pointer to the font with the specified file name. /// Loads the font if it was not loaded before. Returns 0 if the font could not be loaded. /// /// returns a pointer to the font. IGUIFont* GetFont(System::String* filename); /// /// Returns the default built-in font. /// __property IGUIFont* get_BuiltInFont(); /// /// Sets the focus to an element. /// void SetFocus(IGUIElement* element); /// /// Removes the focus from an element. /// void RemoveFocus(IGUIElement* element); /// /// Returns if the element has focus /// bool HasFocus(IGUIElement* element); /// /// Creates a new GUI Skin based on a template. /// Use setSkin() to set the created skin. /// IGUISkin* CreateSkin(SkinType type); /// /// Sets or gets the currently used skin. Skins influence how GUIElements /// draw themselves. See createSkin() for how to set a new skin. /// __property void set_Skin(IGUISkin* skin); /// /// Sets or gets the currently used skin. Skins influence how GUIElements /// draw themselves. See createSkin() for how to set a new skin. /// __property IGUISkin* get_Skin(); /// /// Returns the root gui element. This is the first gui element, parent of all other /// gui elements. You'll never need to use this method, unless you are not creating /// your own gui elements, trying to add them to the gui elements without a parent. /// __property IGUIElement* get_RootGUIElement(); /// /// Draws all gui elements. Call this in your drawing loops if you want /// GUI Elements to be visible. /// void DrawAll(); /// /// Adds an button element. /// /// Parent gui element of the message box, can be null /// Id with which the gui element can be identified. IGUIElement* AddButton(Core::Rect position, IGUIElement* parent, int id, System::String* text); /// /// Adds an empty window element. /// /// Defines if the dialog is modal. This means, that all other /// gui elements which were created before the message box cannot be used /// until this messagebox is removed. /// Parent gui element of the message box, can be null. /// Id with which the gui element can be identified. IGUIElement* AddWindow(Core::Rect position, bool modal, System::String* text, IGUIElement* parent, int id); /// /// Adds a message box. /// /// Text to be displayed in the body of the message box. /// Defines if the dialog is modal. This means, that all other /// gui elements which were created before the message box cannot be used /// until this messagebox is removed. /// Flags specifying the layout of the message box. For example /// to create a message box with an OK and a CANCEL button on it, set this /// to (MessageBoxFlag.OK | MessageBoxFlag.CANCEL). /// Parent gui element of the message box, can be null /// Id with which the gui element can be identified. IGUIElement* AddMessageBox(System::String* caption, System::String* text, bool modal, MessageBoxFlag flags, IGUIElement* parent, int id); /// /// Adds a scrollbar. /// /// Parent gui element of the message box, can be null /// Id with which the gui element can be identified. IGUIElement* AddScrollBar(bool horizontal, Core::Rect position, IGUIElement* Parent, int id); /// /// Adds an image. /// /// Position of the image. The width and height of the image is taken /// from the image. /// Sets if the image should use the alpha channel /// of the texture to draw itself. /// Parent gui element of the message box, can be null /// Id with which the gui element can be identified. IGUIElement* AddImage(Video::ITexture* image, Core::Position2D pos, bool useAlphaChannel, IGUIElement* parent, int id, System::String* text); /// /// Adds a checkbox element. /// /// Parent gui element of the message box, can be null /// Id with which the gui element can be identified. IGUIElement* AddCheckBox(bool checked, Core::Rect position, IGUIElement* parent, int id, System::String* text); /// /// Adds a list box element. /// /// Parent gui element of the message box, can be null /// Id with which the gui element can be identified. IGUIListBox* AddListBox(Core::Rect position, IGUIElement* parent, int id, bool drawBackGround); /// /// Adds a file open dialog. /// /// Parent gui element of the message box, can be null /// Id with which the gui element can be identified. IGUIElement* AddFileOpenDialog(System::String* text, bool modal, IGUIElement* parent, int id); /// /// Adds a static text. /// /// Parent gui element of the message box, can be null /// Id with which the gui element can be identified. IGUIStaticText* AddStaticText(System::String* text, Core::Rect position, bool border, bool wordWrap, IGUIElement* parent, int id); /// /// Adds an edit box. /// /// Parent gui element of the message box, can be null /// Id with which the gui element can be identified. IGUIElement* AddEditBox(System::String* text, Core::Rect position, bool border, IGUIElement* parent, int id); private: irr::gui::IGUIEnvironment* Environment; IGUIFont* BuildInFont; }; } }