Inheritance: NativeElement
Ejemplo n.º 1
0
		public GUISpinBox AddSpinBox (string text, Rect rectangle, bool border, GUIElement parent, int id)
		{
			IntPtr par = (parent == null ? IntPtr.Zero : parent.Raw);

			return (GUISpinBox)NativeElement.GetObject(GuiEnv_AddSpinBox(_raw, text,
			                                                             rectangle.ToUnmanaged(),
                                                                         border,
			                                                             par, id), typeof(GUISpinBox));
		}
Ejemplo n.º 2
0
		public GUIColorSelectDialog AddColorSelectDialog(string title, bool modal, GUIElement parent, int id)
		{
			IntPtr par = (parent == null ? IntPtr.Zero : parent.Raw);
			return (GUIColorSelectDialog)NativeElement.GetObject(GuiEnv_AddColorSelectDialog(_raw,
			                                                                                 title,
			                                                                                 modal,
			                                                                                 par,
			                                                                                 id),
			                                                     typeof(GUIColorSelectDialog));
		}
Ejemplo n.º 3
0
        public CustomElement(GUIEnvironment guienv, GUIElement parent, int id,
		                      Rect rect)
            : base(guienv, parent, id, rect)
        {
            driver = guienv.VideoDriver;

            // For some reason passing this as a parent parameter doesn't work.
            // Probably that's because initialization of the managed part
            // is not finished yet, so this points to elsewhere but a complete class

            text = guienv.AddStaticText(caption, rect, false,
                                        true, null, -1, false);

            // let's workaround this by calling addchild instantly
            AddChild(text);
        }
Ejemplo n.º 4
0
		public IGUIElement (GUIEnvironment guienv, GUIElement parent, int id, 
		                    Rect rect)
		{
			antigc1 = OnCallbackVoid;
			antigc2 = OnCallbackInt;
			antigc3 = OnCallbackIntptr;

			Initialize (CGE_CREATE(guienv.Raw, 
			                       parent == null? guienv.RootElement.Raw : parent.Raw, 
			                       id, 
			                       rect.ToUnmanaged(), 
			                       antigc1,
			                       antigc2,
			                       antigc3));
			
		}
Ejemplo n.º 5
0
        private void RemoveFromElements(GUIElement node)
        {
            if (NativeElement.Elements.ContainsKey(node.Raw))
            {
                NativeElement.Elements.Remove(node.Raw);
            }
            else
            {
                //throw new Exception("Element was stale!!!!");
            }

            foreach (GUIElement cnode in node.Children)
            {
                System.Diagnostics.Debug.WriteLine("Deleting child nodes for GUI: " + node.Raw + " Elements remaining: " + NativeElement.Elements.Count);
                RemoveFromElements(cnode);
            }
        }
Ejemplo n.º 6
0
 public void RemoveFocus(GUIElement elem)
 {
     GuiEnv_RemoveFocus(_raw, elem.Raw);
 }
Ejemplo n.º 7
0
 public bool HasFocus(GUIElement elem)
 {
     return GuiEnv_HasFocus(_raw, elem.Raw);
 }
        public GUIEditBox AddEditBoxW(string text, Rect rectangle, bool border, GUIElement parent, int id)
        {
            IntPtr par = (parent == null ? IntPtr.Zero : parent.Raw);
#if !LINUX
			return (GUIEditBox)NativeElement.GetObject(GuiEnv_AddEditBoxW(_raw, text, rectangle.ToUnmanaged(), border, par, id),
                                                      typeof(GUIEditBox));
#else
			return (GUIEditBox)NativeElement.GetObject(GuiEnv_AddEditBox(_raw, text, rectangle.ToUnmanaged(), border, par, id),
                                                      typeof(GUIEditBox));
#endif
		}
Ejemplo n.º 9
0
 public bool BringToFront(GUIElement elem)
 {
     return GuiElem_BringToFront(_raw, elem.Raw);
 }
Ejemplo n.º 10
0
        public override void Cleanup()
        {
            if (imageChat != null)
                imageChat.Visible = false;

            if (imageChair != null)
                imageChair.Visible = false;

            // Background textures need not be disposed in cleanup
            if (parentElement != null)
            {
                try
                {
                    try
                    {
                        parentElement.Remove();
                    }
                    catch (Exception e)
                    {
                        Reference.Log.Warn(@"[GUIMANAGER]: Exception occured in Cleanup - " + e.Message);
                        Reference.Log.Debug(@"[GUIMANAGER]: Exception occured in Cleanup - " + e.StackTrace);
                    }
                }
                finally
                {
                    parentElement = null;
                }
            }
            timer.Enabled = false;
            blinkTimer.Enabled = false;
        }
Ejemplo n.º 11
0
		public override void AddChild (GUIElement child)
		{
			CGE_PVOID_METHODS(_raw, CGE_VOID_METHOD.ADD_CHILD, child.Raw, 0, 0, null);
		}
Ejemplo n.º 12
0
 public GUIContextMenu AddMenu(GUIElement parent, int id)
 {
     IntPtr par = (parent == null ? IntPtr.Zero : parent.Raw);
     return (GUIContextMenu)NativeElement.GetObject(GuiEnv_AddMenu(_raw, par, id),
                                               typeof(GUIContextMenu));
 }
Ejemplo n.º 13
0
 public GUIListBox AddListBox(Rect rect, GUIElement parent, int id, bool drawBackground)
 {
     IntPtr par = (parent == null ? IntPtr.Zero : parent.Raw);
     return (GUIListBox)NativeElement.GetObject(GuiEnv_AddListBox(_raw, rect.ToUnmanaged(), par, id, drawBackground),
                                               typeof(GUIListBox));
 }
Ejemplo n.º 14
0
 public GUIInOutFader AddInOutFader(GUIElement parent, int id)
 {
     IntPtr par = (parent == null ? IntPtr.Zero : parent.Raw);
     return (GUIInOutFader)NativeElement.GetObject(GuiEnv_AddInOutFader(_raw, null, par, id),
                                               typeof(GUIInOutFader));
 }
Ejemplo n.º 15
0
 public GUIImage AddImage(Texture image, Position2D position, bool useAlphaChannel, GUIElement parent, int id, string text)
 {
     IntPtr par = (parent == null ? IntPtr.Zero : parent.Raw);
     return (GUIImage)NativeElement.GetObject(GuiEnv_AddImageA(_raw, image.Raw, position.ToUnmanaged(), useAlphaChannel, par, id, text),
                                               typeof(GUIImage));
 }
Ejemplo n.º 16
0
        public override void Initialize()
        {
            parentElement = Reference.GUIEnvironment.RootElement;

            Reference.GUIEnvironment.Skin.SetColor(GuiDefaultColor.ActiveBorder, new Color(0, 204, 204, 204));
            Reference.GUIEnvironment.Skin.SetColor(GuiDefaultColor.ActiveCaption, Color.Black);
            Reference.GUIEnvironment.Skin.SetColor(GuiDefaultColor.AppWorkspace, Color.Red);
            Reference.GUIEnvironment.Skin.SetColor(GuiDefaultColor.ButtonText, Color.Black);
            Reference.GUIEnvironment.Skin.SetColor(GuiDefaultColor.Count, Color.White);
            Reference.GUIEnvironment.Skin.SetColor(GuiDefaultColor.DarkShadow3D, new Color(128, 0, 0, 0));
            Reference.GUIEnvironment.Skin.SetColor(GuiDefaultColor.Face3D, new Color(128, 204, 204, 204));
            Reference.GUIEnvironment.Skin.SetColor(GuiDefaultColor.GrayText, Color.Gray);
            Reference.GUIEnvironment.Skin.SetColor(GuiDefaultColor.HighLight, new Color(191, 0, 0, 0));
            Reference.GUIEnvironment.Skin.SetColor(GuiDefaultColor.HighLight3D, new Color(32, 255, 255, 255));
            Reference.GUIEnvironment.Skin.SetColor(GuiDefaultColor.HighLightText, new Color(32, 255, 255, 255));
            Reference.GUIEnvironment.Skin.SetColor(GuiDefaultColor.InactiveBorder, Color.Red);
            Reference.GUIEnvironment.Skin.SetColor(GuiDefaultColor.InactiveCaption, Color.Red);
            Reference.GUIEnvironment.Skin.SetColor(GuiDefaultColor.Light3D, Color.Gray);
            Reference.GUIEnvironment.Skin.SetColor(GuiDefaultColor.Scrollbar, Color.White);
            Reference.GUIEnvironment.Skin.SetColor(GuiDefaultColor.Shadow3D, new Color(240, 204, 204, 204));
            Reference.GUIEnvironment.Skin.SetColor(GuiDefaultColor.ToolTip, Color.Black);
            Reference.GUIEnvironment.Skin.SetColor(GuiDefaultColor.Window, Color.White);

            blinkTimer.Enabled = true;

            isChacheDeleteMessage = false;
        }
Ejemplo n.º 17
0
 public void SetFocus(GUIElement elem)
 {
     GuiEnv_SetFocus(_raw, elem.Raw);
 }
Ejemplo n.º 18
0
 public GUIWindow AddMessageBox(string caption, string text, bool modal, MessageBoxFlag flags, GUIElement parent, int id)
 {
     IntPtr par = (parent == null ? IntPtr.Zero : parent.Raw);
     return (GUIWindow)NativeElement.GetObject(GuiEnv_AddMessageBox(_raw, caption, text, modal, flags, par, id),
                                               typeof(GUIWindow));
 }
Ejemplo n.º 19
0
 public GUICheckBox AddCheckBox(bool ischecked, Rect rectangle, GUIElement parent, int id, string text)
 {
     IntPtr par = (parent == null ? IntPtr.Zero : parent.Raw);
     return (GUICheckBox)NativeElement.GetObject(GuiEnv_AddCheckBox(_raw, ischecked, rectangle.ToUnmanaged(), par, id, text),
                                               typeof(GUICheckBox));
 }
 public GUIButton AddButtonW(Rect rectangle, GUIElement parent, int id, string text)
 {
     IntPtr par = (parent == null ? IntPtr.Zero : parent.Raw);
     return (GUIButton)NativeElement.GetObject(GuiEnv_AddButtonW(_raw, rectangle.ToUnmanaged(), par, id, text),
                                               typeof(GUIButton));
 }
Ejemplo n.º 21
0
		public override void RemoveChild (GUIElement child)
		{
			CGE_PVOID_METHODS(_raw, CGE_VOID_METHOD.REMOVE_CHILD, 
			                  child==null?IntPtr.Zero:child.Raw, 0, 0, null);
		}
 public GUIWindow AddWindowW(Rect rectangle, bool modal, string text, GUIElement parent, int id)
 {
     IntPtr par = (parent == null ? IntPtr.Zero : parent.Raw);
     return (GUIWindow)NativeElement.GetObject(GuiEnv_AddWindowW(_raw, rectangle.ToUnmanaged(), modal, text, par, id),
                                               typeof(GUIWindow));
 }
Ejemplo n.º 23
0
 public GUIScrollBar AddScrollBar(bool horizontal, Rect rectangle, GUIElement parent, int id)
 {
     IntPtr par = (parent == null ? IntPtr.Zero : parent.Raw);
     return (GUIScrollBar)NativeElement.GetObject(GuiEnv_AddScrollBar(_raw, horizontal, rectangle.ToUnmanaged(), par, id),
                                               typeof(GUIScrollBar));
 }
Ejemplo n.º 24
0
        public override void Cleanup()
        {
            if (imageChat != null)
                imageChat.Visible = false;

            if (imageChair != null)
                imageChair.Visible = false;

            // Background textures need not be disposed in cleanup
            if (parentElement != null)
            {
                try
                {
                    try
                    {
                        parentElement.Remove();
                    }
                    catch { }
                }
                finally
                {
                    parentElement = null;
                }
            }
            timer.Enabled = false;
            blinkTimer.Enabled = false;
        }
 public GUIStaticText AddStaticTextW(string text, Rect rectangle, bool border, bool wordWrap, GUIElement parent, int id, bool fillBackground)
 {
     IntPtr par = (parent == null ? IntPtr.Zero : parent.Raw);
     return (GUIStaticText)NativeElement.GetObject(GuiEnv_AddStaticTextW(_raw, text, rectangle.ToUnmanaged(), border, wordWrap, par, id, fillBackground),
                                               typeof(GUIStaticText));
 }
Ejemplo n.º 26
0
 public GUITab AddTab(Rect rectangle, GUIElement parent, int id)
 {
     IntPtr par = (parent == null ? IntPtr.Zero : parent.Raw);
     return (GUITab)NativeElement.GetObject(GuiEnv_AddTab(_raw, rectangle.ToUnmanaged(), par, id),
                                               typeof(GUITab));
 }
Ejemplo n.º 27
0
 public virtual void AddChild(GUIElement child)
 {
     GuiElem_AddChild(_raw, child.Raw);
 }
Ejemplo n.º 28
0
 public GUITabControl AddTabControl(Rect rectangle, GUIElement parent, bool fillBackground, bool hasBorder, int id)
 {
     IntPtr par = (parent == null ? IntPtr.Zero : parent.Raw);
     return (GUITabControl)NativeElement.GetObject(GuiEnv_AddTabControl(_raw, rectangle.ToUnmanaged(), par, fillBackground, hasBorder, id),
                                               typeof(GUITabControl));
 }
Ejemplo n.º 29
0
 public virtual void RemoveChild(GUIElement child)
 {
     GuiElem_RemoveChild(_raw, child.Raw);
 }
Ejemplo n.º 30
0
 public GUIToolBar AddToolBar(GUIElement parent, int id)
 {
     IntPtr par = (parent == null ? IntPtr.Zero : parent.Raw);
     return (GUIToolBar)NativeElement.GetObject(GuiEnv_AddToolBar(_raw, par, id),
                                               typeof(GUIToolBar));
 }