Exemple #1
0
 public Button(IUIStyle style, string text = "", IUITexture iconTex = null) : base(style)
 {
     Content = new IconLabel(style)
     {
         Texture = iconTex, Text = text, Enabled = false, Anchor = AnchoredRect.CreateHorizontallyStretched()
     };
 }
        public NotebookTab(IUIStyle style) : base(style)
        {
            activationRequestedSupport = new EventSupport <EventArgs>();
            closeRequestedSupport      = new EventSupport <EventArgs>();

            emptyContent = new Label(UIStyle)
            {
                Anchor = AnchoredRect.CreateHorizontallyStretched()
            };

            closeButton = new Button(UIStyle);
            closeButton.AddStyleClass(CloseButtonStyleClass);
            closeButton.Anchor           = AnchoredRect.CreateCentered();
            closeButton.ActionPerformed += OnCloseButtonOnClicked;

            InternalContent = new DockPanel(UIStyle);
            InternalContent.LastChildFill = true;
            InternalContent.Add(closeButton, DockPanelConstraint.Right);
            InternalContent.Add(emptyContent, DockPanelConstraint.Left);

            KeyPressed   += OnKeyPressed;
            MouseClicked += OnMouseClick;

            Focusable = true;
        }
        public ListDataItemRenderer(IUIStyle style) : base(style)
        {
            selectionChangedSupport = new EventSupport <ListSelectionEventArgs>();
            Anchor          = AnchoredRect.CreateHorizontallyStretched();
            FocusedChanged += (s, e) =>
            {
                if (Focused)
                {
                    selectionChangedSupport.Raise(this, ListSelectionEventArgs.Adjusted);
                }
            };

            MouseClicked += OnMouseClick;
            KeyPressed   += OnKeyPressed;
        }
Exemple #4
0
 public Label(IUIStyle style) : base(style, new PlainTextDocumentEditor(style))
 {
     Content.Anchor = AnchoredRect.CreateHorizontallyStretched();
 }