/// <summary> /// Makes this configuration binding being controlled by the specified button. /// Use this method if you want to use one ChooseStorageLocationButton to control /// multiple properties. /// </summary> public void RegisterLocationButton(ChooseStorageLocationButton btn) { this.storageLocationButton = btn; btn.StorageLocationChanged += delegate(object sender, EventArgs e) { this.Location = ((ChooseStorageLocationButton)sender).StorageLocation; }; }
/// <summary> /// Moves the <paramref name="replacedControl"/> a bit to the right and inserts a /// <see cref="ChooseStorageLocationButton"/>. /// </summary> public ChooseStorageLocationButton CreateLocationButton(Control replacedControl) { ChooseStorageLocationButton btn = CreateLocationButton(); btn.Location = new Point(replacedControl.Left, replacedControl.Top + (replacedControl.Height - btn.Height) / 2); replacedControl.Left += btn.Width + 4; replacedControl.Width -= btn.Width + 4; replacedControl.Parent.Controls.Add(btn); replacedControl.Parent.Controls.SetChildIndex(btn, replacedControl.Parent.Controls.IndexOf(replacedControl)); return(btn); }
public ChooseStorageLocationButton CreateLocationButton() { ChooseStorageLocationButton btn = new ChooseStorageLocationButton(); if (location == PropertyStorageLocations.Unknown) { btn.StorageLocation = defaultLocation; } else { btn.StorageLocation = location; } RegisterLocationButton(btn); return(btn); }
public ChooseStorageLocationButton CreateLocationButtonInPanel(string panelName) { ChooseStorageLocationButton btn = CreateLocationButton(); Control panel = Helper.ControlDictionary[panelName]; foreach (Control ctl in panel.Controls) { if ((ctl.Anchor & AnchorStyles.Left) == AnchorStyles.Left) { ctl.Left += btn.Width + 8; if ((ctl.Anchor & AnchorStyles.Right) == AnchorStyles.Right) { ctl.Width -= btn.Width + 8; } } } btn.Location = new Point(4, (panel.ClientSize.Height - btn.Height) / 2); panel.Controls.Add(btn); panel.Controls.SetChildIndex(btn, 0); return(btn); }
protected void InitAdvanced() { ConfigurationGuiBinding b; b = helper.BindBoolean("registerCOMInteropCheckBox", "RegisterForComInterop", false); b.DefaultLocation = PropertyStorageLocations.PlatformSpecific; advancedLocationButton = b.CreateLocationButtonInPanel("platformSpecificOptionsPanel"); b = helper.BindStringEnum("generateSerializationAssemblyComboBox", "GenerateSerializationAssemblies", "Auto", new StringPair("Off", "${res:Dialog.ProjectOptions.Build.Off}"), new StringPair("On", "${res:Dialog.ProjectOptions.Build.On}"), new StringPair("Auto", "${res:Dialog.ProjectOptions.Build.Auto}")); b.DefaultLocation = PropertyStorageLocations.PlatformSpecific; b.RegisterLocationButton(advancedLocationButton); b = helper.BindHexadecimal(Get<TextBox>("dllBaseAddress"), "BaseAddress", 0x400000); b.DefaultLocation = PropertyStorageLocations.PlatformSpecific; b.RegisterLocationButton(advancedLocationButton); b = CreatePlatformTarget(); b.RegisterLocationButton(advancedLocationButton); }