Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

795 lines
19 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. FTMan
  5. File Name:
  6. FTListVw.cpp
  7. Abstract:
  8. Implementation of the CFTListView class. It is a list view displaying all members of a
  9. logical volume
  10. Author:
  11. Cristian Teodorescu October 20, 1998
  12. Notes:
  13. Revision History:
  14. --*/
  15. #include "stdafx.h"
  16. #include "Actions.h"
  17. #include "FTDoc.h"
  18. #include "FTListVw.h"
  19. #include "FTTreeVw.h"
  20. #include "Item.h"
  21. #include "MainFrm.h"
  22. #include "LogVol.h"
  23. #include "PhPart.h"
  24. #include "Resource.h"
  25. #ifdef _DEBUG
  26. #define new DEBUG_NEW
  27. #undef THIS_FILE
  28. static char THIS_FILE[] = __FILE__;
  29. #endif
  30. // This is the configuration of the list-view columns
  31. LV_COLUMN_CONFIG ColumnsConfig[COLUMNS_NUMBER] = {
  32. { LVC_Name, IDS_COLUMN_NAME, LVCFMT_LEFT, 20 },
  33. { LVC_Type, IDS_COLUMN_TYPE, LVCFMT_LEFT, 20 },
  34. { LVC_DiskNumber, IDS_COLUMN_DISKS, LVCFMT_RIGHT, 10 },
  35. { LVC_Size, IDS_COLUMN_SIZE, LVCFMT_RIGHT, 15 },
  36. { LVC_Offset, IDS_COLUMN_OFFSET, LVCFMT_RIGHT, 15 },
  37. { LVC_VolumeID, IDS_COLUMN_VOLUMEID,LVCFMT_RIGHT, 20 } };
  38. /////////////////////////////////////////////////////////////////////////////
  39. // CFTListView
  40. IMPLEMENT_DYNCREATE(CFTListView, CListView)
  41. BEGIN_MESSAGE_MAP(CFTListView, CListView)
  42. //{{AFX_MSG_MAP(CFTListView)
  43. ON_WM_DESTROY()
  44. ON_NOTIFY_REFLECT(NM_DBLCLK, OnDblclk)
  45. ON_COMMAND(ID_ITEM_EXPAND, OnItemExpand)
  46. ON_NOTIFY_REFLECT(NM_RCLICK, OnRclick)
  47. ON_COMMAND(ID_ACTION_ASSIGN, OnActionAssign)
  48. ON_UPDATE_COMMAND_UI(ID_ACTION_ASSIGN, OnUpdateActionAssign)
  49. ON_COMMAND(ID_ACTION_FTBREAK, OnActionFtbreak)
  50. ON_UPDATE_COMMAND_UI(ID_ACTION_FTBREAK, OnUpdateActionFtbreak)
  51. ON_COMMAND(ID_ACTION_CREATE_EXTENDED_PARTITION, OnActionCreateExtendedPartition)
  52. ON_UPDATE_COMMAND_UI(ID_ACTION_CREATE_EXTENDED_PARTITION, OnUpdateActionCreateExtendedPartition)
  53. ON_COMMAND(ID_ACTION_CREATE_PARTITION, OnActionCreatePartition)
  54. ON_UPDATE_COMMAND_UI(ID_ACTION_CREATE_PARTITION, OnUpdateActionCreatePartition)
  55. ON_COMMAND(ID_ACTION_DELETE, OnActionDelete)
  56. ON_UPDATE_COMMAND_UI(ID_ACTION_DELETE, OnUpdateActionDelete)
  57. ON_COMMAND(ID_ACTION_FTINIT, OnActionFtinit)
  58. ON_UPDATE_COMMAND_UI(ID_ACTION_FTINIT, OnUpdateActionFtinit)
  59. ON_COMMAND(ID_ACTION_FTMIRROR, OnActionFtmirror)
  60. ON_UPDATE_COMMAND_UI(ID_ACTION_FTMIRROR, OnUpdateActionFtmirror)
  61. ON_COMMAND(ID_ACTION_FTSTRIPE, OnActionFtstripe)
  62. ON_UPDATE_COMMAND_UI(ID_ACTION_FTSTRIPE, OnUpdateActionFtstripe)
  63. ON_COMMAND(ID_ACTION_FTSWAP, OnActionFtswap)
  64. ON_UPDATE_COMMAND_UI(ID_ACTION_FTSWAP, OnUpdateActionFtswap)
  65. ON_COMMAND(ID_ACTION_FTSWP, OnActionFtswp)
  66. ON_UPDATE_COMMAND_UI(ID_ACTION_FTSWP, OnUpdateActionFtswp)
  67. ON_COMMAND(ID_ACTION_FTVOLSET, OnActionFtvolset)
  68. ON_UPDATE_COMMAND_UI(ID_ACTION_FTVOLSET, OnUpdateActionFtvolset)
  69. //}}AFX_MSG_MAP
  70. END_MESSAGE_MAP()
  71. /////////////////////////////////////////////////////////////////////////////
  72. // CFTListView construction/destruction
  73. CFTListView::CFTListView() : m_pParentData(NULL)
  74. {
  75. // TODO: add construction code here
  76. }
  77. CFTListView::~CFTListView()
  78. {
  79. }
  80. BOOL CFTListView::PreCreateWindow(CREATESTRUCT& cs)
  81. {
  82. // TODO: Modify the Window class or styles here by modifying
  83. // the CREATESTRUCT cs
  84. return CListView::PreCreateWindow(cs);
  85. }
  86. /////////////////////////////////////////////////////////////////////////////
  87. // CFTListView drawing
  88. void CFTListView::OnDraw(CDC* pDC)
  89. {
  90. // TODO: add draw code for native data here
  91. }
  92. void CFTListView::OnInitialUpdate()
  93. {
  94. MY_TRY
  95. CListView::OnInitialUpdate();
  96. // fill in image list for normal icons
  97. CImageList* pImageList = new CImageList();
  98. if( pImageList->Create( IDB_IMAGELIST_LARGE, 32, 32, RGB( 255, 0, 255 ) ) )
  99. GetListCtrl().SetImageList(pImageList, LVSIL_NORMAL);
  100. else
  101. AfxMessageBox( IDS_ERR_CREATE_IMAGELIST, MB_ICONSTOP );
  102. // fill in image list for small icons
  103. pImageList = new CImageList();
  104. if( pImageList->Create( IDB_IMAGELIST_SMALL, 16, 16, RGB( 255, 0, 255 ) ) )
  105. GetListCtrl().SetImageList(pImageList, LVSIL_SMALL);
  106. else
  107. AfxMessageBox( IDS_ERR_CREATE_IMAGELIST, MB_ICONSTOP );
  108. // insert columns (REPORT mode) and modify the new header items
  109. CRect rect;
  110. GetListCtrl().GetWindowRect(&rect);
  111. for( int i = 0; i < COLUMNS_NUMBER; i++ )
  112. {
  113. PLV_COLUMN_CONFIG pColumn = &(ColumnsConfig[i]);
  114. CString str;
  115. if( !str.LoadString(pColumn->dwTitleID) )
  116. ASSERT(FALSE);
  117. GetListCtrl().InsertColumn( i, str, pColumn->nFormat ,
  118. rect.Width() * pColumn->wWidthPercent/100, pColumn->iSubItem);
  119. }
  120. // Set the list-view style
  121. ModifyStyle(LVS_TYPEMASK, LVS_REPORT | LVS_SHOWSELALWAYS );
  122. // Load the popup menu
  123. m_menuPopup.LoadMenu(IDM_POPUP);
  124. // TODO: You may populate your ListView with items by directly accessing
  125. // its list control through a call to GetListCtrl().
  126. MY_CATCH_AND_REPORT
  127. }
  128. int CFTListView::GetFocusedItem() const
  129. {
  130. return GetListCtrl().GetNextItem(-1, LVNI_FOCUSED );
  131. }
  132. BOOL CFTListView::SetFocusedItem( int iItem )
  133. {
  134. // The old focused item must loose the focus
  135. GetListCtrl().SetItemState(GetFocusedItem(), 0, LVNI_FOCUSED);
  136. // The new item receive focus
  137. return GetListCtrl().SetItemState(iItem, LVNI_FOCUSED, LVNI_FOCUSED);
  138. }
  139. BOOL CFTListView::SelectItem( int iItem, BOOL bSelect /* =TRUE */ )
  140. {
  141. return GetListCtrl().SetItemState( iItem, bSelect ? LVNI_SELECTED : 0, LVNI_SELECTED );
  142. }
  143. CItemData* CFTListView::GetItemData( int iItem )
  144. {
  145. LVITEM lvItem;
  146. lvItem.iItem = iItem;
  147. lvItem.iSubItem = LVC_Name;
  148. lvItem.mask = LVIF_PARAM;
  149. if( !GetListCtrl().GetItem(&lvItem) )
  150. return NULL;
  151. return (CItemData*)(lvItem.lParam);
  152. }
  153. BOOL CFTListView::AddItem( CItemData* pData )
  154. {
  155. MY_TRY
  156. LVITEM lvitem;
  157. CString strDisplay;
  158. // Just in case
  159. if( pData == NULL )
  160. return FALSE;
  161. BOOL bReportStyle = ( GetWindowLong( GetListCtrl().GetSafeHwnd(), GWL_STYLE ) & LVS_REPORT );
  162. // 1. Insert the item
  163. lvitem.iItem = GetListCtrl().GetItemCount();
  164. ASSERT(LVC_Name==0); // The first SubItem must be zero
  165. lvitem.iSubItem = LVC_Name;
  166. if( bReportStyle )
  167. pData->GetDisplayName(strDisplay);
  168. else
  169. pData->GetDisplayExtendedName(strDisplay);
  170. lvitem.pszText = (LPTSTR)(LPCTSTR)strDisplay;
  171. lvitem.iImage = pData->GetImageIndex();
  172. lvitem.lParam = (LPARAM)pData;
  173. lvitem.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM ;
  174. int iActualItem = GetListCtrl().InsertItem( &lvitem );
  175. if( iActualItem < 0 )
  176. return FALSE;
  177. // The items must appear in the list exactly in the order we added them
  178. ASSERT( iActualItem == lvitem.iItem );
  179. pData->SetListItem( iActualItem );
  180. // 2. Set all subitems
  181. lvitem.iItem = iActualItem;
  182. lvitem.mask = LVIF_TEXT;
  183. // Type
  184. lvitem.iSubItem = LVC_Type;
  185. pData->GetDisplayType(strDisplay);
  186. lvitem.pszText = (LPTSTR)(LPCTSTR)strDisplay;
  187. GetListCtrl().SetItem( &lvitem );
  188. // Disks set
  189. lvitem.iSubItem = LVC_DiskNumber;
  190. pData->GetDisplayDisksSet(strDisplay);
  191. lvitem.pszText = (LPTSTR)(LPCTSTR)strDisplay;
  192. GetListCtrl().SetItem( &lvitem );
  193. // Size
  194. lvitem.iSubItem = LVC_Size;
  195. pData->GetDisplaySize(strDisplay);
  196. lvitem.pszText = (LPTSTR)(LPCTSTR)strDisplay;
  197. GetListCtrl().SetItem( &lvitem );
  198. // Offset
  199. lvitem.iSubItem = LVC_Offset;
  200. pData->GetDisplayOffset(strDisplay);
  201. lvitem.pszText = (LPTSTR)(LPCTSTR)strDisplay;
  202. GetListCtrl().SetItem( &lvitem );
  203. // Volume ID
  204. lvitem.iSubItem = LVC_VolumeID;
  205. pData->GetDisplayVolumeID(strDisplay);
  206. lvitem.pszText = (LPTSTR)(LPCTSTR)strDisplay;
  207. GetListCtrl().SetItem( &lvitem );
  208. return TRUE;
  209. MY_CATCH_REPORT_AND_RETURN_FALSE
  210. }
  211. BOOL CFTListView::RefreshItem( int iItem )
  212. {
  213. MY_TRY
  214. LVITEM lvitem;
  215. CString strDisplay;
  216. BOOL bReportStyle = ( GetWindowLong( GetListCtrl().GetSafeHwnd(), GWL_STYLE ) & LVS_REPORT );
  217. // 1. Get the item data
  218. lvitem.iItem = iItem;
  219. ASSERT(LVC_Name==0); // The first SubItem must be zero
  220. lvitem.iSubItem = LVC_Name;
  221. lvitem.mask = LVIF_PARAM ;
  222. if( !GetListCtrl().GetItem( &lvitem ) )
  223. return FALSE;
  224. CItemData* pData = (CItemData*)(lvitem.lParam);
  225. ASSERT( pData );
  226. ASSERT( pData->GetListItem() == iItem );
  227. // 2. Now refresh the name and the image of the item
  228. if( bReportStyle )
  229. pData->GetDisplayName( strDisplay );
  230. else
  231. pData->GetDisplayExtendedName( strDisplay );
  232. lvitem.pszText = (LPTSTR)(LPCTSTR)strDisplay;
  233. lvitem.iImage = pData->GetImageIndex();
  234. lvitem.mask = LVIF_TEXT | LVIF_IMAGE;
  235. return GetListCtrl().SetItem( &lvitem );
  236. MY_CATCH_REPORT_AND_RETURN_FALSE
  237. }
  238. BOOL CFTListView::AddMembersFromTree()
  239. {
  240. MY_TRY
  241. GetListCtrl().DeleteAllItems();
  242. if( !m_pParentData )
  243. return TRUE;
  244. CMainFrame* pFrame = STATIC_DOWNCAST(CMainFrame, GetParentFrame() );
  245. CFTTreeView* pLeftView = (CFTTreeView*)(pFrame->GetLeftPane());
  246. ASSERT( pLeftView );
  247. CTreeCtrl& rTreeCtrl = pLeftView->GetTreeCtrl();
  248. ASSERT( m_pParentData->AreMembersInserted() );
  249. HTREEITEM hItem = m_pParentData->GetTreeItem();
  250. ASSERT(hItem);
  251. // For each member of the item add a new item to the list view
  252. HTREEITEM hChild = rTreeCtrl.GetChildItem(hItem);
  253. while( hChild != NULL )
  254. {
  255. TVITEM tvItem;
  256. tvItem.hItem = hChild;
  257. tvItem.mask = TVIF_PARAM;
  258. if( rTreeCtrl.GetItem(&tvItem) )
  259. {
  260. ASSERT(tvItem.lParam);
  261. if( !AddItem( (CItemData*)(tvItem.lParam) ) )
  262. return FALSE;
  263. }
  264. else
  265. ASSERT(FALSE);
  266. hChild = rTreeCtrl.GetNextSiblingItem(hChild);
  267. }
  268. SelectItem(0);
  269. SetFocusedItem(0);
  270. return TRUE;
  271. MY_CATCH_REPORT_AND_RETURN_FALSE
  272. }
  273. // This method fills the list view with all members of the given item
  274. // It causes also the expandation of the parent item in the tree view ( if it is not expanded )
  275. BOOL CFTListView::ExpandItem( int iItem)
  276. {
  277. MY_TRY
  278. if( iItem < 0 )
  279. return FALSE;
  280. // Now get the CItemData structure of the selected item
  281. CItemData* pData = GetItemData(iItem);
  282. if( !pData )
  283. return FALSE;
  284. // TODO: Add your control notification handler code here
  285. ASSERT( m_pParentData );
  286. // Double-clicking a member of the list is equivalent with two actions in the tree:
  287. // 1. Expand the selected item ( if not expanded )
  288. // 2. Select a member of it
  289. CMainFrame* pFrame = STATIC_DOWNCAST(CMainFrame, GetParentFrame() );
  290. CFTTreeView* pLeftView = (CFTTreeView*)(pFrame->GetLeftPane());
  291. ASSERT(pLeftView);
  292. CTreeCtrl& rTreeCtrl = pLeftView->GetTreeCtrl();
  293. // First expand the parent tree item
  294. HTREEITEM hItem = m_pParentData->GetTreeItem();
  295. ASSERT( hItem );
  296. TVITEM tvItem;
  297. tvItem.hItem = hItem;
  298. tvItem.stateMask = TVIS_EXPANDED;
  299. tvItem.mask = TVIF_STATE;
  300. rTreeCtrl.GetItem(&tvItem);
  301. // If the parent node is not expanded then expand it
  302. if( !(tvItem.state & TVIS_EXPANDED ) )
  303. {
  304. // Reset the ExpandedOnce flag; so the tree view will receive the OnItemExpanding notification
  305. tvItem.stateMask = TVIS_EXPANDEDONCE;
  306. tvItem.state = 0;
  307. rTreeCtrl.SetItem(&tvItem);
  308. // Before expanding the tree we must take a copy of pData ( because the expandation causes
  309. // all list-view items to be refreshed i.e. the old CItemData structures to be deleted
  310. CItemData* pOldData;
  311. if( pData->GetItemType() == IT_LogicalVolume )
  312. pOldData = new CLogicalVolumeData( *((CLogicalVolumeData*)pData) );
  313. else if( pData->GetItemType() == IT_PhysicalPartition )
  314. pOldData = new CPhysicalPartitionData( *((CPhysicalPartitionData*)pData) );
  315. else
  316. ASSERT(FALSE);
  317. rTreeCtrl.Expand( hItem, TVE_EXPAND );
  318. // Now we must find the old member among the new refreshed members
  319. int i;
  320. for( i=0, pData = NULL; ( i < GetListCtrl().GetItemCount() ) && !pData; i++ )
  321. {
  322. CItemData* pItemData = GetItemData(i);
  323. if( *pOldData == *pItemData )
  324. pData = pItemData;
  325. }
  326. // It is possible to don't find our member anymore
  327. // That means something happened with it outside our application
  328. if( !pData )
  329. {
  330. CString strDisplayName, str;
  331. pOldData->GetDisplayExtendedName(strDisplayName);
  332. AfxFormatString1(str, IDS_ERR_MEMBER_NOT_FOUND_ANYMORE, strDisplayName);
  333. AfxMessageBox(str,MB_ICONSTOP);
  334. delete pOldData;
  335. return FALSE;
  336. }
  337. delete pOldData;
  338. }
  339. // Then mark the double-clicked item as selected in the tree
  340. ASSERT( pData->GetTreeItem() );
  341. //rTreeCtrl.EnsureVisible( pData->GetTreeItem() );
  342. return rTreeCtrl.SelectItem( pData->GetTreeItem() );
  343. MY_CATCH_REPORT_AND_RETURN_FALSE
  344. }
  345. ////////////////////////////////////////////////////////////////////////////////////////////////
  346. // Public methods
  347. void CFTListView::GetSnapshot( LIST_SNAPSHOT& snapshot )
  348. {
  349. MY_TRY
  350. CWaitCursor wc;
  351. snapshot.setSelectedItems.RemoveAll();
  352. int iItem = GetListCtrl().GetNextItem( -1, LVNI_SELECTED );
  353. while (iItem >= 0)
  354. {
  355. CItemData* pData = GetItemData(iItem);
  356. ASSERT(pData);
  357. CItemID idItem( *pData );
  358. snapshot.setSelectedItems.Add(idItem);
  359. iItem = GetListCtrl().GetNextItem( iItem, LVNI_SELECTED );
  360. }
  361. MY_CATCH_AND_REPORT
  362. }
  363. void CFTListView::SetSnapshot( LIST_SNAPSHOT& snapshot )
  364. {
  365. MY_TRY
  366. CWaitCursor wc;
  367. for ( int i = 0; i < GetListCtrl().GetItemCount(); i++ )
  368. {
  369. CItemData* pData = GetItemData(i);
  370. ASSERT( pData );
  371. CItemID idItem( *pData );
  372. if( snapshot.setSelectedItems.InSet(idItem ) )
  373. {
  374. SelectItem( i, TRUE );
  375. SetFocusedItem(i);
  376. }
  377. else
  378. SelectItem( i, FALSE );
  379. }
  380. MY_CATCH_AND_REPORT
  381. }
  382. BOOL CFTListView::SynchronizeMembersWithTree( CItemData* pParentData )
  383. {
  384. m_pParentData = pParentData;
  385. return AddMembersFromTree();
  386. }
  387. void CFTListView::GetSelectedItems( CObArray& arrSelectedItems )
  388. {
  389. MY_TRY
  390. arrSelectedItems.RemoveAll();
  391. int iItem = GetListCtrl().GetNextItem( -1, LVNI_SELECTED );
  392. while (iItem >= 0)
  393. {
  394. CItemData* pData = GetItemData(iItem);
  395. ASSERT(pData);
  396. arrSelectedItems.Add(pData);
  397. iItem = GetListCtrl().GetNextItem( iItem, LVNI_SELECTED );
  398. }
  399. MY_CATCH_AND_REPORT
  400. }
  401. void CFTListView::DisplayItemsExtendedNames( BOOL bExtended /* = TRUE */ )
  402. {
  403. MY_TRY
  404. for( int i = 0; i < GetListCtrl().GetItemCount(); i++ )
  405. {
  406. CItemData* pData = (CItemData*)(GetListCtrl().GetItemData(i));
  407. ASSERT( pData );
  408. CString strDisplayName;
  409. if( bExtended )
  410. pData->GetDisplayExtendedName( strDisplayName );
  411. else
  412. pData->GetDisplayName( strDisplayName );
  413. GetListCtrl().SetItemText( i, LVC_Name, strDisplayName );
  414. }
  415. MY_CATCH_AND_REPORT
  416. }
  417. /////////////////////////////////////////////////////////////////////////////
  418. // CFTListView diagnostics
  419. #ifdef _DEBUG
  420. void CFTListView::AssertValid() const
  421. {
  422. CListView::AssertValid();
  423. }
  424. void CFTListView::Dump(CDumpContext& dc) const
  425. {
  426. CListView::Dump(dc);
  427. }
  428. CFTDocument* CFTListView::GetDocument() // non-debug version is inline
  429. {
  430. ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CFTDocument)));
  431. return (CFTDocument*)m_pDocument;
  432. }
  433. #endif //_DEBUG
  434. /////////////////////////////////////////////////////////////////////////////
  435. // CFTListView message handlers
  436. void CFTListView::OnStyleChanged(int nStyleType, LPSTYLESTRUCT lpStyleStruct)
  437. {
  438. //TODO: add code to react to the user changing the view style of your window
  439. }
  440. void CFTListView::OnDestroy()
  441. {
  442. GetListCtrl().DeleteAllItems();
  443. // Delete the image list
  444. CImageList* pImageList = GetListCtrl().GetImageList(LVSIL_NORMAL);
  445. if( pImageList )
  446. {
  447. pImageList->DeleteImageList();
  448. delete pImageList;
  449. }
  450. pImageList = GetListCtrl().GetImageList(LVSIL_SMALL);
  451. if( pImageList )
  452. {
  453. pImageList->DeleteImageList();
  454. delete pImageList;
  455. }
  456. // Destroy the popup menu
  457. m_menuPopup.DestroyMenu();
  458. CListView::OnDestroy();
  459. // TODO: Add your message handler code here
  460. }
  461. void CFTListView::OnDblclk(NMHDR* pNMHDR, LRESULT* pResult)
  462. {
  463. LPNMLISTVIEW pNMLV = (LPNMLISTVIEW) pNMHDR;
  464. *pResult = 0;
  465. ExpandItem( pNMLV->iItem );
  466. }
  467. void CFTListView::OnItemExpand()
  468. {
  469. // TODO: Add your command handler code here
  470. int iItem = GetFocusedItem();
  471. ExpandItem(iItem);
  472. }
  473. void CFTListView::OnRclick(NMHDR* pNMHDR, LRESULT* pResult)
  474. {
  475. // TODO: Add your control notification handler code here
  476. *pResult = 0;
  477. LPNMLISTVIEW lpnmlv = (LPNMLISTVIEW) pNMHDR;
  478. if( lpnmlv->iItem < 0 )
  479. return ;
  480. ClientToScreen( &(lpnmlv->ptAction) );
  481. // We want to display in fact only the first popup of the menu m_menuPopup
  482. CMenu* pPopup = m_menuPopup.GetSubMenu(0);
  483. if( pPopup != NULL )
  484. pPopup->TrackPopupMenu( TPM_LEFTALIGN, lpnmlv->ptAction.x, lpnmlv->ptAction.y, AfxGetMainWnd(), NULL);
  485. }
  486. ///////////////////////////////////////////////////////////////////////////////////////////////////////////
  487. // FT Actions
  488. void CFTListView::OnActionAssign()
  489. {
  490. CObArray arrSelectedItems;
  491. GetSelectedItems( arrSelectedItems );
  492. ActionAssign( arrSelectedItems );
  493. }
  494. void CFTListView::OnUpdateActionAssign(CCmdUI* pCmdUI)
  495. {
  496. CObArray arrSelectedItems;
  497. GetSelectedItems( arrSelectedItems );
  498. UpdateActionAssign( pCmdUI, arrSelectedItems );
  499. }
  500. void CFTListView::OnActionFtbreak()
  501. {
  502. CObArray arrSelectedItems;
  503. GetSelectedItems( arrSelectedItems );
  504. ActionFtbreak( arrSelectedItems );
  505. }
  506. void CFTListView::OnUpdateActionFtbreak(CCmdUI* pCmdUI)
  507. {
  508. CObArray arrSelectedItems;
  509. GetSelectedItems( arrSelectedItems );
  510. UpdateActionFtbreak( pCmdUI, arrSelectedItems );
  511. }
  512. void CFTListView::OnActionCreateExtendedPartition()
  513. {
  514. CObArray arrSelectedItems;
  515. GetSelectedItems( arrSelectedItems );
  516. ActionCreateExtendedPartition( arrSelectedItems );
  517. }
  518. void CFTListView::OnUpdateActionCreateExtendedPartition(CCmdUI* pCmdUI)
  519. {
  520. CObArray arrSelectedItems;
  521. GetSelectedItems( arrSelectedItems );
  522. UpdateActionCreateExtendedPartition( pCmdUI, arrSelectedItems );
  523. }
  524. void CFTListView::OnActionCreatePartition()
  525. {
  526. CObArray arrSelectedItems;
  527. GetSelectedItems( arrSelectedItems );
  528. ActionCreatePartition( arrSelectedItems );
  529. }
  530. void CFTListView::OnUpdateActionCreatePartition(CCmdUI* pCmdUI)
  531. {
  532. CObArray arrSelectedItems;
  533. GetSelectedItems( arrSelectedItems );
  534. UpdateActionCreatePartition( pCmdUI, arrSelectedItems );
  535. }
  536. void CFTListView::OnActionDelete()
  537. {
  538. CObArray arrSelectedItems;
  539. GetSelectedItems( arrSelectedItems );
  540. ActionDelete( arrSelectedItems );
  541. }
  542. void CFTListView::OnUpdateActionDelete(CCmdUI* pCmdUI)
  543. {
  544. CObArray arrSelectedItems;
  545. GetSelectedItems( arrSelectedItems );
  546. UpdateActionDelete( pCmdUI, arrSelectedItems );
  547. }
  548. void CFTListView::OnActionFtinit()
  549. {
  550. CObArray arrSelectedItems;
  551. GetSelectedItems( arrSelectedItems );
  552. ActionFtinit( arrSelectedItems );
  553. }
  554. void CFTListView::OnUpdateActionFtinit(CCmdUI* pCmdUI)
  555. {
  556. CObArray arrSelectedItems;
  557. GetSelectedItems( arrSelectedItems );
  558. UpdateActionFtinit( pCmdUI, arrSelectedItems );
  559. }
  560. void CFTListView::OnActionFtmirror()
  561. {
  562. CObArray arrSelectedItems;
  563. GetSelectedItems( arrSelectedItems );
  564. ActionFtmirror( arrSelectedItems );
  565. }
  566. void CFTListView::OnUpdateActionFtmirror(CCmdUI* pCmdUI)
  567. {
  568. CObArray arrSelectedItems;
  569. GetSelectedItems( arrSelectedItems );
  570. UpdateActionFtmirror( pCmdUI, arrSelectedItems );
  571. }
  572. void CFTListView::OnActionFtstripe()
  573. {
  574. CObArray arrSelectedItems;
  575. GetSelectedItems( arrSelectedItems );
  576. ActionFtstripe( arrSelectedItems );
  577. }
  578. void CFTListView::OnUpdateActionFtstripe(CCmdUI* pCmdUI)
  579. {
  580. CObArray arrSelectedItems;
  581. GetSelectedItems( arrSelectedItems );
  582. UpdateActionFtstripe( pCmdUI, arrSelectedItems );
  583. }
  584. void CFTListView::OnActionFtswap()
  585. {
  586. CObArray arrSelectedItems;
  587. GetSelectedItems( arrSelectedItems );
  588. ActionFtswap( arrSelectedItems );
  589. }
  590. void CFTListView::OnUpdateActionFtswap(CCmdUI* pCmdUI)
  591. {
  592. CObArray arrSelectedItems;
  593. GetSelectedItems( arrSelectedItems );
  594. UpdateActionFtswap( pCmdUI, arrSelectedItems );
  595. }
  596. void CFTListView::OnActionFtswp()
  597. {
  598. CObArray arrSelectedItems;
  599. GetSelectedItems( arrSelectedItems );
  600. ActionFtswp( arrSelectedItems );
  601. }
  602. void CFTListView::OnUpdateActionFtswp(CCmdUI* pCmdUI)
  603. {
  604. CObArray arrSelectedItems;
  605. GetSelectedItems( arrSelectedItems );
  606. UpdateActionFtswp( pCmdUI, arrSelectedItems );
  607. }
  608. void CFTListView::OnActionFtvolset()
  609. {
  610. CObArray arrSelectedItems;
  611. GetSelectedItems( arrSelectedItems );
  612. ActionFtvolset( arrSelectedItems );
  613. }
  614. void CFTListView::OnUpdateActionFtvolset(CCmdUI* pCmdUI)
  615. {
  616. CObArray arrSelectedItems;
  617. GetSelectedItems( arrSelectedItems );
  618. UpdateActionFtvolset( pCmdUI, arrSelectedItems );
  619. }