Hello everyone,
I have a weird (actually more, but let's not get hasty) behaviour of Window. I initialize the object with setCanDragResize(false) and setCanDragReposition(false).
I add a VLayout object as item to this window:
The VLayout object holds an HTMLText pane (as first member):
The parent Window object has a HeaderControl button used to toggle between window (dragable & resizeable) / (not dragable & not resizeable) states
The problem is that when I launch the app, I can select the text in the HTMLPane (window not dragable / resizeable); but when I press the header control button, the window becomes dragable and resizeable, BUT I CAN NO LONGER SELECT TEXT IN THE HTMLPane, because when I try to do that the window is being dragged. As I press the button again and make the window "pinned" (not dragable and not resizeable), I can select the text in the HTMLPane again.
Can you please show me the right way I should implement this in order to work properly? I want to be able to select text in the HTMLPane even if the window's state was programatically set to canDragResize(true) and canDragReposition(true).
Thanks!
I have a weird (actually more, but let's not get hasty) behaviour of Window. I initialize the object with setCanDragResize(false) and setCanDragReposition(false).
Code:
window.setCanDragReposition(false); window.setCanDragResize(false);
Code:
window.addItem(createVLayout());
Code:
final HTMLPane htmlPane = createHTMLPane();
Canvas canvas = new Canvas();
canvas.setWidth100();
canvas.setHeight("70%");
canvas.setShowResizeBar(true);
canvas.addChild(conversationPane);
VLayout vLayout = new VLayout();
vLayout.setHeight100();
vLayout.setWidth100();
vLayout.setResizeBarTarget("next");
// add widgets to layout
vLayout.addMember(canvas);
[...]
Code:
final HeaderControl pinControl = new HeaderControl(HeaderControl.PIN_DOWN);
pinControl.setTooltip("toggle this button to be able to resize and drag this window");
pinControl.addClickHandler(new ClickHandler() {
public void onClick(ClickEvent event) {
if (pined[0]) {
window.setTitle("Chat (draggable)");
window.setCanDragReposition(true);
window.setCanDragResize(true);
window.setCanSelectText(true);
pinControl.setSrc("[SKIN]/headerIcons/pin_left.png");
pined[0] = false;
} else {
window.setTitle("Chat (pinned)");
window.setCanDragReposition(false);
window.setCanDragResize(false);
pinControl.setSrc("[SKIN]/headerIcons/pin_down.png");
pined[0] = true;
}
}
});
Can you please show me the right way I should implement this in order to work properly? I want to be able to select text in the HTMLPane even if the window's state was programatically set to canDragResize(true) and canDragReposition(true).
Thanks!
Comment