Hybrid View

  1. #1
    Ext User
    Join Date
    Sep 2008
    Location
    Germany
    Posts
    961
    Vote Rating
    0
    Arno.Nyhm is on a distinguished road

      0  

    Default WindowMaximizeOnHeaderDoubleclick

    WindowMaximizeOnHeaderDoubleclick


    if you like to have the function to double click on a header and then the window should maximize and restore then is this helper class for you:

    WindowMaximizeOnHeaderDoubleclick

    code improvements are welcome :-)


    PHP Code:
    package org.yournamehere.client.gui.components;

    import com.extjs.gxt.ui.client.event.BaseEvent;
    import com.extjs.gxt.ui.client.event.Events;
    import com.extjs.gxt.ui.client.event.Listener;
    import com.extjs.gxt.ui.client.widget.Window;
    import com.google.gwt.user.client.Event;

    /**
     *
     * @author anonym
     */
    public class WindowMaximizeOnHeaderDoubleclick {

        private 
    WindowMaximizeOnHeaderDoubleclick() {
        }

        
    /**
         * 
         * @param window
         */
        
    public static void applyTo(final Window window) {
            
    window.getHeader().addListener(Events.Render, new Listener<BaseEvent>() {

                public 
    void handleEvent(BaseEvent be) {
                    
    window.getHeader().el().addEventsSunk(Event.ONDBLCLICK);
                }
            });
            
    window.getHeader().addListener(Events.OnDoubleClick, new Listener<BaseEvent>() {

                public 
    void handleEvent(BaseEvent be) {
                    if (
    window.isMaximized()) {
                        
    window.restore();
                    } else {
                        
    window.maximize();
                    }
                }
            });
        }

    usage:

    PHP Code:
    package org.yournamehere.client.forum.code.snippets;

    import com.extjs.gxt.ui.client.event.BaseEvent;
    import com.extjs.gxt.ui.client.event.Events;
    import com.extjs.gxt.ui.client.event.Listener;
    import com.extjs.gxt.ui.client.widget.Html;
    import com.extjs.gxt.ui.client.widget.Window;
    import com.google.gwt.core.client.EntryPoint;
    import com.google.gwt.user.client.Event;

    /**
     *
     * @author anonym
     */
    public class ForumThread76937 implements EntryPoint {

        public 
    void onModuleLoad() {
            
    Window window = new MyFormWindow();
            
    window.show();
        }

        class 
    MyFormWindow extends Window {

            
    MyFormWindow() {
                
    setMaximizable(true);
                
    add(new Html("Test"));

                
    WindowMaximizeOnHeaderDoubleclick.applyTo(this);
            }
        }


  2. #2
    Ext User
    Join Date
    Sep 2008
    Location
    Germany
    Posts
    961
    Vote Rating
    0
    Arno.Nyhm is on a distinguished road

      0  

    Default


    it looks there is a shorter solution there:

    I wanna WINDOW double click is maximum.
    http://www.extjs.com/forum/showthrea...321#post369321

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar