void DeleteItemL() {
		TInt idx=ListBox()->CurrentItemIndex();

		auto_ptr<HBufC> message(HBufC::NewL(256));
		message->Des()=_L("Really delete ");
		MListBoxModel* lbmodel=ListBox()->Model();
		CAknFilteredTextListBoxModel* model = STATIC_CAST( CAknFilteredTextListBoxModel*, lbmodel);

		TPtrC item=model->ItemText( idx );
		message->Des().Append( item.Mid(2) );
		message->Des().Append(_L("?"));

		{
			TPtrC16 m=message->Des();
			CAknMessageQueryDialog * dlg = CAknMessageQueryDialog::NewL(m);
			CleanupStack::PushL(dlg);
			dlg->PrepareLC(R_CONFIRMATION_QUERY);
			dlg->QueryHeading()->SetTextL(_L("Delete?"));
			CleanupStack::Pop(dlg);
			
			if ( dlg->RunLD() )
			{
				TInt realidx=model->Filter()->FilteredItemIndex(idx);
				iTagStorage->DeleteItemL(realidx);
				ListBox()->HandleItemRemovalL();
			}
		}	
	}
Esempio n. 2
0
/**
 *	Handle the "Change" option on the Options menu.  This is an
 *	alternative to the Selection key that forces the settings page
 *	to come up rather than changing the value in place (if possible).
 */
void CSymbian_ua_guiSettingItemList::ChangeSelectedItemL()
{
    if ( ListBox()->CurrentItemIndex() >= 0 )
    {
        EditItemL( ListBox()->CurrentItemIndex(), ETrue );
    }
}
/**
 *	Handle the "Change" option on the Options menu.  This is an
 *	alternative to the Selection key that forces the settings page
 *	to come up rather than changing the value in place (if possible).
 */
void CCalendarManagerSettingItemList::ChangeSelectedItemL()
	{
	if ( ListBox()->CurrentItemIndex() >= 0 )
		{
		EditItemL( ListBox()->CurrentItemIndex(), ETrue );		
		}
	}
Esempio n. 4
0
/**
 * Handle system notification that the container's size has changed.
 */
void CSymbian_ua_guiSettingItemList::SizeChanged()
{
    if ( ListBox() )
    {
        ListBox()->SetRect( Rect() );
    }
}
Esempio n. 5
0
/*
-----------------------------------------------------------------------------
----------------------------------------------------------------------------
*/
void CImeiSettingsListListbox::SizeChanged()
    {
    if (ListBox()) 
       {
        ListBox()->SetRect(Rect());
        }
    }
Esempio n. 6
0
TInt CFileSelectDialog::Show()
	{
	_LOG(_L("CFileSelectDialog::Show()"));
	TInt sel=0;
	CDesCArray* itemList = new (ELeave) CDesCArrayFlat(3);
	if (iCurrentPath.Compare(_L(""))!=0){if (iType==EFolder){iArray->InsertL(0,_L("Select folder"));}iArray->InsertL(0,_L("..."));}
	_LOGDATA(_L("Length of array: %d"),iArray->Count());
	
	for (TInt i=0;i<iArray->Count();i++)
		{
		TBuf<255> ItemTxt;
		ItemTxt.Copy(_L("0\t"));
		ItemTxt.Append(iArray->MdcaPoint(i));
		ItemTxt.Append(_L("\t\t"));
		itemList->AppendL(ItemTxt);
		_LOGDATA(_L("Item: %S"),&iArray->MdcaPoint(i));
		}
	_LOG(_L("Will create dialog"));
	SetItemTextArray(itemList);
    ListBox()->HandleItemAdditionL();
    Layout();
    ListBox()->SetCurrentItemIndex(0);
    ListBox()->DrawNow();
    DrawDeferred();
	}
//-----------------------------------------------------------------------------
// CBTKeySettingList::SizeChanged
//-----------------------------------------------------------------------------
//
void CBTKeySettingList::SizeChanged()
    {
    if ( ListBox() ) 
        {
        ListBox()->SetRect(Rect());
        }
    }
// ----------------------------------------------------------------------------
// CSettingItemList::SizeChanged
// Size changed handler
// ----------------------------------------------------------------------------
//
void CSettingItemList::SizeChanged()
    {
    if (ListBox()) 
        {
        ListBox()->SetRect(Rect());
        }
    }
Esempio n. 9
0
void CWordStyleGallery::DoCalcColumnWidthsL()
	{
	CColumnListBoxData* columnData = ListBox()->ItemDrawer()->ColumnData();
	const CFont* font;
	//
	// column 0
	font = iEikonEnv->NormalFont();
	columnData->SetColumnFontL(0, font);
	columnData->SetColumnAlignmentL(0, CGraphicsContext::ELeft);
	//
	// column 1
	columnData->SetColumnWidthPixelL(1, KStyleColumnSpacerWidth);
	//
	// column 2
	font = iEikonEnv->LegendFont();
	columnData->SetColumnFontL(2, font);
	TBuf<KMaxStyleHotKeyDescription> hotkey;
	iCoeEnv->ReadResource(hotkey, R_WORD_HOTKEY);
	TInt width2 = font->TextWidthInPixels(hotkey) + font->MaxCharWidthInPixels();
	columnData->SetColumnWidthPixelL(2, width2);
	columnData->SetColumnAlignmentL(2, CGraphicsContext::ELeft);
	//
	// more column 0
	TInt width0 = ListBox()->View()->ViewRect().Width() - KStyleColumnSpacerWidth - width2 - CEikScrollBar::DefaultScrollBarBreadth(); // only works if called from PostLayout...
	columnData->SetColumnWidthPixelL(0, width0);
	}
Esempio n. 10
0
/*
-----------------------------------------------------------------------------
----------------------------------------------------------------------------
*/
void CAknYuccaSettingsListListbox::SizeChanged()
    {
    if (ListBox()) 
        {
        ListBox()->SetRect(Rect());
        }
    }
	virtual TKeyResponse OfferKeyEventL  (  const TKeyEvent &  aKeyEvent,  
		TEventCode  aType )
	{
		if (aType==EEventKey && aKeyEvent.iCode==0xF845) {
			TInt idx=ListBox()->CurrentItemIndex();
			if (idx!=-1) {
				TBool selected=EFalse;
				const CArrayFix<TInt> *indexes = ListBox()->SelectionIndexes();
				if (indexes) {
					for (int i=0; i<indexes->Count(); i++) {
						if (indexes->At(i)==idx) {
							selected=ETrue;
							break;
						}
					}
				}
				if (!selected) {
					SelectionListProcessCommandL(EAknCmdMark);
				} else {
					SelectionListProcessCommandL(EAknCmdUnmark);
				}
			}
			return EKeyWasConsumed;
		} else {
			if (aType==EEventKey && aKeyEvent.iCode==KEY_C && FindBox()->TextLength()==0) {
				DeleteItemL();
				return EKeyWasConsumed;
			} else {
				return CAknMarkableListDialog::OfferKeyEventL(aKeyEvent, aType);
			}
		}
	}
/**
 *	Handle the "Change" option on the Options menu.  This is an
 *	alternative to the Selection key that forces the settings page
 *	to come up rather than changing the value in place (if possible).
 */
void CSetupGisWeatherSettingItemList::ChangeSelectedItemL()
	{
	if ( ListBox()->CurrentItemIndex() >= 0 )
		{
		EditItemL( ListBox()->CurrentItemIndex(), ETrue );
		}
	}
//-----------------------------------------------------------------------------
// CBTKeySettingList::EditCurrentItemL
//-----------------------------------------------------------------------------
//
void CBTKeySettingList::EditCurrentItemL( TInt aCommand )
    {
    if ( ListBox() )
        {
        TInt index = ListBox()->CurrentItemIndex();
        EditItemL(index, EBTKeyCmdAppChange == aCommand);
        StoreSettingsL();        
        }
    }    
/**
 * Handle system notification that the container's size has changed.
 */
void CCalendarManagerSettingItemList::SizeChanged()
	{
	if ( ListBox() ) 
		{
		ListBox()->SetRect( Rect() );
		}
	
	CAknViewAppUi* i_AppUi = static_cast<CAknViewAppUi*>(iCoeEnv->AppUi());
	CAknView* i_View = i_AppUi->View(TUid::Uid(ECalendarManagerSettingItemListViewId));
	i_View->HandleCommandL(ECalendarManagerSettingItemListView_KeyCommand);	
	}
Esempio n. 15
0
long aDropList::AddItem(aListItem* itemString)
{
	long retval = ListBox().AddItem(itemString);
	float newHeight = (itemString->height() + ListBox().getSpaceBetweenItems()) * ListBox().GetItemCount()+4;
	if (newHeight > listBoxMaxHeight)
	{
		newHeight = listBoxMaxHeight;
	}
	ListBox().resize(ListBox().width(), newHeight);
	rects[2].resize(rects[2].width(), newHeight);
	return retval;
}
Esempio n. 16
0
/*
-----------------------------------------------------------------------------
----------------------------------------------------------------------------
*/
void CAknSettingsListListbox::HandleListBoxEventL(CEikListBox* aListBox,TListBoxEvent aEventType)
{
	if(ListBox())
	{		
		if(ListBox()->CurrentItemIndex() >= 0)// alarms
		{
			SelectCommandSCL(ListBox()->CurrentItemIndex());
		}
		else
		{		
			CAknSettingItemList::HandleListBoxEventL(aListBox,aEventType);
		}
	}
}
void CExampleSettingList::EditCurrentItemL(TBool aFromMenu)
	{
	// Invoke EditItemL on the current item
    EditItemL(ListBox()->CurrentItemIndex(),	// the item index
                aFromMenu);							// invoked from menu
        
			  
	//Updating CAknPasswordSettingItem.
	if(ListBox()->CurrentItemIndex()==5)
		{
		(*(SettingItemArray()))[ListBox()->CurrentItemIndex()]->UpdateListBoxTextL();
		}
        
    StoreSettingsL();
	}
// ----------------------------------------------------------------------------
// void CChangeConnectionDlg::HandleResourceChange( TInt aType )
// Handle resource change events. 
// ----------------------------------------------------------------------------
//
void CChangeConnectionDlg::HandleResourceChange( TInt aType )
    {
    if ( aType == KAknsMessageSkinChange )
        {
        CAknListQueryDialog::HandleResourceChange( aType );

        SizeChanged();
        }
    else
        {
        if ( aType == KEikDynamicLayoutVariantSwitch )
            {
            TRect mainPaneRect;
            AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane,
                                               mainPaneRect );

            TAknLayoutRect layoutRect;
            layoutRect.LayoutRect( TRect( TPoint( 0, 0 ), 
                                   mainPaneRect.Size() ),
                                   AKN_LAYOUT_WINDOW_list_gen_pane( 0 ) );

            ListBox()->SetRect( layoutRect.Rect() );
            }

        // Base call
        CAknListQueryDialog::HandleResourceChange( aType );
        }
    }
// ---------------------------------------------------------
// CChangeConnectionDlg::OkToExitL( TInt aButtonId)
// called by framework when the OK button is pressed
// ---------------------------------------------------------
//
TBool CChangeConnectionDlg::OkToExitL( TInt aButtonId )
    {
    CLOG_ENTERFN( "CChangeConnectionDlg::OkToExitL " );  
    
    TBool result( EFalse );
    __ASSERT_DEBUG( iActiveDlg, User::Panic( KErrNullPointer, KErrNone ) );
    
    
    if ( aButtonId == EAknSoftkeySelect || aButtonId == EAknSoftkeyOk )
        {
        TInt index = ListBox()->CurrentItemIndex();
        CConnectionInfo* tempInfo = iActiveDlg->ActIAPs()->At( index );
        *iIAPId = tempInfo->Id();

        CLOG_WRITEF( _L( "*iIAPId : %d" ), *iIAPId );
        
        iActiveDlg->Cancel();
        iActiveDlg->SetSelected( ETrue );
                
        result = ETrue;
        }
    else if ( aButtonId == EAknSoftkeyCancel )
        {
        iActiveDlg->Cancel();  
                  
        result = ETrue;
        }
    
    CLOG_LEAVEFN( "CChangeConnectionDlg::OkToExitL " );  
    
    return result;
    }
Esempio n. 20
0
void CWordStyleGallery::AppendL(TInt aIndex)
	{
	TBuf<100> name;
	name = (*iStyleNameList)[aIndex];
	//
	// truncate name if necessary
	CColumnListBoxData* columnData = ListBox()->ItemDrawer()->ColumnData();
	TInt columnWidth = columnData->ColumnWidthPixel(0);
	const CFont* columnFont = columnData->ColumnFont(0);
	if (columnFont->TextWidthInPixels(name) > columnWidth)
		TextUtils::ClipToFit(name, *columnFont, columnWidth);
	//
	TChar key = iData.iNormalStyleHotKey;
	if (name != iNormalName)
		{
		CParagraphStyle* pp = iData.iStyleList.PtrByName(name)->iStyle;
		TInt index = iData.iStyleList.IndexByPtr(pp);
		key = iData.iHotKeyList[index];
		}
	if (key > 0)
		{
		name.Append(KColumnListSeparator);
		name.Append(KColumnListSeparator); // one for empty spacer column
		name.Append(iHotKey);
		name.Append(key);		
		name.Append(KColumnListSeparator);
		}
	iStyleNameKeyList->AppendL(name);
	}
Esempio n. 21
0
NS_IMETHODIMP
nsBox::DumpBox(FILE* aFile)
{
  nsAutoString s;
  ListBox(s);
  fprintf(aFile, "%s", NS_LossyConvertUTF16toASCII(s).get());
  return NS_OK;
}
Esempio n. 22
0
int VMenu2::SetSelectPos(int Pos, int Direct)
{
/*
	FarListPos flp={sizeof(FarListPos), Pos, -1};
	return SendMessage(DM_LISTSETCURPOS, 0, &flp); //!! DM_LISTSETCURPOS не работает для скрытого диалога
*/
	return ListBox().SetSelectPos(Pos, Direct);
}
Esempio n. 23
0
bool WrapperDLL::Tool_ListBox(void* self,const char16_t* label,int* current_item,const char16_t* items){
	auto self_ = (Tool*)self;
	auto arg0 = label;
	auto arg1 = current_item;
	auto arg2 = items;
	auto ret = self_->ListBox(arg0,arg1,arg2);
	return ret;
};
	virtual TBool OkToExitL  (  TInt  aButtonId   )  {
		if (aButtonId==-2) {
			const CArrayFix<TInt> *indexes = ListBox()->SelectionIndexes();
			if (indexes->Count()==0) {
				SelectionListProcessCommandL(EAknCmdMark);
			}
		}
		return CAknMarkableListDialog::OkToExitL(aButtonId);
	}
void CExampleSettingList::SizeChanged()
    {
	// if size changes, make sure component takes whole available space
	CEikFormattedCellListBox *listbox = ListBox();

    if (listbox) 
        {
        listbox->SetRect(Rect());
        }
    }
/** 
 * Handle key event (override)
 * @param aKeyEvent key event
 * @param aType event code
 * @return EKeyWasConsumed if the event was handled, else EKeyWasNotConsumed
 */
TKeyResponse CSetupGisWeatherSettingItemList::OfferKeyEventL( 
		const TKeyEvent& aKeyEvent, 
		TEventCode aType )
	{
	
	if ( aKeyEvent.iCode == EKeyLeftArrow/*
		|| aKeyEvent.iCode == EKeyRightArrow */)
		{
		// allow the tab control to get the arrow keys
		ListBox()->SetCurrentItemIndexAndDraw(0);
		//return EKeyWasNotConsumed;
		}
	if(aKeyEvent.iCode == EKeyRightArrow)
	    {
	    ListBox()->SetCurrentItemIndexAndDraw(/*5*/SettingItemArray()->Count()-1);
	    }

	return CAknSettingItemList::OfferKeyEventL( aKeyEvent, aType );
	}
Esempio n. 27
0
TBool CFileSelectDialog::OkToExitL(TInt aButton)
	{
	TInt selected=ListBox()->CurrentItemIndex();
	_LOGDATA(_L("Selected: %d"),selected);
	if (aButton==EAknSoftkeyCancel){return ETrue;}
	if (iCurrentPath.Compare(_L(""))==0)
		{
		_LOG(_L("(iCurrentPath.Compare(_L(""))==0)"));
		_LOG(iCurrentPath);
		iCurrentPath.Append(iArray->MdcaPoint(selected));
		iCurrentPath.Append(_L("\\"));
		if (BaflUtils::PathExists(iFs,iCurrentPath)){Update();Show();return EFalse;}
		//Update();
		}
	else if ((selected>1&&iType==EFolder)||(selected>0&&iType==EFile))
		{
		_LOG(_L("((selected>1)&&(iCurrentPath.Compare(_L(""))!=0))"));
		_LOG(iCurrentPath);
		TBuf<255> temp(iArray->MdcaPoint(selected));
		TChar c1='[',c2=']';
		if (temp[0]==c1&&temp[temp.Length()-1]==c2) {temp.Copy(temp.Left(temp.Length()-1));temp.Copy(temp.Right(temp.Length()-1));}
		_LOGDATA(_L("Temp: %S"),&temp);
		iCurrentPath.Append(temp);
		iCurrentPath.Append(_L("\\"));
		_LOGDATA(_L("CurrPath after append: %S"),&iCurrentPath);
		CEikonEnv::Static()->InfoMsg(iCurrentPath);
		User::After(500000);
		if (BaflUtils::PathExists(iFs,iCurrentPath)){Update();Show();return EFalse;}
		else if (BaflUtils::FileExists(iFs,iCurrentPath.Left(iCurrentPath.Length()-1)))
			{
			iResult.Copy(iCurrentPath.Left(iCurrentPath.Length()-1));
			return ETrue;
			}
		}
	else if (selected==0)
		{
		_LOG(_L("(selected==0&&(iCurrentPath.Compare(_L(""))!=0))"));
		_LOG(iCurrentPath);
		TParse p;
		iFs.Parse(iCurrentPath, p);
		_LOG(_L("Will pop now"))
		TInt err=p.PopDir();
		if (err!=KErrNone||iCurrentPath.Compare(p.FullName())==0){iCurrentPath.Copy(_L(""));}
		else {iCurrentPath.Copy(p.FullName());}
		//if (iCurrentPath.Compare(_L(""))!=0)
		Update();Show();return EFalse;
		}
	else if (selected==1&&iType==EFolder&&(iCurrentPath.Compare(_L(""))!=0))
		{
		_LOG(_L("Will update result"));
		iResult.Copy(iCurrentPath);
		return ETrue;
		}
	Update();Show();return EFalse;
	}
// ---------------------------------------------------------
// CChangeConnectionDlg::RefreshDialogL
// ---------------------------------------------------------
//    
void CChangeConnectionDlg::RefreshDialogL()
    {  
    CLOG_ENTERFN( "CChangeConnectionDlg::RefreshDialogL " );  
     
    SetItemTextArray( iActiveDlg->ActIAPs() );
    ListBox()->HandleItemAdditionL();  
    
    Layout();   
    SizeChanged();
    DrawNow();
    
    CLOG_LEAVEFN( "CChangeConnectionDlg::RefreshDialogL " );  
              
    }
Esempio n. 29
0
File: GUI.cpp Progetto: SinYocto/Zee
int GUI::GUIListBox(std::vector<LPWSTR> _texts, Rect _rect, int _ix, char* _id, ListBoxStyle* listBox_style)
{
	ListBox* listBox = New ListBox(_texts, _rect, _ix, _id, listBox_style);
	AddListBox(listBox);

	if(listBoxState.count(_id))
		listBox->isSelecting = listBoxState[_id];
	else
		listBox->isSelecting = false;

	listBox->GetState();
	listBoxState[_id] = listBox->isSelecting;
	
	return listBox->selectedIx;
}
void CDCQLoginViewSettings::EditCurrentItemL()
{
   TInt aCurrItemIdx = ListBox()->CurrentItemIndex();
   
   // invoke EditItemL on the current item
   EditItemL(aCurrItemIdx, // the item index
             EFalse); // not invoked from menu

   //Updating CAknPasswordSettingItem.
   if (aCurrItemIdx == EDCQLoginViewSettingICQPasswordOrder)
   {
      (*(SettingItemArray()))[aCurrItemIdx]->UpdateListBoxTextL();
   }
   
   StoreSettingsL();
}