Use of Slide bars

Source: Internet
Author: User

Use of Slide bars

 

  1. Write the pre-declaration in the header file of the container:

    Class CAknSlider;

  2. Define the CAknSlider pointer variable
    CAknSlider * iSlider;
  3. Slide bar definition in Rss files
    Resource slider r_my_slider {layout = EAknFormSliderLayout3; minvalue = 0; maxvalue = 100; step = 1; valuetype = EAknSliderValueBareFigure; minlabel = "0"; maxlabel = "100 ";

    }

     

  4. Add references to the container code file:

    # Include <aknslider. h>

  5. Create a slide in the code file
    Void CsliderContainer: ConstructL (const TRect & aRect) {create1_wl (); TResourceReader aReader; CEikonEnv: Static ()-> events (aReader, R_MY_SLIDER); iSlider = new (ELeave) CAknSlider; iSlider-> HandleResourceChange (changes); iSlider-> setcontainer1_wl (* this); iSlider-> ConstructFromResourceL (aReader); CleanupStack: PopAndDestroy (); // iSlider-> SetObserver (this); iSlider-> SetMaximumTextL (_ L ("max"); SetRect (aRect); ActivateL ();}

    Use ResourceReader to add the header file of barsread. h

  6. Add button
    Add TKeyResponse OfferKeyEventL (const TKeyEvent & aKeyEvent, TEventCode aType); declared in the header file
    Add implementation methods in the code file
    TKeyResponse CsliderContainer: OfferKeyEventL (const TKeyEvent & aKeyEvent, TEventCode aType) {return iSlider-> OfferKeyEventL (aKeyEvent, aType );}

 

Anping 2009 @ original
Qi_jianzhou@126.com

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.