diff options
Diffstat (limited to 'plugins/Actman30')
31 files changed, 412 insertions, 286 deletions
diff --git a/plugins/Actman30/actman30.dpr b/plugins/Actman30/actman30.dpr index 2f7a24e573..55f510418a 100644 --- a/plugins/Actman30/actman30.dpr +++ b/plugins/Actman30/actman30.dpr @@ -75,7 +75,7 @@ var {$include m_actman.inc}
-function MirandaPluginInfoEx(mirandaVersion:DWORD):PPLUGININFOEX; cdecl;
+function MirandaPluginInfoEx(mirandaVersion:dword):PPLUGININFOEX; cdecl;
begin
result:=@PluginInfo;
PluginInfo.cbSize :=SizeOf(TPLUGININFOEX);
diff --git a/plugins/Actman30/hooks/i_hook.inc b/plugins/Actman30/hooks/i_hook.inc index 8b7b487d98..7bdf64fd47 100644 --- a/plugins/Actman30/hooks/i_hook.inc +++ b/plugins/Actman30/hooks/i_hook.inc @@ -108,7 +108,7 @@ begin end;
end;
-function HookWndProc(Dialog:HWnd;hMessage:UINT;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+function HookWndProc(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
var
p:pHookRec;
ap:tAct_Param;
diff --git a/plugins/Actman30/hooks/i_opt_dlg.inc b/plugins/Actman30/hooks/i_opt_dlg.inc index 8fac1007a1..23adcf0848 100644 --- a/plugins/Actman30/hooks/i_opt_dlg.inc +++ b/plugins/Actman30/hooks/i_opt_dlg.inc @@ -207,7 +207,7 @@ begin CheckButtons(Dialog);
end;
-function NewHKTableProc(Dialog:HWnd;hMessage:UINT;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+function NewHKTableProc(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
var
i:integer;
begin
@@ -301,7 +301,7 @@ begin OldTableProc:=pointer(SetWindowLongPtrW(wnd,GWL_WNDPROC,LONG_PTR(@NewHKTableProc)));
end;
-function DlgProcOpt(Dialog:HWnd;hMessage:UINT;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+function DlgProcOpt(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
var
i:integer;
tmp:pAnsiChar;
diff --git a/plugins/Actman30/i_opt_dlg2.inc b/plugins/Actman30/i_opt_dlg2.inc index 3a816a481a..24fdb59ab5 100644 --- a/plugins/Actman30/i_opt_dlg2.inc +++ b/plugins/Actman30/i_opt_dlg2.inc @@ -201,7 +201,7 @@ begin end;
// Fill action type combobox
-function FillActTypeList(list:hwnd):HWND;
+function FillActTypeList(list:HWND):HWND;
var
cbei:TCOMBOBOXEXITEMW;
il:HIMAGELIST;
@@ -305,7 +305,7 @@ end; procedure FillAction(Dialog:HWND;act:tBaseAction);
var
p:pActModule;
- i:lresult;
+ i:LRESULT;
wnd:HWND;
begin
if act<>nil then
@@ -529,7 +529,7 @@ begin end;
// action (chain) table procedure (key hook)
-function NewActTableProc(Dialog:HWnd;hMessage:uint;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+function NewActTableProc(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
var
i:integer;
begin
@@ -577,7 +577,7 @@ end; //----- Macro list stuff -----
// action group table procedure (key hook)
-function NewGroupTableProc(Dialog:HWnd;hMessage:uint;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+function NewGroupTableProc(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
var
i:integer;
begin
@@ -722,7 +722,7 @@ begin end;
// Fill action group list and disable chain controls
-function FillMacroList(Dialog:hwnd):integer;
+function FillMacroList(Dialog:HWND):integer;
var
CurMacro:pMacroRecord;
i:integer;
@@ -854,7 +854,7 @@ begin SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
end;
-function DlgProcOpt2(Dialog:HWnd;hMessage:uint;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+function DlgProcOpt2(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
var
wnd:HWND;
p:pActModule;
diff --git a/plugins/Actman30/iac_.pas b/plugins/Actman30/iac_.pas index f99e4f7366..5a47ba96a1 100644 --- a/plugins/Actman30/iac_.pas +++ b/plugins/Actman30/iac_.pas @@ -85,7 +85,7 @@ procedure ClearFields(Dialog:HWND); begin
end;
-function DlgProc(Dialog:HWnd;hMessage:UINT;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+function DlgProc(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
begin
result:=0;
diff --git a/plugins/Actman30/iac_call.pas b/plugins/Actman30/iac_call.pas index 33208fb16a..074646f149 100644 --- a/plugins/Actman30/iac_call.pas +++ b/plugins/Actman30/iac_call.pas @@ -422,7 +422,7 @@ begin end;
end;
-procedure SearchDllByFName(flist,dlist:HWND;idx:Integer=-1);
+procedure SearchDllByFName(flist,dlist:HWND;idx:integer=-1);
var
pc,p,pp,pz:pAnsiChar;
lptr:pointer;
@@ -612,7 +612,7 @@ begin ShowHideBlock(Dialog,true);
end;
-function DlgProc(Dialog:HWnd;hMessage:UINT;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+function DlgProc(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
var
wnd,wnd1:HWND;
buf:array [0..63] of AnsiChar;
@@ -831,6 +831,7 @@ begin CheckDlgButton(Dialog,IDC_CLOSE_ARG,BST_UNCHECKED);
ShowHideBlock(Dialog,false);
+ exit;
end;
IDC_CLOSE_ARG: begin
@@ -840,6 +841,7 @@ begin CheckDlgButton(Dialog,IDC_CLOSE_RES,BST_UNCHECKED);
ShowHideBlock(Dialog,true);
+ exit;
end;
end;
SendMessage(GetParent(GetParent(Dialog)),PSM_CHANGED,0,0);
diff --git a/plugins/Actman30/iac_chain.pas b/plugins/Actman30/iac_chain.pas index a4736ab1ca..39e03e13b8 100644 --- a/plugins/Actman30/iac_chain.pas +++ b/plugins/Actman30/iac_chain.pas @@ -210,7 +210,7 @@ end; //----- Dialog realization -----
-procedure FillChainList(Dialog:hwnd);
+procedure FillChainList(Dialog:HWND);
var
wnd,list:HWND;
i:integer;
@@ -245,7 +245,7 @@ begin CheckDlgButton(Dialog,IDC_MACRO_KEEPOLD ,BST_UNCHECKED);
end;
-function DlgProc(Dialog:HWnd;hMessage:UINT;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+function DlgProc(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
var
tmp:dword;
wnd:HWND;
diff --git a/plugins/Actman30/iac_contact.pas b/plugins/Actman30/iac_contact.pas index cb5350bd26..318dc8601e 100644 --- a/plugins/Actman30/iac_contact.pas +++ b/plugins/Actman30/iac_contact.pas @@ -24,7 +24,7 @@ const type
tContactAction = class(tBaseAction)
private
- contact:MCONTACT;
+ contact:TMCONTACT;
public
constructor Create(uid:dword);
// function Clone:tBaseAction; override;
@@ -131,7 +131,7 @@ begin CheckDlgButton(Dialog,IDC_CNT_GET ,BST_UNCHECKED);
end;
-function DlgProc(Dialog:HWnd;hMessage:UINT;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+function DlgProc(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
var
wnd:HWND;
bb:boolean;
diff --git a/plugins/Actman30/iac_dbrw.pas b/plugins/Actman30/iac_dbrw.pas index eaf4daf02d..c4224f91b2 100644 --- a/plugins/Actman30/iac_dbrw.pas +++ b/plugins/Actman30/iac_dbrw.pas @@ -68,7 +68,7 @@ const type
tDataBaseAction = class(tBaseAction)
private
- dbcontact:MCONTACT;
+ dbcontact:TMCONTACT;
dbmodule :PWideChar;
dbsetting:PWideChar;
dbvalue :PWideChar; // keep all in unicode (str to int translation fast)
@@ -129,7 +129,7 @@ var ambuf,asbuf:array [0..127] of AnsiChar;
ls,tmp:pWideChar;
tmpa,tmpa1:pAnsiChar;
- hContact:MCONTACT;
+ hContact:TMCONTACT;
proto:pAnsiChar;
avalue:uint_ptr;
begin
@@ -451,7 +451,7 @@ begin CheckDlgButton(Dialog,IDC_RW_DELETE,BST_UNCHECKED);
end;
-function DlgProc(Dialog:HWnd;hMessage:UINT;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+function DlgProc(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
const
NoProcess:boolean=true;
var
diff --git a/plugins/Actman30/iac_global.pas b/plugins/Actman30/iac_global.pas index c6e96cd130..5e7ff9bec1 100644 --- a/plugins/Actman30/iac_global.pas +++ b/plugins/Actman30/iac_global.pas @@ -7,7 +7,7 @@ uses m_api;
var
- xmlparser:XML_API_W;
+ xmlparser:TXML_API_W;
const
IcoLibPrefix = 'action_type_';
@@ -89,8 +89,8 @@ procedure InsertString(wnd:HWND;num:dword;str:PAnsiChar); function GetLink(hash:dword):pActModule;
function GetLinkByName(name:pAnsiChar):pActModule;
-function ImportContact (node:HXML ):MCONTACT;
-function ImportContactINI(node:pointer):MCONTACT;
+function ImportContact (node:HXML ):TMCONTACT;
+function ImportContactINI(node:pointer):TMCONTACT;
implementation
@@ -301,7 +301,7 @@ const ioCUID = 'cuid';
ioCUIDType = 'cuidtype';
-function ImportContact(node:HXML):MCONTACT;
+function ImportContact(node:HXML):TMCONTACT;
var
proto:pAnsiChar;
tmpbuf:array [0..63] of AnsiChar;
@@ -352,7 +352,7 @@ begin end;
end;
-function ImportContactINI(node:pointer):MCONTACT;
+function ImportContactINI(node:pointer):TMCONTACT;
{
var
proto:pAnsiChar;
diff --git a/plugins/Actman30/iac_ini.pas b/plugins/Actman30/iac_ini.pas index 12a1074563..7061d65936 100644 --- a/plugins/Actman30/iac_ini.pas +++ b/plugins/Actman30/iac_ini.pas @@ -248,7 +248,7 @@ begin EnableEditField(Dialog,IDC_INI_VALUE,true);
end;
-function DlgProc(Dialog:HWnd;hMessage:UINT;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+function DlgProc(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
const
NoProcess:boolean=true;
begin
diff --git a/plugins/Actman30/iac_inout.pas b/plugins/Actman30/iac_inout.pas index 0ae2f0d7fc..c8b63aa1dc 100644 --- a/plugins/Actman30/iac_inout.pas +++ b/plugins/Actman30/iac_inout.pas @@ -85,7 +85,7 @@ var tmp:PWideChar;
blob,p:PAnsiChar;
w:PWideChar;
- hContact:MCONTACT;
+ hContact:TMCONTACT;
wnd:HWND;
fexist:bool;
dbei:TDBEVENTINFO;
@@ -479,7 +479,7 @@ begin CheckDlgButton(Dialog,IDC_TEXT_SEND,BST_UNCHECKED);
end;
-function DlgProc(Dialog:HWnd;hMessage:UINT;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+function DlgProc(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
const
NoProcess:boolean=true;
var
diff --git a/plugins/Actman30/iac_jump.pas b/plugins/Actman30/iac_jump.pas index 7d3d405f2a..c06c1037dd 100644 --- a/plugins/Actman30/iac_jump.pas +++ b/plugins/Actman30/iac_jump.pas @@ -480,7 +480,7 @@ begin CheckDlgButton(Dialog,IDC_FLAG_JUMP ,BST_UNCHECKED);
end;
-function DlgProc(Dialog:HWnd;hMessage:UINT;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+function DlgProc(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
const
NoProcess:boolean=true;
var
diff --git a/plugins/Actman30/iac_messagebox.pas b/plugins/Actman30/iac_messagebox.pas index f782e54e94..7d99c5ffb3 100644 --- a/plugins/Actman30/iac_messagebox.pas +++ b/plugins/Actman30/iac_messagebox.pas @@ -231,7 +231,7 @@ begin CheckDlgButton(Dialog,IDC_MSGI_INFO ,BST_UNCHECKED);
end;
-function DlgProc(Dialog:HWnd;hMessage:UINT;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+function DlgProc(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
const
NoProcess:boolean=true;
begin
diff --git a/plugins/Actman30/iac_program.pas b/plugins/Actman30/iac_program.pas index 83cc60a5f9..bf44fdffa6 100644 --- a/plugins/Actman30/iac_program.pas +++ b/plugins/Actman30/iac_program.pas @@ -336,7 +336,7 @@ begin mFreeMem(pw);
end;
-function DlgProc(Dialog:HWnd;hMessage:UINT;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+function DlgProc(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
const
NoProcess:boolean=true;
begin
diff --git a/plugins/Actman30/iac_service.pas b/plugins/Actman30/iac_service.pas index b31ab403b1..88ca4f7f07 100644 --- a/plugins/Actman30/iac_service.pas +++ b/plugins/Actman30/iac_service.pas @@ -467,7 +467,7 @@ end; //----- Dialog realization -----
-function DlgProc(Dialog:HWnd;hMessage:UINT;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+function DlgProc(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
var
ServiceBlock:HWND;
rc:TRECT;
@@ -533,10 +533,15 @@ begin end;
}
end;
-{
+
WM_COMMAND: begin
+ case wParam shr 16 of
+ CBN_EDITCHANGE,
+ BN_CLICKED:
+ SendMessage(GetParent(GetParent(Dialog)),PSM_CHANGED,0,0);
+ end;
end;
-}
+
WM_HELP: begin
ServiceBlock:=GetWindowLongPtrW(Dialog,GWLP_USERDATA);
SendMessage(ServiceBlock,WM_HELP,0,0);
diff --git a/plugins/Actman30/iac_settings.pas b/plugins/Actman30/iac_settings.pas index bb2c8efe5a..0cd7d82507 100644 --- a/plugins/Actman30/iac_settings.pas +++ b/plugins/Actman30/iac_settings.pas @@ -36,7 +36,7 @@ begin CheckDlgButton(Dialog,IDC_FR_FLAG,BST_UNCHECKED);
end;
-function DlgProc(Dialog:HWnd;hMessage:UINT;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+function DlgProc(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
var
fCLformat:pWideChar;
lp:TLPARAM;
diff --git a/plugins/Actman30/iac_storage.pas b/plugins/Actman30/iac_storage.pas index aaa7351452..53be7dd153 100644 --- a/plugins/Actman30/iac_storage.pas +++ b/plugins/Actman30/iac_storage.pas @@ -208,7 +208,7 @@ begin CheckDlgButton(Dialog,IDC_FLAG_FROM,BST_UNCHECKED);
end;
-function DlgProc(Dialog:HWnd;hMessage:UINT;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+function DlgProc(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
begin
result:=0;
diff --git a/plugins/Actman30/iac_text.pas b/plugins/Actman30/iac_text.pas index e6a05d8fc0..ddebb3f3c8 100644 --- a/plugins/Actman30/iac_text.pas +++ b/plugins/Actman30/iac_text.pas @@ -387,7 +387,7 @@ begin CheckDlgButton (Dialog,IDC_TXT_POST,BST_UNCHECKED);
end;
-function DlgProc(Dialog:HWnd;hMessage:UINT;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+function DlgProc(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
const
NoProcess:boolean=true;
begin
diff --git a/plugins/Actman30/inoutxml.pas b/plugins/Actman30/inoutxml.pas index 3a7aea25d4..cd11c1a963 100644 --- a/plugins/Actman30/inoutxml.pas +++ b/plugins/Actman30/inoutxml.pas @@ -77,7 +77,7 @@ begin CloseHandle(f);
//MessageBoxW(0,res,'SRC',0);
- xmlparser.cbSize:=SizeOf(XML_API_W);
+ xmlparser.cbSize:=SizeOf(TXML_API_W);
CallService(MS_SYSTEM_GET_XI,0,lparam(@xmlparser));
with xmlparser do
begin
diff --git a/plugins/Actman30/question.pas b/plugins/Actman30/question.pas index 9e5f0d1b59..d936b65794 100644 --- a/plugins/Actman30/question.pas +++ b/plugins/Actman30/question.pas @@ -19,7 +19,7 @@ const imp_noall = 4;
imp_append = 5;
-function QuestionDlg(Dialog:HWnd;hMessage:UINT;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
+function QuestionDlg(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
var
i:integer;
begin
diff --git a/plugins/Actman30/tasks/i_opt_dlg.inc b/plugins/Actman30/tasks/i_opt_dlg.inc index e6797e3a9a..bf8d45f63c 100644 --- a/plugins/Actman30/tasks/i_opt_dlg.inc +++ b/plugins/Actman30/tasks/i_opt_dlg.inc @@ -300,7 +300,7 @@ begin CheckTaskList(Dialog,false);
end;
-function NewHKTableProc(Dialog:HWnd;hMessage:UINT;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+function NewHKTableProc(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
var
i:integer;
begin
@@ -404,7 +404,7 @@ begin SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,LPARAM(@ti));
end;
-function DlgProcOpt(Dialog:HWnd;hMessage:UINT;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+function DlgProcOpt(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
var
wnd:HWND;
lv:LV_COLUMNW;
diff --git a/plugins/Actman30/tasks/i_options.inc b/plugins/Actman30/tasks/i_options.inc index 527e8d0c88..da5cce0c40 100644 --- a/plugins/Actman30/tasks/i_options.inc +++ b/plugins/Actman30/tasks/i_options.inc @@ -83,6 +83,7 @@ begin StrCopy(p,opt_name ); name :=DBReadUnicode(0,DBBranch,section);
StrCopy(p,opt_action); action :=DBReadDWord (0,DBBranch,section);
StrCopy(p,opt_days ); dayoffset:=DBReadByte (0,DBBranch,section);
+ //!! smallint?
StrCopy(p,opt_repeat); count :=Shortint(DBReadWord(0,DBBranch,section));
StrCopy(p,opt_time_lo ); starttime.dwLowDateTime :=DBReadDWord(0,DBBranch,section);
diff --git a/plugins/Actman30/ua/i_inoutjson.inc b/plugins/Actman30/ua/i_inoutjson.inc index 61879200a1..b560e99fb1 100644 --- a/plugins/Actman30/ua/i_inoutjson.inc +++ b/plugins/Actman30/ua/i_inoutjson.inc @@ -25,6 +25,7 @@ const ioMenuShow :PWideChar = 'Show';
ioMenuUsed :PWideChar = 'Used';
ioMenuSeparated :PWideChar = 'Separated';
+ ioNoTRanslate :PWideChar = 'NoTranslate';
function ImportMenuItems(node:JSONNODE;var MenuItem:tUAMenuItem):integer;
@@ -48,6 +49,9 @@ begin // separated
if StrToInt(getAttrValue(node,ioMenuSeparated))<>0 then
menu_opt:=menu_opt or UAF_MENUSEP;
+ // no translate
+ if StrToInt(getAttrValue(node,ioMenuNotranslate))<>0 then
+ menu_opt:=menu_opt or UAF_NOTRANAS;
end;
end;
end;
@@ -210,6 +214,8 @@ begin AddAttrInt(result,ioMenuUsed,ord((menu_opt AND UAF_MENUUSE)<>0));
// separated
AddAttrInt(result,ioMenuSeparated,ord((menu_opt AND UAF_MENUSEP)<>0));
+ // no translate
+ AddAttrInt(result,ioNoTranslate,ord((menu_opt AND UAF_NOTRANS)<>0));
end;
end;
end;
diff --git a/plugins/Actman30/ua/i_inoutxm.inc b/plugins/Actman30/ua/i_inoutxm.inc index a052a5a0e0..bf53ff954a 100644 --- a/plugins/Actman30/ua/i_inoutxm.inc +++ b/plugins/Actman30/ua/i_inoutxm.inc @@ -1,6 +1,6 @@ {}
var
- xmlparser:XML_API_W;
+ xmlparser:TXML_API_W;
const
ioAction :PWideChar = 'Action';
@@ -25,6 +25,7 @@ const ioMenuShow :PWideChar = 'Show';
ioMenuUsed :PWideChar = 'Used';
ioMenuSeparated :PWideChar = 'Separated';
+ ioNoTranslate :PWideChar = 'NoTranslate';
function ImportMenuItems(node:HXML;var MenuItem:tUAMenuItem):integer;
@@ -48,6 +49,9 @@ begin // separated
if StrToInt(getAttrValue(node,ioMenuSeparated))<>0 then
menu_opt:=menu_opt or UAF_MENUSEP;
+ // no translate
+ if StrToInt(getAttrValue(node,ioNoTranslate))<>0 then
+ menu_opt:=menu_opt or UAF_NOTRANS;
end;
end;
end;
@@ -135,7 +139,7 @@ begin BlockRead(f,res^,i);
CloseHandle(f);
- xmlparser.cbSize:={XML_API_SIZEOF_V1;//}SizeOf(XML_API_W);
+ xmlparser.cbSize:={XML_API_SIZEOF_V1;//}SizeOf(TXML_API_W);
CallService(MS_SYSTEM_GET_XI,0,lparam(@xmlparser));
with xmlparser do
begin
@@ -211,6 +215,8 @@ begin AddAttrInt(result,ioMenuUsed,ord((menu_opt AND UAF_MENUUSE)<>0));
// separated
AddAttrInt(result,ioMenuSeparated,ord((menu_opt AND UAF_MENUSEP)<>0));
+ // no translate
+ AddAttrInt(result,ioNoTranslate,ord((menu_opt AND UAF_NOTRANS)<>0));
end;
end;
end;
@@ -300,7 +306,7 @@ var ptr,ptr1:pChain;
begin
result:=0;
- xmlparser.cbSize:={XML_API_SIZEOF_V1;//}SizeOf(XML_API_W);
+ xmlparser.cbSize:={XML_API_SIZEOF_V1;//}SizeOf(TXML_API_W);
CallService(MS_SYSTEM_GET_XI,0,lparam(@xmlparser));
with xmlparser do
begin
diff --git a/plugins/Actman30/ua/i_opt_dlg.inc b/plugins/Actman30/ua/i_opt_dlg.inc index 643aa253b7..5a85bf2a52 100644 --- a/plugins/Actman30/ua/i_opt_dlg.inc +++ b/plugins/Actman30/ua/i_opt_dlg.inc @@ -1,122 +1,133 @@ {}
const
settings:HWND = 0;
-const
- NumControls = 17;
-
- IDsArray:array [0..NumControls-1] of integer =(
- // Menu settings controls
- IDC_UA_SEPARATE ,IDC_UA_POPUPT ,IDC_UA_POPUPV,
- IDC_UA_VARNAMEST,IDC_UA_VARNAMESV,IDC_UA_VARNAMESH,
- IDC_UA_SHOWVART ,IDC_UA_SHOWVARV ,IDC_UA_SHOWVARH,
- IDC_UA_TWOSTATE ,IDC_UA_SAVSTATE ,IDC_UA_COMMON,
- // toolbar settings controls
- IDC_UA_TTNORMALT,IDC_UA_TTNORMALV,IDC_UA_TTPRESSEDT,IDC_UA_TTPRESSEDV,
- IDC_UA_GLOBAL
- );
-
- // Show-hide controls by place type
- SHArray:array [0..NumTypes-1, 0..NumControls-1] of integer = (
- // CList Modern toolbar
- (SW_HIDE,SW_HIDE,SW_HIDE, SW_HIDE,SW_HIDE,SW_HIDE, SW_SHOW,SW_SHOW,SW_SHOW,
- SW_SHOW,SW_SHOW,SW_SHOW, SW_SHOW,SW_SHOW,SW_SHOW,SW_SHOW, SW_HIDE),
- // TabSRMM toolbar
- (SW_HIDE,SW_HIDE,SW_HIDE, SW_HIDE,SW_HIDE,SW_HIDE, SW_HIDE,SW_HIDE,SW_HIDE,
- SW_SHOW,SW_SHOW,SW_SHOW, SW_SHOW,SW_SHOW,SW_SHOW,SW_SHOW, SW_SHOW),
- // Core Hotkey
- (SW_HIDE,SW_HIDE,SW_HIDE, SW_HIDE,SW_HIDE,SW_HIDE, SW_HIDE,SW_HIDE,SW_HIDE,
- SW_HIDE,SW_HIDE,SW_HIDE, SW_HIDE,SW_HIDE,SW_HIDE,SW_HIDE, SW_HIDE),
- // Main menu
- (SW_SHOW,SW_SHOW,SW_SHOW, SW_SHOW,SW_SHOW,SW_SHOW, SW_SHOW,SW_SHOW,SW_SHOW,
- SW_SHOW,SW_SHOW,SW_SHOW, SW_HIDE,SW_HIDE,SW_HIDE,SW_HIDE, SW_HIDE),
- // Contact menu
- (SW_SHOW,SW_SHOW,SW_SHOW, SW_SHOW,SW_SHOW,SW_SHOW, SW_SHOW,SW_SHOW,SW_SHOW,
- SW_SHOW,SW_SHOW,SW_SHOW, SW_HIDE,SW_HIDE,SW_HIDE,SW_HIDE, SW_SHOW),
- // Tray menu
- (SW_SHOW,SW_SHOW,SW_SHOW, SW_SHOW,SW_SHOW,SW_SHOW, SW_SHOW,SW_SHOW,SW_SHOW,
- SW_SHOW,SW_SHOW,SW_SHOW, SW_HIDE,SW_HIDE,SW_HIDE,SW_HIDE, SW_HIDE),
- // Protocol menu
- (SW_SHOW,SW_SHOW,SW_SHOW, SW_SHOW,SW_SHOW,SW_SHOW, SW_SHOW,SW_SHOW,SW_SHOW,
- SW_SHOW,SW_SHOW,SW_SHOW, SW_HIDE,SW_HIDE,SW_HIDE,SW_HIDE, SW_HIDE),
- // Status menu
- (SW_SHOW,SW_SHOW,SW_SHOW, SW_SHOW,SW_SHOW,SW_SHOW, SW_SHOW,SW_SHOW,SW_SHOW,
- SW_SHOW,SW_SHOW,SW_SHOW, SW_HIDE,SW_HIDE,SW_HIDE,SW_HIDE, SW_HIDE)
- );
- // additional show/hide controls check by Variables installings (1 - need to check)
- SHVarArray:array [0..NumControls-1] of byte = (
- 0,0,0, 0,0,1, 1,1,1,
- 0,0,0,0,0,0,0, 0);
- // additional enable/disable controls check (1 - always enable)
- EnDisArray:array [0..NumControls-1] of byte = (
- 0,0,0, 0,0,0, 0,0,0,
- 1,1,1,0,0,0,0, 1);
var
hIC:THANDLE;
-procedure CheckPlacesAbility;
-var
- i:integer;
+//----- Static (no option-depended) control view -----
+
+procedure HideAllControls(Dialog:HWND);
begin
- for i:=0 to NumTypes-1 do
- begin
- with NamesArray[i] do
- begin
- enable:=(service=nil) or (ServiceExists(service)<>0);
- end;
- end;
+ ShowWindow(GetDlgItem(Dialog,IDC_UA_GLOBAL ),SW_HIDE);
+
+ ShowWindow(GetDlgItem(Dialog,IDC_UA_BLOCK ),SW_HIDE);
+ ShowWindow(GetDlgItem(Dialog,IDC_UA_MENU ),SW_HIDE);
+ ShowWindow(GetDlgItem(Dialog,IDC_UA_NOTRANSLATE),SW_HIDE);
+ ShowWindow(GetDlgItem(Dialog,IDC_UA_SEPARATE ),SW_HIDE);
+ ShowWindow(GetDlgItem(Dialog,IDC_UA_POPUPT ),SW_HIDE);
+ ShowWindow(GetDlgItem(Dialog,IDC_UA_VARNAMEST ),SW_HIDE);
+// ShowWindow(GetDlgItem(Dialog,IDC_UA_NOTRANSLATE),SW_HIDE);
+
+ ShowWindow(GetDlgItem(Dialog,IDC_UA_TTNORMALT ),SW_HIDE);
+ ShowWindow(GetDlgItem(Dialog,IDC_UA_TTPRESSEDT ),SW_HIDE);
+
+ ShowWindow(GetDlgItem(Dialog,IDC_UA_SHOWVART ),SW_HIDE);
+
+
+ ShowEditField(Dialog,IDC_UA_SHOWVARV ,SW_HIDE);
+ ShowEditField(Dialog,IDC_UA_VARNAMESV ,SW_HIDE);
+ ShowEditField(Dialog,IDC_UA_POPUPV ,SW_HIDE);
+ ShowEditField(Dialog,IDC_UA_TTNORMALV ,SW_HIDE);
+ ShowEditField(Dialog,IDC_UA_TTPRESSEDV,SW_HIDE);
end;
-// Show or hide option items
-procedure SetupControls(Dialog:HWND;atype:integer;item:integer=-1);
+// Show or hide option items ("static options")
+procedure ShowHideControls(Dialog:HWND;atype:integer;item:integer=-1);
var
- i: cardinal;
- typ:integer;
- wnd,wnd1:HWND;
- enable:boolean;
+ show:integer;
begin
- if atype<0 then
+ HideAllControls(Dialog);
+ if atype>=0 then
begin
- for i:=0 to NumControls-1 do
- begin
- ShowWindow(GetDlgItem(Dialog,IDsArray[i]),SW_HIDE);
- end;
- end
- else
- begin
- wnd1:=GetDlgItem(Dialog,IDC_UA_PLACELIST);
- if item<0 then
- item:=SendMessage(wnd1,LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
- enable:=ListView_GetCheckState(wnd1,item)<>0;
+ if LoByte(atype)<>uaHotkey then
+ show:=SW_SHOW
+ else
+ show:=SW_HIDE;
+ ShowWindow(GetDlgItem(Dialog,IDC_UA_TWOSTATE),show);
+ ShowWindow(GetDlgItem(Dialog,IDC_UA_SAVSTATE),show);
+ ShowWindow(GetDlgItem(Dialog,IDC_UA_COMMON ),show);
- for i:=0 to NumControls-1 do
- begin
- typ:=SHArray[LoByte(atype)+HiByte(atype)][i];
- if typ=SW_SHOW then
- if (SHVarArray[i]<>0) and (not IsVarsInstalled) then
- typ:=SW_HIDE;
- wnd:=GetDlgItem(Dialog,IDsArray[i]);
- ShowWindow(wnd,typ);
- EnableWindow(wnd,enable or (EnDisArray[i]<>0));
- end;
+ case LoByte(atype) of
+ uaTTB: begin
+ ShowWindow(GetDlgItem(Dialog,IDC_UA_SHOWVART ),SW_SHOW);
+ ShowEditField(Dialog,IDC_UA_SHOWVARV ,SW_SHOW);
+
+ ShowWindow(GetDlgItem(Dialog,IDC_UA_TTNORMALT ),SW_SHOW);
+ ShowWindow(GetDlgItem(Dialog,IDC_UA_TTPRESSEDT),SW_SHOW);
+ ShowEditField(Dialog,IDC_UA_TTNORMALV ,SW_SHOW);
+ ShowEditField(Dialog,IDC_UA_TTPRESSEDV,SW_SHOW);
+ end;
+ uaTAB: begin
+ ShowWindow(GetDlgItem(Dialog,IDC_UA_GLOBAL ),SW_SHOW);
- // common settings
- EnableWindow(GetDlgItem(Dialog,IDC_UA_SAVSTATE),
- IsDlgButtonChecked(Dialog,IDC_UA_TWOSTATE)<>BST_UNCHECKED);
+ ShowWindow(GetDlgItem(Dialog,IDC_UA_TTNORMALT ),SW_SHOW);
+ ShowWindow(GetDlgItem(Dialog,IDC_UA_TTPRESSEDT),SW_SHOW);
+ ShowEditField(Dialog,IDC_UA_TTNORMALV ,SW_SHOW);
+ ShowEditField(Dialog,IDC_UA_TTPRESSEDV,SW_SHOW);
+ end;
+ uaHotkey: begin
+ end;
+ uaMenu: begin
+ if tMenuType(HiByte(atype))=contact_menu then
+ ShowWindow(GetDlgItem(Dialog,IDC_UA_GLOBAL),SW_SHOW);
- // personal settings
- case LoByte(atype) of
- uaTTB, uaTAB: begin
- enable:=false;
- if IsDlgButtonChecked(Dialog,IDC_UA_TWOSTATE)<>BST_UNCHECKED then
- if IsWindowEnabled(GetDlgItem(Dialog,IDC_UA_TTNORMALV)) then
- enable:=true;
- EnableWindow(GetDlgItem(Dialog,IDC_UA_TTPRESSEDV),enable);
+ ShowWindow(GetDlgItem(Dialog,IDC_UA_BLOCK ),SW_SHOW);
+ ShowWindow(GetDlgItem(Dialog,IDC_UA_MENU ),SW_SHOW);
+
+//!! ShowWindow(GetDlgItem(Dialog,IDC_UA_SEPARATE ),SW_SHOW);
+//!! ShowWindow(GetDlgItem(Dialog,IDC_UA_SEPARATE ),SW_SHOW);
+
+ ShowWindow(GetDlgItem(Dialog,IDC_UA_SHOWVART ),SW_SHOW);
+ ShowEditField(Dialog,IDC_UA_SHOWVARV ,SW_SHOW);
+
+ ShowWindow(GetDlgItem(Dialog,IDC_UA_POPUPT ),SW_SHOW);
+ ShowWindow(GetDlgItem(Dialog,IDC_UA_VARNAMEST ),SW_SHOW);
+ ShowEditField(Dialog,IDC_UA_VARNAMESV ,SW_SHOW);
+ ShowEditField(Dialog,IDC_UA_POPUPV ,SW_SHOW);
+
+// ShowWindow(GetDlgItem(Dialog,IDC_UA_NOTRANSLATE),SW_SHOW);
end;
end;
end;
end;
+procedure EnableDisableCheck(Dialog:HWND);
+var
+ wnd:HWND;
+ item:integer;
+ two,enable:boolean;
+begin
+ wnd:=GetDlgItem(Dialog,IDC_UA_PLACELIST);
+ item:=SendMessage(wnd,LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
+ enable:=ListView_GetCheckState(wnd,item)<>0;
+
+ // common settings
+ two:=IsDlgButtonChecked(Dialog,IDC_UA_TWOSTATE)<>BST_UNCHECKED;
+ EnableWindow(GetDlgItem(Dialog,IDC_UA_SAVSTATE),two);
+
+ // all others
+ EnableWindow(GetDlgItem(Dialog,IDC_UA_BLOCK ),enable);
+ EnableWindow(GetDlgItem(Dialog,IDC_UA_MENU ),enable);
+
+ EnableWindow(GetDlgItem(Dialog,IDC_UA_NOTRANSLATE),enable);
+ EnableWindow(GetDlgItem(Dialog,IDC_UA_SEPARATE ),enable);
+ EnableWindow(GetDlgItem(Dialog,IDC_UA_POPUPT ),enable);
+ EnableWindow(GetDlgItem(Dialog,IDC_UA_VARNAMEST ),enable);
+
+ EnableWindow(GetDlgItem(Dialog,IDC_UA_TTNORMALT ),enable);
+ EnableWindow(GetDlgItem(Dialog,IDC_UA_TTPRESSEDT ),enable);
+
+ EnableWindow(GetDlgItem(Dialog,IDC_UA_SHOWVART ),enable);
+
+ EnableEditField(Dialog,IDC_UA_SHOWVARV ,enable);
+ EnableEditField(Dialog,IDC_UA_VARNAMESV ,enable);
+ EnableEditField(Dialog,IDC_UA_POPUPV ,enable);
+ EnableEditField(Dialog,IDC_UA_TTNORMALV ,enable);
+
+ EnableEditField(Dialog,IDC_UA_TTPRESSEDV,enable and two);
+end;
+
// Clear all screen buttons/text fields (reset)
procedure ClearControls(Dialog:HWND);
var
@@ -124,16 +135,108 @@ var begin
s:=settings;
settings:=0;
- CheckDlgButton (Dialog,IDC_UA_TWOSTATE ,BST_UNCHECKED);
- CheckDlgButton (Dialog,IDC_UA_SAVSTATE ,BST_UNCHECKED);
+ // common
+ CheckDlgButton (Dialog,IDC_UA_TWOSTATE,BST_UNCHECKED);
+ CheckDlgButton (Dialog,IDC_UA_SAVSTATE,BST_UNCHECKED);
+
+ // menu items
+ SetDlgItemTextW(Dialog,IDC_UA_BLOCK ,'>');
+ CheckDlgButton (Dialog,IDC_UA_SEPARATE ,BST_UNCHECKED);
+ CheckDlgButton (Dialog,IDC_UA_NOTRANSLATE,BST_UNCHECKED);
+ SetDlgItemTextW(Dialog,IDC_UA_POPUPV ,nil);
+ SetDlgItemTextW(Dialog,IDC_UA_VARNAMESV ,nil);
+
+ SetDlgItemTextW(Dialog,IDC_UA_SHOWVARV ,nil);
+ // buttons
+ SetDlgItemTextW(Dialog,IDC_UA_TTNORMALV ,nil);
+ SetDlgItemTextW(Dialog,IDC_UA_TTPRESSEDV,nil);
+
+ // contact related
+ CheckDlgButton (Dialog,IDC_UA_GLOBAL,BST_UNCHECKED);
- CheckDlgButton (Dialog,IDC_UA_SEPARATE ,BST_UNCHECKED);
- SetDlgItemTextW(Dialog,IDC_UA_POPUPV ,nil);
- SetDlgItemTextW(Dialog,IDC_UA_VARNAMESV,nil);
- SetDlgItemTextW(Dialog,IDC_UA_SHOWVARV ,nil);
settings:=s;
end;
+procedure InitActionSettings(Dialog:HWND);
+begin
+ MakeEditField(Dialog,IDC_UA_TTNORMALV);
+ SetEditFlags(GetDlgItem(Dialog,IDC_UA_TTNORMALV),EF_FORCE,EF_FORCET);
+ MakeEditField(Dialog,IDC_UA_TTPRESSEDV);
+ SetEditFlags(GetDlgItem(Dialog,IDC_UA_TTPRESSEDV),EF_FORCE,EF_FORCET);
+
+ MakeEditField(Dialog,IDC_UA_POPUPV);
+ MakeEditField(Dialog,IDC_UA_VARNAMESV);
+
+ MakeEditField(Dialog,IDC_UA_SHOWVARV);
+ SetEditFlags(GetDlgItem(Dialog,IDC_UA_SHOWVARV),EF_FORCE,EF_FORCES);
+end;
+
+function CompareItem(lParam1,lParam2:LPARAM;SortType:LPARAM):int; stdcall;
+begin
+ result:=UActionList[lParam1].wSortIndex-UActionList[lParam2].wSortIndex;
+end;
+
+procedure FillActionList(wnd:HWND);
+var
+ i:integer;
+ li:LV_ITEMW;
+ il:HIMAGELIST;
+ lmenu:tMenuType;
+begin
+ wnd:=GetDlgItem(wnd,IDC_UA_ACTIONLIST);
+ SendMessage(wnd,LVM_DELETEALLITEMS,0,0);
+
+ il:=ImageList_Create(16,16,ILC_COLOR32 or ILC_MASK,0,1);
+ for i:=0 to HIGH(UActionList) do
+ begin
+ li.mask :=LVIF_TEXT+LVIF_PARAM+LVIF_IMAGE;
+ li.iSubItem:=0;
+ li.iItem :=i;
+ li.lParam :=i;
+ li.pszText :=UActionList[i].szActDescr;
+ li.iImage:=ImageList_ReplaceIcon(il, -1,
+ HICON(CallService(MS_SKIN2_GETICONBYHANDLE,0,LPARAM(UActionList[i].hIcolibIcon))));
+ li.iItem :=SendMessageW(wnd,LVM_INSERTITEMW,0,LPARAM(@li));
+
+ for lmenu:=main_menu to HIGH(tMenuType) do
+ UActionList[i].UAMenuItem[lmenu].changed:=false;
+ end;
+ ImageList_Destroy(SendMessage(wnd,LVM_SETIMAGELIST,LVSIL_SMALL,il));
+
+ SendMessage(wnd,LVM_SORTITEMS,0,LPARAM(@CompareItem));
+
+ ListView_SetItemState(wnd,0,
+ LVIS_FOCUSED or LVIS_SELECTED,
+ LVIS_FOCUSED or LVIS_SELECTED);
+end;
+
+// refresh icons in UA list (at least)
+function IconChanged(wParam:WPARAM;lParam:LPARAM):int;cdecl;
+var
+ i:integer;
+ li:LV_ITEMW;
+ il:HIMAGELIST;
+ wnd:HWND;
+begin
+ result:=0;
+ wnd:=GetDlgItem(settings,IDC_UA_ACTIONLIST);
+
+ il:=ImageList_Create(16,16,ILC_COLOR32 or ILC_MASK,0,1);
+ for i:=0 to HIGH(UActionList) do
+ begin
+ li.mask :=LVIF_IMAGE;
+ li.iSubItem:=0;
+ li.iItem :=i;
+ li.iImage:=ImageList_ReplaceIcon(il, -1,
+ HICON(CallService(MS_SKIN2_GETICONBYHANDLE,0,TLPARAM(UActionList[i].hIcolibIcon))));
+ SendMessageW(wnd,LVM_SETITEM,0,TLPARAM(@li));
+ end;
+ ImageList_Destroy(SendMessage(wnd,LVM_SETIMAGELIST,LVSIL_SMALL,il));
+//!!refresh?
+end;
+
+//----- Dynamic (option-depended) view -----
+
procedure ShowSubAction(Dialog:HWND;aType:integer;item:integer=-1);
var
UA:pMyActionItem;
@@ -176,6 +279,8 @@ begin begin
if (menu_opt and UAF_MENUSEP)<>0 then
CheckDlgButton(Dialog,IDC_UA_SEPARATE,BST_CHECKED);
+ if (menu_opt and UAF_NOTRANS)<>0 then
+ CheckDlgButton(Dialog,IDC_UA_NOTRANSLATE,BST_CHECKED);
SetDlgItemTextW(Dialog,IDC_UA_POPUPV ,szMenuPopup);
SetDlgItemTextW(Dialog,IDC_UA_VARNAMESV,szMenuNameVars);
SetDlgItemTextW(Dialog,IDC_UA_SHOWVARV ,szMenuShowWhenVars);
@@ -186,7 +291,8 @@ begin // Settings in Customize/Hotkeys
end;
end;
- SetupControls(Dialog,aType,-1);
+ ShowHideControls(Dialog,aType,-1);
+ EnableDisableCheck(Dialog);
settings:=s;
end;
@@ -250,10 +356,12 @@ begin else
begin
ClearControls(Dialog);
- SetupControls(Dialog,-1,-1);
+ ShowHideControls(Dialog,-1,-1);
end;
end;
+//----- Saving -----
+
procedure SetChangedFlag(Dialog:HWND);
var
num,atype:integer;
@@ -271,6 +379,8 @@ begin mFreeMem(szMenuNameVars ); szMenuNameVars :=GetDlgText(Dialog,IDC_UA_VARNAMESV);
mFreeMem(szMenuShowWhenVars); szMenuShowWhenVars:=GetDlgText(Dialog,IDC_UA_SHOWVARV);
menu_opt:=0;
+ if IsDlgButtonchecked(Dialog,IDC_UA_NOTRANSLATE)<>BST_UNCHECKED then
+ menu_opt:=menu_opt or UAF_NOTRANS;
if IsDlgButtonchecked(Dialog,IDC_UA_SEPARATE)<>BST_UNCHECKED then
menu_opt:=menu_opt or UAF_MENUSEP;
end;
@@ -349,75 +459,46 @@ begin end;
end;
-function CompareItem(lParam1,lParam2:LPARAM;SortType:LPARAM):int; stdcall;
-begin
- result:=UActionList[lParam1].wSortIndex-UActionList[lParam2].wSortIndex;
-end;
-
-procedure FillActionList(wnd:HWND);
+procedure ChangeBlock(Dialog:HWND);
var
- i:integer;
- li:LV_ITEMW;
- il:HIMAGELIST;
- lmenu:tMenuType;
+ pc:pWideChar;
+ sh_main,sh_add:integer;
begin
- wnd:=GetDlgItem(wnd,IDC_UA_ACTIONLIST);
- SendMessage(wnd,LVM_DELETEALLITEMS,0,0);
-
- il:=ImageList_Create(16,16,ILC_COLOR32 or ILC_MASK,0,1);
- for i:=0 to HIGH(UActionList) do
- begin
- li.mask :=LVIF_TEXT+LVIF_PARAM+LVIF_IMAGE;
- li.iSubItem:=0;
- li.iItem :=i;
- li.lParam :=i;
- li.pszText :=UActionList[i].szActDescr;
- li.iImage:=ImageList_ReplaceIcon(il, -1,
- HICON(CallService(MS_SKIN2_GETICONBYHANDLE,0,LPARAM(UActionList[i].hIcolibIcon))));
- li.iItem :=SendMessageW(wnd,LVM_INSERTITEMW,0,LPARAM(@li));
-
- for lmenu:=main_menu to HIGH(tMenuType) do
- UActionList[i].UAMenuItem[lmenu].changed:=false;
- end;
- ImageList_Destroy(SendMessage(wnd,LVM_SETIMAGELIST,LVSIL_SMALL,il));
-
- SendMessage(wnd,LVM_SORTITEMS,0,LPARAM(@CompareItem));
-
- ListView_SetItemState(wnd,0,
- LVIS_FOCUSED or LVIS_SELECTED,
- LVIS_FOCUSED or LVIS_SELECTED);
-end;
-
-// refresh icons in UA list (at least)
-function IconChanged(wParam:WPARAM;lParam:LPARAM):int;cdecl;
-var
- i:integer;
- li:LV_ITEMW;
- il:HIMAGELIST;
- wnd:HWND;
-begin
- result:=0;
- wnd:=GetDlgItem(settings,IDC_UA_ACTIONLIST);
-
- il:=ImageList_Create(16,16,ILC_COLOR32 or ILC_MASK,0,1);
- for i:=0 to HIGH(UActionList) do
+ if IsWindowVisible(GetDlgItem(Dialog,IDC_UA_POPUPV)) then
begin
- li.mask :=LVIF_IMAGE;
- li.iSubItem:=0;
- li.iItem :=i;
- li.iImage:=ImageList_ReplaceIcon(il, -1,
- HICON(CallService(MS_SKIN2_GETICONBYHANDLE,0,TLPARAM(UActionList[i].hIcolibIcon))));
- SendMessageW(wnd,LVM_SETITEM,0,TLPARAM(@li));
+ pc:='<';
+ sh_main:=SW_HIDE;
+ sh_add :=SW_SHOW;
+ end
+ else
+ begin
+ pc:='>';
+ sh_main:=SW_SHOW;
+ sh_add :=SW_HIDE;
end;
- ImageList_Destroy(SendMessage(wnd,LVM_SETIMAGELIST,LVSIL_SMALL,il));
-//!!refresh?
+ ShowWindow(GetDlgItem(Dialog,IDC_UA_NOTRANSLATE),sh_add);
+ ShowWindow(GetDlgItem(Dialog,IDC_UA_SEPARATE ),sh_add);
+ ShowWindow(GetDlgItem(Dialog,IDC_UA_POPUPT ),sh_main);
+ ShowWindow(GetDlgItem(Dialog,IDC_UA_VARNAMEST ),sh_main);
+ ShowEditField(Dialog,IDC_UA_VARNAMESV,sh_main);
+ ShowEditField(Dialog,IDC_UA_POPUPV ,sh_main);
+
+ SetDlgItemTextW(Dialog,IDC_UA_BLOCK,pc);
+ if sh_main=SW_SHOW then
+ pc:='Main settings'
+ else
+ pc:='Custom settings';
+ SetDlgItemTextW(Dialog,IDC_UA_MENU,TranslateW(pc));
end;
-function DlgProcOpt(Dialog:HWnd;hMessage:UINT;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+//----- Main Dialog -----
+
+function DlgProcOpt(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
var
wnd:HWND;
lv:LV_COLUMNW;
i:integer;
+ twostate:bool;
begin
result:=0;
case hMessage of
@@ -430,6 +511,8 @@ begin settings:=0;
TranslateDialogDefault(Dialog);
+ InitActionSettings(Dialog);
+
wnd:=GetDlgItem(Dialog,IDC_UA_PLACELIST);
SendMessage(wnd,LVM_SETEXTENDEDLISTVIEWSTYLE,LVS_EX_CHECKBOXES,LVS_EX_CHECKBOXES);
SendMessage(wnd,LVM_SETUNICODEFORMAT,1,0);
@@ -450,16 +533,6 @@ begin FillActionList(Dialog);
ShowAction(Dialog,-1);
-// if isVarsInstalled then
- begin
- SendDlgItemMessage(Dialog,IDC_UA_VARNAMESH,BM_SETIMAGE,IMAGE_ICON,
- CallService(MS_VARS_GETSKINITEM,0,VSI_HELPICON));
- SendDlgItemMessage(Dialog,IDC_UA_SHOWVARH,BM_SETIMAGE,IMAGE_ICON,
- CallService(MS_VARS_GETSKINITEM,0,VSI_HELPICON));
-// SendDlgItemMessage(Dialog,IDC_UA_VARNAMESH,BUTTONSETASFLATBTN,0,0);
-// SendDlgItemMessage(Dialog,IDC_UA_SHOWVARH ,BUTTONSETASFLATBTN,0,0);
- end;
-
settings:=Dialog;
hIC:=HookEvent(ME_SKIN2_ICONSCHANGED,@IconChanged);
end;
@@ -480,29 +553,36 @@ begin begin
case loword(wParam) of
IDC_UA_TWOSTATE: begin
- SetupControls(Dialog,
+ twostate:=IsDlgButtonChecked(Dialog,IDC_UA_TWOSTATE)<>BST_UNCHECKED;
+ EnableWindow(GetDlgItem(Dialog,IDC_UA_SAVSTATE),twostate);
+
+ if LoByte(LV_GetLParam(GetDlgItem(Dialog,IDC_UA_PLACELIST))) in [uaTTB,uaTAB] then
+ EnableEditField(Dialog,IDC_UA_TTPRESSEDV,
+ twostate and IsWindowEnabled(GetDlgItem(Dialog,IDC_UA_TTNORMALV))
+ );
+
+ ShowHideControls(Dialog,
LV_GetLParam(GetDlgItem(Dialog,IDC_UA_PLACELIST)),-1);
- {
- EnableWindow(GetDlgItem(Dialog,IDC_UA_TTPRESSEDV),
- IsDlgButtonChecked(Dialog,IDC_UA_TWOSTATE)<>BST_UNCHECKED);
- }
- if IsDlgButtonChecked(Dialog,IDC_UA_TWOSTATE)=BST_UNCHECKED then
- DeleteIcolibIconP(
+
+ if twostate then
+ AddIcolibIconP(
UActionList[LV_GetLParam(GetDlgItem(Dialog,IDC_UA_ACTIONLIST),-1)])
else
- AddIcolibIconP(
+ DeleteIcolibIconP(
UActionList[LV_GetLParam(GetDlgItem(Dialog,IDC_UA_ACTIONLIST),-1)]);
SendMessage(GetParent(Dialog),PSM_CHANGED,0,0);
end;
- IDC_UA_VARNAMESH: ShowVarHelp(Dialog,IDC_UA_VARNAMESV);
- IDC_UA_SHOWVARH : ShowVarHelp(Dialog,IDC_UA_SHOWVARV);
-
//was commented. why?
IDC_UA_SAVSTATE,
IDC_UA_GLOBAL: SendMessage(GetParent(Dialog),PSM_CHANGED,0,0);
+ IDC_UA_BLOCK: begin
+ ChangeBlock(Dialog);
+ end;
+
+ IDC_UA_NOTRANSLATE,
IDC_UA_SEPARATE: begin
SetChangedFlag(Dialog);
SendMessage(GetParent(Dialog),PSM_CHANGED,0,0);
@@ -548,6 +628,7 @@ begin LV_GetLParam(GetDlgItem(Dialog,IDC_UA_PLACELIST),
PNMLISTVIEW(lParam)^.iItem));
end
+ // checkboxes
else if (settings<>0) and
((PNMLISTVIEW(lParam)^.uOldState or PNMLISTVIEW(lParam)^.uNewState)=$3000) then
begin
@@ -559,8 +640,7 @@ begin LVIS_FOCUSED or LVIS_SELECTED,
LVIS_FOCUSED or LVIS_SELECTED)
else
- SetupControls(Dialog,LV_GetLParam(wnd,PNMLISTVIEW(lParam)^.iItem),
- PNMLISTVIEW(lParam)^.iItem);
+ EnableDisableCheck(Dialog);
SendMessage(GetParent(Dialog),PSM_CHANGED,0,0);
end;
diff --git a/plugins/Actman30/ua/i_uaplaces.inc b/plugins/Actman30/ua/i_uaplaces.inc index b38d16290e..e250b3d8f1 100644 --- a/plugins/Actman30/ua/i_uaplaces.inc +++ b/plugins/Actman30/ua/i_uaplaces.inc @@ -50,7 +50,7 @@ end; procedure SetTABState(hContact:THANDLE;const ActionItem:tMyActionItem;pressed:integer);
var
- tabb:BBButton;
+ tabb:TBBButton;
pc:pWideChar;
begin
FillChar(tabb,SizeOf(tabb),0);
@@ -225,8 +225,8 @@ begin if (ActionItem.flags and UAF_HKREGGED)=0 then
begin
FillChar(hkd,SizeOf(hkd),0);
- hkd.cbSize := SizeOf(hkd);
- hkd.dwFlags := HKD_UNICODE;
+ hkd.cbSize := SizeOf(hkd); // HOTKEYDESC_SIZE_V1 for pre-0.9
+ hkd.dwFlags := HKD_UNICODE; // since 0.9 only
hkd.pszName := ActionItem.szNameID;
hkd.pszDescription.w:= ActionItem.szActDescr;
hkd.pszSection .w:= MODULE_NAME;
@@ -381,7 +381,10 @@ begin begin
FillChar(clmi,SizeOf(clmi),0);
clmi.cbSize:=SizeOf(clmi);
- clmi.flags :=CMIF_UNICODE{ or CMIF_ICONFROMICOLIB};
+ if (UAMenuItem.menu_opt and UAF_NOTRANS)<>0 then
+ clmi.flags :=CMIF_UNICODE or CMIF_KEEPUNTRANSLATED
+ else
+ clmi.flags :=CMIF_UNICODE{ or CMIF_ICONFROMICOLIB};
if (UAMenuItem.szMenuPopup<>nil) and (UAMenuItem.szMenuPopup^<>#0) then
clmi.szName.w:=ParseVarString(UAMenuItem.szMenuPopup)
@@ -418,7 +421,10 @@ begin {}{}
FillChar(clmi,SizeOf(clmi),0);
clmi.cbSize:=SizeOf(clmi);
- clmi.flags:=CMIF_UNICODE{ or CMIF_ICONFROMICOLIB};
+ if (UAMenuItem.menu_opt and UAF_NOTRANS)<>0 then
+ clmi.flags :=CMIF_UNICODE or CMIF_KEEPUNTRANSLATED
+ else
+ clmi.flags :=CMIF_UNICODE{ or CMIF_ICONFROMICOLIB};
if (ActionItem.flags and (UAF_2STATE+UAF_PRESSED))<>(UAF_2STATE+UAF_PRESSED) then
begin
clmi.hIcon:=ActionItem.hIcolibIcon;
@@ -427,7 +433,7 @@ begin else
begin
clmi.hIcon:=ActionItem.hIcolibIconPressed;
- clmi.flags:=CMIF_UNICODE {or CMIF_ICONFROMICOLIB }or CMIF_CHECKED;
+ clmi.flags:=clmi.flags or CMIF_CHECKED;
extra:='1';
end;
@@ -463,7 +469,7 @@ begin end;
-function PreBuildMenu(mtype:tMenuType;hContact:MCONTACT=0):int;
+function PreBuildMenu(mtype:tMenuType;hContact:TMCONTACT=0):int;
var
i:integer;
mi:TCListMenuItem;
@@ -703,7 +709,7 @@ const procedure AddTabBBButton(var ActionItem:tMyActionItem);
var
- tabb:BBButton;
+ tabb:TBBButton;
begin
if not NamesArray[uaTAB].enable then exit;
@@ -736,7 +742,7 @@ end; procedure DeleteTabBBButton(var ActionItem:tMyActionItem);
var
- tabb:BBButton;
+ tabb:TBBButton;
begin
if (ActionItem.flags and UAF_TBREGGED)<>0 then
begin
diff --git a/plugins/Actman30/ua/i_uavars.inc b/plugins/Actman30/ua/i_uavars.inc index 5b53cde26a..dc11d5b76d 100644 --- a/plugins/Actman30/ua/i_uavars.inc +++ b/plugins/Actman30/ua/i_uavars.inc @@ -29,9 +29,6 @@ type type
pMyActionItem = ^tMyActionItem;
tMyActionItem = record
- flags :dword;
- dwActID :dword; // action ID
- wSortIndex :word; // list/menu/toolbar order
// UseActions/Action_ID
szNameID :pAnsiChar; // uaction ID
szActDescr :pWideChar; // action name
@@ -50,6 +47,10 @@ type lastContact :THANDLE; // for contact menu
hMenuService :THANDLE; // common menu service
UAMenuItem :array [tMenuType] of tUAMenuItem;
+ // moved to the end for better align
+ flags :dword;
+ dwActID :dword; // action ID
+ wSortIndex :word; // list/menu/toolbar order
end;
const
@@ -77,6 +78,7 @@ const // menu options
UAF_MENUSEP = 1 shl 1; // menu item separated
UAF_MENUUSE = 1 shl 8; // use this menu
+ UAF_NOTRANS = 1 shl 9; // do not translate menus
type
tNameRec = record
diff --git a/plugins/Actman30/ua/i_uconst.inc b/plugins/Actman30/ua/i_uconst.inc index 34dde3ee9e..cffbfdcc76 100644 --- a/plugins/Actman30/ua/i_uconst.inc +++ b/plugins/Actman30/ua/i_uconst.inc @@ -2,33 +2,35 @@ const
IDD_UA = 1031;
- IDC_UA_ACTIONLIST = 1025;
- IDC_UA_PLACELIST = 1026;
+ IDC_UA_ACTIONLIST = 1025;
+ IDC_UA_PLACELIST = 1026;
// menu settings
- IDC_UA_SEPARATE = 1027;
- IDC_UA_POPUPT = 1028;
- IDC_UA_POPUPV = 1029;
+ IDC_UA_POPUPT = 1030;
+ IDC_UA_POPUPV = 1031;
- IDC_UA_VARNAMEST = 1030;
- IDC_UA_VARNAMESV = 1031;
- IDC_UA_VARNAMESH = 1032;
+ IDC_UA_VARNAMEST = 1032;
+ IDC_UA_VARNAMESV = 1033;
- IDC_UA_SHOWVART = 1033;
- IDC_UA_SHOWVARV = 1034;
- IDC_UA_SHOWVARH = 1035;
+ IDC_UA_SHOWVART = 1034;
+ IDC_UA_SHOWVARV = 1035;
+
+ IDC_UA_BLOCK = 1040;
+ IDC_UA_SEPARATE = 1041;
+ IDC_UA_NOTRANSLATE = 1042;
+ IDC_UA_MENU = 1043;
// toolbar settings
- IDC_UA_TTNORMALT = 2028;
- IDC_UA_TTNORMALV = 2029;
- IDC_UA_TTPRESSEDT = 2030;
- IDC_UA_TTPRESSEDV = 2031;
+ IDC_UA_TTNORMALT = 2028;
+ IDC_UA_TTNORMALV = 2029;
+ IDC_UA_TTPRESSEDT = 2030;
+ IDC_UA_TTPRESSEDV = 2031;
// common
- IDC_UA_COMMON = 2000;
- IDC_UA_TWOSTATE = 2001;
- IDC_UA_SAVSTATE = 2002;
+ IDC_UA_COMMON = 2000;
+ IDC_UA_TWOSTATE = 2001;
+ IDC_UA_SAVSTATE = 2002;
- IDC_UA_GLOBAL = 2003;
+ IDC_UA_GLOBAL = 2003;
IDI_ACTION = 101;
diff --git a/plugins/Actman30/ua/ua.pas b/plugins/Actman30/ua/ua.pas index 4aad8e1793..9c9554e1c0 100644 --- a/plugins/Actman30/ua/ua.pas +++ b/plugins/Actman30/ua/ua.pas @@ -6,7 +6,7 @@ implementation uses
windows, commctrl, messages,
- mirutils, common, dbsettings, io, m_api, wrapper,
+ mirutils, common, dbsettings, io, m_api, wrapper, editwrapper,
global;
{$R ua.res}
@@ -49,6 +49,19 @@ var // ------------ base interface functions -------------
+procedure CheckPlacesAbility;
+var
+ i:integer;
+begin
+ for i:=0 to NumTypes-1 do
+ begin
+ with NamesArray[i] do
+ begin
+ enable:=(service=nil) or (ServiceExists(service)<>0);
+ end;
+ end;
+end;
+
procedure Init;
begin
GetModuleFileNameW(hInstance,szMyPath,MAX_PATH);
diff --git a/plugins/Actman30/ua/ua.rc b/plugins/Actman30/ua/ua.rc index 76d8c0ad77..6e0fdde413 100644 --- a/plugins/Actman30/ua/ua.rc +++ b/plugins/Actman30/ua/ua.rc @@ -7,44 +7,47 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE EXSTYLE WS_EX_CONTROLPARENT
FONT 8, "MS Shell Dlg", 0, 0
{
- CTEXT "Action list",-1, 2,2,132,10, SS_CENTERIMAGE
+ CTEXT "Action list",-1, 0,2,134,11, SS_CENTERIMAGE
CONTROL "", IDC_UA_ACTIONLIST, "SysListView32",
WS_BORDER | WS_TABSTOP |
LVS_NOCOLUMNHEADER | LVS_SHOWSELALWAYS | LVS_REPORT | LVS_SINGLESEL,
- 2, 12, 132, 212, WS_EX_CONTROLPARENT
+ 0, 13, 134, 212, WS_EX_CONTROLPARENT
- CTEXT "Where to use",-1, 138,2,160,10, SS_CENTERIMAGE
+ CTEXT "Where to use",-1, 138,2,160,11, SS_CENTERIMAGE
CONTROL "", IDC_UA_PLACELIST, "SysListView32",
WS_BORDER | WS_TABSTOP |
LVS_NOCOLUMNHEADER | LVS_SHOWSELALWAYS | LVS_REPORT | LVS_SINGLESEL,
- 138, 12, 160, 74, WS_EX_CONTROLPARENT
+ 138, 13, 160, 74, WS_EX_CONTROLPARENT
- GROUPBOX "Common" , IDC_UA_COMMON , 138, 88,160,38
- AUTOCHECKBOX "2 state button/item" , IDC_UA_TWOSTATE, 140, 96,156,14, BS_LEFTTEXT | BS_RIGHT
- AUTOCHECKBOX "Save button/item state", IDC_UA_SAVSTATE, 140,110,156,14, BS_LEFTTEXT | BS_RIGHT
+ GROUPBOX "Common" , IDC_UA_COMMON , 138, 88,164,38
+ AUTOCHECKBOX "2 state button/item" , IDC_UA_TWOSTATE, 140, 96,160,14, BS_LEFTTEXT | BS_RIGHT
+ AUTOCHECKBOX "Save button/item state", IDC_UA_SAVSTATE, 140,110,160,14, BS_LEFTTEXT | BS_RIGHT
- AUTOCHECKBOX "Contact related", IDC_UA_GLOBAL, 138,128,160,14, BS_LEFTTEXT | BS_RIGHT
+ AUTOCHECKBOX "Contact related", IDC_UA_GLOBAL, 138,128,164,14, BS_LEFTTEXT | BS_RIGHT
// Buttons settings block
- RTEXT "Normal button tooltip",IDC_UA_TTNORMALT, 138,148,160,8
- EDITTEXT IDC_UA_TTNORMALV, 138,158,160,12, ES_AUTOHSCROLL
+ RTEXT "Normal button tooltip",IDC_UA_TTNORMALT, 138,144,164,12, SS_CENTERIMAGE
+ EDITTEXT IDC_UA_TTNORMALV, 138,157,164,12, ES_AUTOHSCROLL
- RTEXT "Pressed button tooltip",IDC_UA_TTPRESSEDT, 138,172,160,8
- EDITTEXT IDC_UA_TTPRESSEDV, 138,182,160,12, ES_AUTOHSCROLL
+ RTEXT "Pressed button tooltip",IDC_UA_TTPRESSEDT, 138,172,164,12, SS_CENTERIMAGE
+ EDITTEXT IDC_UA_TTPRESSEDV, 138,185,164,12, ES_AUTOHSCROLL
- // Menu settings block
- AUTOCHECKBOX "Separated",IDC_UA_SEPARATE, 138,142,160,14, BS_LEFTTEXT | BS_RIGHT
+ PUSHBUTTON ">" , IDC_UA_BLOCK, 292,146, 10,52
+ GROUPBOX "Main settings", IDC_UA_MENU , 138,142,152,58
- RTEXT "Root popup:",IDC_UA_POPUPT,138,158,80,12, SS_CENTERIMAGE
- EDITTEXT IDC_UA_POPUPV, 218,158,80,12, ES_AUTOHSCROLL
+ // Block #1 (Menu data block)
+ RTEXT "Root popup:",IDC_UA_POPUPT, 140,150,146,12, SS_CENTERIMAGE
+ EDITTEXT IDC_UA_POPUPV, 141,162,146,12, ES_AUTOHSCROLL
- RTEXT "Menu item name:",IDC_UA_VARNAMEST, 138,172,140,8
- EDITTEXT IDC_UA_VARNAMESV, 138,182,140,12, ES_AUTOHSCROLL
- CONTROL "V",IDC_UA_VARNAMESH,"MButtonClass",WS_TABSTOP, 282,180,16,16, $18000000
+ RTEXT "Menu item name:",IDC_UA_VARNAMEST, 140,174,146,12, SS_CENTERIMAGE
+ EDITTEXT IDC_UA_VARNAMESV, 141,186,146,12, ES_AUTOHSCROLL
- RTEXT "Show only if variables return 1",IDC_UA_SHOWVART, 138,200,140,8
- EDITTEXT IDC_UA_SHOWVARV,138,210,140,12,ES_AUTOHSCROLL
- CONTROL "V",IDC_UA_SHOWVARH,"MButtonClass",WS_TABSTOP, 282,208,16,16, $18000000
+ // Block #2 (Menu settings block)
+ AUTOCHECKBOX "Separated" ,IDC_UA_SEPARATE , 140,150,148,14, BS_LEFTTEXT | BS_RIGHT
+ AUTOCHECKBOX "Do not translate",IDC_UA_NOTRANSLATE, 140,166,148,14, BS_LEFTTEXT | BS_RIGHT
+
+ RTEXT "Show only if variables return 1",IDC_UA_SHOWVART, 138,200,164,12, SS_CENTERIMAGE
+ EDITTEXT IDC_UA_SHOWVARV, 138,213,164,12, ES_AUTOHSCROLL
}
|