×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Sep 2005
    Posts
    10

    Can't change control position in dialog

    I'm having a problem changing the position of a control in a dialog. I've stripped things down to a very simple example, but still can't get it to work. I thought that calling SetPosition() on the control in the dialog's PostLayoutDynInitL() is all one had to do. The resource defines a dialog with one control - a label:

    RESOURCE DIALOG r_help_dialog
    {
    flags = EEikDialogFlagNoDrag |
    EEikDialogFlagFillAppClientRect |
    EEikDialogFlagWait |
    EEikDialogFlagCbaButtons ;
    buttons = R_AVKON_SOFTKEYS_OK_EMPTY;
    items =
    {
    DLG_LINE
    {
    id = EHelpDialogLabel;
    type = EEikCtLabel;
    control = LABEL
    {
    txt = STR_HELP_SECTION_HEAD_1;
    };
    }
    };
    }

    In PostLayoutDynInitL() I get the control, then move it over and down:

    void CHelpDialog::PostLayoutDynInitL()
    {
    CEikLabel* label = static_cast< CEikLabel* >( ControlOrNull( EHelpDialogLabel ) );

    label->SetPosition( TPoint( 10, 50 ) );
    }

    When the app runs the label text appears at ( 0, 0 ), as if SetPosition() did nothing. Ideas?

    Thanks,

    Dan

  2. #2
    Regular Contributor
    Join Date
    Jul 2007
    Location
    Dublin
    Posts
    240

    Re: Can't change control position in dialog

    Did you solve your problem related to positioning.
    -Datha

  3. #3
    Regular Contributor
    Join Date
    Jul 2007
    Location
    Dublin
    Posts
    240

    Re: Can't change control position in dialog

    I learnt that dialog line in RSS file, literally is dialog line. If dialog controls are built by multiple dialog lines, their extent is set in line pattern.
    I solved my problem of placing controls anywhere in Dialog, by having a dialog line which is container for other controls.
    'Other controls' which i used are CEikLabel, CAknBitmapAnimation. The position and extent can be set by calling SetExtent() and SetPosition().
    SetRect() does not have any effect on positioning.
    I did my layout planning in CMyDialog::PreLayoutDynInitL() and CMyDialog::HandleResourceChange().
    I think i can do in single place that is CMyContainer::SizeChanged(). I did not try this SizeChanged() yet...

    But still, it was harder to do layout plan of resource in S60. We need some easy layout planning tool.

    -Datha

Similar Threads

  1. Setting the screen position of a CAknDialog derived dialog box
    By curwenx in forum Symbian User Interface
    Replies: 3
    Last Post: 2008-04-04, 07:39
  2. Replies: 2
    Last Post: 2007-07-24, 14:33
  3. dialog position control...
    By platinnum in forum Symbian
    Replies: 1
    Last Post: 2005-04-28, 06:02
  4. how to change the size and position of a dialog
    By handle_cn in forum Symbian
    Replies: 2
    Last Post: 2004-08-16, 19:46
  5. Access list control declared in dialog resources
    By Steve_Johnson in forum Symbian User Interface
    Replies: 0
    Last Post: 2002-07-17, 12:21

Posting Permissions

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