// ReSharper restore MemberCanBePrivate.Global #endregion protected override void CreateChildren() { //Debug.Log("Button skin creating children"); base.CreateChildren(); #region Background _background = new RectShape { Left = 0, Right = 0, Top = 0, Bottom = 0 }; AddChild(_background); #endregion #region Label LabelDisplay = new Label { HorizontalCenter = 0, VerticalCenter = 0, Right = 10, Left = 10, Top = 10, Bottom = 10, MouseEnabled = false }; AddChild(LabelDisplay); #endregion }
protected override void CreateChildren() { base.CreateChildren(); /** * Frame does not need to measure itself, and its size will always be explicitely set * */ _frame = new RectShape {Width = 50, Height = 50, FocusEnabled = false}; AddChild(_frame); /** * Label will measure itself, depending of text * */ _label = new Label(); AddChild(_label); }
// ReSharper restore MemberCanBePrivate.Global #endregion protected override void CreateChildren() { //Debug.Log("Button skin creating children"); base.CreateChildren(); #region Background _background = new RectShape { Left = 0, Right = 0, Top = 0, Bottom = 0, Alpha = 0.5f }; //_background.SetStyle("backgroundStyle", ButtonStyle.Instance); AddChild(_background); #endregion #region Box Group box = new Group { HorizontalCenter = 0, VerticalCenter = 0 }; AddChild(box); _boxBg = new RectShape { Left = 0, Right = 0, Top = 0, Bottom = 0, HorizontalCenter = 0, VerticalCenter = 0, /*MinWidth = 300, MinHeight = 100*/ }; //_background.SetStyle("backgroundStyle", ButtonStyle.Instance); _background.SetStyle("backgroundColor", Color.blue); box.AddChild(_boxBg); #endregion HGroup hGroup = new HGroup { Left = 10, Right = 10, Top = 10, Bottom = 10, HorizontalCenter = 0, VerticalCenter = 0, VerticalAlign = VerticalAlign.Middle }; box.AddChild(hGroup); #region Icon IconDisplay = new Image { MouseEnabled = false }; hGroup.AddChild(IconDisplay); #endregion #region Label LabelDisplay = new Label { Text = "miki", MouseEnabled = false, //Width = 100 }; hGroup.AddChild(LabelDisplay); #endregion }
protected override void CreateChildren() { base.CreateChildren(); #region Background _background = new RectShape { Id = "background", Left = 0, Right = 0, Top = 0, Bottom = 0 }; AddChild(_background); #endregion #region Border _border = new RectShape { Id = "overlay", Left = 0, Right = 0, Top = 0, Bottom = 0, MouseEnabled = false }; AddChild(_border); #endregion #region Header background _headerBackground = new RectShape { Id = "headerBackground", //Color = (Color?)GetStyle("headerBackgroundColor"), Left = 1, Right = 1, Top = 1, Height = 50 }; AddChild(_headerBackground); #endregion #region Header group HeaderGroup = new Group { Id = "headerGroup", Layout = new AbsoluteLayout(), Left = 1, Right = 1, Top = 1, Height = 50, MouseEnabled = true }; AddChild(HeaderGroup); #endregion #region Icon + label group _labelGroup = new HGroup { Left = 10, VerticalCenter = 0, Gap = 6, VerticalAlign = VerticalAlign.Middle, ClipAndEnableScrolling = true }; HeaderGroup.AddChild(_labelGroup); #endregion #region Icon display HeaderIconDisplay = new Image(); _labelGroup.AddChild(HeaderIconDisplay); #endregion #region Label display TitleDisplay = new Label(); _labelGroup.AddChild(TitleDisplay); #endregion #region Move area MoveArea = new Group { Id = "move_area", Layout = new AbsoluteLayout(), Left = 0, Right = 0, Top = 0, Bottom = 0, MouseEnabled = true }; HeaderGroup.AddChild(MoveArea); #endregion #region Tools ToolGroup = new Group { Id = "toolGroup", Layout = new HorizontalLayout { HorizontalAlign = HorizontalAlign.Right, VerticalAlign = VerticalAlign.Middle, Gap = 4 }, Right = 6, VerticalCenter = 0, MouseEnabled = true // not draggable when clicking space between buttons --- false // to be draggable on possible tools label click }; HeaderGroup.AddChild(ToolGroup); #endregion #region Content background _contentGroupBackground = new RectShape { Id = "contentGroupBackground", //Color = Color.white, Left = 6, Right = 6, Top = 50, Bottom = 50 }; AddChild(_contentGroupBackground); #endregion #region Scroller _scroller = new Scroller { Left = 6, Right = 6, Top = 50, Bottom = 50 }; AddChild(_scroller); #endregion #region Content group ContentGroup = new HGroup { Id = "contentGroup", Gap = 10, PaddingLeft = 10, PaddingRight = 10, PaddingTop = 10, PaddingBottom = 10, HorizontalAlign = HorizontalAlign.Center, VerticalAlign = VerticalAlign.Middle }; AddChild(ContentGroup); _scroller.Viewport = ContentGroup; #endregion #region Icon IconDisplay = new Image(); ContentGroup.AddChild(IconDisplay); #endregion #region Message display MessageDisplay = new Label { Multiline = true, MaxWidth = 800, MaxHeight = 600, Color = Color.black, }; MessageDisplay.SetStyle("labelStyle", GetStyle("labelStyle")); MessageDisplay.SetStyle("font", GetStyle("labelFont")); ContentGroup.AddChild(MessageDisplay); #endregion #region Control bar background _controlBarBackground = new RectShape { Id = "controlBarBackground", Left = 1, Right = 1, Bottom = 1, Height = 50, Alpha = 0.5f, MouseEnabled = false }; AddChild(_controlBarBackground); #endregion #region Control bar ControlBarGroup = new Group { Id = "controlBar", //ClipAndEnableScrolling = true, // this introduces a child positioning bug Layout = new HorizontalLayout { HorizontalAlign = HorizontalAlign.Right, VerticalAlign = VerticalAlign.Bottom, Gap = 4, PaddingLeft = 6, PaddingRight = 6, PaddingTop = 6, PaddingBottom = 6 }, ClipAndEnableScrolling = true, Left = 1, Right = 1, Bottom = 1, Height = 50, MouseEnabled = true // not draggable when clicking space between buttons --- false // to be draggable on possible tools label click }; AddChild(ControlBarGroup); #endregion }
protected override void CreateChildren() { //Debug.Log("Button skin creating children"); base.CreateChildren(); #region Background image /* just in case that no image is visible */ /*_background = new RectShape { Left = 0, Right = 0, Top = 0, Bottom = 0 }; _background.SetStyle("backgroundStyle", ButtonSingleStateStyle.Instance); AddChild(_background);*/ /* Tiled image */ _backgroundImage = new Image { Left = 0, Right = 0, Top = 0, Bottom = 0, Mode = ImageMode.Tiled, Visible = true }; AddChild(_backgroundImage); #endregion #region Icon + label group VGroup vGroup = new VGroup { Gap = 10, HorizontalAlign = HorizontalAlign.Center, VerticalAlign = VerticalAlign.Middle, HorizontalCenter = 0, VerticalCenter = 0, Right = 10, Left = 10, Top = 10, Bottom = 10, }; AddChild(vGroup); #endregion #region Label LabelDisplay = new Label { MouseEnabled = false, Multiline = true, Color = (Color) GetStyle("labelUpColor") }; vGroup.AddChild(LabelDisplay); #endregion #region Icon IconDisplay = new Image {MouseEnabled = false}; vGroup.AddChild(IconDisplay); #endregion }
protected override void CreateChildren() { //Debug.Log("Button skin creating children"); base.CreateChildren(); #region Background _background = new RectShape { Left = 0, Right = 0, Top = 0, Bottom = 0, BackgroundColor = (Color)GetStyle("backgroundColor") }; _background.SetStyle("backgroundStyle", ButtonSingleStateStyle.Instance); AddChild(_background); /*_backgroundImage = new Image { Left = 0, Right = 0, Top = 0, Bottom = 0, //Visible = false, ScaleMode = ImageScaleMode.ScaleToFill }; AddChild(_backgroundImage);*/ #endregion VGroup vGroup = new VGroup { Gap = 10, HorizontalAlign = HorizontalAlign.Center, VerticalAlign = VerticalAlign.Middle, HorizontalCenter = 0, VerticalCenter = 0, Right = 10, Left = 10, Top = 10, Bottom = 10, }; AddChild(vGroup); #region Icon IconDisplay = new Image { MouseEnabled = false, //Visible = false, //IncludeInLayout = false }; vGroup.AddChild(IconDisplay); #endregion #region Label LabelDisplay = new Label { MouseEnabled = false, //Visible = false, //IncludeInLayout = false }; vGroup.AddChild(LabelDisplay); #endregion }
// ReSharper restore MemberCanBePrivate.Global #endregion protected override void CreateChildren() { base.CreateChildren(); #region Background _background = new RectShape { Id = "background", Color = Color.white, Left = 0, Right = 0, Top = 0, Bottom = 0 }; AddChild(_background); _backgroundImage = new Image { //Id = "background_image", Left = 0, Right = 0, Top = 0, Bottom = 0, Visible = false, //Rotation = 30, //AspectRatio = 4, ScaleMode = ImageScaleMode.ScaleToFill }; AddChild(_backgroundImage); #endregion #region Header background _headerBackground = new RectShape { Id = "headerBackground", //Color = RgbColor.FromHex(0x000fff).ToColor(), BackgroundColor = (Color) GetStyle("headerBackgroundColor"), Left = 0, Right = 0, Top = 0, Height = 80 }; AddChild(_headerBackground); #endregion #region Header group HeaderGroup = new Group { Id = "headerGroup", Layout = new AbsoluteLayout(), Left = 0, Right = 0, Top = 0, Height = 80 }; AddChild(HeaderGroup); #endregion #region Title label TitleDisplay = new Label { Id = "titleLabel", Left = 10, VerticalCenter = 0 }; //TitleLabel.SetStyle("textColor", UnityEngine.Color.white); HeaderGroup.AddChild(TitleDisplay); #endregion #region Tools ToolGroup = new Group { Id = "toolGroup", Layout = new HorizontalLayout { HorizontalAlign = HorizontalAlign.Right, VerticalAlign = VerticalAlign.Middle, Gap = 4 }, Right = 6, VerticalCenter = 0, MouseEnabled = true // not draggable when clicking space between buttons --- false // to be draggable on possible tools label click }; HeaderGroup.AddChild(ToolGroup); #endregion #region Scroller _scroller = new Scroller { SkinClass = EvaluateSkinClassFromStyle("scrollerSkin"), Left = 0, Right = 0, Top = 80, Bottom = 50 }; AddChild(_scroller); #endregion #region Content group ContentGroup = new Group { Id = "contentGroup" }; //AddChild(ContentGroup); _scroller.Viewport = ContentGroup; #endregion #region Control bar background _controlBarBackground = new RectShape { Id = "controlBarBackground", BackgroundColor = ColorMixer.FromHex(0x000fff).ToColor(), Left = 0, Right = 0, Bottom = 0, Height = 50, //Alpha = 0.5f }; AddChild(_controlBarBackground); #endregion #region Control bar ControlBarGroup = new Group { Id = "controlBar", Layout = new HorizontalLayout { HorizontalAlign = HorizontalAlign.Right, VerticalAlign = VerticalAlign.Middle, Gap = 4, PaddingLeft = 10, PaddingRight = 10, PaddingTop = 10, PaddingBottom = 10 }, Left = 0, Right = 0, Bottom = 0, Height = 50, MouseEnabled = true // not draggable when clicking space between buttons --- false // to be draggable on possible tools label click }; AddChild(ControlBarGroup); #endregion #region Border _border = new RectShape { Id = "border", Left = 0, Right = 0, Top = 0, Bottom = 0, MouseEnabled = false }; AddChild(_border); #endregion }
//private Component _lastAddedControl; //internal override void StyleChanged(string styleName/*, object style*/) //{ // Debug.Log(string.Format("[{0}] -> StyleChanged [{1}]", this, styleName)); // base.StyleChanged(styleName/*, style*/); // switch (styleName) // { // case "labelStyle": // Children.ForEach(delegate(DisplayListMember child) // { // Label l = child as Label; // if (null != l) // l.SetStyle("labelStyle", GetStyle("labelStyle")); // }); // break; // } //} protected override void CreateChildren() { base.CreateChildren(); Debug.Log("CreateChildren.labelStyle: " + GetStyle("labelStyle")); _lbl = new Label(); //_lbl.SetStyle("labelStyle", GetStyle("labelStyle")); _lbl.Text = base.NavigatorDescriptor; _lbl.FocusEnabled = false; AddChild(_lbl); //_contentGroup = new Container(); _contentGroup.PercentWidth = 100; _contentGroup.PercentHeight = 100; AddChild(_contentGroup); }
protected override void CreateChildren() { base.CreateChildren(); /*#region Background _background = new RectShape { Id = "background", Left = 0, Right = 0, Top = 0, Bottom = 0 }; AddChild(_background); #endregion*/ #region Background image _backgroundImage = new Image { //Id = "background_image", Left = 0, Right = 0, Top = 0, Bottom = 0, Visible = false, Mode = ImageMode.Tiled }; AddChild(_backgroundImage); #endregion #region Border _border = new RectShape { Id = "overlay", Left = 0, Right = 0, Top = 0, Bottom = 0, MouseEnabled = false }; AddChild(_border); #endregion #region Header background _headerBackground = new RectShape { Id = "headerBackground", Left = 1, Right = 1, Top = 1, Height = 50 }; AddChild(_headerBackground); #endregion #region Header group HeaderGroup = new Group { Id = "headerGroup", Layout = new AbsoluteLayout(), Left = 1, Right = 1, Top = 1, Height = 50, MouseEnabled = true }; AddChild(HeaderGroup); #endregion #region Icon + label group _labelGroup = new HGroup { Left = 10, VerticalCenter = 0, Gap = 6, VerticalAlign = VerticalAlign.Middle, ClipAndEnableScrolling = true }; HeaderGroup.AddChild(_labelGroup); #endregion #region Icon display HeaderIconDisplay = new Image(); _labelGroup.AddChild(HeaderIconDisplay); #endregion #region Label display TitleDisplay = new Label(); _labelGroup.AddChild(TitleDisplay); #endregion #region Move area MoveArea = new Group { Id = "move_area", Layout = new AbsoluteLayout(), Left = 0, Right = 0, Top = 0, Bottom = 0, MouseEnabled = true }; HeaderGroup.AddChild(MoveArea); #endregion #region Tools ToolGroup = new Group { Id = "toolGroup", Layout = new HorizontalLayout { HorizontalAlign = HorizontalAlign.Right, VerticalAlign = VerticalAlign.Middle, Gap = 4 }, Right = 6, VerticalCenter = 0, MouseEnabled = true // not draggable when clicking space between buttons --- false // to be draggable on possible tools label click }; HeaderGroup.AddChild(ToolGroup); #endregion #region Content background _contentGroupBackground = new RectShape { Id = "contentGroupBackground", //Color = Color.white, Left = 6, Right = 6, Top = 50, Bottom = 50 }; AddChild(_contentGroupBackground); #endregion #region Scroller _scroller = new Scroller { Left = 6, Right = 6, Top = 50, Bottom = 50 }; AddChild(_scroller); #endregion #region Content group ContentGroup = new Group { Id = "contentGroup", //Left = 6, //Right = 6, //Top = 50, //Bottom = 50 }; AddChild(ContentGroup); _scroller.Viewport = ContentGroup; #endregion #region Control bar background _controlBarBackground = new RectShape { Id = "controlBarBackground", Left = 1, Right = 1, Bottom = 1, Height = 50, Alpha = 0.5f, MouseEnabled = false }; AddChild(_controlBarBackground); #endregion #region Control bar ControlBarGroup = new Group { Id = "controlBar", ClipAndEnableScrolling = true, Layout = new HorizontalLayout { HorizontalAlign = HorizontalAlign.Right, VerticalAlign = VerticalAlign.Bottom, Gap = 4, PaddingLeft = 6, PaddingRight = 6, PaddingTop = 6, PaddingBottom = 6 }, Left = 1, Right = 1, Bottom = 1, Height = 50, MouseEnabled = true }; AddChild(ControlBarGroup); #endregion }
protected override void CreateChildren() { base.CreateChildren(); #region Background _background = new RectShape { Left = 0, Right = 0, Top = 0, Bottom = 0 }; _background.SetStyle("backgroundStyle", GetStyle("backgroundStyle")); AddChild(_background); #endregion _group = new Group { Left = 0, Right = 0, Top = 0, Bottom = 0, Layout = GetLayout((bool)GetStyle("vertical")) }; AddChild(_group); #region Icon IconDisplay = new Image { MouseEnabled = false }; _group.AddChild(IconDisplay); #endregion #region Label LabelDisplay = new Label(); _group.AddChild(LabelDisplay); #endregion }
/*public override void SetCurrentState(string stateName) { base.SetCurrentState(stateName); Debug.Log("SetCurrentState: " + stateName); }*/ protected override void CreateChildren() { //Debug.Log("Button skin creating children"); base.CreateChildren(); #region Background _backgroundImage = new Image { Left = 0, Right = 0, Top = 0, Bottom = 0, Mode = ImageMode.Tiled, AdjustWidthToTexture = false, AdjustHeightToTexture = false, Visible = false // default }; AddChild(_backgroundImage); #endregion _hGroup = new HGroup { HorizontalCenter = 0, VerticalCenter = 0, Right = 6, Left = 6, Top = 6, Bottom = 6 }; AddChild(_hGroup); #region Icon _iconImage = new Image { Width = 16, Height = 16, MinWidth = 4, MinHeight = 4 }; _hGroup.AddChild(_iconImage); #endregion #region Label LabelDisplay = new Label(); _hGroup.AddChild(LabelDisplay); #endregion }
/// <summary> /// Adds the component to a form<br/> /// Registers th efield using the supplied ID /// </summary> /// <param name="id"></param> /// <param name="label"></param> /// <param name="control"></param> /// <param name="itemLayout"></param> /// <exception cref="Exception"></exception> public void AddField(string id, string label, Component control, LayoutBase itemLayout = null) { if (_dictFields.ContainsKey(id)) throw new Exception("Duplicated form element ID: " + id); _dictFields.Add(id, control); Group itemGroup = new Group { PercentWidth = 100, Layout = itemLayout ?? new VerticalLayout() // TODO: different item layouts }; /*_fieldGroup.*/AddChild(itemGroup); if (_dictItems.ContainsKey(id)) throw new Exception("Duplicated form element ID: " + id); _dictItems.Add(id, itemGroup); // 1) label Label lbl = new Label { Text = label, Width = LabelWidth }; lbl.SetStyle("labelStyle", GetStyle("itemLabelStyle")); itemGroup.AddChild(lbl); // 2) control if (null != control) { itemGroup.AddChild(control); } else lbl.PercentWidth = 100; }
// ReSharper restore MemberCanBePrivate.Global #endregion protected override void CreateChildren() { base.CreateChildren(); #region Background _background = new RectShape { Left = 0, Right = 0, Top = 0, Bottom = 0, Alpha = 0.5f }; AddChild(_background); #endregion #region Box _box = new RectShape { MinWidth = 300, MinHeight = 100, HorizontalCenter = 0, VerticalCenter = 0 }; AddChild(_box); #endregion HGroup hGroup = new HGroup { HorizontalCenter = 0, VerticalCenter = 0 }; AddChild(hGroup); #region Icon IconDisplay = new Image { MouseEnabled = false }; hGroup.AddChild(IconDisplay); #endregion #region Label LabelDisplay = new Label { Text = "miki", MouseEnabled = false, Width = 100 }; hGroup.AddChild(LabelDisplay); #endregion }
// ReSharper restore MemberCanBePrivate.Global #endregion protected override void CreateChildren() { //Debug.Log("Button skin creating children"); base.CreateChildren(); #region Background _background = new RectShape { //Id = "background", //Color = (Color)GetStyle("backgroundColor"), Left = 0, Right = 0, Top = 0, Bottom = 0 }; //_background.SetStyle("backgroundStyle", ButtonStyle.Instance); AddChild(_background); #endregion #region Label LabelDisplay = new Label { HorizontalCenter = 0, VerticalCenter = 0, Right = 10, Left = 10, Top = 10, Bottom = 10, MouseEnabled = false }; AddChild(LabelDisplay); #endregion }
protected override void CreateChildren() { //Debug.Log("Button skin creating children"); base.CreateChildren(); #region Background _background = new RectShape { Left = 0, Right = 0, Top = 0, Bottom = 0, BackgroundColor = (Color) GetStyle("backgroundUpColor") }; _background.SetStyle("backgroundStyle", ButtonSingleStateStyle.Instance); AddChild(_background); #endregion #region Shine _shine = new RectShape { Left = 1, Right = 1, Top = 1, Height = GetCurrentShineHeight("up"), MouseEnabled = false }; _shine.SetStyle("backgroundStyle", GetShineStyle()); _shine.BackgroundColor = (Color) GetStyle("shineColor"); AddChild(_shine); #endregion VGroup vGroup = new VGroup { Gap = 10, HorizontalAlign = HorizontalAlign.Center, VerticalAlign = VerticalAlign.Middle, HorizontalCenter = 0, VerticalCenter = 0, Right = 10, Left = 10, Top = 10, Bottom = 10, }; AddChild(vGroup); #region Label LabelDisplay = new Label { MouseEnabled = false, Multiline = true, Color = (Color) GetStyle("labelUpColor") }; vGroup.AddChild(LabelDisplay); #endregion #region Icon IconDisplay = new Image {MouseEnabled = false}; vGroup.AddChild(IconDisplay); #endregion }
protected override void CreateChildren() { base.CreateChildren(); #region Popup anchor _anchor = new PopUpAnchor { Id = "pop_up", Left = 0, Right = 0, Top = 0, Bottom = 0, PopupPosition = PopupPosition.Below, PopupWidthMatchesAnchorWidth = true }; AddChild(_anchor); #endregion #region DropDown DropDown = new Group { Id = "drop_down", MaxHeight = 134, MinHeight = 22, Width = 150 }; //AddChild(DropDown); _anchor.Popup = DropDown; #endregion #region Background _background = new RectShape { Id = "background", Left = 0, Right = 0, Top = 0, Bottom = 0 }; DropDown.AddChild(_background); #endregion #region Scroller _scroller = new Scroller { Id = "scroller", SkinClass = EvaluateSkinClassFromStyle("scrollerSkin"), Left = 0, Right = 0, Top = 0, Bottom = 0, MinViewportInset = 1, HasFocusableChildren = false, Height = 100 }; DropDown.AddChild(_scroller); #endregion #region Data group DataGroup = new DataGroup { Id = "data_group", ItemRenderer = new ItemRendererFactory<DefaultItemRenderer>(), Layout = new VerticalLayout { Gap = 0, HorizontalAlign = HorizontalAlign.ContentJustify, RequestedMinRowCount = 5 } }; _scroller.Viewport = DataGroup; #endregion #region Border _border = new RectShape { Id = "border", Left = 0, Right = 0, Top = 0, Bottom = 0, MouseEnabled = false }; DropDown.AddChild(_border); #endregion #region OpenButton OpenButton = new Button { Left = 0, Right = 0, Top = 0, Bottom = 0, FocusEnabled = false, SkinClass = typeof(DropDownListButtonSkin) }; AddChild(OpenButton); #endregion #region Label LabelDisplay = new Label { VerticalCenter = 0, Left = 7, Right = 32, Top = 2, Bottom = 2, Width = 75, MouseEnabled = false, Color = Color.black }; //LabelDisplay.SetStyle("color", GetStyle("textColor")); AddChild(LabelDisplay); #endregion }
// ReSharper restore MemberCanBePrivate.Global #endregion protected override void CreateChildren() { base.CreateChildren(); #region Background _background = new RectShape { Id = "background", Left = 0, Right = 0, Top = 0, Bottom = 0 }; AddChild(_background); #endregion #region Border _border = new RectShape { Id = "border", Left = 0, Right = 0, Top = 0, Bottom = 0, MouseEnabled = false }; AddChild(_border); #endregion #region Header background _headerBackground = new RectShape { Id = "headerBackground", //Color = (Color?)GetStyle("headerBackgroundColor"), Left = 1, Right = 1, Top = 1, Height = 50 }; AddChild(_headerBackground); #endregion #region Header group HeaderGroup = new Group { Id = "headerGroup", Layout = new AbsoluteLayout(), Left = 1, Right = 1, Top = 1, Height = 50 }; AddChild(HeaderGroup); #endregion #region Icon + label group HGroup hgroup = new HGroup { Left = 10, VerticalCenter = 0, Gap = 6, VerticalAlign = VerticalAlign.Middle }; HeaderGroup.AddChild(hgroup); #endregion #region Icon display HeaderIconDisplay = new Image { //Id = "titleLabel", //Text = "miki!", Left = 10, VerticalCenter = 0 }; hgroup.AddChild(HeaderIconDisplay); #endregion #region Title label TitleDisplay = new Label { //Id = "titleLabel", Left = 10, VerticalCenter = 0 }; //TitleLabel.SetStyle("textColor", UnityEngine.Color.white); hgroup.AddChild(TitleDisplay); #endregion #region Tools ToolGroup = new Group { Id = "toolGroup", Layout = new HorizontalLayout { HorizontalAlign = HorizontalAlign.Right, VerticalAlign = VerticalAlign.Middle, Gap = 4 }, Right = 6, VerticalCenter = 0, MouseEnabled = true // not draggable when clicking space between buttons --- false // to be draggable on possible tools label click }; HeaderGroup.AddChild(ToolGroup); #endregion #region Content background _contentGroupBackground = new RectShape { Left = 6, Right = 6, Top = 50, Bottom = 50 }; AddChild(_contentGroupBackground); #endregion #region Scroller _scroller = new Scroller { SkinClass = EvaluateSkinClassFromStyle("scrollerSkin"), Left = 6, Right = 6, Top = 50, Bottom = 50 }; AddChild(_scroller); #endregion #region Content group ContentGroup = new Group { Id = "contentGroup", //Left = 6, //Right = 6, //Top = 50, //Bottom = 50 }; //AddChild(ContentGroup); _scroller.Viewport = ContentGroup; #endregion #region Control bar background _controlBarBackground = new RectShape { Id = "controlBarBackground", Left = 1, Right = 1, Bottom = 1, Height = 50, Alpha = 0.5f // note: alpha! }; AddChild(_controlBarBackground); #endregion #region Control bar ControlBarGroup = new Group { Id = "controlBar", Layout = new HorizontalLayout { HorizontalAlign = HorizontalAlign.Right, VerticalAlign = VerticalAlign.Middle, Gap = 4, PaddingLeft = 6, PaddingRight = 6, PaddingTop = 6, PaddingBottom = 6 }, Left = 1, Right = 1, Bottom = 1, Height = 50, MouseEnabled = true // not draggable when clicking space between buttons --- false // to be draggable on possible tools label click }; AddChild(ControlBarGroup); #endregion }
// ReSharper restore MemberCanBePrivate.Global #endregion protected override void CreateChildren() { base.CreateChildren(); #region Background _background = new RectShape { Id = "background", Left = 0, Right = 0, Top = 0, Bottom = 0 }; AddChild(_background); #endregion #region Border _border = new RectShape { Id = "overlay", Left = 0, Right = 0, Top = 0, Bottom = 0, MouseEnabled = false }; AddChild(_border); #region Header background _headerBackground = new RectShape { Id = "headerBackground", Left = 1, Right = 1, Top = 1, Height = 50 }; AddChild(_headerBackground); #endregion #region Header group HeaderGroup = new Group { Id = "headerGroup", Layout = new AbsoluteLayout(), Left = 1, Right = 1, Top = 1, Height = 50, MouseEnabled = true }; AddChild(HeaderGroup); #endregion #region Icon + label group _labelGroup = new HGroup { Left = 10, VerticalCenter = 0, Gap = 6, VerticalAlign = VerticalAlign.Middle, ClipAndEnableScrolling = true }; HeaderGroup.AddChild(_labelGroup); #endregion #region Icon display HeaderIconDisplay = new Image { /*Left = 10, VerticalCenter = 0*/ }; _labelGroup.AddChild(HeaderIconDisplay); #endregion #region Label display TitleDisplay = new Label { //Id = "titleLabel", //Left = 10, //VerticalCenter = 0 }; //TitleLabel.SetStyle("textColor", UnityEngine.Color.white); _labelGroup.AddChild(TitleDisplay); #endregion #region Move area MoveArea = new Group { Id = "move_area", Layout = new AbsoluteLayout(), Left = 0, Right = 0, Top = 0, Bottom = 0, MouseEnabled = true }; HeaderGroup.AddChild(MoveArea); #endregion #region Tools ToolGroup = new Group { Id = "toolGroup", Layout = new HorizontalLayout { HorizontalAlign = HorizontalAlign.Right, VerticalAlign = VerticalAlign.Middle, Gap = 4 }, Right = 6, VerticalCenter = 0, MouseEnabled = true // not draggable when clicking space between buttons --- false // to be draggable on possible tools label click }; HeaderGroup.AddChild(ToolGroup); #endregion #region Content background _contentGroupBackground = new RectShape { Id = "contentGroupBackground", Left = 6, Right = 6, Top = 50, Bottom = 50 }; AddChild(_contentGroupBackground); #endregion #region Scroller _scroller = new Scroller { Left = 6, Right = 6, Top = 50, Bottom = 50 }; AddChild(_scroller); #endregion #region Content group ContentGroup = new Group { Id = "contentGroup", //Left = 6, //Right = 6, //Top = 50, //Bottom = 50 }; /** * Panel: in designer, children not focusable (textarea) * Problem je bio u WindowSkinu: * ContentGroup = new Group{ Id = "contentGroup" }; * AddChild(ContentGroup); // -> ova linija radi problem (ako se izbaci, sve je ok) * _scroller.Viewport = ContentGroup; * */ // AddChild(ContentGroup); _scroller.Viewport = ContentGroup; #endregion #region Control bar background _controlBarBackground = new RectShape { Id = "controlBarBackground", Left = 1, Right = 1, Bottom = 1, Height = 50, Alpha = 0.5f, MouseEnabled = false }; AddChild(_controlBarBackground); #endregion #region Control bar ControlBarGroup = new Group { Id = "controlBar", ClipAndEnableScrolling = true, Layout = new HorizontalLayout { HorizontalAlign = HorizontalAlign.Right, VerticalAlign = VerticalAlign.Middle, Gap = 4, PaddingLeft = 6, PaddingRight = 6, PaddingTop = 6, PaddingBottom = 6 }, Left = 1, Right = 1, Bottom = 1, Height = 50, MouseEnabled = true }; AddChild(ControlBarGroup); #endregion #endregion }