Exemple #1
0
        public G2DScrollPane(G2DComponent scrollableContent, ScrollBarPolicy horizontalPolicy, ScrollBarPolicy verticalPolicy)
        {
            if (!(scrollableContent is Scrollable))
                throw new ArgumentException("The scrollableContent has to implement Scrollable interface");

            this.scrollableContent = scrollableContent;

            enableWheelScroll = true;

            drawBackground = false;

            hBarPolicy = horizontalPolicy;
            vBarPolicy = verticalPolicy;

            hScrollBar = new G2DScrollBar(GoblinEnums.Orientation.Horizontal, 0, 2, 2);
            vScrollBar = new G2DScrollBar(GoblinEnums.Orientation.Vertical, 2, 2, 2);

            if (vBarPolicy == ScrollBarPolicy.Always)
                showVScroll = true;
            else
                showVScroll = false;

            if (hBarPolicy == ScrollBarPolicy.Always)
                showHScroll = true;
            else
                showHScroll = false;
        }
        public G2DScrollPane(G2DComponent scrollableContent, ScrollBarPolicy horizontalPolicy, ScrollBarPolicy verticalPolicy)
        {
            if (!(scrollableContent is Scrollable))
            {
                throw new ArgumentException("The scrollableContent has to implement Scrollable interface");
            }

            this.scrollableContent = scrollableContent;

            enableWheelScroll = true;

            drawBackground = false;

            hBarPolicy = horizontalPolicy;
            vBarPolicy = verticalPolicy;

            hScrollBar = new G2DScrollBar(GoblinEnums.Orientation.Horizontal, 0, 2, 2);
            vScrollBar = new G2DScrollBar(GoblinEnums.Orientation.Vertical, 2, 2, 2);

            if (vBarPolicy == ScrollBarPolicy.Always)
            {
                showVScroll = true;
            }
            else
            {
                showVScroll = false;
            }

            if (hBarPolicy == ScrollBarPolicy.Always)
            {
                showHScroll = true;
            }
            else
            {
                showHScroll = false;
            }
        }