×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Mar 2008
    Posts
    5

    TimeAndDateEditor

    Hello,

    I edited the resource file like this:
    RESOURCE DIALOG r_smsexample_time_date_editor
    {
    flags = EGeneralQueryFlags;
    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
    items =
    {
    DLG_LINE
    {
    type = EAknCtMultilineQuery;
    //id = EMultilineFirstLine;
    control = AVKON_DATA_QUERY
    {
    layout = EMultiDataFirstTimeEd;
    label = STRING_r_smsexample_time_date_label_text;
    control = TIME_AND_DATE_EDITOR
    {
    minTimeAndDate = TIME_AND_DATE
    {
    second=0;
    minute=0;
    hour=0;
    day=0;
    month=0;
    year=2007;
    };
    maxTimeAndDate = TIME_AND_DATE
    {
    second=59;
    minute=59;
    hour=23;
    day=0;
    month=0;
    year=2030;
    };
    interveningtext=":";
    flags = EEikTimeWithoutSecondsField ;
    };
    };
    }
    };
    }

    From the source code I read this resource like this:
    ////

    iDateTime.HomeTime(); // iDateTime is TTime
    CAknTimeQueryDialog* dlg = new (ELeave) CAknTimeQueryDialog(iDateTime,
    CAknQueryDialog::ENoTone);

    return dlg->ExecuteLD(R_SMSEXAMPLE_TIME_DATE_EDITOR);
    ////
    But it always crashes and the panic is User 3:

    Please help me to resolve this problem.

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

    Re: TimeAndDateEditor

    you could try this:

    RESOURCE DIALOG r_alarm_time_query
    {
    flags = EGeneralQueryFlags;
    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
    items =
    {
    DLG_LINE
    {
    type = EAknCtMultilineQuery;
    id = EMultilineFirstLine;
    control = AVKON_DATA_QUERY
    {
    layout = EMultiDataFirstDateEd;
    label = ktx_sh_str_date;
    control = DATE_EDITOR
    {
    minDate = DATE
    {
    year = 1800;
    };
    maxDate = DATE
    {
    year = 2599;
    };
    flags = 0;
    };
    };
    },
    DLG_LINE
    {
    type = EAknCtMultilineQuery;
    id = EMultilineSecondLine;
    control = AVKON_DATA_QUERY
    {
    layout = EMultiDataSecondTimeEd;
    label = ktx_sh_str_time;
    control = TIME_EDITOR
    {
    minTime = TIME
    {
    second = 0;
    minute = 0;
    hour = 0;
    };
    maxTime = TIME
    {
    second = 59;
    minute = 59;
    hour = 23;
    };
    flags = EEikTimeWithoutSecondsField |
    EEikTimeForce24HourFormat;
    };
    };
    }
    };
    }

    And to get one time out from it, you could do this:

    TTime GetTimeL(TBool& Ok,TTime aInitialTime)
    {
    Ok = EFalse;
    TTime AlDate = aInitialTime;
    TTime AlTime = aInitialTime;


    CAknMultiLineDataQueryDialog* dlg = CAknMultiLineDataQueryDialog::NewL(AlDate,AlTime);
    if(dlg->ExecuteLD(R_ALARM_TIME_QUERY))
    {
    Ok = ETrue;
    }

    TDateTime NewAlarm(AlDate.DateTime().Year(),AlDate.DateTime().Month(),AlDate.DateTime().Day(),AlTime.DateTime().Hour(),AlTime.DateTime().Minute(), 0,0);
    TTime RetAlarm(NewAlarm);
    return RetAlarm;
    }

  3. #3
    Registered User
    Join Date
    Mar 2008
    Posts
    5

    Re: TimeAndDateEditor

    Hi Yucca,
    Thanks for the reply and that was really helpful
    i just want to know cant we set both dateandtime in a single editor
    I mean in multiline quey dialog,cant we set both lines to DATE_AND_TIME_EDITOR
    RESOURCE DIALOG r_alarm_time_query
    {
    flags = EGeneralQueryFlags;
    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
    items =
    {
    DLG_LINE
    {
    type = EAknCtMultilineQuery;
    id = EMultilineFirstLine;
    control = AVKON_DATA_QUERY
    {
    layout = EMultiDataFirstTimeEd;
    label = STRING_r_smsexample_time_date_label_text;
    control = TIME_AND_DATE_EDITOR
    {
    minTimeAndDate = TIME_AND_DATE
    {
    second=0;
    minute=0;
    hour=0;
    day=0;
    month=0;
    year=2007;
    };
    maxTimeAndDate = TIME_AND_DATE
    {
    second=59;
    minute=59;
    hour=23;
    day=0;
    month=0;
    year=2030;
    };
    flags = EEikTimeWithoutSecondsField |
    EEikTimeForce24HourFormat;
    };
    };
    },
    DLG_LINE
    {
    type = EAknCtMultilineQuery;
    id = EMultilineSecondLine;
    control = AVKON_DATA_QUERY
    {
    layout = EMultiDataSecondTimeEd;
    label = ktx_sh_str_time;
    control = TIME_AND_DATE_EDITOR
    {
    minTimeAndDate = TIME_AND_DATE
    {
    second=0;
    minute=0;
    hour=0;
    day=0;
    month=0;
    year=2007;
    };
    maxTimeAndDate = TIME_AND_DATE
    {
    second=59;
    minute=59;
    hour=23;
    day=0;
    month=0;
    year=2030;
    };
    flags = EEikTimeWithoutSecondsField |
    EEikTimeForce24HourFormat;
    };
    };
    }
    };
    }

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

    Re: TimeAndDateEditor

    Can not remember seeing such query dialog, but you could of course search SDK help documentations, and see if one exists.

  5. #5
    Registered User
    Join Date
    Mar 2008
    Posts
    5

    Re: TimeAndDateEditor

    Hi yucca,
    Thanks for the reply,but i too havent found any ,i will have a recheck
    Thanks

Posting Permissions

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