#include #include #include #include #include #include SlideSelect::SlideSelect(HWND hParent) : mhParent(hParent) { } SlideSelect::~SlideSelect() { } WORD SlideSelect::selectSlides(Block &pathFileNames) { HINSTANCE hInstance; int retCode; pathFileNames.remove(); mPathFileNames.remove(); #if defined(__FLAT__) hInstance=(HINSTANCE)::GetWindowLong(mhParent,GWL_HINSTANCE); #else hInstance=(HINSTANCE)::GetWindowWord(mhParent,GWW_HINSTANCE); #endif retCode=::DialogBoxParam(hInstance,(LPSTR)"SlideShow",mhParent,(DLGPROC)DWindow::DialogProcedure,(LONG)((DWindow*)this)); if(retCode)retCode=(int)mPathFileNames.size(); if(retCode)copyList(pathFileNames); return retCode; } int SlideSelect::DlgProc(UINT message,WPARAM wParam,LPARAM lParam) { switch(message) { case WM_INITDIALOG : Main::smhBitmap.associate(IDOK, String(STRING_BITMAPOKFOCUSUP,Main::processInstance()), String(STRING_BITMAPOKNOFUP,Main::processInstance()), String(STRING_BITMAPOKFOCUSDN,Main::processInstance()), OwnerDraw::NOFOCUS); Main::smhBitmap.associate(IDCANCEL, String(STRING_BITMAPCAFOCUSUP,Main::processInstance()), String(STRING_BITMAPCANOFUP,Main::processInstance()), String(STRING_BITMAPCAFOCUSDN,Main::processInstance()), OwnerDraw::NOFOCUS); ::SendDlgItemMessage(GetHandle(),SS_BITMAP,BM_SETCHECK,TRUE,0L); return TRUE; case WM_DRAWITEM : switch(((LPDRAWITEMSTRUCT)lParam)->CtlID) { case IDOK : Main::smhBitmap.handleOwnerButton(IDOK,lParam); break; case IDCANCEL : Main::smhBitmap.handleOwnerButton(IDCANCEL,lParam); break; } return TRUE; case WM_COMMAND : switch(GET_WM_COMMAND_ID(wParam,lParam)) { case SS_BITMAP : handleBitmapEvent(); return FALSE; case SS_PROJECT : handleProjectEvent(); return FALSE; case SS_LIST : handleListBoxEvent(lParam); return FALSE; case SS_SELECT : handleSelectEvent(lParam); return FALSE; case IDOK : retrieveItemList(); freeBitmaps(); ::EndDialog(GetHandle(),TRUE); return TRUE; case IDCANCEL : freeBitmaps(); ::EndDialog(GetHandle(),FALSE); return TRUE; } } return FALSE; } void SlideSelect::freeBitmaps(void)const { Main::smhBitmap.freeButton(IDOK); Main::smhBitmap.freeButton(IDCANCEL); return; } void SlideSelect::copyList(Block &pathFileNames) { size_t listSize((int)mPathFileNames.size()); for(int index=0;index> tempString; if(tempString.isNull())continue; if(selectedBitmap.isValidBitmap(tempString)) ::SendDlgItemMessage(GetHandle(),SS_LIST,LB_ADDSTRING,0,(LPARAM)(LPCSTR)tempString); else errorCount++; } waitCursor(FALSE); ::SendMessage(::GetDlgItem(GetHandle(),SS_LIST),WM_SETREDRAW,TRUE,0L); if(errorCount) ::MessageBox(GetHandle(),(LPSTR)errorItemsNotPresent,(LPSTR)"Error loading project",MB_OK); }