×

Discussion Board

Page 1 of 3 123 LastLast
Results 1 to 15 of 31
  1. #1
    Regular Contributor
    Join Date
    Jun 2006
    Posts
    230

    Grid....Plz help

    Hi to all,

    I m making grid application.

    in view.cpp file,

    void ChellogridAppView::ConstructL( const TRect& aRect )
    {
    CreateWindowL();

    iGrid = new( ELeave ) CAknGrid;
    iGrid->SetContainerWindowL( *this );
    TResourceReader reader;
    CEikonEnv::Static()->CreateResourceReaderLC(reader, R_SELECTIONGRID);
    iGrid->ConstructFromResourceL(reader);
    iGrid->ActivateL();

    iGrid->SetFocus(ETrue);
    iGrid->DrawNow();

    CleanupStack::PopAndDestroy()

    SetRect( aRect );

    ActivateL();
    }
    an in .rss file

    RESOURCE GRID r_selectiongrid
    {

    //height = 5; // in items
    //width = 10;
    flags = EAknListBoxSelectionGrid;
    style = r_selectiongrid_style;
    array_id = r_selectiongrid_items;
    }

    RESOURCE GRID_STYLE r_selectiongrid_style
    {
    layoutflags = EAknGridHorizontalOrientation |
    EAknGridLeftToRight | EAknGridTopToBottom;
    primaryscroll = EAknGridFollowsItemsAndLoops;
    secondaryscroll = EAknGridFollowsItemsAndLoops;
    itemsinprimaryorient = 3;
    itemsinsecondaryorient = 3;
    gapwidth = 5;
    gapheight = 5;
    width = 20;
    height = 20;
    }

    RESOURCE ARRAY r_selectiongrid_items
    {
    items =
    {
    LBUF { txt = "aaa"; },
    LBUF { txt = "bbb"; },
    LBUF { txt = "ccc"; },
    LBUF { txt = "ddd"; }

    };
    }

    My problem is the program do not show me grid but yes only scroll bar.

    I haven't use draw function n i think bcoz of that my grid hides...is that so?

    Plz help

    Symbee

  2. #2
    Regular Contributor
    Join Date
    Apr 2006
    Location
    India
    Posts
    383

    Re: Grid....Plz help

    Hi!

    What kind of grid u wanna show?

    Have u implemented SetLayoutL(--) ,AknListBoxLayouts::SetupFormGfxCell(--)
    or AknListBoxLayouts::SetupFormTextCell(--) functions?

    Where u have user "RESOURCE GRID_STYLE r_selectiongrid_style"?

    U can do it without resource also effectively.

    Check the Grid example on SDK. It will help u.

    Download "Series_60_DP_Avkon_UI_Resources_Grids_v1_0_en.pdf "
    from forum.

    Regards.

    Shilpa K

  3. #3
    Regular Contributor
    Join Date
    Jun 2006
    Posts
    230

    Re: Grid....Plz help

    Thank u very much for reply.

    First I wanna show selection grid, than i'll move on to menu grid.

    Where I should implement SetLayoutL(--) ,AknListBoxLayouts::SetupFormGfxCell(--)
    or AknListBoxLayouts::SetupFormTextCell(--) functions bcoz I havn't implemented anywhere in my application.

    I have given my .rss code in which i have used RESOURCE GRID_STYLE r_selectiongrid_style.

    that pdf file is currupted, i can't use it!

    I m using sdk 3.0 and symbian 9.0. there is no grid eample given:-(

    Any pointers regarding this ma'm?

    Thanks again

    Symbee
    Last edited by symbee; 2006-06-26 at 13:47.

  4. #4
    Regular Contributor
    Join Date
    Jun 2006
    Posts
    230

    Re: Grid....Plz help

    Hi,

    I have implemented iGrid->SetLayoutL(50,20,20,3,3,TSize(300, 300),5,5);

    But there is no difference in output! Only scrollbar!

    Plz help

    regards,

    Symbee

  5. #5
    Regular Contributor
    Join Date
    Apr 2006
    Location
    India
    Posts
    383

    Re: Grid....Plz help

    Hi!
    plz check the function and every parameter
    void CAknGrid::SetLayoutL ( TBool aVerticalOrientation,
    TBool aLeftToRight,
    TBool aTopToBottom,
    TInt aNumOfItemsInPrimaryOrient,
    TInt aNumOfItemsInSecondaryOrient,
    TSize aSizeOfItems,
    TInt aWidthOfSpaceBetweenItems = 0,
    TInt aHeightOfSpaceBetweenItems = 0
    )

    What TSize u have specified?? (300, 300) why so large??

    did u forget to put any text or graphic to display??

    Check AknListBoxLayouts::SetupFormTextCell() n related functions.

    Follow the link :
    http://www.forum.nokia.com/info/sw.n..._0_en.pdf.html

    to download the file once again.

    Check the pdf once again. It will help u.

    Regards.

    Shilpa K

  6. #6
    Regular Contributor
    Join Date
    Jun 2006
    Posts
    230

    Re: Grid....Plz help

    Thanx again Shilpa,

    I have changed size by (30,30) and in rss file,
    RESOURCE ARRAY r_selectiongrid_items
    {
    items =
    {
    LBUF { txt = "aaa"; },
    LBUF { txt = "bbb"; },
    LBUF { txt = "ccc"; },
    LBUF { txt = "ddd"; }
    };

    Doesn't it sufficient to display aaa,bbb,ccc and ddd in grid?

    Why should I use AknListBoxLayouts::SetupFormTextCell() becoz in that pdf there is only mentioned as I previously discussed in my code!!

    I have used SetExtent and by that I got some grid structure but no text appears!
    plz reply

    Regards

    Symbee
    Last edited by symbee; 2006-06-28 at 07:35.

  7. #7
    Regular Contributor
    Join Date
    Apr 2006
    Location
    India
    Posts
    383

    Re: Grid....Plz help

    Hi!

    SetupFormTextCell (--) setups a single text cell of list item .
    U call it after setting the layout for the grid.

    Also call SetPrimaryScrollingType() n SetSecondaryScrollingType() properly

    Check the following function definition

    void AknListBoxLayouts::SetupFormTextCell ( CEikListBox & aListBox,
    CFormattedCellListBoxItemDrawer * aItemDrawer,
    TInt index,
    const CFont * font,
    TInt ,
    TInt lm,
    TInt ,
    TInt B,
    TInt W,
    CGraphicsContext::TTextAlign aAlign,
    TPoint p1,
    TPoint p2
    )

    1st parameter will be *iGrid .
    2nd iGrid ->ItemDrawer()
    3rd 0 ie the column index ie in ur list string format text column number
    LatinBold12(),
    215, // Color (215 = black)
    25, // Left margin
    0, // Right margin - unused
    20, // Baseline
    25, // Text width
    CGraphicsContext::ELeft, // Text alignment
    TPoint(24,0), // Start position
    TPoint(28, 28) // End position

    U set the start and end position as per ur requirement.

    Dont forget to call DrawNow() after this.

    Make some variations in numeric values if required e.g for baseline or margin.

    I hope u have implemted SizeChanged() properly.

    Bye.

    Still any problem exist then tell me.

    Regards

    Shilpa K

  8. #8
    Regular Contributor
    Join Date
    Jun 2006
    Posts
    230

    Re: Grid...Plz help

    Hey

    Thanks a lot for ur help. I got text on my grid buttons!:-)

    Actually I want to create menu grid and i have read from sdk help.

    But I m not clear about second phase constructor and In my program

    ------------------------------------------------------------------------
    iGrid = new( ELeave ) CAknGrid;
    iGrid->SetContainerWindowL( *this );
    TResourceReader reader;
    CEikonEnv::Static()->CreateResourceReaderLC(reader, R_SELECTIONGRID);

    CAknPopupList* popupList = CAknPopupList::NewL( iGrid,R_AVKON_SOFTKEYS_SELECT_BACK );
    CleanupStack::PushL(popupList);
    popupList->SetTitleL(_L("Menu grid"));

    iGrid->ConstructL( popupList, CEikListBox::ELeftDownInViewRect );

    iGrid->ConstructFromResourceL(reader);
    iGrid->ActivateL();
    iGrid->SetLayoutL(50,50,50,3,3,TSize(60, 60),30,30);
    iGrid->SetExtent(TPoint(40,40),TSize(150, 150));
    iLayout->SetupFormTextCell(*iGrid,iGrid ->ItemDrawer(),0 ,LatinBold12(),215,25,0, 20,25,
    CGraphicsContext::ELeft,TPoint(24,0),TPoint(28, 28) );

    TInt popupOk = popupList->ExecuteLD();

    CleanupStack::Pop(); // popupList


    iGrid->MakeVisible(ETrue);
    iGrid->SetFocus(ETrue);
    iGrid->DrawNow();

    CleanupStack::PopAndDestroy();//reader
    ----------------------------------------------------------------------
    As output I get title "Menu grid" and grid as it looked earler in selection grid.

    Also text doesn't appear. and it doesn't look like menugrid as shown in sdk help! I want to create grid like buttons at the top of screen

    Thanx in advance

    Symbee
    Last edited by symbee; 2006-06-29 at 09:31.

  9. #9
    Registered User
    Join Date
    Jun 2006
    Posts
    20

    Re: Grid....Plz help

    Hello everybody,

    I´m trying to code the same example, but I am not successful. Perhaps you are so kind to post your (complete) code of xxxAppView.cpp?
    This would be very nice, because I already try to solve my problem for hours...

  10. #10
    Super Contributor
    Join Date
    Aug 2005
    Location
    india
    Posts
    2,078

    Re: Grid....Plz help

    hi,

    guys, i have completed the grid example ported to 3rd edition and the code is amazing working fine.

    I have been working on this from 2 weeks atlast got it working for 3rd edition.

    If anyone needs the help in this regard.

    Do let me know.

    Regards,
    Mateen Maldar
    Last edited by mateen_maldar; 2006-07-10 at 14:17. Reason: Working typed someline
    "Whatever the mind can conceive and believe, the mind can achieve"

  11. #11
    Registered User
    Join Date
    Jun 2006
    Posts
    20

    Re: Grid....Plz help

    Hello mateen_maldar,

    I need the help... I am absolut helpless... I don´t know where my faults are!

    I´m very interessted in your source code!

    Regards,
    Ralph

  12. #12
    Super Contributor
    Join Date
    Aug 2005
    Location
    india
    Posts
    2,078

    Re: Grid....Plz help

    hi fset_darkwing
    Quote Originally Posted by fset_darkwing
    I need the help... I am absolut helpless... I don´t know where my faults are!

    I´m very interessted in your source code!
    i can guide from where ur struck at paste the errors or anycode which u have coded wrong so that i can help u in this regard...

    Regards,
    Mateen Maldar
    "Whatever the mind can conceive and believe, the mind can achieve"

  13. #13
    Regular Contributor
    Join Date
    Apr 2006
    Location
    India
    Posts
    383

    Smile Re: Grid....Plz help

    Hi Mateen!
    :-))
    I would like to know what tool u used to show graphic with grid cell.
    I am curious to know the changes in 3rd edition.
    U can give me the link or give psedo code.
    I will check it.

    Regards.

    Shilpa K

  14. #14
    Super Contributor
    Join Date
    Aug 2005
    Location
    india
    Posts
    2,078

    Re: Grid....Plz help

    hi shilpa,

    Quote Originally Posted by Shilpa13
    I would like to know what tool u used to show graphic with grid cell.
    I am curious to know the changes in 3rd edition.
    U can give me the link or give psedo code.
    I will check it.

    I can guide the procedure how to make it .I have used the bitmaps bmconv similar to the lower version.Make some changes in the rss and grid file.

    I cannot submit all the code as i'm binded with the legal ethics(NDA). But still i will guide u how to make it workable...

    Regards,
    Mateen Maldar
    "Whatever the mind can conceive and believe, the mind can achieve"

  15. #15
    Registered User
    Join Date
    Jun 2006
    Posts
    20

    Re: Grid....Plz help

    Quote Originally Posted by mateen_maldar
    hi fset_darkwing


    i can guide from where ur struck at paste the errors or anycode which u have coded wrong so that i can help u in this regard...

    Regards,
    Mateen Maldar
    Tanks a lot! That would be nice!

    First of all: I´m very new to Symbian and I´m using Carbide.c++ express.

    I am trying to copy the example of the "S60 Platform: Avkon UI Resources - Grids" source.
    Everything works fine, there is no error at compilation, but all I see in the emulator ist .... nothing!
    I copied the example below, but this wasn´t successful either. I just want to have a selection menu with 5 Icons. Nothing more, nothing less... but this is really disapointing me.
    So I started already from the very beginning:

    Code:
    void CGridmenuAppView::ConstructL( const TRect& aRect )
        {
       
    	CreateWindowL();
    	
    	CAknGrid* iGrid = new( ELeave ) CAknGrid;
    	iGrid->SetContainerWindowL( *this );
    	TResourceReader reader;
    	CEikonEnv::Static()->CreateResourceReaderLC(reader, R_SELECTIONGRID);
    	iGrid->ConstructFromResourceL(reader);
    	iGrid->ActivateL();
    	
    	iGrid->SetFocus(ETrue);
    	iGrid->DrawNow();
    	
    	CleanupStack::PopAndDestroy();
    	
    	SetRect( aRect );
    	
    	ActivateL();
    
        }
    So, there nothing happens... no error, but also no result.

Similar Threads

  1. scrollbar with the grid
    By agirllikeyou in forum Symbian User Interface
    Replies: 9
    Last Post: 2010-02-05, 09:46
  2. How to make simple GRID list with border and highlighted selection.
    By khurshed79 in forum Symbian User Interface
    Replies: 2
    Last Post: 2009-01-25, 10:25
  3. Grid refresh problem(Need urgent help)
    By ekramulhuq in forum Symbian
    Replies: 3
    Last Post: 2006-10-19, 07:09
  4. help me for the grid problems
    By bention in forum Symbian
    Replies: 3
    Last Post: 2006-05-01, 15:34
  5. Making Editable Grid
    By Shilpa13 in forum Symbian User Interface
    Replies: 0
    Last Post: 2006-04-13, 08:40

Posting Permissions

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