Good morning everyone!
I'm having problems with updating the look of MenuItem smartgwt. I'm leaving
the subitems disabled and enabled dynamically, but the look is not, has
problems, only updates the look when the cursor is over the icon, but needs
to be updated to access the menu, follow what I'm trying to do:

2 subitems begin disabled and are only able to access another sub-item, but
in doing so enabled this subsection which sets should be disabled.
They are disabled but the bigger problem is the question that is not dynamic
visual ... How do I pose to fix it?

The other problem is concerned a repetition of events from the keyboard, how
can I do to run a command only while precione is the shortcut key that I
generated?

HandlerRegistration logHandler = Event.addNativePreviewHandler(new
NativePreviewHandler() {

                        @Override
                        public void onPreviewNativeEvent(NativePreviewEvent
event) {
                                NativeEvent ne = event.getNativeEvent();
                                if (ne.getCtrlKey() && (ne.getKeyCode()=='l'
||
ne.getKeyCode()=='L')) {
                                        ne.preventDefault();
                                        DeferredCommand.addCommand(new
Command() {
                                                @Override
                                                public void execute() {
                                                        loggerWindow.show();

                                                }
                                        });
                                }
                        }
                });



And the last problem is with the gwt-print: cmo do I print full pages in
firefox? They are coming out blank!

package br.com.freller.tool.client;

import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.DeferredCommand;
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.UIObject;
import com.google.gwt.user.client.Timer;

public class Print {

    /**
     * If true, use a Timer instead of DeferredCommand to print the internal
fram
     */
    public static boolean USE_TIMER     = false;

    /**
     * Time in seconds to wait before printing the internal frame when using
Timer
     */
    public static int TIMER_DELAY       = 2;


    public static native void it() /*-{
        $wnd.print();
    }-*/;

    public static void it(UIObject obj) {
        it("", obj);
    }

    public static void it(Element element) {
        it("", element);
    }

    public static void it(String style, UIObject obj) {
        it(style, obj.getElement());
    }

    public static void it(String style, Element element) {
        it("", style, element);
    }

    public static void it(String docType, String style, Element element) {
        it(docType, style, DOM.toString(element));
    }

    public static void it(String docType, String style, String it) {
        it(docType
           +"<html>"
           +"<head>"
           +"<meta http-equiv=\"Content-Type\"          content=\"text/html;
charset=utf-8\">"
           +"<meta http-equiv=\"Content-Style-Type\"
content=\"text/css\">"
           +    style
           +"</head>"+"<body>"
           +    it
           +"</body>"+
           "</html>");
    }

    public static void it(String html) {
        try {
            buildFrame(html);

            if (USE_TIMER) {
                Timer timer     = new Timer() {
                        public void run() {
                            printFrame();
                        }
                    };
                timer.schedule(TIMER_DELAY * 1000);
            } else {
                DeferredCommand.addCommand(new Command() {
                        public void execute() {
                            printFrame();
                        }
                    });
            }

        } catch (Throwable exc) {
            Window.alert(exc.getMessage());
        }
    }

    public static native void buildFrame(String html) /*-{
        var frame = $doc.getElementById('__printingFrame');
        if (!frame) {
            $wnd.alert("Error: Can't find printing frame.");
            return;
        }
        var doc = frame.contentWindow.document;
        doc.open();
        doc.write(html);
        doc.close();

    }-*/;

    public static native void printFrame() /*-{
        var frame = $doc.getElementById('__printingFrame');
        frame = frame.contentWindow;
        frame.focus();
        frame.print();
    }-*/;

}

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
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.

Reply via email to