Hybrid View

  1. #1
    Ext User
    Join Date
    Sep 2008
    Location
    Germany
    Posts
    961
    Vote Rating
    1
    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
    1
    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

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi