public NotebookTabList(IUIStyle style) : base(style) { activeTabChangedSupport = new EventSupport <EventArgs>(); allowDragReorder = true; notebookStyle = StyleSystem.StylesFor <NotebookStyleDefinition>(); DragState = new DragNDropState(this); }
public ListView(IUIStyle style) : base(style) { selectionChangedSupport = new EventSupport <ListSelectionEventArgs>(); listViewStyle = StyleSystem.StylesFor <ListViewStyleDefinition>(); selectedIndex = -1; InternalContent = new ScrollPanel <BoxGroup>(UIStyle) { Content = new BoxGroup(UIStyle) { Orientation = Orientation.Vertical } }; DataItems = new ObservableCollection <T>(); DataItems.CollectionChanged += (s, e) => { RebuildDataRenderers(); InvalidateLayout(); }; CreateRenderer = ListView.DefaultCreateRenderer; MinHeight = 0; MaxHeight = int.MaxValue; }
protected TextWidgetBase(IUIStyle style, IDocumentEditor <TView, TDocument> editor) : base(style) { textStyles = StyleSystem.StylesFor <TextStyleDefinition>(); ChildrenChanged += HandleOnChildrenChanged; DocumentEditor = editor; Content = DocumentEditor.CreateDocumentView(AnchoredRect.CreateTopAnchored()); WrapText = WrapText.Auto; }
public Notebook(IUIStyle style) : base(style) { notebookStyle = StyleSystem.StylesFor <NotebookStyleDefinition>(); Tabs = new NotebookTabList(UIStyle); Tabs.ActiveTabChanged += (s, e) => { panel.Content = Tabs.ActiveTab?.Content; }; Tabs.AddNotify(this); RaiseChildAdded(0, Tabs); panel = new ScrollPanel(UIStyle); panel.AddNotify(this); RaiseChildAdded(1, panel); KeyPressed += OnKeyPressed; }
public Scrollbar(IUIStyle style) : base(style) { scrollbarPositionChangedSupport = new EventSupport <EventArgs>(); scrollbarStyle = StyleSystem.StylesFor <ScrollbarStyleDefinition>(); ScrollUnit = 50 / 120f; lerpOffset = new LerpValue(0, 0, 0.5f, AnimationLoop.NoLoop); MouseDragged += OnMouseDragged; MouseWheel += OnMouseWheel; MouseUp += OnMouseUp; MouseDown += OnMouseDown; MouseClicked += OnMouseClick; Thumb = new ScrollbarThumb(UIStyle); }
public IconLabel(IUIStyle style) : base(style) { iconLabelStyle = StyleSystem.StylesFor <IconLabelStyleDefinition>(); Image = new Image(style) { Padding = new Insets(), Enabled = false }; Image.AddNotify(this); RaiseChildAdded(0, Image); Label = new Label(style) { Padding = new Insets(), Enabled = false }; Label.AddNotify(this); RaiseChildAdded(1, Label); }
public ButtonBase(IUIStyle style) : base(style) { buttonStyle = StyleSystem.StylesFor <ButtonStyleDefinition>(); actionPerformedSupport = new EventSupport <EventArgs>(); selectionChangedSupport = new EventSupport <EventArgs>(); pressedAnimation = new SmoothValue(1f, 0f, 0.1f); pressedAnimation.FinishAnimation(); Focusable = true; FocusedChanged += (sender, args) => ResetPressState(); MouseDown += OnMouseDown; MouseUp += OnMouseUp; MouseClicked += OnMouseClick; KeyPressed += OnKeyPressed; KeyReleased += OnKeyReleased; }
public Caret(IUIStyle style, TView textInformation) : base(style) { if (textInformation == null) { throw new ArgumentNullException(nameof(textInformation)); } styleDefinition = StyleSystem.StylesFor <TextStyleDefinition>(); TextInformation = textInformation; TextInformation.Document.DocumentModified += UpdatePositions; startPosition = null; endPosition = TextInformation.Document.CreatePosition(0, Bias.Backward); selectionHighlight = new Highlight <TDocument>(startPosition, endPosition, Style); textInformation.Highlighter.AddHighlight(selectionHighlight); blinkAnimation = new StepValue(0, 1) { Duration = 1, Loop = AnimationLoop.Loop }; Style.ValueChanged += OnStyleChanged; }
public Image(IUIStyle style) : base(style) { imageStyle = StyleSystem.StylesFor <ImageStyleDefinition>(); }
public LineNumberWidget(IUIStyle style) : base(style) { textStyle = StyleSystem.StylesFor <TextStyleDefinition>(); cachedTextPositions = new List <Tuple <int, string> >(); }