How to disable markup option on images in NSTextView? - macos

I have an NSTextView, which has graphics enabled so that users can drag images into it. The problem is that it has an arrow on the image, which opens a dropdown menu. Is there a way to disable this menu, because it causes problems within my app.

How about NSTextView's allowsImageEditing property?
Set it to "false".

Related

How to create custom toolbar in OS X?

I am trying to get the below effect in OS X.
I found out the first step is to create a custom toolbar, then hide the window title.
I have managed to hide the window title but I am new to OS X development so I am not sure how to create a custom toolbar.
Here is the effect I am trying to create (toolbar with a search field and maybe some buttons).
You can easily customize the toolbar in Interface Builder. Click on the toolbar that you have dragged into the window. Now you can remove all the items in there and add the ones you would like to have. You can add anything from TextFields, Buttons to custom views.
Add items by dragging them from the object library into the "Allowed Toolbar Items" section. From there, drag them into the "Default Toolbar Items" section. Otherwise the control will be available to the user, but not in the toolbar until he customizes it.
You can align the controls by using the space and flexible space objects that can be found in the objects library of Xcode.
Aligning the controls works via drag and drop.
To center controls, simply add flexible spaces to the left and right of the control.

Yosemite-style toolbar for document based apps?

Looking for a way to create a Yosemite-style toolbar but retain the default functionality of the titlebar of document based apps.
Here's one way to create a Yosemite-style titlebar:
macOS window with integrated title bar and toolbar?
Which requires hiding the titlebar. Is there a way to get this look and feel but retain the titlebar view which contains:
the filename
if the file has been edited
the fancy renaming popover?
These are the controls we'd like to retain:

change image in a picturebox on scroll in C++/CLI

I have a form application in C++ CLI. It has a scroll bar. I have a panel inside form and a number of picture boxes in it. The panel has auto scroll set. Is it possible that I can hide the panel auto scroll bar and control its scrolling by the form scroll bar.
The form screen shot is attached here
I tried changing the VerticalScroll.Visible property of the panel. But it doesn't help.
regards,
Rohini

How to disable "Open in external viewer" and "Download" menu automatically showed from webview when a pdf is loaded?

I want disable the "open" end "download" functionality from this menu in cocoa WebView, or alternatively disable entire menu.
(source: federicocappelli.net)
There's a slim chance that if you implement a WebUIDelegate whose implementation of webView:contextMenuItemsForElement:defaultMenuItems: filters out WebMenuItemTagOpenWithDefaultApplication and WebMenuItemTagDownloadImageToDisk then that would prevent the web view from showing those two options in the overlay.
Otherwise, you can try subclassing WebView and overriding -mouseMoved: to swallow those events. That might interfere with normal functioning, though.
Or maybe you can override -addTrackingArea: to prevent the adding of whatever tracking area is used to show the overlay.

Nice new 10.7 Lion Toolbar Items

I wonder if anyone knows how to get this "Lion-style" toolbar items like we can see in Apple Mail application? Are they all custom or can be found anywhere? They are surely not present in IB.
Or are they just styled buttons and segmented controls?
The "Lion-Style" toolbar items would appear to be just Rounded Textured buttons with the image and alternate image set. You can drag these buttons directly from the IB library to your toolbar.

Resources