コード例 #1
0
        public void Init(GUIHost host)
        {
            var scrollFrame = new ScrollFrame(0, this);

            scrollFrame.Init(host);
            scrollFrame.RelativeWidth  = 1f;
            scrollFrame.RelativeHeight = 1f;
            AddChildElement(scrollFrame);
            var imageWidget = new ImageWidget(0, scrollFrame);

            imageWidget.Init(host, "guicontrols", 0.0f, 737f, 128f, 767f, 0.0f, 737f, 128f, 767f, 0.0f, 737f, 128f, 767f);
            imageWidget.Width      = 129;
            imageWidget.Height     = 31;
            imageWidget.Y          = 10;
            imageWidget.X          = 10;
            imageWidget.SandBoxing = false;
            scrollFrame.AddChildElement(imageWidget);
            var versionText = Version.VersionText;
            var textWidget  = new TextWidget(0, scrollFrame)
            {
                Text       = Locale.GlobalLocale.T("T_AboutText") + versionText,
                Size       = FontSize.Medium,
                Alignment  = QFontAlignment.Left,
                VAlignment = TextVerticalAlignment.Top,
                Color      = new Color4(0.5f, 0.5f, 0.5f, 1f)
            };

            textWidget.SetPosition(10, 60);
            textWidget.Height        = 300;
            textWidget.RelativeWidth = 0.8f;
            scrollFrame.AddChildElement(textWidget);
            textWidget.IgnoreMouse = false;
        }
コード例 #2
0
        private void InitGUIElement(GUIHost gui_host, Element2D parent)
        {
            scroll_frame = new ScrollFrame(1234);
            scroll_frame.Init(gui_host);
            scroll_frame.Width          = 450;
            scroll_frame.RelativeHeight = -1f;
            scroll_frame.Pane_Width     = 400;
            scroll_frame.Pane_Height    = 10;
            scroll_frame.X = -scroll_frame.Width;
            scroll_frame.Y = 64;
            ScrollFrame scrollFrame = scroll_frame;

            scrollFrame.OnControlMsgCallback = scrollFrame.OnControlMsgCallback + new OnControlMsgDelegate(OnControlMsg);
            layout = new VerticalLayout(12345);
            layout.SetSize(400, 10);
            layout.layoutMode = Layout.LayoutMode.ResizeLayoutToFitChildren;
            scroll_frame.AddChildElement(layout);
            scroll_frame.Visible = false;
            parent.ChildList    += scroll_frame;
        }