SynchronizeChecklist.cpp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630
  1. //---------------------------------------------------------------------
  2. #include <vcl.h>
  3. #pragma hdrstop
  4. #include <Common.h>
  5. #include "WinInterface.h"
  6. #include "SynchronizeChecklist.h"
  7. #include <Terminal.h>
  8. #include <TextsWin.h>
  9. #include <ScpMain.h>
  10. #include <VCLCommon.h>
  11. #include <Tools.h>
  12. #include <CustomWinConfiguration.h>
  13. //---------------------------------------------------------------------
  14. #pragma resource "*.dfm"
  15. //---------------------------------------------------------------------
  16. bool __fastcall DoSynchronizeChecklistDialog(TSynchronizeChecklist * Checklist,
  17. TSynchronizeMode Mode, int Params, const AnsiString LocalDirectory,
  18. const AnsiString RemoteDirectory)
  19. {
  20. bool Result;
  21. TSynchronizeChecklistDialog * Dialog = new TSynchronizeChecklistDialog(
  22. Application, Mode, Params, LocalDirectory, RemoteDirectory);
  23. try
  24. {
  25. Result = Dialog->Execute(Checklist);
  26. }
  27. __finally
  28. {
  29. delete Dialog;
  30. }
  31. return Result;
  32. }
  33. //---------------------------------------------------------------------
  34. __fastcall TSynchronizeChecklistDialog::TSynchronizeChecklistDialog(
  35. TComponent * AOwner, TSynchronizeMode Mode, int Params,
  36. const AnsiString LocalDirectory, const AnsiString RemoteDirectory)
  37. : TForm(AOwner)
  38. {
  39. FFormRestored = false;
  40. FMode = Mode;
  41. FParams = Params;
  42. FLocalDirectory = ExcludeTrailingBackslash(LocalDirectory);
  43. FRemoteDirectory = UnixExcludeTrailingBackslash(RemoteDirectory);
  44. UseSystemSettings(this);
  45. FChecklist = NULL;
  46. FChangingItem = NULL;
  47. FChangingItemIgnore = false;
  48. FChangingItemMass = false;
  49. FGeneralHint = StatusBar->Hint;
  50. FOrigListViewWindowProc = ListView->WindowProc;
  51. ListView->WindowProc = ListViewWindowProc;
  52. FSystemImageList = new TImageList(this);
  53. SHFILEINFO FileInfo;
  54. FSystemImageList->Handle = SHGetFileInfo(NULL, 0, &FileInfo, sizeof(FileInfo),
  55. SHGFI_SYSICONINDEX | SHGFI_SMALLICON);
  56. FSystemImageList->ShareImages = true;
  57. ListView->SmallImages = FSystemImageList;
  58. }
  59. //---------------------------------------------------------------------
  60. __fastcall TSynchronizeChecklistDialog::~TSynchronizeChecklistDialog()
  61. {
  62. delete FSystemImageList;
  63. ListView->WindowProc = FOrigListViewWindowProc;
  64. }
  65. //---------------------------------------------------------------------
  66. bool __fastcall TSynchronizeChecklistDialog::Execute(TSynchronizeChecklist * Checklist)
  67. {
  68. FChecklist = Checklist;
  69. bool Result = (ShowModal() != mrCancel);
  70. if (Result)
  71. {
  72. for (int Index = 0; Index < ListView->Items->Count; Index++)
  73. {
  74. TListItem * Item = ListView->Items->Item[Index];
  75. // const violation !
  76. TSynchronizeChecklist::TItem * ChecklistItem =
  77. static_cast<TSynchronizeChecklist::TItem *>(Item->Data);
  78. ChecklistItem->Checked = Item->Checked;
  79. }
  80. TSynchronizeChecklistConfiguration FormConfiguration =
  81. CustomWinConfiguration->SynchronizeChecklist;
  82. FormConfiguration.ListLayout = GetListViewStr(ListView);
  83. AnsiString WindowParams = FormConfiguration.WindowParams;
  84. // if there is no main window, keep previous "custom pos" indication,
  85. bool CustomPos = (StrToIntDef(CutToChar(WindowParams, ';', true), 0) != 0);
  86. if (Application->MainForm != NULL)
  87. {
  88. CustomPos = (Application->MainForm->BoundsRect != BoundsRect);
  89. }
  90. FormConfiguration.WindowParams =
  91. FORMAT("%d;%s", ((CustomPos ? 1 : 0), StoreForm(this)));
  92. CustomWinConfiguration->SynchronizeChecklist = FormConfiguration;
  93. }
  94. return Result;
  95. }
  96. //---------------------------------------------------------------------
  97. void __fastcall TSynchronizeChecklistDialog::UpdateControls()
  98. {
  99. StatusBar->Invalidate();
  100. bool AllChecked = true;
  101. bool AllUnchecked = true;
  102. TListItem * Item = ListView->Selected;
  103. while (Item != NULL)
  104. {
  105. if (Item->Checked)
  106. {
  107. AllUnchecked = false;
  108. }
  109. else
  110. {
  111. AllChecked = false;
  112. }
  113. Item = ListView->GetNextItem(Item, sdAll, TItemStates() << isSelected);
  114. }
  115. EnableControl(OkButton, (FChecked[0] > 0));
  116. EnableControl(CheckButton, !AllChecked);
  117. EnableControl(UncheckButton, !AllUnchecked);
  118. EnableControl(CheckAllButton, (FChecked[0] < FTotals[0]));
  119. EnableControl(UncheckAllButton, (FChecked[0] > 0));
  120. CheckItem->Enabled = CheckButton->Enabled;
  121. UncheckItem->Enabled = UncheckButton->Enabled;
  122. SelectAllItem->Enabled = (ListView->SelCount < ListView->Items->Count);
  123. }
  124. //---------------------------------------------------------------------------
  125. void __fastcall TSynchronizeChecklistDialog::CreateParams(TCreateParams & Params)
  126. {
  127. if (!FFormRestored)
  128. {
  129. FFormRestored = True;
  130. AnsiString WindowParams = CustomWinConfiguration->SynchronizeChecklist.WindowParams;
  131. bool CustomPos = (StrToIntDef(CutToChar(WindowParams, ';', true), 0) != 0);
  132. if (!CustomPos && (Application->MainForm != NULL))
  133. {
  134. BoundsRect = Application->MainForm->BoundsRect;
  135. }
  136. else
  137. {
  138. RestoreForm(WindowParams, this);
  139. }
  140. }
  141. TForm::CreateParams(Params);
  142. }
  143. //---------------------------------------------------------------------------
  144. void __fastcall TSynchronizeChecklistDialog::HelpButtonClick(TObject * /*Sender*/)
  145. {
  146. FormHelp(this);
  147. }
  148. //---------------------------------------------------------------------------
  149. void __fastcall TSynchronizeChecklistDialog::LoadItem(TListItem * Item)
  150. {
  151. AnsiString S;
  152. const TSynchronizeChecklist::TItem * ChecklistItem = FChecklist->Item[Item->Index];
  153. Item->Data = const_cast<TSynchronizeChecklist::TItem *>(ChecklistItem);
  154. Item->Checked = ChecklistItem->Checked;
  155. if (ChecklistItem->ImageIndex >= 0)
  156. {
  157. Item->ImageIndex = ChecklistItem->ImageIndex;
  158. }
  159. else
  160. {
  161. Item->ImageIndex = FakeFileImageIndex(ChecklistItem->FileName,
  162. FLAGMASK(ChecklistItem->IsDirectory, FILE_ATTRIBUTE_DIRECTORY));
  163. }
  164. AnsiString FileName = ChecklistItem->FileName;
  165. if (ChecklistItem->IsDirectory)
  166. {
  167. FileName = IncludeTrailingBackslash(FileName);
  168. }
  169. Item->Caption = FileName;
  170. if (ChecklistItem->Action == TSynchronizeChecklist::saDeleteRemote)
  171. {
  172. Item->SubItems->Add("");
  173. Item->SubItems->Add("");
  174. Item->SubItems->Add("");
  175. }
  176. else
  177. {
  178. S = ChecklistItem->Local.Directory;
  179. if (AnsiSameText(FLocalDirectory, S.SubString(1, FLocalDirectory.Length())))
  180. {
  181. S[1] = '.';
  182. S.Delete(2, FLocalDirectory.Length() - 1);
  183. }
  184. else
  185. {
  186. assert(false);
  187. }
  188. Item->SubItems->Add(S);
  189. if (ChecklistItem->Action == TSynchronizeChecklist::saDownloadNew)
  190. {
  191. Item->SubItems->Add("");
  192. Item->SubItems->Add("");
  193. }
  194. else
  195. {
  196. if (ChecklistItem->IsDirectory)
  197. {
  198. Item->SubItems->Add("");
  199. }
  200. else
  201. {
  202. Item->SubItems->Add(FormatFloat("#,##0", ChecklistItem->Local.Size));
  203. }
  204. Item->SubItems->Add(UserModificationStr(ChecklistItem->Local.Modification,
  205. ChecklistItem->Local.ModificationFmt));
  206. }
  207. }
  208. Item->SubItems->Add("");
  209. if (ChecklistItem->Action == TSynchronizeChecklist::saDeleteLocal)
  210. {
  211. Item->SubItems->Add("");
  212. Item->SubItems->Add("");
  213. Item->SubItems->Add("");
  214. }
  215. else
  216. {
  217. S = ChecklistItem->Remote.Directory;
  218. if (AnsiSameText(FRemoteDirectory, S.SubString(1, FRemoteDirectory.Length())))
  219. {
  220. S[1] = '.';
  221. S.Delete(2, FRemoteDirectory.Length() - 1);
  222. }
  223. else
  224. {
  225. assert(false);
  226. }
  227. Item->SubItems->Add(S);
  228. if (ChecklistItem->Action == TSynchronizeChecklist::saUploadNew)
  229. {
  230. Item->SubItems->Add("");
  231. Item->SubItems->Add("");
  232. }
  233. else
  234. {
  235. if (ChecklistItem->IsDirectory)
  236. {
  237. Item->SubItems->Add("");
  238. }
  239. else
  240. {
  241. Item->SubItems->Add(FormatFloat("#,##0", ChecklistItem->Remote.Size));
  242. }
  243. Item->SubItems->Add(UserModificationStr(ChecklistItem->Remote.Modification,
  244. ChecklistItem->Remote.ModificationFmt));
  245. }
  246. }
  247. }
  248. //---------------------------------------------------------------------------
  249. void __fastcall TSynchronizeChecklistDialog::LoadList()
  250. {
  251. memset(&FTotals, 0, sizeof(FTotals));
  252. memset(&FChecked, 0, sizeof(FChecked));
  253. FTotals[0] = FChecklist->Count;
  254. FChecked[0] = 0;
  255. ListView->Items->BeginUpdate();
  256. try
  257. {
  258. ListView->Items->Clear();
  259. for (int Index = 0; Index < FChecklist->Count; Index++)
  260. {
  261. const TSynchronizeChecklist::TItem * ChecklistItem =
  262. FChecklist->Item[ListView->Items->Count];
  263. FChangingItemIgnore = true;
  264. try
  265. {
  266. LoadItem(ListView->Items->Add());
  267. }
  268. __finally
  269. {
  270. FChangingItemIgnore = false;
  271. }
  272. FTotals[int(ChecklistItem->Action)]++;
  273. if (ChecklistItem->Checked)
  274. {
  275. FChecked[int(ChecklistItem->Action)]++;
  276. FChecked[0]++;
  277. }
  278. }
  279. }
  280. __finally
  281. {
  282. ListView->Items->EndUpdate();
  283. }
  284. UpdateControls();
  285. }
  286. //---------------------------------------------------------------------------
  287. void __fastcall TSynchronizeChecklistDialog::FormShow(TObject * /*Sender*/)
  288. {
  289. LoadListViewStr(ListView, CustomWinConfiguration->SynchronizeChecklist.ListLayout);
  290. LoadList();
  291. }
  292. //---------------------------------------------------------------------------
  293. void __fastcall TSynchronizeChecklistDialog::ListViewWindowProc(TMessage & Message)
  294. {
  295. if (Message.Msg == CN_NOTIFY)
  296. {
  297. TWMNotify & NotifyMessage = reinterpret_cast<TWMNotify &>(Message);
  298. if (NotifyMessage.NMHdr->code == NM_CUSTOMDRAW)
  299. {
  300. // Due to a bug in VCL, OnAdvancedCustomDrawSubItem is not called for any
  301. // other stage except for cdPrePaint. So we must call it ourselves.
  302. TNMLVCustomDraw * CustomDraw =
  303. reinterpret_cast<TNMLVCustomDraw *>(NotifyMessage.NMHdr);
  304. if (FLAGSET(CustomDraw->nmcd.dwDrawStage, CDDS_ITEM) &&
  305. FLAGSET(CustomDraw->nmcd.dwDrawStage, CDDS_SUBITEM) &&
  306. FLAGSET(CustomDraw->nmcd.dwDrawStage, CDDS_ITEMPOSTPAINT))
  307. {
  308. TListItem * Item = ListView->Items->Item[CustomDraw->nmcd.dwItemSpec];
  309. bool DefaultDraw = true; // not used
  310. // do not know how to convert CustomDraw->nmcd.uItemState to TCustomDrawState
  311. ListViewAdvancedCustomDrawSubItem(ListView, Item, CustomDraw->iSubItem,
  312. TCustomDrawState(), cdPostPaint, DefaultDraw);
  313. }
  314. }
  315. }
  316. FOrigListViewWindowProc(Message);
  317. }
  318. //---------------------------------------------------------------------------
  319. void __fastcall TSynchronizeChecklistDialog::ListViewAdvancedCustomDrawSubItem(
  320. TCustomListView * /*Sender*/, TListItem * Item, int SubItem,
  321. TCustomDrawState /*State*/, TCustomDrawStage Stage, bool & /*DefaultDraw*/)
  322. {
  323. if ((SubItem == 4) && (Stage == cdPostPaint))
  324. {
  325. if (ActionImages->Width <= ListView->Columns->Items[SubItem]->Width)
  326. {
  327. const TSynchronizeChecklist::TItem * ChecklistItem =
  328. static_cast<const TSynchronizeChecklist::TItem *>(Item->Data);
  329. TRect R = Item->DisplayRect(drBounds);
  330. for (int Index = 0; Index < SubItem; Index++)
  331. {
  332. R.Left += ListView->Columns->Items[Index]->Width;
  333. }
  334. R.Left +=
  335. (ListView->Columns->Items[SubItem]->Width - ActionImages->Width) / 2;
  336. ImageList_Draw(reinterpret_cast<HIMAGELIST>(ActionImages->Handle),
  337. int(ChecklistItem->Action), ListView->Canvas->Handle,
  338. R.Left, R.Top, ILD_TRANSPARENT);
  339. }
  340. }
  341. }
  342. //---------------------------------------------------------------------------
  343. void __fastcall TSynchronizeChecklistDialog::StatusBarDrawPanel(
  344. TStatusBar * StatusBar, TStatusPanel * Panel, const TRect & Rect)
  345. {
  346. bool Possible;
  347. TSynchronizeChecklist::TAction Action = TSynchronizeChecklist::TAction(Panel->Index);
  348. switch (Action)
  349. {
  350. case TSynchronizeChecklist::saNone:
  351. Possible = true;
  352. break;
  353. case TSynchronizeChecklist::saUploadNew:
  354. Possible = ((FMode == smRemote) || (FMode == smBoth)) &&
  355. FLAGCLEAR(FParams, spTimestamp);
  356. break;
  357. case TSynchronizeChecklist::saDownloadNew:
  358. Possible = ((FMode == smLocal) || (FMode == smBoth)) &&
  359. FLAGCLEAR(FParams, spTimestamp);
  360. break;
  361. case TSynchronizeChecklist::saUploadUpdate:
  362. Possible = ((FMode == smRemote) || (FMode == smBoth));
  363. break;
  364. case TSynchronizeChecklist::saDownloadUpdate:
  365. Possible = ((FMode == smLocal) || (FMode == smBoth));
  366. break;
  367. case TSynchronizeChecklist::saDeleteRemote:
  368. Possible = (FMode == smRemote) &&
  369. FLAGCLEAR(FParams, spTimestamp);
  370. break;
  371. case TSynchronizeChecklist::saDeleteLocal:
  372. Possible = (FMode == smLocal) &&
  373. FLAGCLEAR(FParams, spTimestamp);
  374. break;
  375. default:
  376. assert(false);
  377. Possible = false;
  378. break;
  379. }
  380. int ImageIndex = Panel->Index;
  381. AnsiString PanelText;
  382. if (Possible)
  383. {
  384. PanelText = FORMAT(LoadStrPart(SYNCHRONIZE_SELECTED_ACTIONS, 1),
  385. (FormatFloat("#,##0", FChecked[Panel->Index]),
  386. FormatFloat("#,##0", FTotals[Panel->Index])));
  387. }
  388. else
  389. {
  390. PanelText = LoadStrPart(SYNCHRONIZE_SELECTED_ACTIONS, 2);
  391. }
  392. StatusBar->Canvas->TextRect(Rect, Rect.left + 18, Rect.top + 1, PanelText);
  393. ActionImages->Draw(StatusBar->Canvas,
  394. Rect.Left + 1, Rect.Top, ImageIndex, Possible);
  395. }
  396. //---------------------------------------------------------------------------
  397. int __fastcall TSynchronizeChecklistDialog::PanelAt(int X)
  398. {
  399. int Result = 0;
  400. while ((X > StatusBar->Panels->Items[Result]->Width) &&
  401. (Result < StatusBar->Panels->Count - 1))
  402. {
  403. X -= StatusBar->Panels->Items[Result]->Width;
  404. Result++;
  405. }
  406. return ((Result < StatusBar->Panels->Count - 1) ? Result : -1);
  407. }
  408. //---------------------------------------------------------------------------
  409. void __fastcall TSynchronizeChecklistDialog::StatusBarMouseMove(
  410. TObject * /*Sender*/, TShiftState /*Shift*/, int X, int /*Y*/)
  411. {
  412. AnsiString Hint;
  413. int IPanel = PanelAt(X);
  414. if (IPanel >= 0)
  415. {
  416. Hint = StatusBar->Panels->Items[IPanel]->Text;
  417. if (IPanel > 0)
  418. {
  419. Hint = FORMAT("%s\n%s", (Hint, FGeneralHint));
  420. }
  421. }
  422. if (Hint != StatusBar->Hint)
  423. {
  424. Application->CancelHint();
  425. StatusBar->Hint = Hint;
  426. }
  427. }
  428. //---------------------------------------------------------------------------
  429. void __fastcall TSynchronizeChecklistDialog::ListViewChange(
  430. TObject * /*Sender*/, TListItem * Item, TItemChange Change)
  431. {
  432. if ((Change == ctState) && (FChangingItem == Item) && (FChangingItem != NULL))
  433. {
  434. if (!FChangingItemIgnore)
  435. {
  436. assert(Item->Data != NULL);
  437. if ((FChangingItemChecked != Item->Checked) && (Item->Data != NULL))
  438. {
  439. const TSynchronizeChecklist::TItem * ChecklistItem =
  440. static_cast<const TSynchronizeChecklist::TItem *>(Item->Data);
  441. if (Item->Checked)
  442. {
  443. FChecked[int(ChecklistItem->Action)]++;
  444. FChecked[0]++;
  445. }
  446. else
  447. {
  448. FChecked[int(ChecklistItem->Action)]--;
  449. FChecked[0]--;
  450. }
  451. if (!FChangingItemMass)
  452. {
  453. UpdateControls();
  454. }
  455. }
  456. }
  457. FChangingItem = NULL;
  458. }
  459. }
  460. //---------------------------------------------------------------------------
  461. void __fastcall TSynchronizeChecklistDialog::ListViewChanging(
  462. TObject * /*Sender*/, TListItem * Item, TItemChange Change,
  463. bool & /*AllowChange*/)
  464. {
  465. if (Change == ctState)
  466. {
  467. FChangingItem = Item;
  468. FChangingItemChecked = Item->Checked;
  469. }
  470. else
  471. {
  472. assert(FChangingItem == NULL);
  473. FChangingItem = NULL;
  474. }
  475. }
  476. //---------------------------------------------------------------------------
  477. void __fastcall TSynchronizeChecklistDialog::CheckAll(bool Check)
  478. {
  479. FChangingItemMass = true;
  480. try
  481. {
  482. for (int Index = 0; Index < ListView->Items->Count; Index++)
  483. {
  484. ListView->Items->Item[Index]->Checked = Check;
  485. }
  486. }
  487. __finally
  488. {
  489. FChangingItemMass = false;
  490. }
  491. UpdateControls();
  492. }
  493. //---------------------------------------------------------------------------
  494. void __fastcall TSynchronizeChecklistDialog::CheckAllButtonClick(TObject * Sender)
  495. {
  496. CheckAll(Sender == CheckAllButton);
  497. }
  498. //---------------------------------------------------------------------------
  499. void __fastcall TSynchronizeChecklistDialog::CheckButtonClick(
  500. TObject * Sender)
  501. {
  502. FChangingItemMass = true;
  503. try
  504. {
  505. TListItem * Item = ListView->Selected;
  506. while (Item != NULL)
  507. {
  508. Item->Checked = (Sender == CheckButton) || (Sender == CheckItem);
  509. Item = ListView->GetNextItem(Item, sdAll, TItemStates() << isSelected);
  510. }
  511. }
  512. __finally
  513. {
  514. FChangingItemMass = false;
  515. }
  516. UpdateControls();
  517. }
  518. //---------------------------------------------------------------------------
  519. void __fastcall TSynchronizeChecklistDialog::ListViewSelectItem(
  520. TObject * /*Sender*/, TListItem * /*Item*/, bool /*Selected*/)
  521. {
  522. // Delayed update of button status in case many items are being selected at once
  523. // Also change of selection causes buttons to flash, as for short period of time,
  524. // no item is selected
  525. UpdateTimer->Enabled = true;
  526. }
  527. //---------------------------------------------------------------------------
  528. void __fastcall TSynchronizeChecklistDialog::StatusBarResize(
  529. TObject * Sender)
  530. {
  531. RepaintStatusBar(dynamic_cast<TCustomStatusBar *>(Sender));
  532. }
  533. //---------------------------------------------------------------------------
  534. void __fastcall TSynchronizeChecklistDialog::UpdateTimerTimer(
  535. TObject * /*Sender*/)
  536. {
  537. UpdateTimer->Enabled = false;
  538. UpdateControls();
  539. }
  540. //---------------------------------------------------------------------------
  541. TListItem * __fastcall TSynchronizeChecklistDialog::SelectAll(bool Select, int Action,
  542. bool OnlyTheAction)
  543. {
  544. TListItem * Result = NULL;
  545. for (int Index = 0; Index < ListView->Items->Count; Index++)
  546. {
  547. TListItem * Item = ListView->Items->Item[Index];
  548. if (Action == 0)
  549. {
  550. Item->Selected = Select;
  551. }
  552. else
  553. {
  554. const TSynchronizeChecklist::TItem * ChecklistItem =
  555. static_cast<const TSynchronizeChecklist::TItem *>(Item->Data);
  556. bool WantedAction = (int(ChecklistItem->Action) == Action);
  557. if (WantedAction || !OnlyTheAction)
  558. {
  559. Item->Selected = Select && WantedAction;
  560. if (WantedAction && (Result == NULL))
  561. {
  562. Result = Item;
  563. }
  564. }
  565. }
  566. }
  567. return Result;
  568. }
  569. //---------------------------------------------------------------------------
  570. void __fastcall TSynchronizeChecklistDialog::SelectAllItemClick(
  571. TObject * /*Sender*/)
  572. {
  573. SelectAll(true);
  574. }
  575. //---------------------------------------------------------------------------
  576. void __fastcall TSynchronizeChecklistDialog::StatusBarMouseDown(
  577. TObject * /*Sender*/, TMouseButton /*Button*/, TShiftState Shift, int X,
  578. int /*Y*/)
  579. {
  580. int IPanel = PanelAt(X);
  581. if (IPanel >= 0)
  582. {
  583. TListItem * Item = SelectAll(true, IPanel, Shift.Contains(ssCtrl));
  584. if (Item != NULL)
  585. {
  586. Item->MakeVisible(false);
  587. Item->Focused = true;
  588. }
  589. }
  590. }
  591. //---------------------------------------------------------------------------