public Button(string name, IGuiSize size, IGuiStyle style, string text) : this(name, size, style, null, text) { }
public Image(string name, IGuiStyle style, IGuiSize size) : base(name, size, style) { mTexture = null; }
public Button BuildTabButton(XmlNode buttonNode) { string name = BuildName(buttonNode); IGuiSize size = BuildSize(buttonNode); IGuiStyle activatedStyle = GetNamedStyle(buttonNode, "activatedStyle", typeof(TabButton)); IGuiStyle deactivatedStyle = GetNamedStyle(buttonNode, "deactivatedStyle", typeof(TabButton)); Texture image = null; if (buttonNode.Attributes["image"] != null) { image = BuildTexture(buttonNode, "image"); } IGuiFrame frame = null; XmlNode frameNode = buttonNode.SelectSingleNode("Frame"); XmlNode scrollFrameNode = buttonNode.SelectSingleNode("ScrollFrame"); if (frameNode != null) { frame = BuildFrame(frameNode); } if (scrollFrameNode != null) { frame = BuildScrollFrame(scrollFrameNode); } if (frame == null) { throw new GuiConstructionException("Cannot create TabButton (" + name + "), cannot find frame child node."); } return(new TabButton(name, size, activatedStyle, deactivatedStyle, image, frame)); }
public TopLevel(string name, IGuiSize size, IGuiPosition position, IGuiManager manager, KeyValuePair <IGuiFrame, IGuiPosition> mainFrame, IGuiStyle style) : base(name, size, style) { if (manager == null) { throw new ArgumentNullException("manager"); } if (position == null) { throw new ArgumentNullException("position"); } mPosition = position; mWindowId = UnityWindowIdManager.RequestNewWindowId(); mManager = manager; mManager.RegisterTopLevel(this, position); mMainFrame = mainFrame; if (mMainFrame.Value == null) { mMainFrame = new KeyValuePair <IGuiFrame, IGuiPosition>(mainFrame.Key, new MainFrameSizePosition()); } if (mMainFrame.Key != null) { mMainFrame.Key.Parent = this; } }
public Window(string name, IGuiSize size, IGuiManager manager, IGuiFrame mainFrame) : this(name, size, manager, new KeyValuePair <IGuiFrame, IGuiPosition>(mainFrame, null), new KeyValuePair <IGuiFrame, IGuiPosition>(null, null), null) { }
public Window(string name, IGuiSize size, IGuiPosition position, IGuiManager manager, KeyValuePair <IGuiFrame, IGuiPosition> mainFrame, KeyValuePair <IGuiFrame, IGuiPosition> headerFrame, DragBehavior isDraggable, IGuiStyle style) : base(name, size, position, manager, mainFrame, style) { mLogger = manager.Logger; mDraggable = isDraggable; mHeaderFrame = headerFrame; if (mHeaderFrame.Key != null) { mHeaderFrame.Key.Parent = this; } if (mHeaderFrame.Value == null) { mHeaderFrame = new KeyValuePair <IGuiFrame, IGuiPosition> ( mHeaderFrame.Key, new HeaderFrameSizePosition() ); } }
public ProgressView(string name, IGuiSize size, IGuiFrame progressFrame, IGuiPosition progressFramePosition, IGuiStyle progressLabelsStyle, IGuiFrame contextFrame, IGuiPosition contextFramePosition) : base(name, size, null) { if (progressFrame == null) { throw new ArgumentNullException("progressFrame"); } if (progressFramePosition == null) { throw new ArgumentNullException("progressFramePosition"); } if (contextFrame == null) { throw new ArgumentNullException("contextFrame"); } if (contextFramePosition == null) { throw new ArgumentNullException("contextFramePosition"); } mProgressFrame = new Pair <IGuiFrame, IGuiPosition>(progressFrame, progressFramePosition); mContextFrame = new Pair <IGuiFrame, IGuiPosition>(contextFrame, contextFramePosition); mProgressLabelStyle = progressLabelsStyle; mProgressFrame.First.Parent = this; mContextFrame.First.Parent = this; }
protected override Window BuildWindow(XmlNode windowNode) { string name = BuildName(windowNode); IGuiSize size = BuildSize(windowNode); IGuiFrame mainFrame = null; IGuiPosition mainFramePosition = null; XmlNode mainFrameNode = windowNode.SelectSingleNode("MainFrame"); if (mainFrameNode != null) { mainFramePosition = BuildPosition(mainFrameNode); mainFrame = BuildFrame(mainFrameNode); if (mainFrame == null) { throw new GuiConstructionException("Found MainFrame node in Window (" + name + "), but was unable to construct it."); } } IGuiStyle style = GetStyle(windowNode, typeof(Window)); return(new DockableEditorTab ( name, size, mManager, new KeyValuePair <IGuiFrame, IGuiPosition> ( mainFrame, mainFramePosition ), style )); }
public Button(string name, IGuiSize size, IGuiStyle style, Texture image) : this(name, size, style, image, null) { }
public PushButton(string name, IGuiSize size, IGuiStyle style, Texture image, string text) : base(name, size, style, image, text) { }
public DockableEditorTab(string name, IGuiSize size, IGuiManager manager, KeyValuePair <IGuiFrame, IGuiPosition> mainFrame, IGuiStyle style) : base(name, size, manager, mainFrame, new KeyValuePair <IGuiFrame, IGuiPosition>(null, null), style) { }
public GuiRange(string name, IGuiStyle style, IGuiSize size) : base(name, size, style) { mBounds = new Rangef(0.0f, 1.0f); Percent = 0.0f; }
public Label(string name, IGuiSize size, IGuiStyle style, string text) : base(name, size, style) { mText = text; }
public Window(string name, IGuiSize size, IGuiManager manager, IGuiFrame mainFrame, IGuiFrame headerFrame, IGuiStyle style) : this(name, size, manager, new KeyValuePair <IGuiFrame, IGuiPosition>(mainFrame, null), new KeyValuePair <IGuiFrame, IGuiPosition>(headerFrame, null), style) { }
public Textbox(string name, IGuiSize size, IGuiStyle style, string text, bool singleLine, bool userEditable) : this(name, size, style, text, singleLine, userEditable, null) { }
public Window(string name, IGuiSize size, IGuiManager manager, KeyValuePair <IGuiFrame, IGuiPosition> mainFrame, KeyValuePair <IGuiFrame, IGuiPosition> headerFrame, IGuiStyle style) : this(name, size, manager, mainFrame, headerFrame, Window.DefaultDragBehavior, style) { }
public Image(string name, IGuiStyle style, IGuiSize size, Texture2D texture) : base(name, size, style) { // TODO: Nobody destroys this texture that we just created. This essentially creates a leak here. mTexture = TextureUtility.ResizeTexture(texture, (int)size.GetSize(this).x, (int)size.GetSize(this).y); }
public Window(string name, IGuiSize size, IGuiManager manager, KeyValuePair <IGuiFrame, IGuiPosition> mainFrame, KeyValuePair <IGuiFrame, IGuiPosition> headerFrame, DragBehavior isDraggable, IGuiStyle style) : this(name, size, new FixedPosition(new Vector2(Screen.width * 0.5f, Screen.height * 0.5f)), manager, mainFrame, headerFrame, isDraggable, style) { }
public SelectableFrame(string name, IGuiSize size, IEnumerable <KeyValuePair <IWidget, IGuiPosition> > widgets, IGuiStyle unselectedStyle, IGuiStyle selectedStyle) : base(name, size, widgets, unselectedStyle) { mSelectedStyle = selectedStyle; mUnselectedStyle = unselectedStyle; }
public Label BuildLabel(XmlNode labelNode) { string name = BuildName(labelNode); IGuiSize size = BuildSize(labelNode); IGuiStyle style = GetStyle(labelNode, typeof(Label)); string text = BuildText(labelNode); return(new Label(name, size, style, text)); }
public Button(string name, IGuiSize size, IGuiStyle style, Texture image, string text) : base(name, size, style) { mImage = image; mText = text; }
public TabButton(string name, IGuiSize size, IGuiStyle activatedStyle, IGuiStyle deactivatedStyle, Texture image, IGuiFrame frame) : base(name, size, activatedStyle, deactivatedStyle, image) { mFrame = frame; }
public ScrollFrame(string name, IGuiSize size, IEnumerable <KeyValuePair <IWidget, IGuiPosition> > widgets, IGuiStyle frameStyle) : base(name, size, widgets, frameStyle) { AddModifyPositionCallback(delegate(Vector2 widgetPosition) { return(widgetPosition + mScrollOffset); }); }
/** * /param[frameStyle] Can be null for an invisible GuiFrame * /param[widgets] All the widgets for this frame. The list of widgets can be a Dictionary if the ordering doesn't matter. If ordering is required (ex. if the widgets use IAutoLayouts), then pass an ordered IEnumerator (List or Array). */ public GuiFrame(string name, IGuiSize size, IEnumerable <KeyValuePair <IWidget, IGuiPosition> > widgets, IGuiStyle frameStyle) : base(name, size, frameStyle) { if (widgets == null) { throw new ArgumentNullException("widgets"); } mWidgets = new List <KeyValuePair <IWidget, IGuiPosition> >(widgets); RegisterChildrenWidgets(); }
public GuiRange(string name, IGuiStyle style, IGuiSize size, Rangef bounds, float position) : base(name, size, style) { if (bounds == null) { throw new ArgumentNullException("position"); } mBounds = bounds; Percent = position; }
public Button BuildPushButton(XmlNode buttonNode) { string name = BuildName(buttonNode); IGuiSize size = BuildSize(buttonNode); IGuiStyle style = GetStyle(buttonNode, typeof(Button)); Texture image = null; if (buttonNode.Attributes["image"] != null) { image = BuildTexture(buttonNode, "image"); } string text = BuildText(buttonNode); return(new PushButton(name, size, style, image, text)); }
public GuiElement(string name, IGuiSize size, IGuiStyle style) { if (size == null) { throw new ArgumentNullException("size"); } if (name == null) { throw new ArgumentNullException("name"); } mStyle = style; mName = name; mSize = size; }
public ScrollbarThumb(string name, IGuiStyle style, IGuiSize size, Scrollbar scrollbar) : base(name, size, style) { if (style == null) { throw new ArgumentNullException("style"); } if (scrollbar == null) { throw new ArgumentNullException("scrollbar"); } mScrollbar = scrollbar; }
public IWidget BuildAnimation(XmlNode widgetNode) { string name = BuildName(widgetNode); IGuiSize size = BuildSize(widgetNode); IGuiStyle style = GetStyle(widgetNode, typeof(GuiAnimation)); float? playbackFpsDuration = null; XmlNode playbackFpsNode = widgetNode.SelectSingleNode("@playbackFps"); if (playbackFpsNode != null) { playbackFpsDuration = 1.0f / float.Parse(playbackFpsNode.InnerText); } List <GuiAnimation.Frame> frames = new List <GuiAnimation.Frame>(); foreach (XmlNode animationFrameNode in widgetNode.SelectNodes("Frame")) { float time = 0.0f; XmlNode durationNode = animationFrameNode.SelectSingleNode("@duration"); if (durationNode == null && playbackFpsDuration == null) { throw new GuiConstructionException("Animation(" + name + ") requires duration information for each of it's Frames (either a playbackFps attribute on the Animation node, or a duration attribute on each of the Frame nodes."); } else if (durationNode != null) { time = float.Parse(durationNode.InnerText); } else { time = (float)playbackFpsDuration; } Texture2D image = BuildTexture(animationFrameNode, "path"); frames.Add(new GuiAnimation.Frame(image, time)); } if (frames.Count == 0) { throw new GuiConstructionException("Animation(" + name + ") has no Frame nodes."); } return(new GuiAnimation(name, size, style, frames)); }
public Textbox(string name, IGuiSize size, IGuiStyle style, string text, bool singleLine, bool userEditable, int?maxLength) : base(name, size, style) { if (mText == null) { throw new ArgumentNullException("text"); } mText = text; mSingleLine = singleLine; mUserEditable = userEditable; mMaxLength = maxLength; }