コード例 #1
0
        protected virtual void CreateTitlebar()
        {
            captionComponent = new ColossalControl <UISlicedSprite>("Caption");
            windowPanel.AttachControl(captionComponent);
            captionComponent.Width            = windowPanel.Width;
            captionComponent.Height           = 40;
            captionComponent.Anchor           = Anchor.Top | Anchor.Left | Anchor.Right;
            captionComponent.ZOrder           = 0;
            captionComponent.IsActive         = true;
            captionComponent.RelativePosition = Vector3.zero;

            dragHandle = new DragHandle("Drag Handle");
            captionComponent.AttachControl(DragHandle);
            dragHandle.Target           = windowPanel;
            dragHandle.Width            = windowPanel.Width;
            dragHandle.Height           = 40;
            dragHandle.Anchor           = Anchor.All;
            dragHandle.ZOrder           = 1;
            dragHandle.IsActive         = true;
            dragHandle.RelativePosition = Vector3.zero;

            labelComponent = new ColossalControl <UILabel>("Label");
            captionComponent.AttachControl(labelComponent);
            labelComponent.Height                = 40;
            labelComponent.Anchor                = Anchor.CenterHorizontal | Anchor.CenterVertical;
            labelComponent.EnableAutoSize        = true;
            labelComponent.Color                 = new Color32(254, 254, 254, 255);
            labelComponent.UIComponent.textColor = new Color32(254, 254, 254, 255);
            labelComponent.Pivot                 = PivotPoint.TopLeft;
            labelComponent.ZOrder                = 0;
            labelComponent.IsActive              = true;

            closeButton = new Button("Close");
            captionComponent.AttachControl(closeButton);
            closeButton.Text                    = String.Empty;
            closeButton.IsTooltipOnTop          = true;
            closeButton.CharacterSpacing        = 0;
            closeButton.Color                   = new Color32(254, 254, 254, 255);
            closeButton.Width                   = 32;
            closeButton.Height                  = 32;
            closeButton.NormalBackgroundSprite  = "buttonclose";
            closeButton.HoveredColor            = new Color32(254, 254, 254, 255);
            closeButton.HoveredBackgroundSprite = "buttonclosehover";
            closeButton.PressedColor            = new Color32(254, 254, 254, 255);
            closeButton.PressedBackgroundSprite = "buttonclosepressed";
            closeButton.FocusedColor            = new Color32(254, 254, 254, 255);
            closeButton.FocusedBackgroundSprite = "buttonclose";
            closeButton.OutlineColor            = new Color32(0, 0, 0, 255);
            closeButton.Pivot                   = PivotPoint.TopLeft;
            closeButton.Anchor                  = Anchor.Top | Anchor.Right;
            closeButton.ZOrder                  = 2;
            closeButton.IsActive                = true;
            closeButton.RelativePosition        = new Vector3(this.windowPanel.Width - 36, 4);
        }
コード例 #2
0
 public FocusEventArgs(UIFocusEventParameter originalParams)
     : base(originalParams)
 {
     this.FocusedControl   = ColossalControl.FromUIComponent(originalParams.gotFocus);
     this.LostFocusControl = ColossalControl.FromUIComponent(originalParams.lostFocus);
 }
コード例 #3
0
 public static ColossalControl ToSkylineToolkitControl(this UIComponent component)
 {
     return(ColossalControl.FromUIComponent(component));
 }
コード例 #4
0
 public TooltipEventArgs(UITooltipEventParameter originalParams)
     : base(originalParams)
 {
     this.TooltipControl = ColossalControl.FromUIComponent(originalParams.tooltip);
 }
コード例 #5
0
 public static ColossalControl <T> ToSkylineToolkitControl <T>(this UIComponent component)
     where T : UIComponent
 {
     return((ColossalControl <T>) ColossalControl <T> .FromUIComponent(component));
 }