public override void SelectWithFrame(RectangleF aRect, NSView inView, NSText editor, NSObject delegateObject, int selStart, int selLength) { RectangleF textFrame, imageFrame; aRect.Divide(3 + _image.Size.Width, CGRectEdge.MinXEdge, out imageFrame, out textFrame); base.SelectWithFrame(textFrame, inView, editor, delegateObject, selStart, selLength); }
public override void EditWithFrame(RectangleF aRect, NSView inView, NSText editor, NSObject delegateObject, NSEvent theEvent) { RectangleF textFrame, imageFrame; aRect.Divide(3 + _image.Size.Width, CGRectEdge.MinXEdge, out imageFrame, out textFrame); base.EditWithFrame(textFrame, inView, editor, delegateObject, theEvent); }
public SparkleWindow() : base() { SetFrame (new RectangleF (0, 0, 640, 480), true); Center (); StyleMask = (NSWindowStyle.Closable | NSWindowStyle.Miniaturizable | NSWindowStyle.Titled); MaxSize = new SizeF (640, 480); MinSize = new SizeF (640, 480); HasShadow = true; BackingType = NSBackingStore.Buffered; SideSplash = new NSImage (NSBundle.MainBundle.ResourcePath + "/Pixmaps/side-splash.png"); SideSplash.Size = new SizeF (150, 480); NSText tv = new NSText (new RectangleF (200, 200, 200, 200)) { Value = "TEST" }; ContentView.AddSubview (new NSImageView (new RectangleF (0, 0, 150, 480)) { Image = SideSplash}); ContentView.AddSubview (new NSTextField (new RectangleF (200, 100, 128, 31)) { BezelStyle = NSTextFieldBezelStyle.Rounded}); ContentView.AddSubview (tv); NSApplication.SharedApplication.ActivateIgnoringOtherApps (true); MakeKeyAndOrderFront (this); }
public override void SelectWithFrame(CGRect aRect, NSView inView, NSText editor, NSObject delegateObject, nint selStart, nint selLength) { var actualRect = DrawingRectForBounds(aRect); _isSelecting = true; base.SelectWithFrame(actualRect, inView, editor, delegateObject, selStart, selLength); _isSelecting = false; }
public override void EditWithFrame(CGRect aRect, NSView inView, NSText editor, NSObject delegateObject, NSEvent theEvent) { var actualRect = DrawingRectForBounds(aRect); _isEditing = true; base.EditWithFrame(actualRect, inView, editor, delegateObject, theEvent); _isEditing = false; }
public override bool TextShouldEndEditing(NSText textObject) { if (!ValidateFinalString(TextField.StringValue)) { TextField.ResetInvalidInput(); AppKitFramework.NSBeep(); return(false); } return(TextField.ShouldEndEditing(textObject)); }
public override bool ShouldBeginEditing(NSText textObject) { bool began = base.ShouldBeginEditing(textObject); if (began) { DialogController.TextBeingEdited = true; CocoaCloseButton.Enabled = false; } return(began); }
public override bool ShouldEndEditing(NSText textObject) { bool ended = base.ShouldEndEditing(textObject); if (ended) { DialogController.TextBeingEdited = false; CocoaCloseButton.Enabled = true; } return(ended); }
//, SizeF size) public static SizeF MeasureString (string inString, Font font) { /*NSTextStorage textStorage = new NSTextStorage(); textStorage. NSTextContainer textContainer = new NSTextContainer(size); NSLayoutManager layoutManager = new NSLayoutManager(); */ var tv = new NSText { Font = font.ToNsFont (), Value = inString }; tv.SizeToFit (); return tv.Frame.Size; }
public override bool TextShouldEndEditing(NSControl control, NSText fieldEditor) { if (!CanGetValue(fieldEditor.Value)) { NSTextField text = (NSTextField)control; text.StringValue = this.lastValid; AppKitFramework.NSBeep(); return(false); } return(true); }
public override void SelectWithFrame(CGRect aRect, NSView inView, NSText editor, NSObject delegateObject, nint selStart, nint selLength) { nfloat xOffset = 0; if (IdeApp.Preferences.UserInterfaceTheme == Theme.Dark) { xOffset = -1.5f; } // y does not appear to affect anything. Whatever value is set here for y will always be 1px below the // placeholder text aRect = new CGRect(aRect.X + xOffset, aRect.Y, aRect.Width, aRect.Height); base.SelectWithFrame(aRect, inView, editor, delegateObject, selStart, selLength); }
//, SizeF size) public static SizeF MeasureString(string inString, Font font) { /*NSTextStorage textStorage = new NSTextStorage(); * textStorage. * NSTextContainer textContainer = new NSTextContainer(size); * NSLayoutManager layoutManager = new NSLayoutManager(); */ var tv = new NSText { Font = font.ToNsFont(), Value = inString }; tv.SizeToFit(); return(tv.Frame.Size); }
public override bool ShouldBeginEditing(NSText fieldEditor) { CachedCurrentEditor = fieldEditor; cachedValueString = fieldEditor.Value; if (AllowRatios) { CachedCurrentEditor.Delegate = new RatioValidateDelegate(this); } else { CachedCurrentEditor.Delegate = new NumericValidationDelegate(this); } return(true); }
public override bool ShouldBeginEditing(NSText textObject) { CachedCurrentEditor = textObject; this.cachedValueString = textObject.Value; if (AllowRatios) { CachedCurrentEditor.Delegate = new RatioValidateDelegate(this); } else { CachedCurrentEditor.Delegate = new NumericValidationDelegate(this); } return(true); }
public override bool TextShouldEndEditing(NSText textObject) { bool shouldEndEditing = false; if (!ValidateFinalString(textObject.Value)) { TextField.ResetInvalidInput(); AppKitFramework.NSBeep(); TextField.ShouldEndEditing(textObject); } else { shouldEndEditing = TextField.ShouldEndEditing(textObject); } return(shouldEndEditing); }
//, SizeF size) public static SizeF MeasureString(string inString, Font font) { /* * NSTextStorage textStorage = new NSTextStorage(); * textStorage. * NSTextContainer textContainer = new NSTextContainer(size); * NSLayoutManager layoutManager = new NSLayoutManager(); */ var tv = new NSText { Font = font.ToNsFont(), Value = inString }; tv.SizeToFit(); float w = (float)tv.Frame.Size.Width; float h = (float)tv.Frame.Size.Height; return(new SizeF(w, h)); }
internal virtual Size InternalGetPreferredSize(Size proposed) { Size size; if (Text == string.Empty) { size = new Size(0, Font.Height); } else { var txt = new NSText(); txt.Value = Text; txt.Font = Font.ToNsFont(); txt.SizeToFit(); size = Size.Round(txt.Frame.Size); } #if NET_2_0 size.Width += Padding.Horizontal; size.Height += Padding.Vertical; if (!use_compatible_text_rendering) { return(size); } #else size.Height = Font.Height; #endif if (border_style == BorderStyle.None) { size.Height += 3; } else { size.Height += 6; } return(size); }
public override void EndEditing(NSText textObj) { base.EndEditing(textObj); }
//, SizeF size) public static SizeF MeasureString (string inString, Font font) { /* NSTextStorage textStorage = new NSTextStorage(); textStorage. NSTextContainer textContainer = new NSTextContainer(size); NSLayoutManager layoutManager = new NSLayoutManager(); */ var tv = new NSText { Font = font.ToNsFont (), Value = inString }; tv.SizeToFit (); float w = (float)tv.Frame.Size.Width; float h = (float)tv.Frame.Size.Height; return new SizeF (w, h); }
public override bool TextShouldBeginEditing(NSText textObject) { return(TextField.ShouldBeginEditing(textObject)); }
public override void SelectWithFrame(CGRect aRect, NSView inView, NSText editor, NSObject delegateObject, nint selStart, nint selLength) { base.SelectWithFrame(AdjustFrame(aRect), inView, editor, delegateObject, selStart, selLength); }
public override void EditWithFrame(CGRect aRect, NSView inView, NSText editor, NSObject delegateObject, NSEvent theEvent) { base.EditWithFrame(AdjustFrame(aRect), inView, editor, delegateObject, theEvent); }
public override void SelectWithFrame (RectangleF aRect, NSView inView, NSText editor, NSObject delegateObject, int selStart, int selLength) { RectangleF textFrame, imageFrame; aRect.Divide(3 + _image.Size.Width, CGRectEdge.MinXEdge, out imageFrame, out textFrame); base.SelectWithFrame(textFrame, inView, editor, delegateObject, selStart, selLength); }
public override void SelectWithFrame (CGRect aRect, NSView inView, NSText editor, NSObject delegateObject, nint selStart, nint selLength) { nfloat xOffset = 0; if (IdeApp.Preferences.UserInterfaceTheme == Theme.Dark) { xOffset = -1.5f; } // y does not appear to affect anything. Whatever value is set here for y will always be 1px below the // placeholder text aRect = new CGRect (aRect.X + xOffset, aRect.Y, aRect.Width, aRect.Height); base.SelectWithFrame (aRect, inView, editor, delegateObject, selStart, selLength); }
public override bool TextShouldBeginEditing(NSControl control, NSText fieldEditor) { return(!_passwordBox.GetTarget()?.IsReadOnly ?? false); }
internal virtual bool TextFieldShouldBeginEditing(NSControl control, NSText fieldEditor) { return(!owner.ReadOnly && owner.Enabled); }
public override void EditWithFrame(System.Drawing.RectangleF aRect, NSView inView, NSText editor, MonoMac.Foundation.NSObject delegateObject, NSEvent theEvent) { base.EditWithFrame(aRect, inView, editor, delegateObject, theEvent); }
public override bool TextShouldBeginEditing(NSText textObject) { return(false); }
public override bool ShouldBeginEditing(NSText textObject) { textObject.Delegate = new FocusableComboBoxDelegate(); return(false); }
// When customising the NSCell these are the methods which determine // where the editing and selecting text appears public override void EditWithFrame (CGRect aRect, NSView inView, NSText editor, NSObject delegateObject, NSEvent theEvent) { aRect = new CGRect (aRect.X, aRect.Y + 10, aRect.Width - 66, aRect.Height); base.EditWithFrame (aRect, inView, editor, delegateObject, theEvent); }
public override void SelectWithFrame(CGRect aRect, NSView inView, NSText editor, NSObject delegateObject, nint selStart, nint selLength) { base.SelectWithFrame(VerticalCenteredRectForBounds(aRect), inView, editor, delegateObject, selStart, selLength); }
public override void EditWithFrame(System.Drawing.RectangleF aRect, NSView inView, NSText editor, MonoMac.Foundation.NSObject delegateObject, NSEvent theEvent) { base.EditWithFrame (aRect, inView, editor, delegateObject, theEvent); }
public override void EditWithFrame (RectangleF aRect, NSView inView, NSText editor, NSObject delegateObject, NSEvent theEvent) { RectangleF textFrame, imageFrame; aRect.Divide(3 + _image.Size.Width, CGRectEdge.MinXEdge, out imageFrame, out textFrame); base.EditWithFrame(textFrame, inView, editor, delegateObject, theEvent); }
public override void SelectWithFrame(CGRect aRect, NSView inView, NSText editor, NSObject delegateObject, nint selStart, nint selLength) { var bounds = DrawingRectForBounds(aRect); base.SelectWithFrame(bounds, inView, editor, delegateObject, selStart, selLength); }
public override void EndEditing(NSText textObj) { base.EndEditing (textObj); }
// When customising the NSCell these are the methods which determine // where the editing and selecting text appears public override void EditWithFrame(CGRect aRect, NSView inView, NSText editor, NSObject delegateObject, NSEvent theEvent) { aRect = new CGRect(aRect.X, aRect.Y + 10, aRect.Width - 66, aRect.Height); base.EditWithFrame(aRect, inView, editor, delegateObject, theEvent); }
public override void EditWithFrame(CGRect aRect, NSView inView, NSText editor, NSObject delegateObject, NSEvent theEvent) { base.EditWithFrame(VerticalCenteredRectForBounds(aRect), inView, editor, delegateObject, theEvent); }
internal virtual Size InternalGetPreferredSize (Size proposed) { Size size; if (Text == string.Empty) { size = new Size (0, Font.Height); } else { var txt = new NSText(); txt.Value = Text; txt.Font = Font.ToNsFont(); txt.SizeToFit(); size = Util.NSSizeToSize(txt.Frame.Size); } #if NET_2_0 size.Width += Padding.Horizontal; size.Height += Padding.Vertical; if (!use_compatible_text_rendering) return size; #else size.Height = Font.Height; #endif if (border_style == BorderStyle.None) size.Height += 3; else size.Height += 6; return size; }
public override void SelectWithFrame(CGRect aRect, NSView inView, NSText editor, NSObject delegateObject, nint selStart, nint selLength) { aRect = AdjustBoundsForImage(aRect); base.SelectWithFrame(aRect, inView, editor, delegateObject, selStart, selLength); }