Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    How to add a mouseClickListener to a scrollbar or addDragResizeStartHandler?

    I am trying to attach a mouse listener to a ResizeBar but have not been successful.

    Code:
    final VLayout layout = new VLayout();
    layout.setAlign(Alignment.CENTER);
    layout.setOverflow(Overflow.SCROLL);
    layout.setShowResizeBar(true);
    layout.setVisible(true);
    I want to catch the user trying to resize the VLayout but I want to catch the event before the resize is finished. In other words I want a addDragResizeStartHandler but for some reason I can not get it to work.

    I have been able to add a Resize handler:
    layout.addResizedHandler(new ResizedHandler() {
    @Override
    public void onResized(ResizedEvent event) {
    Log.debug("Resize handler");
    }
    });

    But that is not what I want.

    Code:
    layout.addDragResizeStartHandler(new DragResizeStartHandler() {
             @Override
             public void onDragResizeStart(DragResizeStartEvent event) {
                //I cant get this handler to fire
             }
    });
    Is there a way to either listen to mouseDown on a ResizeBar or attach a listener to catch the user trying to resize the VLayout (before it has been resized).
    Last edited by Jolie; 10 Jul 2011, 02:28.

    #2
    Any thoughts on this problem?

    Comment


      #3
      Hey Jolie,
      What exactly are you trying to achieve ?

      Comment


        #4
        I have placed google maps in a div-tag since I have been unable to place it in a smart gwt container. All around I have smart gwt widgets that are resizable. I can only make the smart gwt widgets smaller since the rest of the space is occupied by the map. When the user tries to resize I can increase the size of the underlying (invisible) smart gwt container making it possible to make the widgets larger.

        The problem is that I cant detect when the user clicks the resize bar or catch the event DragResizeStart.

        Comment


          #5
          Just use the ResizedEvent rather than trying to catch these indirect notifications.

          Comment


            #6
            Originally posted by Isomorphic
            Just use the ResizedEvent rather than trying to catch these indirect notifications.
            I can only use ResizedEvent when widgets has been resized to a smaller size. I am unable to increase the size of smart GWT widgets because google maps is placed in a div tag (I have not been able to place it in a smart GWT container).

            Comment


              #7
              Google Maps works inside SmartGWT containers. The QuickStart Guide has a brief discussion about how to do this (basically create a DIV with a known ID as contents for an HTMLFlow, and have Google Maps take over that DIV). On the forums you can find various users succeeding with this approach.

              Comment


                #8
                I have not been able to find any reference regarding HTMLFlow in the QuickStart Guide. Also where are the forum posts with users succeeding with Google Maps that you are talking about?

                I would really appreciate some code showing the prefered method to successfully add Google Maps to a Smart GWT component, or even GWT component if it is recommended.

                Comment


                  #9
                  Take a look here :

                  http://forums.smartclient.com/showthread.php?t=10509

                  Comment


                    #10
                    Originally posted by jmichelgarcia
                    Take a look here :

                    http://forums.smartclient.com/showthread.php?t=10509
                    Thank you for your effort finding something related to Google Maps/Earth but I am not trying to integrate the Google Maps GWT Library with GWT. The Google Maps GWT Library can actually fairly easily be added to many GWT and Smart GWT containers.

                    What I want to do is integrate Google maps Javascript API v3 with Smart GWT or GWT http://code.google.com/apis/maps/documentation/javascript/basics.html

                    I need to integrate something similar to this with Smart GWT:
                    Code:
                    function initialize() {
                      var myLatlng = new google.maps.LatLng(-34.397, 150.644);
                      var myOptions = {
                        zoom: 8,
                        center: myLatlng,
                        mapTypeId: google.maps.MapTypeId.ROADMAP
                      }
                      var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
                    }
                      
                    function loadScript() {
                      var script = document.createElement("script");
                      script.type = "text/javascript";
                      script.src = "http://maps.googleapis.com/maps/api/js?sensor=false&callback=initialize";
                      document.body.appendChild(script);
                    }
                      
                    window.onload = loadScript;
                    I want to add Google Maps Javascript API v3 to some Smart GWT container in a way which makes it behave as any other container making it possible to resize/move the container.

                    Comment


                      #11
                      Hey Jolie,

                      Untill someone from Isomorphic replies to you, have you see this ?

                      http://forums.smartclient.com/showthread.php?t=8159#aContainer

                      Comment

                      Working...
                      X