×

Discussion Board

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

    Displaying vertical scrollbar for Edwin in Dialog on 5800

    Hi all,
    I have been having real problems with this.
    I have read through all the threads relating to this in the forum and tried to implement it in various ways as suggested with no success.
    There must be something I am missing and it is starting to bug me. Maybe someone here can spot what I am doing wrong...

    I am creating a dialog to display the contents of a file.
    the first dialog line displays the file name and the second line displays the files contents.
    The display of the file contents works fine and by clicking on the right-hand side of the screen I can scroll. However, the scroll bar is not actually being drawn even though it is usable.

    My resource is as follows (maybe some flags are conflicting?):

    Code:
    RESOURCE DIALOG r_my_file_dlg
    {
    flags=EEikDialogFlagNoDrag | EEikDialogFlagFillAppClientRect | EEikDialogFlagCbaButtons | EEikDialogFlagWait;
    buttons = r_buttons_ok_quit;
    items =
    	{
    	DLG_LINE
    		{
    		type = EEikCtEdwin;
    		id = EMyFileNameID;
    		itemflags = EEikDlgItemNonFocusing;
    		control = EDWIN
    			{
    				flags= EEikEdwinWidthInPixels 
    					| EEikEdwinReadOnly 
    					| EEikEdwinDisplayOnly 
    					| EEikEdwinNoHorizScrolling 
    					| EEikEdwinNoAutoSelection 
    					| EEikEdwinResizable 
    					| EEikEdwinAvkonDisableCursor;
    				width=176;
    				lines=2;
    				max_view_height_in_lines=2;
    				maxlength=160;
    			};
    		},
    	DLG_LINE
    		{
    		type = EEikCtEdwin;
    		id = EMyFileContentsID;
    		control = EDWIN
    			{
    			flags= EEikEdwinWidthInPixels 
    				| EEikEdwinReadOnly 
    				| EEikEdwinOwnsWindow 
    				| EEikEdwinInclusiveSizeFixed 
    				| EEikEdwinNoHorizScrolling 
    				| EEikEdwinNoAutoSelection 
    				| EEikEdwinResizable 
    				| EEikEdwinAvkonDisableCursor;
    			avkon_flags = EAknEditorFlagEnableScrollBars;
    			width=176;
    			lines=3;
    			max_view_height_in_lines=20;
    			maxlength=16000;
    			};
    		}
    	};
    }
    In my dialogs PostLayoutDynInitL I am trying to setup and dispaly the scrollbars as follows:

    Code:
    void CEMyFileDisplayDlg::PostLayoutDynInitL() 
    	{
    	SetExtentToWholeScreen();
    	CEikEdwin* fileContentCtrl = static_cast<CEikEdwin*>(ControlOrNull(EMyFileContentsID));
    	TRect dlgRect = Rect();
    	
    	//scrolls but scroll bars not visible
    	CEikScrollBarFrame* scrollBarFrame = fileContentCtrl->CreatePreAllocatedScrollBarFrameL();
    	
    ///////////// Two methods here seem to make no difference at mo...
    	scrollBarFrame->CreateDoubleSpanScrollBarsL( ETrue, EFalse, ETrue, EFalse );
    	scrollBarFrame->SetTypeOfVScrollBar( CEikScrollBarFrame::EDoubleSpan );
    //////////////
    
    	//set visibility as suggested in nokia forum
    	scrollBarFrame->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
    	
    	TRect edwinRect = fileContentCtrl->Rect();
    	
    	//calculate the new height of the file contents edwin
    	TInt newHeight = dlgRect.Height() - edwinRect.iTl.iY;
    	
    	//compensate for the width of the scroll bar as suggested in the forum.
    	TInt scrollwidth = scrollBarFrame->ScrollBarBreadth(CEikScrollBar::EVertical);	
    	TRect clientRect (TPoint(edwinRect.iTl.iX,edwinRect.iTl.iY),TSize(dlgRect.Width()-scrollwidth, newHeight));
    	
    	fileContentCtrl->SetExtent(clientRect.iTl,clientRect.Size());
    	
    	//calling any of these does not change the outcome
    	//fileContentCtrl->UpdateScrollBarsL (); 
    	//scrollBarFrame->DrawScrollBarsNow();
    	//scrollBarFrame->DrawScrollBarsDeferred();
    	}
    If anyone can point out what I am doing wrong I will be very grateful.
    Thanks in advance for any help.
    Last edited by shadowBR; 2009-09-07 at 02:57.

  2. #2
    Super Contributor
    Join Date
    Nov 2004
    Posts
    1,009

    Re: Displaying vertical scrollbar for Edwin in Dialog on 5800

    scrollBarFrame->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOn);

    Try this on your code.


    SetAknEditorFlags(EAknEditorFlagEnableScrollBars)
    CreatePreAllocatedScrollBarFrameL();
    ScrollBarFrame()->VerticalScrollBar()->SetContainerWindowL(*this);
    ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::Eon);

    ScrollBarFrame()->VerticalScrollBar()->MakeVisible(ETrue);
    Regards,
    Shafali

  3. #3
    Registered User
    Join Date
    Aug 2009
    Posts
    7

    Re: Displaying vertical scrollbar for Edwin in Dialog on 5800

    Hi ShadowBR,
    (You a HALO player by any chance? BR...) lol

    Anyhow I have been watching this post with interest. I have been doing something very similar to what you are doing.
    I also ran into the problem with displaying the scrollbar.
    I read all the threads and tried all the suggestions to no avail.

    I tried shafalig82's suggestion too but that did not make any difference.

    I have it working now though. Basically it will work if you decide to handle the scrolling yourself.
    You also need to use the TileL method that takes the layout model so that you can set the scrollbar to be inclusiverect.
    Having to do the above kinda sucks when the framework is supposed to handle it...

    I think symbian may ignore the Inclusive Rect flag for edwins and that is why it is drawn outside of the view. You may have better luck with a Rich Text Editor resource but I did not try it.

    Let us know how you get on.
    If anyone finds the answer i can remove all my handling code.
    I've got a business for you, check that forex trading online

Similar Threads

  1. Replies: 10
    Last Post: 2010-03-24, 09:51
  2. problem in displaying multi-page dialog resource
    By Abhishek_karmakar in forum Symbian User Interface
    Replies: 0
    Last Post: 2008-08-19, 09:42
  3. [moved] Displaying a Simple Dialog
    By Burim in forum Symbian User Interface
    Replies: 6
    Last Post: 2008-06-26, 16:13
  4. [announce] wait dialog wrapper 0.2
    By lfd in forum Symbian
    Replies: 10
    Last Post: 2008-03-21, 11:03
  5. how to updated the list box on dialog box before it is displaying it.
    By manjunaths in forum Symbian User Interface
    Replies: 3
    Last Post: 2008-03-20, 10:37

Posting Permissions

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