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?):
In my dialogs PostLayoutDynInitL I am trying to setup and dispaly the scrollbars as follows: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; }; } }; }
If anyone can point out what I am doing wrong I will be very grateful.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(); }
Thanks in advance for any help.



