Example #1
0
		public ButtonView(GeeUIMain GeeUI, View rootView, string text, Vector2 position)
			: base(GeeUI, rootView)
		{
			NinePatchNormal = GeeUIMain.NinePatchBtnDefault;
			NinePatchHover = GeeUIMain.NinePatchBtnHover;
			NinePatchClicked = GeeUIMain.NinePatchBtnClicked;
			Position.Value = position;

			//Make the TextView for the text
			var textV = new TextView(this.ParentGeeUI, this, text, new Vector2(0, 0)) {TextJustification = TextJustification.Left};
			Width.Value = (textV.Width.Value = (int)GeeUIMain.Font.MeasureString(text).X) + NinePatchNormal.LeftWidth + NinePatchNormal.RightWidth;
			Height.Value = (textV.Height.Value = (int)GeeUIMain.Font.MeasureString(text).Y) + NinePatchNormal.TopHeight + NinePatchNormal.BottomHeight;
		}
Example #2
0
		public ToolTip(GeeUIMain theGeeUI, View parentView, View linkedTo, string text)
			: base(theGeeUI, parentView)
		{
			this.Patch = GeeUIMain.NinePatchPanelUnselected;

			ToolTipText.Value = text;
			TextView = new TextView(theGeeUI, this, text, Vector2.Zero);
			this.ChildrenLayouts.Add(new ExpandToFitLayout());
			this.ChildrenLayouts.Add(new VerticalViewLayout(0, false));

			this.realParent = linkedTo;

			if (this.realParent != null)
				this.Add(new NotifyBinding(this.CheckActive, this.realParent.Active, this.realParent.Attached));
			
			this.Add(new NotifyBinding(this.CheckActive, this.Active));

			this.AnchorPoint.Value = new Vector2(0f, 1f);
			this.Position.Value = InputManager.GetMousePosV();

			this.Add(new NotifyBinding(CheckActive, this.Active, realParent.Active));
			this.AnimateIn();
		}