×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Regular Contributor
    Join Date
    Dec 2004
    Posts
    101

    CAknLocationEditor

    my app crashes when I select command1
    Code:
    		case ECommand1:
    			{		
    			TReal64 iLat = 21.44444;
    			TReal64 iLong = 39.33333;
    			
    			TPosition iPosition;
    			iPosition.SetCoordinate(iLat, iLong);;
    			iPosition.SetCurrentTime();
    			
    			CAknLocationEditor *editor = CAknLocationEditor::NewL(iPosition, CAknLocationEditor::ELatitudeOnly);
    			editor->ActivateL();
    	
    			CleanupStack::PopAndDestroy();
    
    			}

  2. #2
    Super Contributor
    Join Date
    Nov 2004
    Location
    Wiltshire, UK
    Posts
    3,644

    Re: CAknLocationEditor

    You cannot use Symbian controls that way, you either need to make it part of a container or put it in a form or query.

    I recommend looking at some of the example code to see how to use controls.
    Also probably look the Symbian work book to see how the Cleanup stack and resource management works.

    http://www.forum.nokia.com/info/sw.n..._Workbook.html
    Download Symbian OS now! [url]http://developer.symbian.org[/url]

  3. #3
    Regular Contributor
    Join Date
    Dec 2004
    Posts
    101

    Re: CAknLocationEditor

    what about Resource definition:
    I tried:
    -----------------------------------------------------------------------
    LATITUDE_EDITOR r_my_editor
    {
    flags = ELocationEdFlagLatitude;
    latlongresourceid = R_EIK_LATITUDE_AND_LONGITUDE;
    };
    ----------------------------------------------------------------------

    but it sayes link name not found.

  4. #4
    Super Contributor
    Join Date
    Nov 2004
    Location
    Wiltshire, UK
    Posts
    3,644

    Re: CAknLocationEditor

    Since there are two items in the structure could you have a go and tell us which one was not found?
    Thats why the build output window in carbide.c++ is provided.

    Probably you forgot to include eikctl.rsg or you are building on an unsupported SDK. The location editor is only avaliable from 3.0 FP2 and later
    Download Symbian OS now! [url]http://developer.symbian.org[/url]

  5. #5
    Regular Contributor
    Join Date
    Dec 2004
    Posts
    101

    Re: CAknLocationEditor

    OK The
    Code:
    #include <eikctl.rsg>
    WAS Missing.


    Thanks
    but any idea how to define the Latitude editor in a form.

    Code:
    RESOURCE FORM r_lat1_form_lat1_form
    	{items =
    			{
    			DLG_LINE
    				{
    				type = 
    				id = 
    				control =
                                      }
                                };
              }
    what should I provide for the type = id = control =.

  6. #6
    Super Contributor
    Join Date
    Nov 2004
    Location
    Wiltshire, UK
    Posts
    3,644

    Re: CAknLocationEditor

    The same you would as any other form contol.

    To use forms see http://library.forum.nokia.com/topic...Form_API4.html

    type = EAknCtLocationEditor;
    control = LATITUDE_EDITOR
    {
    flags = ELocationEdFlagLatitude;
    latlongresourceid = R_EIK_LATITUDE_AND_LONGITUDE;
    };
    Download Symbian OS now! [url]http://developer.symbian.org[/url]

  7. #7
    Regular Contributor
    Join Date
    Dec 2004
    Posts
    101

    Re: CAknLocationEditor

    Now for the form.cpp
    what Id should I use to define the control in the form
    Code:
    void CLAT1Form::PreLayoutDynInitL()
    	{
    	// [[[ begin generated region: do not modify [Generated Contents]
    	iLatEditor = static_cast< CAknLocationEditor* >(ControlOrNull( Id ) );
    
    	// ]]] end generated region [Generated Contents]
    	
    	LoadFromDataL();
    	}

  8. #8
    Regular Contributor
    Join Date
    Dec 2004
    Posts
    101

    Re: CAknLocationEditor

    This is My RSS code
    Code:
    RESOURCE DIALOG r_lat_query
           {
           flags = EGeneralQueryFlags;
           buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
           items =
               {
               DLG_LINE
                   {
                   type = EAknCtQuery;
                   id = EGeneralQuery;
                   control = AVKON_DATA_QUERY
       			{
       			 layout = ELocationLayout;
       			         label = STR_MyApp01ContainerView_5;
       			         control = LATITUDE_EDITOR
       			           {
       			           flags =	ELocationEdFlagLatitude;
       			           latlongresourceid = R_EIK_LATITUDE_AND_LONGITUDE;
       						};
                       };
                   }
               };
           }
    And My CPP is
    Code:
    TBool CMyApp01ContainerView::HandleLATMenuItemSelectedL( TInt aCommand )
    	{
    	_LIT( KQuery, "Use");
    	TReal64 iLat = 21.44444;
    				TReal64 iLong = 39.33333;
    				
    				TPosition iPosition;
    				iPosition.SetCoordinate(iLat, iLong);;
    				//iPosition.SetCurrentTime();
    	CAknQueryDialog* dlg = CAknQueryDialog::NewL( iPosition, CAknQueryDialog::ENoTone );
    	CleanupStack::PushL( dlg );
    	//dlg->SetPromptL( KQuery );
    	CleanupStack::Pop(); // queryDialog
    	dlg->ExecuteLD( R_LAT_QUERY );
    	return ETrue;
    	}
    but Myy App craches when I select the command .

  9. #9
    Super Contributor
    Join Date
    Nov 2004
    Location
    Wiltshire, UK
    Posts
    3,644

    Re: CAknLocationEditor

    I have create a sample on the wiki together with an example to show how to use the location editor in a real application.

    Start with my blog and work from there
    http://blogs.forum.nokia.com/blog/pa...locationeditor
    Download Symbian OS now! [url]http://developer.symbian.org[/url]

  10. #10
    Regular Contributor
    Join Date
    Dec 2004
    Posts
    101

    Re: CAknLocationEditor

    Man That is Ammazing , I have been trying to Do that since months. Believ it or not, that is the first Example in the whole WEB to diplay Locatin Coordinates editor.

    Thanks alot.

    ah one more thing.
    the Coordinates Format is DD.MM.SS.ss
    How Can I choose different format.

  11. #11
    Super Contributor
    Join Date
    Nov 2004
    Location
    Wiltshire, UK
    Posts
    3,644

    Re: CAknLocationEditor

    I think, but I am not 100% sure, like the way locale works in Symbian, the input preferences are controlled from the Location app|Positioning|Notation preferences.

    I am not aware of any API to change this from code.
    Download Symbian OS now! [url]http://developer.symbian.org[/url]

  12. #12
    Regular Contributor
    Join Date
    Dec 2004
    Posts
    101

    Re: CAknLocationEditor

    I found this in the AknLocationEd.h
    Code:
    /*
    * ==============================================================================
    *  Name        : AknLocationEd.h
    *  Part of     : EikCtl
    *  Description : Location editors 
    *  Version     :
    *
    * * ==============================================================================
    */
    private:
    	enum TLocationType
    		{
    		EDD,
    		EDMM,
    		EDMSD
    		};
    
    	TInt FieldMapping(const TInt aFieldNumber, const TLocationType aType) const;
    
    protected:
    	IMPORT_C virtual void* CAknLocationEditor_ExtensionInterface( TUid aInterface ); 
    private:
    	CLocationStrings* iStrings;
    	TLocationContext iContext;
    	};
    
    
    #endif
    Could it be of any Use.

  13. #13
    Super Contributor
    Join Date
    Nov 2004
    Location
    Wiltshire, UK
    Posts
    3,644

    Re: CAknLocationEditor

    Unfortunatly since CLocationStrings is a private structure (ie you do not have the definition for it )and internally it reads and watches the global settings for the current format and uses that.

    Changing the global settings is likely to confuse the user anyway since these are set as the default based on the locale (ie metric or imperial)
    Download Symbian OS now! [url]http://developer.symbian.org[/url]

  14. #14
    Regular Contributor
    Join Date
    Dec 2004
    Posts
    101

    Re: CAknLocationEditor

    I Still have to find out how to change the format.
    I am sure there is a way.

    because in the S60 FP1 the Landmark API Accepts only the format DD.dddd ex( 21.6683).
    and in the Later SDKs it Accepts the format DD.MM.SS.ss ex (21.40.05.90) which is used for high Accuracy.

    Check this
    [code/
    enum TLocationType
    {
    EDD,
    EDMM,
    EDMSD
    };
    [/code]

    I believe That :

    EDD = N21.12345
    EDMM = N21-40.1233
    EDMSD = N21-40-05.99
    Last edited by moja_a; 2009-08-10 at 20:02.

  15. #15
    Super Contributor
    Join Date
    Nov 2004
    Location
    Wiltshire, UK
    Posts
    3,644

    Re: CAknLocationEditor

    If you look in the location application where I suggested I think you will find on earlier releases the firmware did not support different coordinate formats - it was only introduced from FP2. This also explains why the editor control is not avaliable for FP1 and earlier in the public sdk.
    Download Symbian OS now! [url]http://developer.symbian.org[/url]

Page 1 of 2 12 LastLast

Posting Permissions

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