×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Regular Contributor
    Join Date
    Sep 2009
    Location
    India
    Posts
    172

    How to add clickable icon image

    Hello All,

    I my application I have to add one background image (already added), after that add four small image on screen. this image will be clickable, On click event I have perform the operation.

    So, Please help for adding the clickable image on screen.
    Thanks,
    Amit

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,144

    Re: How to add clickable icon image

    I suppose you have a CCoeControl based container that draws the background. So you could just define 4 rectange areas, draw the images into them, and then see in pointer handling function whether the pointer event is inside any of those four rectangles.

  3. #3
    Regular Contributor
    Join Date
    Sep 2009
    Location
    India
    Posts
    172

    Re: How to add clickable icon image

    Hi Yucca,

    Thanks for your reply.
    I have added twi icon image from UI design. then select the "Handle 'state changed' Event " the framework generate the following code in container.cpp
    Code:
    void CTestIconContainer::HandleImage1StateChangedL( 
    		CCoeControl* /* aControl */, 
    		TCoeEvent /* anEvent */ )
    	{
    	// TODO: implement stateChanged event handler
    	CEikonEnv::Static()->InfoWinL(_L("On icon"),_L("")); // written by me
    	}
    but I didn't see any focus on image icon to press select button.
    Thanks,
    Amit

  4. #4
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,144

    Re: How to add clickable icon image

    I never have used the UI designer really, and would not know who and when would be calling the HandleImage1StateChangedL() function. Basically I was refering for doing the code manually.

  5. #5
    Regular Contributor
    Join Date
    Sep 2009
    Location
    India
    Posts
    172

    Re: How to add clickable icon image

    Hi Yucca,

    Can I get some code snippet to add clickable image icon manually.
    Thanks,
    Amit

  6. #6
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,144

    Re: How to add clickable icon image

    I'm not having too good links at the moment (but you could maybe do additional search), anyway, you can get the pointer events in CCoeControls's HandlePointerEventL function: http://library.forum.nokia.com/index...2ADEE1D82.html

    Then tou would just see whether the type is EButton1Down, and see whether the pointer is inside any of the rect areas you have. It is is then flag it with a member variable. And wait for EButton1Up and see whether it is still on the same area, and if it is, then execute the command.

    also you could call DrawNow() after each pointer event, and if the flag is set, show the pointer down with graphics. Note that you could also get the drag events.

Similar Threads

  1. How to add icon to the listbox
    By siva_321 in forum Symbian
    Replies: 9
    Last Post: 2009-10-21, 10:36
  2. Clickable Image
    By swarna.nokia in forum Mobile Java Media (Graphics & Sounds)
    Replies: 9
    Last Post: 2009-06-26, 13:59
  3. clickable area of an image by j2me
    By mramin05 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 8
    Last Post: 2008-11-26, 07:48

Posting Permissions

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