Gelmiş geçmiş en büyük porno sitemiz olan 2pe de her zaman en kaliteli pornoları sunmayı hedefledik. Diğer video sitemiz olan vuam da ise hd porno ağırlıklı çalışmalara başladık.

  1. #1
    Sencha User
    Join Date
    Dec 2010
    Posts
    51
    Vote Rating
    1
    aminef is on a distinguished road

      0  

    Default Problem with Slider and Events.OnMouseUp

    Problem with Slider and Events.OnMouseUp


    I am trying to have the value of the slider only when the mouse is release, this event is fired if I click and release the slider bar itself but not when I drag and release the slider cursor.


    Code:
                Slider pageSlider = new Slider();
    	    pageSlider.addListener(Events.OnMouseUp, new Listener<SliderEvent>() {
    
    			@Override
    			public void handleEvent(SliderEvent be) {
    				//do stuff...
    			}
    		});
    I am using google Chrome as a browser and gxt 2.2.0

  2. #2
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      -1  

    Default


    Why do you think this is a bug? If themouse up happens outside of the component, than this code would not get it, because you only listen to the mouseup within the component.

    You need to use native event preview for example.

  3. #3
    Sencha User
    Join Date
    Dec 2010
    Posts
    51
    Vote Rating
    1
    aminef is on a distinguished road

      1  

    Default


    It doesn't happen in both cases (inside or outside the slider) so I figured it might be a bug, sorry for the confusion anyway. But it doesn't catch the OnMouseUp when you use the slider control, but it does when you use the slider bar

  4. #4
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      -1  

    Default


    I would use a completly different approach.

    1) You can use the change event with a Timer. If the Change event fires two times within a given amount of time, cancel the timer and reschedule it.

    2) Extend Slider and override onDragEnd and add your custom logic.

  5. #5
    Sencha User
    Join Date
    Dec 2010
    Posts
    51
    Vote Rating
    1
    aminef is on a distinguished road

      0  

    Default


    That was exactly what I was trying to do ( solution 1 ) by adding this inside the handleEvent

    Code:
    DelayedTask delay = new DelayedTask(this);
    				delay.delay(1000);

  6. #6
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    This would always recreate the task, meaning you have it still fire all the time, just one second later. You need to cancel the previes one (do not revreate DelayedTask)

  7. #7
    Sencha User
    Join Date
    Dec 2010
    Posts
    51
    Vote Rating
    1
    aminef is on a distinguished road

      0  

    Default


    It's funny but it seems impossible to create the delayTask outside the listener (it needs a listener to create it, and not null one). Do you have any tips for how to create this delayTask please?

  8. #8
    Software Architect
    Join Date
    Sep 2007
    Posts
    13,971
    Vote Rating
    132
    sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light sven is a glorious beacon of light

      0  

    Default


    Code:
     slider.addListener(Events.Change, new Listener<SliderEvent>() {
    
          DelayedTask t = new DelayedTask(new Listener<BaseEvent>() {
    
            public void handleEvent(BaseEvent be) {
              System.out.println("test");
    
            }
          });
    
          public void handleEvent(SliderEvent be) {
            t.delay(1000);
          }
        });

  9. #9
    Sencha User
    Join Date
    Dec 2010
    Posts
    51
    Vote Rating
    1
    aminef is on a distinguished road

      0  

    Default


    Thank you sven!
    It works perfectly

  10. #10
    Sencha User
    Join Date
    Dec 2010
    Posts
    51
    Vote Rating
    1
    aminef is on a distinguished road

      0  

    Default


    I also have just one question if you don't mind:
    What the difference between events that start with "on" like "Events.onChange" and the events that are without like "Events.Change"?

Similar Threads

  1. [3.2] Ext.ux.slider.Highlight - A slider background color plugin
    By mankz in forum Ext 3.x: User Extensions and Plugins
    Replies: 8
    Last Post: 8 Feb 2012, 5:03 AM
  2. [OPEN-979] Ext.form.SliderField -> Slider events
    By tobiu in forum Ext 3.x: Bugs
    Replies: 6
    Last Post: 30 Mar 2011, 2:58 AM
  3. Replies: 2
    Last Post: 19 Sep 2010, 11:48 PM
  4. Replies: 2
    Last Post: 21 Nov 2007, 6:17 AM

Thread Participants: 2