Resizable panel-like widget

2011-08-11 Thread Alexander Orlov
I'm looking for a panel-like widget that can be resized (vertically) when 
the users clicks and moves its bottom/top end. Couldn't find anything 
suitable in GWT's Showcase app.

-Alex

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/5YmF6b_ZqxYJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.



Re: Resizable Panel

2009-01-03 Thread Dev

Figured out myself .Here is a code example for a resizable and
dragable panel
public class DragPanel extends VerticalPanel {
private boolean drag_drop = false;
private boolean move = false ;
private Element movingPanelElement;


public void setMovingPanelElement(Element movingPanelElement) {
this.movingPanelElement = movingPanelElement;
}



public DragPanel() {
super();
DOM.sinkEvents(this.getElement(), Event.ONMOUSEDOWN |
Event.ONMOUSEMOVE
| Event.ONMOUSEUP | Event.ONMOUSEOVER);

}

@Override
public void onBrowserEvent(Event event) {

final int eventType = DOM.eventGetType(event);
if (Event.ONMOUSEOVER == eventType) {


if (isCursorResize(event)) {
DOM.setStyleAttribute(this.getElement(), 
"cursor", "s-resize");
} else if(isCursorMove(event)){

DOM.setStyleAttribute(this.getElement(),"cursor", "move");
}else {
DOM.setStyleAttribute(this.getElement(), 
"cursor", "default");
}

}
if (Event.ONMOUSEDOWN == eventType) {
if (isCursorResize(event)) {
if (drag_drop == false) {
drag_drop = true;

DOM.setCapture(this.getElement());


}
}else if(isCursorMove(event)){
DOM.setCapture(this.getElement());
move = true;
}

} else if (Event.ONMOUSEMOVE == eventType) {
if(!isCursorResize(event)&&!isCursorMove(event)){
DOM.setStyleAttribute(this.getElement(), 
"cursor", "default");
}
if (drag_drop == true) {
int absY = DOM.eventGetClientY(event);
int originalY = 
DOM.getAbsoluteTop(this.getElement());
if(absY>originalY){
Integer height = absY-originalY;
this.setHeight(height + "px");
}
}else if(move == true){
RootPanel.get().setWidgetPosition(this, 
DOM.eventGetClientX
(event),DOM.eventGetClientY(event));
}
} else if (Event.ONMOUSEUP == eventType) {
if(move == true){
move = false;
DOM.releaseCapture(this.getElement());
}
if (drag_drop == true) {
drag_drop = false;
DOM.releaseCapture(this.getElement());

}

}
}

protected boolean isCursorResize(Event event) {
int cursor = DOM.eventGetClientY(event);
int initial = this.getAbsoluteTop();
int height = this.getOffsetHeight();

if (initial + height - 20 < cursor && cursor <= initial + 
height)
return true;
else
return false;

}
protected boolean isCursorMove(Event event){
int cursor = DOM.eventGetClientY(event);
int initial = movingPanelElement.getAbsoluteTop();
int height = movingPanelElement.getOffsetHeight();
if(initial <= cursor && cursor <= initial + height)
return true;
else
return false;

}
}


On Jan 2, 10:08 am, Dev  wrote:
> Is there any way to have a 'Resizable'panelin GWT.
>
> ByresizableI mean that if you you drag on the edge ofPanelit can
> be resized accordingly.

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Resizable Panel

2009-01-02 Thread Dev

Is there any way to have a 'Resizable' panel in GWT.

By resizable I mean that if you you drag on the edge of Panel it can
be resized accordingly.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---



Re: Is there a resizable panel in GWT? like JInternalFrame in Swing

2008-08-28 Thread Anil

I found out much later about Gwt-ext. Surprised no one here mentioned
it.

On Aug 16, 4:57 pm, Anil <[EMAIL PROTECTED]> wrote:
> by resizable, I mean the user should be able to drag an edge to the
> new size, and/or click the maximize/minimize button on the top right
> corner.
>
> On Aug 15, 8:08 pm, Anil <[EMAIL PROTECTED]> wrote:
>
> > Is there a resizable panel in GWT? like JInternalFrame in Swing
> > thanks,
> > Anil
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~--~~~~--~~--~--~---