internal virtual void HandleLinkClicked (LinkRectangle link_clicked) { }
private void TextBoxBase_MouseMove (object sender, MouseEventArgs e) { // FIXME - handle auto-scrolling if mouse is to the right/left of the window if (e.Button == MouseButtons.Left && Capture) { if (!ClientRectangle.Contains (e.X, e.Y)) { if (scroll_timer == null) { scroll_timer = new Timer (); scroll_timer.Interval = 100; scroll_timer.Tick += new EventHandler (ScrollTimerTickHandler); } if (!scroll_timer.Enabled) { scroll_timer.Start (); // Force the first tick ScrollTimerTickHandler (null, EventArgs.Empty); } } document.PositionCaret(e.X + document.ViewPortX, e.Y + document.ViewPortY); if (click_mode == CaretSelection.Position) { document.SetSelectionToCaret(false); document.DisplayCaret(); } } //search through link boxes to see if the mouse is over one of them bool found_link = false; foreach (LinkRectangle link in list_links) { if (link.LinkAreaRectangle.Contains (e.X, e.Y)) { XplatUI.SetCursor (window.Handle, Cursors.Hand.handle); found_link = true; current_link = link; break; } } if (found_link == false) { #if NET_2_0 XplatUI.SetCursor (window.Handle, DefaultCursor.handle); #else XplatUI.SetCursor(window.Handle, Cursors.IBeam.handle); #endif current_link = null; } }
// Constructor will go when complete, only for testing - pdb internal TextBoxBase () { alignment = HorizontalAlignment.Left; accepts_return = false; accepts_tab = false; auto_size = true; InternalBorderStyle = BorderStyle.Fixed3D; actual_border_style = BorderStyle.Fixed3D; character_casing = CharacterCasing.Normal; hide_selection = true; max_length = short.MaxValue; password_char = '\0'; read_only = false; word_wrap = true; richtext = false; show_selection = false; enable_links = false; list_links = new ArrayList (); current_link = null; show_caret_w_selection = (this is TextBox); document = new Document(this); document.WidthChanged += new EventHandler(document_WidthChanged); document.HeightChanged += new EventHandler(document_HeightChanged); //document.CaretMoved += new EventHandler(CaretMoved); document.Wrap = false; click_last = DateTime.Now; click_mode = CaretSelection.Position; MouseDown += new MouseEventHandler(TextBoxBase_MouseDown); MouseUp += new MouseEventHandler(TextBoxBase_MouseUp); MouseMove += new MouseEventHandler(TextBoxBase_MouseMove); SizeChanged += new EventHandler(TextBoxBase_SizeChanged); FontChanged += new EventHandler(TextBoxBase_FontOrColorChanged); ForeColorChanged += new EventHandler(TextBoxBase_FontOrColorChanged); MouseWheel += new MouseEventHandler(TextBoxBase_MouseWheel); RightToLeftChanged += new EventHandler (TextBoxBase_RightToLeftChanged); scrollbars = RichTextBoxScrollBars.None; hscroll = new ImplicitHScrollBar(); hscroll.ValueChanged += new EventHandler(hscroll_ValueChanged); hscroll.SetStyle (ControlStyles.Selectable, false); hscroll.Enabled = false; hscroll.Visible = false; hscroll.Maximum = Int32.MaxValue; vscroll = new ImplicitVScrollBar(); vscroll.ValueChanged += new EventHandler(vscroll_ValueChanged); vscroll.SetStyle (ControlStyles.Selectable, false); vscroll.Enabled = false; vscroll.Visible = false; vscroll.Maximum = Int32.MaxValue; SuspendLayout (); this.Controls.AddImplicit (hscroll); this.Controls.AddImplicit (vscroll); ResumeLayout (); SetStyle(ControlStyles.UserPaint | ControlStyles.StandardClick, false); #if NET_2_0 SetStyle(ControlStyles.UseTextForAccessibility, false); base.SetAutoSizeMode (AutoSizeMode.GrowAndShrink); #endif canvas_width = ClientSize.Width; canvas_height = ClientSize.Height; document.ViewPortWidth = canvas_width; document.ViewPortHeight = canvas_height; Cursor = Cursors.IBeam; }
internal override void HandleLinkClicked (LinkRectangle link) { OnLinkClicked (new LinkClickedEventArgs (link.LinkTag.LinkText)); }