How to disable clicking parent menu item without disabling it? - macos

I want to disable some of parent top menu links with sub-menus, so that when I click at the root top nothing should happen until I navigate and click to its sub menus for specific action.
For example, In Cocoa, if I have menu File -> Recent -> "...Recent files list...." , I can press "Recent". I want to prevent pressing "Recent". Can I do it?
Thanks!

The solution is call [menuItem SetAction : 0] for the item having Sub Menus.
In this way you will not be able to select this item.

Related

How would I disable the minimap in Xcode?

How do I get rid of the minimap in Xcode?
Updated for Xcode 13
Open a code file, such as *.swift, and press the second from the right button in the top right corner. Then click on Minimap:
In older versions of Xcode, this looked as follows:
in XCode 12.0.1
there are 3 ways to hide or show Minimap.
first, you can do it with the Adjust editor option (see the following image).
next way: check or uncheck Minimap from Editor(menu) -> Minimap. (like following image)
and the last way you can use ⌃⇧⌘M and show or hide Minimap.
Navigate to Adjust Editor Options (at the top right corner, to the left of the Add Editor Below button) and uncheck Minimap (or press ^⇧⌘M).
This is called minimap window which give you insight of where you're in part of whole storyboard/code. This feature was introduced in Xcode11 and is quite useful.
You can show/hide simply by using shortcut key as: cmd + shift + ctrl + M.
Alternatively, you can choose 'Adjust Editor Options' i.e multi-lined stacked icon present on top right of Xcode. Deselect Minimap from dropdown list to hide it and Select to show it.

add View menu to thunar context menu

How can I add the View menu to right click in Thunar? I would like to be able to right click an empty area in the Thunar window to at least select between icon, compact list, or details list if not access the rest of the View menu. In reference to documentation at https://docs.xfce.org/xfce/thunar/custom-actions what custom action can I program to change the Thunar view of the current folder?
I'm working in Linux Mint, XFCE4 desktop environment using Thunar 1.6.15.
One way to do this is by using xdotool to emit the keyboard shortcut for the different views and tying it to a Thunar custom action. To do so, you will need to create 3 custom actions:
Icon View
Detailed List item
Compact List View
For each of these, make sure you select the "Directories" box on the custom action's Appearance Conditions tab. On the Basic tab, enter the name, description and select an icon for each action and use the following as the command for each action:
Icon View = xdotool key Ctrl+1
Detailed List View = xdotool key Ctrl+2
Compact List View = xdotool key Ctrl+3
This will create 3 new custom actions - one for each view. The drawback is that you will have 3 menu entries.
You can get away with 1 custom action (and 1 menu entry) if you are okay with cycling through the 3 options. To do so, create an executable file with the following content:
#!/bin/bash
case $(xfconf-query -c thunar -p /last-view) in
ThunarIconView) xdotool key Ctrl+2 ;;
ThunarDetailsView) xdotool key Ctrl+3 ;;
ThunarCompactView) xdotool key Ctrl+1 ;;
esac
Create one new Custom Action with the title of "Cycle View" (and a description and icon of your choice) and set the command to point to this script. Also ensure that on the Appearance Conditions tab, that Directories are checked.
This script will cycle between Icon, Detailed and Compact view every time the custom action is selected.
There is no easy way to display the View menu from the right click. You could use the same procedure as above to send the keyboard shortcut for the view menu, but it will only open directly below the view menu on the menubar - in which case you might as well just click on View and save yourself one click.
Hope this helps.

How to add "Last Position" button to my tool bar in VB6 IDE

I did this before but can't remember how the heck I did it.
I want to have a button on my vb6 IDE toolbar that takes me back to the previous place I was in the code (in my "history) -- an incredibly useful feature.
I have it in my properties (right-click) menu but don't see it in the other menus from which I could drag it to the Toolbar.
Any ideas?
This should do it:
In the IDE right click an empty spot on your
menu and select Customize...
Select the Command tab in the Customize dialog
Select View from the Categories list.
On the Commands list you should see
an item called Last Position.
Drag this item to a toolbar.
#Jay's answer is right on. There are also handy shortcut keys for this feature and the related Definition feature:
Last Position: Ctl + Shift + F2
Definition: Shift + F2
In one of the toolbars in the sample applications?

Xcode find caller functions

In Xcode, how can I find all caller functions of a specific function?
Xcode 4.5 (in beta) has this functionality. when you highlight say... a function, you can check the "caller" and "callee"
edit i believe it's located at the top left of the file panel for that file... so double click on the function to highlight it, and you click on on the file panel options (the one that has the "open recent, open unsaved...etc" drop down
EDIT #2
here's a picture to clarify (since i dont know what this menu button is called):
ALSO - XCode 4.5 is no longer beta, i believe, and is actually out in public
EDIT #3
also note that this caller thing does NOT search for being called under the performSelector method, as in, the particular caller that has this performSelector won't show up if you had done something like:
[self performSelector:#selector(checkIfShouldStopMovement) withObject:nil afterDelay:0.25];
In Xcode, the quickest method is this:
Select method in code (double click or mark using your mouse cursor)
Press Ctrl+1
Select "Callers" from the pop-up menu.
This is the shortcut for going View -> Editor -> Show Related Items in Xcode's menu.
use ⌘+Ctrl+Shift+H key combination on Xcode 7 onwards.
This can also be accessed via the assistant editor, as shown in the screenshot below. Whichever method you have the insertion point in in the main editor on the left will have its callers displayed in the assistant editor. I've found this to be the best way of looking through each caller in succession, since once you have "Callers" selected, you can then select the next caller via the next pop-up menu to the right in the jump bar.
In Xcode-7 you have the functionality of getting call-heirerchy. Right-click on the function and click "Find Call Hierarchy":
image reference:
Xcode 10 upwards seems to have made it easier. Just Command Click on the function and you should see it in the drop down.
Press ⌘+Ctrl+Shift+H shortcut when a method of interests is selected (with a mouse or cursor). (as per #uiroshan 's answer)
But you can also specify any another shortcut in XCode -> Preferences -> Key Bindings
Use Find in Project as Text or as Symbol.
AFAIK, there's no equivalent to e.g. Call Hierarchy known from Eclipse or NetBeans.
Strangely the refactoring tool can detect all method calls but not the search.
So I simply use it to rename my method to a unique name (eg. reset to resetPlayer) and then use the new name in a regular textual search.
1.) Menu > Edit > Refactor... > Rename to unique name
2.) search for the new name
The functionality is available in XCode 4.4.1, see this: http://smilingfinney.blogspot.de/2012/09/method-callers-in-xcode-44.html

Visual Studio: How can I see the same file in two separate tab groups?

I want to be able to edit one method while looking at another method in the same file, as reference.
Can this be done?
You can open the file in another tab (Window -> New Window).
Doing so you have two copies of the same file. Then you can right-click the tab bar and select New Vertical Tab Group (or New Horizontal Tab Group, the one you like more).
Hope I understood you question..
Be on the tab you want to duplicate,then click in the menu bar at the top onWindow > New Window
Finally drag & drop the second window to the the left or right side to show both views next to each other.
Et voila, there you have it :)
EDIT
It seems that this function is not implemented in all version of VS.
In my case (V 15.4.2 (2017), V 15.9.7 (2017) & V 16.2.5 (2019)) it just works fine.
Only vertically that I'm aware. When looking at the code, right above the vertical scroll bar is a small rectangle, drag it down to get a split view of the file.
You simply use the small drag arrows icon at the top right corner of your file window as depicted in the following screenshots:
1) View the same document side-by-side (with a fix for Visual Studio 2017)
It is possible to do this using New Window and New Vertical Tab Group, however, in my Visual Studio 2017 the New Window command was missing from the Window menu. To use it, first you must add the command to a menu or assign a shortcut to it.
To add New Window to your Window menu follow this sequence, starting with the Tools menu:
Tools > Customize > Commands > Menu Bar > Window > Add Command > Window > New Window
FYI In the Commands step you decide where to put the New Window command. The sequence I gave above puts it unceremoniously at the top of the Window menu.
To view the same document side-by-side
Open the document you want to view side-by-side
Select your recently added New Window command (perhaps it's in Window > New Window)
Right click the new tab and select New Vertical Tab Group or select that command from the Window menu
2) View the same document above-one-another
If you wish to view the same document in two views on top of each other use the Window > Split command or click-and-drag the double-arrow at the top of the scroll bar for any window.
3) Get creative
FYI You can even combine the two view options to have three, four or even more views of the same document on a particularly wide monitor. On mine (2560 x 1080) I can comfortably get three side-by-side views going and split them vertically, if desired.
One can install VsVim extension and :sp :vsp does the trick.
In Visual Studio 15 you can just click inside the document and then "Window → Split"

Resources