202 // CLmkEditorNumberField::CreateAvkonUnitEditorL |
202 // CLmkEditorNumberField::CreateAvkonUnitEditorL |
203 // ---------------------------------------------------- |
203 // ---------------------------------------------------- |
204 // |
204 // |
205 void CLmkEditorNumberField::CreateAvkonUnitEditorL() |
205 void CLmkEditorNumberField::CreateAvkonUnitEditorL() |
206 { |
206 { |
207 // Create Distance editor using AVKON's unit editor |
207 // Create Distance editor using AVKON's unit editor |
208 // and insert a line in the dialog |
208 // and insert a line in the dialog |
209 iControl = static_cast<CAknUnitEditor*>( iUiBuilder.CreateLineL( |
209 iControl = static_cast<CAknUnitEditor*>( iUiBuilder.CreateLineL( |
210 FieldLabel(), LandmarkItemField().UniqueFieldIdentity(), |
210 FieldLabel(), LandmarkItemField().UniqueFieldIdentity(), |
211 EAknCtUnitEditor ) ); |
211 EAknCtUnitEditor ) ); |
212 //read control from resource file. |
212 |
213 TResourceReader reader; |
213 |
214 iEnv->CreateResourceReaderLC(reader, R_LMK_UNIT_EDITOR); |
214 |
215 iControl->ConstructFromResourceL(reader); |
|
216 CleanupStack::PopAndDestroy();// reader |
|
217 ResolveUnitL(); |
|
218 |
|
219 // Obtain the current system of measurement |
215 // Obtain the current system of measurement |
220 TInt sysOfMeasurement = EAknUnitEditorMeter; |
216 TInt sysOfMeasurement = EAknUnitEditorMeter; |
221 if( !IsSystemUnitMetric()) |
217 if( !IsSystemUnitMetric()) |
222 { |
218 { |
223 sysOfMeasurement = EAknUnitEditorFoot; |
219 sysOfMeasurement = EAknUnitEditorFoot; |
224 } |
220 } |
|
221 |
|
222 //read control from resource file. |
|
223 TResourceReader reader; |
|
224 if( sysOfMeasurement == EAknUnitEditorMeter) |
|
225 { |
|
226 iEnv->CreateResourceReaderLC(reader, R_LMK_UNIT_EDITOR_METRIC); |
|
227 } |
|
228 else |
|
229 { |
|
230 iEnv->CreateResourceReaderLC(reader, R_LMK_UNIT_EDITOR_IMPERIAL); |
|
231 } |
|
232 |
|
233 iControl->ConstructFromResourceL(reader); |
|
234 CleanupStack::PopAndDestroy(); //reader |
|
235 ResolveUnitL(); |
225 |
236 |
226 /* |
237 /* |
227 if ( LandmarkItemField().FieldType() == EPositionAccuracy || |
238 if ( LandmarkItemField().FieldType() == EPositionAccuracy || |
228 LandmarkItemField().FieldType() == EAltitudeAccuracy ) |
239 LandmarkItemField().FieldType() == EAltitudeAccuracy ) |
229 { |
240 { |