Best way to only get some functionality from TextEdit for NSTextViews - objective-c

I'm new to objective-C and I'm not sure what's the best way to finish my current project. Basicaly, my project is a plugin for a medical software and it has as inputs 2 NSTextViews. I've tried to manually implement all the functionality of a text editor but some futures seem impossible for me to implement. My question is, what is the best way to get this functionality: TextEdit Funtionality for my NSTextViews ? Is there a better and/or easier way from doing every button and every action regarding text editing ?

Check the documentation for NSTextView, specifically the section "Using Text Formatting Controls".
The properties rulerVisible and usesInspectorBar will enable the functionality in your screenshot.

Related

How to customize auto completing list in intellij?

I am intellij user. I am not sure this post is fits to stackoverflow or super user.
Recently, I am working on a project with customized language, which developed by co-workers. It is customized HTML.
However I want to add some words to suggestion list. i.e when I make a div, then I want to find lang attribute on auto suggestion list.
If you know how to customize auto completing suggestion, please reply!
Thanks in advanced!
//############ Edit ##################
I found it! when you type div and waiting, a bulb pop up appears.
There is where users can add custom suggestions.
However, I want to know where to store all this suggestions.
(So I can add several keywords at once!)

Is it possible to use a textarea for a Safari extension settings?

I've made a couple small Safari extensions. For one of them, I would like to collect a set of user-entered strings (e.g., URLs or URL patterns) using a textarea in the settings screen. The only setting types offered in the documentation are one line text, check box, slider, select lists, and radio buttons. I could use a one line text field as an ugly workaround, but I'm hoping there's a better option. I've googled for hints and looked through Safari extensions in GitHub, but haven't found an example of anyone doing this yet.
Does anyone have an example of how to use a textarea for a Safari extensions setting? Is there an undocumented feature I've not been able to find? Or is there a way to trigger a custom popup window from the settings?
Thanks for any tips.
No, there is no way to build a more complex UI inside the settings dialog. What extensions typically do is add a button (checkbox, even if it's not quite the correct element) in the settings page which then launches a separate Safari page which contains the full settings UI, written in HTML.
For an example of this, install uBlock and take a look at how it launches its setting UI.

how to prevent dojo name text box remove/delete name onclick

I want prevent users from possibility to delete a name by accident from the list.. It should be possible to delete a name by clicking only on [x]...
Thanks
Reconsider the plan as Stephan says. My advice: you have used filter elements from OneUI framework. That's not a good choice in my opinion.
My suggestion is to use list element of OneUI instead, for example:
You might want to reconsider that plan :-) - the behavior of the dojo value picker in any other application is to make the full entry a click target - since you don't control other applications, you create an interaction inconsistency that will rather annoy users.
... But if you have to:
The Dojo UI interaction is deeply wired into that control and can't be changed easily. Your sensible option is to take the source of the control and create your own dojo/dijiit widget. Since dojo supports name spaces, that can coexist with the default control. Check the dojo documentation. It contains tutorials how to do that.
You might find there are better uses for your time.

ExtendScript - Can you listen for/change keypress behavior?

I can imagine a lot of different angles to this, but here is my goal:
When I use the [blob brush] tool in [Illustrator] I want the option key to toggle the eyedropper tool.
I figure the specific tool and application are irrelevant, and the root of it is the ExtendScript question:
Can we bind actions to keydown and keyup events?
Can we know what tool is currently active?
Can we change the active tool?
Can we override a default keypress behavior?*
According to the internet, ExtendScript can at least do #2 (see getCurrentTool here). Do you know if it can do 1, 3, and 4? Or do you have suggestions for another approach?
Yes, yes, another approach would be to just deal with it like everyone else. But I really want to fix this, and so do other right-thinking people, and so would you if you came to Illustrator from Photoshop. You would be dumbfounded that it doesn't work this way by default. And we are here because we don't accept what we think we can change.
(I'm sure there are also other uses for this info.)
It's pretty easy to listen for shift+click or ctrl+click if you want to add your listener to a mouse click - look here, and here, too.
YES - you CAN change the active tool.
Check out kahrel's guide to scriptUI. The pdf file has a setion called "Listening to the Keyboard"
I'm not sure if you can override a default keypress behaviour - but you could set a new hotkey in the keyboard settings - and probably do that with a script.

Adding a custom pop-up in Cocoa Touch

Im trying to add a custom pop-up, I dont want to use the Alertview class, I want to make a personalized pop-up, with only two buttons, ok and cancel, and to capture those events to use them later.
Im new to objective-c, what is the best approach to do this? (a working example would be better than nice)
Thx.-
Here are a few examples with projects:
CustomAlert
Another SO Question