curtis
14小時前 3af5c004b4f2d2005d22ee85dccc2c80a66b1556
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
{ ==============================================================================
  方法名稱:PageLVClick
  引用相依:
  方法描述:處理影像列表點擊。選取項目後同步更新 ScrollBar1 的位置。
============================================================================== }
procedure TCB_IMGPSScanX.PageLVClick(Sender: TObject);
begin
  IF PageLV.Selected = nil Then Exit;
  PageLVclear := False;
  ScrollBar1.Position := PageLV.Selected.Index+1;
  PageLVclear := True;
end;
 
 
{ ==============================================================================
  方法名稱:PageLVKeyUp
  引用相依:
  方法描述:處理影像列表按鍵放開事件。若有選取項目,則同步更新 ScrollBar1 的位置。
============================================================================== }
procedure TCB_IMGPSScanX.PageLVKeyUp(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  IF PageLV.Selected = nil Then Exit;
  ScrollBar1.Position := PageLV.Selected.Index+1;
end;
 
 
{ ==============================================================================
  方法名稱:PageLVMouseDown
  引用相依:
  方法描述:處理影像列表滑鼠按下事件。若是右鍵,則選取該項目並彈出右鍵選單。
============================================================================== }
procedure TCB_IMGPSScanX.PageLVMouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  IF Button = TMouseButton(MbRight) Then
  begin
    If PageLV.GetItemAt(X,Y) = nil then Exit;
    PageLV.Selected := PageLV.GetItemAt(X,Y);
    PageLVClick(self);
    PageLV.PopupMenu.Popup(Mouse.CursorPos.X ,Mouse.CursorPos.Y);
  end;
end;
 
 
{ ==============================================================================
  方法名稱:AttListBoxClick
  引用相依:
  方法描述:處理附加檔案列表點擊,若有選取則啟用刪除按鈕。
============================================================================== }
procedure TCB_IMGPSScanX.AttListBoxClick(Sender: TObject);
begin
  DelAttFileLB.Enabled := False;
  if AttListBox.ItemIndex >= 0 then
    DelAttFileLB.Enabled := True;
end;
 
 
{ ==============================================================================
  方法名稱:AttListBoxDblClick
  引用相依:FileExists
  方法描述:處理附加檔案列表連按兩下,呼叫 ShellExecute 開啟檔案。
============================================================================== }
procedure TCB_IMGPSScanX.AttListBoxDblClick(Sender: TObject);
var
  AttFile : String;
begin
  if AttListBox.ItemIndex < 0 then Exit;
 
  AttFile := HTTPEncode(UTF8Encode(AttListBox.Items.Strings[AttListBox.ItemIndex]));
  if FileExists(DisplayPath+AttFile) then
    ShellExecute(Application.Handle,'open',PChar(DisplayPath+AttFile),nil,nil,SW_SHOW)
  else
    Showmessage(Format(_Msg('找不到檔案:%s'),[AttFile]));
end;