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)); }
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)); }
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); }
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)); }
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); } }
public void RemoveFocus(GUIElement elem) { GuiEnv_RemoveFocus(_raw, elem.Raw); }
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 }
public bool BringToFront(GUIElement elem) { return GuiElem_BringToFront(_raw, elem.Raw); }
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; }
public override void AddChild (GUIElement child) { CGE_PVOID_METHODS(_raw, CGE_VOID_METHOD.ADD_CHILD, child.Raw, 0, 0, null); }
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)); }
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)); }
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)); }
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)); }
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; }
public void SetFocus(GUIElement elem) { GuiEnv_SetFocus(_raw, elem.Raw); }
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)); }
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)); }
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)); }
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)); }
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)); }
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)); }
public virtual void AddChild(GUIElement child) { GuiElem_AddChild(_raw, child.Raw); }
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)); }
public virtual void RemoveChild(GUIElement child) { GuiElem_RemoveChild(_raw, child.Raw); }
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)); }