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.FileSizeText.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.GetImage("Icons.MenuFileSaveIcon.png"));

            this.documentView.Cursor = handIcon;

            this.previewBottomMargin = this.Height - this.documentView.Bottom;
            this.previewRightMargin  = this.Width - this.documentView.Right;

            this.MinimumSize = this.Size;
        }
        public CanvasSizeDialog()
        {
            // This call is required by the Windows Form Designer.
            InitializeComponent();

            this.Icon = Utility.ImageToIcon(PdnResources.GetImage("Icons.MenuImageCanvasSizeIcon.png"), 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);
        }
Example #3
0
        public NewFileDialog()
        {
            InitializeComponent();
            this.Icon = Utility.ImageToIcon(PdnResources.GetImage("Icons.MenuFileNewIcon.png"), Utility.TransparentKey);

            this.Text = PdnResources.GetString("NewFileDialog.Text"); // "New";
        }
Example #4
0
        public HistoryForm()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

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

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

            clearHistoryButton.ImageIndex = clearHistoryIndex;
            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.clearHistoryButton.ToolTipText = PdnResources.GetString("HistoryForm.ClearHistoryButton.ToolTipText");

            this.MinimumSize = this.Size;
        }
        public AnchorChooserControl()
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            this.ResizeRedraw = true;

            this.centerImage    = PdnResources.GetImage("Images.AnchorChooserControl.AnchorImage.png");
            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);
        }
 public SaveProgressDialog(Control owner)
     : base(owner,
            PdnResources.GetString("SaveProgressDialog.Title"),
            PdnResources.GetString("SaveProgressDialog.Description"))
 {
     this.Icon = Utility.ImageToIcon(PdnResources.GetImage("Icons.MenuFileSaveIcon.png"), Utility.TransparentKey);
 }
 public LoadProgressDialog(Control owner, Stream stream, FileType fileType)
     : base(owner,
            PdnInfo.GetBareProductName(),
            PdnResources.GetString("LoadProgressDialog.Description"))
 {
     this.fileType                 = fileType;
     this.siphonStream             = new SiphonStream(stream);
     this.siphonStream.IOFinished += new IOEventHandler(siphonStream_IOFinished);
     this.Icon = Utility.ImageToIcon(PdnResources.GetImage("Icons.ImageFromDiskIcon.png"), Utility.TransparentKey);
 }
Example #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.GetImage("Icons.MenuViewZoomOutIcon.png");
            this.zoomInButton.Image  = PdnResources.GetImage("Icons.MenuViewZoomInIcon.png");
            this.gridButton.Image    = PdnResources.GetImage("Icons.MenuViewGridIcon.png");
            this.rulersButton.Image  = PdnResources.GetImage("Icons.MenuViewRulersIcon.png");

            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);
        }
        public LayerPropertiesDialog()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            this.Icon = Utility.ImageToIcon(PdnResources.GetImage("Icons.MenuLayersLayerPropertiesIcon.png"), Color.FromArgb(192, 192, 192));

            this.Text = PdnResources.GetString("LayerPropertiesDialog.Text");
            this.visibleCheckBox.Text = PdnResources.GetString("LayerPropertiesDialog.VisibleCheckBox.Text");
            this.nameLabel.Text       = PdnResources.GetString("LayerPropertiesDialog.NameLabel.Text");
            this.generalHeader.Text   = PdnResources.GetString("LayerPropertiesDialog.GeneralHeader.Text");
            this.cancelButton.Text    = PdnResources.GetString("Form.CancelButton.Text");
            this.okButton.Text        = PdnResources.GetString("Form.OkButton.Text");
        }
        public ColorDisplayWidget()
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

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

            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"));
            }
        }
Example #11
0
        public LayerForm()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            imageList.TransparentColor = Utility.TransparentKey;

            toolStrip.ImageList = this.imageList;

            int addNewLayerIndex    = imageList.Images.Add(PdnResources.GetImage("Icons.MenuLayersAddNewLayerIcon.png"), imageList.TransparentColor);
            int deleteLayerIndex    = imageList.Images.Add(PdnResources.GetImage("Icons.MenuLayersDeleteLayerIcon.png"), imageList.TransparentColor);
            int moveLayerUpIndex    = imageList.Images.Add(PdnResources.GetImage("Icons.MenuLayersMoveLayerUpIcon.png"), imageList.TransparentColor);
            int moveLayerDownIndex  = imageList.Images.Add(PdnResources.GetImage("Icons.MenuLayersMoveLayerDownIcon.png"), imageList.TransparentColor);
            int duplicateLayerIndex = imageList.Images.Add(PdnResources.GetImage("Icons.MenuEditCopyIcon.png"), imageList.TransparentColor);
            int mergeLayerDownIndex = imageList.Images.Add(PdnResources.GetImage("Icons.MenuLayersMergeLayerDownIcon.png"), imageList.TransparentColor);
            int propertiesIndex     = imageList.Images.Add(PdnResources.GetImage("Icons.MenuLayersLayerPropertiesIcon.png"), 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;
        }
Example #12
0
        public CommonActionsStrip()
        {
            InitializeComponent();

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

            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;
        }
Example #13
0
 protected override Image Load()
 {
     return(PdnResources.GetImage(this.name));
 }