protected override void OnShown(EventArgs e) { base.OnShown(e); if (PdnInfo.IsExpired) { foreach (Form form in Application.OpenForms) { form.Enabled = false; } TaskButton checkForUpdatesTB = new TaskButton( ImageResource.Get("Icons.MenuHelpCheckForUpdatesIcon.png").Reference, PdnResources.GetString("ExpiredTaskDialog.CheckForUpdatesTB.ActionText"), PdnResources.GetString("ExpiredTaskDialog.CheckForUpdatesTB.ExplanationText")); TaskButton goToWebSiteTB = new TaskButton( ImageResource.Get("Icons.MenuHelpPdnWebsiteIcon.png").Reference, PdnResources.GetString("ExpiredTaskDialog.GoToWebSiteTB.ActionText"), PdnResources.GetString("ExpiredTaskDialog.GoToWebSiteTB.ExplanationText")); TaskButton doNotCheckForUpdatesTB = new TaskButton( ImageResource.Get("Icons.CancelIcon.png").Reference, PdnResources.GetString("ExpiredTaskDialog.DoNotCheckForUpdatesTB.ActionText"), PdnResources.GetString("ExpiredTaskDialog.DoNotCheckForUpdatesTB.ExplanationText")); TaskButton[] taskButtons = new TaskButton[] { checkForUpdatesTB, goToWebSiteTB, doNotCheckForUpdatesTB }; TaskButton clickedTB = TaskDialog.Show( this, Icon, PdnInfo.GetFullAppName(), ImageResource.Get("Icons.WarningIcon.png").Reference, true, PdnResources.GetString("ExpiredTaskDialog.InfoText"), taskButtons, checkForUpdatesTB, doNotCheckForUpdatesTB, 450); if (clickedTB == checkForUpdatesTB) { this.appWorkspace.CheckForUpdates(); } else if (clickedTB == goToWebSiteTB) { PdnInfo.LaunchWebSite(this, InvariantStrings.ExpiredPage); } Close(); } }
protected void SetStatus(ImageResource statusIcon, string statusText) { if (statusIcon == null && statusText != null) { statusIcon = ImageResource.Get("Icons.MenuHelpHelpTopicsIcon.png"); } DocumentWorkspace.SetStatus(statusText, statusIcon); }
public override void LoadResources() { this.Text = PdnResources.GetString("SavePaletteDialog.Text"); this.Icon = Utility.ImageToIcon(ImageResource.Get("Icons.MenuFileSaveAsIcon.png").Reference); this.cancelButton.Text = PdnResources.GetString("Form.CancelButton.Text"); this.saveButton.Text = PdnResources.GetString("Form.SaveButton.Text"); this.typeANameLabel.Text = PdnResources.GetString("SavePaletteDialog.TypeANameLabel.Text"); this.palettesLabel.Text = PdnResources.GetString("SavePaletteDialog.PalettesLabel.Text"); base.LoadResources(); }
public override void LoadResources() { this.Text = PdnResources.GetString("ChooseToolDefaultsDialog.Text"); this.Icon = Utility.ImageToIcon(ImageResource.Get("Icons.MenuLayersLayerPropertiesIcon.png").Reference); this.introText.Text = PdnResources.GetString("ChooseToolDefaultsDialog.IntroText.Text"); this.defaultToolText.Text = PdnResources.GetString("ChooseToolDefaultsDialog.DefaultToolText.Text"); this.loadFromToolBarButton.Text = PdnResources.GetString("ChooseToolDefaultsDialog.LoadFromToolBarButton.Text"); this.cancelButton.Text = PdnResources.GetString("Form.CancelButton.Text"); this.saveButton.Text = PdnResources.GetString("Form.SaveButton.Text"); this.resetButton.Text = PdnResources.GetString("Form.ResetButton.Text"); base.LoadResources(); }
public PdnStatusBar() { InitializeComponent(); this.cursorInfoStatusLabel.Image = ImageResource.Get("Icons.CursorXYIcon.png").Reference; this.cursorInfoStatusLabel.Text = string.Empty; // imageInfo (width,height info) this.imageInfoStatusLabel.Image = ImageResource.Get("Icons.ImageSizeIcon.png").Reference; // progress this.progressStatusBar.Visible = false; this.progressStatusSeparator.Visible = false; this.progressStatusBar.Height -= 4; this.progressStatusBar.ProgressBar.Style = ProgressBarStyle.Continuous; }
public override void LoadResources() { this.Text = PdnResources.GetString("UnsavedChangesDialog.Text"); this.Icon = Utility.ImageToIcon(ImageResource.Get("Icons.WarningIcon.png").Reference, false); this.infoLabel.Text = PdnResources.GetString("UnsavedChangesDialog.InfoLabel.Text"); this.documentListHeader.Text = PdnResources.GetString("UnsavedChangesDialog.DocumentListHeader.Text"); this.saveButton.ActionText = PdnResources.GetString("UnsavedChangesDialog.SaveButton.ActionText"); this.saveButton.ExplanationText = PdnResources.GetString("UnsavedChangesDialog.SaveButton.ExplanationText"); this.saveButton.ActionImage = ImageResource.Get("Icons.UnsavedChangesDialog.SaveButton.png").Reference; this.dontSaveButton.ActionText = PdnResources.GetString("UnsavedChangesDialog.DontSaveButton.ActionText"); this.dontSaveButton.ExplanationText = PdnResources.GetString("UnsavedChangesDialog.DontSaveButton.ExplanationText"); this.dontSaveButton.ActionImage = ImageResource.Get("Icons.MenuFileCloseIcon.png").Reference; this.cancelButton.ActionText = PdnResources.GetString("UnsavedChangesDialog.CancelButton.ActionText"); this.cancelButton.ExplanationText = PdnResources.GetString("UnsavedChangesDialog.CancelButton.ExplanationText"); this.cancelButton.ActionImage = ImageResource.Get("Icons.CancelIcon.png").Reference; base.LoadResources(); }
private void ChooseToolButton_DropDownOpening(object sender, EventArgs e) { this.chooseToolButton.DropDownItems.Clear(); if (this.showChooseDefaults) { string chooseToolText = PdnResources.GetString("ToolChooserStrip.ChooseToolDefaults.Text"); ImageResource chooseToolIcon = ImageResource.Get("Icons.MenuLayersLayerPropertiesIcon.png"); ToolStripMenuItem tsmi = new ToolStripMenuItem( chooseToolText, chooseToolIcon.Reference, ChooseTool_Click); this.chooseToolButton.DropDownItems.Add(tsmi); this.chooseToolButton.DropDownItems.Add(new ToolStripSeparator()); } for (int i = 0; i < this.toolInfos.Length; ++i) { ToolStripMenuItem toolMI = new ToolStripMenuItem(); toolMI.Image = this.toolInfos[i].Image.Reference; toolMI.Text = this.toolInfos[i].Name; toolMI.Tag = this.toolInfos[i]; if (this.toolInfos[i].ToolType == this.activeTool) { toolMI.Checked = true; } else { toolMI.Checked = false; } this.chooseToolButton.DropDownItems.Add(toolMI); } }
public ControlShadow() { this.SetStyle(ControlStyles.Opaque, true); this.SetStyle(ControlStyles.UserPaint, true); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.SupportsTransparentBackColor, true); this.Dock = DockStyle.Fill; this.DoubleBuffered = true; this.ResizeRedraw = true; // This call is required by the Windows.Forms Form Designer. InitializeComponent(); BackColor = Color.Transparent; this.roundedEdgeUL = ImageResource.Get("Images.RoundedEdgeUL.png").Reference; this.roundedEdgeUR = ImageResource.Get("Images.RoundedEdgeUR.png").Reference; this.roundedEdgeLL = ImageResource.Get("Images.RoundedEdgeLL.png").Reference; this.roundedEdgeLR = ImageResource.Get("Images.RoundedEdgeLR.png").Reference; if (!PdnInfo.IsFinalBuild && !betaTagDone) { betaTagDone = true; string betaTagStringFormat = PdnResources.GetString("ControlShadow.BetaTag.Text.Format"); string appName = PdnInfo.GetFullAppName(); string expiredDateString = PdnInfo.ExpirationDate.ToShortDateString(); this.betaTagString = string.Format(betaTagStringFormat, appName, expiredDateString); this.betaTagStart = DateTime.Now; this.betaTagTimer = new Timer(); this.betaTagTimer.Interval = 100; this.betaTagTimer.Tick += new EventHandler(BetaTagTimer_Tick); this.betaTagTimer.Enabled = true; } }
protected override void OnDragDrop(DragEventArgs drgevent) { Activate(); if (!IsCurrentModalForm || !Enabled) { // do nothing } else if (drgevent.Data.GetDataPresent(DataFormats.FileDrop)) { string[] allFiles = (string[])drgevent.Data.GetData(DataFormats.FileDrop); if (allFiles == null) { return; } string[] files = PruneDirectories(allFiles); bool importAsLayers = true; if (files.Length == 0) { return; } else { TaskButton openTB = new TaskButton( ImageResource.Get("Icons.MenuFileOpenIcon.png").Reference, PdnResources.GetString("DragDrop.OpenOrImport.OpenButton.ActionText"), PdnResources.GetString("DragDrop.OpenOrImport.OpenButton.ExplanationText")); string importLayersExplanation; if (this.appWorkspace.DocumentWorkspaces.Length == 0) { importLayersExplanation = PdnResources.GetString("DragDrop.OpenOrImport.ImportLayers.ExplanationText.NoImagesYet"); } else { importLayersExplanation = PdnResources.GetString("DragDrop.OpenOrImport.ImportLayers.ExplanationText"); } TaskButton importLayersTB = new TaskButton( ImageResource.Get("Icons.MenuLayersImportFromFileIcon.png").Reference, PdnResources.GetString("DragDrop.OpenOrImport.ImportLayers.ActionText"), importLayersExplanation); TaskButton clickedTB = TaskDialog.Show( this, new Icon(PdnResources.GetResourceStream("Icons.Question.ico")), PdnInfo.GetBareProductName(), null, false, PdnResources.GetString("DragDrop.OpenOrImport.InfoText"), new TaskButton[] { openTB, importLayersTB, TaskButton.Cancel }, null, TaskButton.Cancel); if (clickedTB == openTB) { importAsLayers = false; } else if (clickedTB == importLayersTB) { importAsLayers = true; } else { return; } } if (!importAsLayers) { // open files into new tabs this.appWorkspace.OpenFilesInNewWorkspace(files); } else { // no image open? we will have to create one if (this.appWorkspace.ActiveDocumentWorkspace == null) { Size newSize = this.appWorkspace.GetNewDocumentSize(); this.appWorkspace.CreateBlankDocumentInNewWorkspace( newSize, Document.DefaultDpuUnit, Document.GetDefaultDpu(Document.DefaultDpuUnit), false); } ImportFromFileAction action = new ImportFromFileAction(); HistoryMemento ha = action.ImportMultipleFiles(this.appWorkspace.ActiveDocumentWorkspace, files); if (ha != null) { this.appWorkspace.ActiveDocumentWorkspace.History.PushNewMemento(ha); } } } base.OnDragDrop(drgevent); }
public void SetIcon(string imageName) { this.ImageTransparentColor = Utility.TransparentKey; this.Image = ImageResource.Get(imageName).Reference; }