Movable panel that stays in background while moving in ExtJS 4.2.1 - extjs4.2

I'm trying to create a floating window and a floating panel. Panel is to hold shortcuts (as in a desktop) and the window is like windows in a desktop environment. I want to be able to move the window and the panel both but I don't want ever the panel to come forth on the window (not in any situation). And I'm trying to do this in ExtJS 4.2.1. Here's the sample code:
Ext.create('Ext.panel.Panel', {
draggable: true,
floating: true,
height: 250,
width: 400,
resizable: true,
headerPosition: 'bottom',
title: 'Desktop Shortcuts'
}).show();
Ext.create('widget.window', {
height: 200,
width: 400,
title: 'Window'
}).show();
This code's problem is that, when you are trying to move the panel, it will come forth. Is there anyway I can get rid of that?
[SOLUTION]
It was just enough to set the floating property of panel to false. Since it is mentioned draggable it does not need floating to make the panel movable. And by disabling the floating property it won't ever come to front.

You should be able to use extjs' z-index property to allow you to bring what you want to the front. You can use the z-index manager to register/manage your elements through it or you can set the z-index manually. A higher z-index should bring that element in front of a lower one.
panel.getEl().setStyle('z-index','80000');
Sencha Docs - ZIndexManager
stack overflow similar question (z-index)

Related

How can I set a default width for my VS Code Extension webview?

I am developing a VS Code extension using a webview. I would like to set the width of the panel when the user first opens it.
I see that there are options for where to place the panel with ViewColumn but I have not been able to figure out how to change the default width. Specifically, I would like the panel to open to the right and for the width to be the smallest possible width, basically what I can achieve by manually dragging the split line as far to the right as VS Code will let me. Where can I specify the width?
const panel = vscode.window.createWebviewPanel(
'catCoding',
'Cat Coding',
vscode.ViewColumn.Two,
{
enableScripts: true
}
);

Application Menu on top of Leaflet map

In a map application based on Leaflet, I would like to have a large application menu, kind of a settings menu. I managed to put a nice button into the top right corner as a L.Control and it gets fired on a click.
The menu should position either to the left of the menu button or simply in the middle of the screen.
I am wondering whether it is best practice to use
a Popup,
a Layer,
another Control or
just position a at the right place on the page.
Trying the latter, I found that I have to set z-index to a very high value to see it, and it feels a bit odd not to use the Leafleat features.
What would be the "right" solution to use with Leaflet?
If you want a full screen map, you can use https://github.com/Turbo87/leaflet-sidebar
I use it here: http://franceimage.github.io/map
You can create a nice customized icons based toolbar using Leaflet easybutton plugin.
You will have all the leaflet based controls (Click, hover, position etc.) to set that up as per your requirements.
Here are the implementation examples:
http://danielmontague.com/projects/easyButton.js/v1/examples/
and github repo: https://github.com/CliffCloud/Leaflet.EasyButton

JavaFX 8, how to hide a pane in Splitpane?

I have a splitpane created from FXML that consists of Three panes left to right. I want to be able to hide the rightmost pane but I can't find anything to hide it. If I turn of the visibility it hides the pane content. What I want is to temporarily hide it, so the pane is removed visually.
As a temporary workaround I move the divider to 100%, but this leaves the divider visible. Another side-effect is that if I resize the main window the divider doesn't stay at the rightmost position.
Any tips on hiding one pane in splitpane?
Or any tips on the best way to achieve this without splitpane(rightmost pane needs to be resizable when not hidden). General pointers to techniques/containers would be appreciated since I'm new to Java/JavaFX but not to programming :)
Seems I've found it, even thought it's not a plain hide/show deal. My splitpane is named "mainSplitPane", and the one I want to hide/show is the third. Upon initialization of the controller I retrieve the third pane and store it in "componentsPane".
Declared in controllerclass:
Node componentsPane;
Called in initialize method of the controllerclass:
componentsPane=mainSplitPane.getItems().get(2);
Code to hide:
mainSplitPane.getItems().remove(componentsPane);
And code to show:
mainSplitPane.getItems().add(2, componentsPane);
mainSplitPane.setDividerPosition(1, 0.8);
A side effect is that I have to set dividerposition since it's removed.

Vertically center overlay window

For an application I am working on, their is a requirement for a custom overlay to display detailed information about a selected item. I am using jQuery Tools for this but am having issues centering the overlay vertically within the user's viewport. Because the page is so tall it is rarely in an appropriate location (either to high or to low). How can I force this overlay to be centered?
You can indeed center the overlay with jQuery Tools. They were kind enough to include this functionality. If you read the source it has a conditional check for if the option key "top" has the value of "center"
Thus,
$(".overlay").overlay({
top: "center"
});
And that's it!

GWT popup setGlassEnabled(true) don't work

I'm creating a popup panel whit same text, i would like to disable the background and make it grey. I read about setGlassEnabled but it doesn't work, can someone help? ps. the popup is correctly visualized.
PopupPanel popup = new PopupPanel(infoType);
popup.center();
popup.setGlassEnabled(true);
popup.show();
The glass panel has no default style, so it's transparent by default. If you want the background to be grayed out, you need to add some CSS styling to the glass panel.
Also, setGlassEnabled only enables the glass panel for the next time the popup is shown, and in your case, the popup is already showing when you call show (because of the previous call to center), so it's a no-op and the glass panel actually isn't used. Move your call to center to after the call to setGlassEnabled and/or call hide before setGlassEnabled.
Putting the following code at the top of your dialog constructor appears to fix the issue for me.
setGlassEnabled(true);
Style glassStyle = getGlassElement().getStyle();
glassStyle.setProperty("width", "100%");
glassStyle.setProperty("height", "100%");
glassStyle.setProperty("backgroundColor", "#000");
glassStyle.setProperty("opacity", "0.45");
glassStyle.setProperty("mozOpacity", "0.45");
glassStyle.setProperty("filter", " alpha(opacity=45)");
The javadoc for setGlassEnabled() is a bit misleading by saying that "the background will be blocked with a semi-transparent pane". In fact all it will do is apply a full-screen div with a default style name of 'gwt-PopupPanelGlass' (as of GWT 2.4, at least). If, say, your project <inherits> a theme such as com.google.gwt.user.theme.clean.Clean, then clean.css supplies the semi-transparent pane you were expecting:
.gwt-PopupPanelGlass {
background-color: #000;
opacity: 0.3;
filter: alpha(opacity=30);
}
Otherwise, as previously described, you'll have to roll your own.