newlc.com
Articles Only
Forum Only
Community
World-Wide Web
Symbian OS
iPhone
Windows Mobile
Mobile Linux
Forums
Last forum posts
Home
::
Forums
::
Symbian
::
User Interface
::
S60
Username:
*
Password:
*
Create new account
Request new password
shoppinglist code
Login
to reply to this topic.
Tue, 2006-03-14 21:06
mitsos69
Joined: 2006-03-14
Forum posts: 2
Hi,guys i need your help.I need to enter a box for insert number in the quantity bar (case EShoppingListQuantity:) for my shopping list application.I want it to display after the name of the food.Thx
CShoppingListAppUi::HandleCommandL()
// ---------------------------------------------------------
//
void CShoppingListAppUi::HandleCommandL( TInt aCommand )
{
TInt selectedItemIndex = 0;
CShoppingItem* item;
switch( aCommand )
{
case EEikCmdExit:
case EAknSoftkeyExit:
TRAPD( Err, SaveL() ); // Ignore any errors
Exit();
break;
case EShoppingListNewItem:
{
if( GetDocument()->ItemCount() > 0 )
{
selectedItemIndex = iAppView->CurrentItemIndex();
}
item = CShoppingItem::NewLC();
item->SetNameL( KNewitem().AllocL() );
GetDocument()->InsertItemL( item, selectedItemIndex );
CleanupStack::Pop( item );
HandleModelChangeL();
TBuf<KTextBufferLength> name;
CAknTextQueryDialog* dlg = CAknTextQueryDialog::NewL( name );
if ( dlg->ExecuteLD( R_DIALOG_TEXT_ITEM_NAME ) )
{
GetDocument()->Item( iAppView->CurrentItemIndex() )->
SetNameL( name.AllocL() );
}
HandleModelChangeL();
break;
}
case EShoppingListMarkUnmark:
if( GetDocument()->ItemCount() > 0 )
{
item = GetDocument()->Item( iAppView->CurrentItemIndex() );
item->SetFlags( item->Flags() ^ CShoppingItem::EMarked );
HandleModelChangeL();
}
break;
case EShoppingListQuantity:
if( GetDocument()->ItemCount() > 0 )
{
item = GetDocument()->Item( iAppView->CurrentItemIndex() );
??
}
break;
case EShoppingListRemove:
if( GetDocument()->ItemCount() > 0 )
{
selectedItemIndex = iAppView->CurrentItemIndex();
GetDocument()->RemoveItem( selectedItemIndex );
TInt count = GetDocument()->ItemCount();
if( count > 0 && iAppView->CurrentItemIndex() == count )
{
iAppView->SetCurrentItemIndex( iAppView->CurrentItemIndex() - 1 );
}
HandleModelChangeL();
}
break;
default:
Panic( EShoppingListUi );
break;
}
}
Login
or
register
to post in forums
- Report To Moderator -
Professional
Services
Development
Consulting
Training
About NewLC
Commitments
References
Contact
copyright 2003-2009 NewLC SARL