================ rvOpenFileDialog::HandleInitDialog Handles the init dialog message ================ */
| 292 | ================ |
| 293 | */ |
| 294 | void rvOpenFileDialog::HandleInitDialog ( void ) |
| 295 | { |
| 296 | // Cache the more used window handles |
| 297 | mWndFileList = GetDlgItem ( mWnd, IDC_TOOLS_FILELIST ); |
| 298 | mWndLookin = GetDlgItem ( mWnd, IDC_TOOLS_LOOKIN ); |
| 299 | |
| 300 | // Load the custom resources used by the controls |
| 301 | mImageList = ImageList_LoadBitmap ( mInstance, MAKEINTRESOURCE(IDB_TOOLS_OPEN),16,1,RGB(255,255,255) ); |
| 302 | mBackBitmap = (HBITMAP)LoadImage ( mInstance, MAKEINTRESOURCE(IDB_TOOLS_BACK), IMAGE_BITMAP, 16, 16, LR_DEFAULTCOLOR|LR_LOADMAP3DCOLORS ); |
| 303 | |
| 304 | // Attach the image list to the file list and lookin controls |
| 305 | ListView_SetImageList ( mWndFileList, mImageList, LVSIL_SMALL ); |
| 306 | SendMessage( mWndLookin,CBEM_SETIMAGELIST,0,(LPARAM) mImageList ); |
| 307 | |
| 308 | // Back button is a bitmap button |
| 309 | SendMessage( GetDlgItem ( mWnd, IDC_TOOLS_BACK ), BM_SETIMAGE, IMAGE_BITMAP, (LONG_PTR) mBackBitmap ); |
| 310 | |
| 311 | // Allow custom titles |
| 312 | SetWindowText ( mWnd, mTitle ); |
| 313 | |
| 314 | // Custom ok button title |
| 315 | if ( mOKTitle.Length ( ) ) |
| 316 | { |
| 317 | SetWindowText ( GetDlgItem ( mWnd, IDOK ), mOKTitle ); |
| 318 | } |
| 319 | |
| 320 | // See if there is a filename in the lookin |
| 321 | idStr temp; |
| 322 | idStr filename = mLookin; |
| 323 | filename.ExtractFileExtension ( temp ); |
| 324 | if ( temp.Length ( ) ) |
| 325 | { |
| 326 | filename.ExtractFileName ( temp ); |
| 327 | SetWindowText ( GetDlgItem ( mWnd, IDC_TOOLS_FILENAME ), temp ); |
| 328 | filename.StripFilename ( ); |
| 329 | idStr::snPrintf( mLookin, sizeof( mLookin ), "%s", filename.c_str() ); |
| 330 | } |
| 331 | |
| 332 | // Update our controls |
| 333 | UpdateLookIn ( ); |
| 334 | UpdateFileList ( ); |
| 335 | } |
| 336 | |
| 337 | /* |
| 338 | ================ |
no test coverage detected