コード例 #1
0
ファイル: ScrollBar.cs プロジェクト: larsbrubaker/agg-sharp
        internal ScrollBar(ScrollableWidget parent, Color backgroundColor, Color thumbViewColor, Orientation orientation = Orientation.Vertical)
        {
            parentScrollWidget = parent;

            this.background = new GuiWidget()
            {
                BackgroundColor = backgroundColor
            };
            thumb = new ThumDragWidget(orientation)
            {
                BackgroundColor = thumbViewColor
            };
            thumb.SizeChanged += (s, e) =>
            {
                thumb.BackgroundRadius = new RadiusCorners(thumb.Width / 2);
            };

            AddChild(background);
            AddChild(thumb);

            this.Margin = ScrollBar.DefaultMargin;

            parentScrollWidget.BoundsChanged            += Bounds_Changed;
            parentScrollWidget.ScrollArea.BoundsChanged += Bounds_Changed;
            parentScrollWidget.ScrollPositionChanged    += Bounds_Changed;
            parentScrollWidget.ScrollArea.MarginChanged += Bounds_Changed;

            UpdateScrollBar();
        }
コード例 #2
0
        internal ScrollBar(ScrollableWidget parent, GuiWidget background, GuiWidget thumbView, Orientation orientation = Orientation.Vertical)
        {
            ParentScrollWidget = parent;

            this.background = background;
            thumb           = new ThumDragWidget(orientation);
            thumb.AddChild(thumbView);

            AddChild(background);
            AddChild(thumb);

            this.Margin = ScrollBar.DefaultMargin;

            ParentScrollWidget.BoundsChanged            += Bounds_Changed;
            ParentScrollWidget.ScrollArea.BoundsChanged += Bounds_Changed;
            ParentScrollWidget.ScrollPositionChanged    += Bounds_Changed;
            ParentScrollWidget.ScrollArea.MarginChanged += Bounds_Changed;

            UpdateScrollBar();
        }
コード例 #3
0
        internal ScrollBar(ScrollableWidget parent, GuiWidget background, GuiWidget thumbView, Orientation orientation = Orientation.Vertical)
        {
            ParentScrollWidget = parent;

            this.background = background;
            thumb           = new ThumDragWidget(orientation);
            thumb.AddChild(thumbView);

            background.BackgroundColor = RGBA_Bytes.LightGray;

            AddChild(background);
            AddChild(thumb);

            BackgroundColor = RGBA_Bytes.Blue;

            ParentScrollWidget.BoundsChanged            += new EventHandler(Parent_BoundsChanged);
            ParentScrollWidget.ScrollArea.BoundsChanged += new EventHandler(ScrollArea_BoundsChanged);
            ParentScrollWidget.ScrollPositionChanged    += new EventHandler(scrollWidgeContainingThis_ScrollPositionChanged);
            ParentScrollWidget.ScrollArea.MarginChanged += new EventHandler(ScrollArea_MarginChanged);
            UpdateScrollBar();
        }
コード例 #4
0
ファイル: ScrollBar.cs プロジェクト: glocklueng/agg-sharp
		internal ScrollBar(ScrollableWidget parent, GuiWidget background, GuiWidget thumbView, Orientation orientation = Orientation.Vertical)
		{
			ParentScrollWidget = parent;

			this.background = background;
			thumb = new ThumDragWidget(orientation);
			thumb.AddChild(thumbView);

			background.BackgroundColor = RGBA_Bytes.LightGray;

			AddChild(background);
			AddChild(thumb);

			BackgroundColor = RGBA_Bytes.Blue;

			ParentScrollWidget.BoundsChanged += new EventHandler(Parent_BoundsChanged);
			ParentScrollWidget.ScrollArea.BoundsChanged += new EventHandler(ScrollArea_BoundsChanged);
			ParentScrollWidget.ScrollPositionChanged += new EventHandler(scrollWidgeContainingThis_ScrollPositionChanged);
			ParentScrollWidget.ScrollArea.MarginChanged += new EventHandler(ScrollArea_MarginChanged);
			UpdateScrollBar();
		}