Beispiel #1
0
        public EditorStartupForm(RegionCaptureOptions options)
        {
            Options = options;

            InitializeComponent();
            ShareXResources.ApplyThemeToForm(this);
        }
Beispiel #2
0
        public TwitterTweetForm()
        {
            InitializeComponent();
            ShareXResources.ApplyThemeToForm(this);

            MediaMode = false;
        }
Beispiel #3
0
        public HotkeySettingsForm(HotkeyManager hotkeyManager)
        {
            InitializeComponent();
            ShareXResources.ApplyThemeToForm(this);

            PrepareHotkeys(hotkeyManager);
        }
        public HistoryItemInfoForm(object hi)
        {
            InitializeComponent();
            ShareXResources.ApplyThemeToForm(this);

            olvMain.SelectObject(hi);
        }
        public ScrollingCaptureForm(ScrollingCaptureOptions options, RegionCaptureOptions regionCaptureOptions, bool forceSelection = false)
        {
            Options = options;
            RegionCaptureOptions = regionCaptureOptions;

            InitializeComponent();
            ShareXResources.ApplyThemeToForm(this);

            cbScrollMethod.Items.AddRange(Helpers.GetLocalizedEnumDescriptions <ScrollingCaptureScrollMethod>());
            cbScrollMethod.SelectedIndex = (int)Options.ScrollMethod;
            cbScrollTopMethodBeforeCapture.Items.AddRange(Helpers.GetLocalizedEnumDescriptions <ScrollingCaptureScrollTopMethod>());
            cbScrollTopMethodBeforeCapture.SelectedIndex = (int)Options.ScrollTopMethodBeforeCapture;
            nudStartDelay.SetValue(Options.StartDelay);
            nudScrollDelay.SetValue(Options.ScrollDelay);
            nudMaximumScrollCount.SetValue(Options.MaximumScrollCount);
            cbStartSelectionAutomatically.Checked = Options.StartSelectionAutomatically;
            cbStartCaptureAutomatically.Checked   = Options.StartCaptureAutomatically;
            cbAutoDetectScrollEnd.Checked         = Options.AutoDetectScrollEnd;
            cbRemoveDuplicates.Checked            = Options.RemoveDuplicates;
            cbAutoCombine.Checked = Options.AfterCaptureAutomaticallyCombine;
            chkAutoUpload.Checked = Options.AutoUpload;

            if (forceSelection || Options.StartSelectionAutomatically)
            {
                if (Options.StartCaptureAutomatically)
                {
                    WindowState = FormWindowState.Minimized;
                }

                SelectHandle();
            }
        }
        public ActionsToolbarEditForm(List <HotkeyType> actions)
        {
            InitializeComponent();
            ShareXResources.ApplyThemeToForm(this);

            Actions = actions;

            foreach (HotkeyType hotkeyType in Helpers.GetEnums <HotkeyType>())
            {
                Image img;

                if (hotkeyType == HotkeyType.None)
                {
                    img = Resources.ui_splitter;
                }
                else
                {
                    img = TaskHelpers.GetHotkeyTypeIcon(hotkeyType);
                }

                ilMain.Images.Add(hotkeyType.ToString(), img);
            }

            AddEnumItemsContextMenu(AddAction, cmsAction);

            foreach (HotkeyType action in Actions)
            {
                AddActionToList(action);
            }
        }
        public DirectoryIndexerForm(IndexerSettings settings)
        {
            InitializeComponent();
            ShareXResources.ApplyThemeToForm(this);

            Settings = settings;
            pgSettings.SelectedObject = Settings;
        }
Beispiel #8
0
        public ResponseForm(string response)
        {
            InitializeComponent();
            ShareXResources.ApplyThemeToForm(this);

            Response       = response;
            txtSource.Text = Response;
        }
Beispiel #9
0
        public WatermarkForm(WatermarkConfig watermarkConfig)
        {
            config = watermarkConfig;

            InitializeComponent();
            ShareXResources.ApplyThemeToForm(this);

            CodeMenu.Create <CodeMenuEntryFilename>(txtWatermarkText, CodeMenuEntryFilename.t, CodeMenuEntryFilename.pn);
        }
Beispiel #10
0
        public UserPassBox(string title, string userName, string password)
        {
            InitializeComponent();
            ShareXResources.ApplyThemeToForm(this);

            Text             = title;
            txtUserName.Text = userName;
            txtPassword.Text = password;
        }
Beispiel #11
0
        public QRCodeForm(string text = null)
        {
            InitializeComponent();
            ShareXResources.ApplyThemeToForm(this);

            if (!string.IsNullOrEmpty(text))
            {
                txtQRCode.Text = text;
            }
        }
Beispiel #12
0
        public AfterUploadForm(TaskInfo info)
        {
            InitializeComponent();
            ShareXResources.ApplyThemeToForm(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 (!Helpers.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 (Helpers.IsImageFile(Info.Result.URL))
            {
                foreach (ClipboardFormat cf in Program.Settings.ClipboardContentFormats)
                {
                    AddFormat(cf.Description, parser.Parse(Info, cf.Format), lvgCustom);
                }
            }
        }
Beispiel #13
0
        public ImageCombinerForm(ImageCombinerOptions options)
        {
            Options = options;

            InitializeComponent();
            ShareXResources.ApplyThemeToForm(this);

            cbOrientation.Items.AddRange(Enum.GetNames(typeof(Orientation)));
            cbOrientation.SelectedIndex = (int)Options.Orientation;
            nudSpace.SetValue(Options.Space);
        }
Beispiel #14
0
        public WatchFolderForm(WatchFolderSettings watchFolder)
        {
            WatchFolder = watchFolder;

            InitializeComponent();
            ShareXResources.ApplyThemeToForm(this);

            txtFolderPath.Text = watchFolder.FolderPath ?? "";
            txtFilter.Text     = watchFolder.Filter ?? "";
            cbIncludeSubdirectories.Checked = watchFolder.IncludeSubdirectories;
        }
        public VideoThumbnailerForm(string ffmpegPath, VideoThumbnailOptions options)
        {
            FFmpegPath = ffmpegPath;
            Options    = options;

            InitializeComponent();
            ShareXResources.ApplyThemeToForm(this);

            txtMediaPath.Text        = Options.LastVideoPath ?? "";
            pgOptions.SelectedObject = Options;
        }
Beispiel #16
0
        public OCRSpaceForm(OCROptions ocrOptions)
        {
            InitializeComponent();
            ShareXResources.ApplyThemeToForm(this);

            this.ocrOptions = ocrOptions;
            cbLanguages.Items.AddRange(Helpers.GetEnumDescriptions <OCRSpaceLanguages>());
            cbLanguages.SelectedIndex = (int)ocrOptions.DefaultLanguage;
            Language = ocrOptions.DefaultLanguage;
            txtResult.SupportSelectAll();
        }
        public QuickTaskMenuEditorForm()
        {
            InitializeComponent();
            ShareXResources.ApplyThemeToForm(this);

            if (Program.Settings.QuickTaskPresets == null)
            {
                Program.Settings.QuickTaskPresets = new List <QuickTaskInfo>();
            }

            UpdateItems();
        }
Beispiel #18
0
        public FileExistForm(string filepath)
        {
            InitializeComponent();
            ShareXResources.ApplyThemeToForm(this);

            Filepath            = filepath;
            filename            = Path.GetFileNameWithoutExtension(Filepath);
            txtNewName.Text     = filename;
            btnOverwrite.Text  += Path.GetFileName(Filepath);
            uniqueFilepath      = Helpers.GetUniqueFilePath(Filepath);
            btnUniqueName.Text += Path.GetFileName(uniqueFilepath);
        }
Beispiel #19
0
        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.ApplyThemeToForm(this);
        }
Beispiel #20
0
        public ClipboardFormatForm(ClipboardFormat cbf)
        {
            InitializeComponent();
            ShareXResources.ApplyThemeToForm(this);

            ClipboardFormat     = cbf;
            txtDescription.Text = cbf.Description ?? "";
            txtFormat.Text      = cbf.Format ?? "";
            CodeMenu.Create <CodeMenuEntryFilename>(txtFormat);
            lblExample.Text = string.Format(Resources.ClipboardFormatForm_ClipboardFormatForm_Supported_variables___0__and_other_variables_such_as__1__etc_,
                                            "$result, $url, $shorturl, $thumbnailurl, $deletionurl, $filepath, $filename, $filenamenoext, $thumbnailfilename, $thumbnailfilenamenoext, $folderpath, $foldername, $uploadtime",
                                            "%y, %mo, %d");
        }
Beispiel #21
0
        public ImageHistorySettingsForm(ImageHistorySettings settings)
        {
            InitializeComponent();
            ShareXResources.ApplyThemeToForm(this);

            Settings = settings;
            cbViewMode.Items.AddRange(Enum.GetNames(typeof(Manina.Windows.Forms.View)));
            cbViewMode.SelectedIndex = Settings.ViewMode;
            nudThumbnailSize.SetValue(Settings.ThumbnailSize.Width);
            nudMaximumImageLimit.SetValue(Settings.MaxItemCount);
            cbFilterMissingFiles.Checked = Settings.FilterMissingFiles;
            cbRememberSearchText.Checked = Settings.RememberSearchText;
        }
Beispiel #22
0
        public QuickTaskInfoEditForm(QuickTaskInfo taskInfo)
        {
            TaskInfo = taskInfo;

            InitializeComponent();
            ShareXResources.ApplyThemeToForm(this);

            txtName.Text = TaskInfo.Name;
            AddMultiEnumItemsContextMenu <AfterCaptureTasks>(x => TaskInfo.AfterCaptureTasks = TaskInfo.AfterCaptureTasks.Swap(x), cmsAfterCapture);
            AddMultiEnumItemsContextMenu <AfterUploadTasks>(x => TaskInfo.AfterUploadTasks   = TaskInfo.AfterUploadTasks.Swap(x), cmsAfterUpload);
            SetMultiEnumCheckedContextMenu(TaskInfo.AfterCaptureTasks, cmsAfterCapture);
            SetMultiEnumCheckedContextMenu(TaskInfo.AfterUploadTasks, cmsAfterUpload);
            UpdateUploaderMenuNames();
        }
Beispiel #23
0
        public ImageEffectsForm(Image img, List <ImageEffectPreset> presets, int selectedPresetIndex)
        {
            InitializeComponent();
            ShareXResources.ApplyThemeToForm(this);

            DefaultImage = img;
            Presets      = presets;
            if (Presets.Count == 0)
            {
                Presets.Add(new ImageEffectPreset());
            }
            SelectedPresetIndex       = selectedPresetIndex;
            eiImageEffects.ObjectType = typeof(ImageEffectPreset);
            AddAllEffectsToContextMenu();
        }
Beispiel #24
0
        public NewImageForm(RegionCaptureOptions options)
        {
            InitializeComponent();
            ShareXResources.ApplyThemeToForm(this);

            Options = options;

            nudWidth.TextChanged  += NudWidth_TextChanged;
            nudHeight.TextChanged += NudHeight_TextChanged;

            nudWidth.Value        = Options.EditorNewImageSize.Width;
            nudHeight.Value       = Options.EditorNewImageSize.Height;
            cbTransparent.Checked = Options.EditorNewImageTransparent;
            btnChangeColor.Color  = options.EditorNewImageBackgroundColor;
        }
Beispiel #25
0
        public ActionsForm(ExternalProgram fileAction)
        {
            InitializeComponent();
            ShareXResources.ApplyThemeToForm(this);

            FileAction        = fileAction;
            txtName.Text      = fileAction.Name ?? "";
            txtPath.Text      = fileAction.Path ?? "";
            txtArguments.Text = fileAction.Args ?? "";
            CodeMenu.Create <CodeMenuEntryActions>(txtArguments);
            txtOutputExtension.Text   = fileAction.OutputExtension ?? "";
            txtExtensions.Text        = fileAction.Extensions ?? "";
            cbHiddenWindow.Checked    = fileAction.HiddenWindow;
            cbDeleteInputFile.Checked = fileAction.DeleteInputFile;
        }
Beispiel #26
0
        public BeforeUploadForm(TaskInfo info)
        {
            InitializeComponent();
            ShareXResources.ApplyThemeToForm(this);
            DialogResult = DialogResult.OK;

            ucBeforeUpload.InitCompleted += currentDestination =>
            {
                string title = string.IsNullOrEmpty(currentDestination) ? Resources.BeforeUploadForm_BeforeUploadForm_Please_choose_a_destination_ :
                               Resources.BeforeUploadForm_BeforeUploadForm__0__is_about_to_be_uploaded_to__1___You_may_choose_a_different_destination_;
                lblTitle.Text = string.Format(title, info.FileName, currentDestination);
                pbPreview.LoadImageFromFileAsync(info.FilePath);
            };

            ucBeforeUpload.Init(info);
        }
Beispiel #27
0
        public TextUploadForm(string content = null)
        {
            InitializeComponent();
            ShareXResources.ApplyThemeToForm(this);

            if (string.IsNullOrEmpty(content) && Clipboard.ContainsText())
            {
                content = Clipboard.GetText();
            }

            if (!string.IsNullOrEmpty(content))
            {
                txtContent.Text = content;
                txtContent.SelectAll();
            }
        }
Beispiel #28
0
        public FFmpegOptionsForm(ScreencastOptions options)
        {
            Options = options;

            InitializeComponent();
            ShareXResources.ApplyThemeToForm(this);

            eiFFmpeg.ObjectType = typeof(FFmpegOptions);
            cboVideoCodec.Items.AddRange(Helpers.GetEnumDescriptions <FFmpegVideoCodec>());
            cboAudioCodec.Items.AddRange(Helpers.GetEnumDescriptions <FFmpegAudioCodec>());
            cbx264Preset.Items.AddRange(Helpers.GetEnumDescriptions <FFmpegPreset>());
            cbGIFStatsMode.Items.AddRange(Helpers.GetEnumDescriptions <FFmpegPaletteGenStatsMode>());
            cbNVENCPreset.Items.AddRange(Helpers.GetEnums <FFmpegNVENCPreset>().Select(x => $"{x} ({x.GetDescription()})").ToArray());
            cbGIFDither.Items.AddRange(Helpers.GetEnumDescriptions <FFmpegPaletteUseDither>());
            cbAMFUsage.Items.AddRange(Helpers.GetEnums <FFmpegAMFUsage>().Select(x => $"{x} ({x.GetDescription()})").ToArray());
            cbAMFQuality.Items.AddRange(Helpers.GetEnums <FFmpegAMFQuality>().Select(x => $"{x} ({x.GetDescription()})").ToArray());
            cbQSVPreset.Items.AddRange(Helpers.GetEnumDescriptions <FFmpegQSVPreset>());
        }
Beispiel #29
0
        public StickerPackForm(List <StickerPackInfo> stickers)
        {
            Stickers = stickers;

            InitializeComponent();
            ShareXResources.ApplyThemeToForm(this);

            foreach (StickerPackInfo stickerPackInfo in Stickers)
            {
                cbStickers.Items.Add(stickerPackInfo);
            }

            if (cbStickers.Items.Count > 0)
            {
                cbStickers.SelectedIndex = 0;
            }

            UpdateEnabledStates();
        }
Beispiel #30
0
        public StickerForm(List <StickerPackInfo> stickerPacks, int selectedStickerPack, int stickerSize = 64)
        {
            StickerPacks        = stickerPacks;
            SelectedStickerPack = selectedStickerPack;
            StickerSize         = stickerSize;

            InitializeComponent();
            ShareXResources.ApplyThemeToForm(this);

            tsMain.Renderer = new ToolStripRoundedEdgeRenderer();
            tsnudSize.NumericUpDownControl.Minimum   = 16;
            tsnudSize.NumericUpDownControl.Maximum   = 256;
            tsnudSize.NumericUpDownControl.Increment = 16;
            tsnudSize.NumericUpDownControl.TextAlign = HorizontalAlignment.Center;
            tsnudSize.NumericUpDownControl.SetValue(StickerSize);
            ilvStickers.SetRenderer(new StickerImageListViewRenderer());
            ilvStickers.ThumbnailSize = new Size(StickerSize, StickerSize);
            UpdateStickerPacks();
            tstbSearch.Focus();
        }