public static void ParserBottomRightBorderUV(string[] parms, params object[] objects)
        {
            BorderPanel borderPanel = (BorderPanel)objects[0];

            float u1 = StringConverter.ParseFloat(parms[0]);
            float v1 = StringConverter.ParseFloat(parms[1]);
            float u2 = StringConverter.ParseFloat(parms[2]);
            float v2 = StringConverter.ParseFloat(parms[3]);

            borderPanel.SetCellUV(BorderCell.BottomRight, u1, v1, u2, v2);
        }
        public static void ParserBorderSize(string[] parms, params object[] objects)
        {
            BorderPanel borderPanel = (BorderPanel)objects[0];

            float left   = StringConverter.ParseFloat(parms[0]);
            float right  = StringConverter.ParseFloat(parms[1]);
            float top    = StringConverter.ParseFloat(parms[2]);
            float bottom = StringConverter.ParseFloat(parms[3]);

            borderPanel.SetBorderSize(left, right, top, bottom);
        }
Example #3
0
		/// <summary>
		/// Do not instantiate any widgets directly. Use SdkTrayManager.
		/// </summary>
		/// <param name="name"></param>
		/// <param name="caption"></param>
		/// <param name="width"></param>
		public CheckBox( String name, String caption, Real width )
		{
			IsCursorOver = false;
			isFitToContents = width <= 0;
			element = OverlayManager.Instance.Elements.CreateElementFromTemplate
				( "SdkTrays/CheckBox", "BorderPanel", name );
			OverlayElementContainer c = (OverlayElementContainer)element;
			this.textArea = (TextArea)c.Children[ Name + "/CheckBoxCaption" ];
			this.square = (BorderPanel)c.Children[ Name + "/CheckBoxSquare" ];
			this.x = this.square.Children[ this.square.Name + "/CheckBoxX" ];
			this.x.Hide();
			element.Width = width;
			this.Caption = caption;
		}
 /// <summary>
 ///
 /// </summary>
 /// <param name="parent"></param>
 public BorderRenderable(BorderPanel parent)
 {
     this.parent = parent;
 }
        public static void ParserBorderMaterial(string[] parms, params object[] objects)
        {
            BorderPanel borderPanel = (BorderPanel)objects[0];

            borderPanel.BorderMaterialName = parms[0];
        }
Example #6
0
		/// <summary>
		/// Do not instantiate any widgets directly. Use SdkTrayManager.
		/// </summary>
		/// <param name="name"></param>
		/// <param name="caption"></param>
		/// <param name="width"></param>
		/// <param name="height"></param>
		public TextBox( String name, String caption, Real width, Real height )
		{
			this.lines = new List<string>();
			element = OverlayManager.Instance.Elements.CreateElementFromTemplate( "SdkTrays/TextBox", "BorderPanel", name );
			element.Width = width;
			element.Height = height;
			var container = (OverlayElementContainer)element;
			this.textArea = (TextArea)container.Children[ Name + "/TextBoxText" ];
			this.captionBar = (BorderPanel)container.Children[ Name + "/TextBoxCaptionBar" ];
			this.captionBar.Width = width - 4;
			this.captionTextArea = (TextArea)this.captionBar.Children[ this.captionBar.Name + "/TextBoxCaption" ];
			Caption = caption;
			this.scrollTrack = (BorderPanel)container.Children[ Name + "/TextBoxScrollTrack" ];
			this.scrollHandle = (Panel)this.scrollTrack.Children[ this.scrollTrack.Name + "/TextBoxScrollHandle" ];
			this.scrollHandle.Hide();
			this.isDragging = false;
			this.scrollPercentage = 0;
			this.startingLine = 0;
			this.padding = 15;
			this.text = "";
			RefitContents();
		}
Example #7
0
		/// <summary>
		///  Do not instantiate any widgets directly. Use SdkTrayManager.
		/// </summary>
		/// <param name="name"></param>
		/// <param name="caption"></param>
		/// <param name="width"></param>
		/// <param name="boxWidth"></param>
		/// <param name="maxItemsShown"></param>
		public SelectMenu( String name, String caption, Real width, Real boxWidth, int maxItemsShown )
		{
			items = new List<string>();
			itemElements = new List<BorderPanel>();

			this.sectionIndex = -1;
			this.isFitToContents = false;
			this.IsCursorOver = false;
			this.isExpanded = false;
			this.isDragging = false;
			this.maxItemsShown = maxItemsShown;
			this.itemsShown = 0;
			element = (BorderPanel)OverlayManager.Instance.Elements.CreateElementFromTemplate
										( "SdkTrays/SelectMenu", "BorderPanel", name );
			this.textArea = (TextArea)( (OverlayElementContainer)element ).Children[ name + "/MenuCaption" ];
			this.smallBox = (BorderPanel)( (OverlayElementContainer)element ).Children[ name + "/MenuSmallBox" ];
			this.smallBox.Width = width - 10;
			this.smallTextArea = (TextArea)this.smallBox.Children[ name + "/MenuSmallBox/MenuSmallText" ];
			element.Width = width;

			if ( boxWidth > 0 )  // long style
			{
				if ( width <= 0 )
					this.isFitToContents = true;
				this.smallBox.Width = boxWidth;
				this.smallBox.Top = 2;
				this.smallBox.Left = width - boxWidth - 5;
				element.Height = this.smallBox.Height + 4;
				this.textArea.HorizontalAlignment = HorizontalAlignment.Left;
				this.textArea.TextAlign = HorizontalAlignment.Left;
				this.textArea.Left = 12;
				this.textArea.Top = 10;
			}

			this.expandedBox = (BorderPanel)( (OverlayElementContainer)element ).Children[ name + "/MenuExpandedBox" ];
			this.expandedBox.Width = this.smallBox.Width + 10;
			this.expandedBox.Hide();
			this.scrollTrack = (BorderPanel)this.expandedBox.Children[ this.expandedBox.Name + "/MenuScrollTrack" ];
			this.scrollHandle = (Panel)this.scrollTrack.Children[ this.scrollTrack.Name + "/MenuScrollHandle" ];

			this.Caption = caption;
		}
Example #8
0
		/// <summary>
		/// Do not instantiate any widgets directly. Use SdkTrayManager.
		/// </summary>
		/// <param name="name"></param>
		/// <param name="caption"></param>
		/// <param name="width"></param>
		/// <param name="trackWidth"></param>
		/// <param name="valueBoxWidth"></param>
		/// <param name="minValue"></param>
		/// <param name="maxValue"></param>
		/// <param name="snaps"></param>
		public Slider( String name, String caption, Real width, Real trackWidth, Real valueBoxWidth, Real minValue,
		               Real maxValue, int snaps )
		{
			this.isDragging = false;
			this.isFitToContents = false;
			element = OverlayManager.Instance.Elements.CreateElementFromTemplate( "SdkTrays/Slider", "BorderPanel", name );
			element.Width = width;
			var c = (OverlayElementContainer)element;
			this.textArea = (TextArea)c.Children[ Name + "/SliderCaption" ];
			var valueBox = (OverlayElementContainer)c.Children[ Name + "/SliderValueBox" ];
			valueBox.Width = valueBoxWidth;
			valueBox.Left = -( valueBoxWidth + 5 );
			this.valueTextArea = (TextArea)valueBox.Children[ valueBox.Name + "/SliderValueText" ];
			this.track = (BorderPanel)c.Children[ Name + "/SliderTrack" ];
			this.handle = (Panel)this.track.Children[ this.track.Name + "/SliderHandle" ];

			if ( trackWidth <= 0 ) // tall style
			{
				this.track.Width = width - 16;
			}
			else // long style
			{
				if ( width <= 0 )
				{
					this.isFitToContents = true;
				}
				element.Height = 34;
				this.textArea.Top = 10;
				valueBox.Top = 2;
				this.track.Top = -23;
				this.track.Width = trackWidth;
				this.track.HorizontalAlignment = HorizontalAlignment.Right;
				this.track.Left = -( trackWidth + valueBoxWidth + 5 );
			}

			Caption = caption;
			SetRange( minValue, maxValue, snaps, false );
		}
Example #9
0
			/// <summary>
			///
			/// </summary>
			/// <param name="parent"></param>
			public BorderRenderable( BorderPanel parent )
			{
				this.parent = parent;
			}
Example #10
0
		/// <summary>
		/// Creates a new instance of <see cref="Button" />
		/// </summary>
		/// <param name="name"></param>
		/// <param name="caption"></param>
		/// <param name="width"></param>
		/// <remarks>
		/// Do not instantiate any widgets directly. Use SdkTrayManager.
		/// </remarks>
		public Button( String name, String caption, Real width )
		{
			element = OverlayManager.Instance.Elements.CreateElementFromTemplate( "SdkTrays/Button", "BorderPanel", name );
			this.BorderPanel = (BorderPanel)element;
			this.TextArea = (TextArea)this.BorderPanel.Children[ this.BorderPanel.Name + "/ButtonCaption" ];
			this.TextArea.Top = -( this.TextArea.CharHeight/2 ); //
			if ( width > 0 )
			{
				element.Width = width;
				this.isFitToContents = false;
			}
			else
			{
				this.isFitToContents = true;
			}

			Caption = caption;
			State = ButtonState.Up;
		}