×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    May 2008
    Posts
    29

    developing gui based calculator

    Hi,

    I am implementing a calculator in symbian which look as same as windows(desktop) calculator. I have read a post by stenlik in nokia forum itself that its difficult for newbie to develop a calculator in symbian but i have to develop it. I am completed with the gui part plz do help me in following sections:

    1) As there will be only one editor box so my code for a+b=c should work like first it display "a" and as i press "+" a should be stored in some memory or buffer and "0" should be displayed on editor and now "b" will be displayed and on pressing "=" it should as the b with memory data and display again on the same editor . So how should i proceed in that help with sample code.

    2)As calculator is aligned from the right side how i can achieve that.

    3)How to handle the button on the calculator in the gui and how to get the coordinate of mouse movement so that button can be pressed from emulator.

    4)how to handle MC , MR , MS , M+ of the calculator.

    plz send the sample codes also and if any body is having code of calculator on one editor box and button handling then plz do send me.

    Thanks and Regards
    Amrish

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,567

    Re: developing gui based calculator

    1) Yes, this is how calculators work. What kind of sample code do you expect? Editor examples already exist in the Wiki.
    2) Align your text to the right. CEikEdwin::SetAlignment can do that for you, or it might be already the default for numeric editors (like CEikFloatingPointEditor or CEikNumberEditor). If you decide to simply use DrawText, it also supports alignment
    3) you have to draw your buttons for yourself, then HandlePointerEventL can give you pointer events. Note that you have no "mouse" in current S60 devices
    4) the functionality of M-buttons is still documented in the User's manual / the Help, as suggested in your older post http://discussion.forum.nokia.com/fo...d.php?t=136637

  3. #3
    Regular Contributor
    Join Date
    Jun 2008
    Posts
    108

    Re: developing gui based calculator

    Hi Amrish,
    I am a fresher in symbian C++,have a basic idea on a simple calculator,having problems with gui.
    How do i create buttons in GUI?
    How do i create text boxes?
    Please help me in GUI development.
    cheers,
    Remesh

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,567

    Re: developing gui based calculator

    Quote Originally Posted by remesh View Post
    Hi Amrish,
    I am a fresher in symbian C++,have a basic idea on a simple calculator,having problems with gui.
    You can find generic GUI documents on FN main site: www.forum.nokia.com Documentation/Symbian C++ on the left, UI. Of course there are other interesting sections as well, like Getting Started, General Architecture/Design, etc.
    An other good source is the Wiki, try simple search queries like editor, they reveal useful info.

  5. #5
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,335

    Smile Re: developing gui based calculator

    Just to add with Wizard,

    There is e-Learning section available which will be useful to you in learning S60 modules.

    http://www.forum.nokia.com/main/tech...urriculum.html

    Kiran.
    Nokia Developer Wiki Moderation team

  6. #6
    Registered User
    Join Date
    May 2008
    Posts
    29

    Re: developing gui based calculator

    hi remesh
    Yet my calculator implementation is on devlopment phase but i have complete the GUI section. Well I want to know that you are developing just a simple calculator which can perform basic mathematical operations or there are some extra features in that.

    As I am devloping the calculator is as same as windows(desktop)If you are calculator which is a bit difficult as you have to handle all the things in one numeric box, on the other hand if you are thinking of developing just a basic calculator then you can take input in two different numeric box and can give the command on offerKeyevent() and display that on the third one as result.

    Now it depends on you that how you implement.

    Amrish

    1) For Editor

  7. #7
    Registered User
    Join Date
    May 2008
    Posts
    29

    Re: developing gui based calculator

    hi,
    For editor window i want restrict that for digits only apto 12 digit but i am not able to do so.Below is my code::

    In RSS
    RESOURCE EDWIN R_EDWIN
    {
    flags = EAknEditorFlagNoT9;
    width = 100;
    lines= 10;
    maxlength = 15; // Max number of characters
    allowed_input_modes = EAknEditorNumericInputMode;
    default_input_mode = EAknEditorNumericInputMode;

    }
    In APPVIEW

    void CCalculatorAppView::ConstructL(const TRect& aRect)
    {

    // Create a window for this application view
    CreateWindowL();

    TResourceReader reader;
    iCoeEnv->CreateResourceReaderLC(reader,R_EDWIN );
    iEditor = new (ELeave) CEikFloatingPointEditor;
    iEditor->SetContainerWindowL(*this);
    iEditor->ConstructFromResourceL(reader);
    // iEditor->SetSize(aRect.Size());
    iEditor->SetExtent(TPoint(15,20),TSize(200,25));
    iEditor->SetFocus(ETrue);
    iEditor->SetAknEditorInputMode(EAknEditorNumericInputMode );
    iEditor->SetAlignment(3);

    // iEditor->SetEdwinObserver(this);
    CleanupStack::PopAndDestroy();
    }
    plz help me out that where I am going wrong and what changes should I go for

    Thanks and Regards
    Amrish

Similar Threads

  1. Problem developing canvas based application for N95
    By shallu_taneja in forum Mobile Java Tools & SDKs
    Replies: 2
    Last Post: 2007-09-07, 06:20
  2. Developing a location based application
    By avi1000 in forum General Development Questions
    Replies: 3
    Last Post: 2007-08-15, 12:17
  3. Engine instantiating the GUI in a new thread
    By savvy in forum Symbian C++
    Replies: 4
    Last Post: 2007-05-15, 15:03
  4. Replies: 3
    Last Post: 2007-02-02, 12:16
  5. Developing GUI Front End for MIDP 2.0
    By earamsey in forum Mobile Java General
    Replies: 0
    Last Post: 2005-08-16, 18:00

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •