Click here to Skip to main content
Licence 
First Posted 25 Jan 2000
Views 91,783
Bookmarked 24 times

ATL Rotary Control

By | 25 Jan 2000 | Article
A rotary knob similar to that used in the Windows 2000 CD Player
  • Download source files - 67 Kb
  • Sample Image - rotary.gif

    This is an example of a simple ATL rotary control. The control is a copy of the rotary knob found on the Windows 2000 CD Player.

    The control uses a minimum and maximum value, the position is calculation using the following calculated: once the limits are reached).

    double a = -PI/4 + 3*PI/2 * (m_iMax - m_iPos)/(m_iMax - m_iMin);

    The calculation sets the minimum stop at 8 o’clock and the maximum stop is a 4 o’clock. One enhancement that could be made to the project, is the facility for a Jogger button (A button that spins 360 Degrees) increasing a value until the minimum/maximum value is reached (the button still spins, but the value remains the same.

    When the dial is moved a connection point event is fired:

    DialChanged(int nPos)

    This can be picked up in MFC, HTML page, or Visual Basic. The following methods are supported for retrieving and altering the limits and position are:

    [propget, id(1), helpstring("property DialPosition")] HRESULT DialPosition([out, retval] short *pVal);
    
    [propput, id(1), helpstring("property DialPosition")] HRESULT DialPosition([in] short newVal);
    
    [id(2), helpstring("method SetMax")] HRESULT SetMax([in] short nMax);
    
    [id(3), helpstring("method SetMin")] HRESULT SetMin([in] short nMin);
    

    Any circular bitmap can be using for the background. When the left mouse button is press the LED positional indicator pulses.

    The control has been tested with IE 5.0, Visual Basic 6.0 and MFC. One other thing to mention is that it would be rather simple to port this as MFC based CWnd class, as this how it was developed in the first place.

    License

    This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

    A list of licenses authors might use can be found here

    About the Author

    Norm .net

    Chief Technology Officer
    Software Kinetics
    United Kingdom United Kingdom

    Member

    Follow on Twitter Follow on Twitter



    Software Kinetics
    are experts in developing customised and bespoke applications and have expertise in the development of desktop, mobile and internet applications on Windows.

    We specialise in:

    • User Interface Design
    • Desktop Development
    • Windows Phone Development
    • Windows Presentation Framework
    • Windows Forms
    • Windows Communication Framework
    • Windows Services
    • Network Applications
    • Database Applications
    • Web Development
    • Web Services
    • Silverlight
    • ASP.net
     
    Visit Software Kinetics

    Sign Up to vote   Poor Excellent
    Add a reason or comment to your vote: x
    Votes of 3 or less require a comment

    Comments and Discussions

     
    You must Sign In to use this message board. (secure sign-in)
     
    Search this forum  
     FAQ
        Noise  Layout  Per page   
      Refresh
    QuestionSkinnable? PineditorHeath Stewart5:51 15 Jul '03  
    GeneralImplemetation problem Pinmember""23:24 5 Jun '03  
    GeneralRe: Implemetation problem PineditorHeath Stewart5:47 15 Jul '03  
    GeneralControl dissapears PinmemberAnonymous12:38 23 Feb '02  
    GeneralRe: Control dissapears PinmemberAnonymous12:18 26 Feb '02  
    GeneralRe: Control dissapears PinmemberNorm Almond3:05 1 Nov '02  
    GeneralMFC sample program PinmemberAnonymous8:19 20 Feb '02  
    GeneralGreat but ... PinmemberDjibril22:13 13 Jan '02  
    GeneralRe: Great but ... PinmemberNorm Almond21:05 15 Jan '02  
    GeneralRe: Great but ... PinmemberDjibril22:48 15 Jan '02  
    GeneralRe: Great but ... PinmemberNorm Almond2:12 18 Jan '02  
    GeneralAlso Linker Error Please Help PinmemberThorben Burghardt20:32 25 Jul '01  
    GeneralRe: Also Linker Error Please Help PinmemberNorm Almond21:12 25 Jul '01  
    Generallinker errors PinsussGregory Franz9:45 7 Mar '00  
    GeneralRe: linker errors PinmemberAnonymous23:12 4 Mar '02  
    GeneralRe: linker errors PinsussAlmighty2:27 1 Nov '02  
    Questionhow do i view the control in the demo? Pinsuss-2:25 29 Jan '00  
    AnswerRe: how do i view the control in the demo? Pinmemberharrisonkirk9:46 25 Oct '05  

    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

    Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

    Permalink | Advertise | Privacy | Mobile
    Web01 | 2.5.120517.1 | Last Updated 26 Jan 2000
    Article Copyright 2000 by Norm .net
    Everything else Copyright © CodeProject, 1999-2012
    Terms of Use
    Layout: fixed | fluid