Brendan -- and anyone else implementing drag functionality --
 
  as a general rule, the way you should implement drag functionality is:
 
- add a mousedown handler to the thing you want to drag.
   - on mouse down, add a mouse move and mouse listener handler _to the
systemManager_, _in the capture phase_.
   - on mouse move, update your data.  Keep in mind that the mouse event
x/y for mouse move will be in systemManager coordinates, so either use
mouseX/mouseY off of the original target, or convert all coordinates to
global before doing any computations.
  - on mouse up, remove your move/up handlers _from the system manager_
during _capture phase_.
 
That will fix the problem with your current example where the drag
breaks when you move the mouse too quickly.
 
Ely.
 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Brendan Meutzner
Sent: Monday, March 12, 2007 5:34 PM
To: [email protected]
Subject: Re: [flexcoders] custom charting component question



Hey,

I've added in some drag functionality, and an updated version of Doug's
slider.  Have had some great feedback from this, so by all means, keep
the suggestions coming!

http://www.stretchmedia.ca/code_examples/chart_range_selection/main.html
<http://www.stretchmedia.ca/code_examples/chart_range_selection/main.htm
l> 

Brendan




On 3/12/07, Brendan Meutzner < [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> > wrote: 

        Hey Adam,
        
        So dragging the bottom part would be pretty straightforward,
just need to add the appropriate methods to the inner canvas.  If your
drag updates your slider, then you can use the properties in the Slider
class for snapping to values.  Changing the horizontalGap,
dividerAffordance, etc... in the HDividedBox on the bottom chart should
get the visual appearance you want. 
        
        The one thing I was pondering over was dragging the main chart
(like google finance does).  Ely, can you shed some light on the best
way to accomplish this?
        
        
        Brendan 
        
        
        
        
        On 12 Mar 2007 05:03:33 -0700, Adam Royle <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> > wrote: 

                

                Thanks for the example Brendan! I am wondering, is it
possible with the current structure to skin your component to look
exactly like this?
                
                 
                http://sleekgeek.com.au/daterange_example.gif
<http://sleekgeek.com.au/daterange_example.gif> 
                 
                And also a few extra features such as click and drag of
the main section (not the slider), and even snap-to certain data points
when dragging?
                 
                I need to know whether I should attempt modification of
what you've made, or use another combination of components.
                 
                Thanks,
                Adam
                 

                        
                        ----- Original Message ----- 
                        From: Brendan Meutzner
<mailto:[EMAIL PROTECTED]>  
                        To: [email protected]
<mailto:[email protected]>  
                        Sent: Saturday, March 10, 2007 10:19 AM
                        Subject: Re: [flexcoders] custom charting
component question

                        

                        Voila...
http://www.stretchmedia.ca/blog/index.cfm/2007/3/9/Flex-Chart-Range-Sele
ctor--Google-Financeish
<http://www.stretchmedia.ca/blog/index.cfm/2007/3/9/Flex-Chart-Range-Sel
ector--Google-Financeish> 
                        
                        
                        
                        
                        

                        On 08 Mar 2007 01:54:19 -0800, Tom Chiverton <
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> >
wrote: 

                                On Wednesday 07 Mar 2007, Adam Royle
wrote:
                                > Eg. Should I use composition of a few
charts and a draggable invisible 
                                > button placed inside a canvas? I had
an idea of having two AreaCharts, one
                                > that is greyed out and the other that
is coloured, and have a mask to only
                                > display the portion that is required?
                                
                                Use a two-button horizontal slider, and
draw a transparent rectangle over the 
                                chart based on the sliders values.
                                
                                --
                                Tom Chiverton
                                Helping to enormously industrialize
cross-platform e-tailers
                                On: http://thefalken.livejournal.com
<http://thefalken.livejournal.com> 
                                
        
**************************************************** 
                                
                                This email is sent for and on behalf of
Halliwells LLP.
                                
                                Halliwells LLP is a limited liability
partnership registered in England and Wales under registered number
OC307980 whose registered office address is at St James's Court Brown
Street Manchester M2 2JF.  A list of members is available for inspection
at the registered office. Any reference to a partner in relation to
Halliwells LLP means a member of Halliwells LLP. Regulated by the Law
Society. 
                                
                                CONFIDENTIALITY
                                
                                This email is intended only for the use
of the addressee named above and may be confidential or legally
privileged.  If you are not the addressee you must not read it and must
not use any information contained in nor copy it nor inform any person
other than Halliwells LLP or the addressee of its existence or contents.
If you have received this email in error please delete it and notify
Halliwells LLP IT Department on 0870 365 8008. 
                                
                                For more information about Halliwells
LLP visit www.halliwells.com <http://www.halliwells.com> .
                                
                                
                                
                                --
                                Flexcoders Mailing List 
                                FAQ:
http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
<http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt> 
                                Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com
<http://www.mail-archive.com/flexcoders%40yahoogroups.com> 
                                Yahoo! Groups Links 
                                
http://groups.yahoo.com/group/flexcoders/
<http://groups.yahoo.com/group/flexcoders/> 
                                
http://groups.yahoo.com/group/flexcoders/join
<http://groups.yahoo.com/group/flexcoders/join> 
                                    (Yahoo! ID required)
                                
mailto:[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> 
                                    mailto:
[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> 
                                
[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> 
                                
<http://docs.yahoo.com/info/terms/> 
                                
                                




                        -- 
                        Brendan Meutzner 
                        Stretch Media - RIA Adobe Flex Development
                        [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> 
                        http://www.stretchmedia.ca
<http://www.stretchmedia.ca>  

                        

                        

                

                




        -- 
        Brendan Meutzner
        Stretch Media - RIA Adobe Flex Development
        [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> 
        http://www.stretchmedia.ca <http://www.stretchmedia.ca>  




-- 
Brendan Meutzner
Stretch Media - RIA Adobe Flex Development
[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> 
http://www.stretchmedia.ca <http://www.stretchmedia.ca>  

 

Reply via email to