OpenTkEngine.Core.Gui.ScrollPanel.SetContentDimensions C# (CSharp) 메소드

SetContentDimensions() 공개 메소드

public SetContentDimensions ( int width, int height ) : void
width int
height int
리턴 void
        public void SetContentDimensions(int width, int height)
        {
            if (width < _content.Width)
                width = _content.Width;
            if (height < _content.Height)
                height = _content.Height;
            _horizontalScroll.SetScrollAmount(width);
            _verticalScroll.SetScrollAmount(height);
        }

Usage Example

예제 #1
0
        protected override void Initialize()
        {
            base.Initialize();

            //create a bunch of UI elements and link them to the state
            ScrollPanel panel = new ScrollPanel(0, 0, 0, 400, 640, this);
            panel.SetBackgroundColor(Color4.Red);
            ScrollPanel panel2 = new ScrollPanel(420, 10, 0, 350, 500, this);

            panel.SetContentDimensions(800, 800);
            panel2.SetContentDimensions(400, 400);

            Button button = new Button(10, 50, 0, 100, 100, "button.png", "button", this);
            TextField field = new TextField(10, 10, 0, 100, this);
            ListBox listBox = new ListBox(120, 10, 0, 200, 150, 10, this);

            DropDownBox dropDown = new DropDownBox(50, 420, 0, 100, this);

            TextBox textBox = new TextBox(10, 10, 0, 400, 400, this);
            RadioButton radio = new RadioButton(200, 420, 0, this);

            panel.AddControl(panel2);

            panel.AddControl(dropDown);
            panel.AddControl(textBox);
            panel.AddControl(radio);

            panel2.AddControl(button);
            panel2.AddControl(field);
            panel2.AddControl(listBox);

            this.AddControl(panel);
        }