summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-11-06 16:02:51 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-11-06 16:02:51 +0000
commite5921864a7020e65ddee7d5c83fb3ed0f9ddc106 (patch)
treec51dc65b300b192a9da902047c5785443f76c2df /plugins
parent1109badbf7ade0bd6647654302a6ef5e1bb8fee2 (diff)
compilation fix
git-svn-id: http://svn.miranda-ng.org/main/trunk@6807 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Actman30/hooks/hooks.resbin0 -> 688 bytes
-rw-r--r--plugins/Actman30/iac_global.pas8
-rw-r--r--plugins/Actman30/tasks/tasks.resbin0 -> 1288 bytes
-rw-r--r--plugins/Actman30/tmp/FreeImage.ppubin199403 -> 0 bytes
-rw-r--r--plugins/Actman30/tmp/PsAPI.ppubin23713 -> 0 bytes
-rw-r--r--plugins/Actman30/tmp/ask.resbin456 -> 0 bytes
-rw-r--r--plugins/Actman30/tmp/commctrl.ppubin503113 -> 0 bytes
-rw-r--r--plugins/Actman30/tmp/common.ppubin55446 -> 0 bytes
-rw-r--r--plugins/Actman30/tmp/dbsettings.ppubin26337 -> 0 bytes
-rw-r--r--plugins/Actman30/tmp/global.ppubin2051 -> 0 bytes
-rw-r--r--plugins/Actman30/tmp/io.ppubin7789 -> 0 bytes
-rw-r--r--plugins/Actman30/tmp/mApiCard.resbin1052 -> 0 bytes
-rw-r--r--plugins/Actman30/tmp/mApiCardM.ppubin9968 -> 0 bytes
-rw-r--r--plugins/Actman30/tmp/m_api.ppubin607276 -> 0 bytes
-rw-r--r--plugins/Actman30/tmp/memini.ppubin10884 -> 0 bytes
-rw-r--r--plugins/Actman30/tmp/mirutils.ppubin20647 -> 0 bytes
-rw-r--r--plugins/Actman30/tmp/question.ppubin3314 -> 0 bytes
-rw-r--r--plugins/Actman30/tmp/syswin.ppubin12797 -> 0 bytes
-rw-r--r--plugins/Actman30/tmp/wrapper.ppubin15405 -> 0 bytes
-rw-r--r--plugins/Actman30/ua/ua.resbin0 -> 3944 bytes
-rw-r--r--plugins/Utils.pas/editwrapper.pas376
-rw-r--r--plugins/Utils.pas/editwrapper.rc26
-rw-r--r--plugins/Utils.pas/editwrapper.res (renamed from plugins/Actman30/editwrapper.res)bin492 -> 492 bytes
-rw-r--r--plugins/Utils.pas/mirutils.pas25
24 files changed, 419 insertions, 16 deletions
diff --git a/plugins/Actman30/hooks/hooks.res b/plugins/Actman30/hooks/hooks.res
new file mode 100644
index 0000000000..1cf202f414
--- /dev/null
+++ b/plugins/Actman30/hooks/hooks.res
Binary files differ
diff --git a/plugins/Actman30/iac_global.pas b/plugins/Actman30/iac_global.pas
index 11bfbba275..1d7957a3bc 100644
--- a/plugins/Actman30/iac_global.pas
+++ b/plugins/Actman30/iac_global.pas
@@ -12,7 +12,7 @@ var
const
IcoLibPrefix = 'action_type_';
const
- NoDescription:PWideChar='No Description';
+ NoDescription:PWideChar='No description';
const
protostr = '<proto>';
const
@@ -94,7 +94,7 @@ function ImportContactINI(node:pointer):THANDLE;
implementation
-uses Common, global, dbsettings, base64, mirutils;
+uses Common, global, dbsettings, mirutils;
//----- tBaseAction code -----
const
@@ -308,6 +308,7 @@ var
dbv:TDBVARIANT;
tmp:pWideChar;
is_chat:boolean;
+ bufLen:int;
begin
with xmlparser do
begin
@@ -336,7 +337,8 @@ begin
DBVT_UTF8 : WideToUTF8(tmp,dbv.szVal.A);
DBVT_WCHAR : dbv.szVal.W:=tmp;
DBVT_BLOB : begin
- Base64Decode(FastWideToAnsi(tmp,pAnsiChar(dbv.pbVal)),dbv.pbVal);
+ dbv.pbVal := mir_base64_decode(FastWideToAnsi(tmp,pAnsiChar(dbv.pbVal)),bufLen);
+ dbv.cpbVal := bufLen;
end;
end;
end;
diff --git a/plugins/Actman30/tasks/tasks.res b/plugins/Actman30/tasks/tasks.res
new file mode 100644
index 0000000000..bc72f06406
--- /dev/null
+++ b/plugins/Actman30/tasks/tasks.res
Binary files differ
diff --git a/plugins/Actman30/tmp/FreeImage.ppu b/plugins/Actman30/tmp/FreeImage.ppu
deleted file mode 100644
index f25e2c85ec..0000000000
--- a/plugins/Actman30/tmp/FreeImage.ppu
+++ /dev/null
Binary files differ
diff --git a/plugins/Actman30/tmp/PsAPI.ppu b/plugins/Actman30/tmp/PsAPI.ppu
deleted file mode 100644
index ef67c967e3..0000000000
--- a/plugins/Actman30/tmp/PsAPI.ppu
+++ /dev/null
Binary files differ
diff --git a/plugins/Actman30/tmp/ask.res b/plugins/Actman30/tmp/ask.res
deleted file mode 100644
index 15a00e0218..0000000000
--- a/plugins/Actman30/tmp/ask.res
+++ /dev/null
Binary files differ
diff --git a/plugins/Actman30/tmp/commctrl.ppu b/plugins/Actman30/tmp/commctrl.ppu
deleted file mode 100644
index 4456f8e7b5..0000000000
--- a/plugins/Actman30/tmp/commctrl.ppu
+++ /dev/null
Binary files differ
diff --git a/plugins/Actman30/tmp/common.ppu b/plugins/Actman30/tmp/common.ppu
deleted file mode 100644
index 43cef92527..0000000000
--- a/plugins/Actman30/tmp/common.ppu
+++ /dev/null
Binary files differ
diff --git a/plugins/Actman30/tmp/dbsettings.ppu b/plugins/Actman30/tmp/dbsettings.ppu
deleted file mode 100644
index 7ce66f7110..0000000000
--- a/plugins/Actman30/tmp/dbsettings.ppu
+++ /dev/null
Binary files differ
diff --git a/plugins/Actman30/tmp/global.ppu b/plugins/Actman30/tmp/global.ppu
deleted file mode 100644
index 46e10fc2cc..0000000000
--- a/plugins/Actman30/tmp/global.ppu
+++ /dev/null
Binary files differ
diff --git a/plugins/Actman30/tmp/io.ppu b/plugins/Actman30/tmp/io.ppu
deleted file mode 100644
index 73b9a58bd5..0000000000
--- a/plugins/Actman30/tmp/io.ppu
+++ /dev/null
Binary files differ
diff --git a/plugins/Actman30/tmp/mApiCard.res b/plugins/Actman30/tmp/mApiCard.res
deleted file mode 100644
index 7d6ed320b9..0000000000
--- a/plugins/Actman30/tmp/mApiCard.res
+++ /dev/null
Binary files differ
diff --git a/plugins/Actman30/tmp/mApiCardM.ppu b/plugins/Actman30/tmp/mApiCardM.ppu
deleted file mode 100644
index 8db033ec05..0000000000
--- a/plugins/Actman30/tmp/mApiCardM.ppu
+++ /dev/null
Binary files differ
diff --git a/plugins/Actman30/tmp/m_api.ppu b/plugins/Actman30/tmp/m_api.ppu
deleted file mode 100644
index 94ef17fde8..0000000000
--- a/plugins/Actman30/tmp/m_api.ppu
+++ /dev/null
Binary files differ
diff --git a/plugins/Actman30/tmp/memini.ppu b/plugins/Actman30/tmp/memini.ppu
deleted file mode 100644
index 34fa7338bb..0000000000
--- a/plugins/Actman30/tmp/memini.ppu
+++ /dev/null
Binary files differ
diff --git a/plugins/Actman30/tmp/mirutils.ppu b/plugins/Actman30/tmp/mirutils.ppu
deleted file mode 100644
index 1627956ef1..0000000000
--- a/plugins/Actman30/tmp/mirutils.ppu
+++ /dev/null
Binary files differ
diff --git a/plugins/Actman30/tmp/question.ppu b/plugins/Actman30/tmp/question.ppu
deleted file mode 100644
index a00b7fa2c2..0000000000
--- a/plugins/Actman30/tmp/question.ppu
+++ /dev/null
Binary files differ
diff --git a/plugins/Actman30/tmp/syswin.ppu b/plugins/Actman30/tmp/syswin.ppu
deleted file mode 100644
index bd3a2a4040..0000000000
--- a/plugins/Actman30/tmp/syswin.ppu
+++ /dev/null
Binary files differ
diff --git a/plugins/Actman30/tmp/wrapper.ppu b/plugins/Actman30/tmp/wrapper.ppu
deleted file mode 100644
index 2fe9202853..0000000000
--- a/plugins/Actman30/tmp/wrapper.ppu
+++ /dev/null
Binary files differ
diff --git a/plugins/Actman30/ua/ua.res b/plugins/Actman30/ua/ua.res
new file mode 100644
index 0000000000..8316b81f51
--- /dev/null
+++ b/plugins/Actman30/ua/ua.res
Binary files differ
diff --git a/plugins/Utils.pas/editwrapper.pas b/plugins/Utils.pas/editwrapper.pas
new file mode 100644
index 0000000000..1a66929bfd
--- /dev/null
+++ b/plugins/Utils.pas/editwrapper.pas
@@ -0,0 +1,376 @@
+unit EditWrapper;
+
+interface
+
+uses windows;
+
+// exported flags
+const
+ EF_SCRIPT = 1;
+ EF_ALL = EF_SCRIPT; // what can be changed
+ EF_FORCES = $80;
+ EF_FORCET = $40;
+ EF_FORCE = EF_FORCES or EF_FORCET;
+
+function MakeEditField(Dialog:HWND; id:uint):HWND;
+procedure SetEditFlags(wnd:HWND; mask, flags:dword); overload;
+procedure SetEditFlags(Dialog:HWND; id:uint; mask,flags:dword); overload;
+function GetEditFlags(wnd:HWND):dword; overload;
+function GetEditFlags(Dialog:HWND; id:uint):dword; overload;
+function EnableEditField(wnd:HWND; enable:boolean):boolean; overload;
+function EnableEditField(Dialog:HWND; id:uint; enable:boolean):boolean; overload;
+function ShowEditField(wnd:HWND; mode:integer):boolean;overload;
+function ShowEditField(Dialog:HWND; id:uint; mode:integer):boolean;overload;
+
+implementation
+
+uses messages,commctrl,common,wrapper,m_api;
+
+{$R editwrapper.res}
+{$include 'i_text_const.inc'}
+
+// internal flags
+const
+ EF_WRAP = 2;
+
+// EditFields & EditForm -> Button -> [EditField,WinProc,flags]
+type
+ pUserData = ^tUserData;
+ tUserData = record
+ SavedProc :pointer;
+ LinkedControl:HWND;
+ LinkedCtrlId :integer;
+ flags :dword;
+ end;
+
+procedure SetButtonTitle(btnwnd:HWND);
+var
+ title:pWideChar;
+ ptr:pUserData;
+begin
+ ptr:=pUserData(GetWindowLongPtrW(btnwnd,GWLP_USERDATA));
+ if (ptr^.flags and EF_SCRIPT)<>0 then
+ title:='S'
+ else
+ title:='T';
+ SendMessageW(btnwnd,WM_SETTEXT,0,tlParam(title));
+end;
+
+function EditDlgResizer(Dialog:HWND;lParam:LPARAM;urc:PUTILRESIZECONTROL):int; cdecl;
+begin
+ case urc^.wId of
+ IDCANCEL: result:=RD_ANCHORX_RIGHT or RD_ANCHORY_BOTTOM;
+ IDOK: result:=RD_ANCHORX_RIGHT or RD_ANCHORY_BOTTOM;
+ IDC_SCRIPT_HELP: result:=RD_ANCHORX_RIGHT or RD_ANCHORY_TOP;
+ IDC_TEXT_SCRIPT: result:=RD_ANCHORX_LEFT or RD_ANCHORY_TOP;
+ IDC_TEXT_WRAP: result:=RD_ANCHORX_LEFT or RD_ANCHORY_BOTTOM;
+ IDC_TEXT_EDIT_W: result:=RD_ANCHORX_WIDTH or RD_ANCHORY_HEIGHT;
+ IDC_TEXT_EDIT_NW: result:=RD_ANCHORX_WIDTH or RD_ANCHORY_HEIGHT;
+ else
+ result:=0;
+ end;
+end;
+
+// if need to change button text, will pass button (not edit field) handle as parameter
+function EditWndProc(Dialog:HWnd;hMessage:uint;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+var
+ pc:pWideChar;
+ btnwnd:HWND;
+ ptr:pUserData;
+ wnd,wnd1:HWND;
+ vhi:TVARHELPINFO;
+ cr:integer;
+ idshow,idhide:integer;
+ urd:TUTILRESIZEDIALOG;
+begin
+ result:=0;
+
+ case hMessage of
+ WM_DESTROY: begin
+ end;
+
+ WM_INITDIALOG: begin
+ TranslateDialogDefault(Dialog);
+ ptr:=pUserData(GetWindowLongPtrW(HWND(lParam),GWLP_USERDATA));
+
+ SetWindowLongPtrW(Dialog,GWLP_USERDATA,lParam);
+ pc:=GetDlgText(ptr^.LinkedControl);
+
+ if (ptr^.flags and (EF_FORCES or EF_FORCET))<>0 then
+ EnableWindow(GetDlgItem(Dialog,IDC_TEXT_SCRIPT),false);
+
+ if (ptr^.flags and EF_SCRIPT)<>0 then
+ CheckDlgButton(Dialog,IDC_TEXT_SCRIPT,BST_CHECKED);
+
+ if (ptr^.flags and EF_WRAP)<>0 then
+ begin
+ CheckDlgButton(Dialog,IDC_TEXT_WRAP,BST_CHECKED);
+ idshow:=IDC_TEXT_EDIT_W;
+ idhide:=IDC_TEXT_EDIT_NW;
+ end
+ else
+ begin
+ idshow:=IDC_TEXT_EDIT_NW;
+ idhide:=IDC_TEXT_EDIT_W;
+ end;
+
+ SetDlgItemTextW(Dialog,idshow,pc);
+ mFreeMem(pc);
+ ShowWindow(GetDlgItem(Dialog,idshow),SW_SHOW);
+ ShowWindow(GetDlgItem(Dialog,idhide),SW_HIDE);
+
+ wnd:=GetDlgItem(Dialog,IDC_SCRIPT_HELP);
+ if ServiceExists(MS_VARS_FORMATSTRING)<>0 then
+ begin
+ SendMessage(wnd,BM_SETIMAGE,IMAGE_ICON,
+ CallService(MS_VARS_GETSKINITEM,0,VSI_HELPICON));
+ SendMessage(wnd,BUTTONADDTOOLTIP,
+ CallService(MS_VARS_GETSKINITEM,0,VSI_HELPTIPTEXT),0);
+{
+ SendMessage(wnd,BM_SETIMAGE,IMAGE_ICON,
+ CallService(MS_SKIN_LOADICON,SKINICON_OTHER_HELP,0));
+}
+ end
+ else
+ begin
+ ShowWindow(wnd,SW_HIDE);
+ end;
+ end;
+
+ WM_GETMINMAXINFO: begin
+ with PMINMAXINFO(lParam)^ do
+ begin
+ ptMinTrackSize.x:=200;
+ ptMinTrackSize.y:=180;
+ end;
+ end;
+
+ WM_SIZE: begin
+ FillChar(urd,SizeOf(TUTILRESIZEDIALOG),0);
+ urd.cbSize :=SizeOf(urd);
+ urd.hwndDlg :=Dialog;
+ urd.hInstance :=hInstance;
+ urd.lpTemplate:='IDD_EDITCONTROL';
+ urd.lParam :=0;
+ urd.pfnResizer:=@EditDlgResizer;
+ CallService(MS_UTILS_RESIZEDIALOG,0,tlparam(@urd));
+ end;
+
+ WM_COMMAND: begin
+ case wParam shr 16 of
+ BN_CLICKED: begin
+ btnwnd:=GetWindowLongPtrW(Dialog,GWLP_USERDATA);
+ ptr:=pUserData(GetWindowLongPtrW(btnwnd,GWLP_USERDATA));
+
+ case loword(wParam) of
+ IDC_TEXT_WRAP: begin
+ if IsDlgButtonChecked(Dialog,IDC_TEXT_WRAP)<>BST_UNCHECKED then
+ begin
+ ptr^.flags:=ptr^.flags or EF_WRAP;
+ idshow:=IDC_TEXT_EDIT_W;
+ idhide:=IDC_TEXT_EDIT_NW;
+ end
+ else
+ begin
+ ptr^.flags:=ptr^.flags and not EF_WRAP;
+ idshow:=IDC_TEXT_EDIT_NW;
+ idhide:=IDC_TEXT_EDIT_W;
+ end;
+ wnd :=GetDlgItem(Dialog,idhide);
+ wnd1:=GetDlgItem(Dialog,idshow);
+ pc:=GetDlgText(wnd);
+ SetDlgItemTextW(Dialog,idshow,pc);
+ mFreeMem(pc);
+ cr:=hiword(SendMessage(wnd,EM_GETSEL,0,0));
+ SendMessage(wnd1,EM_SETSEL,-1,cr);
+ ShowWindow(wnd1,SW_SHOW);
+ ShowWindow(wnd ,SW_HIDE);
+
+// SetWindowLongPtr(wnd,GWL_STYLE,GetWindowLongPtr(wnd,GWL_STYLE) xor WS_HSCROLL);
+// SetWindowLongPtr(wnd,GWL_STYLE,GetWindowLongPtr(wnd,GWL_STYLE) xor ES_AUTOHSCROLL);
+
+ end;
+
+ IDC_SCRIPT_HELP: begin
+ FillChar(vhi,SizeOf(vhi),0);
+ with vhi do
+ begin
+ cbSize:=SizeOf(vhi);
+ flags :=VHF_FULLDLG or VHF_SETLASTSUBJECT;
+ if (ptr^.flags and EF_WRAP)<>0 then
+ hwndCtrl:=GetDlgItem(Dialog,IDC_TEXT_EDIT_W)
+ else
+ hwndCtrl:=GetDlgItem(Dialog,IDC_TEXT_EDIT_NW);
+ end;
+ CallService(MS_VARS_SHOWHELPEX,Dialog,tlparam(@vhi));
+ end;
+
+ IDOK: begin
+ ptr^.flags:=ptr^.flags and not EF_ALL; // /clear changing flags
+ if IsDlgButtonChecked(Dialog,IDC_TEXT_SCRIPT)<>BST_UNCHECKED then
+ ptr^.flags:=ptr^.flags or EF_SCRIPT;
+ SetButtonTitle(btnwnd);
+ //??
+ if (ptr^.flags and EF_WRAP)<>0 then
+ pc:=GetDlgText(Dialog,IDC_TEXT_EDIT_W)
+ else
+ pc:=GetDlgText(Dialog,IDC_TEXT_EDIT_NW);
+ SendMessageW(ptr^.LinkedControl,WM_SETTEXT,0,tlParam(pc));
+ mFreeMem(pc);
+
+ // !! cheat
+ SendMessage(GetParent(ptr^.LinkedControl),WM_COMMAND,
+ (EN_CHANGE shl 16)+ptr^.LinkedCtrlId,ptr^.LinkedControl);
+
+ EndDialog(Dialog,1);
+ end;
+
+ IDCANCEL: begin // clear result / restore old value
+ EndDialog(Dialog,0);
+ end;
+ end;
+ end;
+ end;
+ end;
+{
+ WM_NOTIFY: begin
+ case integer(PNMHdr(lParam)^.code) of
+ PSN_APPLY: begin
+ end;
+ end;
+ end;
+}
+ end;
+end;
+
+//----- Edit button processing -----
+
+function EditControlProc(Dialog:HWnd;hMessage:uint;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+var
+ oldproc:pointer;
+ ptr:pUserData;
+begin
+ ptr:=pUserData(GetWindowLongPtrW(Dialog,GWLP_USERDATA));
+ oldproc:=ptr^.SavedProc;
+
+ case hMessage of
+ WM_DESTROY: begin
+ SetWindowLongPtrW(Dialog,GWLP_WNDPROC,long_ptr(oldproc));
+ mFreeMem(ptr);
+ end;
+
+ WM_INITDIALOG: begin
+ end;
+
+ WM_LBUTTONDOWN: begin
+ DialogBoxParamW(hInstance,'IDD_EDITCONTROL',GetParent(Dialog),@EditWndProc,Dialog);
+ result:=0;
+ exit;
+ end;
+ end;
+
+ result:=CallWindowProc(oldproc,Dialog,hMessage,wParam,lParam)
+end;
+
+function MakeEditField(Dialog:HWND; id:uint):HWND;
+var
+ rc,rcp:TRECT;
+ ctrl:HWND;
+ pu:pUserData;
+begin
+ ctrl:=GetDlgItem(Dialog,id);
+ GetWindowRect(ctrl,rc ); // screen coords
+ GetWindowRect(Dialog ,rcp); // screen coords of parent
+
+ result:=CreateWindowW('BUTTON',nil,WS_CHILD+WS_VISIBLE+BS_PUSHBUTTON+BS_CENTER+BS_VCENTER,
+ rc.left-rcp.left, rc.top-rcp.top+(rc.bottom-rc.top-16) div 2, 16,16,
+ Dialog,0,hInstance,nil);
+ if result<>0 then
+ begin
+ SetWindowLongPtrW(ctrl,GWLP_USERDATA,long_ptr(result));
+ mGetMem(pu,SizeOf(tUserData));
+ pu^.SavedProc :=pointer(SetWindowLongPtrW(result,GWL_WNDPROC,long_ptr(@EditControlProc)));
+ pu^.LinkedControl:=ctrl;
+ pu^.LinkedCtrlId :=id;
+ pu^.flags :=0;
+ SetWindowLongPtrW(result,GWLP_USERDATA,long_ptr(pu));
+ inc(rc.left,20);
+ MoveWindow(ctrl,
+ rc.left-rcp.left, rc.top-rcp.top, rc.right-rc.left, rc.bottom-rc.top,
+ false);
+ SetButtonTitle(result);
+ end;
+end;
+
+procedure SetEditFlags(wnd:HWND; mask, flags:dword);
+var
+ btnwnd:HWND;
+ pu:pUserData;
+begin
+ if mask<>0 then
+ begin
+ btnwnd:=GetWindowLongPtrW(wnd,GWLP_USERDATA);
+ if btnwnd<>0 then
+ begin
+ pu:=pUserData(GetWindowLongPtrW(btnwnd,GWLP_USERDATA));
+ pu^.flags:=pu^.flags and not mask;
+ pu^.flags:=pu^.flags or flags;
+ if (pu^.flags and EF_FORCES)<>0 then pu^.flags:=pu^.flags or EF_SCRIPT
+ else if (pu^.flags and EF_FORCET)<>0 then pu^.flags:=pu^.flags and not EF_SCRIPT;
+ SetButtonTitle(btnwnd);
+ end;
+ end;
+end;
+procedure SetEditFlags(Dialog:HWND; id:uint; mask, flags:dword);
+begin
+ SetEditFlags(GetDlgItem(Dialog,id),mask,flags);
+end;
+
+function GetEditFlags(wnd:HWND):dword;
+var
+ btnwnd:HWND;
+ pu:pUserData;
+begin
+ btnwnd:=GetWindowLongPtrW(wnd,GWLP_USERDATA);
+ if btnwnd<>0 then
+ begin
+ pu:=pUserData(GetWindowLongPtrW(btnwnd,GWLP_USERDATA));
+ result:=pu^.flags and EF_ALL;
+ end
+ else
+ result:=0;
+end;
+function GetEditFlags(Dialog:HWND; id:uint):dword;
+begin
+ result:=GetEditFlags(GetDlgItem(Dialog,id));
+end;
+
+function EnableEditField(wnd:HWND; enable:boolean):boolean;
+var
+ btnwnd:HWND;
+begin
+ btnwnd:=GetWindowLongPtrW(wnd,GWLP_USERDATA);
+ if btnwnd<>0 then
+ EnableWindow(btnwnd,enable);
+ result:=EnableWindow(wnd,enable);
+end;
+function EnableEditField(Dialog:HWND; id:uint; enable:boolean):boolean;
+begin
+ result:=EnableEditField(GetDlgItem(Dialog,id),enable);
+end;
+
+function ShowEditField(wnd:HWND; mode:integer):boolean;
+var
+ btnwnd:HWND;
+begin
+ btnwnd:=GetWindowLongPtrW(wnd,GWLP_USERDATA);
+ if btnwnd<>0 then
+ ShowWindow(btnwnd,mode);
+ result:=ShowWindow(wnd,mode);
+end;
+function ShowEditField(Dialog:HWND; id:uint; mode:integer):boolean;
+begin
+ result:=ShowEditField(GetDlgItem(Dialog,id),mode);
+end;
+
+end.
diff --git a/plugins/Utils.pas/editwrapper.rc b/plugins/Utils.pas/editwrapper.rc
new file mode 100644
index 0000000000..105a112119
--- /dev/null
+++ b/plugins/Utils.pas/editwrapper.rc
@@ -0,0 +1,26 @@
+#include "i_text_const.inc"
+
+LANGUAGE 0,0
+
+IDD_EDITCONTROL DIALOGEX 0, 0, 226,184, 0
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_VISIBLE | WS_THICKFRAME
+CAPTION "Text Editor"
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 0, 0
+{
+// COMBOBOX IDC_TYPE, 4, 4, 140, 56, CBS_DROPDOWNLIST | WS_VSCROLL
+ AUTOCHECKBOX "Script" , IDC_TEXT_SCRIPT, 4, 23, 142, 14
+ CONTROL "Help" ,IDC_SCRIPT_HELP ,"MButtonClass",WS_TABSTOP,206,22,16,16,$18000000 | WS_GROUP
+
+ EDITTEXT IDC_TEXT_EDIT_NW , 4, 40, 218, 124,
+ ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | WS_HSCROLL | WS_VSCROLL
+ EDITTEXT IDC_TEXT_EDIT_W, 4, 40, 218, 124,
+ ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN | WS_VSCROLL
+ AUTOCHECKBOX "Wrap Text", IDC_TEXT_WRAP, 4, 168, 116, 14
+
+ PUSHBUTTON "&OK" , IDOK , 124, 168, 46, 14
+ PUSHBUTTON "C&ancel", IDCANCEL, 176, 168, 46, 14
+}
+
+//IDI_TEXT ICON "ico\text.ico"
+//IDI_SCRIPT ICON "ico\script.ico"
diff --git a/plugins/Actman30/editwrapper.res b/plugins/Utils.pas/editwrapper.res
index a0019a92ae..a0019a92ae 100644
--- a/plugins/Actman30/editwrapper.res
+++ b/plugins/Utils.pas/editwrapper.res
Binary files differ
diff --git a/plugins/Utils.pas/mirutils.pas b/plugins/Utils.pas/mirutils.pas
index 6762f00866..e5a08ced1d 100644
--- a/plugins/Utils.pas/mirutils.pas
+++ b/plugins/Utils.pas/mirutils.pas
@@ -7,6 +7,7 @@ uses windows,m_api;
// for miranda services
const
+ rtUnkn = 0;
rtInt = 1;
rtWide = 2;
rtAnsi = 3;
@@ -109,7 +110,7 @@ begin
end
else
pc:=nil;
- CallService(MS_UTILS_PATHTOABSOLUTEW,wparam(src),lparam(dst));
+ PathToAbsoluteW(src,dst);
mFreeMem(pc);
end;
end;
@@ -139,7 +140,7 @@ begin
end
else
pc:=nil;
- CallService(MS_UTILS_PATHTOABSOLUTE,wparam(src),lparam(dst));
+ PathToAbsolute(src,dst);
mFreeMem(pc);
end;
end;
@@ -301,8 +302,7 @@ var
tmp:pWideChar;
begin
mGetMem(tmp,(StrLen(sz)+1)*SizeOf(WideChar));
- Result:=PWideChar(CallService(MS_LANGPACK_TRANSLATESTRING,LANG_UNICODE,
- lParam(FastAnsiToWideBuf(sz,tmp))));
+ Result:=TranslateW(FastAnsiToWideBuf(sz,tmp));
if Result<>tmp then
begin
StrDupW(Result,Result);
@@ -489,7 +489,7 @@ begin
begin
if path<>nil then
begin
- CallService(MS_UTILS_PATHTOABSOLUTE,wparam(path),lparam(@buf));
+ PathToAbsolute(path,buf);
p:=StrEnd(buf);
if p^<>'\' then
begin
@@ -743,16 +743,15 @@ begin
if proto<>nil then
proto^:=#0;
end;
-
end;
// Import plugin function adaptation
function CreateGroupW(name:pWideChar;hContact:THANDLE):integer;
var
- groupId, res:integer;
+ groupId:integer;
groupIdStr:array [0..10] of AnsiChar;
grbuf:array [0..127] of WideChar;
- p, pw:pWideChar;
+ p:pWideChar;
begin
if (name=nil) or (name^=#0) then
begin
@@ -766,21 +765,21 @@ begin
// Check for duplicate & find unused id
groupId:=0;
repeat
- pw:=DBReadUnicode(0,'CListGroups',IntToStr(groupIdStr,groupId));
- if pw=nil then
+ p:=DBReadUnicode(0,'CListGroups',IntToStr(groupIdStr,groupId));
+ if p=nil then
break;
- res:=StrCmpW(pw+1,@grbuf[1]);
- mFreeMem(pw);
- if res=0 then
+ if StrCmpW(p+1,@grbuf[1])=0 then
begin
if hContact<>0 then
DBWriteUnicode(hContact,strCList,clGroup,@grbuf[1]);
+ mFreeMem(p);
result:=0;
exit;
end;
+ mFreeMem(p);
inc(groupId);
until false;