Use metro window with visual studio extension - microsoft-metro

I am developing a Visual Studio Extension. It shows a tool window. The element is s user control which is automatically generated. I want to use a window instead of user control. The reason behind this is, I want to use Metro style window. for which I need a window control derived from MetroWindow class. But as the tool window is generated using a windows control, I am unable to apply metro style to it as it is not a window and I am unable to derive it form metro window class.

Related

How to detect VSCode panel visibility from the extension code?

I would like to create an extension to toggle all the currently visible panels by a single shortcut. So something like the command "Hide/show All Tool Windows" from JetBrains IDEs, which I think is still missing in VS Code.
VS Code can have up to 3 panels visible:
Sidebar (the left-side panel)
Panel (the bottom panel)
AuxiliaryBar (the new right-side panel)
For that purpose, I need to detect the current state of all the panels from the extension code, so I can toggle only the panel(s) which are currently visible.
But alas I can't find it anywhere in the documentation. This page (https://code.visualstudio.com/api/references/when-clause-contexts) contains several variables like sideBarVisible, but I really don't get how to access those context variables from the vscode namespace which you can access from the extension.
import * as vscode from 'vscode';
So, is there a way how to detect if the panel is open or closed from the extension code?
Do you really need to know whether they are open or closed? Can't you just toggle them all?
vscode.commands.executeCommand('workbench.action.toggleSidebarVisibility')
vscode.commands.executeCommand('workbench.action.togglePanel')
vscode.commands.executeCommand('workbench.action.toggleAuxiliaryBar')

Is it possible to open an another exe (for example command promt) like a content inside of custom Editor Window in unity?

I would like to integrate my desktop application inside of unity editor, is it possible to do that?
For example by using Editor Window as a wrapping of my application?
Any solutions?

How to add a new menu item to the File menu in Visual Studio Code?

Is it possible to create an add a custom menu to the main menu bar (preferably the File menu) in Visual Studio with an extension? I want to add a new project type.
Related question as this but for Visual Studio Code instead of Visual Studio:
Adding a Menu to the Visual Studio Menu Bar within an Add-In
I've been looking for the same thing, but currently, I don't think it's possible. This link describes how an extension can create menu items, but the only "contribution points" are in context menus. There is no contribution point for the top-level File menu. I have also been unsuccessful finding a configuration file for editing the existing menus.
Additionally, this other SO post seems to confirm this: VSCode: hiding some default menu items
opened https://github.com/microsoft/vscode/issues/74013

VS Code: how to keep two projects open in tabs (instead of two windows)?

I have VS Code 1.15.1 and when I work at two projects at once, I choose File -> New Window and open the second project. Clicking File -> New Window opens new window with VS Code.
On my other computer (not sure about the VS Code version there), when I click File -> New Window, instead of opening new window, it will rather open new tab, so that I end up with two tabs in one window, each tab for one project and the active tab occupies whole screen estate.
Any ideas what should I change in Settings to achieve this "single window, multiple tabs" layout when having multiple projects?
I use macos (not sure if OS may be somehow related to the window management settings)
Go to Preferences > Settings.
Search for native tabs
Check the checkbox
Code will prompt for restart to take effect.
After restart, make sure you have multiple projects open. And then merge all windows as shown below:
Enjoy multiple tabs in single window.
Note: I think this applies to all Mac OS >= Sierra. Tested with Catalina, Big Sur recently.
Just set in your user settings
"window.nativeTabs": true
and do Window -> Merge All Windows
note: If you have High Sierra installed, that might be an issue.
Here's the link:
Better macOS native window tabs support
In Mac OS, there is a system setting outside of VS Code. Set this and then opening files/folders from the command line will also automatically open the file/folder in a new tab instead of a new window.
In MacOS 12.3 (Monterrey) this is under:
System Preferences > General > Prefer tabs ____ when opening documents.
Change this setting to always. (The default is in full
screen).
You might additionally need to set the setting in VS Code "window.nativeTabs": true as the other commenters have already suggested.

Eclipse GEF graphical editor without header

I am developing RCP plug-in with GEF framework.
I've created basic graphical editor (GraphicalEditor and IEditorInput)
IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
page.openEditor(new TEditorInput("T"), TGraphicalEditor.ID,false);
When I run the application I get editor with a header that contains the tab with the name of the editor and control buttons to maximize and minimize the editor.
What I need is to display just the editor, without the header.
Can it be done?
To my knowledge, it is not possible to just hide an editor's tab.
However, you can try two workarounds:
Have your GEF editor be displayed in an Eclipse view instead of an editor and open such a view as a standalone view. An example of how to open a GEF diagram in a view can be found in GEF's Directed Graph Example. An example of how to open a view as standalone can be found in one the Eclipse RCP official tutorials.
Extend the presentation factories extension point to control how workbench parts are displayed (which includes control over the part stack tab).
I suggest you try the first approach, as to me it seems easier to implement.
The idea with editors is that you can instantiate them multiply for different editor inputs. I am not aware of any way to restrict the number of open editors to just one (well, it appears you can in Eclipse 4.2 if that helps you)
For views, what you want can be done by setting the perspective to fixed and set showTitle of the org.eclipse.ui.perspectiveExtensions extension to false on the view. Maybe you can use a view instead of an editor and control the editor input yourself?
(For example, using an editor, the default Open action would instantiate a new editor, while you probably want to replace the contents in your only editor, right?)