本文整理汇总了C++中CDisplay::GetScreenHeight方法的典型用法代码示例。如果您正苦于以下问题:C++ CDisplay::GetScreenHeight方法的具体用法?C++ CDisplay::GetScreenHeight怎么用?C++ CDisplay::GetScreenHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDisplay
的用法示例。
在下文中一共展示了CDisplay::GetScreenHeight方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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;
}
示例2: 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());
//.........这里部分代码省略.........
示例3: 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;
}
}