Пример #1
0
 public void InitializeComponent()
 {
     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.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);
     //
     // 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.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);
 }
Пример #2
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.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);
     //
     // 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.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);
 }