summaryrefslogtreecommitdiff
path: root/plugins/Actman30/dlgshare.pas
blob: cd6dbb9023c50d6060d6800ad9b0c5d85eb8bfc0 (plain)
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
unit dlgshare;

interface

uses windows,lowlevelc;

var
  MacroListWindow,
  ActionListWindow:HWND;
var
  EditMacroList:tMacroList;

const
  ACI_APPLY   = 0;
  ACI_NEW     = 1;
  ACI_DELETE  = 2;
  ACI_UP      = 3;
  ACI_DOWN    = 4;
  ACI_TEST    = 5;
  ACI_IMPORT  = 6;
  ACI_EXPORT  = 7;
  ACI_REFRESH = 8;

procedure RegisterIcons;
function OptSetButtonIcon(btn:HWND;num:integer):HICON;
procedure OptFillContactList(wnd:HWND);

implementation

uses messages, m_api, dbsettings, contact, common, global;

{$include i_cnst_dlgshare.inc}
{$resource dlgshare.res}

const
  IconAmount = 9;
const
  Icons:array [0..IconAmount-1] of tIconItem = (
    (szDescr: 'Apply'         ; szName: 'Apply' ; defIconID: IDI_APPLY ; size: 0; hIcolib: 0;),
    (szDescr: 'New'           ; szName: 'New'   ; defIconID: IDI_NEW   ; size: 0; hIcolib: 0;),
    (szDescr: 'Delete'        ; szName: 'Delete'; defIconID: IDI_DELETE; size: 0; hIcolib: 0;),
    (szDescr: 'Up'            ; szName: 'Up'    ; defIconID: IDI_UP    ; size: 0; hIcolib: 0;),
    (szDescr: 'Down'          ; szName: 'Down'  ; defIconID: IDI_DOWN  ; size: 0; hIcolib: 0;),
    (szDescr: 'Test'          ; szName: 'Test'  ; defIconID: IDI_TEST  ; size: 0; hIcolib: 0;),
    (szDescr: 'Import'        ; szName: 'Import'; defIconID: IDI_IMPORT; size: 0; hIcolib: 0;),
    (szDescr: 'Export'        ; szName: 'Export'; defIconID: IDI_EXPORT; size: 0; hIcolib: 0;),
    (szDescr: 'Reload/Refresh'; szName: 'Reload'; defIconID: IDI_RELOAD; size: 0; hIcolib: 0;)
  );


procedure RegisterIcons;
begin
  Icon_Register(hInstance,'Actions',@Icons,IconAmount,'ACI');
end;

function OptSetButtonIcon(btn:HWND;num:integer):HICON;
begin
  result:=CallService(MS_SKIN2_GETICONBYHANDLE,0,LPARAM(Icons[num].hIcolib));
  SendMessage(btn,BM_SETIMAGE,IMAGE_ICON,result);
end;

procedure OptFillContactList(wnd:HWND);
var
  fCLformat:pWideChar;
  fCLfilter:byte;
begin
  fCLfilter:=DBReadByte   (0,DBBranch,'CLfilter',BST_UNCHECKED);
  fCLformat:=DBReadUnicode(0,DBBranch,'CLformat');
  FillContactList(wnd, fCLfilter<>BST_UNCHECKED, fCLformat);
  mFreeMem(fCLformat);
end;

end.