亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? numericeditorcontainer.cpp

?? symbian手機上記事本的程序
?? CPP
字號:
/**
* 
* @brief Definition of CNumericEditorContainer
*
* Copyright (c) EMCC Software Ltd 2003
* @version 1.0
*/

// INCLUDE FILES

// Class include
#include "NumericEditorContainer.h"

// System includes
#include <akniconarray.h> 
#include <stringloader.h> 
#include <aknlists.h> // CAknSingleHeadingStyleListBox
#include <barsread.h> // TResourceReader
#include <NumericEditor.rsg> //R_NUMERICEDITOR_FORM, R_NUMERICEDITOR_EMPLOYEES_LISTBOX
#include <NumericEditor.mbg>
#include <e32def.h> // STATIC_CAST
#include <eikclbd.h> // CColumnListBoxData
#include <eikmenub.h> // CEikMenuBar
#include <stringloader.h> // StringLoader
#include <uikon.hrh> // 
#include <aknnotewrappers.h>
#include <eikslb.h> 
#include <eikrted.h>        // CEikRichTextEditor
#include <stringloader.h> 

// User includes
#include "NumericEditorForm.h"



// CONSTANTS

// N.B. #define'd as DLL cannot contain writeable static data
#define KListPosition TPoint(0,0) 
#define KLabelPosition TPoint(5,5)
const TInt KNumberOfIcons(4);


// ================= MEMBER FUNCTIONS =======================

/**
* Symbian OS 2nd phase constructor.  Creates a Window for the controls, which it contains.
* Constructs a list and adds it to the window, which it then activates.
* @param aRect The rectangle for this window
*/		
void CNumericEditorContainer::ConstructL(const TRect& aRect)//itododb 沒有用到,所以在ui的newlc中沒有傳進去,所以要用構造函數來初始化
	{
	CreateWindowL();
	
	iToDoList = new (ELeave) CAknSingleGraphicStyleListBox;
	iToDoList->SetContainerWindowL(*this);
	
	// Second Phase Construction
	TResourceReader reader;
	CEikonEnv::Static()->CreateResourceReaderLC(reader, R_NUMERICEDITOR_EMPLOYEES_LISTBOX);
	iToDoList->ConstructFromResourceL(reader);
	CleanupStack::PopAndDestroy(); // reader             
	
	iToDoList->CreateScrollBarFrameL(ETrue);
	iToDoList->ScrollBarFrame()->SetScrollBarVisibilityL(
		CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
	
	iToDoDb.RestoreL();
	UpdateListBox();
	SetupListIconsL();
	//CreateLabel();
	//SetLabelText();
	//SetupScrollBarsL();
	SetRect(aRect);
	ActivateL();
	}

void CNumericEditorContainer::UpdateListBox()//沒有顯示列表數據,是因為沒有寫這個函數
	{
		CToDo* todo;
		//二部構造中被調用,simplelist中沒有這個函數
		//把數據添加到model中,在把model中的數據放到array中
		CTextListBoxModel* model = iToDoList->Model();  // not taking ownership
		model->SetOwnershipType (ELbmOwnsItemArray); 
		CDesCArray* savedGamesArray = STATIC_CAST(CDesCArray*, model->ItemTextArray());
	//	LoadFormValuesFromDataL(*savedGamesArray);//調用下面的函數
		savedGamesArray->Reset();
		TInt count = iToDoDb.Count();
		for(TInt i = 0; i < iToDoDb.Count(); i++)//做了一個for循環(huán)把所建的todo一個加進去
			{
			 todo = iToDoDb.At(i);
			 savedGamesArray->AppendL (ListStringFromEmployeeL(*todo));
			iToDoList->HandleItemAdditionL();
			}

	}																																																																																																																																																																																																																																				

/**
* Symbian OS 2 phase constructor.
* Constructs the CNumericEditorContainer using the NewLC method, popping
* the constructed object from the CleanupStack before returning it.
* 
* @param aRect The rectangle for this window
* @return The newly constructed CNumericEditorContainer
*/
CNumericEditorContainer* CNumericEditorContainer::NewL(const TRect& aRect, CSynchToDoDb& aToDoDb)
	{
	CNumericEditorContainer* self = CNumericEditorContainer::NewLC(aRect, aToDoDb);
	CleanupStack::Pop(self);
	return self;
	}

/**
* Symbian OS 2 phase constructor.
* Constructs the CNumericEditorContainer using the constructor and ConstructL 
* method, leaving the constructed object on the CleanupStack before returning it.
* 
* @param aRect The rectangle for this window
* @return The newly constructed CNumericEditorContainer
*/
CNumericEditorContainer* CNumericEditorContainer::NewLC(const TRect& aRect, CSynchToDoDb& aToDoDb)
	{
	CNumericEditorContainer* self = new (ELeave) CNumericEditorContainer( aToDoDb );
	CleanupStack::PushL(self);
	self->ConstructL(aRect);
	return self;
	}

/**
* Destructor. Frees up memory for the list and the array of employees.
*/
CNumericEditorContainer::~CNumericEditorContainer()
	{
	delete iToDoList;
//	delete iLabel;
	//iEmployees.Close();
	}


/**
*	
* Called by framework when the view size is changed.  Resizes the
* iEmployeesList accordingly.
*
*/
void CNumericEditorContainer::SizeChanged()
	{
	iToDoList->SetExtent (KListPosition, iToDoList->MinimumSize());
//	iLabel->SetExtent(KLabelPosition, iLabel->MinimumSize());
	}
/*
void CNumericEditorContainer::CreateLabel()
	{
	iLabel = new (ELeave) CEikLabel;
	iLabel->SetContainerWindowL(*this); 
	}
*/
/**
* Called by the framework in compound controls	
* @return The number of controls in this CNumericEditorContainer
*/
TInt CNumericEditorContainer::CountComponentControls() const
	{
	return 1; // return number of controls inside this container
	}

/**
* Called by the framework in compound controls	
* @param The index of the control to return
* @return The control for aIndex
*/
CCoeControl* CNumericEditorContainer::ComponentControl(TInt aIndex) const
	{
	switch (aIndex)
		{
		case 0:
			return iToDoList;
	//	case 1:
	//		return iLabel;
		default:
			return NULL;
		}
	}

/**
* Called by the framework to draw this control.  Clears the area in 
* aRect.
* @param aRect in which to draw
*/
void CNumericEditorContainer::Draw(const TRect& aRect) const
	{
	CWindowGc& gc = SystemGc();
	gc.Clear(aRect);
	}


void CNumericEditorContainer::SetupListIconsL()
	{
	// Get the name of the file containing the icons	
	HBufC* iconFileName;
	iconFileName = StringLoader::LoadLC(R_ICON_FILE_NAME);	// Pushes iconFileName onto the Cleanup Stack.
	
	// Create an array of icons, reading them from the file
	CArrayPtr<CGulIcon>* icons = new(ELeave) CAknIconArray(KNumberOfIcons);
	CleanupStack::PushL(icons);
	//icons->AppendL(iEikonEnv->CreateIconL(*iconFileName, EMbmNumericeditor1player,/*(mbg中自動生成的枚舉值 )*/EMbmNumericeditor1player_mask));
	icons->AppendL(iEikonEnv->CreateIconL(*iconFileName, EMbmNumericeditor2player, EMbmNumericeditor2player_mask));
	icons->AppendL(iEikonEnv->CreateIconL(*iconFileName, EMbmNumericeditor3player, EMbmNumericeditor3player_mask));
	icons->AppendL(iEikonEnv->CreateIconL(*iconFileName, EMbmNumericeditor4player, EMbmNumericeditor4player_mask));
	CleanupStack::Pop(icons);
	CleanupStack::PopAndDestroy(iconFileName);
	
	iToDoList->ItemDrawer()->ColumnData()->SetIconArray(icons); // passing ownership of icons
	}
/*
void CNumericEditorContainer::SetLabelText()
	{
		HBufC* labelText = StringLoader::LoadLC( R_LABEL_ALL_TEXT );
		//HBufC* labelText = iEikonEnv->AllocReadResourceLC( R_HEWB_LABEL_STRING );
		iLabel->SetTextL( *labelText );
		//DrawNow();
		//iLabel->Set
		CleanupStack::PopAndDestroy(labelText);
	}
*/	
/*
void CNumericEditorContainer::SetupScrollBarsL()
	{
	iToDoList->CreateScrollBarFrameL(ETrue);
	iToDoList->ScrollBarFrame()->SetScrollBarVisibilityL(
	CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
	}
*/

/**
* Called by the framework whenever a key event occurs.	
* Passes the key event to the employees list if it is not null, otherwise returns
* EKeyWasNotConsumed
* @param aKeyEvent the Key event which occured, e.g. select key pressed
* @param aType the type of Key event which occurred, e.g. key up, key down
* @return TKeyResponse EKeyWasNotConsumed if the key was not processed, EKeyWasConsumed if it was
*/
TKeyResponse CNumericEditorContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
	{
	if (iToDoList)
		return iToDoList->OfferKeyEventL (aKeyEvent, aType);
	else
		return EKeyWasNotConsumed;
	}


/**
* Invokes the form in editable state, with a new opponenet, so that the details can be entered.
* Adds the Employee to the array of iEmployees and the list
*/
void CNumericEditorContainer::NewEmployeeL()
	{
	CToDo* todo = CToDo::NewLC(); //創(chuàng)建一個新的
	TBool saveState = EFalse;
	CNumericEditorForm* form = CNumericEditorForm::NewL(*todo, saveState);//創(chuàng)建form , 要加*原因是,創(chuàng)建的是CToDo的指針,newl傳的是引用,所以加*進行轉換
	form->ExecuteLD(R_NUMERICEDITOR_FORM_DIALOG);
	if (saveState)
		{
		AddEmployeeToListL(*todo);
		CleanupStack::Pop(todo);
		}
	else
		{
		iToDoList->DrawNow();
		CleanupStack::PopAndDestroy(todo);
		}
	}

/**
* Invokes the form in the view state, with the currently selected Employee so that the details 
* can be viewed and edited.
* Updates the Employee in the array of iEmployees and the list
*/
void CNumericEditorContainer::OpenEmployeeL()
	{
	TInt index=iToDoList->CurrentItemIndex();
	CToDo& todo = *iToDoDb[index];//??????為什么加*
	TBool saveState = EFalse;
	CNumericEditorForm* form = CNumericEditorForm::NewL(todo, saveState);
	form->ExecuteLD(R_NUMERICEDITOR_FORM_DIALOG);
	if (saveState)
		{
		UpdateEmployeeInListL (todo);
		iToDoDb.SaveL();
		}
	else
		{
		iToDoList->DrawNow();
		
		//CleanupStack::PopAndDestroy(todo);
		}
	}



/**
* If the Employee is valid, adds it to the array of iEmployees and updates the list
* of employees
* @param aEmployee reference to the Employee which should be added
*/
void CNumericEditorContainer::AddEmployeeToListL (CToDo& aToDo)
	{
		iToDoDb.AddToDoL(&aToDo);
		//iToDoDb.SaveL();
		
		CTextListBoxModel* model = iToDoList->Model();  // not taking ownership
		model->SetOwnershipType (ELbmOwnsItemArray);
		CDesCArray* itemArray = STATIC_CAST(CDesCArray*, model->ItemTextArray());
		itemArray->AppendL (ListStringFromEmployeeL(aToDo));
		iToDoList->HandleItemAdditionL();
	
	}

void CNumericEditorContainer::SearchToDoL()
	{
	
		TBuf<30> aSubject;
		TDateTime dateTime(2008,EJanuary,1,0,0,0,0);
		TTime time(dateTime);//剛開始不彈出對話框,是因為資源文件的問題,設置的是多行,下面的形式用的是單行
	    
		CAknMultiLineDataQueryDialog* dlg = CAknMultiLineDataQueryDialog::NewL(aSubject, time);//創(chuàng)建form , 要加*原因是,創(chuàng)建的是CToDo的指針,newl傳的是引用,所以加*進行轉換
		dlg->ExecuteLD(R_AKNEXQUERY_MULTI_LINE_DATA_AND_DATE_LAYOUT);
		if (iToDoDb.Find(aSubject) != KErrNone)
			{
			iToDoDb.Find(aSubject);
			iToDoList->CurrentItemIndex();
			}
			iToDoList->DrawNow();
		
	}

/**
* Extracts the information from aEmployee, for display in the list.
* @param aEmployee the Employee to get the information from
*/
TBuf<50> CNumericEditorContainer::ListStringFromEmployeeL (const CToDo& aToDo) const
	{
	TBuf<50> string; 
	TBuf<3> icons;
	_LIT (KStringHeader, "%d\t%S");
	switch ( aToDo.Priority() )
				{
			case 0:
				icons = _L("1");
			case 1:
				icons = _L("2");
				break;
		 	case 2:
		 		icons = _L("0");
				break;
			default:
				break;
				}
	
	HBufC* subject = aToDo.GetSubject().AllocLC();		
	string.Format(KStringHeader(), aToDo.Priority(),subject);	
	CleanupStack::PopAndDestroy(subject);
	return string;

	}


/**
* Updates the Employee in the array of iEmployees and updates the list
* of employees
* @param aEmployee reference to the employee which should be updated
*/
void CNumericEditorContainer::UpdateEmployeeInListL (CToDo& aToDo)
	{
	CTextListBoxModel* model = iToDoList->Model();  // not taking ownership
	model->SetOwnershipType (ELbmOwnsItemArray);
	CDesCArray* itemArray = STATIC_CAST(CDesCArray*, model->ItemTextArray());
	
	TInt index = iToDoList->CurrentItemIndex();
	
	itemArray->Delete(index);
	itemArray->InsertL(index, ListStringFromEmployeeL(aToDo));
	iToDoList->DrawNow();
	}

/**
* Deletes the currently selected Employee in the array of iEmployees and updates the list of employees
*/
void CNumericEditorContainer::DeleteEmployeeL()
	{
	
	CTextListBoxModel* model = iToDoList->Model();  // not taking ownership
	model->SetOwnershipType (ELbmOwnsItemArray);
	CDesCArray* itemArray = STATIC_CAST(CDesCArray*, model->ItemTextArray());
	
	TInt index = iToDoList->CurrentItemIndex();
	
	iToDoDb.RemoveToDo(index);
	itemArray->Delete(index);
	iToDoList->SetCurrentItemIndex(iToDoList->TopItemIndex());
	iToDoList->DrawNow();
	}

/**
* Returns the number of employees currently in the list
*/
TInt CNumericEditorContainer::NumberOfEmployees()
	{
	TInt numberOfEmployees = 0;
	
	if (iToDoList)
		numberOfEmployees = iToDoDb.Count();
	
	return numberOfEmployees;
	}

void CNumericEditorContainer::HandleListBoxEventL(CEikListBox*/* aListBox*/, TListBoxEvent aListBoxEvent)
	{
	//處理listbox的控件事件
	// if the Select Key has been pressed
	if ((aListBoxEvent == MEikListBoxObserver::EEventEnterKeyPressed) ||
		(aListBoxEvent == MEikListBoxObserver::EEventItemClicked))
		{
		//	PlaySelectedGame();
		}
	}

// End of File	

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲午夜久久久久久久久久久 | 久久国产麻豆精品| 欧美日韩在线播放三区| 亚洲国产日韩a在线播放性色| 欧美视频在线观看一区二区| 日本成人在线视频网站| 欧美成人高清电影在线| 国产另类ts人妖一区二区| 国产精品久久夜| 色综合久久久网| 日韩国产成人精品| 国产亚洲综合色| 91影视在线播放| 亚洲最新视频在线播放| 欧美色欧美亚洲另类二区| 一区二区三区欧美在线观看| 欧美三级三级三级| 国产综合久久久久影院| 亚洲免费观看高清完整版在线观看熊 | 欧美日韩一二区| 久久成人免费网站| 中文字幕一区二区三| 欧美色电影在线| 国产精品91一区二区| 亚洲精品网站在线观看| 日韩一区二区三区四区| 99久久精品一区| 久久精品国产亚洲a| 亚洲天天做日日做天天谢日日欢 | 欧美丰满美乳xxx高潮www| 国产精品一区二区在线播放| 亚洲综合免费观看高清在线观看| 精品成人免费观看| 在线欧美日韩精品| 国产91精品在线观看| 视频一区二区国产| 国产精品久久久久影院老司 | 亚洲成人动漫一区| 欧美激情一区二区在线| 717成人午夜免费福利电影| 国产成人av一区二区三区在线观看| 亚洲一区自拍偷拍| 亚洲国产精品99久久久久久久久| 欧美精品在线一区二区| 96av麻豆蜜桃一区二区| 国产电影一区二区三区| 久久福利资源站| 午夜精品久久久久久久久| 国产精品萝li| 久久综合九色欧美综合狠狠| 91麻豆精品国产91| 91成人看片片| 91色乱码一区二区三区| 东方aⅴ免费观看久久av| 狠狠v欧美v日韩v亚洲ⅴ| 丝袜美腿一区二区三区| 亚洲国产精品久久艾草纯爱| 亚洲免费观看在线观看| 综合分类小说区另类春色亚洲小说欧美| 欧美大片国产精品| 欧美精品第1页| 欧美日韩国产精选| 欧美三区在线观看| 欧美四级电影网| 欧美制服丝袜第一页| 色综合激情五月| 91亚洲精品乱码久久久久久蜜桃| 懂色av一区二区夜夜嗨| 国产精品99精品久久免费| 国产精品亚洲专一区二区三区| 精品一区二区av| 激情综合色播五月| 国产呦精品一区二区三区网站| 精品亚洲国产成人av制服丝袜| 婷婷激情综合网| 日韩电影在线免费看| 美女视频黄 久久| 久久精品国产99国产| 久久精品免费观看| 精品在线一区二区三区| 国模冰冰炮一区二区| 韩国v欧美v日本v亚洲v| 福利视频网站一区二区三区| 99在线精品观看| 91日韩精品一区| 欧美色视频一区| 日韩一区二区三区在线视频| 久久综合资源网| 中文字幕欧美三区| 亚洲狠狠丁香婷婷综合久久久| 亚洲一区二区三区四区的| 日韩1区2区3区| 国产综合久久久久久鬼色 | av一本久道久久综合久久鬼色| 99久久精品99国产精品| 欧美视频一区二区在线观看| 欧美一区二区三区在| 国产亚洲成av人在线观看导航| 国产精品视频一二三区| 一区二区三区在线观看国产| 日韩成人伦理电影在线观看| 国产高清精品网站| 91网址在线看| 欧美一级视频精品观看| 国产视频一区二区在线观看| 伊人色综合久久天天| 美国十次综合导航| 成人免费高清视频在线观看| 欧美日韩亚洲丝袜制服| 26uuu久久综合| 一区二区三区资源| 久久99国内精品| 色综合久久66| 久久综合狠狠综合| 亚洲综合色区另类av| 国产精品888| 欧美区一区二区三区| 亚洲精品一区二区三区99| 亚洲精品亚洲人成人网| 国产一区二区看久久| 欧美午夜一区二区三区 | 日韩美女视频19| 久久精品国产一区二区| 在线精品视频免费观看| 欧美精品一区二区久久久| 一级中文字幕一区二区| 国产盗摄女厕一区二区三区| 4hu四虎永久在线影院成人| 国产精品激情偷乱一区二区∴| 日日噜噜夜夜狠狠视频欧美人 | 国产乱码精品一区二区三区av| 在线亚洲一区二区| 国产视频一区在线播放| 日韩国产高清在线| 日本精品视频一区二区| 欧美国产1区2区| 国产一区二三区好的| 精品视频一区二区不卡| 中文字幕在线观看不卡| 国产伦精品一区二区三区在线观看| 欧美日韩一区中文字幕| 最近日韩中文字幕| 国产露脸91国语对白| 欧美一区二区私人影院日本| 亚洲最大色网站| 日本道色综合久久| 中文字幕中文字幕一区二区| 国产精品一二三四区| 亚洲精品在线电影| 久久99国产精品免费| 日韩免费视频线观看| 免费久久99精品国产| 欧美夫妻性生活| 婷婷综合五月天| 欧美区一区二区三区| 天天做天天摸天天爽国产一区| 色综合中文字幕| 免费亚洲电影在线| 91福利国产成人精品照片| 亚洲免费伊人电影| 99re视频精品| 亚洲精品国产视频| 91麻豆国产福利在线观看| 日韩理论电影院| 91丝袜美腿高跟国产极品老师| 国产精品久久久久久久久久免费看| 国产91高潮流白浆在线麻豆| 久久精品亚洲麻豆av一区二区| 国产精品影音先锋| 国产拍欧美日韩视频二区| 国产91高潮流白浆在线麻豆| 国产精品第一页第二页第三页 | 色偷偷88欧美精品久久久| 亚洲色欲色欲www| 日本久久精品电影| 亚洲第一主播视频| 欧美日本一道本| 蜜臀精品一区二区三区在线观看| 91精品在线观看入口| 精品在线免费观看| 国产亚洲污的网站| 成人黄动漫网站免费app| 亚洲乱码日产精品bd| 欧美无砖专区一中文字| 毛片一区二区三区| 久久色中文字幕| 成人理论电影网| 亚洲成人在线网站| 日韩一级完整毛片| 国产电影一区二区三区| 亚洲同性gay激情无套| 欧美少妇性性性| 精品一二线国产| 亚洲你懂的在线视频| 欧美日韩一二区| 国产成人精品免费| 亚洲精品免费播放| 日韩免费观看高清完整版| 成人黄色av电影| 日韩激情一区二区|