/// <summary> /// Creates an instance of the dialog for modifying a given RenderWare version. /// Once this is executed, run <see cref="ShowDialog"/>. /// </summary> /// <param name="renderWareVersion">The RenderWare version entry to modify.</param> public RWVersionDialog(RWVersion renderWareVersion) { InitializeComponent(); RenderWareVersion = renderWareVersion; ApplyTheme.ThemeWindowsForm(this); MakeRoundedWindow.RoundWindow(this, 30, 30); }
/// <summary> /// Creates an instance of the dialog for modifying the value of a single /// integer used to specify search buffer size. /// </summary> /// <param name="initialInteger">The singular integer value to modify.</param> public ChangeCompressionRateDialog(int initialInteger) { InitializeComponent(); integerToManipulate = initialInteger; ApplyTheme.ThemeWindowsForm(this); MakeRoundedWindow.RoundWindow(this, 30, 30); }
/// <summary> /// Creates an instance of the dialog for modifying the value of a single /// integer used to specify search buffer size. /// </summary> /// <param name="name">Specifies the initial name for the dialog..</param> public RenameDialog(string name) { InitializeComponent(); localName = name; ApplyTheme.ThemeWindowsForm(this); MakeRoundedWindow.RoundWindow(this, 30, 30); }
/// <summary> /// Load the global theme once the base form has finished loading (all MDI children should also have finished loading) /// by then, as they are loaded in the constructor, pretty convenient. /// </summary> private void Base_Load(object sender, EventArgs e) { // Load the global theme if not loaded. if (String.IsNullOrEmpty(Global.Theme.ThemeDirectory)) { Global.Theme.ThemeDirectory = Global.LoaderConfiguration.CurrentTheme; } // Theme! ApplyTheme.ThemeWindowsForm(this); // Get all available games and populate them. _gameConfigs = ConfigManager.GetAllGameConfigs(); // Clear available items. borderless_SelectGame.Items.Clear(); // Populate the dropdown listbox. // For each config, append the name of the game. foreach (GameConfig gameConfig in _gameConfigs) { borderless_SelectGame.Items.Add ( gameConfig.GameName + " " + Theme.ThemeProperties.TitleProperties.LoaderTitleDelimiter + " " + gameConfig.ExecutableLocation + " " + Theme.ThemeProperties.TitleProperties.LoaderTitleDelimiter + " " + gameConfig.GameVersion ); } borderless_SelectGame.SelectedIndex = 0; borderless_UpdateProgressBar.Value = 0; }
/// <summary> /// Detects the decoration boxes of a windows form and automatically appends any other /// controls which are within the region space of the decoration box to the box. /// </summary> /// <param name="winForm">Windows form whose controls are to be checked.</param> public static void FindDecorationControls(Form winForm) { // Get the list of all button contorls List <Control> allControls = new List <Control>(); // Find all button controls // We need to first grab all controls into a list ourselves, as adding // a control to be a child of X will cause it to no longer to be a child of the form, // causing otherwise the foreach loop to end early as winForm.Controls changes. foreach (Control control in winForm.Controls) { allControls.Add(control); } // Find every Box Control foreach (Control control in allControls) { // If the control is of box type. if (control is IDecorationBox && ApplyTheme.IsBox(control)) { // Iterate over all controls again to find controls which are in the // space of the control we are investigating foreach (Control childControl in allControls) { if (childControl.Location.X > control.Location.X && childControl.Location.X < control.Location.X + control.Size.Width && childControl.Location.Y > control.Location.Y && childControl.Location.Y < control.Location.Y + control.Size.Height) { // Cast to decoration box, check if to capture children IDecorationBox decorationBox = (IDecorationBox)control; // Ignore the mouse if it can ignore the mouse. if (childControl is IControlIgnorable label) { label.IgnoreMouse = true; } // Add as child if the box is set to capture children. if (decorationBox.CaptureChildren) { // Add the control as child control.Controls.Add(childControl); // Update BackColor with parent control.BackColorChanged += Control_BackColorChanged; // Set location relative to parent SetLocationRelative.SetRelativeLocation(control, childControl); } } } } } }
private void Base_Load(object sender, EventArgs e) { // Load the global theme if not loaded. if (String.IsNullOrEmpty(Global.Theme.ThemeDirectory)) { Global.Theme.ThemeDirectory = Global.LoaderConfiguration.CurrentTheme; } MakeRoundedWindow.RoundWindow(this, 30, 30); ApplyTheme.ThemeWindowsForm(this); PopulateList(); }
/// <summary> /// Load the global theme once the base form has finished loading (all MDI children should also have finished loading) /// by then, as they are loaded in the constructor, pretty convenient. /// </summary> private void Base_Load(object sender, EventArgs e) { // Load the global theme. ApplyTheme.ThemeWindowsForm(this); // Set default logging location. borderless_LogLocation.Text = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + $"\\{Strings.Launcher.DefaultLogFileName}"; borderless_AttachExecutableName.Text = Path.GetFileNameWithoutExtension(Global.CurrentGameConfig.ExecutableLocation); // Set images. box_LogLocationSelect.BackgroundImage = Bindings.Images.TweaksImage; box_AttachExecutableNameSelect.BackgroundImage = Bindings.Images.TweaksImage; }
/// <summary> /// Load the global theme once the base form has finished loading (all MDI children should also have finished loading) /// by then, as they are loaded in the constructor, pretty convenient. /// </summary> private void Base_Load(object sender, EventArgs e) { // Load the global theme if not loaded. if (String.IsNullOrEmpty(Global.Theme.ThemeDirectory)) { Global.Theme.ThemeDirectory = Global.LoaderConfiguration.CurrentTheme; } // Theme! ApplyTheme.ThemeWindowsForm(this); // Set images borderless_SourceBox.Image = Bindings.Images.GithubImage; borderless_UserGuide.Image = Bindings.Images.AboutIconImage; }
/// <summary> /// Load the global theme once the base form has finished loading (all MDI children should also have finished loading) /// by then, as they are loaded in the constructor, pretty convenient. /// </summary> private void Base_Load(object sender, EventArgs e) { // Load the global theme if not loaded. if (String.IsNullOrEmpty(Global.Theme.ThemeDirectory)) { Global.Theme.ThemeDirectory = Global.LoaderConfiguration.CurrentTheme; } // Theme! ApplyTheme.ThemeWindowsForm(this); // Autostart update if enabled. if (Global.LoaderConfiguration.EnableAutomaticUpdates) { item_Update_Click(item_Update, null); } }
/// <summary> /// Load the global theme once the base form has finished loading (all MDI children should also have finished loading) /// by then, as they are loaded in the constructor, pretty convenient. /// </summary> private void Base_Load(object sender, EventArgs e) { // Load the global theme. ApplyTheme.ThemeWindowsForm(this); }