Example #1
0
    public override bool Loaded()
    {
        ToolStripLabel item = new ToolStripLabel("Test Plugin");
            item.Click += item_Click;

            Host.FDMenuMap.Items.Add(item);

            return true;
    }
    public StatusStripExam()
    {
        this.Text = "StatusStrip 예제";

        ImageList imglst = new ImageList();
        imglst.TransparentColor = Color.Black;
        imglst.Images.Add("Color", new Bitmap(GetType(), "StatusStripExam.ColorHS.BMP"));
        imglst.Images.Add("Comment", new Bitmap(GetType(), "StatusStripExam.CommentHS.bmp"));

        StatusStrip status = new StatusStrip();
        status.Parent = this;
        status.ImageList = imglst;

        color_btn = new ToolStripButton();
        color_btn.Image = imglst.Images[0];
        color_btn.Click += EventProc;
        status.Items.Add(color_btn);

        comment_btn = new ToolStripButton();
        comment_btn.ImageKey = "Comment";
        comment_btn.Click += EventProc;
        status.Items.Add(comment_btn);

        // 메뉴 구분선 넣기
        ToolStripSeparator item_sep = new ToolStripSeparator();
        status.Items.Add(item_sep);

        txt_box = new ToolStripComboBox();
        txt_box.ToolTipText = "글꼴 선택";
        txt_box.Text = "글꼴 선택";
        txt_box.Items.Add("궁서체");
        txt_box.Items.Add("돋움체");
        txt_box.Items.Add("바탕체");
        status.Items.Add(txt_box);

        label = new ToolStripLabel();
        label.Size = new Size(100, 10);
        status.Items.Add(label);

        // 프로그래스바 설정
        prog_bar = new ToolStripProgressBar();

        prog_bar.Size = new Size(100, 10);
        prog_bar.Maximum = 100;
        prog_bar.Minimum = 0;
        status.Items.Add(prog_bar);

        Timer timer = new Timer();
        timer.Tick += new EventHandler(TimerProc);
        timer.Interval = 1000;
        timer.Start();
    }
Example #3
0
	public MainForm ()
	{
		// 
		// _showImageMarginCheckBox
		// 
		_showImageMarginCheckBox = new CheckBox ();
		_showImageMarginCheckBox.Checked = true;
		_showImageMarginCheckBox.Location = new Point (8, 80);
		_showImageMarginCheckBox.Size = new Size (130, 20);
		_showImageMarginCheckBox.Text = "ShowImageMargin";
		_showImageMarginCheckBox.CheckedChanged += new EventHandler (ShowImageMarginCheckBox_CheckedChanged);
		Controls.Add (_showImageMarginCheckBox);
		// 
		// _menu
		// 
		_menu = new ContextMenuStrip ();
		_menu.Dock = DockStyle.Top;
		_menu.Size = new Size (170, 70);
		// 
		// _label
		// 
		_label = new ToolStripLabel ();
		_label.Text = "Mono";
		_menu.Items.Add (_label);
		// 
		// _menuItem
		// 
		_menuItem = new ToolStripMenuItem ();
		_menuItem.Size = new Size (169, 22);
		_menuItem.Text = "Insert date...";
		_menu.Items.Add (_menuItem);
		// 
		// MainForm
		// 
		ClientSize = new Size (285, 105);
		ContextMenuStrip = _menu;
		Location = new Point (250, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "bug #81903";
		Load += new EventHandler (MainForm_Load);
	}
Example #4
0
        public static ToolStripItem[] RecentMenu(this RecentFiles recent, IMainFormForTools mainForm, Action <string> loadFileCallback, string entrySemantic, bool noAutoload = false, bool romLoading = false)
        {
            var items = new List <ToolStripItem>();

            if (recent.Empty)
            {
                var none = new ToolStripMenuItem {
                    Enabled = false, Text = "None"
                };
                items.Add(none);
            }
            else
            {
                foreach (var filename in recent)
                {
                    string caption      = filename;
                    string path         = filename;
                    string physicalPath = filename;
                    bool   crazyStuff   = true;

                    //sentinel for newer format OpenAdvanced type code
                    if (romLoading)
                    {
                        if (filename.StartsWith("*"))
                        {
                            var oa = OpenAdvancedSerializer.ParseWithLegacy(filename);
                            caption = oa.DisplayName;

                            crazyStuff = false;
                            if (oa is OpenAdvanced_OpenRom openRom)
                            {
                                crazyStuff   = true;
                                physicalPath = openRom.Path;
                            }
                        }
                    }

                    // TODO - do TSMI and TSDD need disposing? yuck
                    var item = new ToolStripMenuItem {
                        Text = caption.Replace("&", "&&")
                    };
                    items.Add(item);

                    item.Click += (o, ev) =>
                    {
                        loadFileCallback(path);
                    };

                    var tsdd = new ToolStripDropDownMenu();

                    if (crazyStuff)
                    {
                        //TODO - use standard methods to split filename (hawkfile acquire?)
                        var  hf         = new HawkFile(physicalPath ?? throw new Exception("this will probably never appear but I can't be bothered checking --yoshi"), delayIOAndDearchive: true);
                        bool canExplore = File.Exists(hf.FullPathWithoutMember);

                        if (canExplore)
                        {
                            //make a menuitem to show the last modified timestamp
                            var timestamp     = File.GetLastWriteTime(hf.FullPathWithoutMember);
                            var tsmiTimestamp = new ToolStripLabel {
                                Text = timestamp.ToString()
                            };

                            tsdd.Items.Add(tsmiTimestamp);
                            tsdd.Items.Add(new ToolStripSeparator());

                            if (hf.IsArchive)
                            {
                                //make a menuitem to let you copy the path
                                var tsmiCopyCanonicalPath = new ToolStripMenuItem {
                                    Text = "&Copy Canonical Path"
                                };
                                tsmiCopyCanonicalPath.Click += (o, ev) => { Clipboard.SetText(physicalPath); };
                                tsdd.Items.Add(tsmiCopyCanonicalPath);

                                var tsmiCopyArchivePath = new ToolStripMenuItem {
                                    Text = "Copy Archive Path"
                                };
                                tsmiCopyArchivePath.Click += (o, ev) => { Clipboard.SetText(hf.FullPathWithoutMember); };
                                tsdd.Items.Add(tsmiCopyArchivePath);

                                var tsmiOpenArchive = new ToolStripMenuItem {
                                    Text = "Open &Archive"
                                };
                                tsmiOpenArchive.Click += (o, ev) => { System.Diagnostics.Process.Start(hf.FullPathWithoutMember); };
                                tsdd.Items.Add(tsmiOpenArchive);
                            }
                            else
                            {
                                // make a menuitem to let you copy the path
                                var tsmiCopyPath = new ToolStripMenuItem {
                                    Text = "&Copy Path"
                                };
                                tsmiCopyPath.Click += (o, ev) => { Clipboard.SetText(physicalPath); };
                                tsdd.Items.Add(tsmiCopyPath);
                            }

                            tsdd.Items.Add(new ToolStripSeparator());

                            // make a menuitem to let you explore to it
                            var tsmiExplore = new ToolStripMenuItem {
                                Text = "&Explore"
                            };
                            string explorePath = $"\"{hf.FullPathWithoutMember}\"";
                            tsmiExplore.Click += (o, ev) => { System.Diagnostics.Process.Start("explorer.exe", $"/select, {explorePath}"); };
                            tsdd.Items.Add(tsmiExplore);

                            var tsmiCopyFile = new ToolStripMenuItem {
                                Text = "Copy &File"
                            };
                            var lame = new System.Collections.Specialized.StringCollection
                            {
                                hf.FullPathWithoutMember
                            };

                            tsmiCopyFile.Click += (o, ev) => { Clipboard.SetFileDropList(lame); };
                            tsdd.Items.Add(tsmiCopyFile);

                            var tsmiTest = new ToolStripMenuItem {
                                Text = "&Shell Context Menu"
                            };
                            tsmiTest.Click += (o, ev) =>
                            {
                                var si    = new GongSolutions.Shell.ShellItem(hf.FullPathWithoutMember);
                                var scm   = new GongSolutions.Shell.ShellContextMenu(si);
                                var tsddi = o as ToolStripDropDownItem;
                                tsddi.Owner.Update();
                                scm.ShowContextMenu(tsddi.Owner, new System.Drawing.Point(0, 0));
                            };
                            tsdd.Items.Add(tsmiTest);

                            tsdd.Items.Add(new ToolStripSeparator());
                        }
                        else
                        {
                            //make a menuitem to show the last modified timestamp
                            var tsmiMissingFile = new ToolStripLabel {
                                Text = "-Missing-"
                            };
                            tsdd.Items.Add(tsmiMissingFile);
                            tsdd.Items.Add(new ToolStripSeparator());
                        }
                    }                     //crazystuff

                    //in any case, make a menuitem to let you remove the item
                    var tsmiRemovePath = new ToolStripMenuItem {
                        Text = "&Remove"
                    };
                    tsmiRemovePath.Click += (o, ev) => {
                        recent.Remove(path);
                    };
                    tsdd.Items.Add(tsmiRemovePath);

#if false //experiment of popping open a submenu. doesn't work well.
                    item.MouseDown += (o, mev) =>
                    {
                        if (mev.Button != MouseButtons.Right)
                        {
                            return;
                        }
                        //location of the menu containing this item that was just right-clicked
                        var pos = item.Owner.Bounds.Location;
                        //the offset within that menu of this item
                        pos.Offset(item.Bounds.Location);
                        //the offset of the click
                        pos.Offset(mev.Location);
//						tsdd.OwnerItem = item; //has interesting promise, but breaks things otherwise
                        tsdd.Show(pos);
                    };
#endif

                    //just add it to the submenu for now. seems to work well enough, even though its a bit odd
                    item.MouseDown += (o, mev) =>
                    {
                        if (mev.Button != MouseButtons.Right)
                        {
                            return;
                        }
                        if (item.DropDown != null)
                        {
                            item.DropDown = tsdd;
                        }
                        item.ShowDropDown();
                    };
                }
            }

            items.Add(new ToolStripSeparator());

            var clearItem = new ToolStripMenuItem {
                Text = "&Clear", Enabled = !recent.Frozen
            };
            clearItem.Click += (o, ev) => recent.Clear();
            items.Add(clearItem);

            var freezeItem = new ToolStripMenuItem
            {
                Text  = recent.Frozen ? "&Unfreeze" : "&Freeze",
                Image = recent.Frozen ? Properties.Resources.Unfreeze : Properties.Resources.Freeze
            };
            freezeItem.Click += (o, ev) => recent.Frozen ^= true;
            items.Add(freezeItem);

            if (!noAutoload)
            {
                var auto = new ToolStripMenuItem {
                    Text = $"&Autoload {entrySemantic}", Checked = recent.AutoLoad
                };
                auto.Click += (o, ev) => recent.ToggleAutoLoad();
                items.Add(auto);
            }

            var settingsItem = new ToolStripMenuItem {
                Text = "&Recent Settings..."
            };
            settingsItem.Click += (o, ev) =>
            {
                using var prompt = new InputPrompt
                      {
                          TextInputType = InputPrompt.InputType.Unsigned,
                          Message       = "Number of recent files to track",
                          InitialValue  = recent.MAX_RECENT_FILES.ToString()
                      };
                var result = mainForm.DoWithTempMute(() => prompt.ShowDialog());
                if (result == DialogResult.OK)
                {
                    int val = int.Parse(prompt.PromptText);
                    if (val > 0)
                    {
                        recent.MAX_RECENT_FILES = val;
                    }
                }
            };
            items.Add(settingsItem);

            return(items.ToArray());
        }
Example #5
0
        public static string[] Translate(string[] text, string sourceLanguageCode, string destLanguageCode, ToolStripProgressBar tspb, ToolStripLabel tsl)
        {
            string[]      rawXML = TranslateToXml(text, sourceLanguageCode, destLanguageCode, tspb, tsl);
            List <string> result = new List <string>();

            foreach (string xml in rawXML)
            {
                XElement parsedXML = XElement.Parse(xml);
                foreach (XElement txt in parsedXML.Descendants(ReturnArgs.TEXT))
                {
                    result.Add(txt.Value);
                }
            }
            return(result.ToArray());
        }
Example #6
0
        private void MouseLeave(object sender, EventArgs e)
        {
            ToolStripLabel tsl = (ToolStripLabel)sender;

            tsl.BackColor = System.Drawing.Color.LightSteelBlue;
        }
        static void Main()
        {
            SmartSocket = new QuantumSmartSocket("192.168.1.75");
            SmartSocket.SmartSocketStateChanged += SmartSocket_SmartSocketStateChanged;
            SmartSocket.SmartSocketConnected    += SmartSocket_SmartSocketConnected;
            SmartSocket.SmartSocketDisconnected += SmartSocket_SmartSocketDisconnected;

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            notifyIcon            = new NotifyIcon();
            contextMenu           = new ContextMenuStrip();
            menuItemExit          = new ToolStripMenuItem("Выход");
            menuItemHeader        = new ToolStripLabel("My Little Smart Socket by Quantum0");
            menuSeparator1        = new ToolStripSeparator();
            menuSeparator2        = new ToolStripSeparator();
            menuSeparator3        = new ToolStripSeparator();
            menuSeparator4        = new ToolStripSeparator();
            menuSeparator5        = new ToolStripSeparator();
            menuItemState         = new ToolStripLabel("Состояние: ВЫКЛ");
            menuItemTimer         = new ToolStripLabel("Таймер: ВЫКЛ");
            menuItemTurnOn        = new ToolStripMenuItem("Включить");
            menuItemTurnOn10      = new ToolStripMenuItem("На 10 минут");
            menuItemTurnOn30      = new ToolStripMenuItem("На 30 минут");
            menuItemTurnOnHour    = new ToolStripMenuItem("На час");
            menuItemTurnOn2Hours  = new ToolStripMenuItem("На 2 часа");
            menuItemTurnOn3Hours  = new ToolStripMenuItem("На 3 часа");
            menuItemTurnOnNoTimer = new ToolStripMenuItem("Без таймера");
            menuItemTurnOn1       = new ToolStripMenuItem("На 1 минуту");
            menuItemTurnOff       = new ToolStripMenuItem("Выключить");
            menuItemDefault       = new ToolStripMenuItem("Настройки");


            menuItemTurnOn.DropDownItems.AddRange(new ToolStripItem[] { menuItemTurnOn1, menuItemTurnOn10, menuItemTurnOn30, menuItemTurnOnHour, menuItemTurnOn2Hours, menuItemTurnOn3Hours, menuSeparator3, menuItemTurnOnNoTimer });
            contextMenu.Items.AddRange(new ToolStripItem[] { menuItemHeader, menuSeparator1, menuItemState, menuItemTimer, menuSeparator2, menuItemTurnOn, menuItemTurnOff, menuSeparator4, menuItemDefault, menuSeparator5, menuItemExit });

            menuItemExit.Click          += (s, e) => { cancelTokenSource.Cancel(); Application.Exit(); };
            menuItemTurnOff.Click       += (s, e) => SmartSocket.Off();
            menuItemTurnOn1.Click       += (s, e) => SmartSocket.On(1);
            menuItemTurnOn10.Click      += (s, e) => SmartSocket.On(10);
            menuItemTurnOn30.Click      += (s, e) => SmartSocket.On(30);
            menuItemTurnOnHour.Click    += (s, e) => SmartSocket.On(60);
            menuItemTurnOn2Hours.Click  += (s, e) => SmartSocket.On(120);
            menuItemTurnOn3Hours.Click  += (s, e) => SmartSocket.On(180);
            menuItemTurnOnNoTimer.Click += (s, e) => SmartSocket.On();

            menuItemState.Text      = "Состояние: НЕ НАЙДЕНА";
            menuItemTimer.Visible   = false;
            menuItemTurnOn.Visible  = false;
            menuItemTurnOff.Visible = false;

            MethodInfo methodShowContextMenu = typeof(NotifyIcon).GetMethod("ShowContextMenu", BindingFlags.Instance | BindingFlags.NonPublic);

            methodShowContextMenu.Invoke(notifyIcon, null);
            notifyIcon.Click           += (s, e) => methodShowContextMenu.Invoke(notifyIcon, null);
            notifyIcon.Icon             = new Icon("icon.ico");
            notifyIcon.Text             = "My Little Smart Socket by Quantum0";
            notifyIcon.ContextMenuStrip = contextMenu;
            notifyIcon.Visible          = true;
            Task.Run((Action)(() => SmartSocketLoop(cancelTokenSource.Token)), cancelTokenSource.Token);
            Application.Run();
            cancelTokenSource.Cancel();
            notifyIcon.Visible = false;
        }
Example #8
0
 private void UpdateLblInfo(ToolStripLabel label)
 {
     label.Text = (PicRowLocation * ColCount + PicColLocation + 1).ToString() + "/" + RowCount + "*" + ColCount;
 }
Example #9
0
 /// <summary>
 /// This method is required for Windows Forms designer support.
 /// Do not change the method contents inside the source code editor. The Forms designer might
 /// not be able to load this method if it was changed manually.
 /// </summary>
 private void InitializeComponent()
 {
     this.entriesView            = new System.Windows.Forms.ListView();
     this.entryType              = new System.Windows.Forms.ColumnHeader();
     this.entryLine              = new System.Windows.Forms.ColumnHeader();
     this.entryDesc              = new System.Windows.Forms.ColumnHeader();
     this.entryFile              = new System.Windows.Forms.ColumnHeader();
     this.entryPath              = new System.Windows.Forms.ColumnHeader();
     this.toolStripFilters       = new PluginCore.Controls.ToolStripEx();
     this.clearFilterButton      = new System.Windows.Forms.ToolStripButton();
     this.toolStripButtonError   = new System.Windows.Forms.ToolStripButton();
     this.toolStripButtonWarning = new System.Windows.Forms.ToolStripButton();
     this.toolStripButtonInfo    = new System.Windows.Forms.ToolStripButton();
     this.toolStripTextBoxFilter = new System.Windows.Forms.ToolStripSpringTextBox();
     this.toolStripLabelFilter   = new System.Windows.Forms.ToolStripLabel();
     this.toolStripFilters.SuspendLayout();
     this.SuspendLayout();
     //
     // clearFilterButton
     //
     this.clearFilterButton.Enabled               = false;
     this.clearFilterButton.DisplayStyle          = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.clearFilterButton.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.clearFilterButton.Margin    = new System.Windows.Forms.Padding(0, 1, 0, 1);
     this.clearFilterButton.Name      = "clearFilterButton";
     this.clearFilterButton.Size      = new System.Drawing.Size(23, 26);
     this.clearFilterButton.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
     this.clearFilterButton.Click    += new System.EventHandler(this.ClearFilterButtonClick);
     //
     // entriesView
     //
     this.entriesView.Dock        = DockStyle.Fill;
     this.entriesView.BorderStyle = System.Windows.Forms.BorderStyle.None;
     this.entriesView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { this.entryType, this.entryLine, this.entryDesc, this.entryFile, this.entryPath });
     this.entriesView.FullRowSelect    = true;
     this.entriesView.GridLines        = true;
     this.entriesView.Location         = new System.Drawing.Point(0, 28);
     this.entriesView.Name             = "entriesView";
     this.entriesView.ShowItemToolTips = true;
     this.entriesView.Size             = new System.Drawing.Size(710, 218);
     this.entriesView.TabIndex         = 1;
     this.entriesView.UseCompatibleStateImageBehavior = false;
     this.entriesView.View         = System.Windows.Forms.View.Details;
     this.entriesView.DoubleClick += new System.EventHandler(this.EntriesViewDoubleClick);
     this.entriesView.KeyDown     += new System.Windows.Forms.KeyEventHandler(this.EntriesViewKeyDown);
     //
     // entryType
     //
     this.entryType.Text  = "!";
     this.entryType.Width = 23;
     //
     // entryLine
     //
     this.entryLine.Text  = "Line";
     this.entryLine.Width = 55;
     //
     // entryDesc
     //
     this.entryDesc.Text  = "Description";
     this.entryDesc.Width = 350;
     //
     // entryFile
     //
     this.entryFile.Text  = "File";
     this.entryFile.Width = 150;
     //
     // entryPath
     //
     this.entryPath.Text  = "Path";
     this.entryPath.Width = 400;
     //
     // toolStripFilters
     //
     this.toolStripFilters.ImageScalingSize = ScaleHelper.Scale(new Size(16, 16));
     this.toolStripFilters.CanOverflow      = false;
     this.toolStripFilters.LayoutStyle      = System.Windows.Forms.ToolStripLayoutStyle.HorizontalStackWithOverflow;
     this.toolStripFilters.Padding          = new System.Windows.Forms.Padding(1, 1, 2, 2);
     this.toolStripFilters.GripStyle        = System.Windows.Forms.ToolStripGripStyle.Hidden;
     this.toolStripFilters.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
         this.toolStripButtonError,
         new ToolStripSeparator(),
         this.toolStripButtonWarning,
         new ToolStripSeparator(),
         this.toolStripButtonInfo,
         new ToolStripSeparator(),
         this.toolStripLabelFilter,
         this.toolStripTextBoxFilter,
         this.clearFilterButton
     });
     this.toolStripFilters.Name     = "toolStripFilters";
     this.toolStripFilters.Location = new System.Drawing.Point(1, 0);
     this.toolStripFilters.Size     = new System.Drawing.Size(710, 25);
     this.toolStripFilters.TabIndex = 0;
     this.toolStripFilters.Text     = "toolStripFilters";
     //
     // toolStripButtonError
     //
     this.toolStripButtonError.Checked               = true;
     this.toolStripButtonError.CheckOnClick          = true;
     this.toolStripButtonError.Margin                = new System.Windows.Forms.Padding(1, 1, 0, 1);
     this.toolStripButtonError.CheckState            = System.Windows.Forms.CheckState.Checked;
     this.toolStripButtonError.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.toolStripButtonError.Name            = "toolStripButtonError";
     this.toolStripButtonError.Size            = new System.Drawing.Size(36, 22);
     this.toolStripButtonError.Text            = "Error";
     this.toolStripButtonError.CheckedChanged += new System.EventHandler(this.ToolStripButtonErrorCheckedChanged);
     //
     // toolStripButtonWarning
     //
     this.toolStripButtonWarning.Checked               = true;
     this.toolStripButtonWarning.CheckOnClick          = true;
     this.toolStripButtonWarning.Margin                = new System.Windows.Forms.Padding(1, 1, 0, 1);
     this.toolStripButtonWarning.CheckState            = System.Windows.Forms.CheckState.Checked;
     this.toolStripButtonWarning.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.toolStripButtonWarning.Name            = "toolStripButtonWarning";
     this.toolStripButtonWarning.Size            = new System.Drawing.Size(56, 22);
     this.toolStripButtonWarning.Text            = "Warning";
     this.toolStripButtonWarning.CheckedChanged += new System.EventHandler(this.ToolStripButtonErrorCheckedChanged);
     //
     // toolStripButtonInfo
     //
     this.toolStripButtonInfo.Checked               = true;
     this.toolStripButtonInfo.CheckOnClick          = true;
     this.toolStripButtonInfo.Margin                = new System.Windows.Forms.Padding(1, 1, 0, 1);
     this.toolStripButtonInfo.CheckState            = System.Windows.Forms.CheckState.Checked;
     this.toolStripButtonInfo.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.toolStripButtonInfo.Name            = "toolStripButtonInfo";
     this.toolStripButtonInfo.Size            = new System.Drawing.Size(74, 22);
     this.toolStripButtonInfo.Text            = "Information";
     this.toolStripButtonInfo.CheckedChanged += new System.EventHandler(this.ToolStripButtonErrorCheckedChanged);
     //
     // toolStripTextBoxFilter
     //
     this.toolStripTextBoxFilter.Name         = "toolStripTextBoxFilter";
     this.toolStripTextBoxFilter.Size         = new System.Drawing.Size(100, 25);
     this.toolStripTextBoxFilter.Padding      = new System.Windows.Forms.Padding(0, 0, 1, 0);
     this.toolStripTextBoxFilter.TextChanged += new System.EventHandler(this.ToolStripButtonErrorCheckedChanged);
     //
     // toolStripLabelFilter
     //
     this.toolStripLabelFilter.Margin = new System.Windows.Forms.Padding(2, 1, 0, 1);
     this.toolStripLabelFilter.Name   = "toolStripLabelFilter";
     this.toolStripLabelFilter.Size   = new System.Drawing.Size(36, 22);
     this.toolStripLabelFilter.Text   = "Filter:";
     //
     // PluginUI
     //
     this.Name    = "PluginUI";
     this.Resize += this.PluginUIResize;
     this.Controls.Add(this.entriesView);
     this.Controls.Add(this.toolStripFilters);
     this.Size = new System.Drawing.Size(712, 246);
     this.toolStripFilters.ResumeLayout(false);
     this.toolStripFilters.PerformLayout();
     this.ResumeLayout(false);
     this.PerformLayout();
 }
Example #10
0
        private void UpdateToolbar(List <HotkeyType> actions)
        {
            tsMain.SuspendLayout();

            tsMain.Items.Clear();

            ToolStripLabel tslTitle = new ToolStripLabel()
            {
                Margin      = new Padding(4, 0, 3, 0),
                Text        = "ShareX",
                ToolTipText = Resources.ActionsToolbar_Tip
            };

            tslTitle.MouseDown  += tslTitle_MouseDown;
            tslTitle.MouseEnter += tslTitle_MouseEnter;
            tslTitle.MouseLeave += tslTitle_MouseLeave;
            tslTitle.MouseUp    += tslTitle_MouseUp;

            tsMain.Items.Add(tslTitle);

            foreach (HotkeyType action in actions)
            {
                if (action == HotkeyType.None)
                {
                    ToolStripSeparator tss = new ToolStripSeparator()
                    {
                        Margin = new Padding(0)
                    };

                    tsMain.Items.Add(tss);
                }
                else
                {
                    ToolStripButton tsb = new ToolStripButton()
                    {
                        Text         = action.GetLocalizedDescription(),
                        DisplayStyle = ToolStripItemDisplayStyle.Image,
                        Image        = TaskHelpers.FindMenuIcon(action)
                    };

                    tsb.Click += (sender, e) =>
                    {
                        if (Program.Settings.ActionsToolbarStayTopMost)
                        {
                            TopMost = false;
                        }

                        TaskHelpers.ExecuteJob(action);

                        if (Program.Settings.ActionsToolbarStayTopMost)
                        {
                            TopMost = true;
                        }
                    };

                    tsMain.Items.Add(tsb);
                }
            }

            foreach (ToolStripItem tsi in tsMain.Items)
            {
                tsi.MouseEnter += (sender, e) =>
                {
                    string text;

                    if (!string.IsNullOrEmpty(tsi.ToolTipText))
                    {
                        text = tsi.ToolTipText;
                    }
                    else
                    {
                        text = tsi.Text;
                    }

                    ttMain.SetToolTip(tsMain, text);
                };

                tsi.MouseLeave += tsMain_MouseLeave;
            }

            tsMain.ResumeLayout(false);
            tsMain.PerformLayout();
        }
        public WebBrowserTabPage(WebKitBrowser browserControl, bool goHome)
        {
            InitializeComponent();

            statusStrip            = new StatusStrip();
            statusStrip.Name       = "statusStrip";
            statusStrip.Visible    = true;
            statusStrip.SizingGrip = false;

            container         = new ToolStripContainer();
            container.Name    = "container";
            container.Visible = true;
            container.Dock    = DockStyle.Fill;

            statusLabel         = new ToolStripLabel();
            statusLabel.Name    = "statusLabel";
            statusLabel.Text    = "Done";
            statusLabel.Visible = true;

            iconLabel         = new ToolStripLabel();
            iconLabel.Name    = "iconLabel";
            iconLabel.Text    = "No Icon";
            iconLabel.Visible = true;

            progressBar         = new ToolStripProgressBar();
            progressBar.Name    = "progressBar";
            progressBar.Visible = true;

            statusStrip.Items.Add(statusLabel);
            statusStrip.Items.Add(iconLabel);
            statusStrip.Items.Add(progressBar);

            container.BottomToolStripPanel.Controls.Add(statusStrip);

            // create webbrowser control
            browser         = browserControl;
            browser.Visible = true;
            browser.Dock    = DockStyle.Fill;
            browser.Name    = "browser";
            //browser.IsWebBrowserContextMenuEnabled = false;
            //browser.IsScriptingEnabled = false;
            container.ContentPanel.Controls.Add(browser);

            browser.ObjectForScripting = new TestScriptObject();

            // context menu

            this.Controls.Add(container);
            this.Text = "<New Tab>";

            // events
            browser.DocumentTitleChanged += (s, e) => this.Text = browser.DocumentTitle;
            browser.Navigating           += (s, e) => statusLabel.Text = "Loading...";
            browser.Navigated            += (s, e) => { statusLabel.Text = "Downloading..."; };
            browser.DocumentCompleted    += (s, e) => { statusLabel.Text = "Done"; };
            browser.ProgressStarted      += (s, e) => { progressBar.Visible = true; };
            browser.ProgressChanged      += (s, e) => { progressBar.Value = e.ProgressPercentage; };
            browser.ProgressFinished     += (s, e) => { progressBar.Visible = false; };
            if (goHome)
            {
                browser.Navigate("http://www.google.com");
            }

            browser.ShowJavaScriptAlertPanel   += (s, e) => MessageBox.Show(e.Message, "[JavaScript Alert]");
            browser.ShowJavaScriptConfirmPanel += (s, e) =>
            {
                e.ReturnValue = MessageBox.Show(e.Message, "[JavaScript Confirm]", MessageBoxButtons.YesNo) == DialogResult.Yes;
            };
            browser.ShowJavaScriptPromptPanel += (s, e) =>
            {
                var frm = new JSPromptForm(e.Message, e.DefaultValue);
                if (frm.ShowDialog() == DialogResult.OK)
                {
                    e.ReturnValue = frm.Value;
                }
            };
        }
Example #12
0
 private void InitializeComponent()
 {
     this.toolStripLabel1 = new System.Windows.Forms.ToolStripLabel();
     this.searchTxt       = new System.Windows.Forms.ToolStripTextBox();
     this.toolStripLabel2 = new System.Windows.Forms.ToolStripLabel();
     this.searchInCmb     = new System.Windows.Forms.ToolStripComboBox();
     this.searchBtn       = new System.Windows.Forms.ToolStripButton();
     this.refreshBtn      = new System.Windows.Forms.ToolStripButton();
     this.SuspendLayout();
     //
     // toolStripLabel1
     //
     this.toolStripLabel1.AutoSize  = false;
     this.toolStripLabel1.ForeColor = System.Drawing.SystemColors.ButtonFace;
     this.toolStripLabel1.Name      = "toolStripLabel1";
     this.toolStripLabel1.Size      = new System.Drawing.Size(48, 29);
     this.toolStripLabel1.Text      = "Search :";
     //
     // searchTxt
     //
     this.searchTxt.Name = "searchTxt";
     this.searchTxt.Size = new System.Drawing.Size(100, 32);
     //
     // toolStripLabel2
     //
     this.toolStripLabel2.ForeColor = System.Drawing.SystemColors.ButtonFace;
     this.toolStripLabel2.Name      = "toolStripLabel2";
     this.toolStripLabel2.Size      = new System.Drawing.Size(58, 29);
     this.toolStripLabel2.Text      = "Search In:";
     //
     // searchInCmb
     //
     this.searchInCmb.Name      = "searchInCmb";
     this.searchInCmb.Size      = new System.Drawing.Size(100, 32);
     this.searchInCmb.GotFocus += new System.EventHandler(this.searchInToolStripCombobox_GotFocus);
     //
     // searchBtn
     //
     this.searchBtn.DisplayStyle          = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
     this.searchBtn.ForeColor             = System.Drawing.Color.White;
     this.searchBtn.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.searchBtn.Name   = "searchBtn";
     this.searchBtn.Size   = new System.Drawing.Size(52, 29);
     this.searchBtn.Text   = "Search !";
     this.searchBtn.Click += new System.EventHandler(this.searchBtnToolStripButton_Click);
     //
     // refreshBtn
     //
     this.refreshBtn.Alignment             = System.Windows.Forms.ToolStripItemAlignment.Right;
     this.refreshBtn.DisplayStyle          = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
     this.refreshBtn.ForeColor             = System.Drawing.Color.White;
     this.refreshBtn.ImageTransparentColor = System.Drawing.Color.Magenta;
     this.refreshBtn.Name   = "refreshBtn";
     this.refreshBtn.Size   = new System.Drawing.Size(50, 29);
     this.refreshBtn.Text   = "Refresh";
     this.refreshBtn.Click += new System.EventHandler(this.refreshBtn_Click);
     //
     // FindStrip
     //
     this.BackColor = System.Drawing.Color.Maroon;
     this.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
         this.toolStripLabel1,
         this.searchTxt,
         this.toolStripLabel2,
         this.searchInCmb,
         this.searchBtn,
         this.refreshBtn
     });
     this.Name     = "findStrip2";
     this.Size     = new System.Drawing.Size(772, 32);
     this.TabIndex = 2;
     this.Text     = "toolStrip1";
     this.ResumeLayout(false);
     this.PerformLayout();
 }
Example #13
0
	public MainForm ()
	{
		// 
		// _toolStrip
		// 
		_toolStrip = new ToolStrip ();
		_toolStrip.Dock = DockStyle.Top;
		_toolStrip.Height = 25;
		Controls.Add (_toolStrip);
		// 
		// _statusStrip;
		// 
		_statusStrip = new StatusStrip ();
		Controls.Add (_statusStrip);
		// 
		// _toolStripLabel1
		// 
		_toolStripLabel1 = new ToolStripLabel ();
		_toolStripLabel1.Text = "Mono";
		_statusStrip.Items.Add (_toolStripLabel1);
		// 
		// _toolStripLabel2
		// 
		_toolStripLabel2 = new ToolStripLabel ();
		_toolStripLabel2.Text = "Mono";
		_toolStrip.Items.Add (_toolStripLabel2);
		// 
		// _menuStrip
		// 
		_menuStrip = new MenuStrip ();
		_menuStrip.Dock = DockStyle.Left;
		_menuStrip.LayoutStyle = ToolStripLayoutStyle.Flow;
		_menuStrip.Location = new Point (0, 0);
		_menuStrip.Size = new Size (303, 23);
		Controls.Add (_menuStrip);
		// 
		// _fileToolStripMenuItem
		// 
		_fileToolStripMenuItem = new ToolStripMenuItem ();
		_fileToolStripMenuItem.Text = "&File";
		_menuStrip.Items.Add (_fileToolStripMenuItem);
		// 
		// _newToolStripMenuItem
		// 
		_newToolStripMenuItem = new ToolStripMenuItem ();
		_newToolStripMenuItem.Text = "&New";
		_fileToolStripMenuItem.DropDownItems.Add (_newToolStripMenuItem);
		// 
		// _openToolStripMenuItem
		// 
		_openToolStripMenuItem = new ToolStripMenuItem ();
		_openToolStripMenuItem.Text = "&Open";
		_fileToolStripMenuItem.DropDownItems.Add (_openToolStripMenuItem);
		// 
		// _editToolStripMenuItem
		// 
		_editToolStripMenuItem = new ToolStripMenuItem ();
		_editToolStripMenuItem.Text = "&Edit";
		_menuStrip.Items.Add (_editToolStripMenuItem);
		// 
		// _undoToolStripMenuItem
		// 
		_undoToolStripMenuItem = new ToolStripMenuItem ();
		_undoToolStripMenuItem.Text = "&Undo";
		_editToolStripMenuItem.DropDownItems.Add (_undoToolStripMenuItem);
		// 
		// MainForm
		// 
		ClientSize = new Size (300, 250);
		Location = new Point (250, 100);
		StartPosition = FormStartPosition.Manual;
		Text = "bug #82739";
		Load += new EventHandler (MainForm_Load);
	}
Example #14
0
        private void AddControls()
        {
            ToolStrip toolStrip = new ToolStrip();

            Controls.Add(toolStrip);

            ToolStripLabel folderLabel = new ToolStripLabel();

            folderLabel.Text = "Folder";
            toolStrip.Items.Add(folderLabel);

            folderComboBox          = new ToolStripComboBox();
            folderComboBox.AutoSize = false;
            SetComboBoxItems(folderComboBox, settings.folderPaths);
            folderComboBox.SelectedIndexChanged += FolderComboBox_SelectedIndexChanged;
            toolStrip.Items.Add(folderComboBox);

            ToolStripLabel songLabel = new ToolStripLabel();

            songLabel.Text = "Song";
            toolStrip.Items.Add(songLabel);

            songComboBox          = new ToolStripComboBox();
            songComboBox.AutoSize = false;
            songComboBox.Width    = 25;
            toolStrip.Items.Add(songComboBox);

            ToolStripButton showSongButton = new ToolStripButton();

            showSongButton.Text   = "Show song";
            showSongButton.Click += ShowSongButton_Click;
            toolStrip.Items.Add(showSongButton);

            toolStrip.Items.Add(new ToolStripSeparator());

            ToolStripLabel metronomeLabel = new ToolStripLabel();

            songLabel.Text = "Metronome";
            toolStrip.Items.Add(metronomeLabel);

            metronomeComboBox = new ToolStripComboBox();
            metronomeComboBox.Items.Add("30");
            metronomeComboBox.Items.Add("40");
            metronomeComboBox.Items.Add("50");
            metronomeComboBox.Items.Add("60");
            metronomeComboBox.Items.Add("70");
            metronomeComboBox.Items.Add("80");
            metronomeComboBox.Items.Add("90");
            metronomeComboBox.Items.Add("100");
            toolStrip.Items.Add(metronomeComboBox);

            metronomeButton        = new ToolStripButton();
            metronomeButton.Text   = "Start";
            metronomeButton.Click += MetronomeButton_Click;
            toolStrip.Items.Add(metronomeButton);

            toolStrip.Items.Add(new ToolStripSeparator());

            ToolStripButton launchPlayerButton = new ToolStripButton();

            launchPlayerButton.Text   = "Launch player";
            launchPlayerButton.Click += LaunchPlayerButton_Click;
            toolStrip.Items.Add(launchPlayerButton);

            ToolStripButton addFolderButton = new ToolStripButton();

            addFolderButton.Text   = "Add folder";
            addFolderButton.Click += AddFolderButton_Click;
            toolStrip.Items.Add(addFolderButton);

            ToolStripButton changePlayerButton = new ToolStripButton();

            changePlayerButton.Text   = "Change player";
            changePlayerButton.Click += ChangePlayerButton_Click;
            toolStrip.Items.Add(changePlayerButton);

            ToolStripButton changeInputButton = new ToolStripButton();

            changeInputButton.Text   = "Change input";
            changeInputButton.Click += ChangeInputButton_Click;
            toolStrip.Items.Add(changeInputButton);

            pictureBox           = new PictureBox();
            pictureBox.BackColor = Color.White;
            pictureBox.Size      = new Size(Size.Width, Size.Height - toolStrip.Height); //1920x1200 -> 1920x1145
            pictureBox.Location  = new Point(0, toolStrip.Height);
            Controls.Add(pictureBox);
            //MessageBox.Show(pictureBox.Width + " " + pictureBox.Height);

            folderSwitchingLabel           = new Label();
            folderSwitchingLabel.Text      = ("Press left or right to change a folder and select to confirm");
            folderSwitchingLabel.TextAlign = ContentAlignment.MiddleCenter;
            folderSwitchingLabel.Size      = Size;
            folderSwitchingLabel.Hide();
            Controls.Add(folderSwitchingLabel);

            exitPressedLabel           = new Label();
            exitPressedLabel.Text      = ("Press stop to exit or play to continue");
            exitPressedLabel.TextAlign = ContentAlignment.MiddleCenter;
            exitPressedLabel.Size      = Size;
            exitPressedLabel.Hide();
            Controls.Add(exitPressedLabel);

            if (settings.folderPaths.Count > 0)
            {
                SetFolderComboBoxItems(settings.folderPaths);
                UpdateSongComboBox();
            }

            LoadPages();
        }
Example #15
0
 /// <summary>
 /// Escribe el estado actual de la etiqueta del tiempo que tarda en imprimirse por completo la grafica
 /// en la barra de estado.
 /// </summary>
 /// <param name="toolstriplabel">Objeto a modificar.</param>
 /// <param name="chain">Cadena a imprimir</param>
 public void ToolStripStatusLabel_ChartPrintingTime_Write(ToolStripLabel toolstriplabel, string chain)
 {
     toolstriplabel.Text = "Tiempo de impresion: " + chain + "ms";
 }
Example #16
0
 /// <summary>
 /// Escribe el estado actual de la etiqueta de tiempo transcurrido en la barra de estado.
 /// </summary>
 /// <param name="toolstriplabel">Objeto a modificar.</param>
 /// <param name="chain">Cadena a imprimir</param>
 public void ToolStripStatusLabel_Time_Write(ToolStripLabel toolstriplabel, string chain)
 {
     toolstriplabel.Text = "Tiempo transcurrido: " + chain + "s";
 }
Example #17
0
 /// <summary>
 /// Escribe el estado actual de la etiqueta de estado en la barra de estado.
 /// </summary>
 /// <param name="toolstriplabel">Objeto a modificar.</param>
 /// <param name="chain">Cadena a imprimir</param>
 public void ToolStripStatusLabel_Status_Write(ToolStripLabel toolstriplabel, string chain)
 {
     toolstriplabel.Text = "Estado: " + chain;
 }
Example #18
0
 public void InitializeComponent()
 {
     this.ImageScalingSize  = ScaleHelper.Scale(new Size(16, 16));
     this.highlightTimer    = new Timer();
     this.wholeWordCheckBox = new CheckBox();
     this.matchCaseCheckBox = new CheckBox();
     this.highlightCheckBox = new CheckBox();
     this.nextButton        = new ToolStripButton();
     this.closeButton       = new ToolStripButton();
     this.moreButton        = new ToolStripButton();
     this.highlightHost     = new ToolStripControlHost(this.highlightCheckBox);
     this.matchCaseHost     = new ToolStripControlHost(this.matchCaseCheckBox);
     this.wholeWordHost     = new ToolStripControlHost(this.wholeWordCheckBox);
     this.previousButton    = new ToolStripButton();
     this.findTextBox       = new EscapeTextBox();
     this.findLabel         = new ToolStripLabel();
     this.infoLabel         = new ToolStripLabel();
     this.SuspendLayout();
     //
     // highlightTimer
     //
     this.highlightTimer          = new Timer();
     this.highlightTimer.Interval = 500;
     this.highlightTimer.Enabled  = false;
     this.highlightTimer.Tick    += delegate { this.HighlightTimerTick(); };
     //
     // findLabel
     //
     this.findLabel.BackColor = Color.Transparent;
     this.findLabel.Text      = TextHelper.GetString("Info.Find");
     this.findLabel.Margin    = new Padding(0, 0, 0, 3);
     //
     // infoLabel
     //
     this.infoLabel.BackColor = Color.Transparent;
     this.infoLabel.ForeColor = SystemColors.GrayText;
     this.infoLabel.Text      = TextHelper.GetString("Info.NoMatches");
     this.infoLabel.Margin    = new Padding(0, 0, 0, 1);
     //
     // highlightCheckBox
     //
     this.highlightHost.Margin        = new Padding(0, 2, 6, 1);
     this.highlightCheckBox.Text      = TextHelper.GetString("Label.HighlightAll");
     this.highlightCheckBox.BackColor = Color.Transparent;
     this.highlightCheckBox.Click    += new EventHandler(this.HighlightAllCheckBoxClick);
     //
     // matchCaseCheckBox
     //
     this.matchCaseHost.Margin              = new Padding(0, 2, 6, 1);
     this.matchCaseCheckBox.Text            = TextHelper.GetString("Label.MatchCase");
     this.matchCaseCheckBox.BackColor       = Color.Transparent;
     this.matchCaseCheckBox.CheckedChanged += new EventHandler(this.MatchCaseCheckBoxCheckedChanged);
     //
     // wholeWordCheckBox
     //
     this.wholeWordHost.Margin              = new Padding(0, 2, 6, 1);
     this.wholeWordCheckBox.Text            = TextHelper.GetString("Label.WholeWord");
     this.wholeWordCheckBox.BackColor       = Color.Transparent;
     this.wholeWordCheckBox.CheckedChanged += new EventHandler(this.WholeWordCheckBoxCheckedChanged);
     //
     // nextButton
     //
     this.nextButton.DisplayStyle = ToolStripItemDisplayStyle.ImageAndText;
     this.nextButton.Image        = Image.FromStream(ResourceHelper.GetStream("QuickFindNext.png"));
     this.nextButton.Click       += new EventHandler(this.FindNextButtonClick);
     this.nextButton.Text         = TextHelper.GetString("Label.Next");
     this.nextButton.Margin       = new Padding(0, 1, 2, 2);
     //
     // previousButton
     //
     this.previousButton.DisplayStyle = ToolStripItemDisplayStyle.ImageAndText;
     this.previousButton.Image        = Image.FromStream(ResourceHelper.GetStream("QuickFindPrev.png"));
     this.previousButton.Click       += new EventHandler(this.FindPrevButtonClick);
     this.previousButton.Text         = TextHelper.GetString("Label.Previous");
     this.previousButton.Margin       = new Padding(0, 1, 7, 2);
     //
     // closeButton
     //
     this.closeButton.DisplayStyle = ToolStripItemDisplayStyle.Image;
     this.closeButton.Image        = Image.FromStream(ResourceHelper.GetStream("QuickFindClose.png"));
     this.closeButton.Click       += new EventHandler(this.CloseButtonClick);
     this.closeButton.Margin       = new Padding(0, 1, 5, 2);
     //
     // findTextBox
     //
     this.findTextBox.Size         = new Size(150, 21);
     this.findTextBox.KeyPress    += new KeyPressEventHandler(this.FindTextBoxKeyPress);
     this.findTextBox.TextChanged += new EventHandler(this.FindTextBoxTextChanged);
     this.findTextBox.OnKeyEscape += new KeyEscapeEvent(this.FindTextBoxOnKeyEscape);
     this.findTextBox.Margin       = new Padding(0, 1, 7, 2);
     //
     // moreButton
     //
     this.moreButton.Click    += new EventHandler(this.MoreButtonClick);
     this.moreButton.Text      = TextHelper.GetString("Label.More");
     this.moreButton.Alignment = ToolStripItemAlignment.Right;
     this.moreButton.Margin    = new Padding(0, 1, 5, 2);
     //
     // QuickFind
     //
     this.Items.Add(this.closeButton);
     this.Items.Add(this.findLabel);
     this.Items.Add(this.findTextBox);
     this.Items.Add(this.nextButton);
     this.Items.Add(this.previousButton);
     this.Items.Add(this.matchCaseHost);
     this.Items.Add(this.wholeWordHost);
     this.Items.Add(this.highlightHost);
     this.Items.Add(this.infoLabel);
     this.Items.Add(this.moreButton);
     this.GripStyle   = ToolStripGripStyle.Hidden;
     this.Renderer    = new QuickFindRenderer();
     this.Padding     = new Padding(4, 4, 0, 3);
     this.Dock        = DockStyle.Bottom;
     this.CanOverflow = false;
     this.Visible     = false;
     this.ResumeLayout(false);
 }
Example #19
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FViewer));
     this.toolStripContainer1 = new System.Windows.Forms.ToolStripContainer();
     this.tiffViewer1         = new NAPS2.WinForms.TiffViewerCtl();
     this.toolStrip1          = new System.Windows.Forms.ToolStrip();
     this.tbPageCurrent       = new System.Windows.Forms.ToolStripTextBox();
     this.lblPageTotal        = new System.Windows.Forms.ToolStripLabel();
     this.tsPrev = new System.Windows.Forms.ToolStripButton();
     this.tsNext = new System.Windows.Forms.ToolStripButton();
     this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
     this.tsdRotate           = new System.Windows.Forms.ToolStripDropDownButton();
     this.tsRotateLeft        = new System.Windows.Forms.ToolStripMenuItem();
     this.tsRotateRight       = new System.Windows.Forms.ToolStripMenuItem();
     this.tsFlip              = new System.Windows.Forms.ToolStripMenuItem();
     this.tsDeskew            = new System.Windows.Forms.ToolStripMenuItem();
     this.tsCustomRotation    = new System.Windows.Forms.ToolStripMenuItem();
     this.tsCrop              = new System.Windows.Forms.ToolStripButton();
     this.tsBrightness        = new System.Windows.Forms.ToolStripButton();
     this.tsContrast          = new System.Windows.Forms.ToolStripButton();
     this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
     this.tsSavePDF           = new System.Windows.Forms.ToolStripButton();
     this.tsSaveImage         = new System.Windows.Forms.ToolStripButton();
     this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
     this.tsDelete            = new System.Windows.Forms.ToolStripButton();
     this.toolStripContainer1.ContentPanel.SuspendLayout();
     this.toolStripContainer1.TopToolStripPanel.SuspendLayout();
     this.toolStripContainer1.SuspendLayout();
     this.toolStrip1.SuspendLayout();
     this.SuspendLayout();
     //
     // toolStripContainer1
     //
     //
     // toolStripContainer1.ContentPanel
     //
     this.toolStripContainer1.ContentPanel.Controls.Add(this.tiffViewer1);
     resources.ApplyResources(this.toolStripContainer1.ContentPanel, "toolStripContainer1.ContentPanel");
     resources.ApplyResources(this.toolStripContainer1, "toolStripContainer1");
     this.toolStripContainer1.Name = "toolStripContainer1";
     //
     // toolStripContainer1.TopToolStripPanel
     //
     this.toolStripContainer1.TopToolStripPanel.Controls.Add(this.toolStrip1);
     //
     // tiffViewer1
     //
     resources.ApplyResources(this.tiffViewer1, "tiffViewer1");
     this.tiffViewer1.Image    = null;
     this.tiffViewer1.Name     = "tiffViewer1";
     this.tiffViewer1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.tiffViewer1_KeyDown);
     //
     // toolStrip1
     //
     resources.ApplyResources(this.toolStrip1, "toolStrip1");
     this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
         this.tbPageCurrent,
         this.lblPageTotal,
         this.tsPrev,
         this.tsNext,
         this.toolStripSeparator1,
         this.tsdRotate,
         this.tsCrop,
         this.tsBrightness,
         this.tsContrast,
         this.toolStripSeparator3,
         this.tsSavePDF,
         this.tsSaveImage,
         this.toolStripSeparator2,
         this.tsDelete
     });
     this.toolStrip1.Name = "toolStrip1";
     //
     // tbPageCurrent
     //
     this.tbPageCurrent.Name = "tbPageCurrent";
     resources.ApplyResources(this.tbPageCurrent, "tbPageCurrent");
     this.tbPageCurrent.KeyDown     += new System.Windows.Forms.KeyEventHandler(this.tbPageCurrent_KeyDown);
     this.tbPageCurrent.TextChanged += new System.EventHandler(this.tbPageCurrent_TextChanged);
     //
     // lblPageTotal
     //
     this.lblPageTotal.Name = "lblPageTotal";
     resources.ApplyResources(this.lblPageTotal, "lblPageTotal");
     //
     // tsPrev
     //
     this.tsPrev.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.tsPrev.Image        = global::NAPS2.Icons.arrow_left;
     resources.ApplyResources(this.tsPrev, "tsPrev");
     this.tsPrev.Name   = "tsPrev";
     this.tsPrev.Click += new System.EventHandler(this.tsPrev_Click);
     //
     // tsNext
     //
     this.tsNext.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.tsNext.Image        = global::NAPS2.Icons.arrow_right;
     resources.ApplyResources(this.tsNext, "tsNext");
     this.tsNext.Name   = "tsNext";
     this.tsNext.Click += new System.EventHandler(this.tsNext_Click);
     //
     // toolStripSeparator1
     //
     this.toolStripSeparator1.Name = "toolStripSeparator1";
     resources.ApplyResources(this.toolStripSeparator1, "toolStripSeparator1");
     //
     // tsdRotate
     //
     this.tsdRotate.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.tsdRotate.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
         this.tsRotateLeft,
         this.tsRotateRight,
         this.tsFlip,
         this.tsDeskew,
         this.tsCustomRotation
     });
     this.tsdRotate.Image = global::NAPS2.Icons.arrow_rotate_anticlockwise_small;
     resources.ApplyResources(this.tsdRotate, "tsdRotate");
     this.tsdRotate.Name = "tsdRotate";
     this.tsdRotate.ShowDropDownArrow = false;
     //
     // tsRotateLeft
     //
     this.tsRotateLeft.Image = global::NAPS2.Icons.arrow_rotate_anticlockwise_small;
     this.tsRotateLeft.Name  = "tsRotateLeft";
     resources.ApplyResources(this.tsRotateLeft, "tsRotateLeft");
     this.tsRotateLeft.Click += new System.EventHandler(this.tsRotateLeft_Click);
     //
     // tsRotateRight
     //
     this.tsRotateRight.Image = global::NAPS2.Icons.arrow_rotate_clockwise_small;
     this.tsRotateRight.Name  = "tsRotateRight";
     resources.ApplyResources(this.tsRotateRight, "tsRotateRight");
     this.tsRotateRight.Click += new System.EventHandler(this.tsRotateRight_Click);
     //
     // tsFlip
     //
     this.tsFlip.Image = global::NAPS2.Icons.arrow_switch_small;
     this.tsFlip.Name  = "tsFlip";
     resources.ApplyResources(this.tsFlip, "tsFlip");
     this.tsFlip.Click += new System.EventHandler(this.tsFlip_Click);
     //
     // tsDeskew
     //
     this.tsDeskew.Name = "tsDeskew";
     resources.ApplyResources(this.tsDeskew, "tsDeskew");
     this.tsDeskew.Click += new System.EventHandler(this.tsDeskew_Click);
     //
     // tsCustomRotation
     //
     this.tsCustomRotation.Name = "tsCustomRotation";
     resources.ApplyResources(this.tsCustomRotation, "tsCustomRotation");
     this.tsCustomRotation.Click += new System.EventHandler(this.tsCustomRotation_Click);
     //
     // tsCrop
     //
     this.tsCrop.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.tsCrop.Image        = global::NAPS2.Icons.transform_crop;
     resources.ApplyResources(this.tsCrop, "tsCrop");
     this.tsCrop.Name   = "tsCrop";
     this.tsCrop.Click += new System.EventHandler(this.tsCrop_Click);
     //
     // tsBrightness
     //
     this.tsBrightness.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.tsBrightness.Image        = global::NAPS2.Icons.weather_sun;
     resources.ApplyResources(this.tsBrightness, "tsBrightness");
     this.tsBrightness.Name   = "tsBrightness";
     this.tsBrightness.Click += new System.EventHandler(this.tsBrightness_Click);
     //
     // tsContrast
     //
     this.tsContrast.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.tsContrast.Image        = global::NAPS2.Icons.contrast;
     resources.ApplyResources(this.tsContrast, "tsContrast");
     this.tsContrast.Name   = "tsContrast";
     this.tsContrast.Click += new System.EventHandler(this.tsContrast_Click);
     //
     // toolStripSeparator3
     //
     this.toolStripSeparator3.Name = "toolStripSeparator3";
     resources.ApplyResources(this.toolStripSeparator3, "toolStripSeparator3");
     //
     // tsSavePDF
     //
     this.tsSavePDF.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.tsSavePDF.Image        = global::NAPS2.Icons.file_extension_pdf_small;
     resources.ApplyResources(this.tsSavePDF, "tsSavePDF");
     this.tsSavePDF.Name   = "tsSavePDF";
     this.tsSavePDF.Click += new System.EventHandler(this.tsSavePDF_Click);
     //
     // tsSaveImage
     //
     this.tsSaveImage.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.tsSaveImage.Image        = global::NAPS2.Icons.picture_small;
     resources.ApplyResources(this.tsSaveImage, "tsSaveImage");
     this.tsSaveImage.Name   = "tsSaveImage";
     this.tsSaveImage.Click += new System.EventHandler(this.tsSaveImage_Click);
     //
     // toolStripSeparator2
     //
     this.toolStripSeparator2.Name = "toolStripSeparator2";
     resources.ApplyResources(this.toolStripSeparator2, "toolStripSeparator2");
     //
     // tsDelete
     //
     this.tsDelete.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
     this.tsDelete.Image        = global::NAPS2.Icons.cross_small;
     resources.ApplyResources(this.tsDelete, "tsDelete");
     this.tsDelete.Name   = "tsDelete";
     this.tsDelete.Click += new System.EventHandler(this.tsDelete_Click);
     //
     // FViewer
     //
     resources.ApplyResources(this, "$this");
     this.Controls.Add(this.toolStripContainer1);
     this.Name          = "FViewer";
     this.ShowInTaskbar = false;
     this.toolStripContainer1.ContentPanel.ResumeLayout(false);
     this.toolStripContainer1.TopToolStripPanel.ResumeLayout(false);
     this.toolStripContainer1.TopToolStripPanel.PerformLayout();
     this.toolStripContainer1.ResumeLayout(false);
     this.toolStripContainer1.PerformLayout();
     this.toolStrip1.ResumeLayout(false);
     this.toolStrip1.PerformLayout();
     this.ResumeLayout(false);
 }
Example #20
0
 /// <summary>
 /// This method is required for Windows Forms designer support.
 /// Do not change the method contents inside the source code editor. The Forms designer might
 /// not be able to load this method if it was changed manually.
 /// </summary>
 private void InitializeComponent()
 {
     this.listView       = new System.Windows.Forms.ListViewEx();
     this.columnIcon     = new System.Windows.Forms.ColumnHeader();
     this.columnPos      = new System.Windows.Forms.ColumnHeader();
     this.columnType     = new System.Windows.Forms.ColumnHeader();
     this.columnText     = new System.Windows.Forms.ColumnHeader();
     this.columnName     = new System.Windows.Forms.ColumnHeader();
     this.columnPath     = new System.Windows.Forms.ColumnHeader();
     this.toolStripLabel = new System.Windows.Forms.ToolStripLabel();
     this.statusStrip    = new System.Windows.Forms.StatusStrip();
     this.statusStrip.SuspendLayout();
     this.SuspendLayout();
     //
     // listView
     //
     this.listView.BorderStyle = System.Windows.Forms.BorderStyle.None;
     this.listView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
         this.columnIcon,
         this.columnPos,
         this.columnType,
         this.columnText,
         this.columnName,
         this.columnPath
     });
     this.listView.Dock             = System.Windows.Forms.DockStyle.Fill;
     this.listView.FullRowSelect    = true;
     this.listView.GridLines        = true;
     this.listView.LabelWrap        = false;
     this.listView.MultiSelect      = false;
     this.listView.Name             = "listView";
     this.listView.ShowItemToolTips = true;
     this.listView.Size             = new System.Drawing.Size(278, 330);
     this.listView.TabIndex         = 0;
     this.listView.UseCompatibleStateImageBehavior = false;
     this.listView.View         = System.Windows.Forms.View.Details;
     this.listView.DoubleClick += new System.EventHandler(this.ListViewDoubleClick);
     this.listView.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.ListViewColumnClick);
     this.listView.KeyPress    += new KeyPressEventHandler(this.ListViewKeyPress);
     //
     // columnIcon
     //
     this.columnIcon.Text  = "!";
     this.columnIcon.Width = 23;
     //
     // columnPos
     //
     this.columnPos.Text  = "Position";
     this.columnPos.Width = 75;
     //
     // columnType
     //
     this.columnType.Text  = "Type";
     this.columnType.Width = 70;
     //
     // columnText
     //
     this.columnText.Text  = "Description";
     this.columnText.Width = 350;
     //
     // columnName
     //
     this.columnName.Text  = "File";
     this.columnName.Width = 150;
     //
     // columnPath
     //
     this.columnPath.Text  = "Path";
     this.columnPath.Width = 400;
     //
     // toolStripLabel
     //
     this.toolStripLabel.Name = "toolStripLabel";
     this.toolStripLabel.Size = new System.Drawing.Size(0, 20);
     //
     // statusStrip
     //
     this.statusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripLabel });
     this.statusStrip.Dock     = System.Windows.Forms.DockStyle.Bottom;
     this.statusStrip.Renderer = new DockPanelStripRenderer(false);
     this.statusStrip.Name     = "statusStrip";
     this.statusStrip.Size     = new System.Drawing.Size(278, 22);
     this.statusStrip.TabIndex = 0;
     //
     // PluginUI
     //
     this.Name = "PluginUI";
     this.Controls.Add(this.listView);
     this.Controls.Add(this.statusStrip);
     this.Size = new System.Drawing.Size(280, 352);
     this.statusStrip.ResumeLayout(false);
     this.statusStrip.PerformLayout();
     this.ResumeLayout(false);
     this.PerformLayout();
 }
Example #21
0
 public DownloadFileMicroCommand(string name, string downloadPath, string saveTo, ToolStripProgressBar progressBar, ToolStripLabel tsl1, ToolStripLabel tsl2)
     : base(name)
 {
     _downloadPath = downloadPath;
     _saveTo = saveTo;
     _progressBar = progressBar;
     _tsl1 = tsl1;
     _tsl2 = tsl2;
 }
Example #22
0
        ColorBook()
        {
            Size         = new Size(800, 600);
            BackColor    = Color.Lavender;
            Icon         = Resource.ColorBookIcon;
            Text         = "TS Xmas ColorBook ";
            FormClosing += ColorBook_FormClosing;

            currentPencilWidth = 8;
            currentZoom        = 1.0;

            aboutDialog                = new AboutDialog();
            aboutDialog.AppIcon        = Resource.ColorBookIcon;
            aboutDialog.AppName        = "TS Xmas ColorBook";
            aboutDialog.AppVersion     = "ver. 1.1";
            aboutDialog.AppCopyright   = "Copyright (c) 2017 by Tobiasz Stamborski";
            aboutDialog.AppDescription = "Free computer ColorBook in the christmas mood!";
            aboutDialog.Licence        = license;

            colorDialog = new ColorDialog();

            menuBar = new MenuStrip();

            colorBookMenu    = (ToolStripMenuItem)menuBar.Items.Add("&ColorBook");
            nextPageMenuItem = (ToolStripMenuItem)colorBookMenu.DropDownItems.Add("&Next page ",
                                                                                  Resource.NextIcon.ToBitmap(), new EventHandler(nextPageMenuItem_Click));
            nextPageMenuItem.ShortcutKeys = Keys.Control | Keys.Right;
            prevPageMenuItem = (ToolStripMenuItem)colorBookMenu.DropDownItems.Add("&Previous page ",
                                                                                  Resource.PreviousIcon.ToBitmap(), new EventHandler(prevPageMenuItem_Click));
            prevPageMenuItem.ShortcutKeys = Keys.Control | Keys.Left;
            prevPageMenuItem.Enabled      = false;
            colorBookMenu.DropDownItems.Add("-");
            saveAsMenuItem = (ToolStripMenuItem)colorBookMenu.DropDownItems.Add("&Save As... ",
                                                                                Resource.SaveIcon.ToBitmap(), new EventHandler(saveAsMenuItem_Click));
            saveAsMenuItem.ShortcutKeys = Keys.Control | Keys.S;
            colorBookMenu.DropDownItems.Add("-");
            exitMenuItem = (ToolStripMenuItem)colorBookMenu.DropDownItems.Add("&Exit ",
                                                                              Resource.ExitIcon.ToBitmap(), new EventHandler(exitMenuItem_Click));
            exitMenuItem.ShortcutKeys = Keys.Alt | Keys.F4;

            pencilMenu     = (ToolStripMenuItem)menuBar.Items.Add("&Pencil");
            pastelMenu     = (ToolStripMenuItem)pencilMenu.DropDownItems.Add("&Pastel ");
            yellowMenuItem = new ColorMenuItem("Yellow", new ColorIcon(Color.Yellow),
                                               new EventHandler(colorMenuItem_Click));
            orangeMenuItem = new ColorMenuItem("Orange", new ColorIcon(Color.Orange),
                                               new EventHandler(colorMenuItem_Click));
            lightPinkMenuItem = new ColorMenuItem("Light Pink", new ColorIcon(Color.LightPink),
                                                  new EventHandler(colorMenuItem_Click));
            pinkMenuItem = new ColorMenuItem("Pink", new ColorIcon(Color.Pink),
                                             new EventHandler(colorMenuItem_Click));
            redMenuItem = new ColorMenuItem("Red", new ColorIcon(Color.Red),
                                            new EventHandler(colorMenuItem_Click));
            purpleMenuItem = new ColorMenuItem("Purple", new ColorIcon(Color.Purple),
                                               new EventHandler(colorMenuItem_Click));
            violetMenuItem = new ColorMenuItem("Violet", new ColorIcon(Color.BlueViolet),
                                               new EventHandler(colorMenuItem_Click));
            pastelMenu.DropDownItems.Add((ToolStripItem)yellowMenuItem);
            pastelMenu.DropDownItems.Add((ToolStripItem)orangeMenuItem);
            pastelMenu.DropDownItems.Add((ToolStripItem)lightPinkMenuItem);
            pastelMenu.DropDownItems.Add((ToolStripItem)pinkMenuItem);
            pastelMenu.DropDownItems.Add((ToolStripItem)redMenuItem);
            pastelMenu.DropDownItems.Add((ToolStripItem)purpleMenuItem);
            pastelMenu.DropDownItems.Add((ToolStripItem)violetMenuItem);
            marineMenu      = (ToolStripMenuItem)pencilMenu.DropDownItems.Add("&Marine ");
            skyBlueMenuItem = new ColorMenuItem("Sky Blue", new ColorIcon(Color.SkyBlue),
                                                new EventHandler(colorMenuItem_Click));
            blueMenuItem = new ColorMenuItem("Blue", new ColorIcon(Color.Blue),
                                             new EventHandler(colorMenuItem_Click));
            darkBlueMenuItem = new ColorMenuItem("Dark Blue", new ColorIcon(Color.DarkBlue),
                                                 new EventHandler(colorMenuItem_Click));
            yellowGreenMenuItem = new ColorMenuItem("Yellow Green", new ColorIcon(Color.YellowGreen),
                                                    new EventHandler(colorMenuItem_Click));
            darkGreenMenuItem = new ColorMenuItem("Dark Green", new ColorIcon(Color.DarkGreen),
                                                  new EventHandler(colorMenuItem_Click));
            seledineMenuItem = new ColorMenuItem("Slate Blue", new ColorIcon(Color.SlateBlue),
                                                 new EventHandler(colorMenuItem_Click));
            marineMenu.DropDownItems.Add((ToolStripItem)skyBlueMenuItem);
            marineMenu.DropDownItems.Add((ToolStripItem)blueMenuItem);
            marineMenu.DropDownItems.Add((ToolStripItem)darkBlueMenuItem);
            marineMenu.DropDownItems.Add((ToolStripItem)yellowGreenMenuItem);
            marineMenu.DropDownItems.Add((ToolStripItem)darkGreenMenuItem);
            marineMenu.DropDownItems.Add((ToolStripItem)seledineMenuItem);
            groundMenu        = (ToolStripMenuItem)pencilMenu.DropDownItems.Add("&Ground ");
            lightGrayMenuItem = new ColorMenuItem("Light Gray", new ColorIcon(Color.LightGray),
                                                  new EventHandler(colorMenuItem_Click));
            slateGrayMenuItem = new ColorMenuItem("Slate Gray", new ColorIcon(Color.SlateGray),
                                                  new EventHandler(colorMenuItem_Click));
            blackMenuItem = new ColorMenuItem("Black", new ColorIcon(Color.Black),
                                              new EventHandler(colorMenuItem_Click));
            goldMenuItem = new ColorMenuItem("Gold", new ColorIcon(Color.Gold),
                                             new EventHandler(colorMenuItem_Click));
            brownMenuItem = new ColorMenuItem("Brown", new ColorIcon(Color.Brown),
                                              new EventHandler(colorMenuItem_Click));
            groundMenu.DropDownItems.Add((ToolStripItem)lightGrayMenuItem);
            groundMenu.DropDownItems.Add((ToolStripItem)slateGrayMenuItem);
            groundMenu.DropDownItems.Add((ToolStripItem)blackMenuItem);
            groundMenu.DropDownItems.Add((ToolStripItem)goldMenuItem);
            groundMenu.DropDownItems.Add((ToolStripItem)brownMenuItem);
            currentColorIcon    = redMenuItem.ColorIcon; //kolor na poczatek
            customColorMenuItem = (ToolStripMenuItem)pencilMenu.DropDownItems.Add("&Custom color... ",
                                                                                  Resource.CustomColorIcon.ToBitmap(), new EventHandler(customColorMenuItem_Click));
            customColorMenuItem.ShortcutKeys = Keys.Control | Keys.C;
            pencilMenu.DropDownItems.Add("-");
            rubberMenuItem = (ToolStripMenuItem)pencilMenu.DropDownItems.Add("&Rubber ",
                                                                             Resource.RubberIcon.ToBitmap(), new EventHandler(rubberMenuItem_Click));
            rubberMenuItem.ShortcutKeys = Keys.Control | Keys.R;

            optionsMenu         = (ToolStripMenuItem)menuBar.Items.Add("&Options");
            pencilSizeMenu      = (ToolStripMenuItem)optionsMenu.DropDownItems.Add("Pencil &size ");
            smallPencilMenuItem = (ToolStripMenuItem)pencilSizeMenu.DropDownItems.Add("&Small",
                                                                                      null, new EventHandler(pencilSizeMenu_Click));
            smallPencilMenuItem.ShortcutKeys = Keys.None | Keys.F5;
            mediumPencilMenuItem             = (ToolStripMenuItem)pencilSizeMenu.DropDownItems.Add("&Medium",
                                                                                                   null, new EventHandler(pencilSizeMenu_Click));
            mediumPencilMenuItem.ShortcutKeys = Keys.None | Keys.F6;
            mediumPencilMenuItem.Checked      = true;
            bigPencilMenuItem = (ToolStripMenuItem)pencilSizeMenu.DropDownItems.Add("&Big",
                                                                                    null, new EventHandler(pencilSizeMenu_Click));
            bigPencilMenuItem.ShortcutKeys = Keys.None | Keys.F7;
            largePencilMenuItem            = (ToolStripMenuItem)pencilSizeMenu.DropDownItems.Add("&Large",
                                                                                                 null, new EventHandler(pencilSizeMenu_Click));
            largePencilMenuItem.ShortcutKeys = Keys.None | Keys.F8;
            zoomMenu       = (ToolStripMenuItem)optionsMenu.DropDownItems.Add("&Zoom ");
            zoom50MenuItem = (ToolStripMenuItem)zoomMenu.DropDownItems.Add("&50%",
                                                                           null, new EventHandler(zoomMenu_Click));
            zoom100MenuItem = (ToolStripMenuItem)zoomMenu.DropDownItems.Add("&100%",
                                                                            null, new EventHandler(zoomMenu_Click));
            zoom100MenuItem.Checked = true;
            zoom200MenuItem         = (ToolStripMenuItem)zoomMenu.DropDownItems.Add("&200%",
                                                                                    null, new EventHandler(zoomMenu_Click));
            zoom400MenuItem = (ToolStripMenuItem)zoomMenu.DropDownItems.Add("&400%",
                                                                            null, new EventHandler(zoomMenu_Click));
            optionsMenu.DropDownItems.Add("-");
            resetMenuItem = (ToolStripMenuItem)optionsMenu.DropDownItems.Add("&Reset all pages ", Resource.ResetIcon.ToBitmap(),
                                                                             new EventHandler(resetMenuItem_Click));

            helpMenu      = (ToolStripMenuItem)menuBar.Items.Add("&Help");
            aboutMenuItem = (ToolStripMenuItem)helpMenu.DropDownItems.Add("&About... ", Resource.ColorBookIcon.ToBitmap(),
                                                                          new EventHandler(aboutMenuItem_Click));

            toolBar                         = new ToolStrip();
            yellowButton                    = new ColorBarButton(new ColorIcon(Color.Yellow), new EventHandler(colorBarButton_Click));
            orangeButton                    = new ColorBarButton(new ColorIcon(Color.Orange), new EventHandler(colorBarButton_Click));
            pinkButton                      = new ColorBarButton(new ColorIcon(Color.Pink), new EventHandler(colorBarButton_Click));
            redButton                       = new ColorBarButton(new ColorIcon(Color.Red), new EventHandler(colorBarButton_Click));
            skyBlueButton                   = new ColorBarButton(new ColorIcon(Color.SkyBlue), new EventHandler(colorBarButton_Click));
            blueButton                      = new ColorBarButton(new ColorIcon(Color.Blue), new EventHandler(colorBarButton_Click));
            yellowGreenButton               = new ColorBarButton(new ColorIcon(Color.YellowGreen), new EventHandler(colorBarButton_Click));
            darkGreenButton                 = new ColorBarButton(new ColorIcon(Color.DarkGreen), new EventHandler(colorBarButton_Click));
            lightGrayButton                 = new ColorBarButton(new ColorIcon(Color.LightGray), new EventHandler(colorBarButton_Click));
            slateGrayButton                 = new ColorBarButton(new ColorIcon(Color.SlateGray), new EventHandler(colorBarButton_Click));
            brownButton                     = new ColorBarButton(new ColorIcon(Color.Brown), new EventHandler(colorBarButton_Click));
            blackButton                     = new ColorBarButton(new ColorIcon(Color.Black), new EventHandler(colorBarButton_Click));
            customColorButton               = new ToolStripButton(Resource.CustomColorIcon.ToBitmap());
            customColorButton.ToolTipText   = "Pallette";
            customColorButton.Click        += customColorMenuItem_Click;
            rubberButton                    = new ToolStripButton(Resource.RubberIcon.ToBitmap());
            rubberButton.ToolTipText        = "Rubber";
            rubberButton.Click             += RubberButton_Click;
            pencilSizeLabel                 = new ToolStripLabel("pencil size:");
            pencilSmallButton               = new ToolStripButton("Small");
            pencilSmallButton.CheckOnClick  = true;
            pencilSmallButton.Click        += new EventHandler(pencilSizeButton_Clicked);
            pencilSmallButton.Font          = new Font(pencilSmallButton.Font, FontStyle.Bold);
            pencilMediumButton              = new ToolStripButton("Medium");
            pencilMediumButton.CheckOnClick = true;
            pencilMediumButton.Checked      = true;
            pencilMediumButton.Click       += new EventHandler(pencilSizeButton_Clicked);
            pencilMediumButton.Font         = new Font(pencilSmallButton.Font, FontStyle.Bold);
            pencilBigButton                 = new ToolStripButton("Big");
            pencilBigButton.CheckOnClick    = true;
            pencilBigButton.Click          += new EventHandler(pencilSizeButton_Clicked);
            pencilBigButton.Font            = new Font(pencilSmallButton.Font, FontStyle.Bold);
            pencilLargeButton               = new ToolStripButton("Large");
            pencilLargeButton.CheckOnClick  = true;
            pencilLargeButton.Click        += new EventHandler(pencilSizeButton_Clicked);
            pencilLargeButton.Font          = new Font(pencilSmallButton.Font, FontStyle.Bold);
            toolBar.Items.Add(yellowButton);
            toolBar.Items.Add(orangeButton);
            toolBar.Items.Add(pinkButton);
            toolBar.Items.Add(redButton);
            toolBar.Items.Add(skyBlueButton);
            toolBar.Items.Add(blueButton);
            toolBar.Items.Add(yellowGreenButton);
            toolBar.Items.Add(darkGreenButton);
            toolBar.Items.Add(slateGrayButton);
            toolBar.Items.Add(lightGrayButton);
            toolBar.Items.Add(brownButton);
            toolBar.Items.Add(blackButton);
            toolBar.Items.Add("-");
            toolBar.Items.Add(customColorButton);
            toolBar.Items.Add("-");
            toolBar.Items.Add(rubberButton);
            toolBar.Items.Add("-");
            toolBar.Items.Add(pencilSizeLabel);
            toolBar.Items.Add(pencilSmallButton);
            toolBar.Items.Add(pencilMediumButton);
            toolBar.Items.Add(pencilBigButton);
            toolBar.Items.Add(pencilLargeButton);

            area    = new PagesArea();
            page    = new Page[8];
            page[0] = new Page(Resource.Page1, "Santa with bag");
            page[1] = new Page(Resource.Page2, "Santa smiling");
            page[2] = new Page(Resource.Page3, "Birth of Christ");
            page[3] = new Page(Resource.Page4, "Gifts");
            page[4] = new Page(Resource.Page5, "Rudolph reindeer");
            page[5] = new Page(Resource.Page6, "Christmas tree");
            page[6] = new Page(Resource.Page7, "Snowman");
            page[7] = new Page(Resource.Page8, "Guru meditation");
            for (int i = 0; i < 8; i++)
            {
                page[i].MouseMove    += ColorBook_MouseMove;
                page[i].ColorChanged += ColorBook_ColorChanged;
                area.AddPage(page[i]);
            }
            area.ActualPage.PencilWidth = currentPencilWidth;
            area.ActualPage.Zoom        = currentZoom;
            area.ActualPage.PencilColor = currentColorIcon.Color;

            statusBar           = new StatusBar();
            colorPanel          = new StatusBarPanel();
            colorPanel.MinWidth = 20;
            colorPanel.Width    = 20;
            colorPanel.Icon     = redMenuItem.ColorIcon.Icon;
            pagePanel           = new StatusBarPanel();
            pagePanel.AutoSize  = StatusBarPanelAutoSize.Spring;
            pagePanel.Text      = String.Format("Page {0} of {1}: {2}",
                                                area.Index + 1, area.PageCount, area.ActualPage.Name);
            coordPanel          = new StatusBarPanel();
            coordPanel.Text     = "x:    0, y:    0";
            coordPanel.MinWidth = 100;
            coordPanel.Width    = 100;
            statusBar.Panels.Add(colorPanel);
            statusBar.Panels.Add(pagePanel);
            statusBar.Panels.Add(coordPanel);
            statusBar.ShowPanels = true;

            MainMenuStrip = menuBar;
            Controls.Add(area);
            Controls.Add(toolBar);
            Controls.Add(menuBar);
            Controls.Add(statusBar);

            LoadAppData();
        }
Example #23
0
        //添加租赁结算
        public static void AddNewLeaseJS(int i_ProjectID, int i_CompanyID, string s_BillCycle, DateTime d_SDate, DateTime d_EDate, ToolStripLabel labelStatus)
        {
            labelStatus.Text = "现在开始把数据添加到数据库中...";
            Application.DoEvents();
            string[,] ALeaseAccountLeft = new string[50, 2];                    //用于保存当前剩余租赁材料

            ISession     session = NHibernateHelper.sessionFactory.OpenSession();
            ITransaction tx      = session.BeginTransaction();

            try {
                int i_SNumber = 1;                              //租赁结算顺序号

                //1.先添加租赁结算单,以得到BillID
                labelStatus.Text = "现在开始添加租赁结算单...";
                Application.DoEvents();

                Projects  tProject       = BLL.ProjectsBLL.GetProject(i_ProjectID);
                Companies tCompany       = BLL.CompanyBLL.GetCompany(i_CompanyID);
                LeaseHT   tLeaseHT       = BLL.LeaseBLL.GetLeaseHT(i_ProjectID, i_CompanyID);
                int       i_IncludeSDate = tLeaseHT.IncludeSDate;       //租金包含开始日
                int       i_IncludeEDate = tLeaseHT.IncludeEDate;       //租金包含结束日
                string    s_CalMethod    = "";                          //计算方式
                if (i_IncludeSDate == 0 && i_IncludeEDate == 0)
                {
                    s_CalMethod = "倒扣计算法,头尾都不算";
                }
                if (i_IncludeSDate == 1 && i_IncludeEDate == 0)
                {
                    s_CalMethod = "倒扣计算法,算头不算尾";
                }
                if (i_IncludeSDate == 1 && i_IncludeEDate == 1)
                {
                    s_CalMethod = "倒扣计算法,既算头又算尾";
                }
                if (i_IncludeSDate == 0 && i_IncludeEDate == 1)
                {
                    s_CalMethod = "倒扣计算法,算尾不算头";
                }
                TimeSpan tTS    = d_EDate.Subtract(d_SDate);
                int      i_Days = tTS.Days + 1;                         //结余时租赁天数

                LeaseAccount newLeaseAccount = new LeaseAccount();
                newLeaseAccount.ProjectID    = i_ProjectID;
                newLeaseAccount.CompanyID    = i_CompanyID;
                newLeaseAccount.BillCycle    = s_BillCycle;
                newLeaseAccount.SDate        = d_SDate;
                newLeaseAccount.EDate        = d_EDate;
                newLeaseAccount.CalMethod    = s_CalMethod;
                newLeaseAccount.ProjectName  = tProject.ProjectName;
                newLeaseAccount.CompanyName  = tCompany.CompanyName;
                newLeaseAccount.IncludeSDate = i_IncludeSDate;
                newLeaseAccount.IncludeEDate = i_IncludeEDate;
                session.Save(newLeaseAccount);

                StatementList newStatementList = new StatementList();
                newStatementList.ProjectID      = i_ProjectID;
                newStatementList.ProjectName    = tProject.ProjectName;
                newStatementList.CompanyID      = i_CompanyID;
                newStatementList.CompanyName    = tCompany.CompanyName;
                newStatementList.MoneyTypeID    = 10000;
                newStatementList.MoneyTypeName  = "租赁结算自动生成";
                newStatementList.StatementType  = "租赁结算";
                newStatementList.StatementMemo  = "应付租金";
                newStatementList.StatementCycle = s_BillCycle;
                newStatementList.StatementDate  = DateTime.Now.Date;
                session.Save(newStatementList);

                decimal d_BillAmt = 0.0m;
                //2.添加租赁明细单,并计算金额合计,以便完成后填写到LeaseAccount表记录中
                //把保存剩余租赁量的数组数据填好,全部是字符串
                DataSet dsTmp = BLL.LeaseBLL.GetLeaseAccountLeft(tLeaseHT.HTID);
                foreach (DataRow dr in dsTmp.Tables[0].Rows)
                {
                    string s_0 = dr["ItemsID"].ToString();
                    string s_1 = dr["QualityLeft"].ToString();

                    for (int j = 0; j < ALeaseAccountLeft.GetLength(0); j++)
                    {
                        string s0 = ALeaseAccountLeft[j, 0];
                        string s1 = ALeaseAccountLeft[j, 1];
                        if (ALeaseAccountLeft[j, 0] == null)
                        {
                            ALeaseAccountLeft[j, 0] = s_0;
                            ALeaseAccountLeft[j, 1] = s_1;
                            break;
                        }
                    }
                }
                //2.1添加结余租赁明细项目
                dsTmp = BLL.LeaseBLL.GetLeaseItemsByHTID(tLeaseHT.HTID);
                foreach (DataRow dr in dsTmp.Tables[0].Rows)
                {
                    LeaseAccountList newLeaseAccountList = new LeaseAccountList();
                    int              i_ItemsID           = Convert.ToInt32(dr["ItemsID"]);
                    LeaseItems       tLeaseItem          = BLL.LeaseBLL.GetLeaseItem(i_ItemsID);
                    LeaseAccountLeft tLeaseAccountLeft   = BLL.LeaseBLL.GetLeaseAccountLeft(tLeaseHT.HTID, i_ItemsID);
                    if (tLeaseAccountLeft == null)
                    {
                        continue;
                    }
                    newLeaseAccountList.SNumber      = i_SNumber;
                    newLeaseAccountList.BillID       = newLeaseAccount.BillID;
                    newLeaseAccountList.ItemsID      = tLeaseItem.ItemsID;
                    newLeaseAccountList.ItemsName    = tLeaseItem.MName;
                    newLeaseAccountList.LeaseClass   = 3;                   //将结余类重设
                    newLeaseAccountList.Abstract     = tLeaseItem.MName + " 上期结余";
                    newLeaseAccountList.SDate        = d_SDate;
                    newLeaseAccountList.EDate        = d_EDate;
                    newLeaseAccountList.LeaseUnit    = tLeaseItem.LeaseUnit;
                    newLeaseAccountList.LeaseQuality = tLeaseAccountLeft.QualityLeft;
                    newLeaseAccountList.LeasePrice   = tLeaseItem.LeasePrice;
                    newLeaseAccountList.LeaseDays    = i_Days;
                    newLeaseAccountList.LeaseAmt     = newLeaseAccountList.LeaseQuality * newLeaseAccountList.LeasePrice * i_Days;

                    d_BillAmt += newLeaseAccountList.LeaseAmt;

                    session.Save(newLeaseAccountList);

                    i_SNumber++;
                }
                //2.2按照未结算租赁记录添加租赁结算明细项
                dsTmp = BLL.LeaseBLL.GetLeaseRecord2(i_ProjectID, i_CompanyID);                 //未结算的记录
                foreach (DataRow dr in dsTmp.Tables[0].Rows)
                {
                    //检查租赁日期是否在结算日期范围
                    int         i_RID        = Convert.ToInt32(dr["RID"]);
                    LeaseRecord tLeaseRecord = session.Get <LeaseRecord>(i_RID);

                    if (tLeaseRecord.LeaseDate >= d_SDate && tLeaseRecord.LeaseDate <= d_EDate)
                    {
                        LeaseAccountList newLeaseAccountList = new LeaseAccountList();
                        int        i_ItemsID  = tLeaseRecord.ItemsID;
                        LeaseItems tLeaseItem = session.Get <LeaseItems>(i_ItemsID);


                        newLeaseAccountList.SNumber    = i_SNumber;
                        newLeaseAccountList.BillID     = newLeaseAccount.BillID;
                        newLeaseAccountList.ItemsID    = tLeaseItem.ItemsID;
                        newLeaseAccountList.ItemsName  = tLeaseItem.MName;
                        newLeaseAccountList.LeaseClass = tLeaseItem.LeaseClass;
                        if (tLeaseRecord.Abstract.ToString().Length != 0)
                        {
                            newLeaseAccountList.Abstract = tLeaseItem.MName + "(" + tLeaseRecord.Abstract + ")";
                        }
                        else
                        {
                            newLeaseAccountList.Abstract = tLeaseItem.MName;
                        }
                        DateTime dt1 = tLeaseRecord.LeaseDate;
                        newLeaseAccountList.SDate = dt1;
                        newLeaseAccountList.EDate = d_EDate;
                        TimeSpan tTS1  = d_EDate.Subtract(dt1);
                        int      tDays = tTS1.Days;
                        if (tLeaseRecord.Quality > 0)
                        {
                            if (i_IncludeSDate == 1)
                            {
                                tDays++;
                            }
                        }
                        else
                        {
                            if (i_IncludeEDate != 1)
                            {
                                tDays++;
                            }
                        }
                        if (tLeaseItem.LeaseClass == 0)
                        {
                            //租赁项
                            newLeaseAccountList.LeaseUnit    = tLeaseItem.LeaseUnit;
                            newLeaseAccountList.LeaseQuality = tLeaseRecord.Quality;
                            newLeaseAccountList.LeasePrice   = tLeaseItem.LeasePrice;
                            newLeaseAccountList.LeaseDays    = tDays;
                            newLeaseAccountList.LeaseAmt     = newLeaseAccountList.LeaseQuality * newLeaseAccountList.LeasePrice * tDays;

                            d_BillAmt += newLeaseAccountList.LeaseAmt;

                            newLeaseAccountList.LoadingUnit    = tLeaseItem.LoadingUnit;
                            newLeaseAccountList.LoadingFactor  = Convert.ToDecimal(tLeaseItem.LoadingFactor);
                            newLeaseAccountList.LoadingQuality = Math.Abs(newLeaseAccountList.LeaseQuality / newLeaseAccountList.LoadingFactor);
                            newLeaseAccountList.LoadingPrice   = Convert.ToDecimal(tLeaseItem.LoadingPrice);
                            newLeaseAccountList.LoadingAmt     = Math.Abs(newLeaseAccountList.LoadingPrice * newLeaseAccountList.LoadingQuality);

                            d_BillAmt += newLeaseAccountList.LoadingAmt;

                            if (tLeaseRecord.Quality < 0)
                            {
                                newLeaseAccountList.RepairUnit    = tLeaseItem.RepairUnit;
                                newLeaseAccountList.RepairFactor  = Convert.ToDecimal(tLeaseItem.RepairFactor);
                                newLeaseAccountList.RepairQuality = Math.Abs(newLeaseAccountList.LeaseQuality / newLeaseAccountList.RepairFactor);
                                newLeaseAccountList.RepairPrice   = Convert.ToDecimal(tLeaseItem.RepairPrice);
                                newLeaseAccountList.RepairAmt     = Math.Abs(newLeaseAccountList.RepairPrice * newLeaseAccountList.RepairQuality);
                                d_BillAmt += newLeaseAccountList.RepairAmt;
                            }

                            //检查此租赁项是否存在,存在则更新LeaseAccountLeft,否则添加
                            string s_0 = tLeaseItem.ItemsID.ToString();
                            string s_1 = newLeaseAccountList.LeaseQuality.ToString();
                            for (int j = 0; j < ALeaseAccountLeft.GetLength(0); j++)
                            {
                                if (ALeaseAccountLeft[j, 0] == null)
                                {
                                    ALeaseAccountLeft[j, 0] = s_0;
                                    ALeaseAccountLeft[j, 1] = s_1;
                                    break;
                                }
                                else
                                {
                                    if (ALeaseAccountLeft[j, 0] == s_0)
                                    {
                                        //找到了
                                        decimal d1 = Convert.ToDecimal(s_1) + Convert.ToDecimal(ALeaseAccountLeft[j, 1]);
                                        ALeaseAccountLeft[j, 1] = d1.ToString();
                                        break;
                                    }
                                    //继续找
                                }
                            }
                        }
                        else
                        {
                            //单独结算项
                            newLeaseAccountList.LeaseUnit    = tLeaseItem.LeaseUnit;
                            newLeaseAccountList.OtherUnit    = tLeaseItem.LeaseUnit;
                            newLeaseAccountList.OtherQuality = tLeaseRecord.Quality;
                            newLeaseAccountList.OtherPrice   = tLeaseItem.LeasePrice;
                            newLeaseAccountList.OtherAmt     = newLeaseAccountList.OtherPrice * newLeaseAccountList.OtherQuality;
                            d_BillAmt += newLeaseAccountList.OtherAmt;
                        }

                        tLeaseRecord.LeaseStatus = "已结算";
                        tLeaseRecord.BalanceDate = DateTime.Now.Date;
                        session.Update(tLeaseRecord);
                        session.Save(newLeaseAccountList);


                        i_SNumber++;
                    }
                }

                newLeaseAccount.BillAmt = Convert.ToDecimal(d_BillAmt);
                newStatementList.BillYF = Convert.ToDecimal(d_BillAmt);
                //把LeaseAccountLeft更新
                for (int j = 0; j < ALeaseAccountLeft.GetLength(0); j++)
                {
                    if (ALeaseAccountLeft[j, 0] != null)
                    {
                        int iItem = Convert.ToInt32(ALeaseAccountLeft[j, 0]);
                        LeaseAccountLeft tLeaseAccountLeft = BLL.LeaseBLL.GetLeaseAccountLeft(tLeaseHT.HTID, iItem);
                        if (tLeaseAccountLeft == null)
                        {
                            tLeaseAccountLeft               = new LeaseAccountLeft();
                            tLeaseAccountLeft.HTID          = tLeaseHT.HTID;
                            tLeaseAccountLeft.ItemsID       = iItem;
                            tLeaseAccountLeft.QualityLeft   = Convert.ToDecimal(ALeaseAccountLeft[j, 1]);
                            tLeaseAccountLeft.LastBillCycle = newLeaseAccount.BillCycle;
                            tLeaseAccountLeft.LastEDate     = DateTime.Now.Date;
                            session.Save(tLeaseAccountLeft);
                        }
                        else
                        {
                            tLeaseAccountLeft.QualityLeft   = Convert.ToDecimal(ALeaseAccountLeft[j, 1]);
                            tLeaseAccountLeft.LastBillCycle = newLeaseAccount.BillCycle;
                            tLeaseAccountLeft.LastEDate     = DateTime.Now.Date;
                            session.Update(tLeaseAccountLeft);
                        }
                    }
                    else
                    {
                        break;
                    }
                }
                tx.Commit();
                session.Close();
            } catch (Exception e) {
                Debug.Assert(false, e.Message);
                tx.Rollback();
                session.Close();
            }
            labelStatus.Text = "就绪";
        }
Example #24
0
        public Main()
        {
            InitializeComponent();

            tm_conn_check = new System.Threading.Timer(StartCheck, null, 0, 30000);

            ToolStripItem ic_menu_close = new ToolStripLabel("Cerrar");

            ic_menu = new ContextMenuStrip();
            ic_menu.Items.Add(ic_menu_close);

            icon                  = new NotifyIcon();
            icon.Icon             = Icon;
            icon.Text             = this.Text;
            icon.ContextMenuStrip = ic_menu;
            icon.Visible          = true;

            inet_connections = new List <INetConnection>();

            wlan     = new WlanClient();
            adapters = wlan.Interfaces;

            wlan.HostedNetworkNotification += HostedNetworkNotification;

            //WIFI
            UpdateAdapters();
            if (adapters.Length > 0)
            {
                //TODO Seleccionar el ultimo configurado por GUID
                adapter = adapters[0];
                adapter.WlanNotification += WlanEvent;

                if (adapter.Autoconf)
                {
                    UpdateAPs();
                }
            }
            else
            {
                SetEnabled(false);
            }

            profile_manager = new ProfileManager(adapter);

            //UI
            CheckProfiles();
            LoadApValues();

            UpdateICS();

            //Listeners
            FormClosing         += Closing;
            icon.MouseClick     += NotifyClick;
            ic_menu_close.Click += RealClose;

            cb_adapter.SelectedIndexChanged += AdapterSelected;
            btn_scan.Click         += Scan;
            btn_connect.Click      += Connect;
            btn_disconnect.Click   += Disconnect;
            btn_edit_profile.Click += EditProfile;

            mi_admin_profiles.Click      += OpenEditProfile;
            profile_manager.FormClosed   += EPClosed;
            dg_wifi.CellMouseDoubleClick += EditProfile;

            cb_active_ap.Click    += ActiveAp;
            tb_ap_key.TextChanged += ApKeyCahnged;

            btn_add_privcon.Click += AddPrivConn;

            wlan_event_cb = new WlanEventCallback(WlanEventSecure);
            hn_event_cb   = new HNEventCallback(HNEventSecure);
        }    //Main
Example #25
0
        private void CreateToolbar()
        {
            menuForm = new Form()
            {
                AutoScaleDimensions = new SizeF(6F, 13F),
                AutoScaleMode       = AutoScaleMode.Font,
                AutoSize            = true,
                AutoSizeMode        = AutoSizeMode.GrowAndShrink,
                ClientSize          = new Size(759, 509),
                FormBorderStyle     = FormBorderStyle.None,
                Location            = new Point(200, 200),
                ShowInTaskbar       = false,
                StartPosition       = FormStartPosition.Manual,
                Text    = "ShareX - Region capture menu",
                TopMost = true
            };

            menuForm.Shown           += MenuForm_Shown;
            menuForm.KeyDown         += MenuForm_KeyDown;
            menuForm.KeyUp           += MenuForm_KeyUp;
            menuForm.LocationChanged += MenuForm_LocationChanged;

            menuForm.SuspendLayout();

            tsMain = new ToolStripEx()
            {
                AutoSize         = true,
                CanOverflow      = false,
                ClickThrough     = true,
                Dock             = DockStyle.None,
                GripStyle        = ToolStripGripStyle.Hidden,
                Location         = new Point(0, 0),
                MinimumSize      = new Size(10, 30),
                Padding          = new Padding(0, 1, 0, 0),
                Renderer         = new CustomToolStripProfessionalRenderer(),
                TabIndex         = 0,
                ShowItemToolTips = false
            };

            tsMain.MouseLeave += TsMain_MouseLeave;

            tsMain.SuspendLayout();

            // https://www.medo64.com/2014/01/scaling-toolstrip-with-dpi/
            using (Graphics g = menuForm.CreateGraphics())
            {
                double scale    = Math.Max(g.DpiX, g.DpiY) / 96.0;
                double newScale = ((int)Math.Floor(scale * 100) / 25 * 25) / 100.0;
                if (newScale > 1)
                {
                    int newWidth  = (int)(tsMain.ImageScalingSize.Width * newScale);
                    int newHeight = (int)(tsMain.ImageScalingSize.Height * newScale);
                    tsMain.ImageScalingSize = new Size(newWidth, newHeight);
                }
            }

            menuForm.Controls.Add(tsMain);

            tslDragLeft = new ToolStripLabel()
            {
                DisplayStyle = ToolStripItemDisplayStyle.Image,
                Image        = Resources.ui_radio_button_uncheck,
                Margin       = new Padding(2, 0, 2, 0),
                Padding      = new Padding(2)
            };

            tsMain.Items.Add(tslDragLeft);

            if (form.IsEditorMode)
            {
                #region Editor mode

                ToolStripButton tsbCompleteEdit = new ToolStripButton();

                if (form.Mode == RegionCaptureMode.Editor)
                {
                    tsbCompleteEdit.Text = "Run after capture tasks";
                }
                else
                {
                    tsbCompleteEdit.Text = "Apply changes & continue task (Enter)";
                }

                tsbCompleteEdit.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsbCompleteEdit.Image        = Resources.tick;
                tsbCompleteEdit.MouseDown   += (sender, e) => form.Close(RegionResult.AnnotateRunAfterCaptureTasks);
                tsMain.Items.Add(tsbCompleteEdit);

                if (form.Mode == RegionCaptureMode.TaskEditor)
                {
                    ToolStripButton tsbClose = new ToolStripButton("Continue task (Space or right click)");
                    tsbClose.DisplayStyle = ToolStripItemDisplayStyle.Image;
                    tsbClose.Image        = Resources.control;
                    tsbClose.MouseDown   += (sender, e) => form.Close(RegionResult.AnnotateContinueTask);
                    tsMain.Items.Add(tsbClose);

                    ToolStripButton tsbCloseCancel = new ToolStripButton("Cancel task (Esc)");
                    tsbCloseCancel.DisplayStyle = ToolStripItemDisplayStyle.Image;
                    tsbCloseCancel.Image        = Resources.cross;
                    tsbCloseCancel.MouseDown   += (sender, e) => form.Close(RegionResult.AnnotateCancelTask);
                    tsMain.Items.Add(tsbCloseCancel);
                }

                if (form.Mode == RegionCaptureMode.TaskEditor)
                {
                    tsMain.Items.Add(new ToolStripSeparator());
                }

                ToolStripButton tsbSaveImage = new ToolStripButton("Save image");
                tsbSaveImage.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsbSaveImage.Enabled      = File.Exists(form.ImageFilePath);
                tsbSaveImage.Image        = Resources.disk_black;
                tsbSaveImage.MouseDown   += (sender, e) => form.Close(RegionResult.AnnotateSaveImage);
                tsMain.Items.Add(tsbSaveImage);

                ToolStripButton tsbSaveImageAs = new ToolStripButton("Save image as...");
                tsbSaveImageAs.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsbSaveImageAs.Image        = Resources.disks_black;
                tsbSaveImageAs.MouseDown   += (sender, e) => form.Close(RegionResult.AnnotateSaveImageAs);
                tsMain.Items.Add(tsbSaveImageAs);

                ToolStripButton tsbCopyImage = new ToolStripButton("Copy image to clipboard");
                tsbCopyImage.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsbCopyImage.Image        = Resources.clipboard;
                tsbCopyImage.MouseDown   += (sender, e) => form.Close(RegionResult.AnnotateCopyImage);
                tsMain.Items.Add(tsbCopyImage);

                ToolStripButton tsbUploadImage = new ToolStripButton("Upload image");
                tsbUploadImage.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsbUploadImage.Image        = Resources.drive_globe;
                tsbUploadImage.MouseDown   += (sender, e) => form.Close(RegionResult.AnnotateUploadImage);
                tsMain.Items.Add(tsbUploadImage);

                ToolStripButton tsbPrintImage = new ToolStripButton("Print image...");
                tsbPrintImage.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsbPrintImage.Image        = Resources.printer;
                tsbPrintImage.MouseDown   += (sender, e) => form.Close(RegionResult.AnnotatePrintImage);
                tsMain.Items.Add(tsbPrintImage);

                tsMain.Items.Add(new ToolStripSeparator());

                #endregion Editor mode
            }

            #region Tools

            foreach (ShapeType shapeType in Helpers.GetEnums <ShapeType>())
            {
                if (form.IsEditorMode)
                {
                    if (IsShapeTypeRegion(shapeType))
                    {
                        continue;
                    }
                }
                else if (shapeType == ShapeType.DrawingRectangle)
                {
                    tsMain.Items.Add(new ToolStripSeparator());
                }
                else if (shapeType == ShapeType.DrawingCrop)
                {
                    continue;
                }

                ToolStripButton tsbShapeType = new ToolStripButton(shapeType.GetLocalizedDescription());
                tsbShapeType.DisplayStyle = ToolStripItemDisplayStyle.Image;

                Image img = null;

                switch (shapeType)
                {
                case ShapeType.RegionRectangle:
                    img = Resources.layer_shape_region;
                    break;

                case ShapeType.RegionEllipse:
                    img = Resources.layer_shape_ellipse_region;
                    break;

                case ShapeType.RegionFreehand:
                    img = Resources.layer_shape_polygon;
                    break;

                case ShapeType.DrawingRectangle:
                    img = Resources.layer_shape;
                    break;

                case ShapeType.DrawingEllipse:
                    img = Resources.layer_shape_ellipse;
                    break;

                case ShapeType.DrawingFreehand:
                    img = Resources.pencil;
                    break;

                case ShapeType.DrawingLine:
                    img = Resources.layer_shape_line;
                    break;

                case ShapeType.DrawingArrow:
                    img = Resources.layer_shape_arrow;
                    break;

                case ShapeType.DrawingTextOutline:
                    img = Resources.edit_outline;
                    break;

                case ShapeType.DrawingTextBackground:
                    img = Resources.edit_shade;
                    break;

                case ShapeType.DrawingSpeechBalloon:
                    img = Resources.balloon_box_left;
                    break;

                case ShapeType.DrawingStep:
                    img = Resources.counter_reset;
                    break;

                case ShapeType.DrawingImage:
                    img = Resources.folder_open_image;
                    break;

                case ShapeType.DrawingImageScreen:
                    img = Resources.monitor_image;
                    break;

                case ShapeType.EffectBlur:
                    img = Resources.layer_shade;
                    break;

                case ShapeType.EffectPixelate:
                    img = Resources.grid;
                    break;

                case ShapeType.EffectHighlight:
                    img = Resources.highlighter_text;
                    break;

                case ShapeType.DrawingCrop:
                    img = Resources.image_crop;
                    break;
                }

                tsbShapeType.Image   = img;
                tsbShapeType.Checked = shapeType == CurrentShapeType;
                tsbShapeType.Tag     = shapeType;

                tsbShapeType.MouseDown += (sender, e) =>
                {
                    tsbShapeType.RadioCheck();
                    CurrentShapeType = shapeType;
                };

                tsMain.Items.Add(tsbShapeType);
            }

            #endregion Tools

            #region Shape options

            tsMain.Items.Add(new ToolStripSeparator());

            tsbBorderColor = new ToolStripButton(Resources.ShapeManager_CreateContextMenu_Border_color___);
            tsbBorderColor.DisplayStyle = ToolStripItemDisplayStyle.Image;
            tsbBorderColor.Click       += (sender, e) =>
            {
                PauseForm();

                ShapeType shapeType = CurrentShapeType;

                Color borderColor;

                if (shapeType == ShapeType.DrawingTextBackground || shapeType == ShapeType.DrawingSpeechBalloon)
                {
                    borderColor = AnnotationOptions.TextBorderColor;
                }
                else if (shapeType == ShapeType.DrawingTextOutline)
                {
                    borderColor = AnnotationOptions.TextOutlineBorderColor;
                }
                else if (shapeType == ShapeType.DrawingStep)
                {
                    borderColor = AnnotationOptions.StepBorderColor;
                }
                else
                {
                    borderColor = AnnotationOptions.BorderColor;
                }

                using (ColorPickerForm dialogColor = new ColorPickerForm(borderColor))
                {
                    if (dialogColor.ShowDialog() == DialogResult.OK)
                    {
                        if (shapeType == ShapeType.DrawingTextBackground || shapeType == ShapeType.DrawingSpeechBalloon)
                        {
                            AnnotationOptions.TextBorderColor = dialogColor.NewColor;
                        }
                        else if (shapeType == ShapeType.DrawingTextOutline)
                        {
                            AnnotationOptions.TextOutlineBorderColor = dialogColor.NewColor;
                        }
                        else if (shapeType == ShapeType.DrawingStep)
                        {
                            AnnotationOptions.StepBorderColor = dialogColor.NewColor;
                        }
                        else
                        {
                            AnnotationOptions.BorderColor = dialogColor.NewColor;
                        }

                        UpdateMenu();
                        UpdateCurrentShape();
                    }
                }

                ResumeForm();
            };
            tsMain.Items.Add(tsbBorderColor);

            tsbFillColor = new ToolStripButton(Resources.ShapeManager_CreateContextMenu_Fill_color___);
            tsbFillColor.DisplayStyle = ToolStripItemDisplayStyle.Image;
            tsbFillColor.Click       += (sender, e) =>
            {
                PauseForm();

                ShapeType shapeType = CurrentShapeType;

                Color fillColor;

                if (shapeType == ShapeType.DrawingTextBackground || shapeType == ShapeType.DrawingSpeechBalloon)
                {
                    fillColor = AnnotationOptions.TextFillColor;
                }
                else if (shapeType == ShapeType.DrawingStep)
                {
                    fillColor = AnnotationOptions.StepFillColor;
                }
                else
                {
                    fillColor = AnnotationOptions.FillColor;
                }

                using (ColorPickerForm dialogColor = new ColorPickerForm(fillColor))
                {
                    if (dialogColor.ShowDialog() == DialogResult.OK)
                    {
                        if (shapeType == ShapeType.DrawingTextBackground || shapeType == ShapeType.DrawingSpeechBalloon)
                        {
                            AnnotationOptions.TextFillColor = dialogColor.NewColor;
                        }
                        else if (shapeType == ShapeType.DrawingStep)
                        {
                            AnnotationOptions.StepFillColor = dialogColor.NewColor;
                        }
                        else
                        {
                            AnnotationOptions.FillColor = dialogColor.NewColor;
                        }

                        UpdateMenu();
                        UpdateCurrentShape();
                    }
                }

                ResumeForm();
            };
            tsMain.Items.Add(tsbFillColor);

            tsbHighlightColor = new ToolStripButton(Resources.ShapeManager_CreateContextMenu_Highlight_color___);
            tsbHighlightColor.DisplayStyle = ToolStripItemDisplayStyle.Image;
            tsbHighlightColor.Click       += (sender, e) =>
            {
                PauseForm();

                using (ColorPickerForm dialogColor = new ColorPickerForm(AnnotationOptions.HighlightColor))
                {
                    if (dialogColor.ShowDialog() == DialogResult.OK)
                    {
                        AnnotationOptions.HighlightColor = dialogColor.NewColor;
                        UpdateMenu();
                        UpdateCurrentShape();
                    }
                }

                ResumeForm();
            };
            tsMain.Items.Add(tsbHighlightColor);

            tsddbShapeOptions = new ToolStripDropDownButton("Shape options");
            tsddbShapeOptions.DisplayStyle = ToolStripItemDisplayStyle.Image;
            tsddbShapeOptions.Image        = Resources.layer__pencil;
            tsMain.Items.Add(tsddbShapeOptions);

            tslnudBorderSize = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Border_size_);
            tslnudBorderSize.Content.Minimum      = 0;
            tslnudBorderSize.Content.Maximum      = 20;
            tslnudBorderSize.Content.ValueChanged = (sender, e) =>
            {
                ShapeType shapeType = CurrentShapeType;

                int borderSize = (int)tslnudBorderSize.Content.Value;

                if (shapeType == ShapeType.DrawingTextBackground || shapeType == ShapeType.DrawingSpeechBalloon)
                {
                    AnnotationOptions.TextBorderSize = borderSize;
                }
                else if (shapeType == ShapeType.DrawingTextOutline)
                {
                    AnnotationOptions.TextOutlineBorderSize = borderSize;
                }
                else if (shapeType == ShapeType.DrawingStep)
                {
                    AnnotationOptions.StepBorderSize = borderSize;
                }
                else
                {
                    AnnotationOptions.BorderSize = borderSize;
                }

                UpdateCurrentShape();
            };
            tsddbShapeOptions.DropDownItems.Add(tslnudBorderSize);

            tslnudCornerRadius = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Corner_radius_);
            tslnudCornerRadius.Content.Minimum      = 0;
            tslnudCornerRadius.Content.Maximum      = 150;
            tslnudCornerRadius.Content.ValueChanged = (sender, e) =>
            {
                ShapeType shapeType = CurrentShapeType;

                if (shapeType == ShapeType.RegionRectangle)
                {
                    AnnotationOptions.RegionCornerRadius = (int)tslnudCornerRadius.Content.Value;
                }
                else if (shapeType == ShapeType.DrawingRectangle || shapeType == ShapeType.DrawingTextBackground)
                {
                    AnnotationOptions.DrawingCornerRadius = (int)tslnudCornerRadius.Content.Value;
                }

                UpdateCurrentShape();
            };
            tsddbShapeOptions.DropDownItems.Add(tslnudCornerRadius);

            tslnudBlurRadius = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Blur_radius_);
            tslnudBlurRadius.Content.Minimum      = 3;
            tslnudBlurRadius.Content.Maximum      = 199;
            tslnudBlurRadius.Content.Increment    = 2;
            tslnudBlurRadius.Content.ValueChanged = (sender, e) =>
            {
                AnnotationOptions.BlurRadius = (int)tslnudBlurRadius.Content.Value;
                UpdateCurrentShape();
            };
            tsddbShapeOptions.DropDownItems.Add(tslnudBlurRadius);

            tslnudPixelateSize = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Pixel_size_);
            tslnudPixelateSize.Content.Minimum      = 2;
            tslnudPixelateSize.Content.Maximum      = 10000;
            tslnudPixelateSize.Content.ValueChanged = (sender, e) =>
            {
                AnnotationOptions.PixelateSize = (int)tslnudPixelateSize.Content.Value;
                UpdateCurrentShape();
            };
            tsddbShapeOptions.DropDownItems.Add(tslnudPixelateSize);

            tsmiShadow              = new ToolStripMenuItem("Drop shadow");
            tsmiShadow.Checked      = true;
            tsmiShadow.CheckOnClick = true;
            tsmiShadow.Click       += (sender, e) =>
            {
                AnnotationOptions.Shadow = tsmiShadow.Checked;
                UpdateCurrentShape();
            };
            tsddbShapeOptions.DropDownItems.Add(tsmiShadow);

            // In dropdown menu if only last item is visible then menu opens at 0, 0 position on first open, so need to add dummy item to solve this weird bug...
            tsddbShapeOptions.DropDownItems.Add(new ToolStripSeparator()
            {
                Visible = false
            });

            #endregion Shape options

            #region Edit

            ToolStripDropDownButton tsddbEdit = new ToolStripDropDownButton("Edit");
            tsddbEdit.DisplayStyle = ToolStripItemDisplayStyle.Image;
            tsddbEdit.Image        = Resources.wrench_screwdriver;
            tsMain.Items.Add(tsddbEdit);

            tsmiUndo       = new ToolStripMenuItem("Undo");
            tsmiUndo.Image = Resources.arrow_circle_225_left;
            tsmiUndo.ShortcutKeyDisplayString = "Ctrl+Z";
            tsmiUndo.MouseDown += (sender, e) => UndoShape();
            tsddbEdit.DropDownItems.Add(tsmiUndo);

            tsddbEdit.DropDownItems.Add(new ToolStripSeparator());

            tsmiDelete       = new ToolStripMenuItem("Delete");
            tsmiDelete.Image = Resources.layer__minus;
            tsmiDelete.ShortcutKeyDisplayString = "Del";
            tsmiDelete.MouseDown += (sender, e) => DeleteCurrentShape();
            tsddbEdit.DropDownItems.Add(tsmiDelete);

            tsmiDeleteAll       = new ToolStripMenuItem("Delete all");
            tsmiDeleteAll.Image = Resources.eraser;
            tsmiDeleteAll.ShortcutKeyDisplayString = "Shift+Del";
            tsmiDeleteAll.MouseDown += (sender, e) => DeleteAllShapes();
            tsddbEdit.DropDownItems.Add(tsmiDeleteAll);

            tsddbEdit.DropDownItems.Add(new ToolStripSeparator());

            tsmiMoveTop       = new ToolStripMenuItem("Bring to front");
            tsmiMoveTop.Image = Resources.layers_stack_arrange;
            tsmiMoveTop.ShortcutKeyDisplayString = "Home";
            tsmiMoveTop.MouseDown += (sender, e) => MoveCurrentShapeTop();
            tsddbEdit.DropDownItems.Add(tsmiMoveTop);

            tsmiMoveUp       = new ToolStripMenuItem("Bring forward");
            tsmiMoveUp.Image = Resources.layers_arrange;
            tsmiMoveUp.ShortcutKeyDisplayString = "Page up";
            tsmiMoveUp.MouseDown += (sender, e) => MoveCurrentShapeUp();
            tsddbEdit.DropDownItems.Add(tsmiMoveUp);

            tsmiMoveDown       = new ToolStripMenuItem("Send backward");
            tsmiMoveDown.Image = Resources.layers_arrange_back;
            tsmiMoveDown.ShortcutKeyDisplayString = "Page down";
            tsmiMoveDown.MouseDown += (sender, e) => MoveCurrentShapeDown();
            tsddbEdit.DropDownItems.Add(tsmiMoveDown);

            tsmiMoveBottom       = new ToolStripMenuItem("Send to back");
            tsmiMoveBottom.Image = Resources.layers_stack_arrange_back;
            tsmiMoveBottom.ShortcutKeyDisplayString = "End";
            tsmiMoveBottom.MouseDown += (sender, e) => MoveCurrentShapeBottom();
            tsddbEdit.DropDownItems.Add(tsmiMoveBottom);

            #endregion Edit

            if (!form.IsEditorMode)
            {
                tsMain.Items.Add(new ToolStripSeparator());

                #region Capture

                ToolStripDropDownButton tsddbCapture = new ToolStripDropDownButton("Capture");
                tsddbCapture.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsddbCapture.Image        = Resources.camera;
                tsMain.Items.Add(tsddbCapture);

                tsmiRegionCapture       = new ToolStripMenuItem("Capture regions");
                tsmiRegionCapture.Image = Resources.layer;
                tsmiRegionCapture.ShortcutKeyDisplayString = "Enter";
                tsmiRegionCapture.MouseDown += (sender, e) =>
                {
                    form.UpdateRegionPath();
                    form.Close(RegionResult.Region);
                };
                tsddbCapture.DropDownItems.Add(tsmiRegionCapture);

                if (RegionCaptureForm.LastRegionFillPath != null)
                {
                    ToolStripMenuItem tsmiLastRegionCapture = new ToolStripMenuItem("Capture last region");
                    tsmiLastRegionCapture.Image      = Resources.layers;
                    tsmiLastRegionCapture.MouseDown += (sender, e) => form.Close(RegionResult.LastRegion);
                    tsddbCapture.DropDownItems.Add(tsmiLastRegionCapture);
                }

                ToolStripMenuItem tsmiFullscreenCapture = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Capture_fullscreen);
                tsmiFullscreenCapture.Image = Resources.layer_fullscreen;
                tsmiFullscreenCapture.ShortcutKeyDisplayString = "Space";
                tsmiFullscreenCapture.MouseDown += (sender, e) => form.Close(RegionResult.Fullscreen);
                tsddbCapture.DropDownItems.Add(tsmiFullscreenCapture);

                ToolStripMenuItem tsmiActiveMonitorCapture = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Capture_active_monitor);
                tsmiActiveMonitorCapture.Image = Resources.monitor;
                tsmiActiveMonitorCapture.ShortcutKeyDisplayString = "~";
                tsmiActiveMonitorCapture.MouseDown += (sender, e) => form.Close(RegionResult.ActiveMonitor);
                tsddbCapture.DropDownItems.Add(tsmiActiveMonitorCapture);

                ToolStripMenuItem tsmiMonitorCapture = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Capture_monitor);
                tsmiMonitorCapture.HideImageMargin();
                tsmiMonitorCapture.Image = Resources.monitor_window;
                tsddbCapture.DropDownItems.Add(tsmiMonitorCapture);

                Screen[] screens = Screen.AllScreens;

                for (int i = 0; i < screens.Length; i++)
                {
                    Screen            screen = screens[i];
                    ToolStripMenuItem tsmi   = new ToolStripMenuItem($"{screen.Bounds.Width}x{screen.Bounds.Height}");
                    tsmi.ShortcutKeyDisplayString = (i + 1).ToString();
                    int index = i;
                    tsmi.MouseDown += (sender, e) =>
                    {
                        form.MonitorIndex = index;
                        form.Close(RegionResult.Monitor);
                    };
                    tsmiMonitorCapture.DropDownItems.Add(tsmi);
                }

                #endregion Capture

                #region Options

                ToolStripDropDownButton tsddbOptions = new ToolStripDropDownButton(Resources.ShapeManager_CreateContextMenu_Options);
                tsddbOptions.DisplayStyle = ToolStripItemDisplayStyle.Image;
                tsddbOptions.Image        = Resources.gear;
                tsMain.Items.Add(tsddbOptions);

                tsmiQuickCrop                          = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Multi_region_mode);
                tsmiQuickCrop.Checked                  = !Config.QuickCrop;
                tsmiQuickCrop.CheckOnClick             = true;
                tsmiQuickCrop.ShortcutKeyDisplayString = "Q";
                tsmiQuickCrop.Click                   += (sender, e) => Config.QuickCrop = !tsmiQuickCrop.Checked;
                tsddbOptions.DropDownItems.Add(tsmiQuickCrop);

                tsmiTips                          = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Show_tips);
                tsmiTips.Checked                  = Config.ShowHotkeys;
                tsmiTips.CheckOnClick             = true;
                tsmiTips.ShortcutKeyDisplayString = "F1";
                tsmiTips.Click                   += (sender, e) => Config.ShowHotkeys = tsmiTips.Checked;
                tsddbOptions.DropDownItems.Add(tsmiTips);

                ToolStripMenuItem tsmiShowInfo = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Show_position_and_size_info);
                tsmiShowInfo.Checked      = Config.ShowInfo;
                tsmiShowInfo.CheckOnClick = true;
                tsmiShowInfo.Click       += (sender, e) => Config.ShowInfo = tsmiShowInfo.Checked;
                tsddbOptions.DropDownItems.Add(tsmiShowInfo);

                ToolStripMenuItem tsmiShowMagnifier = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Show_magnifier);
                tsmiShowMagnifier.Checked      = Config.ShowMagnifier;
                tsmiShowMagnifier.CheckOnClick = true;
                tsmiShowMagnifier.Click       += (sender, e) => Config.ShowMagnifier = tsmiShowMagnifier.Checked;
                tsddbOptions.DropDownItems.Add(tsmiShowMagnifier);

                ToolStripMenuItem tsmiUseSquareMagnifier = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Square_shape_magnifier);
                tsmiUseSquareMagnifier.Checked      = Config.UseSquareMagnifier;
                tsmiUseSquareMagnifier.CheckOnClick = true;
                tsmiUseSquareMagnifier.Click       += (sender, e) => Config.UseSquareMagnifier = tsmiUseSquareMagnifier.Checked;
                tsddbOptions.DropDownItems.Add(tsmiUseSquareMagnifier);

                ToolStripLabeledNumericUpDown tslnudMagnifierPixelCount = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Magnifier_pixel_count_);
                tslnudMagnifierPixelCount.Content.Minimum      = RegionCaptureOptions.MagnifierPixelCountMinimum;
                tslnudMagnifierPixelCount.Content.Maximum      = RegionCaptureOptions.MagnifierPixelCountMaximum;
                tslnudMagnifierPixelCount.Content.Increment    = 2;
                tslnudMagnifierPixelCount.Content.Value        = Config.MagnifierPixelCount;
                tslnudMagnifierPixelCount.Content.ValueChanged = (sender, e) => Config.MagnifierPixelCount = (int)tslnudMagnifierPixelCount.Content.Value;
                tsddbOptions.DropDownItems.Add(tslnudMagnifierPixelCount);

                ToolStripLabeledNumericUpDown tslnudMagnifierPixelSize = new ToolStripLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Magnifier_pixel_size_);
                tslnudMagnifierPixelSize.Content.Minimum      = RegionCaptureOptions.MagnifierPixelSizeMinimum;
                tslnudMagnifierPixelSize.Content.Maximum      = RegionCaptureOptions.MagnifierPixelSizeMaximum;
                tslnudMagnifierPixelSize.Content.Value        = Config.MagnifierPixelSize;
                tslnudMagnifierPixelSize.Content.ValueChanged = (sender, e) => Config.MagnifierPixelSize = (int)tslnudMagnifierPixelSize.Content.Value;
                tsddbOptions.DropDownItems.Add(tslnudMagnifierPixelSize);

                ToolStripMenuItem tsmiShowCrosshair = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Show_screen_wide_crosshair);
                tsmiShowCrosshair.Checked      = Config.ShowCrosshair;
                tsmiShowCrosshair.CheckOnClick = true;
                tsmiShowCrosshair.Click       += (sender, e) => Config.ShowCrosshair = tsmiShowCrosshair.Checked;
                tsddbOptions.DropDownItems.Add(tsmiShowCrosshair);

                ToolStripMenuItem tsmiEnableAnimations = new ToolStripMenuItem("Enable animations"); // TODO: Translate
                tsmiEnableAnimations.Checked      = Config.EnableAnimations;
                tsmiEnableAnimations.CheckOnClick = true;
                tsmiEnableAnimations.Click       += (sender, e) => Config.EnableAnimations = tsmiEnableAnimations.Checked;
                tsddbOptions.DropDownItems.Add(tsmiEnableAnimations);

                ToolStripMenuItem tsmiFixedSize = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Fixed_size_region_mode);
                tsmiFixedSize.Checked      = Config.IsFixedSize;
                tsmiFixedSize.CheckOnClick = true;
                tsmiFixedSize.Click       += (sender, e) => Config.IsFixedSize = tsmiFixedSize.Checked;
                tsddbOptions.DropDownItems.Add(tsmiFixedSize);

                ToolStripDoubleLabeledNumericUpDown tslnudFixedSize = new ToolStripDoubleLabeledNumericUpDown(Resources.ShapeManager_CreateContextMenu_Width_,
                                                                                                              Resources.ShapeManager_CreateContextMenu_Height_);
                tslnudFixedSize.Content.Minimum      = 10;
                tslnudFixedSize.Content.Maximum      = 10000;
                tslnudFixedSize.Content.Increment    = 10;
                tslnudFixedSize.Content.Value        = Config.FixedSize.Width;
                tslnudFixedSize.Content.Value2       = Config.FixedSize.Height;
                tslnudFixedSize.Content.ValueChanged = (sender, e) => Config.FixedSize = new Size((int)tslnudFixedSize.Content.Value, (int)tslnudFixedSize.Content.Value2);
                tsddbOptions.DropDownItems.Add(tslnudFixedSize);

                ToolStripMenuItem tsmiShowFPS = new ToolStripMenuItem(Resources.ShapeManager_CreateContextMenu_Show_FPS);
                tsmiShowFPS.Checked      = Config.ShowFPS;
                tsmiShowFPS.CheckOnClick = true;
                tsmiShowFPS.Click       += (sender, e) => Config.ShowFPS = tsmiShowFPS.Checked;
                tsddbOptions.DropDownItems.Add(tsmiShowFPS);

                ToolStripMenuItem tsmiRememberMenuState = new ToolStripMenuItem("Remember menu state");
                tsmiRememberMenuState.Checked      = Config.RememberMenuState;
                tsmiRememberMenuState.CheckOnClick = true;
                tsmiRememberMenuState.Click       += (sender, e) => Config.RememberMenuState = tsmiRememberMenuState.Checked;
                tsddbOptions.DropDownItems.Add(tsmiRememberMenuState);

                #endregion Options
            }

            ToolStripLabel tslDragRight = new ToolStripLabel()
            {
                Alignment    = ToolStripItemAlignment.Right,
                DisplayStyle = ToolStripItemDisplayStyle.Image,
                Image        = Resources.ui_radio_button_uncheck,
                Margin       = new Padding(0, 0, 2, 0),
                Padding      = new Padding(2)
            };

            tsMain.Items.Add(tslDragRight);

            tslDragLeft.MouseDown   += TslDrag_MouseDown;
            tslDragRight.MouseDown  += TslDrag_MouseDown;
            tslDragLeft.MouseEnter  += TslDrag_MouseEnter;
            tslDragRight.MouseEnter += TslDrag_MouseEnter;
            tslDragLeft.MouseLeave  += TslDrag_MouseLeave;
            tslDragRight.MouseLeave += TslDrag_MouseLeave;

            tsMain.ResumeLayout(false);
            tsMain.PerformLayout();
            menuForm.ResumeLayout(false);

            menuForm.Show(form);

            foreach (ToolStripItem tsi in tsMain.Items.OfType <ToolStripItem>())
            {
                if (!string.IsNullOrEmpty(tsi.Text))
                {
                    tsi.MouseEnter += (sender, e) =>
                    {
                        Point pos = CaptureHelpers.ScreenToClient(menuForm.PointToScreen(tsi.Bounds.Location));
                        pos.Y += tsi.Height + 8;

                        MenuTextAnimation.Text     = tsi.Text;
                        MenuTextAnimation.Position = pos;
                        MenuTextAnimation.Start();
                    };

                    tsi.MouseLeave += TsMain_MouseLeave;
                }
            }

            UpdateMenu();

            CurrentShapeChanged     += shape => UpdateMenu();
            CurrentShapeTypeChanged += shapeType => UpdateMenu();
            ShapeCreated            += shape => UpdateMenu();

            ConfigureMenuState();

            form.Activate();
        }
Example #26
0
        public frmBalance()
        {
            InitializeComponent();

            _mainBindingSource = bsBalance;

            var lblInicio = new ToolStripLabel("Início:")
            {
                DoubleClickEnabled = true
            };

            lblInicio.DoubleClick += (sender, args) => {
                _dtpInicio.Value = ContaAtual.DataMin;
                if (_dtpInicio.Value > _dtpTermino.Value)
                {
                    _dtpTermino.Value = _dtpInicio.Value.AddMonths(3);
                }
            };

            var lblTermino = new ToolStripLabel("Término:")
            {
                DoubleClickEnabled = true
            };

            lblTermino.DoubleClick += (sender, args) => {
                _dtpTermino.Value = ContaAtual.DataMax;
                if (_dtpInicio.Value > _dtpTermino.Value)
                {
                    _dtpInicio.Value = _dtpTermino.Value.AddMonths(-3);
                }
            };

            toolStripMenu.Items.Add(new ToolStripLabel("Conta:"));
            toolStripMenu.Items.Add(toolStripComboBoxConta);
            toolStripMenu.Items.Add(lblInicio);
            toolStripMenu.Items.Add(_dtpInicio);
            toolStripMenu.Items.Add(lblTermino);
            toolStripMenu.Items.Add(_dtpTermino);
            toolStripMenu.Items.Add(toolStripButtonProcurar);
            toolStripMenu.Items.Add(new ToolStripLabel("Grupo:"));
            toolStripMenu.Items.Add(toolStripComboBoxGrupo);
            toolStripMenu.Items.Add(toolStripButtonSelecionar);
            toolStripMenu.Items.Add(toolStripSeparator1);
            toolStripMenu.Items.Add(_chkboxAutoMode);
            toolStripMenu.Items.Add(new ToolStripSeparator());
            toolStripMenu.Items.Add(new ToolStripLabel("Procurar:"));
            toolStripMenu.Items.Add(toolStripTextBoxProcurar);
            toolStripMenu.Items.Add(toolStripButtonProcurar);
            toolStripMenu.Items.Add(new ToolStripSeparator());
            toolStripMenu.Items.Add(_chkboxRegex);
            toolStripMenu.Items.Add(new ToolStripSeparator());
            toolStripMenu.Items.Add(_chkboxDocumento);

            var font = new Font("Segoe UI", 11.0F, FontStyle.Regular, GraphicsUnit.Point, 0);

            foreach (var item in toolStripMenu.Items.Cast <ToolStripItem>()
                     .Where(item => item.Font.Name == "Segoe UI"))
            {
                item.Font = font;
            }

            toolStripTextBoxProcurar.KeyDown            += toolStripTextBoxProcurar_KeyDown;
            toolStripTextBoxProcurar.Validated          += toolStripTextBoxProcurar_Validated;
            toolStripTextBoxProcurar.TextChanged        += toolStripTextBoxProcurar_TextChanged;
            toolStripButtonProcurar.Click               += toolStripButtonProcurar_Click;
            _chkboxAutoMode.CheckedChanged              += ToggleAutoMode;
            _chkboxDocumento.CheckedChanged             += ShowDocumento;
            toolStripComboBoxConta.SelectedIndexChanged += FilterItemChanged;
            toolStripButtonSelecionar.Click             += FilterItemChanged;
            _dtpInicio.ValueChanged  += FilterItemChanged;
            _dtpTermino.ValueChanged += FilterItemChanged;

            toolStripComboBoxConta.ComboBox.Items.AddRange(_ctx.Contas.OrderBy(c => c.Apelido).ToArray());
            toolStripComboBoxConta.ComboBox.DisplayMember = "Apelido";

            toolStripComboBoxConta.ComboBox.SelectedItem =
                Settings.Default.BalanceUsarContaPadrao
                    ? _ctx.Contas.Find(Settings.Default.BalanceContaPadrao)
                    : _ctx.Contas.Find(Settings.Default.BalanceUltimaConta);

            dgvBalance.FormatColumn("Data", dgvBalance.StyleDateShort, 80);
            dgvBalance.FormatColumn("Histórico", null, 300);
            dgvBalance.FormatColumn("Documento", null, 120);
            dgvBalance.FormatColumn("Valor", dgvBalance.StyleCurrency, 100);
            dgvBalance.FormatColumn("Afeta Saldo", null, 40);
            dgvBalance.FormatColumn("Saldo", dgvBalance.StyleCurrency, 100);
            dgvBalance.FormatColumn("Grupo", null, 120);
            dgvBalance.FormatColumn("Categoria", null, 140);
            dgvBalance.FormatColumn("SubCategoria", null, 200);
            dgvBalance.FormatColumn("Descrição", null, 200);
            dgvBalance.Columns[2].Visible = false;

            ResizeForm(dgvBalance);

            QueryDatabase();

            toolStripComboBoxGrupo.SelectedIndexChanged += FilterItemChanged;
        }
Example #27
0
        private void MouseMove(object sender, MouseEventArgs e)
        {
            ToolStripLabel tsl = (ToolStripLabel)sender;

            tsl.BackColor = System.Drawing.Color.Snow;
        }
Example #28
0
 /// <summary>
 /// Méthode requise pour la prise en charge du concepteur - ne modifiez pas
 /// le contenu de cette méthode avec l'éditeur de code.
 /// </summary>
 private void InitializeComponent()
 {
     this.components = new System.ComponentModel.Container();
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainView));
     this.timer                               = new System.Windows.Forms.Timer(this.components);
     this.toolBarLblVersion                   = new System.Windows.Forms.ToolStripLabel();
     this.nIUpdateAvailable                   = new System.Windows.Forms.NotifyIcon(this.components);
     this.openCustomizableFileDialog          = new System.Windows.Forms.OpenFileDialog();
     this.colAlerts_Address                   = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
     this.colAlerts_City                      = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
     this.colAlerts_Phone                     = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
     this.colAlerts_BranchName                = ((BrightIdeasSoftware.OLVColumn)(new BrightIdeasSoftware.OLVColumn()));
     this.bwUserInformation                   = new System.ComponentModel.BackgroundWorker();
     this.mnuClients                          = new System.Windows.Forms.ToolStripMenuItem();
     this.mnuNewPerson                        = new System.Windows.Forms.ToolStripMenuItem();
     this.mnuNewClient                        = new System.Windows.Forms.ToolStripMenuItem();
     this.mnuNewGroup                         = new System.Windows.Forms.ToolStripMenuItem();
     this.mnuNewVillage                       = new System.Windows.Forms.ToolStripMenuItem();
     this.newCorporateToolStripMenuItem       = new System.Windows.Forms.ToolStripMenuItem();
     this.toolStripMenuItem1                  = new System.Windows.Forms.ToolStripSeparator();
     this.mnuSearchClient                     = new System.Windows.Forms.ToolStripMenuItem();
     this.mnuSearchContract                   = new System.Windows.Forms.ToolStripMenuItem();
     this.reasignToolStripMenuItem            = new System.Windows.Forms.ToolStripMenuItem();
     this.mnuAccounting                       = new System.Windows.Forms.ToolStripMenuItem();
     this.mnuChartOfAccounts                  = new System.Windows.Forms.ToolStripMenuItem();
     this.accountingRulesToolStripMenuItem    = new System.Windows.Forms.ToolStripMenuItem();
     this.trialBalanceToolStripMenuItem       = new System.Windows.Forms.ToolStripMenuItem();
     this.toolStripMenuItemAccountView        = new System.Windows.Forms.ToolStripMenuItem();
     this.manualEntriesToolStripMenuItem      = new System.Windows.Forms.ToolStripMenuItem();
     this.standardToolStripMenuItem           = new System.Windows.Forms.ToolStripMenuItem();
     this.toolStripSeparator2                 = new System.Windows.Forms.ToolStripSeparator();
     this.menuItemExportTransaction           = new System.Windows.Forms.ToolStripMenuItem();
     this.mnuNewclosure                       = new System.Windows.Forms.ToolStripMenuItem();
     this.fiscalYearToolStripMenuItem         = new System.Windows.Forms.ToolStripMenuItem();
     this.mnuConfiguration                    = new System.Windows.Forms.ToolStripMenuItem();
     this.branchesToolStripMenuItem           = new System.Windows.Forms.ToolStripMenuItem();
     this.tellersToolStripMenuItem            = new System.Windows.Forms.ToolStripMenuItem();
     this.toolStripSeparatorConfig1           = new System.Windows.Forms.ToolStripSeparator();
     this.mnuDomainOfApplication              = new System.Windows.Forms.ToolStripMenuItem();
     this.menuItemLocations                   = new System.Windows.Forms.ToolStripMenuItem();
     this.toolStripMenuItemFundingLines       = new System.Windows.Forms.ToolStripMenuItem();
     this.toolStripMenuItemInstallmentTypes   = new System.Windows.Forms.ToolStripMenuItem();
     this.toolStripSeparatorConfig2           = new System.Windows.Forms.ToolStripSeparator();
     this.menuItemExchangeRate                = new System.Windows.Forms.ToolStripMenuItem();
     this.currenciesToolStripMenuItem         = new System.Windows.Forms.ToolStripMenuItem();
     this.toolStripSeparatorConfig3           = new System.Windows.Forms.ToolStripSeparator();
     this.miContractCode                      = new System.Windows.Forms.ToolStripMenuItem();
     this.collateralProductsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
     this.mnuWindow                           = new System.Windows.Forms.ToolStripMenuItem();
     this.mnuHelp                             = new System.Windows.Forms.ToolStripMenuItem();
     this.userGuideToolStripMenuItem          = new System.Windows.Forms.ToolStripMenuItem();
     this.contactMenuItem                     = new System.Windows.Forms.ToolStripMenuItem();
     this.aboutMenuItem                       = new System.Windows.Forms.ToolStripMenuItem();
     this.getHelpFromForumToolStripMenuItem   = new System.Windows.Forms.ToolStripMenuItem();
     this.visitOpenCBScomToolStripMenuItem    = new System.Windows.Forms.ToolStripMenuItem();
     this.mainMenu                            = new System.Windows.Forms.MenuStrip();
     this.mnuSettings                         = new System.Windows.Forms.ToolStripMenuItem();
     this.menuItemSetting                     = new System.Windows.Forms.ToolStripMenuItem();
     this.menuItemDatabaseControlPanel        = new System.Windows.Forms.ToolStripMenuItem();
     this.menuItemApplicationDate             = new System.Windows.Forms.ToolStripMenuItem();
     this.languagesToolStripMenuItem          = new System.Windows.Forms.ToolStripMenuItem();
     this.frenchToolStripMenuItem             = new System.Windows.Forms.ToolStripMenuItem();
     this.englishToolStripMenuItem            = new System.Windows.Forms.ToolStripMenuItem();
     this.russianToolStripMenuItem            = new System.Windows.Forms.ToolStripMenuItem();
     this.spanishToolStripMenuItem            = new System.Windows.Forms.ToolStripMenuItem();
     this.portugueseToolStripMenuItem         = new System.Windows.Forms.ToolStripMenuItem();
     this.mnuSecurity                         = new System.Windows.Forms.ToolStripMenuItem();
     this.rolesToolStripMenuItem              = new System.Windows.Forms.ToolStripMenuItem();
     this.menuItemAddUser                     = new System.Windows.Forms.ToolStripMenuItem();
     this.miAuditTrail                        = new System.Windows.Forms.ToolStripMenuItem();
     this.changePasswordToolStripMenuItem     = new System.Windows.Forms.ToolStripMenuItem();
     this.mnuProducts                         = new System.Windows.Forms.ToolStripMenuItem();
     this.mnuPackages                         = new System.Windows.Forms.ToolStripMenuItem();
     this.savingProductsToolStripMenuItem     = new System.Windows.Forms.ToolStripMenuItem();
     this._viewItem                           = new System.Windows.Forms.ToolStripMenuItem();
     this._startPageItem                      = new System.Windows.Forms.ToolStripMenuItem();
     this._alertsItem                         = new System.Windows.Forms.ToolStripMenuItem();
     this._dashboardItem                      = new System.Windows.Forms.ToolStripMenuItem();
     this._modulesMenuItem                    = new System.Windows.Forms.ToolStripMenuItem();
     this._aboutModulesMenuItem               = new System.Windows.Forms.ToolStripMenuItem();
     this.reportsToolStripMenuItem            = new System.Windows.Forms.ToolStripMenuItem();
     this.mainStatusBar                       = new System.Windows.Forms.StatusStrip();
     this.mainStatusBarLblUpdateVersion       = new System.Windows.Forms.ToolStripStatusLabel();
     this.mainStatusBarLblUserName            = new System.Windows.Forms.ToolStripStatusLabel();
     this.mainStatusBarLblDate                = new System.Windows.Forms.ToolStripStatusLabel();
     this.toolStripStatusLblBranchCode        = new System.Windows.Forms.ToolStripStatusLabel();
     this.toolStripStatusLblDB                = new System.Windows.Forms.ToolStripStatusLabel();
     this.loanPurposeToolStripMenuItem        = new System.Windows.Forms.ToolStripMenuItem();
     this.mainMenu.SuspendLayout();
     this.mainStatusBar.SuspendLayout();
     this.SuspendLayout();
     //
     // timer
     //
     this.timer.Enabled  = true;
     this.timer.Interval = 1000;
     this.timer.Tick    += new System.EventHandler(this.timer_Tick);
     //
     // toolBarLblVersion
     //
     this.toolBarLblVersion.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
     resources.ApplyResources(this.toolBarLblVersion, "toolBarLblVersion");
     this.toolBarLblVersion.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(100)))), ((int)(((byte)(180)))), ((int)(((byte)(156)))));
     this.toolBarLblVersion.Name      = "toolBarLblVersion";
     //
     // nIUpdateAvailable
     //
     this.nIUpdateAvailable.BalloonTipIcon = System.Windows.Forms.ToolTipIcon.Info;
     resources.ApplyResources(this.nIUpdateAvailable, "nIUpdateAvailable");
     this.nIUpdateAvailable.BalloonTipClicked += new System.EventHandler(this.nIUpdateAvailable_BalloonTipClicked);
     //
     // openCustomizableFileDialog
     //
     resources.ApplyResources(this.openCustomizableFileDialog, "openCustomizableFileDialog");
     //
     // colAlerts_Address
     //
     this.colAlerts_Address.AspectName = "Address";
     resources.ApplyResources(this.colAlerts_Address, "colAlerts_Address");
     this.colAlerts_Address.IsEditable = false;
     this.colAlerts_Address.IsVisible  = false;
     //
     // colAlerts_City
     //
     this.colAlerts_City.AspectName = "City";
     resources.ApplyResources(this.colAlerts_City, "colAlerts_City");
     this.colAlerts_City.IsEditable = false;
     this.colAlerts_City.IsVisible  = false;
     //
     // colAlerts_Phone
     //
     this.colAlerts_Phone.AspectName = "Phone";
     resources.ApplyResources(this.colAlerts_Phone, "colAlerts_Phone");
     this.colAlerts_Phone.IsEditable = false;
     this.colAlerts_Phone.IsVisible  = false;
     //
     // colAlerts_BranchName
     //
     this.colAlerts_BranchName.AspectName = "BranchName";
     resources.ApplyResources(this.colAlerts_BranchName, "colAlerts_BranchName");
     this.colAlerts_BranchName.IsEditable = false;
     this.colAlerts_BranchName.IsVisible  = false;
     //
     // mnuClients
     //
     this.mnuClients.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
         this.mnuNewPerson,
         this.mnuNewClient,
         this.toolStripMenuItem1,
         this.mnuSearchClient,
         this.mnuSearchContract,
         this.reasignToolStripMenuItem
     });
     this.mnuClients.Name = "mnuClients";
     resources.ApplyResources(this.mnuClients, "mnuClients");
     //
     // mnuNewPerson
     //
     resources.ApplyResources(this.mnuNewPerson, "mnuNewPerson");
     this.mnuNewPerson.Name   = "mnuNewPerson";
     this.mnuNewPerson.Click += new System.EventHandler(this.mnuNewPerson_Click);
     //
     // mnuNewClient
     //
     this.mnuNewClient.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
         this.mnuNewGroup,
         this.mnuNewVillage,
         this.newCorporateToolStripMenuItem
     });
     resources.ApplyResources(this.mnuNewClient, "mnuNewClient");
     this.mnuNewClient.Name = "mnuNewClient";
     //
     // mnuNewGroup
     //
     resources.ApplyResources(this.mnuNewGroup, "mnuNewGroup");
     this.mnuNewGroup.Name   = "mnuNewGroup";
     this.mnuNewGroup.Click += new System.EventHandler(this.mnuNewGroup_Click);
     //
     // mnuNewVillage
     //
     this.mnuNewVillage.Name = "mnuNewVillage";
     resources.ApplyResources(this.mnuNewVillage, "mnuNewVillage");
     this.mnuNewVillage.Click += new System.EventHandler(this.mnuNewVillage_Click);
     //
     // newCorporateToolStripMenuItem
     //
     this.newCorporateToolStripMenuItem.Name = "newCorporateToolStripMenuItem";
     resources.ApplyResources(this.newCorporateToolStripMenuItem, "newCorporateToolStripMenuItem");
     this.newCorporateToolStripMenuItem.Click += new System.EventHandler(this.newCorporateToolStripMenuItem_Click);
     //
     // toolStripMenuItem1
     //
     this.toolStripMenuItem1.Name = "toolStripMenuItem1";
     resources.ApplyResources(this.toolStripMenuItem1, "toolStripMenuItem1");
     //
     // mnuSearchClient
     //
     this.mnuSearchClient.Image = global::OpenCBS.GUI.Properties.Resources.find;
     resources.ApplyResources(this.mnuSearchClient, "mnuSearchClient");
     this.mnuSearchClient.Name   = "mnuSearchClient";
     this.mnuSearchClient.Click += new System.EventHandler(this.mnuSearchClient_Click);
     //
     // mnuSearchContract
     //
     this.mnuSearchContract.Image = global::OpenCBS.GUI.Properties.Resources.find;
     resources.ApplyResources(this.mnuSearchContract, "mnuSearchContract");
     this.mnuSearchContract.Name   = "mnuSearchContract";
     this.mnuSearchContract.Click += new System.EventHandler(this.mnuSearchContract_Click);
     //
     // reasignToolStripMenuItem
     //
     this.reasignToolStripMenuItem.Name = "reasignToolStripMenuItem";
     resources.ApplyResources(this.reasignToolStripMenuItem, "reasignToolStripMenuItem");
     this.reasignToolStripMenuItem.Click += new System.EventHandler(this.reasignToolStripMenuItem_Click);
     //
     // mnuAccounting
     //
     this.mnuAccounting.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
         this.mnuChartOfAccounts,
         this.accountingRulesToolStripMenuItem,
         this.trialBalanceToolStripMenuItem,
         this.toolStripMenuItemAccountView,
         this.manualEntriesToolStripMenuItem,
         this.standardToolStripMenuItem,
         this.toolStripSeparator2,
         this.menuItemExportTransaction,
         this.mnuNewclosure,
         this.fiscalYearToolStripMenuItem
     });
     this.mnuAccounting.Name = "mnuAccounting";
     resources.ApplyResources(this.mnuAccounting, "mnuAccounting");
     //
     // mnuChartOfAccounts
     //
     this.mnuChartOfAccounts.Image = global::OpenCBS.GUI.Properties.Resources.page;
     this.mnuChartOfAccounts.Name  = "mnuChartOfAccounts";
     resources.ApplyResources(this.mnuChartOfAccounts, "mnuChartOfAccounts");
     //
     // accountingRulesToolStripMenuItem
     //
     this.accountingRulesToolStripMenuItem.Name = "accountingRulesToolStripMenuItem";
     resources.ApplyResources(this.accountingRulesToolStripMenuItem, "accountingRulesToolStripMenuItem");
     this.accountingRulesToolStripMenuItem.Click += new System.EventHandler(this.accountingRulesToolStripMenuItem_Click);
     //
     // trialBalanceToolStripMenuItem
     //
     this.trialBalanceToolStripMenuItem.Name = "trialBalanceToolStripMenuItem";
     resources.ApplyResources(this.trialBalanceToolStripMenuItem, "trialBalanceToolStripMenuItem");
     this.trialBalanceToolStripMenuItem.Click += new System.EventHandler(this.trialBalanceToolStripMenuItem_Click);
     //
     // toolStripMenuItemAccountView
     //
     this.toolStripMenuItemAccountView.Image = global::OpenCBS.GUI.Properties.Resources.book;
     resources.ApplyResources(this.toolStripMenuItemAccountView, "toolStripMenuItemAccountView");
     this.toolStripMenuItemAccountView.Name   = "toolStripMenuItemAccountView";
     this.toolStripMenuItemAccountView.Click += new System.EventHandler(this.toolStripMenuItemAccountView_Click);
     //
     // manualEntriesToolStripMenuItem
     //
     this.manualEntriesToolStripMenuItem.Name = "manualEntriesToolStripMenuItem";
     resources.ApplyResources(this.manualEntriesToolStripMenuItem, "manualEntriesToolStripMenuItem");
     this.manualEntriesToolStripMenuItem.Click += new System.EventHandler(this.manualEntriesToolStripMenuItem_Click);
     //
     // standardToolStripMenuItem
     //
     this.standardToolStripMenuItem.Name = "standardToolStripMenuItem";
     resources.ApplyResources(this.standardToolStripMenuItem, "standardToolStripMenuItem");
     this.standardToolStripMenuItem.Click += new System.EventHandler(this.standardToolStripMenuItem_Click);
     //
     // toolStripSeparator2
     //
     this.toolStripSeparator2.Name = "toolStripSeparator2";
     resources.ApplyResources(this.toolStripSeparator2, "toolStripSeparator2");
     //
     // menuItemExportTransaction
     //
     resources.ApplyResources(this.menuItemExportTransaction, "menuItemExportTransaction");
     this.menuItemExportTransaction.Name   = "menuItemExportTransaction";
     this.menuItemExportTransaction.Click += new System.EventHandler(this.menuItemExportTransaction_Click);
     //
     // mnuNewclosure
     //
     this.mnuNewclosure.Name = "mnuNewclosure";
     resources.ApplyResources(this.mnuNewclosure, "mnuNewclosure");
     this.mnuNewclosure.Click += new System.EventHandler(this.newClosureToolStripMenuItem_Click_1);
     //
     // fiscalYearToolStripMenuItem
     //
     this.fiscalYearToolStripMenuItem.Name = "fiscalYearToolStripMenuItem";
     resources.ApplyResources(this.fiscalYearToolStripMenuItem, "fiscalYearToolStripMenuItem");
     this.fiscalYearToolStripMenuItem.Click += new System.EventHandler(this.fiscalYearToolStripMenuItem_Click);
     //
     // mnuConfiguration
     //
     this.mnuConfiguration.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
         this.branchesToolStripMenuItem,
         this.tellersToolStripMenuItem,
         this.toolStripSeparatorConfig1,
         this.mnuDomainOfApplication,
         this.loanPurposeToolStripMenuItem,
         this.menuItemLocations,
         this.toolStripMenuItemFundingLines,
         this.toolStripMenuItemInstallmentTypes,
         this.toolStripSeparatorConfig2,
         this.menuItemExchangeRate,
         this.currenciesToolStripMenuItem,
         this.toolStripSeparatorConfig3,
         this.miContractCode,
         this.collateralProductsToolStripMenuItem
     });
     this.mnuConfiguration.Name = "mnuConfiguration";
     resources.ApplyResources(this.mnuConfiguration, "mnuConfiguration");
     //
     // branchesToolStripMenuItem
     //
     this.branchesToolStripMenuItem.Name = "branchesToolStripMenuItem";
     resources.ApplyResources(this.branchesToolStripMenuItem, "branchesToolStripMenuItem");
     this.branchesToolStripMenuItem.Click += new System.EventHandler(this.branchesToolStripMenuItem_Click);
     //
     // tellersToolStripMenuItem
     //
     this.tellersToolStripMenuItem.Name = "tellersToolStripMenuItem";
     resources.ApplyResources(this.tellersToolStripMenuItem, "tellersToolStripMenuItem");
     this.tellersToolStripMenuItem.Click += new System.EventHandler(this.tellersToolStripMenuItem_Click);
     //
     // toolStripSeparatorConfig1
     //
     this.toolStripSeparatorConfig1.Name = "toolStripSeparatorConfig1";
     resources.ApplyResources(this.toolStripSeparatorConfig1, "toolStripSeparatorConfig1");
     //
     // mnuDomainOfApplication
     //
     resources.ApplyResources(this.mnuDomainOfApplication, "mnuDomainOfApplication");
     this.mnuDomainOfApplication.Name   = "mnuDomainOfApplication";
     this.mnuDomainOfApplication.Click += new System.EventHandler(this.mnuDomainOfApplication_Click);
     //
     // menuItemLocations
     //
     this.menuItemLocations.Name = "menuItemLocations";
     resources.ApplyResources(this.menuItemLocations, "menuItemLocations");
     this.menuItemLocations.Click += new System.EventHandler(this.menuItemLocations_Click);
     //
     // toolStripMenuItemFundingLines
     //
     this.toolStripMenuItemFundingLines.Name = "toolStripMenuItemFundingLines";
     resources.ApplyResources(this.toolStripMenuItemFundingLines, "toolStripMenuItemFundingLines");
     this.toolStripMenuItemFundingLines.Click += new System.EventHandler(this.toolStripMenuItemFundingLines_Click);
     //
     // toolStripMenuItemInstallmentTypes
     //
     this.toolStripMenuItemInstallmentTypes.Name = "toolStripMenuItemInstallmentTypes";
     resources.ApplyResources(this.toolStripMenuItemInstallmentTypes, "toolStripMenuItemInstallmentTypes");
     this.toolStripMenuItemInstallmentTypes.Click += new System.EventHandler(this.toolStripMenuItemInstallmentTypes_Click);
     //
     // toolStripSeparatorConfig2
     //
     this.toolStripSeparatorConfig2.Name = "toolStripSeparatorConfig2";
     resources.ApplyResources(this.toolStripSeparatorConfig2, "toolStripSeparatorConfig2");
     //
     // menuItemExchangeRate
     //
     resources.ApplyResources(this.menuItemExchangeRate, "menuItemExchangeRate");
     this.menuItemExchangeRate.Name   = "menuItemExchangeRate";
     this.menuItemExchangeRate.Click += new System.EventHandler(this.menuItemExchangeRate_Click);
     //
     // currenciesToolStripMenuItem
     //
     this.currenciesToolStripMenuItem.Image = global::OpenCBS.GUI.Properties.Resources.money;
     this.currenciesToolStripMenuItem.Name  = "currenciesToolStripMenuItem";
     resources.ApplyResources(this.currenciesToolStripMenuItem, "currenciesToolStripMenuItem");
     this.currenciesToolStripMenuItem.Click += new System.EventHandler(this.currenciesToolStripMenuItem_Click);
     //
     // toolStripSeparatorConfig3
     //
     this.toolStripSeparatorConfig3.Name = "toolStripSeparatorConfig3";
     resources.ApplyResources(this.toolStripSeparatorConfig3, "toolStripSeparatorConfig3");
     //
     // miContractCode
     //
     this.miContractCode.Name = "miContractCode";
     resources.ApplyResources(this.miContractCode, "miContractCode");
     this.miContractCode.Click += new System.EventHandler(this.miContractCode_Click);
     //
     // collateralProductsToolStripMenuItem
     //
     this.collateralProductsToolStripMenuItem.Name = "collateralProductsToolStripMenuItem";
     resources.ApplyResources(this.collateralProductsToolStripMenuItem, "collateralProductsToolStripMenuItem");
     this.collateralProductsToolStripMenuItem.Click += new System.EventHandler(this.collateralProductsToolStripMenuItem_Click);
     //
     // mnuWindow
     //
     this.mnuWindow.Name = "mnuWindow";
     resources.ApplyResources(this.mnuWindow, "mnuWindow");
     //
     // mnuHelp
     //
     this.mnuHelp.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
         this.userGuideToolStripMenuItem,
         this.contactMenuItem,
         this.aboutMenuItem,
         this.getHelpFromForumToolStripMenuItem,
         this.visitOpenCBScomToolStripMenuItem
     });
     this.mnuHelp.Name = "mnuHelp";
     resources.ApplyResources(this.mnuHelp, "mnuHelp");
     //
     // userGuideToolStripMenuItem
     //
     this.userGuideToolStripMenuItem.Name = "userGuideToolStripMenuItem";
     resources.ApplyResources(this.userGuideToolStripMenuItem, "userGuideToolStripMenuItem");
     this.userGuideToolStripMenuItem.Click += new System.EventHandler(this.OpenUserGuid);
     //
     // contactMenuItem
     //
     this.contactMenuItem.Name = "contactMenuItem";
     resources.ApplyResources(this.contactMenuItem, "contactMenuItem");
     this.contactMenuItem.Click += new System.EventHandler(this.contactMenuItem_Click);
     //
     // aboutMenuItem
     //
     this.aboutMenuItem.Name = "aboutMenuItem";
     resources.ApplyResources(this.aboutMenuItem, "aboutMenuItem");
     this.aboutMenuItem.Click += new System.EventHandler(this.OnAboutMenuItemClick);
     //
     // getHelpFromForumToolStripMenuItem
     //
     this.getHelpFromForumToolStripMenuItem.Name = "getHelpFromForumToolStripMenuItem";
     resources.ApplyResources(this.getHelpFromForumToolStripMenuItem, "getHelpFromForumToolStripMenuItem");
     this.getHelpFromForumToolStripMenuItem.Click += new System.EventHandler(this.getHelpFromForumToolStripMenuItem_Click);
     //
     // visitOpenCBScomToolStripMenuItem
     //
     this.visitOpenCBScomToolStripMenuItem.Name = "visitOpenCBScomToolStripMenuItem";
     resources.ApplyResources(this.visitOpenCBScomToolStripMenuItem, "visitOpenCBScomToolStripMenuItem");
     this.visitOpenCBScomToolStripMenuItem.Click += new System.EventHandler(this.visitOpenCBScomToolStripMenuItem_Click);
     //
     // mainMenu
     //
     this.mainMenu.BackColor = System.Drawing.SystemColors.Control;
     this.mainMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
         this.mnuSettings,
         this.mnuConfiguration,
         this.mnuSecurity,
         this.mnuProducts,
         this.mnuClients,
         this._viewItem,
         this._modulesMenuItem,
         this.mnuAccounting,
         this.reportsToolStripMenuItem,
         this.mnuWindow,
         this.mnuHelp
     });
     resources.ApplyResources(this.mainMenu, "mainMenu");
     this.mainMenu.MdiWindowListItem = this.mnuWindow;
     this.mainMenu.Name = "mainMenu";
     //
     // mnuSettings
     //
     this.mnuSettings.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
         this.menuItemSetting,
         this.menuItemDatabaseControlPanel,
         this.menuItemApplicationDate,
         this.languagesToolStripMenuItem
     });
     this.mnuSettings.Name = "mnuSettings";
     resources.ApplyResources(this.mnuSettings, "mnuSettings");
     //
     // menuItemSetting
     //
     this.menuItemSetting.Image = global::OpenCBS.GUI.Properties.Resources.cog;
     resources.ApplyResources(this.menuItemSetting, "menuItemSetting");
     this.menuItemSetting.Name   = "menuItemSetting";
     this.menuItemSetting.Click += new System.EventHandler(this.menuItemSetting_Click);
     //
     // menuItemDatabaseControlPanel
     //
     this.menuItemDatabaseControlPanel.Image = global::OpenCBS.GUI.Properties.Resources.database_gear;
     this.menuItemDatabaseControlPanel.Name  = "menuItemDatabaseControlPanel";
     resources.ApplyResources(this.menuItemDatabaseControlPanel, "menuItemDatabaseControlPanel");
     this.menuItemDatabaseControlPanel.Click += new System.EventHandler(this.menuItemBackupData_Click);
     //
     // menuItemApplicationDate
     //
     this.menuItemApplicationDate.Image = global::OpenCBS.GUI.Properties.Resources.calendar;
     resources.ApplyResources(this.menuItemApplicationDate, "menuItemApplicationDate");
     this.menuItemApplicationDate.Name   = "menuItemApplicationDate";
     this.menuItemApplicationDate.Click += new System.EventHandler(this.OnChangeApplicationDateClick);
     //
     // languagesToolStripMenuItem
     //
     this.languagesToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
         this.frenchToolStripMenuItem,
         this.englishToolStripMenuItem,
         this.russianToolStripMenuItem,
         this.spanishToolStripMenuItem,
         this.portugueseToolStripMenuItem
     });
     this.languagesToolStripMenuItem.Name = "languagesToolStripMenuItem";
     resources.ApplyResources(this.languagesToolStripMenuItem, "languagesToolStripMenuItem");
     //
     // frenchToolStripMenuItem
     //
     this.frenchToolStripMenuItem.Image = global::OpenCBS.GUI.Properties.Resources.fr;
     resources.ApplyResources(this.frenchToolStripMenuItem, "frenchToolStripMenuItem");
     this.frenchToolStripMenuItem.Name   = "frenchToolStripMenuItem";
     this.frenchToolStripMenuItem.Tag    = "fr";
     this.frenchToolStripMenuItem.Click += new System.EventHandler(this.LanguageToolStripMenuItem_Click);
     //
     // englishToolStripMenuItem
     //
     this.englishToolStripMenuItem.Image = global::OpenCBS.GUI.Properties.Resources.gb;
     resources.ApplyResources(this.englishToolStripMenuItem, "englishToolStripMenuItem");
     this.englishToolStripMenuItem.Name   = "englishToolStripMenuItem";
     this.englishToolStripMenuItem.Tag    = "en-US";
     this.englishToolStripMenuItem.Click += new System.EventHandler(this.LanguageToolStripMenuItem_Click);
     //
     // russianToolStripMenuItem
     //
     this.russianToolStripMenuItem.Image = global::OpenCBS.GUI.Properties.Resources.ru;
     resources.ApplyResources(this.russianToolStripMenuItem, "russianToolStripMenuItem");
     this.russianToolStripMenuItem.Name   = "russianToolStripMenuItem";
     this.russianToolStripMenuItem.Tag    = "ru-RU";
     this.russianToolStripMenuItem.Click += new System.EventHandler(this.LanguageToolStripMenuItem_Click);
     //
     // spanishToolStripMenuItem
     //
     this.spanishToolStripMenuItem.Image = global::OpenCBS.GUI.Properties.Resources.es;
     resources.ApplyResources(this.spanishToolStripMenuItem, "spanishToolStripMenuItem");
     this.spanishToolStripMenuItem.Name   = "spanishToolStripMenuItem";
     this.spanishToolStripMenuItem.Tag    = "es-ES";
     this.spanishToolStripMenuItem.Click += new System.EventHandler(this.LanguageToolStripMenuItem_Click);
     //
     // portugueseToolStripMenuItem
     //
     this.portugueseToolStripMenuItem.Image = global::OpenCBS.GUI.Properties.Resources.pt;
     resources.ApplyResources(this.portugueseToolStripMenuItem, "portugueseToolStripMenuItem");
     this.portugueseToolStripMenuItem.Name   = "portugueseToolStripMenuItem";
     this.portugueseToolStripMenuItem.Click += new System.EventHandler(this.LanguageToolStripMenuItem_Click);
     //
     // mnuSecurity
     //
     this.mnuSecurity.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
         this.rolesToolStripMenuItem,
         this.menuItemAddUser,
         this.miAuditTrail,
         this.changePasswordToolStripMenuItem
     });
     this.mnuSecurity.Name = "mnuSecurity";
     resources.ApplyResources(this.mnuSecurity, "mnuSecurity");
     //
     // rolesToolStripMenuItem
     //
     this.rolesToolStripMenuItem.Name = "rolesToolStripMenuItem";
     resources.ApplyResources(this.rolesToolStripMenuItem, "rolesToolStripMenuItem");
     this.rolesToolStripMenuItem.Click += new System.EventHandler(this.rolesToolStripMenuItem_Click);
     //
     // menuItemAddUser
     //
     this.menuItemAddUser.Image = global::OpenCBS.GUI.Properties.Resources.group;
     resources.ApplyResources(this.menuItemAddUser, "menuItemAddUser");
     this.menuItemAddUser.Name   = "menuItemAddUser";
     this.menuItemAddUser.Click += new System.EventHandler(this.menuItemAddUser_Click);
     //
     // miAuditTrail
     //
     this.miAuditTrail.Name = "miAuditTrail";
     resources.ApplyResources(this.miAuditTrail, "miAuditTrail");
     this.miAuditTrail.Click += new System.EventHandler(this.eventsToolStripMenuItem_Click);
     //
     // changePasswordToolStripMenuItem
     //
     this.changePasswordToolStripMenuItem.Name = "changePasswordToolStripMenuItem";
     resources.ApplyResources(this.changePasswordToolStripMenuItem, "changePasswordToolStripMenuItem");
     this.changePasswordToolStripMenuItem.Click += new System.EventHandler(this.changePasswordToolStripMenuItem_Click);
     //
     // mnuProducts
     //
     this.mnuProducts.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
         this.mnuPackages,
         this.savingProductsToolStripMenuItem
     });
     this.mnuProducts.Name = "mnuProducts";
     resources.ApplyResources(this.mnuProducts, "mnuProducts");
     //
     // mnuPackages
     //
     this.mnuPackages.Image = global::OpenCBS.GUI.Properties.Resources.package;
     resources.ApplyResources(this.mnuPackages, "mnuPackages");
     this.mnuPackages.Name   = "mnuPackages";
     this.mnuPackages.Click += new System.EventHandler(this.menuItemPackages_Click);
     //
     // savingProductsToolStripMenuItem
     //
     this.savingProductsToolStripMenuItem.Image = global::OpenCBS.GUI.Properties.Resources.package;
     this.savingProductsToolStripMenuItem.Name  = "savingProductsToolStripMenuItem";
     resources.ApplyResources(this.savingProductsToolStripMenuItem, "savingProductsToolStripMenuItem");
     this.savingProductsToolStripMenuItem.Click += new System.EventHandler(this.savingProductsToolStripMenuItem_Click);
     //
     // _viewItem
     //
     this._viewItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
         this._startPageItem,
         this._alertsItem,
         this._dashboardItem
     });
     this._viewItem.Name = "_viewItem";
     resources.ApplyResources(this._viewItem, "_viewItem");
     //
     // _startPageItem
     //
     this._startPageItem.Name = "_startPageItem";
     resources.ApplyResources(this._startPageItem, "_startPageItem");
     //
     // _alertsItem
     //
     this._alertsItem.Name = "_alertsItem";
     resources.ApplyResources(this._alertsItem, "_alertsItem");
     //
     // _dashboardItem
     //
     this._dashboardItem.Name = "_dashboardItem";
     resources.ApplyResources(this._dashboardItem, "_dashboardItem");
     //
     // _modulesMenuItem
     //
     this._modulesMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
         this._aboutModulesMenuItem
     });
     this._modulesMenuItem.Name = "_modulesMenuItem";
     resources.ApplyResources(this._modulesMenuItem, "_modulesMenuItem");
     //
     // _aboutModulesMenuItem
     //
     this._aboutModulesMenuItem.Name = "_aboutModulesMenuItem";
     resources.ApplyResources(this._aboutModulesMenuItem, "_aboutModulesMenuItem");
     this._aboutModulesMenuItem.Click += new System.EventHandler(this._aboutModulesMenuItem_Click);
     //
     // reportsToolStripMenuItem
     //
     this.reportsToolStripMenuItem.Name = "reportsToolStripMenuItem";
     resources.ApplyResources(this.reportsToolStripMenuItem, "reportsToolStripMenuItem");
     //
     // mainStatusBar
     //
     resources.ApplyResources(this.mainStatusBar, "mainStatusBar");
     this.mainStatusBar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
         this.mainStatusBarLblUpdateVersion,
         this.mainStatusBarLblUserName,
         this.mainStatusBarLblDate,
         this.toolStripStatusLblBranchCode,
         this.toolStripStatusLblDB
     });
     this.mainStatusBar.Name             = "mainStatusBar";
     this.mainStatusBar.RenderMode       = System.Windows.Forms.ToolStripRenderMode.ManagerRenderMode;
     this.mainStatusBar.ShowItemToolTips = true;
     this.mainStatusBar.SizingGrip       = false;
     //
     // mainStatusBarLblUpdateVersion
     //
     resources.ApplyResources(this.mainStatusBarLblUpdateVersion, "mainStatusBarLblUpdateVersion");
     this.mainStatusBarLblUpdateVersion.Name   = "mainStatusBarLblUpdateVersion";
     this.mainStatusBarLblUpdateVersion.Spring = true;
     //
     // mainStatusBarLblUserName
     //
     this.mainStatusBarLblUserName.BorderSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)((((System.Windows.Forms.ToolStripStatusLabelBorderSides.Left | System.Windows.Forms.ToolStripStatusLabelBorderSides.Top)
                                                                                                           | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right)
                                                                                                          | System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom)));
     this.mainStatusBarLblUserName.BorderStyle = System.Windows.Forms.Border3DStyle.SunkenOuter;
     this.mainStatusBarLblUserName.Image       = global::OpenCBS.GUI.Properties.Resources.user_gray;
     this.mainStatusBarLblUserName.Name        = "mainStatusBarLblUserName";
     resources.ApplyResources(this.mainStatusBarLblUserName, "mainStatusBarLblUserName");
     //
     // mainStatusBarLblDate
     //
     this.mainStatusBarLblDate.BorderSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)((((System.Windows.Forms.ToolStripStatusLabelBorderSides.Left | System.Windows.Forms.ToolStripStatusLabelBorderSides.Top)
                                                                                                       | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right)
                                                                                                      | System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom)));
     this.mainStatusBarLblDate.BorderStyle = System.Windows.Forms.Border3DStyle.SunkenOuter;
     this.mainStatusBarLblDate.Image       = global::OpenCBS.GUI.Properties.Resources.calendar;
     this.mainStatusBarLblDate.Name        = "mainStatusBarLblDate";
     resources.ApplyResources(this.mainStatusBarLblDate, "mainStatusBarLblDate");
     //
     // toolStripStatusLblBranchCode
     //
     this.toolStripStatusLblBranchCode.BorderSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)((((System.Windows.Forms.ToolStripStatusLabelBorderSides.Left | System.Windows.Forms.ToolStripStatusLabelBorderSides.Top)
                                                                                                               | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right)
                                                                                                              | System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom)));
     this.toolStripStatusLblBranchCode.BorderStyle = System.Windows.Forms.Border3DStyle.SunkenOuter;
     this.toolStripStatusLblBranchCode.Name        = "toolStripStatusLblBranchCode";
     resources.ApplyResources(this.toolStripStatusLblBranchCode, "toolStripStatusLblBranchCode");
     //
     // toolStripStatusLblDB
     //
     this.toolStripStatusLblDB.BorderSides = ((System.Windows.Forms.ToolStripStatusLabelBorderSides)((((System.Windows.Forms.ToolStripStatusLabelBorderSides.Left | System.Windows.Forms.ToolStripStatusLabelBorderSides.Top)
                                                                                                       | System.Windows.Forms.ToolStripStatusLabelBorderSides.Right)
                                                                                                      | System.Windows.Forms.ToolStripStatusLabelBorderSides.Bottom)));
     this.toolStripStatusLblDB.BorderStyle = System.Windows.Forms.Border3DStyle.SunkenOuter;
     this.toolStripStatusLblDB.Image       = global::OpenCBS.GUI.Properties.Resources.database;
     this.toolStripStatusLblDB.Name        = "toolStripStatusLblDB";
     resources.ApplyResources(this.toolStripStatusLblDB, "toolStripStatusLblDB");
     //
     // loanPurposeToolStripMenuItem
     //
     this.loanPurposeToolStripMenuItem.Name = "loanPurposeToolStripMenuItem";
     resources.ApplyResources(this.loanPurposeToolStripMenuItem, "loanPurposeToolStripMenuItem");
     this.loanPurposeToolStripMenuItem.Click += new System.EventHandler(this.loanPurposeToolStripMenuItem_Click);
     //
     // MainView
     //
     resources.ApplyResources(this, "$this");
     this.Controls.Add(this.mainStatusBar);
     this.Controls.Add(this.mainMenu);
     this.IsMdiContainer = true;
     this.MainMenuStrip  = this.mainMenu;
     this.Name           = "MainView";
     this.WindowState    = System.Windows.Forms.FormWindowState.Maximized;
     this.FormClosing   += new System.Windows.Forms.FormClosingEventHandler(this.LotrasmicMainWindowForm_FormClosing);
     this.Load          += new System.EventHandler(this.LotrasmicMainWindowForm_Load);
     this.mainMenu.ResumeLayout(false);
     this.mainMenu.PerformLayout();
     this.mainStatusBar.ResumeLayout(false);
     this.mainStatusBar.PerformLayout();
     this.ResumeLayout(false);
     this.PerformLayout();
 }
        /// <summary>
        /// Creates a new palette.
        /// </summary>
        /// <param name="palette">The palette.</param>
        /// <param name="paletteMode">The palette mode.</param>
        /// <param name="baseColour">The base colour.</param>
        /// <param name="darkColour">The dark colour.</param>
        /// <param name="middleColour">The middle colour.</param>
        /// <param name="lightColour">The light colour.</param>
        /// <param name="lightestColour">The lightest colour.</param>
        /// <param name="borderColourPreview">The border colour preview.</param>
        /// <param name="alternativeNormalTextColourPreview">The alternative normal text colour preview.</param>
        /// <param name="normalTextColourPreview">The normal text colour preview.</param>
        /// <param name="disabledTextColourPreview">The disabled text colour preview.</param>
        /// <param name="focusedTextColourPreview">The focused text colour preview.</param>
        /// <param name="pressedTextColourPreview">The pressed text colour preview.</param>
        /// <param name="disabledControlColourPreview">The disabled colour preview.</param>
        /// <param name="linkNormalColourPreview">The link normal colour preview.</param>
        /// <param name="linkHoverColourPreview">The link hover colour preview.</param>
        /// <param name="linkVisitedColourPreview">The link visited colour preview.</param>
        /// <param name="customColourOne">The custom colour one.</param>
        /// <param name="customColourTwo">The custom colour two.</param>
        /// <param name="customColourThree">The custom colour three.</param>
        /// <param name="customColourFour">The custom colour four.</param>
        /// <param name="customColourFive">The custom colour five.</param>
        /// <param name="customTextColourOne">The custom text colour one.</param>
        /// <param name="customTextColourTwo">The custom text colour two.</param>
        /// <param name="customTextColourThree">The custom text colour three.</param>
        /// <param name="customTextColourFour">The custom text colour four.</param>
        /// <param name="customTextColourFive">The custom text colour five.</param>
        /// <param name="menuTextColour">The menu text colour.</param>
        /// <param name="statusTextColour">The status text colour.</param>
        /// <param name="ribbonTabTextColour">The ribbon tab text colour.</param>
        /// <param name="statusState">State of the status.</param>
        /// <param name="invertColours">if set to <c>true</c> [invert colours].</param>
        public static void CreatePalette(KryptonPalette palette, PaletteMode paletteMode, Color baseColour, Color darkColour, Color middleColour, Color lightColour, Color lightestColour, Color borderColourPreview, Color alternativeNormalTextColourPreview, Color normalTextColourPreview, Color disabledTextColourPreview, Color focusedTextColourPreview, Color pressedTextColourPreview, Color disabledControlColourPreview, Color linkDisabledColourPreview, Color linkFocusedColour, Color linkNormalColourPreview, Color linkHoverColourPreview, Color linkVisitedColourPreview, Color customColourOne, Color customColourTwo, Color customColourThree, Color customColourFour, Color customColourFive, Color customTextColourOne, Color customTextColourTwo, Color customTextColourThree, Color customTextColourFour, Color customTextColourFive, Color menuTextColour, Color statusTextColour, Color ribbonTabTextColour, ToolStripLabel statusState = null, bool invertColours = false)
        {
            palette = new KryptonPalette();

            try
            {
                palette.BasePaletteMode = paletteMode;

                if (lightestColour == Color.Transparent)
                {
                    lightestColour = lightColour;
                }

                if (invertColours)
                {
                    #region Button Cluster
                    palette.ButtonStyles.ButtonCluster.OverrideDefault.Back.Color1 = darkColour;

                    palette.ButtonStyles.ButtonCluster.OverrideFocus.Back.Color1 = darkColour;

                    palette.ButtonStyles.ButtonCluster.StateCheckedNormal.Back.Color1 = darkColour;

                    palette.ButtonStyles.ButtonCluster.StateCommon.Back.ColorStyle = PaletteColorStyle.GlassNormalFull;

                    palette.ButtonStyles.ButtonCluster.StateNormal.Back.Color1 = middleColour;

                    palette.ButtonStyles.ButtonCluster.StatePressed.Back.Color1 = baseColour;

                    palette.ButtonStyles.ButtonCluster.StateTracking.Back.Color1 = darkColour;
                    #endregion

                    #region Button Common
                    palette.ButtonStyles.ButtonCommon.OverrideDefault.Back.Color1 = lightColour;

                    palette.ButtonStyles.ButtonCommon.OverrideDefault.Content.LongText.Color1 = normalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.OverrideDefault.Content.ShortText.Color1 = normalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateCheckedNormal.Back.Color1 = darkColour;

                    palette.ButtonStyles.ButtonCommon.StateCheckedNormal.Back.Color2 = baseColour;

                    palette.ButtonStyles.ButtonCommon.StateCheckedNormal.Back.ColorStyle = PaletteColorStyle.GlassCheckedFull;

                    palette.ButtonStyles.ButtonCommon.StateCheckedNormal.Content.LongText.Color1 = alternativeNormalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateCheckedNormal.Content.ShortText.Color1 = alternativeNormalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Back.Color1 = darkColour;

                    palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Back.Color2 = baseColour;

                    palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Back.ColorStyle = PaletteColorStyle.GlassCheckedStump;

                    palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Border.DrawBorders = PaletteDrawBorders.All;

                    palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Content.LongText.Color1 = alternativeNormalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Content.ShortText.Color1 = alternativeNormalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateCheckedTracking.Back.Color1 = baseColour;

                    palette.ButtonStyles.ButtonCommon.StateCheckedTracking.Back.Color2 = baseColour;

                    palette.ButtonStyles.ButtonCommon.StateCheckedTracking.Border.DrawBorders = PaletteDrawBorders.All;

                    palette.ButtonStyles.ButtonCommon.StateCheckedTracking.Content.LongText.Color1 = alternativeNormalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateCheckedTracking.Content.ShortText.Color1 = alternativeNormalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateCommon.Back.Color1 = lightColour;

                    palette.ButtonStyles.ButtonCommon.StateDisabled.Back.Color1 = disabledControlColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateDisabled.Back.Color2 = disabledControlColourPreview;

                    /*
                     * palette.ButtonStyles.ButtonCommon.StateDisabled.Back.Color1 = lightColour;
                     *
                     * palette.ButtonStyles.ButtonCommon.StateDisabled.Back.Color2 = lightColour;
                     */

                    palette.ButtonStyles.ButtonCommon.StateDisabled.Content.LongText.Color1 = disabledTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateDisabled.Content.ShortText.Color1 = disabledTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateNormal.Back.Color1 = lightColour;

                    palette.ButtonStyles.ButtonCommon.StateNormal.Back.Color2 = lightColour;

                    palette.ButtonStyles.ButtonCommon.StateNormal.Content.LongText.Color1 = normalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateNormal.Content.LongText.Color2 = normalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateNormal.Content.ShortText.Color1 = normalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateNormal.Content.ShortText.Color2 = normalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StatePressed.Back.Color1 = darkColour;

                    palette.ButtonStyles.ButtonCommon.StatePressed.Back.Color2 = baseColour;

                    palette.ButtonStyles.ButtonCommon.StatePressed.Content.LongText.Color1 = alternativeNormalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StatePressed.Content.ShortText.Color1 = alternativeNormalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateTracking.Back.Color1 = lightColour;

                    palette.ButtonStyles.ButtonCommon.StateTracking.Back.Color2 = lightestColour;

                    palette.ButtonStyles.ButtonCommon.StateTracking.Content.LongText.Color1 = normalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateTracking.Content.ShortText.Color1 = normalTextColourPreview;
                    #endregion

                    #region Common
                    palette.Common.StateCommon.Back.Color1 = darkColour;

                    palette.Common.StateCommon.Back.Color2 = middleColour;

                    palette.Common.StateCommon.Border.Color1 = middleColour;

                    palette.Common.StateCommon.Border.Color2 = lightestColour;

                    palette.Common.StateCommon.Border.DrawBorders = PaletteDrawBorders.All;

                    palette.Common.StateCommon.Content.LongText.Color1 = normalTextColourPreview;

                    palette.Common.StateCommon.Content.LongText.Color2 = normalTextColourPreview;

                    palette.Common.StateCommon.Content.ShortText.Color1 = normalTextColourPreview;

                    palette.Common.StateCommon.Content.ShortText.Color2 = normalTextColourPreview;
                    #endregion

                    #region Form Styles
                    palette.FormStyles.FormCommon.StateActive.Back.Color1 = middleColour;

                    palette.FormStyles.FormCommon.StateActive.Border.DrawBorders = PaletteDrawBorders.All;
                    #endregion

                    #region Grid Styles
                    palette.GridStyles.GridSheet.StateCommon.HeaderColumn.Content.Color1 = darkColour;

                    palette.GridStyles.GridSheet.StateCommon.HeaderRow.Content.Color1 = darkColour;

                    palette.GridStyles.GridSheet.StateNormal.HeaderColumn.Content.Color1 = lightestColour;

                    palette.GridStyles.GridSheet.StateNormal.HeaderColumn.Content.Color2 = baseColour;

                    palette.GridStyles.GridSheet.StateNormal.HeaderRow.Content.Color1 = lightestColour;

                    palette.GridStyles.GridSheet.StateTracking.HeaderColumn.Content.Color1 = middleColour;
                    #endregion
                }
                else
                {
                    #region Button Cluster
                    palette.ButtonStyles.ButtonCluster.OverrideDefault.Back.Color1 = baseColour;

                    palette.ButtonStyles.ButtonCluster.OverrideFocus.Back.Color1 = baseColour;

                    palette.ButtonStyles.ButtonCluster.StateCheckedNormal.Back.Color1 = baseColour;

                    palette.ButtonStyles.ButtonCluster.StateCommon.Back.ColorStyle = PaletteColorStyle.GlassNormalFull;

                    palette.ButtonStyles.ButtonCluster.StateNormal.Back.Color1 = middleColour;

                    palette.ButtonStyles.ButtonCluster.StatePressed.Back.Color1 = darkColour;

                    palette.ButtonStyles.ButtonCluster.StateTracking.Back.Color1 = baseColour;
                    #endregion

                    #region Button Common
                    palette.ButtonStyles.ButtonCommon.OverrideDefault.Back.Color1 = baseColour;

                    palette.ButtonStyles.ButtonCommon.OverrideDefault.Content.LongText.Color1 = alternativeNormalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.OverrideDefault.Content.ShortText.Color1 = alternativeNormalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateCheckedNormal.Back.Color1 = lightestColour;

                    palette.ButtonStyles.ButtonCommon.StateCheckedNormal.Back.Color2 = lightColour;

                    palette.ButtonStyles.ButtonCommon.StateCheckedNormal.Back.ColorStyle = PaletteColorStyle.GlassCheckedFull;

                    palette.ButtonStyles.ButtonCommon.StateCheckedNormal.Content.LongText.Color1 = normalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateCheckedNormal.Content.ShortText.Color1 = normalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Back.Color1 = lightestColour;

                    palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Back.Color2 = lightColour;

                    palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Back.ColorStyle = PaletteColorStyle.GlassCheckedStump;

                    palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Border.DrawBorders = PaletteDrawBorders.All;

                    palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Content.LongText.Color1 = normalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateCheckedPressed.Content.ShortText.Color1 = normalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateCheckedTracking.Back.Color1 = lightestColour;

                    palette.ButtonStyles.ButtonCommon.StateCheckedTracking.Back.Color2 = lightColour;

                    palette.ButtonStyles.ButtonCommon.StateCheckedTracking.Border.DrawBorders = PaletteDrawBorders.All;

                    palette.ButtonStyles.ButtonCommon.StateCheckedTracking.Content.LongText.Color1 = normalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateCheckedTracking.Content.ShortText.Color1 = normalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateCommon.Back.Color1 = baseColour;

                    palette.ButtonStyles.ButtonCommon.StateDisabled.Back.Color1 = disabledControlColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateDisabled.Back.Color2 = disabledControlColourPreview;

                    /*
                     * palette.ButtonStyles.ButtonCommon.StateDisabled.Back.Color1 = baseColour;
                     *
                     * palette.ButtonStyles.ButtonCommon.StateDisabled.Back.Color2 = baseColour;
                     */

                    palette.ButtonStyles.ButtonCommon.StateDisabled.Content.LongText.Color1 = disabledTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateDisabled.Content.ShortText.Color1 = disabledTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateNormal.Back.Color1 = baseColour;

                    palette.ButtonStyles.ButtonCommon.StateNormal.Back.Color2 = baseColour;

                    palette.ButtonStyles.ButtonCommon.StateNormal.Content.LongText.Color1 = alternativeNormalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateNormal.Content.LongText.Color2 = alternativeNormalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateNormal.Content.ShortText.Color1 = alternativeNormalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateNormal.Content.ShortText.Color2 = alternativeNormalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StatePressed.Back.Color1 = lightestColour;

                    palette.ButtonStyles.ButtonCommon.StatePressed.Back.Color2 = lightColour;

                    palette.ButtonStyles.ButtonCommon.StatePressed.Content.LongText.Color1 = normalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StatePressed.Content.ShortText.Color1 = normalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateTracking.Back.Color1 = baseColour;

                    palette.ButtonStyles.ButtonCommon.StateTracking.Back.Color2 = darkColour;

                    palette.ButtonStyles.ButtonCommon.StateTracking.Content.LongText.Color1 = alternativeNormalTextColourPreview;

                    palette.ButtonStyles.ButtonCommon.StateTracking.Content.ShortText.Color1 = alternativeNormalTextColourPreview;
                    #endregion

                    #region Common
                    palette.Common.StateCommon.Back.Color1 = lightestColour;

                    palette.Common.StateCommon.Back.Color2 = baseColour;

                    palette.Common.StateCommon.Border.Color1 = baseColour;

                    palette.Common.StateCommon.Border.Color2 = darkColour;

                    palette.Common.StateCommon.Border.DrawBorders = PaletteDrawBorders.All;

                    palette.Common.StateCommon.Content.LongText.Color1 = alternativeNormalTextColourPreview;

                    palette.Common.StateCommon.Content.LongText.Color2 = alternativeNormalTextColourPreview;

                    palette.Common.StateCommon.Content.ShortText.Color1 = alternativeNormalTextColourPreview;

                    palette.Common.StateCommon.Content.ShortText.Color2 = alternativeNormalTextColourPreview;
                    #endregion

                    #region Form Styles
                    palette.FormStyles.FormCommon.StateActive.Back.Color1 = baseColour;

                    palette.FormStyles.FormCommon.StateActive.Border.DrawBorders = PaletteDrawBorders.All;
                    #endregion

                    #region Grid Styles
                    palette.GridStyles.GridSheet.StateCommon.HeaderColumn.Content.Color1 = lightestColour;

                    palette.GridStyles.GridSheet.StateCommon.HeaderRow.Content.Color1 = lightestColour;

                    palette.GridStyles.GridSheet.StateNormal.HeaderColumn.Content.Color1 = darkColour;

                    palette.GridStyles.GridSheet.StateNormal.HeaderColumn.Content.Color2 = middleColour;

                    palette.GridStyles.GridSheet.StateNormal.HeaderRow.Content.Color1 = darkColour;

                    palette.GridStyles.GridSheet.StateTracking.HeaderColumn.Content.Color1 = baseColour;
                    #endregion

                    #region Header Styles
                    palette.HeaderStyles.HeaderCommon.StateCommon.Back.Color1 = middleColour;

                    palette.HeaderStyles.HeaderCommon.StateCommon.Back.Color2 = lightColour;

                    palette.HeaderStyles.HeaderCommon.StateDisabled.Back.Color1 = lightColour;

                    palette.HeaderStyles.HeaderCommon.StateDisabled.Back.Color2 = lightestColour;

                    palette.HeaderStyles.HeaderCommon.StateDisabled.Content.LongText.Color1 = disabledTextColourPreview;

                    palette.HeaderStyles.HeaderCommon.StateDisabled.Content.LongText.Color2 = baseColour;

                    palette.HeaderStyles.HeaderCommon.StateDisabled.Content.ShortText.Color1 = disabledTextColourPreview;

                    palette.HeaderStyles.HeaderCommon.StateDisabled.Content.ShortText.Color2 = baseColour;

                    palette.HeaderStyles.HeaderForm.StateCommon.Back.Color1 = middleColour;

                    palette.HeaderStyles.HeaderForm.StateCommon.Back.Color2 = lightColour;

                    palette.HeaderStyles.HeaderForm.StateDisabled.Back.Color1 = disabledControlColourPreview;

                    palette.HeaderStyles.HeaderForm.StateDisabled.Back.Color2 = baseColour;

                    palette.HeaderStyles.HeaderForm.StateDisabled.Content.LongText.Color1 = disabledTextColourPreview;

                    palette.HeaderStyles.HeaderForm.StateDisabled.Content.ShortText.Color1 = disabledTextColourPreview;
                    #endregion

                    #region Label Styles
                    palette.LabelStyles.LabelNormalControl.OverrideNotVisited.LongText.Color1 = linkNormalColourPreview;

                    palette.LabelStyles.LabelNormalControl.OverrideNotVisited.ShortText.Color1 = linkNormalColourPreview;

                    palette.LabelStyles.LabelNormalControl.OverridePressed.LongText.Color1 = linkHoverColourPreview;

                    palette.LabelStyles.LabelNormalControl.OverridePressed.ShortText.Color1 = linkHoverColourPreview;

                    palette.LabelStyles.LabelNormalControl.OverrideVisited.LongText.Color1 = linkVisitedColourPreview;

                    palette.LabelStyles.LabelNormalControl.OverrideVisited.ShortText.Color1 = linkVisitedColourPreview;

                    palette.LabelStyles.LabelNormalControl.StateDisabled.LongText.Color1 = linkDisabledColourPreview;

                    palette.LabelStyles.LabelNormalControl.StateDisabled.ShortText.Color1 = linkDisabledColourPreview;

                    palette.LabelStyles.LabelNormalControl.StateNormal.LongText.Color1 = normalTextColourPreview;

                    palette.LabelStyles.LabelNormalControl.StateNormal.ShortText.Color1 = normalTextColourPreview;

                    palette.LabelStyles.LabelNormalControl.OverrideFocus.LongText.Color1 = linkFocusedColour;

                    palette.LabelStyles.LabelNormalControl.OverrideFocus.ShortText.Color1 = linkFocusedColour;
                    #endregion

                    #region Ribbon
                    palette.Ribbon.RibbonAppButton.StateCommon.BackColor2 = baseColour;

                    palette.Ribbon.RibbonAppButton.StateCommon.BackColor3 = customColourThree;

                    palette.Ribbon.RibbonAppButton.StateCommon.BackColor5 = baseColour;

                    palette.Ribbon.RibbonAppButton.StatePressed.BackColor5 = darkColour;

                    palette.Ribbon.RibbonAppButton.StateTracking.BackColor5 = customColourFive;

                    palette.Ribbon.RibbonGroupArea.StateCheckedNormal.BackColor1 = baseColour;

                    palette.Ribbon.RibbonGroupArea.StateCheckedNormal.BackColor2 = customColourTwo;

                    palette.Ribbon.RibbonGroupArea.StateCheckedNormal.BackColor3 = baseColour;

                    palette.Ribbon.RibbonGroupArea.StateCheckedNormal.BackColor4 = baseColour;

                    palette.Ribbon.RibbonGroupArea.StateCheckedNormal.BackColor5 = baseColour;

                    palette.Ribbon.RibbonGroupButtonText.StateCommon.TextColor = customTextColourTwo;

                    palette.Ribbon.RibbonGroupCheckBoxText.StateCommon.TextColor = customTextColourTwo;

                    palette.Ribbon.RibbonGroupCollapsedBack.StateNormal.BackColor1 = SystemColors.Window;

                    palette.Ribbon.RibbonGroupCollapsedBack.StateNormal.BackColor2 = baseColour;

                    palette.Ribbon.RibbonGroupCollapsedBack.StateNormal.BackColor3 = lightColour;

                    palette.Ribbon.RibbonGroupCollapsedBack.StateNormal.BackColor4 = baseColour;

                    palette.Ribbon.RibbonGroupCollapsedBack.StateTracking.BackColor1 = SystemColors.Window;

                    palette.Ribbon.RibbonGroupCollapsedBack.StateTracking.BackColor2 = lightColour;

                    palette.Ribbon.RibbonGroupCollapsedBack.StateTracking.BackColor3 = lightestColour; // Or 230, 230, 230

                    palette.Ribbon.RibbonGroupCollapsedBack.StateTracking.BackColor4 = baseColour;

                    palette.Ribbon.RibbonGroupCollapsedBorder.StateCommon.BackColor1 = baseColour;

                    palette.Ribbon.RibbonGroupCollapsedBorder.StateCommon.BackColor2 = middleColour;

                    palette.Ribbon.RibbonGroupCollapsedBorder.StateCommon.BackColor3 = lightColour;

                    palette.Ribbon.RibbonGroupCollapsedBorder.StateCommon.BackColor4 = baseColour;

                    palette.Ribbon.RibbonGroupCollapsedBorder.StateCommon.BackColor5 = baseColour;

                    palette.Ribbon.RibbonGroupCollapsedFrameBack.StateCommon.BackColor1 = baseColour;

                    palette.Ribbon.RibbonGroupCollapsedFrameBack.StateCommon.BackColor2 = baseColour;

                    palette.Ribbon.RibbonGroupCollapsedFrameBack.StateCommon.BackColor3 = lightColour;

                    palette.Ribbon.RibbonGroupCollapsedFrameBack.StateCommon.BackColor4 = lightColour;

                    palette.Ribbon.RibbonGroupCollapsedFrameBack.StateCommon.BackColor5 = baseColour;

                    palette.Ribbon.RibbonGroupCollapsedFrameBorder.StateCommon.BackColor1 = lightColour;

                    palette.Ribbon.RibbonGroupCollapsedFrameBorder.StateCommon.BackColor2 = lightestColour; // Or 230, 230, 230

                    palette.Ribbon.RibbonGroupCollapsedText.StateCommon.TextColor = alternativeNormalTextColourPreview;

                    palette.Ribbon.RibbonGroupNormalBorder.StateCommon.BackColor1 = baseColour;

                    palette.Ribbon.RibbonGroupNormalBorder.StateCommon.BackColor2 = middleColour;

                    palette.Ribbon.RibbonGroupNormalTitle.StateCommon.BackColor1 = lightestColour; // Or 230, 230, 230

                    palette.Ribbon.RibbonGroupNormalTitle.StateCommon.BackColor2 = middleColour;

                    palette.Ribbon.RibbonGroupNormalTitle.StateCommon.TextColor = customTextColourFive;

                    palette.Ribbon.RibbonGroupNormalTitle.StateTracking.BackColor1 = lightestColour;

                    palette.Ribbon.RibbonGroupNormalTitle.StateTracking.BackColor2 = middleColour;

                    palette.Ribbon.RibbonQATFullbar.BackColor1 = middleColour;

                    palette.Ribbon.RibbonQATFullbar.BackColor2 = middleColour;

                    palette.Ribbon.RibbonQATFullbar.BackColor3 = middleColour;

                    palette.Ribbon.RibbonQATMinibar.StateCommon.BackColor1 = middleColour;

                    palette.Ribbon.RibbonQATMinibar.StateCommon.BackColor2 = middleColour;

                    palette.Ribbon.RibbonQATMinibar.StateCommon.BackColor3 = middleColour;

                    palette.Ribbon.RibbonQATMinibar.StateCommon.BackColor4 = middleColour;

                    palette.Ribbon.RibbonQATOverflow.BackColor1 = middleColour;

                    palette.Ribbon.RibbonQATOverflow.BackColor2 = middleColour;

                    palette.Ribbon.RibbonTab.StateCheckedTracking.BackColor1 = middleColour;

                    palette.Ribbon.RibbonTab.StateCheckedTracking.BackColor2 = lightColour;

                    palette.Ribbon.RibbonTab.StateCheckedTracking.BackColor3 = darkColour;

                    palette.Ribbon.RibbonTab.StateCheckedTracking.BackColor4 = middleColour;

                    palette.Ribbon.RibbonTab.StateCommon.BackColor1 = middleColour;

                    palette.Ribbon.RibbonTab.StateCommon.BackColor3 = middleColour;

                    palette.Ribbon.RibbonTab.StateCommon.BackColor4 = lightColour;

                    palette.Ribbon.RibbonTab.StateCommon.BackColor5 = lightColour;

                    palette.Ribbon.RibbonTab.StateCommon.TextColor = normalTextColourPreview;

                    palette.Ribbon.RibbonTab.StateContextCheckedTracking.BackColor2 = middleColour;

                    palette.Ribbon.RibbonTab.StateTracking.BackColor2 = middleColour;

                    palette.Ribbon.RibbonTab.StateCommon.TextColor = ribbonTabTextColour;
                    #endregion

                    #region Separator Styles
                    palette.SeparatorStyles.SeparatorCommon.StateCommon.Back.Color1 = baseColour;

                    palette.SeparatorStyles.SeparatorCommon.StateCommon.Back.Color2 = baseColour;

                    palette.SeparatorStyles.SeparatorCommon.StateCommon.Border.Color1 = baseColour;

                    palette.SeparatorStyles.SeparatorCommon.StateCommon.Border.Color1 = baseColour;

                    palette.SeparatorStyles.SeparatorCommon.StateCommon.Border.DrawBorders = PaletteDrawBorders.All;
                    #endregion

                    #region Tool Menu Status
                    palette.ToolMenuStatus.Button.ButtonPressedBorder = baseColour;

                    palette.ToolMenuStatus.Button.ButtonSelectedBorder = baseColour;

                    palette.ToolMenuStatus.Button.OverflowButtonGradientBegin = darkColour;

                    palette.ToolMenuStatus.Button.OverflowButtonGradientEnd = baseColour;

                    palette.ToolMenuStatus.Button.OverflowButtonGradientMiddle = middleColour;

                    palette.ToolMenuStatus.Grip.GripDark = baseColour;

                    palette.ToolMenuStatus.Grip.GripLight = customColourFive;

                    palette.ToolMenuStatus.Menu.ImageMarginGradientBegin = baseColour;

                    palette.ToolMenuStatus.Menu.ImageMarginGradientEnd = darkColour;

                    palette.ToolMenuStatus.Menu.ImageMarginGradientMiddle = middleColour;

                    palette.ToolMenuStatus.Menu.ImageMarginRevealedGradientBegin = baseColour;

                    palette.ToolMenuStatus.Menu.ImageMarginRevealedGradientEnd = darkColour;

                    palette.ToolMenuStatus.Menu.ImageMarginRevealedGradientMiddle = middleColour;

                    palette.ToolMenuStatus.Menu.MenuBorder = baseColour;

                    palette.ToolMenuStatus.Menu.MenuItemBorder = darkColour;

                    palette.ToolMenuStatus.Menu.MenuItemPressedGradientBegin = baseColour;

                    palette.ToolMenuStatus.Menu.MenuItemPressedGradientEnd = darkColour;

                    palette.ToolMenuStatus.Menu.MenuItemPressedGradientMiddle = middleColour;

                    palette.ToolMenuStatus.Menu.MenuItemSelected = middleColour;

                    palette.ToolMenuStatus.Menu.MenuItemSelectedGradientBegin = darkColour;

                    palette.ToolMenuStatus.Menu.MenuItemSelectedGradientEnd = baseColour;

                    palette.ToolMenuStatus.Menu.MenuItemText = menuTextColour;

                    palette.ToolMenuStatus.MenuStrip.MenuStripGradientBegin = baseColour;

                    palette.ToolMenuStatus.MenuStrip.MenuStripGradientEnd = darkColour;

                    palette.ToolMenuStatus.MenuStrip.MenuStripText = normalTextColourPreview;

                    palette.ToolMenuStatus.Rafting.RaftingContainerGradientBegin = middleColour;

                    palette.ToolMenuStatus.Rafting.RaftingContainerGradientEnd = darkColour;

                    palette.ToolMenuStatus.Separator.SeparatorDark = baseColour;

                    palette.ToolMenuStatus.Separator.SeparatorLight = lightColour;

                    palette.ToolMenuStatus.StatusStrip.StatusStripGradientBegin = baseColour;

                    palette.ToolMenuStatus.StatusStrip.StatusStripGradientEnd = lightColour;

                    palette.ToolMenuStatus.StatusStrip.StatusStripText = normalTextColourPreview;

                    palette.ToolMenuStatus.ToolStrip.ToolStripBorder = darkColour;

                    palette.ToolMenuStatus.ToolStrip.ToolStripContentPanelGradientBegin = lightColour;

                    palette.ToolMenuStatus.ToolStrip.ToolStripContentPanelGradientEnd = darkColour;

                    palette.ToolMenuStatus.ToolStrip.ToolStripDropDownBackground = middleColour;

                    palette.ToolMenuStatus.ToolStrip.ToolStripGradientBegin = darkColour;

                    palette.ToolMenuStatus.ToolStrip.ToolStripGradientEnd = lightColour;

                    palette.ToolMenuStatus.ToolStrip.ToolStripGradientMiddle = middleColour;

                    palette.ToolMenuStatus.ToolStrip.ToolStripPanelGradientBegin = lightColour;

                    palette.ToolMenuStatus.ToolStrip.ToolStripPanelGradientEnd = darkColour;

                    palette.ToolMenuStatus.ToolStrip.ToolStripText = normalTextColourPreview;
                    #endregion
                }

                palette.Export();

                statusState.Text = $"Palette exported to: { palette.GetCustomisedKryptonPaletteFilePath() }";
            }
            catch (Exception exc)
            {
                ExceptionHandler.CaptureException(exc, icon: MessageBoxIcon.Error, methodSignature: Helpers.GetCurrentMethod());
            }
        }
Example #30
0
        public FilterRevisionsHelper(ToolStripTextBox textBox, ToolStripDropDownButton dropDownButton, RevisionGrid revisionGrid, ToolStripLabel label, ToolStripButton showFirstParentButton, Form form)
            : this()
        {
            _NO_TRANSLATE_textBox               = textBox;
            _NO_TRANSLATE_revisionGrid          = revisionGrid;
            _NO_TRANSLATE_showFirstParentButton = showFirstParentButton;
            _NO_TRANSLATE_form = form;

            dropDownButton.DropDownItems.AddRange(new ToolStripItem[]
            {
                _commitToolStripMenuItem,
                _committerToolStripMenuItem,
                _authorToolStripMenuItem,
                _diffContainsToolStripMenuItem
            });

            _NO_TRANSLATE_showFirstParentButton.Checked = AppSettings.ShowFirstParent;

            label.Click += ToolStripLabelClick;
            _NO_TRANSLATE_textBox.Leave                        += ToolStripTextBoxFilterLeave;
            _NO_TRANSLATE_textBox.KeyPress                     += ToolStripTextBoxFilterKeyPress;
            _NO_TRANSLATE_showFirstParentButton.Click          += ToolStripShowFirstParentButtonClick;
            _NO_TRANSLATE_revisionGrid.ShowFirstParentsToggled += RevisionGridShowFirstParentsToggled;
        }
 /// <summary>
 /// Shows the exception.
 /// </summary>
 /// <param name="exceptionMessage">The exception message.</param>
 /// <param name="useKryptonMessageBox">if set to <c>true</c> [use krypton message box].</param>
 /// <param name="useExtendedKryptonMessageBox">if set to <c>true</c> [use extended krypton message box].</param>
 /// <param name="useWin32MessageBox">if set to <c>true</c> [use win32 message box].</param>
 /// <param name="useConsole">if set to <c>true</c> [use console].</param>
 /// <param name="useToolStripLabel">if set to <c>true</c> [use tool strip label].</param>
 /// <param name="toolStripLabel">The tool strip label.</param>
 /// <param name="args">The arguments.</param>
 /// <param name="caption">The caption.</param>
 /// <param name="buttons">The buttons.</param>
 /// <param name="defaultButton">The default button.</param>
 /// <param name="icon">The icon.</param>
 /// <param name="options">The options.</param>
 public void ShowException(string exceptionMessage, bool useKryptonMessageBox = false, bool useExtendedKryptonMessageBox = false, bool useWin32MessageBox = false, bool useConsole = false, bool useToolStripLabel = false, ToolStripLabel toolStripLabel = null, object args = null, string caption = "Exception Caught", MessageBoxButtons buttons = MessageBoxButtons.OK, MessageBoxDefaultButton defaultButton = MessageBoxDefaultButton.Button3, MessageBoxIcon icon = MessageBoxIcon.Exclamation, MessageBoxOptions options = MessageBoxOptions.DefaultDesktopOnly)
 {
     if (useKryptonMessageBox)
     {
         KryptonMessageBox.Show(exceptionMessage, caption, buttons, icon, defaultButton, options);
     }
     else if (useExtendedKryptonMessageBox)
     {
     }
     else if (useWin32MessageBox)
     {
         MessageBox.Show(exceptionMessage, caption, buttons, icon, defaultButton, options);
     }
     else if (useConsole)
     {
         Console.WriteLine($"[ { DateTime.Now.ToString() } ]: { exceptionMessage }");
     }
 }
        private static void TaskItemFill(this TaskItem item, TaskList list, ToolStrip actionPanel, ContextMenuStrip actionMenu, ToolStripMenuItem parent)
        {
            var method = item as MethodTaskItem;

            if (method != null)
            {
                if (method.Text == "-")
                {
                    actionPanel.Items.Add(new ToolStripSeparator());
                    if ((method.Usage & MethodTaskItemUsages.ContextMenu) == MethodTaskItemUsages.ContextMenu)
                    {
                        if (parent == null)
                        {
                            actionMenu.Items.Add(new ToolStripSeparator());
                        }
                        else
                        {
                            parent.DropDownItems.Add(new ToolStripSeparator());
                        }
                    }

                    return;
                }

                var result = new ToolStripButton(method.Text, method.Image ?? Resources.transparent_16,
                                                 (o, args) =>
                {
                    try
                    {
                        list.InvokeMethod(method.MethodName, method.UserData);
                    }
                    catch (TargetInvocationException ex)
                    {
                        if (ex.InnerException is UnauthorizedAccessException)
                        {
                            MessageBox.Show($"{ex.InnerException.Message}. Running Jexus Manager as administrator might resolve it.", "Jexus Manager", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            Rollbar.RollbarLocator.RollbarInstance.Debug(ex.InnerException);
                            return;
                        }

                        throw new InvalidOperationException($"menu item {method.Text} function {method.MethodName}", ex);
                    }
                })
                {
                    ImageAlign            = ContentAlignment.MiddleLeft,
                    ImageTransparentColor = Color.Magenta,
                    TextAlign             = ContentAlignment.MiddleLeft,
                    Enabled     = method.Enabled,
                    AutoToolTip = false
                };
                actionPanel.Items.Add(result);
                if ((method.Usage & MethodTaskItemUsages.ContextMenu) == MethodTaskItemUsages.ContextMenu)
                {
                    var result2 = new ToolStripMenuItem(method.Text, method.Image ?? Resources.transparent_16,
                                                        (o, args) =>
                    {
                        try
                        {
                            list.InvokeMethod(method.MethodName, method.UserData);
                        }
                        catch (TargetInvocationException ex)
                        {
                            if (ex.InnerException is UnauthorizedAccessException)
                            {
                                MessageBox.Show($"{ex.InnerException.Message}. Running Jexus Manager as administrator might resolve it.", "Jexus Manager", MessageBoxButtons.OK, MessageBoxIcon.Error);
                                Rollbar.RollbarLocator.RollbarInstance.Debug(ex.InnerException);
                                return;
                            }

                            throw new InvalidOperationException($"menu item {method.Text} function {method.MethodName}", ex);
                        }
                    })
                    {
                        ImageTransparentColor = Color.Magenta,
                        Enabled     = method.Enabled,
                        AutoToolTip = false
                    };
                    if (parent == null)
                    {
                        actionMenu.Items.Add(result2);
                    }
                    else
                    {
                        parent.DropDownItems.Add(result2);
                    }
                }

                return;
            }

            var text = item as TextTaskItem;

            if (text != null)
            {
                var result = new ToolStripLabel(text.Text, text.Image ?? Resources.transparent_16)
                {
                    ImageAlign            = ContentAlignment.MiddleLeft,
                    ImageTransparentColor = Color.Magenta,
                    TextAlign             = ContentAlignment.MiddleLeft,
                    Enabled = text.Enabled
                };
                if (text.IsHeading)
                {
                    result.Font = new Font(result.Font, FontStyle.Bold);
                }

                actionPanel.Items.Add(result);
                return;
            }

            var group = item as GroupTaskItem;

            if (group != null)
            {
                var result = new ToolStripLabel(group.Text)
                {
                    ImageAlign            = ContentAlignment.MiddleLeft,
                    ImageTransparentColor = Color.Magenta,
                    TextAlign             = ContentAlignment.MiddleLeft,
                    Enabled = group.Enabled
                };
                if (group.IsHeading)
                {
                    result.Font      = new Font(result.Font, FontStyle.Bold);
                    result.BackColor = SystemColors.ControlDarkDark;
                }

                actionPanel.Items.Add(result);
                ToolStripMenuItem result2 = null;
                if (actionMenu != null)
                {
                    result2 = new ToolStripMenuItem(group.Text);
                    if (parent == null)
                    {
                        actionMenu.Items.Add(result2);
                    }
                    else
                    {
                        parent.DropDownItems.Add(result2);
                    }
                }

                foreach (TaskItem subItem in group.Items)
                {
                    TaskItemFill(subItem, list, actionPanel, actionMenu, result2);
                }
            }
        }
Example #33
0
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            Syncfusion.Windows.Forms.Edit.Implementation.Config.Config config1   = new Syncfusion.Windows.Forms.Edit.Implementation.Config.Config();
            System.ComponentModel.ComponentResourceManager             resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
            this.editControl1                   = new Syncfusion.Windows.Forms.Edit.EditControl();
            this.toolStrip1                     = new System.Windows.Forms.ToolStrip();
            this.toolStripLabel1                = new System.Windows.Forms.ToolStripLabel();
            this.toolStripButton1               = new System.Windows.Forms.ToolStripButton();
            this.toolStripSeparator1            = new System.Windows.Forms.ToolStripSeparator();
            this.toolStripButton2               = new System.Windows.Forms.ToolStripButton();
            this.toolStripSeparator2            = new System.Windows.Forms.ToolStripSeparator();
            this.toolStripButton3               = new System.Windows.Forms.ToolStripButton();
            this.toolStripSeparator3            = new System.Windows.Forms.ToolStripSeparator();
            this.toolStripButton4               = new System.Windows.Forms.ToolStripButton();
            this.toolStripSeparator4            = new System.Windows.Forms.ToolStripSeparator();
            this.toolStripButton5               = new System.Windows.Forms.ToolStripButton();
            this.toolStripSeparator5            = new System.Windows.Forms.ToolStripSeparator();
            this.toolStripButton6               = new System.Windows.Forms.ToolStripButton();
            this.toolStripSeparator8            = new System.Windows.Forms.ToolStripSeparator();
            this.toolStripButton7               = new System.Windows.Forms.ToolStripButton();
            this.menuStrip1                     = new System.Windows.Forms.MenuStrip();
            this.fielToolStripMenuItem          = new System.Windows.Forms.ToolStripMenuItem();
            this.newToolStripMenuItem           = new System.Windows.Forms.ToolStripMenuItem();
            this.openToolStripMenuItem          = new System.Windows.Forms.ToolStripMenuItem();
            this.toolStripSeparator6            = new System.Windows.Forms.ToolStripSeparator();
            this.saveToolStripMenuItem          = new System.Windows.Forms.ToolStripMenuItem();
            this.saveAsToolStripMenuItem        = new System.Windows.Forms.ToolStripMenuItem();
            this.toolStripSeparator7            = new System.Windows.Forms.ToolStripSeparator();
            this.closeToolStripMenuItem         = new System.Windows.Forms.ToolStripMenuItem();
            this.exitToolStripMenuItem          = new System.Windows.Forms.ToolStripMenuItem();
            this.setTextToolStripMenuItem       = new System.Windows.Forms.ToolStripMenuItem();
            this.textPanelToolStripMenuItem     = new System.Windows.Forms.ToolStripMenuItem();
            this.fileNamePanelToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
            this.statusPanelToolStripMenuItem   = new System.Windows.Forms.ToolStripMenuItem();
            this.encodngPanelToolStripMenuItem  = new System.Windows.Forms.ToolStripMenuItem();
            this.positToolStripMenuItem         = new System.Windows.Forms.ToolStripMenuItem();
            this.insertPanelToolStripMenuItem   = new System.Windows.Forms.ToolStripMenuItem();
            ((System.ComponentModel.ISupportInitialize)(this.editControl1)).BeginInit();
            this.toolStrip1.SuspendLayout();
            this.menuStrip1.SuspendLayout();
            this.SuspendLayout();
            //
            // editControl1
            //
            this.editControl1.BackColor                = System.Drawing.SystemColors.Window;
            this.editControl1.BorderStyle              = System.Windows.Forms.BorderStyle.Fixed3D;
            this.editControl1.CodeSnipptSize           = new System.Drawing.Size(100, 100);
            this.editControl1.Configurator             = config1;
            this.editControl1.Dock                     = System.Windows.Forms.DockStyle.Fill;
            this.editControl1.IndicatorMarginBackColor = System.Drawing.Color.Empty;
            this.editControl1.LineNumbersFont          = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
            this.editControl1.Location                 = new System.Drawing.Point(10, 59);
            this.editControl1.Name                     = "editControl1";
            this.editControl1.RenderRightToLeft        = false;
            this.editControl1.ScrollPosition           = new System.Drawing.Point(0, 0);
            this.editControl1.ScrollVisualStyle        = Syncfusion.Windows.Forms.ScrollBarCustomDrawStyles.Metro;
            this.editControl1.ShowHorizontalSplitters  = false;
            this.editControl1.ShowIndicatorMargin      = false;
            this.editControl1.ShowSelectionMargin      = false;
            this.editControl1.ShowVerticalSplitters    = false;
            this.editControl1.Size                     = new System.Drawing.Size(522, 376);

            this.editControl1.StatusBarSettings.GripVisibility = Syncfusion.Windows.Forms.Edit.Enums.SizingGripVisibility.Visible;

            this.editControl1.StatusBarSettings.TextPanel.AutoSize = false;
            this.editControl1.StatusBarSettings.StatusPanel.Width  = 100;
            this.editControl1.StatusBarSettings.Visible            = true;
            this.editControl1.TabIndex           = 0;
            this.editControl1.Text               = "";
            this.editControl1.TransferFocusOnTab = true;
            this.editControl1.UseXPStyleBorder   = true;
            this.editControl1.VisualColumn       = 1;
            this.editControl1.WordWrap           = true;
            //
            // toolStrip1
            //
            this.toolStrip1.BackColor = System.Drawing.Color.White;
            this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
                this.toolStripLabel1,
                this.toolStripButton1,
                this.toolStripSeparator1,
                this.toolStripButton2,
                this.toolStripSeparator2,
                this.toolStripButton3,
                this.toolStripSeparator3,
                this.toolStripButton4,
                this.toolStripSeparator4,
                this.toolStripButton5,
                this.toolStripSeparator5,
                this.toolStripButton6,
                this.toolStripSeparator8,
                this.toolStripButton7
            });
            this.toolStrip1.Location     = new System.Drawing.Point(10, 34);
            this.toolStrip1.Name         = "toolStrip1";
            this.toolStrip1.Size         = new System.Drawing.Size(522, 25);
            this.toolStrip1.TabIndex     = 1;
            this.toolStrip1.Text         = "toolStrip1";
            this.toolStrip1.ItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.VisibilityMenuClick);
            //
            // toolStripLabel1
            //
            this.toolStripLabel1.Name = "toolStripLabel1";
            this.toolStripLabel1.Size = new System.Drawing.Size(99, 22);
            this.toolStripLabel1.Text = "Status Bar Panels:";
            //
            // toolStripButton1
            //
            this.toolStripButton1.Checked               = true;
            this.toolStripButton1.CheckState            = System.Windows.Forms.CheckState.Checked;
            this.toolStripButton1.DisplayStyle          = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
            this.toolStripButton1.Image                 = ((System.Drawing.Image)(resources.GetObject("toolStripButton1.Image")));
            this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.toolStripButton1.Name = "toolStripButton1";
            this.toolStripButton1.Size = new System.Drawing.Size(33, 22);
            this.toolStripButton1.Text = "Text";
            //
            // toolStripSeparator1
            //
            this.toolStripSeparator1.Name = "toolStripSeparator1";
            this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);
            //
            // toolStripButton2
            //
            this.toolStripButton2.Checked               = true;
            this.toolStripButton2.CheckState            = System.Windows.Forms.CheckState.Checked;
            this.toolStripButton2.DisplayStyle          = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
            this.toolStripButton2.Image                 = ((System.Drawing.Image)(resources.GetObject("toolStripButton2.Image")));
            this.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.toolStripButton2.Name = "toolStripButton2";
            this.toolStripButton2.Size = new System.Drawing.Size(61, 22);
            this.toolStripButton2.Text = "FileName";
            //
            // toolStripSeparator2
            //
            this.toolStripSeparator2.Name = "toolStripSeparator2";
            this.toolStripSeparator2.Size = new System.Drawing.Size(6, 25);
            //
            // toolStripButton3
            //
            this.toolStripButton3.Checked               = true;
            this.toolStripButton3.CheckState            = System.Windows.Forms.CheckState.Checked;
            this.toolStripButton3.DisplayStyle          = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
            this.toolStripButton3.Image                 = ((System.Drawing.Image)(resources.GetObject("toolStripButton3.Image")));
            this.toolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.toolStripButton3.Name = "toolStripButton3";
            this.toolStripButton3.Size = new System.Drawing.Size(43, 22);
            this.toolStripButton3.Text = "Status";
            //
            // toolStripSeparator3
            //
            this.toolStripSeparator3.Name = "toolStripSeparator3";
            this.toolStripSeparator3.Size = new System.Drawing.Size(6, 25);
            //
            // toolStripButton4
            //
            this.toolStripButton4.Checked               = true;
            this.toolStripButton4.CheckState            = System.Windows.Forms.CheckState.Checked;
            this.toolStripButton4.DisplayStyle          = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
            this.toolStripButton4.Image                 = ((System.Drawing.Image)(resources.GetObject("toolStripButton4.Image")));
            this.toolStripButton4.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.toolStripButton4.Name = "toolStripButton4";
            this.toolStripButton4.Size = new System.Drawing.Size(61, 22);
            this.toolStripButton4.Text = "Encoding";
            //
            // toolStripSeparator4
            //
            this.toolStripSeparator4.Name = "toolStripSeparator4";
            this.toolStripSeparator4.Size = new System.Drawing.Size(6, 25);
            //
            // toolStripButton5
            //
            this.toolStripButton5.Checked               = true;
            this.toolStripButton5.CheckState            = System.Windows.Forms.CheckState.Checked;
            this.toolStripButton5.DisplayStyle          = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
            this.toolStripButton5.Image                 = ((System.Drawing.Image)(resources.GetObject("toolStripButton5.Image")));
            this.toolStripButton5.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.toolStripButton5.Name = "toolStripButton5";
            this.toolStripButton5.Size = new System.Drawing.Size(54, 22);
            this.toolStripButton5.Text = "Position";
            //
            // toolStripSeparator5
            //
            this.toolStripSeparator5.Name = "toolStripSeparator5";
            this.toolStripSeparator5.Size = new System.Drawing.Size(6, 25);
            //
            // toolStripButton6
            //
            this.toolStripButton6.Checked               = true;
            this.toolStripButton6.CheckState            = System.Windows.Forms.CheckState.Checked;
            this.toolStripButton6.DisplayStyle          = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
            this.toolStripButton6.Image                 = ((System.Drawing.Image)(resources.GetObject("toolStripButton6.Image")));
            this.toolStripButton6.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.toolStripButton6.Name = "toolStripButton6";
            this.toolStripButton6.Size = new System.Drawing.Size(40, 22);
            this.toolStripButton6.Text = "Insert";
            //
            // toolStripSeparator8
            //
            this.toolStripSeparator8.Name = "toolStripSeparator8";
            this.toolStripSeparator8.Size = new System.Drawing.Size(6, 25);
            //
            // toolStripButton7
            //
            this.toolStripButton7.Checked               = true;
            this.toolStripButton7.CheckState            = System.Windows.Forms.CheckState.Checked;
            this.toolStripButton7.DisplayStyle          = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
            this.toolStripButton7.Image                 = ((System.Drawing.Image)(resources.GetObject("toolStripButton7.Image")));
            this.toolStripButton7.ImageTransparentColor = System.Drawing.Color.Magenta;
            this.toolStripButton7.Name = "toolStripButton7";
            this.toolStripButton7.Size = new System.Drawing.Size(83, 22);
            this.toolStripButton7.Text = "Sizing gripper";
            //
            // menuStrip1
            //
            this.menuStrip1.BackColor = System.Drawing.Color.White;
            this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
                this.fielToolStripMenuItem,
                this.setTextToolStripMenuItem
            });
            this.menuStrip1.Location = new System.Drawing.Point(10, 10);
            this.menuStrip1.Name     = "menuStrip1";
            this.menuStrip1.Size     = new System.Drawing.Size(522, 24);
            this.menuStrip1.TabIndex = 2;
            this.menuStrip1.Text     = "menuStrip1";
            //
            // fielToolStripMenuItem
            //
            this.fielToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
                this.newToolStripMenuItem,
                this.openToolStripMenuItem,
                this.toolStripSeparator6,
                this.saveToolStripMenuItem,
                this.saveAsToolStripMenuItem,
                this.toolStripSeparator7,
                this.closeToolStripMenuItem,
                this.exitToolStripMenuItem
            });
            this.fielToolStripMenuItem.Name = "fielToolStripMenuItem";
            this.fielToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
            this.fielToolStripMenuItem.Text = "File";
            //
            // newToolStripMenuItem
            //
            this.newToolStripMenuItem.Name   = "newToolStripMenuItem";
            this.newToolStripMenuItem.Size   = new System.Drawing.Size(123, 22);
            this.newToolStripMenuItem.Text   = "New";
            this.newToolStripMenuItem.Click += new System.EventHandler(this.MainMenuClick);
            //
            // openToolStripMenuItem
            //
            this.openToolStripMenuItem.Name   = "openToolStripMenuItem";
            this.openToolStripMenuItem.Size   = new System.Drawing.Size(123, 22);
            this.openToolStripMenuItem.Text   = "Open...";
            this.openToolStripMenuItem.Click += new System.EventHandler(this.MainMenuClick);
            //
            // toolStripSeparator6
            //
            this.toolStripSeparator6.Name = "toolStripSeparator6";
            this.toolStripSeparator6.Size = new System.Drawing.Size(120, 6);
            //
            // saveToolStripMenuItem
            //
            this.saveToolStripMenuItem.Name   = "saveToolStripMenuItem";
            this.saveToolStripMenuItem.Size   = new System.Drawing.Size(123, 22);
            this.saveToolStripMenuItem.Text   = "Save";
            this.saveToolStripMenuItem.Click += new System.EventHandler(this.MainMenuClick);
            //
            // saveAsToolStripMenuItem
            //
            this.saveAsToolStripMenuItem.Name   = "saveAsToolStripMenuItem";
            this.saveAsToolStripMenuItem.Size   = new System.Drawing.Size(123, 22);
            this.saveAsToolStripMenuItem.Text   = "Save As...";
            this.saveAsToolStripMenuItem.Click += new System.EventHandler(this.MainMenuClick);
            //
            // toolStripSeparator7
            //
            this.toolStripSeparator7.Name = "toolStripSeparator7";
            this.toolStripSeparator7.Size = new System.Drawing.Size(120, 6);
            //
            // closeToolStripMenuItem
            //
            this.closeToolStripMenuItem.Name   = "closeToolStripMenuItem";
            this.closeToolStripMenuItem.Size   = new System.Drawing.Size(123, 22);
            this.closeToolStripMenuItem.Text   = "Close";
            this.closeToolStripMenuItem.Click += new System.EventHandler(this.MainMenuClick);
            //
            // exitToolStripMenuItem
            //
            this.exitToolStripMenuItem.Name   = "exitToolStripMenuItem";
            this.exitToolStripMenuItem.Size   = new System.Drawing.Size(123, 22);
            this.exitToolStripMenuItem.Text   = "Exit";
            this.exitToolStripMenuItem.Click += new System.EventHandler(this.MainMenuClick);
            //
            // setTextToolStripMenuItem
            //
            this.setTextToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
                this.textPanelToolStripMenuItem,
                this.fileNamePanelToolStripMenuItem,
                this.statusPanelToolStripMenuItem,
                this.encodngPanelToolStripMenuItem,
                this.positToolStripMenuItem,
                this.insertPanelToolStripMenuItem
            });
            this.setTextToolStripMenuItem.Name = "setTextToolStripMenuItem";
            this.setTextToolStripMenuItem.Size = new System.Drawing.Size(63, 20);
            this.setTextToolStripMenuItem.Text = "Set Text ";
            //
            // textPanelToolStripMenuItem
            //
            this.textPanelToolStripMenuItem.Name   = "textPanelToolStripMenuItem";
            this.textPanelToolStripMenuItem.Size   = new System.Drawing.Size(156, 22);
            this.textPanelToolStripMenuItem.Text   = "Text Panel";
            this.textPanelToolStripMenuItem.Click += new System.EventHandler(this.SetTextMenuClick);
            //
            // fileNamePanelToolStripMenuItem
            //
            this.fileNamePanelToolStripMenuItem.Name   = "fileNamePanelToolStripMenuItem";
            this.fileNamePanelToolStripMenuItem.Size   = new System.Drawing.Size(156, 22);
            this.fileNamePanelToolStripMenuItem.Text   = "FileName Panel";
            this.fileNamePanelToolStripMenuItem.Click += new System.EventHandler(this.SetTextMenuClick);
            //
            // statusPanelToolStripMenuItem
            //
            this.statusPanelToolStripMenuItem.Name   = "statusPanelToolStripMenuItem";
            this.statusPanelToolStripMenuItem.Size   = new System.Drawing.Size(156, 22);
            this.statusPanelToolStripMenuItem.Text   = "Status Panel";
            this.statusPanelToolStripMenuItem.Click += new System.EventHandler(this.SetTextMenuClick);
            //
            // encodngPanelToolStripMenuItem
            //
            this.encodngPanelToolStripMenuItem.Name   = "encodngPanelToolStripMenuItem";
            this.encodngPanelToolStripMenuItem.Size   = new System.Drawing.Size(156, 22);
            this.encodngPanelToolStripMenuItem.Text   = "Encoding Panel";
            this.encodngPanelToolStripMenuItem.Click += new System.EventHandler(this.SetTextMenuClick);
            //
            // positToolStripMenuItem
            //
            this.positToolStripMenuItem.Name   = "positToolStripMenuItem";
            this.positToolStripMenuItem.Size   = new System.Drawing.Size(156, 22);
            this.positToolStripMenuItem.Text   = "Position Panel";
            this.positToolStripMenuItem.Click += new System.EventHandler(this.SetTextMenuClick);
            //
            // insertPanelToolStripMenuItem
            //
            this.insertPanelToolStripMenuItem.Name   = "insertPanelToolStripMenuItem";
            this.insertPanelToolStripMenuItem.Size   = new System.Drawing.Size(156, 22);
            this.insertPanelToolStripMenuItem.Text   = "Insert Panel";
            this.insertPanelToolStripMenuItem.Click += new System.EventHandler(this.SetTextMenuClick);
            //
            // Form1
            //
            this.AutoScaleBaseSize = new System.Drawing.Size(5, 15);
            this.ClientSize        = new System.Drawing.Size(542, 445);
            this.Controls.Add(this.editControl1);
            this.Controls.Add(this.toolStrip1);
            this.Controls.Add(this.menuStrip1);
            this.Font          = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.Icon          = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.MainMenuStrip = this.menuStrip1;
            this.MinimumSize   = new System.Drawing.Size(554, 482);
            this.Name          = "Form1";
            this.Padding       = new System.Windows.Forms.Padding(10);
            this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text          = "StatusBar";
            this.WindowState   = System.Windows.Forms.FormWindowState.Maximized;
            ((System.ComponentModel.ISupportInitialize)(this.editControl1)).EndInit();
            this.toolStrip1.ResumeLayout(false);
            this.toolStrip1.PerformLayout();
            this.menuStrip1.ResumeLayout(false);
            this.menuStrip1.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();
        }
Example #34
0
        private static string[] TranslateToXml(string[] text, string sourceLanguageCode, string destLanguageCode, ToolStripProgressBar tspb, ToolStripLabel tsl)
        {
            List <List <string> > textChunks = new List <List <string> >();
            List <string>         currChunk  = new List <string>();
            int currChunkLength = 0;

            foreach (string str in text)
            {
                if (currChunkLength + str.Length > CHAR_LIMIT)
                {
                    textChunks.Add(currChunk);
                    currChunk = new List <string>();
                }
                currChunk.Add(str);
                currChunkLength += str.Length;
            }
            if (currChunk.Count > 0)
            {
                textChunks.Add(currChunk);
            }
            List <string> result = new List <string>();
            int           cpt    = 0;
            int           max    = textChunks.Sum((x) => x.Count);

            foreach (List <string> chunk in textChunks)
            {
                if (tspb != null)
                {
                    tspb.Value = (cpt / max) * 100;
                }
                if (tsl != null)
                {
                    tsl.Text = $"Translated {cpt}/{max}";
                }

                string direction = (sourceLanguageCode == DETECT_LANG_CODE) ? destLanguageCode : $"{sourceLanguageCode}-{destLanguageCode}";
                string url       = $"{TRANSLATE_KEY}&{Args.LANG}={direction}";
                foreach (string txt in chunk)
                {
                    url += '&';
                    url += Uri.EscapeDataString(Args.TEXT);
                    url += '=';
                    url += Uri.EscapeDataString(txt);
                }

                WebRequest  rq = WebRequest.Create(url);
                WebResponse wr = rq.GetResponse();
                result.Add(wr.GetResponseStream().ReadToEnd());
                cpt++;
            }
            return(result.ToArray());
        }