How can I add custom commands to the keyboard dialog (Tools->Options->Keyboard) in order to trigger them by shortcuts? Unfortunately, I could not find any resource on the web.
I crossed this blog post, but it's slightly different, because I'd have to create a menu entry. I only want to show the commands in the keyboard dialog. Just like it worked with macros.
I have not checked VS 2012 in this area, but I think it's the same as for previous version.
All that menu and command stuff is localized in a file called [mypackage].vsct which is the Visual Studio Command Table. The schema is described here: VSCT XML Schema Reference. When you used the wizard it probably created one for you.
As you can see in the schema, a Command is always linked somehow to a Menu (Commands Element), but there are a number of flags you can use to tweak this: Command Flag Element. Depending on what you do, I'd try the CommandWellOnly, DefaultInvisible and DynamicVisibility.
Anyway, if you don't want your menu to appear on the top menu bar, just can also just change the <Parent> element of the root <Menu> element in the vsct file.
Related
I'm trying to add a command to the Document Tab context menu in Visual Studio 2019 so I can go directly to the open file in the Solution Explorer. I'm aware of File Tracking. I don't want to open the folder for every file tab I click on. I'm also aware of this extension but it seems like I have to click it two, sometimes three times before it will go to the file.
I found the relevant context menu under Customize -> Commands. It's "Other Context Menus | Easy MDI Document Window". The problem is that under "Add Command" you can only add from preselected lists of commands, and they don't make things easy to find.
I can see the command I want to add under Options -> Environment -> Keyboard. It's SolutionExplorer.SyncWithActiveDocument. But I don't see any way to use it in the Customize window, or if it's there I can't find it.
You can directly add commands to a menu only from the existing VS menus.
For additional commands, you can create an intermediate command with my Visual Commander extension DTE.ExecuteCommand("SolutionExplorer.SyncWithActiveDocumen") and then add this VCmd.Command01 command to the menu.
I recently installed Resharper 2017.1.3 on Visual Studio 2010 and 2017.
On 2010, the File Structure window has a nice grouping based on categories (private method, public methods, override, etc - see image below). However, in 2017 there is no grouping at all.
I'd like to know if anyone can show me how to enable that in 2017. I tried researching it but couldn't find any solution.
thanks,
ReSharper's structure window doesn't have any grouping functionality as such - it always shows files in the order in which everything is defined. However, it does show regions as groups, as in your first screenshot. Those EqualsCore methods are both defined inside a region, and so get grouped by that.
(You'll also notice the little 'x' in the top right of the region grouping box. Click that and ReSharper will remove the region.)
I would like to add an include and library path to the default configuration in VC++ 2012. I know I can add it manually per project, but there is a checkbox "Inherit from parent or project defaults". I would like to modify this "project defaults" so it applies to all my projects.
Any clue of where to edit this?
***EDIT
No, that answer doesn't help. I edited the vsvars32.bat file, run the bat to check that INCLUDE and LIB variables where updated with my own path (and they are), but when I start MSVC++ 2012 my added path is not included.
It's a bit of a pain, and there is a blog post on MSDN that explains in detail, but in summary here's how you do it:
Open a project, any project.
From the menu, choose View / Property Manager (near the bottom of the menu)
In the property manager window, expand the project tree to show Debug and Release nodes
Expand either Debug or Release (it doesn't matter which)
Right-click on Microsoft.Cpp.Win32.user
Choose Properties from the pop-up menu
You should see a dialog where you can edit the VC++ Directories entry like this:
Once you OK through everything, any project you create or load will inherit these defaults.
I am using Rational Rhapsody for Linux and is wondering if it is possible to configure it to open source code with an external editor instead of the built in editor. I would prefer to be able to edit code using emacs via emacsclient.
According to the documentation the following procedure should set Rhapsody to use an external editor but editing that property has no apparent effect when I attempt to edit the code of one of my classes.
Select File > Project Properties.
Select the Properties tab.
Navigate to the General::Model::EditorCommandLine property.
Click in the property value call in the right column to activate the field, then click the ellipsis (...) to open the Browse for File window.
Browse to the location of the editor you want to use (for example, Notepad) and select the editor. Click OK to close the window. The product displays the path in the property value field.
Click OK.
Have you tried the Rhapsody Eclipse Workflow integration? With that you can open your Rhapsody Model inside Eclipse, and use Eclipse as editor too.
Be careful, not all features from Rhapsody are available this way.
I have only used Rhapsody on Windows, but you have to click the "..." button to get it to break out to the external editor to edit something that showing in the properties dialog. If you want to use the external editor in this way, you have to use one that Rhapsody can execute, and then wait for it to exit, as Rhapsody will create a temp file, open the editor on the temp file, and then import the temp file back into the dialog when you close the editor.
When creating menus with submenus in Visual C++, I find that submenus begin as arrows that I must click to expand to see their contents. Is there a way (programmatically) to have the submenus pop-out already expanded (with no arrow to click)?
Here is an image of what I am talking about, before and after clicking aforementioned arrow:
also here
it seems you are using the MFC Feature Pack.
Go to CMainFrame::OnCreate(), you should be able to find
something like
CMFCToolBar::SetBasicCommands(lstBasicCommands);
somewhere inside it.
lstBasicCommands
is a list that holds all the menu items that are not be hidden initially.
Simple populate it with the items you like.
You may also want to check out the samples code available here:
C:\Program Files\Microsoft Visual Studio 9.0\Samples\1033
In case you do not call SetBasicCommands and do not create the list, the expand button is removed. This releases you from enhancing the list everytime you add a new command.