diff options
author | Alexey Kulakov <panda75@bk.ru> | 2014-01-15 21:21:49 +0000 |
---|---|---|
committer | Alexey Kulakov <panda75@bk.ru> | 2014-01-15 21:21:49 +0000 |
commit | 0cfbb97047e562b9d19d201c61a94da79d3d2bd8 (patch) | |
tree | 5207ac96529dea4e7f84187a92c27a63cc642a0d /plugins/QuickSearch/sr_optdialog.pas | |
parent | 56dbdaf5d7855632eeea4cfe820531bc24b09ee0 (diff) |
updated to 1.4.2.0
git-svn-id: http://svn.miranda-ng.org/main/trunk@7672 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/QuickSearch/sr_optdialog.pas')
-rw-r--r-- | plugins/QuickSearch/sr_optdialog.pas | 1439 |
1 files changed, 718 insertions, 721 deletions
diff --git a/plugins/QuickSearch/sr_optdialog.pas b/plugins/QuickSearch/sr_optdialog.pas index 0bdb9e444c..a161fd28dc 100644 --- a/plugins/QuickSearch/sr_optdialog.pas +++ b/plugins/QuickSearch/sr_optdialog.pas @@ -3,36 +3,42 @@ unit sr_optdialog; interface
uses windows;
-{.$include resource.inc}
-
-procedure OptChangeColumns(code:integer;column,data:integer);
function DlgProcOptions(Dialog:HWnd;hMessage:UINT;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
-const
- maindlg:HWND = 0;
-
implementation
-uses messages,commctrl,sr_global,m_api,common,mirutils,wrapper,sr_window;
+uses
+ messages,commctrl,
+ m_api,common,mirutils,wrapper,dbsettings,
+ sr_global,sr_window,
+ sparam,editwrapper,srvblock;
var
OldListProc:pointer;
-const
- curscript:pointer=nil;
+var
+ ServiceBlock:HWND; // single copy, can make it global
+var
+ editcolumns:array [0..MaxColumnAmount-1] of tcolumnitem;
const
- stByte :PAnsiChar = 'Byte';
- stWord :PAnsiChar = 'Word';
- stInt :PAnsiChar = 'Int';
- stString :PAnsiChar = 'String';
- stLastSeen :PAnsiChar = 'LastSeen';
- stIP :PAnsiChar = 'IP';
- stContactInfo:PAnsiChar = 'ContactInfo';
- stLastEvent :PAnsiChar = 'LastEvent';
- stTimeStamp :PAnsiChar = 'TimeStamp';
- stService :PAnsiChar = 'Service';
- stScript :PAnsiChar = 'Script';
- stMetacontact:PAnsiChar = 'Metacontact';
+ stByte :PWideChar = 'Byte';
+ stWord :PWideChar = 'Word';
+ stDWord :PWideChar = 'DWord';
+ stSigned :PWideChar = 'Signed';
+ stHexnum :PWideChar = 'As hex';
+ stString :PWideChar = 'String';
+ stLastSeen :PWideChar = 'LastSeen';
+ stIP :PWideChar = 'IP';
+ stContactInfo:PWideChar = 'ContactInfo';
+ stLastEvent :PWideChar = 'LastEvent';
+ stTimeStamp :PWideChar = 'TimeStamp';
+ stService :PWideChar = 'Service';
+ stScript :PWideChar = 'Script';
+ stMetacontact:PWideChar = 'Metacontact';
+ stEventCount :PWideChar = 'EventCount';
+
+ stSetting :PWideChar = 'DB setting';
+ stOther :PWideChar = 'Other';
const
cnFirstName = 'FIRSTNAME' ;
@@ -57,80 +63,23 @@ const cnBirthday = 'BIRTHDAY' ;
cnBirthMonth = 'BIRTHMONTH';
cnBirthYear = 'BIRTHYEAR' ;
- cnZIP = 'ZIP' ;
cnStreet = 'STREET' ;
+ cnZIP = 'ZIP' ;
cnLanguage1 = 'LANGUAGE1' ;
cnLanguage2 = 'LANGUAGE2' ;
cnLanguage3 = 'LANGUAGE3' ;
cnCoName = 'CONAME' ;
-
-const
- strNotSelected = 'Not Selected';
-
-const
- MaxControls = 13;
- aIdElement:array [0..MaxControls-1] of integer = (
- IDC_SCRIPT, IDC_STAT_VARTYPE, IDC_C_CNFTYPE, IDC_C_RESULT,
- IDC_STAT_SERVICE, IDC_STAT_MODULE, IDC_E_MODULE,
- IDC_STAT_WPAR, IDC_STAT_SETTING, IDC_E_VAR,
- IDC_C_WPAR, IDC_E_LPAR, IDC_C_LPAR);
-
- aShowElement:array [0..ST_MAXTYPE,0..MaxControls-1] of byte = (
-{ST_BYTE } ($00, $80, $80, $00, $00, $81, $81, $00, $81, $81, $80, $80, $80),
-{ST_WORD } ($00, $80, $80, $00, $00, $81, $81, $00, $81, $81, $80, $80, $80),
-{ST_INT } ($00, $80, $80, $00, $00, $81, $81, $00, $81, $81, $80, $80, $80),
-{ST_STRING } ($00, $80, $80, $00, $00, $81, $81, $00, $81, $81, $80, $80, $80),
-{ST_IP } ($00, $80, $80, $00, $00, $81, $81, $00, $81, $81, $80, $80, $80),
-{ST_LASTSEEN } ($00, $80, $80, $00, $00, $81, $81, $00, $81, $81, $80, $80, $80),
-{ST_CONTACTINFO} ($00, $81, $81, $00, $00, $80, $80, $00, $80, $80, $80, $80, $80),
-{ST_LASTEVENT } ($00, $80, $80, $00, $00, $80, $80, $00, $80, $80, $80, $80, $80),
-{ST_TIMESTAMP } ($00, $80, $80, $00, $00, $81, $81, $00, $81, $81, $80, $80, $80),
-{ST_SERVICE } ($00, $80, $00, $81, $81, $00, $81, $81, $00, $81, $81, $81, $81),
-{ST_SCRIPT } ($81, $00, $00, $00, $00, $80, $80, $00, $80, $80, $80, $80, $80),
-{ST_METACONTACT} ($00, $80, $80, $00, $00, $80, $80, $00, $80, $80, $80, $80, $80));
-
-procedure SetupControls(Dialog:HWND; aType:integer);
-var
- i,j: cardinal;
- wnd:HWND;
-begin
- for i:=0 to MaxControls-1 do
- begin
- j :=aShowElement[aType][i];
- wnd:=GetDlgItem(Dialog,aIdElement[i]);
- EnableWindow(wnd,odd(j));
- if shortint(j)<0 then
- j:=SW_SHOW
- else
- j:=SW_HIDE;
- ShowWindow(wnd,j);
- end;
-end;
-
-function settype2str(settype:integer):pointer;
-var
- tmp:array [0..127] of WideChar;
-begin
- case settype of
-// ST_BYTE: result:=stByte;
- ST_WORD: result:=stWord;
- ST_INT: result:=stInt;
- ST_STRING: result:=stString;
- ST_LASTSEEN: result:=stLastSeen;
- ST_IP: result:=stIP;
- ST_CONTACTINFO: result:=stContactInfo;
- ST_LASTEVENT: result:=stLastEvent;
- ST_TIMESTAMP: result:=stTimeStamp;
- ST_SERVICE: result:=stService;
- ST_SCRIPT: result:=stScript;
- ST_METACONTACT: result:=stMetacontact;
- else
- result:=stByte;
- end;
-
- FastAnsiToWideBuf(result,tmp);
- StrDupW(pWideChar(result),TranslateW(tmp));
-end;
+ cnCoDept = 'CODEPT' ;
+ cnCoPosition = 'COPOSITION';
+ cnCoStreet = 'COSTREET' ;
+ cnCoCity = 'COCITY' ;
+ cnCoState = 'COSTATE' ;
+ cnCoZIP = 'COZIP' ;
+ cnCoCountry = 'COCOUNTRY' ;
+ cnCoHomepage = 'COHOMEPAGE';
+ cnDisplayUID = 'DISPLAYUID';
+
+//----- Contact info -----
function setcnftype2str(settype:integer):PWideChar;
var
@@ -166,451 +115,395 @@ begin CNF_LANGUAGE2: res:=cnLanguage2 ;
CNF_LANGUAGE3: res:=cnLanguage3 ;
CNF_CONAME: res:=cnCoName ;
+ CNF_CODEPT: res:=cnCoDept ;
+ CNF_COPOSITION: res:=cnCoPosition;
+ CNF_COSTREET: res:=cnCoStreet ;
+ CNF_COCITY: res:=cnCoCity ;
+ CNF_COSTATE: res:=cnCoState ;
+ CNF_COZIP: res:=cnCoZIP ;
+ CNF_COCOUNTRY: res:=cnCoCountry ;
+ CNF_COHOMEPAGE: res:=cnCoHomepage;
+ CNF_DISPLAYUID: res:=cnDisplayUID;
else
res:=cnFirstName;
end;
result:=TranslateW(res);
end;
-procedure addcolumn(handle:hwnd;width:word;title:PAnsiChar);
-var
- lvcol:LV_COLUMNW;
- buf:array [0..127] of WideChar;
+procedure AddCnf(list:HWND;param:integer);
begin
- lvcol.mask:=LVCF_TEXT or LVCF_WIDTH;
- lvcol.cx :=width;
- lvcol.pszText:=TranslateW(FastAnsiToWideBuf(title,buf));
- SendMessageW(handle,LVM_INSERTCOLUMNW,0,lparam(@lvcol));
+// CB_AddStrDataW(list,setcnftype2str(param),param);
+ SendMessage(list,CB_SETITEMDATA,
+ SendMessageW(list,CB_ADDSTRING,0,lparam(setcnftype2str(param))),
+ param);
end;
-function getselecteditem(list:hwnd):integer;
+procedure addsetcnftypes(list:hwnd);
begin
- result:=SendMessage(list,LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
-end;
+ AddCnf(list,CNF_FIRSTNAME);
+ AddCnf(list,CNF_LASTNAME);
+ AddCnf(list,CNF_NICK);
+ AddCnf(list,CNF_CUSTOMNICK);
+ AddCnf(list,CNF_EMAIL);
+ AddCnf(list,CNF_CITY);
+ AddCnf(list,CNF_STATE);
+ AddCnf(list,CNF_COUNTRY);
+ AddCnf(list,CNF_PHONE);
+ AddCnf(list,CNF_HOMEPAGE);
+ AddCnf(list,CNF_ABOUT);
+ AddCnf(list,CNF_GENDER);
+ AddCnf(list,CNF_AGE);
+ AddCnf(list,CNF_FIRSTLAST);
+ AddCnf(list,CNF_UNIQUEID);
-function savecuritem(Dialog:hwnd):integer;
-var
- listhwnd:hwnd;
- selitem:integer;
+ AddCnf(list,CNF_FAX);
+ AddCnf(list,CNF_CELLULAR);
+ AddCnf(list,CNF_TIMEZONE);
+ AddCnf(list,CNF_MYNOTES);
+ AddCnf(list,CNF_BIRTHDAY);
+ AddCnf(list,CNF_BIRTHMONTH);
+ AddCnf(list,CNF_BIRTHYEAR);
+ AddCnf(list,CNF_STREET);
+ AddCnf(list,CNF_ZIP);
+ AddCnf(list,CNF_LANGUAGE1);
+ AddCnf(list,CNF_LANGUAGE2);
+ AddCnf(list,CNF_LANGUAGE3);
+ AddCnf(list,CNF_CONAME);
+ AddCnf(list,CNF_CODEPT);
+ AddCnf(list,CNF_COPOSITION);
+ AddCnf(list,CNF_COSTREET);
+ AddCnf(list,CNF_COCITY);
+ AddCnf(list,CNF_COSTATE);
+ AddCnf(list,CNF_COZIP);
+ AddCnf(list,CNF_COCOUNTRY);
+ AddCnf(list,CNF_COHOMEPAGE);
+ AddCnf(list,CNF_DISPLAYUID);
- procedure GetText(id,subpos:integer;var dst:PAnsiChar); overload;
- var
- tpc:array [0..1023] of AnsiChar;
- begin
- GetDlgItemTextA(Dialog,id,tpc,SizeOf(tpc));
- mFreeMem(dst);
- StrDup(dst,tpc);
- LV_SetItem(listhwnd,dst,selitem,subpos);
- end;
+ SendMessage(list,CB_SETCURSEL,0,0);
+end;
- // now for Title only
- procedure GetText(id,subpos:integer;var dst:PWideChar); overload;
- var
- tpc:array [0..1023] of WideChar;
- begin
- GetDlgItemTextW(Dialog,id,@tpc,SizeOf(tpc) div SizeOf(WideChar));
- mFreeMem(dst);
- StrDupW(dst,@tpc);
- LV_SetItemW(listhwnd,dst,selitem,subpos);
- end;
- procedure setparam(var param:tserviceparam;cb,id:integer);
- var
- z:bool;
- tpc:array [0..1023] of WideChar;
- begin
- param._type:=SendDlgItemMessage(Dialog,cb,CB_GETCURSEL,0,0);
- case param._type of
- ptNumber: param.n:=GetDlgItemInt(Dialog,id,z,false);
- ptInteger: param.i:=GetDlgItemInt(Dialog,id,z,true);
- ptString: begin
- GetDlgItemTextA(Dialog,id,@tpc,SizeOf(tpc));
- StrDup(param.a,@tpc);
- end;
- ptUnicode: begin
- GetDlgItemTextW(Dialog,id,@tpc,SizeOf(tpc) div SizeOf(WideChar));
- StrDupW(param.w,@tpc);
- end;
- end;
- end;
+function GetSelectedItem(list:hwnd):integer;
+begin
+ result:=SendMessage(list,LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
+end;
-var
- tpc :array [0..127] of WideChar;
- tmpwnd:HWND;
- oldtype,i:integer;
- column:integer;
+//----- Common interface -----
+
+function IconChanged(wParam:WPARAM;lParam:LPARAM;lParam1:LPARAM):int;cdecl;
begin
- listhwnd:=GetDlgItem(Dialog,IDC_LIST);
- selitem:=getselecteditem(listhwnd);
-//!! column:=LV_GetLParam(listhwnd,selitem);
- column:=selitem;
- result:=selitem;
- if (selitem>=0) and (selitem<qsopt.numcolumns) then
- begin
- with qsopt.columns[column] do
- begin
- flags:=0;
+ result:=0;
+ SetButtonIcon(GetDlgItem(lParam1,IDC_NEW ),QS_NEW);
+ SetButtonIcon(GetDlgItem(lParam1,IDC_UP ),QS_UP);
+ SetButtonIcon(GetDlgItem(lParam1,IDC_DN ),QS_DOWN);
+ SetButtonIcon(GetDlgItem(lParam1,IDC_DELETE ),QS_DELETE);
+ SetButtonIcon(GetDlgItem(lParam1,IDC_DEFAULT),QS_DEFAULT);
+ SetButtonIcon(GetDlgItem(lParam1,IDC_RELOAD ),QS_RELOAD);
+end;
- if ListView_GetCheckState(listhwnd,selitem)=BST_CHECKED then
- flags:=flags or COL_ON;
+procedure CheckDirection(Dialog:HWND;item:integer);
+begin
+ EnableWindow(GetDlgItem(Dialog,IDC_UP),item>0);
- oldtype:=setting_type;
+ EnableWindow(GetDlgItem(Dialog,IDC_DN),
+ item<(SendMessage(GetDlgItem(Dialog,IDC_LIST),LVM_GETITEMCOUNT,0,0)-1));
+end;
- tmpwnd:=GetDlgItem(Dialog,IDC_C_VARTYPE);
+//----- Basic screen functions -----
- setting_type:=SendMessage(tmpwnd,CB_GETITEMDATA,
- SendMessage(tmpwnd,CB_GETCURSEL,0,0),0);
+procedure InitScreen(Dialog:HWND);
+begin
+ // setting
+ SendMessage(GetDlgItem(Dialog,IDC_C_DATATYPE),CB_SETCURSEL,0,0);
+ SetDlgItemTextW(Dialog,IDC_E_MODULE ,nil);
+ SetDlgItemTextW(Dialog,IDC_E_SETTING,nil);
+ // script
+ SetDlgItemTextW(Dialog,IDC_E_SCRIPT,nil);
+ // service
+ ClearServiceBlock(ServiceBlock);
+ // contact info
+ SendMessage(GetDlgItem(Dialog,IDC_C_CNFTYPE),CB_SETCURSEL,0,0);
+ // others
+ SendMessage(GetDlgItem(Dialog,IDC_C_OTHER),CB_SETCURSEL,0,0);
+end;
- GetText(IDC_E_TITLE,1,title);
+procedure ClearScreen(Dialog:HWND);
+begin
+ // setting
+ ShowWindow(GetDlgItem(Dialog,IDC_S_DATATYPE),SW_HIDE);
+ ShowWindow(GetDlgItem(Dialog,IDC_C_DATATYPE),SW_HIDE);
+ ShowWindow(GetDlgItem(Dialog,IDC_S_MODULE ),SW_HIDE);
+ ShowWindow(GetDlgItem(Dialog,IDC_E_MODULE ),SW_HIDE);
+ ShowWindow(GetDlgItem(Dialog,IDC_S_SETTING ),SW_HIDE);
+ ShowWindow(GetDlgItem(Dialog,IDC_E_SETTING ),SW_HIDE);
+
+ // script
+ ShowEditField(Dialog,IDC_E_SCRIPT,SW_HIDE);
+
+ // service
+ ShowWindow(ServiceBlock,SW_HIDE);
+
+ // contact info
+ ShowWindow(GetDlgItem(Dialog,IDC_S_CNFTYPE),SW_HIDE);
+ ShowWindow(GetDlgItem(Dialog,IDC_C_CNFTYPE),SW_HIDE);
+
+ // others
+ ShowWindow(GetDlgItem(Dialog,IDC_C_OTHER),SW_HIDE);
+end;
- case oldtype of
- ST_SCRIPT: begin
- mFreeMem(wparam.a);
- end;
- ST_SERVICE: begin
- if (wparam._type=ptString) or (wparam._type=ptUnicode) then mFreeMem(wparam.a);
- if (lparam._type=ptString) or (lparam._type=ptUnicode) then mFreeMem(lparam.a);
- end;
- else
- mFreeMem(wparam.a);
- end;
+procedure SetupScreen(Dialog:HWND;code:integer);
+begin
+ if not IsWindowVisible(GetDlgItem(Dialog,IDC_E_TITLE)) then
+ exit;
- case setting_type of
- ST_METACONTACT: begin
- LV_SetItemW(listhwnd,TranslateW('Metacontact'),selitem,2);
- end;
+ case code of
+ // setting
+ QST_SETTING: begin
+ ShowWindow(GetDlgItem(Dialog,IDC_S_DATATYPE),SW_SHOW);
+ ShowWindow(GetDlgItem(Dialog,IDC_C_DATATYPE),SW_SHOW);
+ ShowWindow(GetDlgItem(Dialog,IDC_S_MODULE ),SW_SHOW);
+ ShowWindow(GetDlgItem(Dialog,IDC_E_MODULE ),SW_SHOW);
+ ShowWindow(GetDlgItem(Dialog,IDC_S_SETTING ),SW_SHOW);
+ ShowWindow(GetDlgItem(Dialog,IDC_E_SETTING ),SW_SHOW);
+ end;
- ST_SCRIPT: begin
- StrDupW(wparam.w,curscript);
- LV_SetItemW(listhwnd,TranslateW('Script'),selitem,2);
- end;
+ // script
+ QST_SCRIPT: begin
+ ShowEditField(Dialog,IDC_E_SCRIPT,SW_SHOW);
+ end;
- ST_CONTACTINFO: begin
- FillChar(tpc,SizeOf(tpc),0);
- tmpwnd:=GetDlgItem(Dialog,IDC_C_CNFTYPE);
+ // service
+ QST_SERVICE: begin
+ ShowWindow(ServiceBlock,SW_SHOW);
+ end;
- i:=SendMessage(tmpwnd,CB_GETCURSEL,0,0);
- setting_cnftype:=SendMessage(tmpwnd,CB_GETITEMDATA,i,0);
+ // contact info
+ QST_CONTACTINFO: begin
+ ShowWindow(GetDlgItem(Dialog,IDC_S_CNFTYPE),SW_SHOW);
+ ShowWindow(GetDlgItem(Dialog,IDC_C_CNFTYPE),SW_SHOW);
+ end;
- SendMessageW(tmpwnd,CB_GETLBTEXT,i,tlparam(@tpc));
- LV_SetItemW(listhwnd,tpc,selitem,2);
- end;
+ // others
+ QST_OTHER: begin
+ ShowWindow(GetDlgItem(Dialog,IDC_C_OTHER),SW_SHOW);
+ end;
+ end;
+end;
- ST_SERVICE: begin
- GetText(IDC_E_MODULE,3,module_name);
- LV_SetItemW(listhwnd,TranslateW('Service'),selitem,2);
-//!! setitem(listhwnd,selitem,3,module_name);
+//----- single column processing -----
- setting_cnftype:=SendDlgItemMessage(Dialog,IDC_C_RESULT,CB_GETCURSEL,0,0);
- setparam(wparam,IDC_C_WPAR,IDC_E_VAR);
- setparam(lparam,IDC_C_LPAR,IDC_E_LPAR);
+procedure FillTableLine(list:HWND;item:integer;const column:tcolumnitem);
+begin
+ LV_SetItemW(list,column.title,item,1);
+ case column.setting_type of
+ QST_SETTING: begin
+ LV_SetItem(list,column.module ,item,2);
+ LV_SetItem(list,column.setting,item,3);
+ end;
+ QST_SCRIPT: begin
+ LV_SetItemW(list,TranslateW('Script'),item,2);
+// LV_SetItemW(list,column.script,item,3);
+ end;
+ QST_SERVICE: begin
+ LV_SetItemW(list,TranslateW('Service'),item,2);
+ LV_SetItem (list,column.service ,item,3);
+ end;
+ QST_CONTACTINFO: begin
+ LV_SetItemW(list,TranslateW('Contact info') ,item,2);
+ LV_SetItemW(list,setcnftype2str(column.cnftype),item,3);
+ end;
+ QST_OTHER: begin
+ case column.other of
+ QSTO_METACONTACT: begin
+ LV_SetItemW(list,TranslateW('Metacontact'),item,2);
end;
- else
- GetText(IDC_E_MODULE,2,module_name);
- GetText(IDC_E_VAR ,3,wparam.a)
end;
end;
end;
end;
-procedure disable_elem(Dialog:hwnd;id:cardinal);
+function savecuritem(Dialog:hwnd):integer;
+var
+ list:HWND;
+ srvalue:tServiceValue;
+ i:integer;
+ idx,lwidth:integer;
begin
- EnableWindow(GetDlgItem(Dialog,id),FALSE);
-end;
+ list:=GetDlgItem(Dialog,IDC_LIST);
+ i:=GetSelectedItem(list);
+ idx:=LV_GetLParam(list,i);
+ result:=idx;
+
+ lwidth:=editcolumns[idx].width;
+ clear_column(editcolumns[idx]);
+ with editcolumns[idx] do
+ begin
+ flags:=0;
-procedure enable_elem(Dialog:hwnd;id:cardinal);
-begin
- EnableWindow(GetDlgItem(Dialog,id),TRUE);
-end;
+ if ListView_GetCheckState(list,i)=BST_CHECKED then
+ flags:=flags or COL_ON;
-procedure CheckDirection(Dialog:HWND;item:integer);
-begin
- if item=0 then
- disable_elem(Dialog,IDC_UP)
- else
- enable_elem(Dialog,IDC_UP);
+ setting_type:=CB_GetData(GetDlgItem(Dialog,IDC_C_VARTYPE));
+
+ title:=GetDlgText(Dialog,IDC_E_TITLE);
+ width:=lwidth;
- if item=(qsopt.numcolumns-1) then
- disable_elem(Dialog,IDC_DN)
- else
- enable_elem(Dialog,IDC_DN);
-end;
+ case setting_type of
+ QST_SETTING: begin
+ datatype:=CB_GetData(GetDlgItem(Dialog,IDC_C_DATATYPE));
+ module :=GetDlgText(Dialog,IDC_E_MODULE ,true);
+ setting :=GetDlgText(Dialog,IDC_E_SETTING,true);
+ end;
+
+ QST_SCRIPT: begin
+ script:=GetDlgText(Dialog,IDC_E_SCRIPT);
+ end;
-procedure displcurinfo(Dialog:hwnd;column:integer);
+ QST_CONTACTINFO: begin
+ cnftype:=CB_GetData(GetDlgItem(Dialog,IDC_C_CNFTYPE));
+ end;
- procedure set_elem(const param:tserviceparam;cb,id:integer);
- begin
- SendDlgItemMessage(Dialog,cb,CB_SETCURSEL,param._type,0);
- case param._type of
- ptNumber: SetDlgItemInt (Dialog,id,param.n,false);
- ptInteger: SetDlgItemInt (Dialog,id,param.i,true);
- ptString: SetDlgItemTextA(Dialog,id,param.a);
- ptUnicode: SetDlgItemTextW(Dialog,id,param.w);
- else
- SetDlgItemTextA(Dialog,id,'');
+ QST_SERVICE: begin
+ GetSrvBlockValue(ServiceBlock,srvalue);
+ service :=srvalue.service;
+ wparam.value:=uint_ptr(srvalue.wparam);
+ wparam._type:=srvalue.w_flag;
+ lparam.value:=uint_ptr(srvalue.lparam);
+ lparam._type:=srvalue.l_flag;
+ restype :=srvalue.flags;
+ end;
+
+ QST_OTHER: begin
+ other:=CB_GetData(GetDlgItem(Dialog,IDC_C_OTHER));
+ end;
end;
- EnableWindow(GetDlgItem(Dialog,id),param._type<>ptCurrent);
end;
+ FillTableLine(list,i,editcolumns[idx]);
+end;
+procedure displcurinfo(Dialog:HWND;const column:tcolumnitem);
var
- v:PWideChar;
- i:int_ptr;
- selpos:integer;
+ srvalue:tServiceValue;
begin
- CheckDirection(Dialog,column);
+ ClearScreen(Dialog);
+ SetupScreen(Dialog,column.setting_type);
- selpos:=column;
- if (selpos>=0) and (selpos<qsopt.numcolumns) then
- begin
- enable_elem(Dialog,IDC_E_TITLE);
- enable_elem(Dialog,IDC_C_VARTYPE);
- enable_elem(Dialog,IDC_DELETE);
-// enable_elem(Dialog,IDC_SETITEM);
+ SetDlgItemTextW(Dialog,IDC_E_TITLE,column.title);
+ CB_SelectData(Dialog,IDC_C_VARTYPE,column.setting_type);
- with qsopt.columns[column] do
- begin
- SetupControls(Dialog,setting_type);
- case setting_type of
- ST_SCRIPT: begin
- mFreeMem(curscript);
- StrDupW(pWideChar(curscript),wparam.w);
- end;
- ST_SERVICE: begin
- SendDlgItemMessage(Dialog,IDC_C_RESULT,CB_SETCURSEL,setting_cnftype,0);
- SetDlgItemTextA(Dialog,IDC_E_MODULE,module_name);
- set_elem(wparam,IDC_C_WPAR,IDC_E_VAR);
- set_elem(lparam,IDC_C_LPAR,IDC_E_LPAR);
- end;
- ST_CONTACTINFO: begin
- i:=int_ptr(setcnftype2str(setting_cnftype));
- SendDlgItemMessageW(Dialog,IDC_C_CNFTYPE,CB_SELECTSTRING,twparam(-1),i);
- end;
- else
- SetDlgItemTextA(Dialog,IDC_E_MODULE,module_name);
- SetDlgItemTextA(Dialog,IDC_E_VAR,wparam.a);
- end;
+ case column.setting_type of
+ QST_SETTING: begin
+ CB_SelectData (Dialog,IDC_C_DATATYPE,column.datatype);
+ SetDlgItemTextA(Dialog,IDC_E_MODULE ,column.module);
+ SetDlgItemTextA(Dialog,IDC_E_SETTING ,column.setting);
+ end;
- v:=settype2str(setting_type);
- SetDlgItemTextW(Dialog,IDC_E_TITLE,title);
- SendDlgItemMessageW(Dialog,IDC_C_VARTYPE,CB_SELECTSTRING,twparam(-1),tlparam(v));
- mFreeMem(v);
+ QST_SCRIPT: begin
+ SetDlgItemTextW(Dialog,IDC_E_SCRIPT,column.script);
+ end;
+
+ QST_SERVICE: begin
+ srvalue.service:=column.service;
+ srvalue.wparam :=pointer(column.wparam.value);
+ srvalue.w_flag :=column.wparam._type;
+ srvalue.lparam :=pointer(column.lparam.value);
+ srvalue.l_flag :=column.lparam._type;
+ srvalue.flags :=column.restype;
+ SetSrvBlockValue(ServiceBlock,srvalue);
+ end;
+
+ QST_CONTACTINFO: begin
+ CB_SelectData(Dialog,IDC_C_CNFTYPE,column.cnftype);
+ end;
+
+ QST_OTHER: begin
+ CB_SelectData(Dialog,IDC_C_OTHER,column.other);
end;
- end
- else
- begin
- disable_elem(Dialog,IDC_E_TITLE);
- disable_elem(Dialog,IDC_C_VARTYPE);
- disable_elem(Dialog,IDC_DELETE);
- disable_elem(Dialog,IDC_SETITEM);
-
- v:=TranslateW(strNotSelected);
- SetDlgItemTextW(Dialog,IDC_E_TITLE ,v);
- SetDlgItemTextW(Dialog,IDC_E_MODULE,v);
- SetDlgItemTextW(Dialog,IDC_E_VAR ,v);
- SetDlgItemTextW(Dialog,IDC_E_LPAR ,v);
- SendDlgItemMessageW(Dialog,IDC_C_VARTYPE,CB_SELECTSTRING,twparam(-1),tlparam(v));
- SendDlgItemMessageW(Dialog,IDC_C_CNFTYPE,CB_SELECTSTRING,twparam(-1),tlparam(v));
end;
end;
-function add_column(list:HWND;i:integer):integer;
+function add_column(list:HWND;i,idx:integer):integer;
var
li:LV_ITEMA;
begin
result:=i;
zeromemory(@li,sizeof(li));
li.mask :=LVIF_PARAM;
- li.lParam:=i;
+ li.lParam:=idx;
li.iItem :=i;
SendMessage(list,LVM_INSERTITEM,0,lparam(@li));
-
- with qsopt.columns[i] do
- begin
- ListView_SetCheckState(list,i,(flags and COL_ON)<>0);
- LV_SetItemW(list,title,i,1);
- case setting_type of
- ST_METACONTACT: begin
- LV_SetItemW(list,TranslateW('Metacontact'),i,2);
- end;
-
- ST_CONTACTINFO: begin
- LV_SetItemW(list,setcnftype2str(setting_cnftype),i,2)
- end;
-
- ST_SCRIPT: begin
- LV_SetItemW(list,TranslateW('Script'),i,2);
- end;
-
- ST_SERVICE: begin
- LV_SetItemW(list,TranslateW('Service'),i,2);
- LV_SetItem(list,module_name,i,3);
- end;
- else
- LV_SetItem(list,module_name,i,2);
- LV_SetItem(list,wparam.a,i,3);
- end;
- end;
end;
procedure update_list(list:hwnd);
var
- i:integer;
+ i,cnt:integer;
begin
ListView_DeleteAllItems(list);
- ListView_SetItemCount(list,qsopt.numcolumns);
- for i:=0 to qsopt.numcolumns-1 do
+ cnt:=0;
+ for i:=0 to MaxColumnAmount-1 do
begin
- add_column(list,i);
+ if editcolumns[i].setting_type<>0 then
+ begin
+ add_column(list,cnt,i);
+ FillTableLine(list,cnt,editcolumns[i]);
+ ListView_SetCheckState(list,cnt,(editcolumns[i].flags and COL_ON)<>0);
+ inc(cnt);
+ end;
end;
-//!! SortColumns(list);
- ListView_SetItemState(list,0,LVIS_FOCUSED or LVIS_SELECTED,
- LVIS_FOCUSED or LVIS_SELECTED);
-end;
-procedure addresulttypes(list:integer);
-begin
- SendMessageW(list,CB_INSERTSTRING,ptNumber ,lparam(TranslateW('number value' )));
- SendMessageW(list,CB_INSERTSTRING,ptInteger,lparam(TranslateW('integer value' )));
- SendMessageW(list,CB_INSERTSTRING,ptString ,lparam(TranslateW('ANSI string' )));
- SendMessageW(list,CB_INSERTSTRING,ptUnicode,lparam(TranslateW('Unicode string')));
- SendMessage(list,CB_SETCURSEL,0,0);
+ ListView_SetItemState(list,0,
+ LVIS_FOCUSED or LVIS_SELECTED,
+ LVIS_FOCUSED or LVIS_SELECTED);
end;
-procedure addparamtypes(list:integer);
-begin
- addresulttypes(list);
- SendMessageW(list,CB_INSERTSTRING,ptCurrent,lparam(TranslateW('current contact')));
-end;
+// fill comboboxes lists
-procedure AddVal(list:HWND;param:integer);
-var
- i:integer;
- v:pointer;
+procedure adddbsettypes(list:hwnd);
begin
- v:=settype2str(param);
- i:=SendMessageW(list,CB_ADDSTRING,0,lparam(v));
- mFreeMem(v);
- SendMessage(list,CB_SETITEMDATA,i,param);
-end;
+ CB_AddStrDataW(list,stByte ,QSTS_BYTE);
+ CB_AddStrDataW(list,stWord ,QSTS_WORD);
+ CB_AddStrDataW(list,stDword ,QSTS_DWORD);
+ CB_AddStrDataW(list,stSigned ,QSTS_SIGNED);
+ CB_AddStrDataW(list,stHexnum ,QSTS_HEXNUM);
+ CB_AddStrDataW(list,stString ,QSTS_STRING);
+ CB_AddStrDataW(list,stIP ,QSTS_IP);
+ CB_AddStrDataW(list,stTimeStamp,QSTS_TIMESTAMP);
-procedure addsettypes(list:hwnd);
-begin
- AddVal(list,ST_BYTE);
- AddVal(list,ST_WORD);
- AddVal(list,ST_INT);
- AddVal(list,ST_STRING);
- AddVal(list,ST_LASTSEEN);
- AddVal(list,ST_IP);
- AddVal(list,ST_CONTACTINFO);
- AddVal(list,ST_LASTEVENT);
- AddVal(list,ST_TIMESTAMP);
- AddVal(list,ST_SERVICE);
- AddVal(list,ST_SCRIPT);
- AddVal(list,ST_METACONTACT);
SendMessage(list,CB_SETCURSEL,0,0);
end;
-procedure AddCnf(list:HWND;param:integer);
-begin
- SendMessage(list,CB_SETITEMDATA,
- SendMessageW(list,CB_ADDSTRING,0,lparam(setcnftype2str(param))),
- param);
-// mFreeMem(str);
-end;
-
-procedure addsetcnftypes(list:hwnd);
+procedure addothertypes(list:hwnd);
begin
- AddCnf(list,CNF_FIRSTNAME);
- AddCnf(list,CNF_LASTNAME);
- AddCnf(list,CNF_NICK);
- AddCnf(list,CNF_CUSTOMNICK);
- AddCnf(list,CNF_EMAIL);
- AddCnf(list,CNF_CITY);
- AddCnf(list,CNF_STATE);
- AddCnf(list,CNF_COUNTRY);
- AddCnf(list,CNF_PHONE);
- AddCnf(list,CNF_HOMEPAGE);
- AddCnf(list,CNF_ABOUT);
- AddCnf(list,CNF_GENDER);
- AddCnf(list,CNF_AGE);
- AddCnf(list,CNF_FIRSTLAST);
- AddCnf(list,CNF_UNIQUEID);
-
- AddCnf(list,CNF_FAX);
- AddCnf(list,CNF_CELLULAR);
- AddCnf(list,CNF_TIMEZONE);
- AddCnf(list,CNF_MYNOTES);
- AddCnf(list,CNF_BIRTHDAY);
- AddCnf(list,CNF_BIRTHMONTH);
- AddCnf(list,CNF_BIRTHYEAR);
- AddCnf(list,CNF_STREET);
- AddCnf(list,CNF_ZIP);
- AddCnf(list,CNF_LANGUAGE1);
- AddCnf(list,CNF_LANGUAGE2);
- AddCnf(list,CNF_LANGUAGE3);
- AddCnf(list,CNF_CONAME);
+ CB_AddStrDataW(list,stLastSeen ,QSTO_LASTSEEN);
+ CB_AddStrDataW(list,stLastEvent ,QSTO_LASTEVENT);
+ CB_AddStrDataW(list,stMetacontact,QSTO_METACONTACT);
+ CB_AddStrDataW(list,stEventCount ,QSTO_EVENTCOUNT);
SendMessage(list,CB_SETCURSEL,0,0);
end;
-procedure _GetIcon(idc:integer;ico:PAnsiChar);
+procedure addsettypes(list:hwnd);
begin
- SetButtonIcon(GetDlgItem(maindlg,idc),ico);
-end;
+ CB_AddStrDataW(list,stSetting,QST_SETTING);
-function IconChanged(wParam:WPARAM;lParam:LPARAM):int;cdecl;
-begin
- result:=0;
- _GetIcon(IDC_NEW ,QS_NEW);
- _GetIcon(IDC_SETITEM,QS_ITEM);
- _GetIcon(IDC_UP ,QS_UP);
- _GetIcon(IDC_DN ,QS_DOWN);
- _GetIcon(IDC_DELETE ,QS_DELETE);
- _GetIcon(IDC_DEFAULT,QS_DEFAULT);
- _GetIcon(IDC_RELOAD ,QS_RELOAD);
+ CB_AddStrDataW(list,stScript ,QST_SCRIPT);
+ CB_AddStrDataW(list,stService ,QST_SERVICE);
+ CB_AddStrDataW(list,stContactInfo,QST_CONTACTINFO);
+
+ CB_AddStrDataW(list,stOther,QST_OTHER);
+
+ SendMessage(list,CB_SETCURSEL,0,0);
end;
-function ScriptEdit(Dialog:HWnd;hMessage:UINT;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+procedure addcolumn(handle:hwnd;width:word;title:PWideChar);
var
- tmp:pointer;
- vhi:TVARHELPINFO;
+ lvcol:LV_COLUMNW;
begin
- result:=0;
- case hMessage of
-
- WM_INITDIALOG: begin
- TranslateDialogDefault(Dialog);
- SetDlgItemTextW(Dialog,IDC_EDIT_SCRIPT,pWideChar(lParam));
- end;
-
- WM_COMMAND: begin
- case wParam shr 16 of
- BN_CLICKED: begin
- case loword(wParam) of
- IDHELP: SendMessage(Dialog,WM_HELP,0,0);
- IDOK: begin
- tmp:=GetDlgText(Dialog,IDC_EDIT_SCRIPT);
- EndDialog(Dialog,tlparam(tmp));
- end;
- IDCANCEL: begin // clear result / restore old value
- EndDialog(Dialog,0);
- end;
- end;
- end;
- end;
- end;
-
- WM_HELP: begin
- FillChar(vhi,SizeOf(vhi),0);
- with vhi do
- begin
- cbSize:=SizeOf(vhi);
- flags:=VHF_NOINPUTDLG;
- end;
- CallService(MS_VARS_SHOWHELPEX,Dialog,tlparam(@vhi));
- end;
- end;
+ lvcol.mask :=LVCF_TEXT or LVCF_WIDTH;
+ lvcol.cx :=width;
+ lvcol.pszText:=TranslateW(title);
+ SendMessageW(handle,LVM_INSERTCOLUMNW,0,lparam(@lvcol));
end;
function NewListProc(Dialog:HWnd;hMessage:UINT;wParam:WPARAM;lParam:LPARAM):integer; stdcall;
@@ -646,40 +539,199 @@ begin result:=CallWindowProc(OldListProc,Dialog,hMessage,wParam,lParam);
end;
-function DlgProcOptions(Dialog:HWnd;hMessage:UINT;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
-const
- InitDlg:bool = true;
- hook:THANDLE = 0;
+procedure ResizeControl(Dialog:HWND;id:integer;width:integer);
+var
+ wnd:HWND;
+ rc:TRECT;
+begin
+ wnd:=GetDlgItem(Dialog,id);
+ GetWindowRect(wnd,rc);
+ SetWindowPos(wnd,0,0,0,width,rc.bottom-rc.top,SWP_NOMOVE or SWP_NOZORDER or SWP_SHOWWINDOW);
+end;
+
+procedure DoResize(Dialog:HWND);
+var
+ wSeparator:HWND;
+ pcw:pWideChar;
+ rc,rc1:TRECT;
+ pt:TPOINT;
+ dx,rside:integer;
+begin
+ GetClientRect(Dialog,rc);
+ wSeparator:=GetDlgItem(Dialog,IDC_B_RESIZE);
+ GetWindowRect(wSeparator,rc1);
+ pt.x:=rc1.left;
+ pt.y:=0;
+ ScreenToClient(Dialog,pt);
+ if pt.x<(rc.right-50) then //!!
+ begin
+ rside:=SW_HIDE;
+ dx:=rc.right-(rc1.right-rc1.left)-4;
+ pcw:='<';
+ end
+ else
+ begin
+ rside:=SW_SHOW;
+
+ GetWindowRect(GetDlgItem(Dialog,IDC_S_COLSETTING),rc);
+ pt.x:=rc.left;
+ pt.y:=0;
+ ScreenToClient(Dialog,pt);
+ dx:=pt.x-(rc1.right-rc1.left)-4;
+ pcw:='>';
+ end;
+ SendMessageW(wSeparator,WM_SETTEXT,0,lparam(pcw));
+
+ // move separator button
+ SetWindowPos(wSeparator,0,dx+2,2,0,0,SWP_NOSIZE or SWP_NOZORDER or SWP_SHOWWINDOW);
+
+ // resize left side controls
+ ResizeControl(Dialog,IDC_LIST ,dx);
+ ResizeControl(Dialog,IDC_CH_GROUP,dx);
+
+ ResizeControl(Dialog,IDC_CH_USETOOLSTYLE,dx-8);
+ ResizeControl(Dialog,IDC_CH_DRAWGRID ,dx-8);
+ ResizeControl(Dialog,IDC_CH_SAVEPATTERN ,dx-8);
+ ResizeControl(Dialog,IDC_CH_AUTOCLOSE ,dx-8);
+ ResizeControl(Dialog,IDC_CH_SORTSTATUS ,dx-8);
+ ResizeControl(Dialog,IDC_CH_CLIENTICONS ,dx-8);
+
+ // show/hide setting block (ugly, i know!)
+ ShowWindow(GetDlgItem(Dialog,IDC_S_COLSETTING),rside);
+ ShowWindow(GetDlgItem(Dialog,IDC_S_LINE ),rside);
+ ShowWindow(GetDlgItem(Dialog,IDC_S_TITLE ),rside);
+ ShowWindow(GetDlgItem(Dialog,IDC_E_TITLE ),rside);
+ ShowWindow(GetDlgItem(Dialog,IDC_S_VARTYPE ),rside);
+ ShowWindow(GetDlgItem(Dialog,IDC_C_VARTYPE ),rside);
+ ShowWindow(GetDlgItem(Dialog,IDC_SETITEM ),rside);
+
+ ClearScreen(Dialog);
+
+ if rside=SW_SHOW then
+ begin
+ SetupScreen(Dialog,CB_GetData(GetDlgItem(Dialog,IDC_C_VARTYPE)));
+ end;
+end;
+
+procedure SetButtons(Dialog:HWND);
var
-// tpc:array [0..255] of AnsiChar;
- itemsel:integer;
- tmpwnd:HWND;
- tmpbool:bool;
- i:integer;
// ti:TTOOLINFOW;
// hwndTooltip:HWND;
hNew :hwnd;
- hItem :hwnd;
hUp :hwnd;
hDown :hwnd;
hDelete :hwnd;
hDefault:hwnd;
hReload :hwnd;
+begin
+{
+ hwndTooltip:=CreateWindowW(TOOLTIPS_CLASS,nil,TTS_ALWAYSTIP,
+ integer(CW_USEDEFAULT),integer(CW_USEDEFAULT),
+ integer(CW_USEDEFAULT),integer(CW_USEDEFAULT),
+ Dialog,0,hInstance,nil);
+}
+ hNew :=GetDlgItem(Dialog,IDC_NEW);
+ SendMessage(hNew,BUTTONADDTOOLTIP,TWPARAM(TranslateW('New')),BATF_UNICODE);
+ hUp :=GetDlgItem(Dialog,IDC_UP);
+ SendMessage(hUp,BUTTONADDTOOLTIP,TWPARAM(TranslateW('Up')),BATF_UNICODE);
+ hDown :=GetDlgItem(Dialog,IDC_DN);
+ SendMessage(hDown,BUTTONADDTOOLTIP,TWPARAM(TranslateW('Down')),BATF_UNICODE);
+ hDelete :=GetDlgItem(Dialog,IDC_DELETE);
+ SendMessage(hDelete,BUTTONADDTOOLTIP,TWPARAM(TranslateW('Delete')),BATF_UNICODE);
+ hDefault:=GetDlgItem(Dialog,IDC_DEFAULT);
+ SendMessage(hDefault,BUTTONADDTOOLTIP,TWPARAM(TranslateW('Default')),BATF_UNICODE);
+ hReload :=GetDlgItem(Dialog,IDC_RELOAD);
+ SendMessage(hReload,BUTTONADDTOOLTIP,TWPARAM(TranslateW('Reload')),BATF_UNICODE);
+{
+ FillChar(ti,SizeOf(ti),0);
+ ti.cbSize :=sizeof(TOOLINFO);
+ ti.uFlags :=TTF_IDISHWND or TTF_SUBCLASS;
+ ti.hwnd :=Dialog;
+ ti.hinst :=hInstance;
+ ti.uId :=hNew;
+ ti.lpszText:=TranslateW('New');
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,tlparam(@ti));
+ ti.uId :=hItem;
+ ti.lpszText:=TranslateW('Save Item');
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,tlparam(@ti));
+ ti.uId :=hUp;
+ ti.lpszText:=TranslateW('Up');
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,tlparam(@ti));
+ ti.uId :=hDown;
+ ti.lpszText:=TranslateW('Down');
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,tlparam(@ti));
+ ti.uId :=hDelete;
+ ti.lpszText:=TranslateW('Delete');
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,tlparam(@ti));
+ ti.uId :=hDefault;
+ ti.lpszText:=TranslateW('Default');
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,tlparam(@ti));
+ ti.uId :=hReload;
+ ti.lpszText:=TranslateW('Reload');
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,tlparam(@ti));
+}
+ SetButtonIcon(hNew ,QS_NEW);
+ SetButtonIcon(hUp ,QS_UP);
+ SetButtonIcon(hDown ,QS_DOWN);
+ SetButtonIcon(hDelete ,QS_DELETE);
+ SetButtonIcon(hDefault,QS_DEFAULT);
+ SetButtonIcon(hReload ,QS_RELOAD);
+
+end;
+
+procedure AddControls(Dialog:HWND);
+var
+ rc:TRECT;
+ pt,pt1:TPOINT;
+ width,height:integer;
+begin
+ // Settings
+ // Script
+ MakeEditField(Dialog, IDC_E_SCRIPT);
+ SetEditFlags (Dialog, IDC_E_SCRIPT,EF_FORCE,EF_FORCES);
+
+ // Service
+ GetWindowRect(GetDlgItem(Dialog,IDC_C_VARTYPE),rc);
+ width:=rc.right-rc.left;
+ pt.x:=rc.left;
+ pt.y:=rc.bottom;
+ ScreenToClient(Dialog,pt);
+
+ GetWindowRect(GetDlgItem(Dialog,IDC_SETITEM),rc);
+ pt1.x:=rc.left;
+ pt1.y:=rc.top;
+ ScreenToClient(Dialog,pt1);
+
+ height:=pt1.y-pt.y-2;
+ ServiceBlock:=CreateServiceBlock(Dialog,pt.x,pt.y,width,height,ACF_NOSTRUCT);
+
+ // Contact info
+ // Other
+end;
+
+function DlgProcOptions(Dialog:HWnd;hMessage:UINT;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+const
+ InitDlg:bool = true;
+ hook:THANDLE = 0;
+var
+ pc:pWideChar;
+ i,idx:integer;
+ itemsel:integer;
listhwnd:hwnd;
- tmpcol:tcolumnitem;
begin
result:=0;
case hMessage of
WM_DESTROY: begin
- // if closed by Cancel, with changes but without apply
- loadopt_db(false); //!!!!
- WndChangeColumns(wcRefresh);
+ clear_columns(editcolumns);
- mFreeMem(curscript);
if hook<>0 then
UnhookEvent(hook);
- maindlg:=0;
+
+ listhwnd:=GetDlgItem(Dialog,IDC_LIST);
+ DBWriteWord(0,qs_module,'col1',ListView_GetColumnWidth(listhwnd,1));
+ DBWriteWord(0,qs_module,'col2',ListView_GetColumnWidth(listhwnd,2));
+ DBWriteWord(0,qs_module,'col3',ListView_GetColumnWidth(listhwnd,3));
end;
WM_INITDIALOG: begin
@@ -692,99 +744,39 @@ begin TranslateDialogDefault(Dialog);
- addcolumn(listhwnd,95 ,'Setting');
- addcolumn(listhwnd,105,'Module/InfoType');
- addcolumn(listhwnd,85 ,'Title');
+ addcolumn(listhwnd,DBReadWord(0,qs_module,'col3',95) ,'Setting');
+ addcolumn(listhwnd,DBReadWord(0,qs_module,'col2',105),'Module/InfoType');
+ addcolumn(listhwnd,DBReadWord(0,qs_module,'col1',85) ,'Title');
addcolumn(listhwnd,20 ,'#');
+
addsettypes (GetDlgItem(Dialog,IDC_C_VARTYPE));
+ adddbsettypes (GetDlgItem(Dialog,IDC_C_DATATYPE));
+ addothertypes (GetDlgItem(Dialog,IDC_C_OTHER));
addsetcnftypes(GetDlgItem(Dialog,IDC_C_CNFTYPE));
- addparamtypes (GetDlgItem(Dialog,IDC_C_WPAR));
- addparamtypes (GetDlgItem(Dialog,IDC_C_LPAR));
- addresulttypes(GetDlgItem(Dialog,IDC_C_RESULT));
-
- CheckDlgButton(Dialog,IDC_CH_SORTSTATUS ,ORD(qsopt.sortbystatus));
- CheckDlgButton(Dialog,IDC_CH_SHOWINMENU ,ORD(qsopt.showinmenu));
- CheckDlgButton(Dialog,IDC_CH_SHOWONLYUSERS ,ORD(qsopt.showonlyinlist));
- CheckDlgButton(Dialog,IDC_CH_AUTOCLOSE ,ORD(qsopt.closeafteraction));
- CheckDlgButton(Dialog,IDC_CH_ADDTOTOPTOOLBAR,ORD(qsopt.showintoptoolbar));
- CheckDlgButton(Dialog,IDC_CH_USETOOLSTYLE ,ORD(qsopt.usetoolstyle));
- CheckDlgButton(Dialog,IDC_CH_DRAWGRID ,ORD(qsopt.drawgrid));
- CheckDlgButton(Dialog,IDC_CH_SINGLECSV ,ORD(qsopt.singlecsv));
- CheckDlgButton(Dialog,IDC_CH_EXPORTHEADERS ,ORD(qsopt.exportheaders));
- CheckDlgButton(Dialog,IDC_CH_SKIPMINIMIZED ,ORD(qsopt.skipminimized));
- CheckDlgButton(Dialog,IDC_CH_SAVEPATTERN ,ORD(qsopt.savepattern));
- if ServiceExists(MS_FP_GETCLIENTICONW)<>0 then
- CheckDlgButton(Dialog,IDC_CH_SHOWCLIENTICONS,ORD(qsopt.showclienticons))
- else
- EnableWindow(GetDlgItem(Dialog,IDC_CH_SHOWCLIENTICONS),false);
-
- if ServiceExists(MS_TTB_ADDBUTTON)=0 then
- EnableWindow(GetDlgItem(Dialog,IDC_CH_ADDTOTOPTOOLBAR),FALSE);
-{
- hwndTooltip:=CreateWindowW(TOOLTIPS_CLASS,nil,TTS_ALWAYSTIP,
- integer(CW_USEDEFAULT),integer(CW_USEDEFAULT),
- integer(CW_USEDEFAULT),integer(CW_USEDEFAULT),
- Dialog,0,hInstance,nil);
-}
- hNew :=GetDlgItem(Dialog,IDC_NEW);
- SendMessage(hNew,BUTTONADDTOOLTIP,TWPARAM(TranslateW('New')),BATF_UNICODE);
- hItem :=GetDlgItem(Dialog,IDC_SETITEM);
- SendMessage(hItem,BUTTONADDTOOLTIP,TWPARAM(TranslateW('Save Item')),BATF_UNICODE);
- hUp :=GetDlgItem(Dialog,IDC_UP);
- SendMessage(hUp,BUTTONADDTOOLTIP,TWPARAM(TranslateW('Up')),BATF_UNICODE);
- hDown :=GetDlgItem(Dialog,IDC_DN);
- SendMessage(hDown,BUTTONADDTOOLTIP,TWPARAM(TranslateW('Down')),BATF_UNICODE);
- hDelete :=GetDlgItem(Dialog,IDC_DELETE);
- SendMessage(hDelete,BUTTONADDTOOLTIP,TWPARAM(TranslateW('Delete')),BATF_UNICODE);
- hDefault:=GetDlgItem(Dialog,IDC_DEFAULT);
- SendMessage(hDefault,BUTTONADDTOOLTIP,TWPARAM(TranslateW('Default')),BATF_UNICODE);
- hReload :=GetDlgItem(Dialog,IDC_RELOAD);
- SendMessage(hReload,BUTTONADDTOOLTIP,TWPARAM(TranslateW('Reload')),BATF_UNICODE);
-{
- FillChar(ti,SizeOf(ti),0);
- ti.cbSize :=sizeof(TOOLINFO);
- ti.uFlags :=TTF_IDISHWND or TTF_SUBCLASS;
- ti.hwnd :=Dialog;
- ti.hinst :=hInstance;
- ti.uId :=hNew;
- ti.lpszText:=TranslateW('New');
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,tlparam(@ti));
- ti.uId :=hItem;
- ti.lpszText:=TranslateW('Save Item');
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,tlparam(@ti));
- ti.uId :=hUp;
- ti.lpszText:=TranslateW('Up');
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,tlparam(@ti));
- ti.uId :=hDown;
- ti.lpszText:=TranslateW('Down');
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,tlparam(@ti));
- ti.uId :=hDelete;
- ti.lpszText:=TranslateW('Delete');
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,tlparam(@ti));
- ti.uId :=hDefault;
- ti.lpszText:=TranslateW('Default');
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,tlparam(@ti));
- ti.uId :=hReload;
- ti.lpszText:=TranslateW('Reload');
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,tlparam(@ti));
-}
- SetButtonIcon(hNew ,QS_NEW);
- SetButtonIcon(hItem, QS_ITEM);
- SetButtonIcon(hUp ,QS_UP);
- SetButtonIcon(hDown ,QS_DOWN);
- SetButtonIcon(hDelete ,QS_DELETE);
- SetButtonIcon(hDefault,QS_DEFAULT);
- SetButtonIcon(hReload ,QS_RELOAD);
+
+ CheckDlgButton(Dialog,IDC_CH_SORTSTATUS ,ORD((qsopt.flags and QSO_SORTBYSTATUS)<>0));
+ CheckDlgButton(Dialog,IDC_CH_AUTOCLOSE ,ORD((qsopt.flags and QSO_AUTOCLOSE)<>0));
+ CheckDlgButton(Dialog,IDC_CH_USETOOLSTYLE,ORD((qsopt.flags and QSO_TOOLSTYLE)<>0));
+ CheckDlgButton(Dialog,IDC_CH_DRAWGRID ,ORD((qsopt.flags and QSO_DRAWGRID)<>0));
+ CheckDlgButton(Dialog,IDC_CH_SAVEPATTERN ,ORD((qsopt.flags and QSO_SAVEPATTERN)<>0));
+ CheckDlgButton(Dialog,IDC_CH_CLIENTICONS ,ORD((qsopt.flags and QSO_CLIENTICONS)<>0));
+
+ SetButtons(Dialog);
+
+ AddControls(Dialog);
+
+ CloneColumns(editcolumns,qsopt.columns);
update_list(listhwnd);
- maindlg:=Dialog;
- hook:=HookEvent(ME_SKIN2_ICONSCHANGED,@IconChanged);
+ hook:=HookEventParam(ME_SKIN2_ICONSCHANGED,@IconChanged,Dialog);
result:=1;
OldListProc:=pointer(SetWindowLongPtrW(listhwnd,GWL_WNDPROC,LONG_PTR(@NewListProc)));
+ DoResize(Dialog);
+
InitDlg:=false;
end;
@@ -795,45 +787,75 @@ begin // checkboxes
listhwnd:=GetDlgItem(Dialog,IDC_LIST);
- for i:=0 to SendMessage(listhwnd,LVM_GETITEMCOUNT,0,0)-1 do
+ clear_columns(qsopt.columns);
+ qsopt.numcolumns:=SendMessage(listhwnd,LVM_GETITEMCOUNT,0,0);
+ for i:=0 to qsopt.numcolumns-1 do
begin
- with qsopt.columns[i] do
+ idx:=LV_GetLParam(listhwnd,i);
+ with editcolumns[idx] do
begin
if ListView_GetCheckSTate(listhwnd,i)=0 then
flags:=flags and not COL_ON
else
flags:=flags or COL_ON;
end;
+ CloneColumn(qsopt.columns[i],editcolumns[idx]);
end;
- disable_elem(Dialog,IDC_SETITEM);
- savecuritem(Dialog);
-
- qsopt.sortbystatus :=IsDlgButtonChecked(Dialog,IDC_CH_SORTSTATUS )<>BST_UNCHECKED;
- qsopt.showonlyinlist :=IsDlgButtonChecked(Dialog,IDC_CH_SHOWONLYUSERS )<>BST_UNCHECKED;
- qsopt.closeafteraction:=IsDlgButtonChecked(Dialog,IDC_CH_AUTOCLOSE )<>BST_UNCHECKED;
- qsopt.usetoolstyle :=IsDlgButtonChecked(Dialog,IDC_CH_USETOOLSTYLE )<>BST_UNCHECKED;
- qsopt.drawgrid :=IsDlgButtonChecked(Dialog,IDC_CH_DRAWGRID )<>BST_UNCHECKED;
- qsopt.showclienticons :=IsDlgButtonChecked(Dialog,IDC_CH_SHOWCLIENTICONS)<>BST_UNCHECKED;
- qsopt.singlecsv :=IsDlgButtonChecked(Dialog,IDC_CH_SINGLECSV )<>BST_UNCHECKED;
- qsopt.exportheaders :=IsDlgButtonChecked(Dialog,IDC_CH_EXPORTHEADERS )<>BST_UNCHECKED;
- qsopt.skipminimized :=IsDlgButtonChecked(Dialog,IDC_CH_SKIPMINIMIZED )<>BST_UNCHECKED;
- qsopt.savepattern :=IsDlgButtonChecked(Dialog,IDC_CH_SAVEPATTERN )<>BST_UNCHECKED;
-
- tmpbool:=IsDlgButtonChecked(Dialog,IDC_CH_SHOWINMENU)<>BST_UNCHECKED;
- if qsopt.showinmenu<>tmpbool then
- begin
- qsopt.showinmenu:=tmpbool;
- AddRemoveMenuItemToMainMenu;
- end;
- tmpbool:=IsDlgButtonChecked(Dialog,IDC_CH_ADDTOTOPTOOLBAR )<>BST_UNCHECKED;
- if qsopt.showintoptoolbar<>tmpbool then
- begin
- qsopt.showintoptoolbar:=tmpbool;
- addtotoolbar;
- end;
+ qsopt.flags:=qsopt.flags and not QSO_MAINOPTIONS;
+
+ if IsDlgButtonChecked(Dialog,IDC_CH_SORTSTATUS)<>BST_UNCHECKED then
+ qsopt.flags:=qsopt.flags or QSO_SORTBYSTATUS;
+
+ if IsDlgButtonChecked(Dialog,IDC_CH_AUTOCLOSE)<>BST_UNCHECKED then
+ qsopt.flags:=qsopt.flags or QSO_AUTOCLOSE;
+
+ if IsDlgButtonChecked(Dialog,IDC_CH_USETOOLSTYLE)<>BST_UNCHECKED then
+ qsopt.flags:=qsopt.flags or QSO_TOOLSTYLE;
+
+ if IsDlgButtonChecked(Dialog,IDC_CH_DRAWGRID)<>BST_UNCHECKED then
+ qsopt.flags:=qsopt.flags or QSO_DRAWGRID;
+
+ if IsDlgButtonChecked(Dialog,IDC_CH_CLIENTICONS)<>BST_UNCHECKED then
+ qsopt.flags:=qsopt.flags or QSO_CLIENTICONS;
+ if IsDlgButtonChecked(Dialog,IDC_CH_SAVEPATTERN)<>BST_UNCHECKED then
+ qsopt.flags:=qsopt.flags or QSO_SAVEPATTERN;
+{
+ if IsDlgButtonChecked(Dialog,IDC_CH_SORTSTATUS)<>BST_UNCHECKED then
+ qsopt.flags:=qsopt.flags or QSO_SORTBYSTATUS
+ else
+ qsopt.flags:=qsopt.flags and not QSO_SORTBYSTATUS;
+
+ if IsDlgButtonChecked(Dialog,IDC_CH_AUTOCLOSE)<>BST_UNCHECKED then
+ qsopt.flags:=qsopt.flags or QSO_AUTOCLOSE
+ else
+ qsopt.flags:=qsopt.flags and not QSO_AUTOCLOSE;
+
+ if IsDlgButtonChecked(Dialog,IDC_CH_USETOOLSTYLE)<>BST_UNCHECKED then
+ qsopt.flags:=qsopt.flags or QSO_TOOLSTYLE
+ else
+ qsopt.flags:=qsopt.flags and not QSO_TOOLSTYLE;
+
+ if IsDlgButtonChecked(Dialog,IDC_CH_DRAWGRID)<>BST_UNCHECKED then
+ qsopt.flags:=qsopt.flags or QSO_DRAWGRID
+ else
+ qsopt.flags:=qsopt.flags and not QSO_DRAWGRID;
+
+ if IsDlgButtonChecked(Dialog,IDC_CH_CLIENTICONS)<>BST_UNCHECKED then
+ qsopt.flags:=qsopt.flags or QSO_CLIENTICONS
+ else
+ qsopt.flags:=qsopt.flags and not QSO_CLIENTICONS;
+
+ if IsDlgButtonChecked(Dialog,IDC_CH_SAVEPATTERN)<>BST_UNCHECKED then
+ qsopt.flags:=qsopt.flags or QSO_SAVEPATTERN
+ else
+ qsopt.flags:=qsopt.flags and not QSO_SAVEPATTERN;
+}
saveopt_db;
+ //?? refresh QS window if it was opened
+ if CloseSrWindow then
+ OpenSrWindow(nil,qsopt.flags);
result:=1;
end;
@@ -844,14 +866,10 @@ begin (PNMLISTVIEW(lParam)^.uNewState and LVNI_FOCUSED);
if i<0 then // new focus
begin
- InitDlg:=true;
- displcurinfo(Dialog,PNMLISTVIEW(lParam)^.iItem);
-{!!
- displcurinfo(Dialog,
- LV_GetLParam(PNMLISTVIEW(lParam)^.hdr.hwndFrom,
- PNMLISTVIEW(lParam)^.iItem));
-}
- InitDlg:=false;
+ CheckDirection(Dialog,PNMLISTVIEW(lParam)^.iItem);
+ InitScreen(Dialog);
+ displcurinfo(Dialog,editcolumns[PNMLISTVIEW(lParam)^.lParam]);
+
result:=1;
end else if (i=0) and not InitDlg then
begin
@@ -861,11 +879,6 @@ begin if abs(i)=$1000 then
begin
SendMessage(GetParent(Dialog),PSM_CHANGED,0,0);
- if i<0 then
- i:=wcShow
- else
- i:=wcHide;
- WndChangeColumns(i,PNMLISTVIEW(lParam)^.iItem);
result:=1;
end;
end;
@@ -876,166 +889,150 @@ begin end;
end;
- WM_MYSHOWHIDEITEM: begin
- InitDlg:=true;
- ListView_SetCheckState(GetDlgItem(Dialog,IDC_LIST),wParam,lParam<>0);
- InitDlg:=false;
- end;
-
- WM_MYMOVEITEM: begin
- listhwnd:=GetDlgItem(Dialog,IDC_LIST);
- LV_MoveItem(listhwnd,lParam,wParam);
- itemsel:=wParam+lParam;
- i:=SizeOf(tcolumnitem)*abs(integer(lParam));
- move(qsopt.columns[wParam],tmpcol,SizeOf(tcolumnitem));
-
- if integer(lParam)>0 then
- move(qsopt.columns[wParam+1],qsopt.columns[wParam],i)
- else
- move(qsopt.columns[itemsel],qsopt.columns[itemsel+1],i);
-
- move(tmpcol,qsopt.columns[itemsel],SizeOf(tcolumnitem));
-
- CheckDirection(Dialog,getselecteditem(listhwnd));
- end;
-
WM_COMMAND: begin
- if ((wParam shr 16)=CBN_SELCHANGE) then
- begin
- case loword(wParam) of
- IDC_C_VARTYPE: begin
- i:=SendMessage(lParam,CB_GETITEMDATA,
- SendMessage(lParam,CB_GETCURSEL,0,0),0);
-
- SetupControls(Dialog,i);
-
- EnableWindow(GetDlgItem(Dialog,IDC_E_VAR),
- SendDlgItemMessage(Dialog,IDC_C_WPAR,CB_GETCURSEL,0,0)<>ptCurrent);
- EnableWindow(GetDlgItem(Dialog,IDC_E_LPAR),
- SendDlgItemMessage(Dialog,IDC_C_LPAR,CB_GETCURSEL,0,0)<>ptCurrent);
- end;
- IDC_C_WPAR: begin
- EnableWindow(GetDlgItem(Dialog,IDC_E_VAR),
- SendMessage(lParam,CB_GETCURSEL,0,0)<>ptCurrent);
- end;
- IDC_C_LPAR: begin
- EnableWindow(GetDlgItem(Dialog,IDC_E_LPAR),
- SendMessage(lParam,CB_GETCURSEL,0,0)<>ptCurrent);
+ case wParam shr 16 of
+ CBN_SELCHANGE: begin
+ if loword(wParam)=IDC_C_VARTYPE then
+ begin
+ ClearScreen(Dialog);
+ SetupScreen(Dialog,CB_GetData(lParam));
end;
end;
- end;
- if not InitDlg then
- case wParam shr 16 of
- CBN_SELCHANGE,
- BN_CLICKED,
- EN_CHANGE: begin
+ BN_CLICKED: begin
+ if loword(wParam)<>IDC_B_RESIZE then
SendMessage(GetParent(Dialog),PSM_CHANGED,0,0);
- enable_elem(Dialog,IDC_SETITEM);
- end;
- end;
- listhwnd:=GetDlgItem(Dialog,IDC_LIST);
- result:=1;
- case loword(wParam) of
- IDC_SCRIPT: begin
- tmpwnd:=DialogBoxParamW(hInstance,MAKEINTRESOURCEW(IDD_SCRIPT),
- Dialog,@ScriptEdit,tlparam(curscript));
- if tmpwnd<>0 then
- begin
- curscript:=pointer(tmpwnd);
- end;
- end;
+ listhwnd:=GetDlgItem(Dialog,IDC_LIST);
+ result:=1;
+ case loword(wParam) of
+ IDC_NEW: begin
+ i:=GetSelectedItem(listhwnd)+1;
+ add_column(listhwnd,i,new_column(editcolumns));
+
+ SendMessage(listhwnd,LVM_ENSUREVISIBLE,i,0);
+ ListView_SetItemState(listhwnd,i,
+ LVIS_FOCUSED+LVIS_SELECTED,LVIS_FOCUSED+LVIS_SELECTED);
+ InitScreen(Dialog);
+ CheckDirection(Dialog,i);
+ EnableWindow(GetDlgItem(Dialog,IDC_DELETE),true);
+ end;
- IDC_NEW: begin
- InitDlg:=true;
- WndChangeColumns(wcInsert,
- add_column(listhwnd,new_column(getselecteditem(listhwnd))));
+ IDC_DELETE: begin
+ i:=GetSelectedItem(listhwnd);
+ clear_column(editcolumns[LV_GetLParam(listhwnd,i)]);
+ SendMessage(listhwnd,LVM_DELETEITEM,i,0);
- SendMessage(listhwnd,LVM_ENSUREVISIBLE,qsopt.numcolumns-1,0);
- ListView_SetItemState(listhwnd,qsopt.numcolumns-1,
- LVIS_FOCUSED+LVIS_SELECTED,LVIS_FOCUSED+LVIS_SELECTED);
- InitDlg:=false;
- end;
+ idx:=SendMessage(listhwnd,LVM_GETITEMCOUNT,0,0);
+ if idx=0 then
+ begin
+ EnableWindow(lParam,false);
+ InitScreen(Dialog);
+ end
+ else
+ begin
+ if i=idx then dec(i);
+ ListView_SetItemState(listhwnd,i,
+ LVIS_FOCUSED+LVIS_SELECTED,LVIS_FOCUSED+LVIS_SELECTED);
+ end;
+ CheckDirection(Dialog,i);
+ end;
- IDC_DELETE: begin
- i:=getselecteditem(listhwnd);
- SendMessage(listhwnd,LVM_DELETEITEM,i,0);
- delete_column(i);
- WndChangeColumns(wcDelete,i);
-// update_list(listhwnd);
+ IDC_UP: begin
+ itemsel:=GetSelectedItem(listhwnd);
+ if itemsel>0 then
+ begin
+ LV_MoveItem(listhwnd,-1,itemsel);
+ CheckDirection(Dialog,itemsel-1);
+ end;
+ end;
- if i=qsopt.numcolumns then dec(i);
- ListView_SetItemState(listhwnd,i,
- LVIS_FOCUSED+LVIS_SELECTED,LVIS_FOCUSED+LVIS_SELECTED);
- end;
+ IDC_DN: begin
+ itemsel:=GetSelectedItem(listhwnd);
+ if itemsel>=0 then
+ begin
+ LV_MoveItem(listhwnd,1,itemsel);
+ CheckDirection(Dialog,itemsel+1);
+ end;
+ end;
- IDC_UP: begin
- itemsel:=getselecteditem(listhwnd);
- if itemsel>0 then
- begin
- LV_MoveItem(listhwnd,-1,itemsel);
- move(qsopt.columns[itemsel] ,tmpcol ,SizeOf(tcolumnitem));
- move(qsopt.columns[itemsel-1],qsopt.columns[itemsel] ,SizeOf(tcolumnitem));
- move(tmpcol ,qsopt.columns[itemsel-1],SizeOf(tcolumnitem));
- WndChangeColumns(wcUp,itemsel);
- CheckDirection(Dialog,itemsel-1);
- end;
- end;
+ IDC_SETITEM: begin
+ if SendMessage(listhwnd,LVM_GETITEMCOUNT,0,0)=0 then
+ begin
+ add_column(listhwnd,0,0);
+ ListView_SetItemState(listhwnd,0,
+ LVIS_FOCUSED+LVIS_SELECTED,LVIS_FOCUSED+LVIS_SELECTED);
+ EnableWindow(GetDlgItem(Dialog,IDC_DELETE),true);
+ end;
+ savecuritem(Dialog);
+ end;
- IDC_DN: begin
- itemsel:=getselecteditem(listhwnd);
- if (itemsel>=0) and (itemsel<(qsopt.numcolumns-1)) then
- begin
- LV_MoveItem(listhwnd,1,itemsel);
- move(qsopt.columns[itemsel] ,tmpcol ,SizeOf(tcolumnitem));
- move(qsopt.columns[itemsel+1],qsopt.columns[itemsel] ,SizeOf(tcolumnitem));
- move(tmpcol ,qsopt.columns[itemsel+1],SizeOf(tcolumnitem));
- WndChangeColumns(wcDown,itemsel);
- CheckDirection(Dialog,itemsel+1);
+ IDC_DEFAULT: begin
+ loaddefaultcolumns(editcolumns);
+ update_list(listhwnd);
+ end;
+
+ IDC_RELOAD: begin
+ loadopt_db(editcolumns);
+ update_list(listhwnd);
+ end;
+
+ IDC_B_RESIZE: begin
+ DoResize(Dialog);
+ end;
+ else
+ result:=0;
end;
end;
+ end;
+ end;
- IDC_SETITEM: begin
- WndChangeColumns(wcChange,savecuritem(Dialog));
+ WM_HELP: begin
+ case CB_GetData(GetDlgItem(Dialog,IDC_C_VARTYPE)) of
+ QST_SETTING: begin
+ MessageBoxW(0,
+ TranslateW('Column content is simple database setting.'),
+ TranslateW('DB setting'),0);
end;
-
- IDC_DEFAULT: begin
- InitDlg:=true;
- loaddefaultcolumns;
- update_list(listhwnd);
- WndChangeColumns(wcRefresh);
- InitDlg:=false;
+ QST_SCRIPT: begin
+ MessageBoxW(0,
+ TranslateW('Column content is script result.'#13#10+
+ 'More help from "Help" button in script dialog.'),
+ TranslateW('Script'),0);
end;
-
- IDC_RELOAD: begin
- InitDlg:=true;
- loadopt_db(false);
- update_list(listhwnd);
- WndChangeColumns(wcRefresh);
- InitDlg:=false;
+ QST_SERVICE: begin
+ SendMessage(ServiceBlock,WM_HELP,0,0);
+ end;
+ QST_CONTACTINFO: begin
+ MessageBoxW(0,
+ TranslateW('Column content is contact property (see list). Can be empty.'),
+ TranslateW('ContactInfo'),0);
+ end;
+ QST_OTHER: begin
+ case CB_GetData(GetDlgItem(Dialog,IDC_C_OTHER)) of
+ QSTO_LASTSEEN: begin
+ pc:='Content is last online time.';
+ end;
+ QSTO_LASTEVENT: begin
+ pc:='Content is time of last contact event.';
+ end;
+ QSTO_METACONTACT: begin
+ pc:='Content is metacontact info.';
+ end;
+ QSTO_EVENTCOUNT: begin
+ pc:='Content is count of ALL contact events (not messages only)';
+ end;
+ end;
+ MessageBoxW(0,TranslateW(pc),TranslateW('Other info'),0);
end;
- else
- result:=0;
end;
+ result:=1;
end;
+
// else
// result:=DefWindowProc(Dialog,hMessage,wParam,lParam);
end;
- DefWindowProc(Dialog,hMessage,wParam,lParam);
-end;
-
-procedure OptChangeColumns(code:integer;column,data:integer);
-begin
- case code of
- wcUp: begin
- SendMessage(maindlg,WM_MYSHOWHIDEITEM,column,data);
- end;
-
- wcShow: begin
- SendMessage(maindlg,WM_MYSHOWHIDEITEM,column,data);
- end;
- end;
+ DefWindowProc(Dialog,hMessage,wParam,lParam);
end;
end.
|