⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 guinavigation.cpp.svn-base

📁 sigmadesign smp8623 gui source code ,bingo
💻 SVN-BASE
📖 第 1 页 / 共 5 页
字号:
		return MorphListList(listindexto, listindex, FALSE);	return RM_OK;}RMstatus RMcuracaoGuiNavigation::DisplayOSDList(RMbool show){	if(show)		gfxDrawOSDMenu(m_pRua, &m_tvList);	else		gfxBlankRect(m_pRua, 400, 40, 250, 400);	return RM_OK;}RMstatus RMcuracaoGuiNavigation::DisplayList(RMuint8 listindex, RMbool redraw, RMbool hasFocus){	if (listindex > MAX_GUI_LISTS)		return RM_ERROR;	if (m_osdPages[m_activePageId]->lists[listindex]->type == LISTTYPE_FILE)		return DisplayFileList(listindex, redraw, hasFocus);	if (m_osdPages[m_activePageId]->lists[listindex]->type == LISTTYPE_BILLING)		return DisplayBillingList(listindex, redraw, hasFocus);	if (m_osdPages[m_activePageId]->lists[listindex]->type == LISTTYPE_STRING)		if (m_osdPages[m_activePageId]->lists[listindex]->object.hasInfo)			return DisplayInfoList(listindex, redraw, hasFocus);		else			return DisplayStringList(listindex, redraw, hasFocus);	if (m_osdPages[m_activePageId]->lists[listindex]->type == LISTTYPE_LIST)		return DisplayListList(listindex, redraw, hasFocus);	if (m_selectedObjectId & POPUP_IDMASK)	{		RMuint16 index;		RMstatus status;		status = GetObjectIndex(m_selectedObjectId, &index);		if (RMFAILED(status))			return status;		if (m_Popups[index]->lists[listindex]->type == LISTTYPE_STRING)			return DisplayStringList(listindex, redraw, hasFocus);	}	return RM_ERROR;}RMstatus RMcuracaoGuiNavigation::DisplayPopupList(RMuint8 popupindex, RMuint8 listindex, RMbool redraw, RMbool hasFocus){	if (listindex > MAX_GUI_LISTS)		return RM_ERROR;	if (m_Popups[popupindex]->lists[listindex]->type == LISTTYPE_STRING)		return DisplayPopupStringList(popupindex, listindex, redraw, hasFocus);	return RM_ERROR;}RMstatus RMcuracaoGuiNavigation::DisplayFileList(RMuint8 listIndex, RMbool redraw, RMbool hasFocus){	RMuint32 count = 0;	RMguiFileType ftype;	RMuint32 i;	if (listIndex > MAX_GUI_LISTS)		return RM_ERROR;	if (m_isoReset == TRUE)	{		if (m_isoData.isoStructure != 0)		{			// Allocate list -- gets cleared as well if previously allocated			if (RMFAILED(AllocateIsoList(m_isoData.numItems)))			{				m_isoReset = FALSE;				return RM_ERROR;			}			for (i = 0; i < m_isoData.numItems; i++)			{				if (m_isoData.isoStructure[i].isDirectory)				{					m_isoList.isoDataIndex[count] = i;					m_isoList.fileType[count] = FILETYPE_DIRECTORY;				}				else				{					ftype = GetFileType(m_isoData.isoStructure[i].name);					if ((ftype & m_isoList.displayfileType) == 0)						continue;					m_isoList.isoDataIndex[count] = i;					m_isoList.fileType[count] = ftype;				}				count++;			}		}		// get from gfx how many items we can display per page		m_isoList.numitemsPerPage = gfxGetListItemsPerPage(m_pRua, &m_osdPages[m_activePageId]->lists[listIndex]->object);		if (!m_isoList.numitemsPerPage)			return RM_ERROR;#ifdef GUI_REFID_2		if(m_gui->gui->GetPlayerMode() == PLAYER_MODE_PCLINK ||				m_gui->gui->GetPlayerMode() == PLAYER_MODE_MEDIA_CONNECT)		{			m_isoList.hasGoUp = (RMCompareAscii(m_isoData.directory, "") ? FALSE : TRUE);		}		else#endif		m_isoList.hasGoUp = (RMCompareAscii(m_isoData.directory, MOUNT_POINT) ? FALSE : TRUE);		if (m_isoList.hasGoUp)			count += 1;		m_isoList.numItems = count;		m_isoList.numCurrentPage = 0;		m_isoList.numPages = count / m_isoList.numitemsPerPage + (count % m_isoList.numitemsPerPage ? 1 : 0);		// mark iso structure as already read		m_isoReset = FALSE;	}	// display current page	return DisplayFileListPage(listIndex, m_isoList.numCurrentPage, redraw, hasFocus);}RMstatus RMcuracaoGuiNavigation::DisplayFileListPage(RMuint8 listIndex, RMuint16 listPage, RMbool redraw, RMbool hasFocus){	//	RMstatus status;	//	RMListItemObject *items[MAX_GUI_LISTITEMS];	//	RMuint16 i;	//	RMuint32 isodataindex;	//	RMuint32 nbItems = 0;	//	RMuint32 firstitem=0, lastitem=0, totalitems=0;	//	//	RMMemset(items, 0, sizeof(items));	//	//	// copy page to draw	//	firstitem = m_isoList.numCurrentPage;// * m_isoList.numitemsPerPage;	//	totalitems = ((RMuint32)(m_isoList.numCurrentPage  + m_isoList.numitemsPerPage) <= (RMuint32) (m_isoList.numItems - 1) ? m_isoList.numitemsPerPage : m_isoList.numItems - m_isoList.numCurrentPage);	//	//	if(m_isoList.hasGoUp){	//		if(m_isoList.numCurrentPage == 0){	//			RMCopyAscii(items[nbItems]->text, GOUP_DIRECTORY);	//	//			// save text info in list struct as well	//			RMCopyAscii(m_osdPages[m_activePageId]->lists[listIndex]->items[nbItems]->object.text, GOUP_DIRECTORY);	//			nbItems++;	//			totalitems -= 1;	//		}	//		else	//			firstitem -= 1;	//	}	//	else{	//		if(m_isoList.numItems == 0)	//			totalitems = 0;	//	}	//	//	lastitem = firstitem + totalitems;	//	for(i = firstitem; i < lastitem; i++){	//		isodataindex = m_isoList.isoDataIndex[i];	//		RMCopyAscii((RMascii*)(items[nbItems]->text), (const RMascii*)(m_isoData.isoStructure[isodataindex].name));	//		items[nbItems].icon = 0; //GetIsoIconType(m_isoList.fileType[i]));	//		items[nbItems].state = STATE_ENABLED;	//	//		// save text/icon info in list struct as well	//		RMCopyAscii((RMascii*)(m_osdPages[m_activePageId]->lists[listIndex]->items[nbItems]->object.text), (const RMascii*)(items[nbItems].text));	//	//	RMCopyAscii((RMascii*)(m_osdPages[m_activePageId]->lists[listIndex]->items[nbItems]->object.icon), (const RMascii*)(items[nbItems].icon));	//		m_osdPages[m_activePageId]->lists[listIndex]->items[nbItems]->object.state = items[nbItems].state;	//		nbItems++;	//	}	//	//	m_osdPages[m_activePageId]->lists[listIndex]->nbItemsDisplayed = nbItems;	//	//	// ARM-elf-gcc generate an error at compilation if redraw is directly affected to m_osdPages structure	//	// this is a work around, but we need to upgrade to arm-elf-gcc 2.95.3 to get rid of this hack	//	if(hasFocus)	//		m_osdPages[m_activePageId]->lists[listIndex]->object.hasfocus = TRUE;	//	else	//		m_osdPages[m_activePageId]->lists[listIndex]->object.hasfocus = FALSE;	//	//	// idem	//	if(redraw)	//		m_osdPages[m_activePageId]->lists[listIndex]->object.redraw = TRUE;	//	else	//		m_osdPages[m_activePageId]->lists[listIndex]->object.redraw = FALSE;	//	// 	m_osdPages[m_activePageId]->lists[listIndex]->object.visible = TRUE;	//	//#ifdef GUI_REFID_2	//	gfxSetCodePageConvertion(FALSE); // since non UTF-8	//	status = gfxDrawList(m_pRua,	//			     &(m_osdPages[m_activePageId]->object),	//			     &(m_osdPages[m_activePageId]->lists[listIndex]->object),	//			     items,	//			     nbItems);	//	gfxSetCodePageConvertion(TRUE);	//#else	//	status = gfxDrawList(m_pRua,	//			     &(m_osdPages[m_activePageId]->object),	//			     &(m_osdPages[m_activePageId]->lists[listIndex]->object),	//			     items,nbItems, m_List.numItems);	//#endif	return RM_OK;}RMstatus RMcuracaoGuiNavigation::ScrollBillingList(RMuint8 listIndex, RMGuiObjectSelectDirection direction){	RMListItemObject *items[MAX_GUI_LISTITEMS];	//	RMTextItemObject txitems[MAX_GUI_TEXTITEMS];	RMuint16 firstitem = 0, lastitem = 0, totalitems = 0;	RMuint16 count;	if (listIndex > MAX_GUI_LISTS)		return RM_ERROR;	m_gui->gui->KillTimer(TIMER_WAIT_ANIMATION, FALSE);	m_List.numItems = m_osdPages[m_activePageId]->lists[listIndex]->nbItems;	// get from gfx how many items we can display per page	m_List.numitemsPerPage = m_osdPages[m_activePageId]->lists[listIndex]->object.numitemsPerPage;//gfxGetListItemsPerPage(m_pRua, &m_osdPages[m_activePageId]->lists[listIndex]->object);	if (m_List.numitemsPerPage == 0)		return RM_ERROR;	m_List.numPages = m_List.numItems / m_List.numitemsPerPage + (m_List.numItems % m_List.numitemsPerPage ? 1 : 0);	// display current pagem_List.numItems = m_osdPages[pageID]->lists[listIndex]->nbItems;	RMMemset(items, 0, sizeof(items));	// copy page to draw	if (m_osdPages[m_activePageId]->lists[listIndex]->object.firstvisible			== m_osdPages[m_activePageId]->lists[listIndex]->object.lastvisible)	{		if (m_List.numitemsPerPage > 1)		{			m_osdPages[m_activePageId]->lists[listIndex]->object.firstvisible = 1;			firstitem = m_osdPages[m_activePageId]->lists[listIndex]->object.firstvisible;			totalitems = ((firstitem + m_List.numitemsPerPage - 1) < (RMuint16) m_List.numItems) ? m_List.numitemsPerPage					: m_List.numItems - firstitem + 1;			m_osdPages[m_activePageId]->lists[listIndex]->object.lastvisible = firstitem + totalitems - 1;			lastitem = m_osdPages[m_activePageId]->lists[listIndex]->object.lastvisible;		}	}	else	{		firstitem = m_osdPages[m_activePageId]->lists[listIndex]->object.firstvisible;		totalitems = ((firstitem + m_List.numitemsPerPage - 1) < (RMuint16) m_List.numItems) ? m_List.numitemsPerPage				: m_List.numItems - firstitem;		//		if(firstitem == m_osdPages[m_activePageId]->lists[listIndex]->object.selecteditem)		//			totalitems --;		lastitem = m_osdPages[m_activePageId]->lists[listIndex]->object.lastvisible;		//totalitems = lastitem - firstitem;	}	count = 0;	items[count++] = &m_osdPages[m_activePageId]->lists[listIndex]->items[0]->object;	for (RMuint16 i = firstitem; i < lastitem; i++)	{		items[count] = &m_osdPages[m_activePageId]->lists[listIndex]->items[i]->object;		count++;	}	items[count - 1]			= &m_osdPages[m_activePageId]->lists[listIndex]->items[m_osdPages[m_activePageId]->lists[listIndex]->nbItems - 1]->object;	m_osdPages[m_activePageId]->lists[listIndex]->nbItemsDisplayed = totalitems; //bacmause of the header	// ARM-elf-gcc generate an error at compilation if redraw is directly affected to m_osdPages structure	// this is a work around, but we need to upgrade to arm-elf-gcc 2.95.3 to get rid of this hack	m_osdPages[m_activePageId]->lists[listIndex]->object.hasfocus = TRUE;	m_osdPages[m_activePageId]->lists[listIndex]->object.redraw = TRUE;	m_osdPages[m_activePageId]->lists[listIndex]->object.visible = TRUE;	gfxScrolBillingList(m_pRua, &(m_osdPages[m_activePageId]->object), &(m_osdPages[m_activePageId]->lists[listIndex]->object), items,			totalitems + 1, m_List.numItems, direction);	m_gui->gui->SetTimer(TIMER_WAIT_ANIMATION, 120);	return RM_OK;}RMstatus RMcuracaoGuiNavigation::ScrollList(RMuint8 listIndex, RMGuiObjectSelectDirection direction){	RMListItemObject *items[MAX_GUI_LISTITEMS];	//RMTextItemObject txitems[MAX_GUI_TEXTITEMS];	RMuint16 firstitem = 0, lastitem = 0, totalitems = 0;	RMuint16 count;	m_gui->gui->KillTimer(TIMER_WAIT_ANIMATION, FALSE);	if (listIndex > MAX_GUI_LISTS)		return RM_ERROR;	m_List.numItems = m_osdPages[m_activePageId]->lists[listIndex]->nbItems;	// get from gfx how many items we can display per page	m_List.numitemsPerPage = m_osdPages[m_activePageId]->lists[listIndex]->object.numitemsPerPage;//gfxGetListItemsPerPage(m_pRua, &m_osdPages[m_activePageId]->lists[listIndex]->object);	if (m_List.numitemsPerPage == 0)		return RM_ERROR;	m_List.numPages = m_List.numItems / m_List.numitemsPerPage + (m_List.numItems % m_List.numitemsPerPage ? 1 : 0);	// display current pagem_List.numItems = m_osdPages[pageID]->lists[listIndex]->nbItems;	RMMemset(items, 0, sizeof(items));	// copy page to draw	if (m_osdPages[m_activePageId]->lists[listIndex]->object.firstvisible			== m_osdPages[m_activePageId]->lists[listIndex]->object.lastvisible)	{		m_osdPages[m_activePageId]->lists[listIndex]->object.firstvisible = 0;		firstitem = m_osdPages[m_activePageId]->lists[listIndex]->object.firstvisible;		totalitems = ((firstitem + m_List.numitemsPerPage - 1) < (RMuint16) m_List.numItems) ? m_List.numitemsPerPage - 1				: m_List.numItems - firstitem;		m_osdPages[m_activePageId]->lists[listIndex]->object.lastvisible = firstitem + totalitems - 1;		lastitem = m_osdPages[m_activePageId]->lists[listIndex]->object.lastvisible;	}	else	{		firstitem = m_osdPages[m_activePageId]->lists[listIndex]->object.firstvisible;		if (direction == SELECT_DOWN)			totalitems = ((firstitem + m_List.numitemsPerPage) < (RMuint16) m_List.numItems) ? (firstitem					== m_osdPages[m_activePageId]->lists[listIndex]->object.selecteditem) ? m_List.numitemsPerPage					: m_List.numitemsPerPage + 1 : m_List.numItems - firstitem;		else			totalitems = ((firstitem + m_List.numitemsPerPage) < (RMuint16) m_List.numItems) ? (firstitem + 1					== m_osdPages[m_activePageId]->lists[listIndex]->object.selecteditem) ? m_List.numitemsPerPage					: m_List.numitemsPerPage + 1 : m_List.numItems - firstitem;		//		if(firstitem == m_osdPages[m_activePageId]->lists[listIndex]->object.selecteditem)		//			totalitems --;		lastitem = m_osdPages[m_activePageId]->lists[listIndex]->object.lastvisible;		//totalitems = lastitem - firstitem;	}	count = 0;	for (RMuint16 i = firstitem; i <= lastitem; i++)	{		//RMMemcpy(&items[count], &m_osdPages[m_activePageId]->lists[listIndex]->items[i]->object, sizeof(RMListItemObject));		items[count] = &m_osdPages[m_activePageId]->lists[listIndex]->items[i]->object;		count++;	}	m_osdPages[m_activePageId]->lists[listIndex]->nbItemsDisplayed = totalitems;	// ARM-elf-gcc generate an error at compilation if redraw is directly affected to m_osdPages structure	// this is a work around, but we need to upgrade to arm-elf-gcc 2.95.3 to get rid of this hack	m_osdPages[m_activePageId]->lists[listIndex]->object.hasfocus = TRUE;	m_osdPages[m_activePageId]->lists[listIndex]->object.redraw = TRUE;	m_osdPages[m_activePageId]->lists[listIndex]->object.visible = TRUE;	gfxScrolList(m_pRua, &(m_osdPages[m_activePageId]->object), &(m_osdPages[m_activePageId]->lists[listIndex]->object), items,			totalitems, m_List.numItems, direction);	//m_gui->gui->SetTimer(TIMER_WAIT_ANIMATION, 120);	return RM_OK;}RMstatus RMcuracaoGuiNavigation::ScrollSubList(RMuint8 listIndex, RMGuiObjectSelectDirection direction){	RMListItemObject *items[MAX_GUI_LISTITEMS];	//RMTextItemObject txitems[MAX_GUI_TEXTITEMS];	RMuint16 firstitem = 0, lastitem = 0, totalitems = 0;	RMuint16 count, parent_selected, numitemsPerPage, numItems;	m_gui->gui->KillTimer(TIMER_WAIT_ANIMATION, FALSE);	if (listIndex > MAX_GUI_LISTS)		return RM_ERROR;	parent_selected = m_osdPages[m_activePageId]->lists[listIndex]->object.selecteditem;	numItems = m_osdPages[m_activePageId]->lists[listIndex]->items[parent_selected]->list->nbItems;	// get from gfx how many items we can display per page	numitemsPerPage = m_osdPages[m_activePageId]->lists[listIndex]->items[parent_selected]->list->object.numitemsPerPage;//gfxGetListItemsPerPage(m_pRua, &m_osdPages[m_activePageId]->lists[listIndex]->object);	//if(m_List.numitemsPerPage == 0)	//	return RM_ERROR;	//m_List.numPages = m_List.numItems / m_List.numitemsPerPage + (m_List.numItems % m_List.numitemsPerPage ? 1 : 0);	// display current pagem_List.numItems = m_osdPages[pageID]->lists[listIndex]->nbItems;	RMMemset(items, 0, sizeof(items));	// copy page to draw	if (m_osdPages[m_activePageId]->lists[listIndex]->items[parent_selected]->list->object.firstvisible			== m_osdPages[m_activePageId]->lists[listIndex]->items[parent_selected]->list->object.lastvisible)	{		m_osdPages[m_activePageId]->lists[listIndex]->items[parent_selected]->list->object.firstvisible = 0;		firstitem = m_osdPages[m_activePageId]->lists[listIndex]->items[parent_selected]->list->object.firstvisible;		totalitems = ((firstitem + numitemsPerPage - 1) < (RMuint16) numItems) ? numitemsPerPage - 1 : numItems - firstitem;		m_osdPages[m_activePageId]->lists[listIndex]->items[parent_selected]->list->object.lastvisible = firstitem + totalitems - 1;		lastitem = m_osdPages[m_activePageId]->lists[listIndex]->items[parent_selected]->list->object.lastvisible;	}	else	{		firstitem = m_osdPages[m_activePageId]->lists[listIndex]->items[parent_selected]->list->object.firstvisible;		totalitems = ((firstitem + numitemsPerPage) < (RMuint16) numItems) ? (firstitem				== m_osdPages[m_activePageId]->lists[listIndex]->items[parent_selected]->list->object.selecteditem) ? numitemsPerPage				: numitemsPerPage + 1 : numItems - firstitem;		//		if(firstitem == m_osdPages[m_activePageId]->lists[listIndex]->object.selecteditem)		//			totalitems --;		lastitem = m_osdPages[m_activePageId]->lists[listIndex]->items[parent_selected]->list->object.lastvisible;		//totalitems = lastitem - firstitem;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -