×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Oct 2007
    Posts
    38

    Query Initial Value

    Hi!
    Lets say i want to have a Single Data Input Query:

    RESOURCE DIALOG r_aknexquery_data_query
    {
    flags = EGeneralQueryFlags;
    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
    items =
    {
    DLG_LINE
    {
    type = EAknCtQuery;
    id = EGeneralQuery;
    control = AVKON_DATA_QUERY
    {
    layout = EDataLayout;
    label = STRING_r_aknexquery_data_label_text;
    control = EDWIN
    {
    flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
    width = AKNTAQUERY_EDWIN_WIDTH;
    maxlength = AKNTAQUERY_EDWIN_MAXLENGTH;
    max_view_height_in_lines = AKNEXQUERY_EDWIN_LINES;
    base_line_delta = 21;
    };
    };
    }
    };
    }

    What do i have to do to set some random text to be displayed in the query as it shows up?
    Tnx for your help!

  2. #2
    Regular Contributor
    Join Date
    Oct 2007
    Location
    Coimbatore,India
    Posts
    114

    Re: Query Initial Value

    Quote Originally Posted by jurekr View Post
    Hi!
    Lets say i want to have a Single Data Input Query:

    RESOURCE DIALOG r_aknexquery_data_query
    {
    flags = EGeneralQueryFlags;
    buttons = R_AVKON_SOFTKEYS_OK_CANCEL;
    items =
    {
    DLG_LINE
    {
    type = EAknCtQuery;
    id = EGeneralQuery;
    control = AVKON_DATA_QUERY
    {
    layout = EDataLayout;
    label = STRING_r_aknexquery_data_label_text;
    control = EDWIN
    {
    flags = EEikEdwinNoHorizScrolling | EEikEdwinResizable;
    width = AKNTAQUERY_EDWIN_WIDTH;
    maxlength = AKNTAQUERY_EDWIN_MAXLENGTH;
    max_view_height_in_lines = AKNEXQUERY_EDWIN_LINES;
    base_line_delta = 21;
    };
    };
    }
    };
    }

    What do i have to do to set some random text to be displayed in the query as it shows up?
    Tnx for your help!

    Hi,

    While you write the code for invoking this resource, you have to
    create a dialog like CAknTextQueryDialog.

    During instantiation, you have to pass a TDes value as a
    parameter in NewL function. That parameter value will be
    displayed initially in the dialog. You can add any value in it.

  3. #3
    Registered User
    Join Date
    Oct 2007
    Posts
    38

    Re: Query Initial Value

    Quote Originally Posted by spinner84 View Post
    Hi,

    While you write the code for invoking this resource, you have to
    create a dialog like CAknTextQueryDialog.

    During instantiation, you have to pass a TDes value as a
    parameter in NewL function. That parameter value will be
    displayed initially in the dialog. You can add any value in it.
    Sorry about this, but i am still very new to Symbian. If I understand you correctly, i need to pass textData as a TDes value parameter? How can i do that. Can you give me an example? Thank you very much!

    void CChatContainer::ShowDataQueryL(
    const TInt aQueryResourceId,
    const TInt aTextResourceId,
    const TInt aPromptResoureId,
    const TInt aMaxLength,
    const TBool aDisplayFlag,
    TDes& aText )
    {

    iDisplayDialog = ETrue;

    TBuf<KChatTextBufLength> textData;

    if ( aTextResourceId )
    {
    iCoeEnv->ReadResourceL( textData, aTextResourceId );
    }

    CAknTextQueryDialog* dlg = CAknTextQueryDialog::NewL(
    textData, CAknQueryDialog::ENoTone );
    CleanupStack::PushL( dlg );

    if ( aPromptResoureId )
    {
    TBuf<KChatTextBufLength> prompt;
    iCoeEnv->ReadResourceL( prompt, aTextResourceId );
    dlg->SetPromptL( prompt );
    }

    if ( aMaxLength )
    {
    dlg->SetMaxLength( aMaxLength );
    }

    CleanupStack::Pop( dlg );
    TBool answer( dlg->ExecuteLD( aQueryResourceId ) );

    if ( aDisplayFlag && answer )
    {
    HBufC* buffer = HBufC::NewLC( KMessageHeaderLen +
    textData.Length() );

    buffer->Des().Append( '<' );
    buffer->Des().Append( '\t' );
    buffer->Des().Append( textData );
    // add the message to the list
    iMessageList->AppendL( *buffer );
    CleanupStack::PopAndDestroy( buffer );

    // tell the control about the change
    iListBox->HandleItemAdditionL();
    }

    iDisplayDialog = EFalse;

    // get message
    aText = textData;

    DrawNow();
    }

  4. #4
    Regular Contributor
    Join Date
    Oct 2007
    Location
    Coimbatore,India
    Posts
    114

    Re: Query Initial Value

    You are right.. textdata's value will be displayed initially.

    I think you got this code from Query example..
    Well, It depends upon your need to use the same code.
    If you just want to design a simple query input dialog, then you may ommit several lines in it.

    Simple code to display the input dialog is
    Code:
    _LIT(KInitialText,"InitialText");
    
    TBuf<20> textData(KInitialText);
    
    CAknTextQueryDialog* dlg = CAknTextQueryDialog::NewL(
    textData, CAknQueryDialog::ENoTone );
    dlg->ExecuteLD(R_AKNEXQUERY_DATA_QUERY);// Your input dialog name 
                                            // from .rss file
    Last edited by spinner84; 2007-11-23 at 09:38.

  5. #5
    Registered User
    Join Date
    Oct 2007
    Posts
    38

    Re: Query Initial Value

    nvm, got it. tnx anyways :)

    EDIT: ups sorry, i didn't see your responce before. i didnt refresh my page when i was typing. That code was from Query example, yes:)
    Thank you very much again spinner ;)
    Last edited by jurekr; 2007-11-23 at 11:26.

Similar Threads

  1. I cannot send query string to the servlet
    By raghda in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2007-09-10, 07:23
  2. Query regarding pkg file syntax
    By vinayakak in forum Symbian
    Replies: 1
    Last Post: 2006-11-06, 12:14
  3. Multiline Query in 3rd edition sdk
    By parag_purkar in forum Symbian User Interface
    Replies: 1
    Last Post: 2006-09-26, 03:54
  4. Query problem
    By samweb in forum Symbian
    Replies: 2
    Last Post: 2004-07-05, 10:03
  5. php query problem in nokia
    By datareceived in forum Browsing and Mark-ups
    Replies: 0
    Last Post: 2002-12-10, 11:43

Posting Permissions

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