Exemplo n.º 1
0
 public SaveProgressDialog(Control owner)
     : base(owner,
            PdnResources.GetString("SaveProgressDialog.Title"),
            PdnResources.GetString("SaveProgressDialog.Description"))
 {
     this.Icon = Utility.ImageToIcon(PdnResources.GetImageResource("Icons.MenuFileSaveIcon.png").Reference, Utility.TransparentKey);
 }
Exemplo n.º 2
0
        public CanvasSizeDialog()
        {
            // This call is required by the Windows Form Designer.
            InitializeComponent();

            this.Icon = Utility.ImageToIcon(PdnResources.GetImageResource("Icons.MenuImageCanvasSizeIcon.png").Reference, Utility.TransparentKey);

            this.Text = PdnResources.GetString("CanvasSizeDialog.Text");                             // "Canvas Size";
            this.anchorHeader.Text  = PdnResources.GetString("CanvasSizeDialog.AnchorHeader.Text");  //"Anchor";
            this.newSpaceLabel.Text = PdnResources.GetString("CanvasSizeDialog.NewSpaceLabel.Text"); //"The new space will be filled with the currently selected background color.";

            foreach (string name in Enum.GetNames(typeof(AnchorEdge)))
            {
                AnchorEdge value    = (AnchorEdge)Enum.Parse(typeof(AnchorEdge), name, true);
                string     itemName = this.anchorEdgeNames.EnumValueToLocalizedName(value);
                this.anchorEdgeCB.Items.Add(itemName);

                if (value == this.AnchorEdge)
                {
                    this.anchorEdgeCB.SelectedItem = itemName;
                }
            }

            anchorChooserControl_AnchorEdgeChanged(anchorChooserControl, EventArgs.Empty);
        }
Exemplo n.º 3
0
        public AnchorChooserControl()
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            this.ResizeRedraw = true;

            this.centerImage    = PdnResources.GetImageResource("Images.AnchorChooserControl.AnchorImage.png").Reference;
            this.xyToAnchorEdge = new AnchorEdge[][] {
                new AnchorEdge[] { AnchorEdge.TopLeft, AnchorEdge.Top, AnchorEdge.TopRight },
                new AnchorEdge[] { AnchorEdge.Left, AnchorEdge.Middle, AnchorEdge.Right },
                new AnchorEdge[] { AnchorEdge.BottomLeft, AnchorEdge.Bottom, AnchorEdge.BottomRight }
            };

            this.anchorEdgeToXy = new Hashtable();
            this.anchorEdgeToXy.Add(AnchorEdge.TopLeft, new Point(0, 0));
            this.anchorEdgeToXy.Add(AnchorEdge.Top, new Point(1, 0));
            this.anchorEdgeToXy.Add(AnchorEdge.TopRight, new Point(2, 0));
            this.anchorEdgeToXy.Add(AnchorEdge.Left, new Point(0, 1));
            this.anchorEdgeToXy.Add(AnchorEdge.Middle, new Point(1, 1));
            this.anchorEdgeToXy.Add(AnchorEdge.Right, new Point(2, 1));
            this.anchorEdgeToXy.Add(AnchorEdge.BottomLeft, new Point(0, 2));
            this.anchorEdgeToXy.Add(AnchorEdge.Bottom, new Point(1, 2));
            this.anchorEdgeToXy.Add(AnchorEdge.BottomRight, new Point(2, 2));

            this.SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint |
                          ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw, true);
        }
Exemplo n.º 4
0
        public HistoryForm()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.imageList.TransparentColor = Utility.TransparentKey;
            this.toolStrip.ImageList        = this.imageList;

            int rewindIndex      = imageList.Images.Add(PdnResources.GetImageResource("Icons.HistoryRewindIcon.png").Reference, imageList.TransparentColor);
            int undoIndex        = imageList.Images.Add(PdnResources.GetImageResource("Icons.MenuEditUndoIcon.png").Reference, imageList.TransparentColor);
            int redoIndex        = imageList.Images.Add(PdnResources.GetImageResource("Icons.MenuEditRedoIcon.png").Reference, imageList.TransparentColor);
            int fastForwardIndex = imageList.Images.Add(PdnResources.GetImageResource("Icons.HistoryFastForwardIcon.png").Reference, imageList.TransparentColor);

            rewindButton.ImageIndex      = rewindIndex;
            undoButton.ImageIndex        = undoIndex;
            redoButton.ImageIndex        = redoIndex;
            fastForwardButton.ImageIndex = fastForwardIndex;

            this.Text = PdnResources.GetString("HistoryForm.Text");

            this.rewindButton.ToolTipText      = PdnResources.GetString("HistoryForm.RewindButton.ToolTipText");
            this.undoButton.ToolTipText        = PdnResources.GetString("HistoryForm.UndoButton.ToolTipText");
            this.redoButton.ToolTipText        = PdnResources.GetString("HistoryForm.RedoButton.ToolTipText");
            this.fastForwardButton.ToolTipText = PdnResources.GetString("HistoryForm.FastForwardButton.ToolTipText");

            this.MinimumSize = this.Size;
        }
Exemplo n.º 5
0
        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(
                    PdnResources.GetImageResource("Icons.MenuHelpCheckForUpdatesIcon.png").Reference,
                    PdnResources.GetString("ExpiredTaskDialog.CheckForUpdatesTB.ActionText"),
                    PdnResources.GetString("ExpiredTaskDialog.CheckForUpdatesTB.ExplanationText"));

                TaskButton goToWebSiteTB = new TaskButton(
                    PdnResources.GetImageResource("Icons.MenuHelpPdnWebsiteIcon.png").Reference,
                    PdnResources.GetString("ExpiredTaskDialog.GoToWebSiteTB.ActionText"),
                    PdnResources.GetString("ExpiredTaskDialog.GoToWebSiteTB.ExplanationText"));

                TaskButton doNotCheckForUpdatesTB = new TaskButton(
                    PdnResources.GetImageResource("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(),
                    PdnResources.GetImageResource("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();
            }
        }
Exemplo n.º 6
0
        protected void SetStatus(ImageResource statusIcon, string statusText)
        {
            if (statusIcon == null && statusText != null)
            {
                statusIcon = PdnResources.GetImageResource("Icons.MenuHelpHelpTopicsIcon.png");
            }

            DocumentWorkspace.SetStatus(statusText, statusIcon);
        }
Exemplo n.º 7
0
 public override void LoadResources()
 {
     this.Text = PdnResources.GetString("SavePaletteDialog.Text");
     this.Icon = Utility.ImageToIcon(PdnResources.GetImageResource("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();
 }
Exemplo n.º 8
0
        public ViewConfigStrip()
        {
            this.SuspendLayout();
            InitializeComponent();

            this.windowText       = EnumLocalizer.EnumValueToLocalizedName(typeof(ZoomBasis), ZoomBasis.FitToWindow);
            this.percentageFormat = PdnResources.GetString("ZoomConfigWidget.Percentage.Format");

            double[] zoomValues = ScaleFactor.PresetValues;

            this.zoomComboBox.ComboBox.SuspendLayout();

            string percent100 = null; // ScaleFactor.PresetValues guarantees that 1.0, or "100%" is in the list, but the compiler can't be shown this so we must assign a value here

            for (int i = zoomValues.Length - 1; i >= 0; --i)
            {
                string zoomValueString = (zoomValues[i] * 100.0).ToString();
                string zoomItemString  = string.Format(this.percentageFormat, zoomValueString);

                if (zoomValues[i] == 1.0)
                {
                    percent100 = zoomItemString;
                }

                this.zoomComboBox.Items.Add(zoomItemString);
            }

            this.zoomComboBox.Items.Add(this.windowText);
            this.zoomComboBox.ComboBox.ResumeLayout(false);
            this.zoomComboBox.Size = new Size(UI.ScaleWidth(this.zoomComboBox.Width), zoomComboBox.Height);

            this.unitsLabel.Text = PdnResources.GetString("WorkspaceOptionsConfigWidget.UnitsLabel.Text");

            this.zoomComboBox.Text = percent100;
            this.ScaleFactor       = ScaleFactor.OneToOne;

            this.zoomOutButton.Image = PdnResources.GetImageResource("Icons.MenuViewZoomOutIcon.png").Reference;
            this.zoomInButton.Image  = PdnResources.GetImageResource("Icons.MenuViewZoomInIcon.png").Reference;
            this.gridButton.Image    = PdnResources.GetImageResource("Icons.MenuViewGridIcon.png").Reference;
            this.rulersButton.Image  = PdnResources.GetImageResource("Icons.MenuViewRulersIcon.png").Reference;

            this.zoomOutButton.ToolTipText = PdnResources.GetString("ZoomConfigWidget.ZoomOutButton.ToolTipText");
            this.zoomInButton.ToolTipText  = PdnResources.GetString("ZoomConfigWidget.ZoomInButton.ToolTipText");
            this.gridButton.ToolTipText    = PdnResources.GetString("WorkspaceOptionsConfigWidget.DrawGridToggleButton.ToolTipText");
            this.rulersButton.ToolTipText  = PdnResources.GetString("WorkspaceOptionsConfigWidget.RulersToggleButton.ToolTipText");

            this.unitsComboBox.Size = new Size(UI.ScaleWidth(this.unitsComboBox.Width), unitsComboBox.Height);

            this.zoomBasis = ZoomBasis.ScaleFactor;
            ScaleFactor    = ScaleFactor.OneToOne;

            this.ResumeLayout(false);
        }
Exemplo n.º 9
0
        public override void LoadResources()
        {
            this.Text = PdnResources.GetString("ChooseToolDefaultsDialog.Text");
            this.Icon = Utility.ImageToIcon(PdnResources.GetImageResource("Icons.SettingsIcon.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();
        }
Exemplo n.º 10
0
        public ColorDisplayWidget()
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            this.swapIconBox.Icon          = new Bitmap(PdnResources.GetImageResource("Icons.SwapIcon.png").Reference);
            this.blackAndWhiteIconBox.Icon = new Bitmap(PdnResources.GetImageResource("Icons.BlackAndWhiteIcon.png").Reference);

            if (!DesignMode)
            {
                this.toolTip.SetToolTip(swapIconBox, PdnResources.GetString("ColorDisplayWidget.SwapIconBox.ToolTipText"));
                this.toolTip.SetToolTip(blackAndWhiteIconBox, PdnResources.GetString("ColorDisplayWidget.BlackAndWhiteIconBox.ToolTipText"));
                this.toolTip.SetToolTip(primaryColorRectangle, PdnResources.GetString("ColorDisplayWidget.ForeColorRectangle.ToolTipText"));
                this.toolTip.SetToolTip(secondaryColorRectangle, PdnResources.GetString("ColorDisplayWidget.BackColorRectangle.ToolTipText"));
            }
        }
Exemplo n.º 11
0
        public PdnStatusBar()
        {
            InitializeComponent();

            this.cursorInfoStatusLabel.Image = PdnResources.GetImageResource("Icons.CursorXYIcon.png").Reference;
            this.cursorInfoStatusLabel.Text  = string.Empty;

            // imageInfo (width,height info)
            this.imageInfoStatusLabel.Image = PdnResources.GetImageResource("Icons.ImageSizeIcon.png").Reference;

            // progress
            this.progressStatusBar.Visible           = false;
            this.progressStatusSeparator.Visible     = false;
            this.progressStatusBar.Height           -= 4;
            this.progressStatusBar.ProgressBar.Style = ProgressBarStyle.Continuous;
        }
Exemplo n.º 12
0
        public CommonActionsStrip()
        {
            InitializeComponent();

            this.newButton.Image      = PdnResources.GetImageResource("Icons.MenuFileNewIcon.png").Reference;
            this.openButton.Image     = PdnResources.GetImageResource("Icons.MenuFileOpenIcon.png").Reference;
            this.saveButton.Image     = PdnResources.GetImageResource("Icons.MenuFileSaveIcon.png").Reference;
            this.printButton.Image    = PdnResources.GetImageResource("Icons.MenuFilePrintIcon.png").Reference;
            this.cutButton.Image      = PdnResources.GetImageResource("Icons.MenuEditCutIcon.png").Reference;
            this.copyButton.Image     = PdnResources.GetImageResource("Icons.MenuEditCopyIcon.png").Reference;
            this.pasteButton.Image    = PdnResources.GetImageResource("Icons.MenuEditPasteIcon.png").Reference;
            this.cropButton.Image     = PdnResources.GetImageResource("Icons.MenuImageCropIcon.png").Reference;
            this.deselectButton.Image = PdnResources.GetImageResource("Icons.MenuEditDeselectIcon.png").Reference;
            this.undoButton.Image     = PdnResources.GetImageResource("Icons.MenuEditUndoIcon.png").Reference;
            this.redoButton.Image     = PdnResources.GetImageResource("Icons.MenuEditRedoIcon.png").Reference;

            this.newButton.ToolTipText      = PdnResources.GetString("CommonAction.New");
            this.openButton.ToolTipText     = PdnResources.GetString("CommonAction.Open");
            this.saveButton.ToolTipText     = PdnResources.GetString("CommonAction.Save");
            this.printButton.ToolTipText    = PdnResources.GetString("CommonAction.Print");
            this.cutButton.ToolTipText      = PdnResources.GetString("CommonAction.Cut");
            this.copyButton.ToolTipText     = PdnResources.GetString("CommonAction.Copy");
            this.pasteButton.ToolTipText    = PdnResources.GetString("CommonAction.Paste");
            this.cropButton.ToolTipText     = PdnResources.GetString("CommonAction.CropToSelection");
            this.deselectButton.ToolTipText = PdnResources.GetString("CommonAction.Deselect");
            this.undoButton.ToolTipText     = PdnResources.GetString("CommonAction.Undo");
            this.redoButton.ToolTipText     = PdnResources.GetString("CommonAction.Redo");

            this.newButton.Tag      = CommonAction.New;
            this.openButton.Tag     = CommonAction.Open;
            this.saveButton.Tag     = CommonAction.Save;
            this.printButton.Tag    = CommonAction.Print;
            this.cutButton.Tag      = CommonAction.Cut;
            this.copyButton.Tag     = CommonAction.Copy;
            this.pasteButton.Tag    = CommonAction.Paste;
            this.cropButton.Tag     = CommonAction.CropToSelection;
            this.deselectButton.Tag = CommonAction.Deselect;
            this.undoButton.Tag     = CommonAction.Undo;
            this.redoButton.Tag     = CommonAction.Redo;
        }
Exemplo n.º 13
0
        public LayerForm()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            imageList.TransparentColor = Utility.TransparentKey;

            toolStrip.ImageList = this.imageList;

            int addNewLayerIndex    = imageList.Images.Add(PdnResources.GetImageResource("Icons.MenuLayersAddNewLayerIcon.png").Reference, imageList.TransparentColor);
            int deleteLayerIndex    = imageList.Images.Add(PdnResources.GetImageResource("Icons.MenuLayersDeleteLayerIcon.png").Reference, imageList.TransparentColor);
            int moveLayerUpIndex    = imageList.Images.Add(PdnResources.GetImageResource("Icons.MenuLayersMoveLayerUpIcon.png").Reference, imageList.TransparentColor);
            int moveLayerDownIndex  = imageList.Images.Add(PdnResources.GetImageResource("Icons.MenuLayersMoveLayerDownIcon.png").Reference, imageList.TransparentColor);
            int duplicateLayerIndex = imageList.Images.Add(PdnResources.GetImageResource("Icons.MenuEditCopyIcon.png").Reference, imageList.TransparentColor);
            int mergeLayerDownIndex = imageList.Images.Add(PdnResources.GetImageResource("Icons.MenuLayersMergeLayerDownIcon.png").Reference, imageList.TransparentColor);
            int propertiesIndex     = imageList.Images.Add(PdnResources.GetImageResource("Icons.MenuLayersLayerPropertiesIcon.png").Reference, imageList.TransparentColor);

            addNewLayerButton.ImageIndex    = addNewLayerIndex;
            deleteLayerButton.ImageIndex    = deleteLayerIndex;
            moveLayerUpButton.ImageIndex    = moveLayerUpIndex;
            moveLayerDownButton.ImageIndex  = moveLayerDownIndex;
            duplicateLayerButton.ImageIndex = duplicateLayerIndex;
            mergeLayerDownButton.ImageIndex = mergeLayerDownIndex;
            propertiesButton.ImageIndex     = propertiesIndex;

            layerControl.KeyUp += new KeyEventHandler(LayerControl_KeyUp);

            this.Text = PdnResources.GetString("LayerForm.Text");
            this.addNewLayerButton.ToolTipText    = PdnResources.GetString("LayerForm.AddNewLayerButton.ToolTipText");
            this.deleteLayerButton.ToolTipText    = PdnResources.GetString("LayerForm.DeleteLayerButton.ToolTipText");
            this.duplicateLayerButton.ToolTipText = PdnResources.GetString("LayerForm.DuplicateLayerButton.ToolTipText");
            this.mergeLayerDownButton.ToolTipText = PdnResources.GetString("LayerForm.MergeLayerDownButton.ToolTipText");
            this.moveLayerUpButton.ToolTipText    = PdnResources.GetString("LayerForm.MoveLayerUpButton.ToolTipText");
            this.moveLayerDownButton.ToolTipText  = PdnResources.GetString("LayerForm.MoveLayerDownButton.ToolTipText");
            this.propertiesButton.ToolTipText     = PdnResources.GetString("LayerForm.PropertiesButton.ToolTipText");

            this.MinimumSize = this.Size;
        }
Exemplo n.º 14
0
        public SaveConfigDialog()
        {
            this.fileSizeTimer = new System.Threading.Timer(new System.Threading.TimerCallback(FileSizeTimerCallback),
                                                            null, 1000, System.Threading.Timeout.Infinite);

            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.Text = PdnResources.GetString("SaveConfigDialog.Text");
            this.fileSizeTextFormat  = PdnResources.GetString("SaveConfigDialog.PreviewHeader.Text.Format");
            this.settingsHeader.Text = PdnResources.GetString("SaveConfigDialog.SettingsHeader.Text");
            this.defaultsButton.Text = PdnResources.GetString("SaveConfigDialog.DefaultsButton.Text");
            this.previewHeader.Text  = PdnResources.GetString("SaveConfigDialog.PreviewHeader.Text");

            this.Icon = Utility.ImageToIcon(PdnResources.GetImageResource("Icons.MenuFileSaveIcon.png").Reference);

            this.documentView.Cursor = handIcon;

            //this.MinimumSize = this.Size;
        }
Exemplo n.º 15
0
        public override void LoadResources()
        {
            this.Text = PdnResources.GetString("UnsavedChangesDialog.Text");
            this.Icon = Utility.ImageToIcon(PdnResources.GetImageResource("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     = PdnResources.GetImageResource("Icons.UnsavedChangesDialog.SaveButton.png").Reference;

            this.dontSaveButton.ActionText      = PdnResources.GetString("UnsavedChangesDialog.DontSaveButton.ActionText");
            this.dontSaveButton.ExplanationText = PdnResources.GetString("UnsavedChangesDialog.DontSaveButton.ExplanationText");
            this.dontSaveButton.ActionImage     = PdnResources.GetImageResource("Icons.MenuFileCloseIcon.png").Reference;

            this.cancelButton.ActionText      = PdnResources.GetString("UnsavedChangesDialog.CancelButton.ActionText");
            this.cancelButton.ExplanationText = PdnResources.GetString("UnsavedChangesDialog.CancelButton.ExplanationText");
            this.cancelButton.ActionImage     = PdnResources.GetImageResource("Icons.CancelIcon.png").Reference;

            base.LoadResources();
        }
Exemplo n.º 16
0
        protected virtual void DrawItemCloseButton(
            Graphics g,
            Item item,
            Rectangle itemRect,
            Rectangle closeButtonRect)
        {
            if (item.Checked && item.Selected)
            {
                const string resourceNamePrefix = "Images.ImageStrip.CloseButton.";
                const string resourceNameSuffix = ".png";
                string       resourceNameInfix  = item.CloseRenderState.ToString();

                string resourceName = resourceNamePrefix + resourceNameInfix + resourceNameSuffix;

                ImageResource imageResource = PdnResources.GetImageResource(resourceName);
                Image         image         = imageResource.Reference;

                g.SmoothingMode     = SmoothingMode.AntiAlias;
                g.InterpolationMode = InterpolationMode.HighQualityBicubic;

                g.DrawImage(image, closeButtonRect, new Rectangle(0, 0, image.Width, image.Width), GraphicsUnit.Pixel);
            }
        }
Exemplo n.º 17
0
        private void ChooseToolButton_DropDownOpening(object sender, EventArgs e)
        {
            this.chooseToolButton.DropDownItems.Clear();

            if (this.showChooseDefaults)
            {
                string        chooseToolText = PdnResources.GetString("ToolChooserStrip.ChooseToolDefaults.Text");
                ImageResource chooseToolIcon = PdnResources.GetImageResource("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);
            }
        }
Exemplo n.º 18
0
        public ControlShadow()
        {
            this.SetStyle(ControlStyles.Opaque, true);
            this.SetStyle(ControlStyles.UserPaint, true);
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);

            this.Dock           = DockStyle.Fill;
            this.DoubleBuffered = true;
            this.ResizeRedraw   = true;

            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            BackColor = Color.FromArgb(0xc0, 0xc0, 0xc0);

            this.roundedEdgeUL = PdnResources.GetImageResource("Images.RoundedEdgeUL.png").Reference;
            this.roundedEdgeUR = PdnResources.GetImageResource("Images.RoundedEdgeUR.png").Reference;
            this.roundedEdgeLL = PdnResources.GetImageResource("Images.RoundedEdgeLL.png").Reference;
            this.roundedEdgeLR = PdnResources.GetImageResource("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;
            }
        }
Exemplo n.º 19
0
 public NewFileDialog()
 {
     InitializeComponent();
     this.Icon = Utility.ImageToIcon(PdnResources.GetImageResource("Icons.MenuFileNewIcon.png").Reference, Utility.TransparentKey);
     this.Text = PdnResources.GetString("NewFileDialog.Text"); // "New";
 }
Exemplo n.º 20
0
        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
                {
                    Icon   formIcon = Utility.ImageToIcon(PdnResources.GetImageResource("Icons.DragDrop.OpenOrImport.FormIcon.png").Reference);
                    string title    = PdnResources.GetString("DragDrop.OpenOrImport.Title");
                    string infoText = PdnResources.GetString("DragDrop.OpenOrImport.InfoText");

                    TaskButton openTB = new TaskButton(
                        PdnResources.GetImageResource("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(
                        PdnResources.GetImageResource("Icons.MenuLayersImportFromFileIcon.png").Reference,
                        PdnResources.GetString("DragDrop.OpenOrImport.ImportLayers.ActionText"),
                        importLayersExplanation);

                    TaskButton clickedTB = TaskDialog.Show(
                        this,
                        formIcon,
                        title,
                        null,
                        false,
                        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);
        }
Exemplo n.º 21
0
 public void SetIcon(string imageName)
 {
     this.ImageTransparentColor = Utility.TransparentKey;
     this.Image = PdnResources.GetImageResource(imageName).Reference;
 }