void CGuiWorkTab::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) { // TODO: Add your message handler code here and/or call default //CWnd::OnHScroll(nSBCode, nPos, pScrollBar); if (pScrollBar->GetSafeHwnd() == m_scroll.GetSafeHwnd()) { CGuiTab* ct = (CGuiTab*) m_pArray[m_iSelectTab]; CWnd* ViewAc = ct->pParent; ViewAc->SendMessage(WM_HSCROLL, MAKEWPARAM(nSBCode, nPos)); SizeScroll(); return; } CClientDC dc(this); Drawtabs(&dc); }
void CWorkTab::OnHScroll(UINT nSBCode, UINT nPos, HWND hScrollBar) { // TODO: Add your message handler code here and/or call default Default(); if (hScrollBar == m_scroll.GetSafeHwnd()) { CTab* ct = (CTab*) m_pArray[m_iSelectTab]; CWin* ViewAc = reinterpret_cast<CWin*>(ct->pParent); ViewAc->SendMessage(WM_HSCROLL, MAKEWPARAM(nSBCode, nPos),0); SizeScroll(); return; } CClientDC dc(this); Drawtabs(&dc); dc.DeleteDC(); }
BOOL CWorkTab::OnSize(UINT nType, int cx, int cy) { CContainer::OnSize(nType, cx, cy); SizeScroll(); return TRUE; }
void CGuiWorkTab::OnSize(UINT nType, int cx, int cy) { CGuiTabWnd::OnSize(nType, cx, cy); SizeScroll(); }
void CKS_Import_File_Browser::SetPath(const std::string& sPath) { CAutoDelete<ge::IWaitCursor> pWaitCursor(ge::IWaitCursor::Create()); std::string sEnum; mItems.clear(); tbool bWasOldMyComputer = (strcmp(msPath.c_str(), ":") == 0); tbool bIsNewMyComputer = (strcmp(sPath.c_str(), ":") == 0); msPath = sPath; if (bIsNewMyComputer) { // List "My Computer" - a.k.a. disk volumes tchar pszEnumVolumes[1024]; if (IFile::GetDriveNames(pszEnumVolumes, sizeof(pszEnumVolumes), '@', true)) { std::list<std::string> listVolumes; PszEnumString2List(pszEnumVolumes, '@', listVolumes); std::list<std::string>::iterator itVolumes = listVolumes.begin(); for ( ; itVolumes != listVolumes.end(); itVolumes++) { SItemInfo Info; Info.sName = *itVolumes; Info.bDir = true; mItems.push_back(Info); } sEnum = pszEnumVolumes; } } else if (bWasOldMyComputer) { #ifdef _WIN32 // For windows we must use only the drive letter part of the path tint32 iPosSpace = msPath.find_first_of(' '); if (iPosSpace > -1) { msPath.erase(iPosSpace); msPath += ":\\"; } #endif // _WIN32 } CAutoDelete<IFileSearch> pSearch(IFileSearch::Create()); std::string sSearchPathName(msPath); sSearchPathName += "*"; pSearch->Init2(sSearchPathName.c_str()); tbool bFirst = true; tchar pszName[1024]; tbool bDir; while (pSearch->GetNext(pszName, bDir)) { std::string sName; tbool bFirstOld = bFirst; if (bFirst == false) { sName = "@"; } bFirst = false; tbool bOK = false; sName += std::string(pszName); if (bDir) { sName += " (dir)"; bOK = true; } else { std::string sPathName(msPath); sPathName += std::string(pszName); CAutoDelete<IFile> pFile(IFile::Create()); if (pFile->Open(sPathName.c_str(), IFile::FileRead)) { ac::IDecoder* pDec = ac::IDecoder::Create(pFile); if (pDec) { bOK = true; pDec->Destroy(); } } } if (bOK) { sEnum += sName; SItemInfo Info; Info.sName = std::string(pszName); Info.bDir = bDir; mItems.push_back(Info); } else { bFirst = bFirstOld; } } mpListBox->SetText(sEnum.c_str(), '@'); tint32 iTextHeight = mItems.size() * 14; ge::SSize SizeScroll(200 - giScrollBarSize, iTextHeight); ge::SScrollPos ScrollPos; mpScrollPane->GetScrollPos(ScrollPos); ScrollPos.AreaSize = SizeScroll; if (ScrollPos.AreaSize.iCY < ScrollPos.VisibleRect.iCY) { ScrollPos.AreaSize.iCY = ScrollPos.VisibleRect.iCY; } mpScrollPane->SetScrollPos(ScrollPos); ge::SSize SizeListBox(SizeScroll - ge::SSize(4, 0)); mpListBox->SetSize(SizeListBox); } // SetPath