Exemplo n.º 1
0
        public EditorStartupForm(RegionCaptureOptions options)
        {
            Options = options;

            InitializeComponent();
            ShareXResources.ApplyThemeToForm(this);
        }
Exemplo n.º 2
0
        public TwitterTweetForm()
        {
            InitializeComponent();
            ShareXResources.ApplyThemeToForm(this);

            MediaMode = false;
        }
Exemplo n.º 3
0
        public HotkeySettingsForm(HotkeyManager hotkeyManager)
        {
            InitializeComponent();
            ShareXResources.ApplyThemeToForm(this);

            PrepareHotkeys(hotkeyManager);
        }
Exemplo n.º 4
0
        public HistoryItemInfoForm(object hi)
        {
            InitializeComponent();
            ShareXResources.ApplyThemeToForm(this);

            olvMain.SelectObject(hi);
        }
Exemplo n.º 5
0
        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();
            }
        }
Exemplo n.º 6
0
        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);
            }
        }
Exemplo n.º 7
0
        public DirectoryIndexerForm(IndexerSettings settings)
        {
            InitializeComponent();
            ShareXResources.ApplyThemeToForm(this);

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

            Response       = response;
            txtSource.Text = Response;
        }
Exemplo n.º 9
0
        public WatermarkForm(WatermarkConfig watermarkConfig)
        {
            config = watermarkConfig;

            InitializeComponent();
            ShareXResources.ApplyThemeToForm(this);

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

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

            if (!string.IsNullOrEmpty(text))
            {
                txtQRCode.Text = text;
            }
        }
Exemplo n.º 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);
                }
            }
        }
Exemplo n.º 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);
        }
Exemplo n.º 14
0
        public WatchFolderForm(WatchFolderSettings watchFolder)
        {
            WatchFolder = watchFolder;

            InitializeComponent();
            ShareXResources.ApplyThemeToForm(this);

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

            InitializeComponent();
            ShareXResources.ApplyThemeToForm(this);

            txtMediaPath.Text        = Options.LastVideoPath ?? "";
            pgOptions.SelectedObject = Options;
        }
Exemplo n.º 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();
        }
Exemplo n.º 17
0
        public QuickTaskMenuEditorForm()
        {
            InitializeComponent();
            ShareXResources.ApplyThemeToForm(this);

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

            UpdateItems();
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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");
        }
Exemplo n.º 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;
        }
Exemplo n.º 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();
        }
Exemplo n.º 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();
        }
Exemplo n.º 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;
        }
Exemplo n.º 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;
        }
Exemplo n.º 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);
        }
Exemplo n.º 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();
            }
        }
Exemplo n.º 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>());
        }
Exemplo n.º 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();
        }
Exemplo n.º 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();
        }