public override void Initialize() { #region MasterVolume lmv = new Elements.Label((int)Position.X + 5, (int)Position.Y + 15, "Master Volume"); lmv.foreground = Color.White; controls.Add(lmv); mv = new Elements.ScrollBar((int)Position.X + 165, (int)Position.Y + 19, 200, 20); mv.onValueChanged += new Elements.ScrollBar.ValueChangedEventHandler(mv_onValueChanged); mv.MinValue = 0; mv.MaxValue = 100; mv.Value = (int)(Settings.MasterVolume * 100); controls.Add(mv); #endregion #region EffectVolume lev = new Elements.Label((int)Position.X + 5, (int)Position.Y + 45, "Effects Volume"); lev.foreground = Color.White; controls.Add(lev); ev = new Elements.ScrollBar((int)Position.X + 165, (int)Position.Y + 49, 200, 20); ev.onValueChanged += new Elements.ScrollBar.ValueChangedEventHandler(ev_onValueChanged); ev.MinValue = 0; ev.MaxValue = 100; ev.Value = (int)(Settings.EffectsVolume * 100); controls.Add(ev); #endregion #region MusicVolume lmzv = new Elements.Label((int)Position.X + 5, (int)Position.Y + 75, "Music Volume"); lmzv.foreground = Color.White; controls.Add(lmzv); mzv = new Elements.ScrollBar((int)Position.X + 165, (int)Position.Y + 79, 200, 20); mzv.onValueChanged += new Elements.ScrollBar.ValueChangedEventHandler(mzv_onValueChanged); mzv.MinValue = 0; mzv.MaxValue = 100; mzv.Value = (int)(Settings.MusicVolume * 100); controls.Add(mzv); #endregion base.Initialize(); }
public override void Initialize() { #region MasterVolume lmv = new Elements.Label((int)Position.X + 5, (int)Position.Y + 15, "Master Volume"); lmv.foreground = Color.White; controls.Add(lmv); mv = new Elements.ScrollBar((int)Position.X + 165, (int)Position.Y + 19, 200, 20); mv.onValueChanged += new Elements.ScrollBar.ValueChangedEventHandler(mv_onValueChanged); mv.MinValue = 0; mv.MaxValue = 100; mv.Value = (int)(Settings.MasterVolume * 100); controls.Add(mv); #endregion #region EffectVolume lev = new Elements.Label((int)Position.X + 5, (int)Position.Y + 45, "Effects Volume"); lev.foreground = Color.White; controls.Add(lev); ev = new Elements.ScrollBar((int)Position.X + 165, (int)Position.Y + 49, 200, 20); ev.onValueChanged += new Elements.ScrollBar.ValueChangedEventHandler(ev_onValueChanged); ev.MinValue = 0; ev.MaxValue = 100; ev.Value = (int)(Settings.EffectsVolume * 100); controls.Add(ev); #endregion #region MusicVolume lmzv = new Elements.Label((int)Position.X + 5, (int)Position.Y + 75, "Music Volume"); lmzv.foreground = Color.White; controls.Add(lmzv); mzv = new Elements.ScrollBar((int)Position.X + 165, (int)Position.Y + 79, 200, 20); mzv.onValueChanged += new Elements.ScrollBar.ValueChangedEventHandler(mzv_onValueChanged); mzv.MinValue = 0; mzv.MaxValue = 100; mzv.Value = (int)(Settings.MusicVolume * 100); controls.Add(mzv); #endregion base.Initialize(); }
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(); }
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(); }
public new void Initialize() { #region Basic Layer = 100000; ShouldBeScaled = false; var a = GraphicsAdapter.DefaultAdapter.SupportedDisplayModes.GetEnumerator(); a.MoveNext(); maxw = a.Current.Width; maxh = a.Current.Height; a.MoveNext(); while (true)//DO NOT TOUCH THIS CYCLE OR ELSE MONO GETS SCARED!!! { try { if (a.Current == null) break; } catch { System.Threading.Thread.Sleep(1); } try { if (a.Current == null) break; } catch { break; } try { if (a.Current.Width > maxw) maxw = a.Current.Width; if (a.Current.Height > maxh) maxh = a.Current.Height; } catch { } a.MoveNext(); } #endregion #region ControlButtons sb = new Elements.EncyclopediaBrowserButton(410, 440, 120, 30, "Back"); (sb as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2"); sb.foreground = Color.White; //sb.font = ResourceManager.Load<SpriteFont>("Fonts/MenuFont"); sb.onClicked +=new Elements.Button.ClickedEventHandler(sbClick); controls.Add(sb); sac = new Elements.EncyclopediaBrowserButton(540, 440, 120, 30, "Save"); (sac as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2"); sac.foreground = Color.White; //sac.font = ResourceManager.Load<SpriteFont>("Fonts/MenuFont"); sac.onClicked += new Elements.Button.ClickedEventHandler(sacClick); controls.Add(sac); ap = new Elements.EncyclopediaBrowserButton(670, 440, 120, 30, "Apply"); (ap as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2"); ap.foreground = Color.White; //ap.font = ResourceManager.Load<SpriteFont>("Fonts/MenuFont"); ap.onClicked += new Elements.Button.ClickedEventHandler(apClick); controls.Add(ap); #endregion #region MasterVolume Elements.Label l1 = new Elements.Label(10, 20, "Master Volume"); l1.foreground = Color.White; controls.Add(l1); mv = new Elements.ScrollBar(170, 24, 200, 20); mv.onValueChanged += new Elements.ScrollBar.ValueChangedEventHandler(mv_onValueChanged); mv.MinValue = 0; mv.MaxValue = 100; mv.Value = (int)(Settings.MasterVolume * 100); controls.Add(mv); #endregion #region EffectVolume Elements.Label l11 = new Elements.Label(10, 50, "Effects Volume"); l11.foreground = Color.White; controls.Add(l11); ev = new Elements.ScrollBar(170, 54, 200, 20); ev.onValueChanged += new Elements.ScrollBar.ValueChangedEventHandler(ev_onValueChanged); ev.MinValue = 0; ev.MaxValue = 100; ev.Value = (int)(Settings.EffectsVolume * 100); controls.Add(ev); #endregion #region MusicVolume Elements.Label l111 = new Elements.Label(10, 80, "Music Volume"); l111.foreground = Color.White; controls.Add(l111); mzv = new Elements.ScrollBar(170, 84, 200, 20); mzv.onValueChanged += new Elements.ScrollBar.ValueChangedEventHandler(mzv_onValueChanged); mzv.MinValue = 0; mzv.MaxValue = 100; mzv.Value = (int)(Settings.MusicVolume * 100); controls.Add(mzv); #endregion #region Resoulutions lar = new Elements.Label(400, 20, "Aspect ratio:"); lar.foreground = Color.White; controls.Add(lar); ar = new Elements.ComboBox(550, 22, 120, 24); ar.onElementSelected += new Elements.ComboBox.ElementSelectedHandler(ar_onElementSelected); controls.Add(ar); ar.ItemsAdd("4*3"); ar.ItemsAdd("5*3"); if (maxw >= 1280 && maxh >= 720) ar.ItemsAdd("16*9"); if (maxw >= 1280 && maxh >= 800) ar.ItemsAdd("16*10"); lres = new Elements.Label(400, 50, "Resolution:"); lres.foreground = Color.White; controls.Add(lres); res = new Elements.ComboBox(550, 52, 120, 24); res.onElementSelected += new Elements.ComboBox.ElementSelectedHandler(res_onElementSelected); controls.Add(res); fs = new Elements.CheckBox(400, 90, 170, 20, "FullScreen", false); fs.foreground = Color.White; controls.Add(fs); #endregion #region Hotkeys hcSimStart = new Elements.HotkeyControl(5, 125, 250, "Simulation start", Settings.k_SimulationStart); controls.Add(hcSimStart); hcSimStop = new Elements.HotkeyControl(5, 150, 250, "Simulation stop", Settings.k_SimulationStop); controls.Add(hcSimStop); hcSimPause = new Elements.HotkeyControl(5, 175, 250, "Simulation pause", Settings.k_SimulationPause); controls.Add(hcSimPause); hcUndo = new Elements.HotkeyControl(5, 200, 250, "Undo", Settings.k_Undo); controls.Add(hcUndo); hcCompRem = new Elements.HotkeyControl(5, 250, 250, "Remove single component", Settings.k_ComponentRemove); controls.Add(hcCompRem); hcEraser = new Elements.HotkeyControl(5, 275, 250, "Eraser", Settings.k_Eraser); controls.Add(hcEraser); hcZoomIn = new Elements.HotkeyControl(5, 300, 250, "Zoom In", Settings.k_ZoomIn); controls.Add(hcZoomIn); hcZoomOut = new Elements.HotkeyControl(5, 325, 250, "Zoom Out", Settings.k_ZoomOut); controls.Add(hcZoomOut); #endregion base.Initialize(); background = GUIEngine.s_mainMenu.background; }
public new void Initialize() { #region Basic Layer = 100000; ShouldBeScaled = false; var a = GraphicsAdapter.DefaultAdapter.SupportedDisplayModes.GetEnumerator(); a.MoveNext(); maxw = a.Current.Width; maxh = a.Current.Height; a.MoveNext(); while (true)//DO NOT TOUCH THIS CYCLE OR ELSE MONO GETS SCARED!!! { try { if (a.Current == null) { break; } } catch { System.Threading.Thread.Sleep(1); } try { if (a.Current == null) { break; } } catch { break; } try { if (a.Current.Width > maxw) { maxw = a.Current.Width; } if (a.Current.Height > maxh) { maxh = a.Current.Height; } } catch { } a.MoveNext(); } #endregion #region ControlButtons sb = new Elements.EncyclopediaBrowserButton(410, 440, 120, 30, "Back"); (sb as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2"); sb.foreground = Color.White; //sb.font = ResourceManager.Load<SpriteFont>("Fonts/MenuFont"); sb.onClicked += new Elements.Button.ClickedEventHandler(sbClick); controls.Add(sb); sac = new Elements.EncyclopediaBrowserButton(540, 440, 120, 30, "Save"); (sac as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2"); sac.foreground = Color.White; //sac.font = ResourceManager.Load<SpriteFont>("Fonts/MenuFont"); sac.onClicked += new Elements.Button.ClickedEventHandler(sacClick); controls.Add(sac); ap = new Elements.EncyclopediaBrowserButton(670, 440, 120, 30, "Apply"); (ap as Elements.EncyclopediaBrowserButton).OverrideTexture("GUI/Menus/ButtonBackground2"); ap.foreground = Color.White; //ap.font = ResourceManager.Load<SpriteFont>("Fonts/MenuFont"); ap.onClicked += new Elements.Button.ClickedEventHandler(apClick); controls.Add(ap); #endregion #region MasterVolume Elements.Label l1 = new Elements.Label(10, 20, "Master Volume"); l1.foreground = Color.White; controls.Add(l1); mv = new Elements.ScrollBar(170, 24, 200, 20); mv.onValueChanged += new Elements.ScrollBar.ValueChangedEventHandler(mv_onValueChanged); mv.MinValue = 0; mv.MaxValue = 100; mv.Value = (int)(Settings.MasterVolume * 100); controls.Add(mv); #endregion #region EffectVolume Elements.Label l11 = new Elements.Label(10, 50, "Effects Volume"); l11.foreground = Color.White; controls.Add(l11); ev = new Elements.ScrollBar(170, 54, 200, 20); ev.onValueChanged += new Elements.ScrollBar.ValueChangedEventHandler(ev_onValueChanged); ev.MinValue = 0; ev.MaxValue = 100; ev.Value = (int)(Settings.EffectsVolume * 100); controls.Add(ev); #endregion #region MusicVolume Elements.Label l111 = new Elements.Label(10, 80, "Music Volume"); l111.foreground = Color.White; controls.Add(l111); mzv = new Elements.ScrollBar(170, 84, 200, 20); mzv.onValueChanged += new Elements.ScrollBar.ValueChangedEventHandler(mzv_onValueChanged); mzv.MinValue = 0; mzv.MaxValue = 100; mzv.Value = (int)(Settings.MusicVolume * 100); controls.Add(mzv); #endregion #region Resoulutions lar = new Elements.Label(400, 20, "Aspect ratio:"); lar.foreground = Color.White; controls.Add(lar); ar = new Elements.ComboBox(550, 22, 120, 24); ar.onElementSelected += new Elements.ComboBox.ElementSelectedHandler(ar_onElementSelected); controls.Add(ar); ar.ItemsAdd("4*3"); ar.ItemsAdd("5*3"); if (maxw >= 1280 && maxh >= 720) { ar.ItemsAdd("16*9"); } if (maxw >= 1280 && maxh >= 800) { ar.ItemsAdd("16*10"); } lres = new Elements.Label(400, 50, "Resolution:"); lres.foreground = Color.White; controls.Add(lres); res = new Elements.ComboBox(550, 52, 120, 24); res.onElementSelected += new Elements.ComboBox.ElementSelectedHandler(res_onElementSelected); controls.Add(res); fs = new Elements.CheckBox(400, 90, 170, 20, "FullScreen", false); fs.foreground = Color.White; controls.Add(fs); #endregion #region Hotkeys hcSimStart = new Elements.HotkeyControl(5, 125, 250, "Simulation start", Settings.k_SimulationStart); controls.Add(hcSimStart); hcSimStop = new Elements.HotkeyControl(5, 150, 250, "Simulation stop", Settings.k_SimulationStop); controls.Add(hcSimStop); hcSimPause = new Elements.HotkeyControl(5, 175, 250, "Simulation pause", Settings.k_SimulationPause); controls.Add(hcSimPause); hcUndo = new Elements.HotkeyControl(5, 200, 250, "Undo", Settings.k_Undo); controls.Add(hcUndo); hcCompRem = new Elements.HotkeyControl(5, 250, 250, "Remove single component", Settings.k_ComponentRemove); controls.Add(hcCompRem); hcEraser = new Elements.HotkeyControl(5, 275, 250, "Eraser", Settings.k_Eraser); controls.Add(hcEraser); hcZoomIn = new Elements.HotkeyControl(5, 300, 250, "Zoom In", Settings.k_ZoomIn); controls.Add(hcZoomIn); hcZoomOut = new Elements.HotkeyControl(5, 325, 250, "Zoom Out", Settings.k_ZoomOut); controls.Add(hcZoomOut); #endregion base.Initialize(); background = GUIEngine.s_mainMenu.background; }