public ImageHistoryForm(string historyPath, ImageHistorySettings settings, Action <string> uploadFile = null, Action <string> editImage = null) { InitializeComponent(); tsMain.Renderer = new ToolStripRoundedEdgeRenderer(); HistoryPath = historyPath; Settings = settings; ilvImages.View = (View)Settings.ViewMode; ilvImages.ThumbnailSize = Settings.ThumbnailSize; if (ShareXResources.ExperimentalDarkTheme) { ilvImages.BorderStyle = BorderStyle.None; ilvImages.Colors.BackColor = ShareXResources.DarkBackgroundVariantColor; ilvImages.Colors.BorderColor = ShareXResources.DarkBorderColor; ilvImages.Colors.ForeColor = ShareXResources.DarkTextColor; ilvImages.Colors.SelectedForeColor = ShareXResources.DarkTextColor; } him = new HistoryItemManager(uploadFile, editImage); him.GetHistoryItems += him_GetHistoryItems; ilvImages.ContextMenuStrip = him.cmsHistory; defaultTitle = Text; if (Settings.RememberSearchText) { tstbSearch.Text = Settings.SearchText; } ShareXResources.ApplyTheme(this); Settings.WindowState.AutoHandleFormState(this); }
public InspectWindowForm() { InitializeComponent(); rtbInfo.AddContextMenu(); ShareXResources.ApplyTheme(this); SelectHandle(); }
public EditorStartupForm(RegionCaptureOptions options) { Options = options; InitializeComponent(); ShareXResources.ApplyTheme(this); }
public VideoConverterForm(string ffmpegFilePath, VideoConverterOptions options) { FFmpegFilePath = ffmpegFilePath; Options = options; InitializeComponent(); ShareXResources.ApplyTheme(this); UpdateOptions(); txtInputFilePath.Text = Options.InputFilePath; txtOutputFolder.Text = Options.OutputFolderPath; txtOutputFileName.Text = Options.OutputFileName; cbVideoCodec.Items.AddRange(Helpers.GetEnumDescriptions <ConverterVideoCodecs>()); cbVideoCodec.SelectedIndex = (int)Options.VideoCodec; tbVideoQuality.SetValue(tbVideoQuality.Minimum + tbVideoQuality.Maximum - Options.VideoQuality); cbAutoOpenFolder.Checked = Options.AutoOpenFolder; cbUseCustomArguments.Checked = Options.UseCustomArguments; if (Options.UseCustomArguments) { txtArguments.Text = Options.CustomArguments; } formReady = true; }
public HistoryItemInfoForm(HistoryItem hi) { InitializeComponent(); ShareXResources.ApplyTheme(this); olvMain.SelectedObject = hi; }
public DirectoryIndexerForm(IndexerSettings settings) { InitializeComponent(); ShareXResources.ApplyTheme(this); Settings = settings; pgSettings.SelectedObject = Settings; }
public ResponseForm(string response) { InitializeComponent(); ShareXResources.ApplyTheme(this); Response = response; txtSource.Text = Response; }
public UserPassBox(string title, string userName, string password) { InitializeComponent(); ShareXResources.ApplyTheme(this); Text = title; txtUserName.Text = userName; txtPassword.Text = password; }
public HistorySettingsForm(HistorySettings settings) { InitializeComponent(); ShareXResources.ApplyTheme(this); Settings = settings; cbRememberSearchText.Checked = Settings.RememberSearchText; cbRememberWindowState.Checked = Settings.RememberWindowState; }
public ImageEffectPackagerForm(string json, string name, string imageEffectsFolderPath) { ImageEffectJson = json; ImageEffectName = name; ShareXImageEffectsFolderPath = imageEffectsFolderPath; InitializeComponent(); ShareXResources.ApplyTheme(this); }
public HotkeySettingsForm(HotkeyManager hotkeyManager) { InitializeComponent(); ShareXResources.ApplyTheme(this); btnHotkeysDisabled.Visible = Program.Settings.DisableHotkeys; PrepareHotkeys(hotkeyManager); }
public WatermarkForm(WatermarkConfig watermarkConfig) { config = watermarkConfig; InitializeComponent(); ShareXResources.ApplyTheme(this); CodeMenu.Create <CodeMenuEntryFilename>(txtWatermarkText, CodeMenuEntryFilename.t, CodeMenuEntryFilename.pn); }
public HistoryForm(string historyPath, HistorySettings settings, Action <string> uploadFile = null, Action <string> editImage = null) { HistoryPath = historyPath; Settings = settings; InitializeComponent(); tsHistory.Renderer = new ToolStripRoundedEdgeRenderer(); defaultTitle = Text; string[] typeNames = Enum.GetNames(typeof(EDataType)); string[] typeTranslations = Helpers.GetLocalizedEnumDescriptions <EDataType>(); typeNamesLocaleLookup = typeNames.Zip(typeTranslations, (key, val) => new { key, val }).ToDictionary(e => e.key, e => e.val); UpdateTitle(); // Mark the Date column as having a date; used for sorting chDateTime.Tag = new DateTime(); ImageList il = new ImageList(); il.ColorDepth = ColorDepth.Depth32Bit; il.Images.Add(Resources.image); il.Images.Add(Resources.notebook); il.Images.Add(Resources.application_block); il.Images.Add(Resources.globe); lvHistory.SmallImageList = il; him = new HistoryItemManager(uploadFile, editImage, true); him.GetHistoryItems += him_GetHistoryItems; lvHistory.ContextMenuStrip = him.cmsHistory; pbThumbnail.Reset(); lvHistory.FillLastColumn(); scHistoryItemInfo.SplitterWidth = 7; // Because of bug must be assigned here again scHistoryItemInfo.Panel2Collapsed = true; tstbSearch.TextBox.HandleCreated += (sender, e) => tstbSearch.TextBox.SetWatermark(Resources.HistoryForm_Search_Watermark, true); if (Settings.RememberSearchText) { tstbSearch.Text = Settings.SearchText; } ShareXResources.ApplyTheme(this); if (Settings.RememberWindowState) { Settings.WindowState.ApplyFormState(this); if (Settings.SplitterDistance > 0) { scMain.SplitterDistance = Settings.SplitterDistance; } } }
public OCRForm(Bitmap bmp, OCROptions options) { bmpSource = (Bitmap)bmp.Clone(); Options = options; InitializeComponent(); ShareXResources.ApplyTheme(this); OCRLanguage[] languages = OCRHelper.AvailableLanguages; if (languages.Length > 0) { cbLanguages.Items.AddRange(languages); if (Options.Language == null) { cbLanguages.SelectedIndex = 0; Options.Language = languages[0].LanguageTag; } else { int index = Array.FindIndex(languages, x => x.LanguageTag.Equals(Options.Language, StringComparison.OrdinalIgnoreCase)); if (index >= 0) { cbLanguages.SelectedIndex = index; } else { cbLanguages.SelectedIndex = 0; Options.Language = languages[0].LanguageTag; } } } else { cbLanguages.Enabled = false; } nudScaleFactor.SetValue((decimal)Options.ScaleFactor); if (Options.ServiceLinks != null && Options.ServiceLinks.Count > 0) { cbServices.Items.AddRange(Options.ServiceLinks.ToArray()); cbServices.SelectedIndex = Options.SelectedServiceLink; } else { cbServices.Enabled = false; } txtResult.SupportSelectAll(); UpdateControls(); loaded = true; }
public QRCodeForm(string text = null) { InitializeComponent(); ShareXResources.ApplyTheme(this); if (!string.IsNullOrEmpty(text)) { txtQRCode.Text = text; } }
public HistorySettingsForm(HistorySettings settings) { InitializeComponent(); ShareXResources.ApplyTheme(this); Settings = settings; nudMaximumItemLimit.SetValue(Settings.MaxItemCount); cbRememberSearchText.Checked = Settings.RememberSearchText; cbRememberWindowState.Checked = Settings.RememberWindowState; }
public BorderlessWindowSettingsForm(BorderlessWindowSettings settings) { InitializeComponent(); ShareXResources.ApplyTheme(this); Settings = settings; cbRememberWindowTitle.Checked = Settings.RememberWindowTitle; cbAutoCloseWindow.Checked = Settings.AutoCloseWindow; cbExcludeTaskbarArea.Checked = Settings.ExcludeTaskbarArea; }
public AfterUploadForm(TaskInfo info) { InitializeComponent(); ShareXResources.ApplyTheme(this); Info = info; if (Info.TaskSettings.AdvancedSettings.AutoCloseAfterUploadForm) { tmrClose.Start(); } bool isFileExist = !string.IsNullOrEmpty(info.FilePath) && File.Exists(info.FilePath); if (info.DataType == EDataType.Image) { if (isFileExist) { pbPreview.LoadImageFromFileAsync(info.FilePath); } else { pbPreview.LoadImageFromURLAsync(info.Result.URL); } } Text = "ShareX - " + (isFileExist ? info.FilePath : info.FileName); lvClipboardFormats.Groups.Add(lvgForums); lvClipboardFormats.Groups.Add(lvgHtml); lvClipboardFormats.Groups.Add(lvgWiki); lvClipboardFormats.Groups.Add(lvgLocal); lvClipboardFormats.Groups.Add(lvgCustom); foreach (LinkFormatEnum type in Helpers.GetEnums <LinkFormatEnum>()) { if (!FileHelpers.IsImageFile(Info.Result.URL) && (type == LinkFormatEnum.HTMLImage || type == LinkFormatEnum.HTMLLinkedImage || type == LinkFormatEnum.ForumImage || type == LinkFormatEnum.ForumLinkedImage || type == LinkFormatEnum.WikiImage || type == LinkFormatEnum.WikiLinkedImage)) { continue; } AddFormat(type.GetLocalizedDescription(), GetUrlByType(type)); } if (FileHelpers.IsImageFile(Info.Result.URL)) { foreach (ClipboardFormat cf in Program.Settings.ClipboardContentFormats) { AddFormat(cf.Description, parser.Parse(Info, cf.Format), lvgCustom); } } }
public ImageCombinerForm(ImageCombinerOptions options) { Options = options; InitializeComponent(); ShareXResources.ApplyTheme(this); cbOrientation.Items.AddRange(Enum.GetNames(typeof(Orientation))); cbOrientation.SelectedIndex = (int)Options.Orientation; nudSpace.SetValue(Options.Space); }
public WatchFolderForm(WatchFolderSettings watchFolder) { WatchFolder = watchFolder; InitializeComponent(); ShareXResources.ApplyTheme(this); txtFolderPath.Text = watchFolder.FolderPath ?? ""; txtFilter.Text = watchFolder.Filter ?? ""; cbIncludeSubdirectories.Checked = watchFolder.IncludeSubdirectories; }
private ResponseForm(UploadResult result) { InitializeComponent(); ShareXResources.ApplyTheme(this); rtbResult.AddContextMenu(); rtbResponseInfo.AddContextMenu(); rtbResponseText.AddContextMenu(); UpdateResult(result); }
public VideoThumbnailerForm(string ffmpegPath, VideoThumbnailOptions options) { FFmpegPath = ffmpegPath; Options = options; InitializeComponent(); ShareXResources.ApplyTheme(this); txtMediaPath.Text = Options.LastVideoPath ?? ""; pgOptions.SelectedObject = Options; }
public OCRSpaceForm(OCROptions ocrOptions) { InitializeComponent(); ShareXResources.ApplyTheme(this); this.ocrOptions = ocrOptions; cbLanguages.Items.AddRange(Helpers.GetEnumDescriptions <OCRSpaceLanguages>()); cbLanguages.SelectedIndex = (int)ocrOptions.DefaultLanguage; Language = ocrOptions.DefaultLanguage; txtResult.SupportSelectAll(); }
public ClipboardUploadForm(bool showCheckBox = false) { InitializeComponent(); ShareXResources.ApplyTheme(this); if (ShareXResources.UseCustomTheme) { lblQuestion.BackColor = ShareXResources.Theme.BorderColor; } cbDontShowThisWindow.Visible = showCheckBox; }
public FirstTimeUploadForm() { InitializeComponent(); ShareXResources.ApplyTheme(this); lblHeader.BackColor = Color.DarkRed; lblHeader.ForeColor = Color.WhiteSmoke; btnYes.Enabled = false; textYes = btnYes.Text; UpdateCountdown(); tCountdown.Start(); }
public ImageHistorySettingsForm(ImageHistorySettings settings) { InitializeComponent(); ShareXResources.ApplyTheme(this); Settings = settings; nudThumbnailSize.SetValue(Settings.ThumbnailSize.Width); nudMaximumImageLimit.SetValue(Settings.MaxItemCount); cbFilterMissingFiles.Checked = Settings.FilterMissingFiles; cbRememberSearchText.Checked = Settings.RememberSearchText; cbRememberWindowState.Checked = Settings.RememberWindowState; }
public CustomUploaderSettingsForm(UploadersConfig config) { Config = config; InitializeComponent(); /* * CodeMenuItem[] inputCodeMenuItems = new CodeMenuItem[] * { * new CodeMenuItem("$input$", "Text/URL input"), * new CodeMenuItem("$filename$", "File name"), * new CodeMenuItem("$random:input1|input2$", "Random selection from list"), * new CodeMenuItem("$select:input1|input2$", "Lets user to select one input from list"), * new CodeMenuItem("$prompt:title|default_value$", "Lets user to input text"), * new CodeMenuItem("$base64:input$", "Base64 encode input") * }; */ CodeMenuItem[] outputCodeMenuItems = new CodeMenuItem[] { new CodeMenuItem("$response$", "Response text"), new CodeMenuItem("$responseurl$", "Response/Redirection URL"), new CodeMenuItem("$header:header_name$", "Response header"), new CodeMenuItem("$json:path$", "Parse response using JSON"), new CodeMenuItem("$xml:path$", "Parse response using XML"), new CodeMenuItem("$regex:index|group$", "Parse response using Regex"), new CodeMenuItem("$filename$", "File name used when uploading"), new CodeMenuItem("$random:input1|input2$", "Random selection from list"), new CodeMenuItem("$select:input1|input2$", "Lets user to select one input from list"), new CodeMenuItem("$prompt:title|default_value$", "Lets user to input text"), new CodeMenuItem("$base64:input$", "Base64 encode input") }; new CodeMenu(rtbResultURL, outputCodeMenuItems); new CodeMenu(rtbResultThumbnailURL, outputCodeMenuItems); new CodeMenu(rtbResultDeletionURL, outputCodeMenuItems); new CodeMenu(rtbResultErrorMessage, outputCodeMenuItems); rtbRequestURL.AddContextMenu(); rtbData.AddContextMenu(); rtbResultURL.AddContextMenu(); rtbResultThumbnailURL.AddContextMenu(); rtbResultDeletionURL.AddContextMenu(); rtbResultErrorMessage.AddContextMenu(); eiCustomUploaders.ObjectType = typeof(CustomUploaderItem); CustomUploaderAddDestinationTypes(); cbRequestMethod.Items.AddRange(Enum.GetNames(typeof(HttpMethod))); cbBody.Items.AddRange(Helpers.GetEnumDescriptions <CustomUploaderBody>()); ShareXResources.ApplyTheme(this); CustomUploaderLoadTab(); }
public FileExistForm(string filepath) { InitializeComponent(); ShareXResources.ApplyTheme(this); Filepath = filepath; filename = Path.GetFileNameWithoutExtension(Filepath); txtNewName.Text = filename; btnOverwrite.Text += Path.GetFileName(Filepath); uniqueFilepath = Helpers.GetUniqueFilePath(Filepath); btnUniqueName.Text += Path.GetFileName(uniqueFilepath); }
public QuickTaskMenuEditorForm() { InitializeComponent(); ShareXResources.ApplyTheme(this); if (Program.Settings.QuickTaskPresets == null) { Program.Settings.QuickTaskPresets = new List <QuickTaskInfo>(); } UpdateItems(); }
public ParserSelectForm(string[] texts) { InitializeComponent(); Texts = texts; SelectedText = Texts[0]; SuspendLayout(); int maxButtonWidth = 0; int rowSize = 10; for (int i = 0; i < Texts.Length; i++) { string text = Texts[i]; if (!string.IsNullOrEmpty(text)) { Button button = new Button() { AutoSize = true, Margin = new Padding(i < rowSize ? 5 : 0, i % rowSize == 0 ? 5 : 0, 5, 5), Padding = new Padding(5), Font = new Font(Font.FontFamily, 12), Text = text, UseVisualStyleBackColor = true }; button.Click += (sender, e) => { SelectedText = text; Close(); }; flpMain.Controls.Add(button); if ((i + 1) % rowSize == 0) { flpMain.SetFlowBreak(button, true); } maxButtonWidth = Math.Max(button.Width, maxButtonWidth); } } foreach (Control control in flpMain.Controls) { control.Width = maxButtonWidth; } ResumeLayout(); ShareXResources.ApplyTheme(this); }