Cocoa Custom Status Menu with text view - objective-c

I've created a status menu following some hints here and sone from other sites. It shows a an NSTextView as a line item and has check spelling as you type on, which is exactly what I want (quick way to check a misspelled word). The text view area behaves as expected by highlighting the misspelled word and all.
All works well except for one thing: when I "Control-click" on the misspelled word to get options or guesses on the possible correctly spelled word, it does not popup the context menu.
In Interface Builder I've linked a list item to a custom view containing the NSTextView ... I can send the xcode project code to anyone who would like to examine it further. As a reference I followed this video: http://www.youtube.com/watch?v=HRPMFNDcfLY and modified it slightly.
I'm a beginner, so please be kind; any hints or tips would be much appreciated. Thanks ...

Related

How to find the name for indentation of object-attributes in .tsx-file in PhpStorm

I'm editting a .tsx-file and are reaching upon this bonkers file-formatting:
... If I enlarge the window a bit, then it makes more sense:
But I would still like to change it, so value and onClick aren't aligned all that way to the right. Ideally, it would try to align them with the opening bracket (as they do), unless the opening bracket is more than 35 characters, from the line start. Or something like that.
Now, I assume that it's the TypeScript-formatting that dictates the Code Style for a .tsx-file. But when I open the settings: Editor >> Code Style >> TypeScript then there are BAZILLIONS of settings.
Which leads me to three questions:
Does anyone know what I need to change, so object-attributes doesn't follow the opening-brackets width?
Could I find the name of what I'm looking for, in some smart way? I tried hovering over the massive space, hoping that the little yellow light-bulb could shine some light on, what I was after.
Are there any presets, to be found somewhere? So I don't need to engineer a new Code Style, if I dislike the default.
Make sure that the following option is disabled:
Settings (Preferences on macOS)
Editor | Code Style | TypeScript | Wrapping and Braces
Function call arguments: Align when multiline
NOTE: It is possible that the default value has been changed somewhere since the previous version as I have seen a few questions for the same option but different language (PHP and JavaScript).
HINT 1: Did you know that you can paste your own code in the preview area and start changing options to see how they will affect it? It helps locating the right option a lot.
HINT 2: There is a special popup that shows formatting rules applied to the code. It does not show all possible options but can give you a hint what to look for. To invoke it:
Use Help | Find Action... (or Action tab on Search Everywhere -- they use to be different popups but are using the same popup nowadays)
Type adjust to filer actions
Select and invoke "Adjust code style settings" action
It will give you a popup with applicable rules (it's a limited set: may not list all).
An example for PHP code:

How do I show the Ln and Col numbers in the Visual Basic editor?

Most IDEs have a display that tells the user what line (Ln) and column (Col) position the cursor is currently located at. Is this function available in the Visual Basic Editor?
The Visual Basic editor does have this functionality.
The Ln and Col display is the last widget on the 'Standard' toolbar. You can right click on the menu bar or any toolbar and check the box next to 'Standard'.
If the toolbar is enabled, but you cannot see the Ln/Col display then the tool bar placement has caused the VBE to truncate the toolbar; try moving your toolbars around.
As already noted that basic functionality is part of the [Standard] toolbar.
With Rubberduck (an actively maintained, open-source VBE add-in project I manage), you get much more than that:
The [Rubberduck] toolbar dwarfs the VBE's line/column display, which only shows the start of the current selection. Rubberduck's context-sensitive toolbar displays:
L1C1-style current selection for single-character selections
L1C1-L1C1-style current selection for multiple-character selections
But also context-sensitive information about the selected declaration:
The name of the type library it's located in;
The fully-qualified module/member name;
The type of declaration (whether it's a function, a property, etc.);
The declared/return type, when applicable;
If the declaration has a docstring, a VB_Description attribute, or a Rubberduck #Description annotation, that description appears in the toolbar;
The number of references to that identifier across the entire project.
The latest/current pre-release/CI build apparently has a bug that prevents the L1C1 selection from being displayed. Will be fixed shortly. We're also working on fixing an annoying glitch that makes the reported number of references in the toolbar be off (clicking the button brings up the correct number of references in a Search Results toolwindow tab though). You may want to try v2.0.13 instead of the latest 2.1 prerelease/CI builds.

Can IntelliJ make spelling suggestions?

IntelliJ tells me that I write words wrongly. That is cool. However, it does not give me any suggestions how to write them correctly, making this feature only half as useful as it could be. Can I get IntelliJ to make spelling suggestions? Working on KDE, many of my usual programs use the KDE spelling and thus are able to make suggestions...
I am using IntelliJ IDEA 2016.2.4.
Right Click on the misspelled word -> Spelling -> Typo: Change to...
Right click or press
Alt + Enter
on the misspelled word. It will display a menu like this -
On the first option, you have a sub menu which you can expand on the right but to access the spell check options, you need to select the option itself that is highlight in the screenshot above, and it will replace the context menu with another one, listing the possible spelling suggestions -
I too struggled finding this option. The menu option available (first screenshot) looks like "can be expanded only" and is not at all selectable, visibly.

Adding comments to xib file

I am working on xib file that has many objects, which hide each other and also change in code.
I would to make my work, and any other future programmer easier by adding comments in the xib file.
I thought of just putting some text area outside the view I'm using, but I want to make sure I'm not effecting the final executable.
Is this a valid way to do it?
1./ In interface-builder, select the object to comment, open the inspector:
in the last tab (with the (i) icon, at the bottom of the inspector panel, you'll see a note area: write your comments there. You may want to click on "show with the selection".
2./ comment in code any object that should change programmatically

Is there a way in Intellij IDEA to see the name of the method the current line belongs to?

In our code base there are a few very long methods (several pages worth of code). When reading the code, it would sometimes be good to be able to see the name of the method the current line belongs to, without paging up to the beginning of the method. Is this possible in Intellij IDEA? I am using Intellij IDEA 7.0.3.
You can use View | Context Info (Alt+Q, Ctrl+Shift+Q on Macs). It will display a pop-up on the top of the editor with the current context information (class/method signature).
IntelliJ 2018
This is shown by default at the bottom.
Unfortunately, the method is shown only by name (not including the parameters). If a method is overloaded you won't know for sure where you are.
If you want to move it from bottom to top, go to File > Settings... > Editor > General > Breadcrumbs > check Top:
In the structure panel select the "Autoscroll from source" option.
This way when you place the cursor inside any method the structure panel will show which method you're in.
Intellij now has support for breadcrumbs. Go to settings > appearance and tick "Show breadcrumbs". In this way you can view class/method name without Alt+Q.
For some reason (Alt-Q) wasn't consistent in Android Studio for me. I find (Ctrl-F12) to be pretty satisfactory for this purpose (Navigate|File Structure) though it can be a little laggy in larger files. And by pressing the hotkey again it will populate the list with all the inherited methods as well.