当前位置: 首页>>代码示例>>C++>>正文


C++ CDisplay::GetScreenWidth方法代码示例

本文整理汇总了C++中CDisplay::GetScreenWidth方法的典型用法代码示例。如果您正苦于以下问题:C++ CDisplay::GetScreenWidth方法的具体用法?C++ CDisplay::GetScreenWidth怎么用?C++ CDisplay::GetScreenWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CDisplay的用法示例。


在下文中一共展示了CDisplay::GetScreenWidth方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: MoveWindow

void UISingleTextInputDialog::MoveWindow(int _iLeft, int _iTop, int _iWidth, int _iHeight)
{
    DebugPrintf(DLC_UISINGLETEXTINPUTDLG, "%s, %d, %s, %s START", __FILE__,  __LINE__, GetClassName(), __FUNCTION__);
    CDisplay* pDisplay = CDisplay::GetDisplay();
    if (pDisplay)
    {
        _iWidth = m_DEFAULT_WIDTH;
        _iHeight = m_DEFAULT_HEIGHT;
        _iLeft = (pDisplay->GetScreenWidth() - _iWidth) >> 1;
        _iTop = 200;
    }
    UIWindow::MoveWindow(_iLeft, _iTop, _iWidth, _iHeight);

    int iTop = m_DEFAULT_MARGIN;
    int iLeft = m_DEFAULT_MARGIN;
    int iWidth = m_iWidth - (m_DEFAULT_MARGIN << 1);
    m_txtPasswordHintLabel.MoveWindow (iLeft, iTop, iWidth, m_DEFAULT_ELEMHEIGHT);
    iTop += m_DEFAULT_ELEMHEIGHT + m_DEFAULT_ELEMSPACING;
    
    m_tbPassword.MoveWindow(iLeft, iTop, iWidth, m_DEFAULT_ELEMHEIGHT);
    iTop += (m_DEFAULT_ELEMHEIGHT + m_DEFAULT_ELEMSPACING);
    
    if(m_iDialogType == Type_Default)
    {
        const int iBtnWidth = (iWidth - m_DEFAULT_ELEMSPACING) >> 1;
        m_btnCancel.MoveWindow(iLeft, iTop, iBtnWidth, m_DEFAULT_ELEMHEIGHT);
        iLeft += iBtnWidth + m_DEFAULT_ELEMSPACING;

        m_btnOK.MoveWindow(iLeft, iTop, iBtnWidth, m_DEFAULT_ELEMHEIGHT);
    }
    else if(m_iDialogType == Type_AddLabel)
开发者ID:chenhbzl,项目名称:OriginApp,代码行数:31,代码来源:UISingleTextInputDialog.cpp

示例2: MoveWindow

void UIFootNoteDialog::MoveWindow(int left, int top, int width, int height)
{
    DebugPrintf(DLC_UIFOOTNOTEDIALOG, "%s:%d:%s  %s start", __FILE__, __LINE__, __FUNCTION__, GetClassName());
    CDisplay* pDisplay = CDisplay::GetDisplay();
    if (pDisplay)
    {
        left = (pDisplay->GetScreenWidth() - m_maxWidth) >> 1;
    }
    UIWindow::MoveWindow(left, top, m_maxWidth, height);
    m_bottomSizer->Show(m_totalPage > 1);

    Layout();
    DebugPrintf(DLC_UIFOOTNOTEDIALOG, "%s:%d:%s  %s end", __FILE__, __LINE__, __FUNCTION__, GetClassName());
}
开发者ID:chenhbzl,项目名称:OriginApp,代码行数:14,代码来源:UIFootNoteDialog.cpp

示例3: OpenBook

BOOL BookOpenManager::OpenBook()
{
    DebugPrintf(DLC_BOOKOPENMANAGER, "%s, %d, %s, %s START", __FILE__,  __LINE__, "BookOpenManager", __FUNCTION__);
	if(!m_pCurPage)
	{
		return FALSE;
	}
	CDKFileManager * pclsFileManager = CDKFileManager::GetFileManager();
	if(!pclsFileManager)
	{
		return FALSE;
	}
	pclsFileManager->ConvertDKPToDKX(GetBookPath());

	//CHourglass* pIns = CHourglass::GetInstance();
	//if(m_iHourglassLeft == 0 && m_iHourglassTop == 0)
	//{
	//	pIns = NULL;
	//}

	//if(pIns)
	//{
	//	pIns->Start(m_iHourglassLeft, m_iHourglassTop);
	//}

	CDisplay* display = CDisplay::GetDisplay();
	if(NULL == display)
	{
		return FALSE;
	}

	DkFileFormat Format = GetBookFormat();
	switch (Format)
	{
	case DFF_Text:
		SQM::GetInstance()->IncCounter(SQM_ACTION_BOOKREADER_FORMAT_TXT);
		break;
	case DFF_ZipFile:
		SQM::GetInstance()->IncCounter(SQM_ACTION_BOOKREADER_FORMAT_ZIP);
		break;
	case DFF_RoshalArchive:
		SQM::GetInstance()->IncCounter(SQM_ACTION_BOOKREADER_FORMAT_RAR);
		break;
	case DFF_PortableDocumentFormat:
		SQM::GetInstance()->IncCounter(SQM_ACTION_BOOKREADER_FORMAT_PDF);
		break;            
	case DFF_ElectronicPublishing:
		SQM::GetInstance()->IncCounter(SQM_ACTION_BOOKREADER_FORMAT_EPUB);
		break;            
	case DFF_Serialized:
		SQM::GetInstance()->IncCounter(SQM_ACTION_BOOKREADER_FORMAT_SERIALIZED);
		break;         
	case DFF_Unknown:
		SQM::GetInstance()->IncCounter(SQM_ACTION_BOOKREADER_FORMAT_UNKNOWN);
		break;
	default:
		//DONOTHING for others
		break;
	}

	if(Format == DFF_ZipFile || Format == DFF_RoshalArchive || Format == DFF_Serialized)
	{

		BOOL bOpenSuccess = OpenArchiveBook();

		//if(pIns)
		//{
		//	pIns->Stop();
		//}

		return bOpenSuccess;
	}
	else
	{
		DkReaderPage *pReader = new DkReaderPage();
		if(NULL == pReader)
		{
			//if(pIns)
			//{
			//	pIns->Stop();
			//}

			return FALSE;
		}

		if (!pReader->Initialize(GetBookPath(), GetBookName(), m_iBookID))
		{
			delete pReader;
			pReader = NULL;
			//if(pIns)
			//{
			//	pIns->Stop();
			//}

			UIMessageBox messagebox(m_pCurPage, StringManager::GetStringById(CANNOT_OPEN_BOOK), MB_OK);
			messagebox.DoModal();
		}
		else
		{
			pReader->MoveWindow(0, 0, display->GetScreenWidth(), display->GetScreenHeight());
//.........这里部分代码省略.........
开发者ID:chenhbzl,项目名称:OriginApp,代码行数:101,代码来源:BookOpenManager.cpp

示例4: OpenArchiveBook


//.........这里部分代码省略.........
	LPCSTR pFileName = NULL;

	LPCSTR *pNameArray = new LPCSTR[iChapterCount];
	if(NULL == pNameArray)
	{
		delete pCurBookContent;
		pCurBookContent = NULL;

		delete[] pZipFileList;
		pZipFileList = NULL;
		return FALSE;
	}

	for(INT index= 0; index < iChapterCount; index++)
	{
		pExtension = ChapterList[index].GetChapterExName();
		if(DFC_Picture == GetFileCategoryForZipFile(pExtension))
		{
			pFileName = ChapterList[index].GetChapterPath();
			iAdjustIndex = AdjustFileList(pZipFileList, iImageCount, pNameArray, pFileName);

			pZipFileList[iAdjustIndex].uFileId = ChapterList[index].GetChapterId();
			pZipFileList[iAdjustIndex].eFileCategory = DFC_Picture;

			strncpy(pZipFileList[iAdjustIndex].pExtension, pExtension, 16);
			iAdjustIndex++;
			iImageCount++;
		}
	}

	DebugPrintf(DLC_BOOKOPENMANAGER, "BookOpenManager::OpenBook iImageCount %d\n", iImageCount);

	delete[] pNameArray;
	pNameArray = NULL;

	if(iChapterCount == iImageCount)
	{
		BookFileList * pZipBookList = new BookFileList();
		if(NULL == pZipBookList)
		{
			delete pCurBookContent;
			pCurBookContent = NULL;

			delete[] pZipFileList;
			pZipFileList = NULL;
			return FALSE;
		}

		pZipBookList->pFileList = pZipFileList;
		pZipBookList->iBookId= m_iBookID;
		pZipBookList->uLength = iImageCount;

		DkReaderPage *pReader = new DkReaderPage();
		if(NULL == pReader)
		{
			delete pCurBookContent;
			pCurBookContent = NULL;

			delete pZipBookList;
			pZipBookList = NULL;

			return FALSE;
		}

		if(!pReader->Initialize(SPtr<BookFileList>(pZipBookList), 0, TRUE,Password))
		{

			UIMessageBox messagebox(m_pCurPage, StringManager::GetStringById(CANNOT_OPEN_BOOK), MB_OK);
			messagebox.DoModal();

			delete pCurBookContent;
			pCurBookContent = NULL;

			delete pReader;
			pReader = NULL;
			return FALSE;
		}
		else
		{
			pReader->MoveWindow(0, 0, display->GetScreenWidth(), display->GetScreenHeight());
			CPageNavigator::Goto(pReader);
			delete pCurBookContent;
			pCurBookContent = NULL;
			return TRUE;
		}
	}
	else	//如果压缩包中含有非图片内容,则暂不支持!
    {
        UIMessageBox messagebox(m_pCurPage, StringManager::GetStringById(CANNOT_OPEN_BOOK), MB_OK);
        messagebox.DoModal();

		delete pCurBookContent;
		pCurBookContent = NULL;
		delete[] pZipFileList;
		pZipFileList = NULL;
		return FALSE;
    }
    DebugPrintf(DLC_BOOKOPENMANAGER, "%s, %d, %s, %s end", __FILE__,  __LINE__, "BookOpenManager", __FUNCTION__);
    return true;
}
开发者ID:chenhbzl,项目名称:OriginApp,代码行数:101,代码来源:BookOpenManager.cpp

示例5: OnWifiMessage

void UIDownloadPage::OnWifiMessage(SNativeMessage event)
{
	if(!m_bIsVisible)
	{
		return;
	}

	if(ALLRECEIVER != event.iParam1)
	{
		LPSTR pReceiver = (LPSTR)event.iParam1;

		if(!pReceiver || strcmp(this->GetClassName(),pReceiver) != 0)
		{
			return;
		}
	}

	switch(event.iParam2)
	{
	case UPDATE_WIFI_STATUS:

		{
			UpdateTitleBar();
		}
		break;

	case POWERONOFF_WIFI:
		{
			UpdateTitleBar();
			WifiManager* wifiManager = WifiManager::GetInstance();
			if(wifiManager && wifiManager->IsPowerOn())
			{
				if(!wifiManager->IsConnected())
				{
					DebugPrintf(DLC_LIUJT, "UIDownloadPage::OnWifiMessage  No wifi connected, begin to auto join!");
					wifiManager->StartAutoJoin(WifiStatusCallBack, ConnectWifiCallBack);
				}
				else
				{
					DebugPrintf(DLC_LIUJT, "UIDownloadPage::OnWifiMessage  Has one wifi connected!!!");
				}
			}
			else
			{
				DebugPrintf(DLC_LIUJT, "UIDownloadPage::OnWifiMessage  Has no power now!!!");
			}
		}
		break;

	case CONNECT_WIFI:
		{
			UpdateTitleBar();
			ConnectionMessage* cm = (ConnectionMessage*)event.iParam3;
			if(cm && !cm->GetWifiConnected())
			{
				delete cm;
				cm = NULL;

				UIWifiDialog m_WifiDialog(this);
				CDisplay* pDisplay = CDisplay::GetDisplay();
				if(pDisplay)
				{
					m_WifiDialog.MoveWindow(0,0,pDisplay->GetScreenWidth(), pDisplay->GetScreenHeight());
					m_WifiDialog.DoModal();
				}
			}
		}

		break;
	default:
		break;

	}
}
开发者ID:chenhbzl,项目名称:OriginApp,代码行数:74,代码来源:UIDownloadPage.cpp


注:本文中的CDisplay::GetScreenWidth方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。