Пример #1
0
        public override void Initialize()
        {
            ButtonsCount = FrameButtonsCount.One;

            article = new Encyclopedia.Article();
            article.position = Position + new Vector2(260, 23 + 96);
            article.Size = Size - new Vector2(260, 23 + 96) - new Vector2(26, 28);
            article.view.OnPageLoaded += new Elements.HTMLViewer.PageLoaded(view_OnPageLoaded);

            lFolder = new Elements.Label((int)Position.X + 92, (int)Position.Y + 31, "");
            lFolder.foreground = Color.White;
            controls.Add(lFolder);

            sbFileList = new Elements.ScrollBar((int)Position.X + 278 - 7, (int)Position.Y + 100, 16, (int)Size.Y - 100 - 7);
            sbFileList.MaxValue = 10000;
            sbFileList.MinValue = 0;
            sbFileList.Value = 0;
            sbFileList.IsVertical = true;
            sbFileList.onValueChanged += new Elements.ScrollBar.ValueChangedEventHandler(sbFileList_onValueChanged);
            controls.Add(sbFileList);

            sbArticle = new Elements.ScrollBar((int)(Position.X + Size.X) - 8, (int)Position.Y + 100, 16, (int)Size.Y - 89 - 100 - 7);
            sbArticle.MaxValue = 1;
            sbArticle.MinValue = 0;
            sbArticle.Value = 0;
            sbArticle.IsVertical = true;
            sbArticle.onValueChanged += new Elements.ScrollBar.ValueChangedEventHandler(sbArticle_onValueChanged);
            controls.Add(sbArticle);

            goToLink = new Elements.MenuButton((int)(Position.X + Size.X - 120), (int)(Position.Y + Size.Y - 23), 120, 23, "Link");
            goToLink.isEnabled = false;
            goToLink.Font = ButtonFont;
            goToLink.onClicked += new Elements.Button.ClickedEventHandler(gotolink_onClicked);
            controls.Add(goToLink);

            base.Initialize();
        }
Пример #2
0
        public override void Initialize()
        {
            ButtonsCount = FrameButtonsCount.One;

            article                    = new Encyclopedia.Article();
            article.position           = Position + new Vector2(260, 23 + 96);
            article.Size               = Size - new Vector2(260, 23 + 96) - new Vector2(26, 28);
            article.view.OnPageLoaded += new Elements.HTMLViewer.PageLoaded(view_OnPageLoaded);

            lFolder            = new Elements.Label((int)Position.X + 92, (int)Position.Y + 31, "");
            lFolder.foreground = Color.White;
            controls.Add(lFolder);

            sbFileList                 = new Elements.ScrollBar((int)Position.X + 278 - 7, (int)Position.Y + 100, 16, (int)Size.Y - 100 - 7);
            sbFileList.MaxValue        = 10000;
            sbFileList.MinValue        = 0;
            sbFileList.Value           = 0;
            sbFileList.IsVertical      = true;
            sbFileList.onValueChanged += new Elements.ScrollBar.ValueChangedEventHandler(sbFileList_onValueChanged);
            controls.Add(sbFileList);

            sbArticle                 = new Elements.ScrollBar((int)(Position.X + Size.X) - 8, (int)Position.Y + 100, 16, (int)Size.Y - 89 - 100 - 7);
            sbArticle.MaxValue        = 1;
            sbArticle.MinValue        = 0;
            sbArticle.Value           = 0;
            sbArticle.IsVertical      = true;
            sbArticle.onValueChanged += new Elements.ScrollBar.ValueChangedEventHandler(sbArticle_onValueChanged);
            controls.Add(sbArticle);

            goToLink            = new Elements.MenuButton((int)(Position.X + Size.X - 120), (int)(Position.Y + Size.Y - 23), 120, 23, "Link");
            goToLink.isEnabled  = false;
            goToLink.Font       = ButtonFont;
            goToLink.onClicked += new Elements.Button.ClickedEventHandler(gotolink_onClicked);
            controls.Add(goToLink);

            base.Initialize();
        }
Пример #3
0
        public override void Initialize()
        {
            Layer = 100000;

            article          = new Encyclopedia.Article();
            article.position = new Vector2(10, 10);
            article.Size     = new Vector2(Main.WindowWidth - 20, Main.WindowHeight - 50);

            goToLink = new EncyclopediaBrowserButton(Main.WindowWidth - 215, Main.WindowHeight - 25, 100, 20, "Go to link");
            (goToLink as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            goToLink.foreground = Color.White;
            goToLink.onClicked += new Button.ClickedEventHandler(goToLink_onClicked);
            controls.Add(goToLink);

            back = new EncyclopediaBrowserButton(Main.WindowWidth - 105, Main.WindowHeight - 25, 100, 20, "Back");
            (back as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            back.foreground = Color.White;
            back.onClicked += new Button.ClickedEventHandler(back_onClicked);
            controls.Add(back);

            base.Initialize();

            background = GUIEngine.s_mainMenu.background;
        }
Пример #4
0
        public override void Initialize()
        {
            Layer = 100000;

            article = new Encyclopedia.Article();
            article.position = new Vector2(10, 10);
            article.Size = new Vector2(Main.WindowWidth - 20, Main.WindowHeight - 50);

            goToLink = new EncyclopediaBrowserButton(Main.WindowWidth - 215, Main.WindowHeight - 25, 100, 20, "Go to link");
            (goToLink as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            goToLink.foreground = Color.White;
            goToLink.onClicked += new Button.ClickedEventHandler(goToLink_onClicked);
            controls.Add(goToLink);

            back = new EncyclopediaBrowserButton(Main.WindowWidth - 105, Main.WindowHeight - 25, 100, 20, "Back");
            (back as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            back.foreground = Color.White;
            back.onClicked += new Button.ClickedEventHandler(back_onClicked);
            controls.Add(back);

            base.Initialize();

            background = GUIEngine.s_mainMenu.background;
        }
Пример #5
0
        public override void Initialize()
        {
            #region NececarryStuff
            article = new Encyclopedia.Article();
            article.position = new Vector2(10, 10);
            article.Size = new Vector2(Main.WindowWidth - 20, Main.WindowHeight - 110);

            loadhtml = new EncyclopediaBrowserButton(Main.WindowWidth - 325, Main.WindowHeight - 25, 100, 20, "View page");
            (loadhtml as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            loadhtml.foreground = Color.White;
            loadhtml.onClicked += new Button.ClickedEventHandler(loadhtml_onClicked);
            controls.Add(loadhtml);

            goToLink = new EncyclopediaBrowserButton(Main.WindowWidth - 215, Main.WindowHeight - 25, 100, 20, "Go to link");
            (goToLink as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            goToLink.foreground = Color.White;
            goToLink.onClicked += new Button.ClickedEventHandler(goToLink_onClicked);
            controls.Add(goToLink);

            exit = new EncyclopediaBrowserButton(Main.WindowWidth - 105, Main.WindowHeight - 25, 100, 20, "Exit");
            (exit as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            exit.foreground = Color.White;
            exit.onClicked += new Button.ClickedEventHandler(exit_onClicked);
            controls.Add(exit);

            Label l1 = new Label(11, Main.WindowHeight - 80, "File:");
            l1.foreground = Color.White;
            controls.Add(l1);

            tbFile = new TextBox(60, Main.WindowHeight - 80,
                Main.WindowWidth - 20 - 50, 18);
            tbFile.BackgroundColor = new Color(32, 32, 32, 192);
            tbFile.ForegroundColor = Color.White;
            tbFile.CursorColor = new Color(200, 200, 200);
            tbFile.Multiline = false;
            controls.Add(tbFile);

            Label l = new Label(11, Main.WindowHeight - 50, "Link:");
            l.foreground = Color.White;
            controls.Add(l);

            tbLink = new TextBox(60, Main.WindowHeight - 50,
                Main.WindowWidth - 20 - 50, 20);
            tbLink.BackgroundColor = new Color(32, 32, 32, 192);
            tbLink.ForegroundColor = Color.White;
            tbLink.CursorColor = new Color(200, 200, 200);
            tbLink.Multiline = false;
            tbLink.onTextChanged += new TextBox.TextChangedEventHandler(tbLink_onTextChanged);
            controls.Add(tbLink);
            #endregion

            #region FileManagement
            save = new EncyclopediaBrowserButton(5, Main.WindowHeight - 25, 100, 20, "Save");
            (save as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            save.foreground = Color.White;
            save.onClicked += new Button.ClickedEventHandler(save_onClicked);
            controls.Add(save);

            saveas = new EncyclopediaBrowserButton(115, Main.WindowHeight - 25, 100, 20, "Save As");
            (saveas as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            saveas.foreground = Color.White;
            saveas.onClicked += new Button.ClickedEventHandler(saveas_onClicked);
            controls.Add(saveas);

            load = new EncyclopediaBrowserButton(225, Main.WindowHeight - 25, 100, 20, "Load");
            (load as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            load.foreground = Color.White;
            load.onClicked += new Button.ClickedEventHandler(load_onClicked);
            controls.Add(load);

            clear = new EncyclopediaBrowserButton(335, Main.WindowHeight - 25, 100, 20, "Clear");
            (clear as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            clear.foreground = Color.White;
            clear.onClicked += new Button.ClickedEventHandler(clear_onClicked);
            controls.Add(clear);
            #endregion

            base.Initialize();

            background = GUIEngine.s_mainMenu.background;
        }
Пример #6
0
        public override void Initialize()
        {
            #region NececarryStuff
            article          = new Encyclopedia.Article();
            article.position = new Vector2(10, 10);
            article.Size     = new Vector2(Main.WindowWidth - 20, Main.WindowHeight - 110);

            loadhtml = new EncyclopediaBrowserButton(Main.WindowWidth - 325, Main.WindowHeight - 25, 100, 20, "View page");
            (loadhtml as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            loadhtml.foreground = Color.White;
            loadhtml.onClicked += new Button.ClickedEventHandler(loadhtml_onClicked);
            controls.Add(loadhtml);

            goToLink = new EncyclopediaBrowserButton(Main.WindowWidth - 215, Main.WindowHeight - 25, 100, 20, "Go to link");
            (goToLink as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            goToLink.foreground = Color.White;
            goToLink.onClicked += new Button.ClickedEventHandler(goToLink_onClicked);
            controls.Add(goToLink);

            exit = new EncyclopediaBrowserButton(Main.WindowWidth - 105, Main.WindowHeight - 25, 100, 20, "Exit");
            (exit as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            exit.foreground = Color.White;
            exit.onClicked += new Button.ClickedEventHandler(exit_onClicked);
            controls.Add(exit);

            Label l1 = new Label(11, Main.WindowHeight - 80, "File:");
            l1.foreground = Color.White;
            controls.Add(l1);

            tbFile = new TextBox(60, Main.WindowHeight - 80,
                                 Main.WindowWidth - 20 - 50, 18);
            tbFile.BackgroundColor = new Color(32, 32, 32, 192);
            tbFile.ForegroundColor = Color.White;
            tbFile.CursorColor     = new Color(200, 200, 200);
            tbFile.Multiline       = false;
            controls.Add(tbFile);

            Label l = new Label(11, Main.WindowHeight - 50, "Link:");
            l.foreground = Color.White;
            controls.Add(l);

            tbLink = new TextBox(60, Main.WindowHeight - 50,
                                 Main.WindowWidth - 20 - 50, 20);
            tbLink.BackgroundColor = new Color(32, 32, 32, 192);
            tbLink.ForegroundColor = Color.White;
            tbLink.CursorColor     = new Color(200, 200, 200);
            tbLink.Multiline       = false;
            tbLink.onTextChanged  += new TextBox.TextChangedEventHandler(tbLink_onTextChanged);
            controls.Add(tbLink);
            #endregion

            #region FileManagement
            save = new EncyclopediaBrowserButton(5, Main.WindowHeight - 25, 100, 20, "Save");
            (save as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            save.foreground = Color.White;
            save.onClicked += new Button.ClickedEventHandler(save_onClicked);
            controls.Add(save);

            saveas = new EncyclopediaBrowserButton(115, Main.WindowHeight - 25, 100, 20, "Save As");
            (saveas as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            saveas.foreground = Color.White;
            saveas.onClicked += new Button.ClickedEventHandler(saveas_onClicked);
            controls.Add(saveas);

            load = new EncyclopediaBrowserButton(225, Main.WindowHeight - 25, 100, 20, "Load");
            (load as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            load.foreground = Color.White;
            load.onClicked += new Button.ClickedEventHandler(load_onClicked);
            controls.Add(load);

            clear = new EncyclopediaBrowserButton(335, Main.WindowHeight - 25, 100, 20, "Clear");
            (clear as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2");
            clear.foreground = Color.White;
            clear.onClicked += new Button.ClickedEventHandler(clear_onClicked);
            controls.Add(clear);
            #endregion

            base.Initialize();

            background = GUIEngine.s_mainMenu.background;
        }