diff options
-rw-r--r-- | bin10/pascal32.bat | 5 | ||||
-rw-r--r-- | bin10/pascal64.bat | 5 | ||||
-rw-r--r-- | bin12/pascal32.bat | 6 | ||||
-rw-r--r-- | bin12/pascal64.bat | 6 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/actman.dpr (renamed from plugins/Actman/actman.dpr) | 0 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/global.pas (renamed from plugins/Actman30/global.pas) | 8 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/hooks/hooks.pas (renamed from plugins/Actman30/hooks/hooks.pas) | 8 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/hooks/hooks.rc (renamed from plugins/Actman30/hooks/hooks.rc) | 0 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/hooks/hooks.res (renamed from plugins/Actman30/hooks.res) | bin | 688 -> 688 bytes | |||
-rw-r--r-- | plugins/!Deprecated/Actman20/hooks/i_hconst.inc (renamed from plugins/Actman30/hooks/i_hconst.inc) | 0 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/hooks/i_hook.inc (renamed from plugins/Actman30/hooks/i_hook.inc) | 2 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/hooks/i_opt_dlg.inc (renamed from plugins/Actman30/hooks/i_opt_dlg.inc) | 96 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/hooks/i_options.inc (renamed from plugins/Actman30/hooks/i_options.inc) | 0 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/i_action.inc (renamed from plugins/Actman/i_action.inc) | 0 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/i_actlow.inc (renamed from plugins/Actman/i_actlow.inc) | 0 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/i_const.inc | 219 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/i_contact.inc (renamed from plugins/Actman/i_contact.inc) | 0 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/i_dlglists.inc (renamed from plugins/Actman/i_dlglists.inc) | 0 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/i_inoutxm.inc (renamed from plugins/Actman/i_inoutxm.inc) | 0 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/i_opt_dlg.inc | 215 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/i_opt_dlg2.inc | 2095 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/i_options.inc | 459 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/i_services.inc | 131 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/i_vars.inc (renamed from plugins/Actman/i_vars.inc) | 0 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/i_visual.inc (renamed from plugins/Actman/i_visual.inc) | 0 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/ico/advance.ico | bin | 0 -> 1150 bytes | |||
-rw-r--r-- | plugins/!Deprecated/Actman20/ico/apply.ico | bin | 0 -> 1150 bytes | |||
-rw-r--r-- | plugins/!Deprecated/Actman20/ico/chain.ico | bin | 0 -> 1150 bytes | |||
-rw-r--r-- | plugins/!Deprecated/Actman20/ico/contact.ico | bin | 0 -> 1150 bytes | |||
-rw-r--r-- | plugins/!Deprecated/Actman20/ico/delete.ico | bin | 0 -> 1150 bytes | |||
-rw-r--r-- | plugins/!Deprecated/Actman20/ico/down.ico | bin | 0 -> 1150 bytes | |||
-rw-r--r-- | plugins/!Deprecated/Actman20/ico/export.ico | bin | 0 -> 1150 bytes | |||
-rw-r--r-- | plugins/!Deprecated/Actman20/ico/format.ico | bin | 0 -> 1150 bytes | |||
-rw-r--r-- | plugins/!Deprecated/Actman20/ico/import.ico | bin | 0 -> 1150 bytes | |||
-rw-r--r-- | plugins/!Deprecated/Actman20/ico/insert.ico | bin | 0 -> 1150 bytes | |||
-rw-r--r-- | plugins/!Deprecated/Actman20/ico/message.ico | bin | 0 -> 1150 bytes | |||
-rw-r--r-- | plugins/!Deprecated/Actman20/ico/new.ico | bin | 0 -> 1150 bytes | |||
-rw-r--r-- | plugins/!Deprecated/Actman20/ico/program.ico | bin | 0 -> 1150 bytes | |||
-rw-r--r-- | plugins/!Deprecated/Actman20/ico/reload.ico | bin | 0 -> 1150 bytes | |||
-rw-r--r-- | plugins/!Deprecated/Actman20/ico/rw.ico | bin | 0 -> 1150 bytes | |||
-rw-r--r-- | plugins/!Deprecated/Actman20/ico/service.ico | bin | 0 -> 1150 bytes | |||
-rw-r--r-- | plugins/!Deprecated/Actman20/ico/test.ico | bin | 0 -> 1150 bytes | |||
-rw-r--r-- | plugins/!Deprecated/Actman20/ico/up.ico | bin | 0 -> 1150 bytes | |||
-rw-r--r-- | plugins/!Deprecated/Actman20/ico/vcheck.ico (renamed from plugins/Actman/ico/vcheck.ico) | bin | 1150 -> 1150 bytes | |||
-rw-r--r-- | plugins/!Deprecated/Actman20/ico/vuncheck.ico (renamed from plugins/Actman/ico/vuncheck.ico) | bin | 1150 -> 1150 bytes | |||
-rw-r--r-- | plugins/!Deprecated/Actman20/m_actions.inc (renamed from plugins/Actman/m_actions.inc) | 0 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/make.bat (renamed from plugins/Actman30/make.bat) | 2 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/options.rc | 328 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/options.res | bin | 0 -> 32904 bytes | |||
-rw-r--r-- | plugins/!Deprecated/Actman20/question.pas (renamed from plugins/Actman30/question.pas) | 11 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/readme.txt (renamed from plugins/Actman30/readme.txt) | 2 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/services.ini (renamed from plugins/Actman30/services.ini) | 124 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/tasks/i_opt_dlg.inc (renamed from plugins/Actman30/tasks/i_opt_dlg.inc) | 11 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/tasks/i_options.inc (renamed from plugins/Actman30/tasks/i_options.inc) | 1 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/tasks/i_service.inc (renamed from plugins/Actman30/tasks/i_service.inc) | 0 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/tasks/i_task.inc (renamed from plugins/Actman30/tasks/i_task.inc) | 0 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/tasks/i_tconst.inc (renamed from plugins/Actman30/tasks/i_tconst.inc) | 0 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/tasks/scheduler.pas (renamed from plugins/Actman30/tasks/scheduler.pas) | 24 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/tasks/tasks.rc (renamed from plugins/Actman30/tasks/tasks.rc) | 0 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/tasks/tasks.res (renamed from plugins/Actman30/tasks.res) | bin | 1288 -> 1288 bytes | |||
-rw-r--r-- | plugins/!Deprecated/Actman20/ua/action.ico | bin | 0 -> 1150 bytes | |||
-rw-r--r-- | plugins/!Deprecated/Actman20/ua/i_inoutxm.inc (renamed from plugins/Actman30/ua/i_inoutxm.inc) | 14 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/ua/i_opt_dlg.inc (renamed from plugins/Actman30/ua/i_opt_dlg.inc) | 471 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/ua/i_options.inc (renamed from plugins/Actman30/ua/i_options.inc) | 93 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/ua/i_ua.inc (renamed from plugins/Actman30/ua/i_ua.inc) | 100 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/ua/i_uaplaces.inc (renamed from plugins/Actman30/ua/i_uaplaces.inc) | 108 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/ua/i_uavars.inc (renamed from plugins/Actman30/ua/i_uavars.inc) | 15 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/ua/i_uconst.inc | 34 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/ua/ua.pas | 124 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/ua/ua.rc | 51 | ||||
-rw-r--r-- | plugins/!Deprecated/Actman20/ua/ua.res | bin | 0 -> 2512 bytes | |||
-rw-r--r-- | plugins/Actman/actman30.dpr (renamed from plugins/Actman30/actman30.dpr) | 0 | ||||
-rw-r--r-- | plugins/Actman/ask.rc (renamed from plugins/Actman30/ask.rc) | 0 | ||||
-rw-r--r-- | plugins/Actman/ask.res (renamed from plugins/Actman30/ask.res) | bin | 456 -> 456 bytes | |||
-rw-r--r-- | plugins/Actman/dlgshare.pas (renamed from plugins/Actman30/dlgshare.pas) | 0 | ||||
-rw-r--r-- | plugins/Actman/dlgshare.rc (renamed from plugins/Actman30/dlgshare.rc) | 0 | ||||
-rw-r--r-- | plugins/Actman/dlgshare.res (renamed from plugins/Actman30/dlgshare.res) | bin | 22652 -> 22652 bytes | |||
-rw-r--r-- | plugins/Actman/global.pas | 8 | ||||
-rw-r--r-- | plugins/Actman/hooks.res (renamed from plugins/Actman30/hooks/hooks.res) | bin | 688 -> 688 bytes | |||
-rw-r--r-- | plugins/Actman/hooks/hooks.pas | 8 | ||||
-rw-r--r-- | plugins/Actman/hooks/i_hook.inc | 2 | ||||
-rw-r--r-- | plugins/Actman/hooks/i_opt_dlg.inc | 96 | ||||
-rw-r--r-- | plugins/Actman/i_cnst_call.inc (renamed from plugins/Actman30/i_cnst_call.inc) | 0 | ||||
-rw-r--r-- | plugins/Actman/i_cnst_chain.inc (renamed from plugins/Actman30/i_cnst_chain.inc) | 0 | ||||
-rw-r--r-- | plugins/Actman/i_cnst_contact.inc (renamed from plugins/Actman30/i_cnst_contact.inc) | 0 | ||||
-rw-r--r-- | plugins/Actman/i_cnst_database.inc (renamed from plugins/Actman30/i_cnst_database.inc) | 0 | ||||
-rw-r--r-- | plugins/Actman/i_cnst_dlgshare.inc (renamed from plugins/Actman30/i_cnst_dlgshare.inc) | 0 | ||||
-rw-r--r-- | plugins/Actman/i_cnst_ini.inc (renamed from plugins/Actman30/i_cnst_ini.inc) | 0 | ||||
-rw-r--r-- | plugins/Actman/i_cnst_inout.inc (renamed from plugins/Actman30/i_cnst_inout.inc) | 0 | ||||
-rw-r--r-- | plugins/Actman/i_cnst_jump.inc (renamed from plugins/Actman30/i_cnst_jump.inc) | 0 | ||||
-rw-r--r-- | plugins/Actman/i_cnst_message.inc (renamed from plugins/Actman30/i_cnst_message.inc) | 0 | ||||
-rw-r--r-- | plugins/Actman/i_cnst_notes.inc (renamed from plugins/Actman30/i_cnst_notes.inc) | 0 | ||||
-rw-r--r-- | plugins/Actman/i_cnst_program.inc (renamed from plugins/Actman30/i_cnst_program.inc) | 0 | ||||
-rw-r--r-- | plugins/Actman/i_cnst_settings.inc (renamed from plugins/Actman30/i_cnst_settings.inc) | 0 | ||||
-rw-r--r-- | plugins/Actman/i_cnst_storage.inc (renamed from plugins/Actman30/i_cnst_storage.inc) | 0 | ||||
-rw-r--r-- | plugins/Actman/i_cnst_text.inc (renamed from plugins/Actman30/i_cnst_text.inc) | 0 | ||||
-rw-r--r-- | plugins/Actman/i_const.inc | 190 | ||||
-rw-r--r-- | plugins/Actman/i_opt_dlg.inc | 175 | ||||
-rw-r--r-- | plugins/Actman/i_opt_dlg2.inc | 2402 | ||||
-rw-r--r-- | plugins/Actman/i_options.inc | 716 | ||||
-rw-r--r-- | plugins/Actman/i_services.inc | 304 | ||||
-rw-r--r-- | plugins/Actman/iac_.pas (renamed from plugins/Actman30/iac_.pas) | 0 | ||||
-rw-r--r-- | plugins/Actman/iac_call.pas (renamed from plugins/Actman30/iac_call.pas) | 0 | ||||
-rw-r--r-- | plugins/Actman/iac_call.rc (renamed from plugins/Actman30/iac_call.rc) | 0 | ||||
-rw-r--r-- | plugins/Actman/iac_call.res (renamed from plugins/Actman30/iac_call.res) | bin | 3492 -> 3492 bytes | |||
-rw-r--r-- | plugins/Actman/iac_chain.pas (renamed from plugins/Actman30/iac_chain.pas) | 0 | ||||
-rw-r--r-- | plugins/Actman/iac_chain.rc (renamed from plugins/Actman30/iac_chain.rc) | 0 | ||||
-rw-r--r-- | plugins/Actman/iac_chain.res (renamed from plugins/Actman30/iac_chain.res) | bin | 3144 -> 3144 bytes | |||
-rw-r--r-- | plugins/Actman/iac_contact.pas (renamed from plugins/Actman30/iac_contact.pas) | 0 | ||||
-rw-r--r-- | plugins/Actman/iac_contact.rc (renamed from plugins/Actman30/iac_contact.rc) | 0 | ||||
-rw-r--r-- | plugins/Actman/iac_contact.res (renamed from plugins/Actman30/iac_contact.res) | bin | 3120 -> 3120 bytes | |||
-rw-r--r-- | plugins/Actman/iac_database.rc (renamed from plugins/Actman30/iac_database.rc) | 0 | ||||
-rw-r--r-- | plugins/Actman/iac_database.res (renamed from plugins/Actman30/iac_database.res) | bin | 3564 -> 3564 bytes | |||
-rw-r--r-- | plugins/Actman/iac_dbrw.pas (renamed from plugins/Actman30/iac_dbrw.pas) | 0 | ||||
-rw-r--r-- | plugins/Actman/iac_global.pas (renamed from plugins/Actman30/iac_global.pas) | 0 | ||||
-rw-r--r-- | plugins/Actman/iac_ini.pas (renamed from plugins/Actman30/iac_ini.pas) | 0 | ||||
-rw-r--r-- | plugins/Actman/iac_ini.rc (renamed from plugins/Actman30/iac_ini.rc) | 0 | ||||
-rw-r--r-- | plugins/Actman/iac_ini.res (renamed from plugins/Actman30/iac_ini.res) | bin | 3416 -> 3416 bytes | |||
-rw-r--r-- | plugins/Actman/iac_inout.pas (renamed from plugins/Actman30/iac_inout.pas) | 0 | ||||
-rw-r--r-- | plugins/Actman/iac_inout.rc (renamed from plugins/Actman30/iac_inout.rc) | 0 | ||||
-rw-r--r-- | plugins/Actman/iac_inout.res (renamed from plugins/Actman30/iac_inout.res) | bin | 3432 -> 3432 bytes | |||
-rw-r--r-- | plugins/Actman/iac_jump.pas (renamed from plugins/Actman30/iac_jump.pas) | 0 | ||||
-rw-r--r-- | plugins/Actman/iac_jump.rc (renamed from plugins/Actman30/iac_jump.rc) | 0 | ||||
-rw-r--r-- | plugins/Actman/iac_jump.res (renamed from plugins/Actman30/iac_jump.res) | bin | 3448 -> 3448 bytes | |||
-rw-r--r-- | plugins/Actman/iac_messagebox.pas (renamed from plugins/Actman30/iac_messagebox.pas) | 0 | ||||
-rw-r--r-- | plugins/Actman/iac_messagebox.rc (renamed from plugins/Actman30/iac_messagebox.rc) | 0 | ||||
-rw-r--r-- | plugins/Actman/iac_messagebox.res (renamed from plugins/Actman30/iac_messagebox.res) | bin | 3760 -> 3760 bytes | |||
-rw-r--r-- | plugins/Actman/iac_notes.pas (renamed from plugins/Actman30/iac_notes.pas) | 0 | ||||
-rw-r--r-- | plugins/Actman/iac_notes.rc (renamed from plugins/Actman30/iac_notes.rc) | 0 | ||||
-rw-r--r-- | plugins/Actman/iac_notes.res (renamed from plugins/Actman30/iac_notes.res) | bin | 2844 -> 2844 bytes | |||
-rw-r--r-- | plugins/Actman/iac_program.pas (renamed from plugins/Actman30/iac_program.pas) | 0 | ||||
-rw-r--r-- | plugins/Actman/iac_program.rc (renamed from plugins/Actman30/iac_program.rc) | 0 | ||||
-rw-r--r-- | plugins/Actman/iac_program.res (renamed from plugins/Actman30/iac_program.res) | bin | 3652 -> 3652 bytes | |||
-rw-r--r-- | plugins/Actman/iac_service.pas (renamed from plugins/Actman30/iac_service.pas) | 0 | ||||
-rw-r--r-- | plugins/Actman/iac_service.rc (renamed from plugins/Actman30/iac_service.rc) | 0 | ||||
-rw-r--r-- | plugins/Actman/iac_service.res (renamed from plugins/Actman30/iac_service.res) | bin | 2820 -> 2820 bytes | |||
-rw-r--r-- | plugins/Actman/iac_settings.pas (renamed from plugins/Actman30/iac_settings.pas) | 0 | ||||
-rw-r--r-- | plugins/Actman/iac_settings.rc (renamed from plugins/Actman30/iac_settings.rc) | 0 | ||||
-rw-r--r-- | plugins/Actman/iac_settings.res (renamed from plugins/Actman30/iac_settings.res) | bin | 3636 -> 3636 bytes | |||
-rw-r--r-- | plugins/Actman/iac_storage.pas (renamed from plugins/Actman30/iac_storage.pas) | 0 | ||||
-rw-r--r-- | plugins/Actman/iac_storage.rc (renamed from plugins/Actman30/iac_storage.rc) | 0 | ||||
-rw-r--r-- | plugins/Actman/iac_storage.res (renamed from plugins/Actman30/iac_storage.res) | bin | 2976 -> 2976 bytes | |||
-rw-r--r-- | plugins/Actman/iac_text.pas (renamed from plugins/Actman30/iac_text.pas) | 0 | ||||
-rw-r--r-- | plugins/Actman/iac_text.rc (renamed from plugins/Actman30/iac_text.rc) | 0 | ||||
-rw-r--r-- | plugins/Actman/iac_text.res (renamed from plugins/Actman30/iac_text.res) | bin | 2912 -> 2912 bytes | |||
-rw-r--r-- | plugins/Actman/ico/advance.ico | bin | 1150 -> 2550 bytes | |||
-rw-r--r-- | plugins/Actman/ico/apply.ico | bin | 1150 -> 1406 bytes | |||
-rw-r--r-- | plugins/Actman/ico/call.ico (renamed from plugins/Actman30/ico/call.ico) | bin | 2550 -> 2550 bytes | |||
-rw-r--r-- | plugins/Actman/ico/chain.ico | bin | 1150 -> 2550 bytes | |||
-rw-r--r-- | plugins/Actman/ico/contact.ico | bin | 1150 -> 2550 bytes | |||
-rw-r--r-- | plugins/Actman/ico/delete.ico | bin | 1150 -> 2550 bytes | |||
-rw-r--r-- | plugins/Actman/ico/down.ico | bin | 1150 -> 2550 bytes | |||
-rw-r--r-- | plugins/Actman/ico/export.ico | bin | 1150 -> 2550 bytes | |||
-rw-r--r-- | plugins/Actman/ico/format.ico | bin | 1150 -> 2550 bytes | |||
-rw-r--r-- | plugins/Actman/ico/import.ico | bin | 1150 -> 2550 bytes | |||
-rw-r--r-- | plugins/Actman/ico/ini.ico (renamed from plugins/Actman30/ico/ini.ico) | bin | 2550 -> 2550 bytes | |||
-rw-r--r-- | plugins/Actman/ico/insert.ico | bin | 1150 -> 2550 bytes | |||
-rw-r--r-- | plugins/Actman/ico/jump.ico (renamed from plugins/Actman30/ico/jump.ico) | bin | 2550 -> 2550 bytes | |||
-rw-r--r-- | plugins/Actman/ico/message.ico | bin | 1150 -> 2550 bytes | |||
-rw-r--r-- | plugins/Actman/ico/new.ico | bin | 1150 -> 2550 bytes | |||
-rw-r--r-- | plugins/Actman/ico/notes.ico (renamed from plugins/Actman30/ico/notes.ico) | bin | 2550 -> 2550 bytes | |||
-rw-r--r-- | plugins/Actman/ico/program.ico | bin | 1150 -> 2550 bytes | |||
-rw-r--r-- | plugins/Actman/ico/reload.ico | bin | 1150 -> 2550 bytes | |||
-rw-r--r-- | plugins/Actman/ico/rw.ico | bin | 1150 -> 2550 bytes | |||
-rw-r--r-- | plugins/Actman/ico/service.ico | bin | 1150 -> 2550 bytes | |||
-rw-r--r-- | plugins/Actman/ico/settings.ico (renamed from plugins/Actman30/ico/settings.ico) | bin | 2550 -> 2550 bytes | |||
-rw-r--r-- | plugins/Actman/ico/storage.ico (renamed from plugins/Actman30/ico/storage.ico) | bin | 2550 -> 2550 bytes | |||
-rw-r--r-- | plugins/Actman/ico/test.ico | bin | 1150 -> 2550 bytes | |||
-rw-r--r-- | plugins/Actman/ico/text.ico (renamed from plugins/Actman30/ico/text.ico) | bin | 2550 -> 2550 bytes | |||
-rw-r--r-- | plugins/Actman/ico/up.ico | bin | 1150 -> 2550 bytes | |||
-rw-r--r-- | plugins/Actman/inoutini.pas (renamed from plugins/Actman30/inoutini.pas) | 0 | ||||
-rw-r--r-- | plugins/Actman/inoutxml.pas (renamed from plugins/Actman30/inoutxml.pas) | 0 | ||||
-rw-r--r-- | plugins/Actman/lowlevelc.pas (renamed from plugins/Actman30/lowlevelc.pas) | 0 | ||||
-rw-r--r-- | plugins/Actman/mApiCard.res (renamed from plugins/Actman30/mApiCard.res) | bin | 1052 -> 1052 bytes | |||
-rw-r--r-- | plugins/Actman/m_actman.h (renamed from plugins/Actman30/m_actman.h) | 0 | ||||
-rw-r--r-- | plugins/Actman/options.rc | 278 | ||||
-rw-r--r-- | plugins/Actman/options.res | bin | 32904 -> 1004 bytes | |||
-rw-r--r-- | plugins/Actman/question.pas | 11 | ||||
-rw-r--r-- | plugins/Actman/readme.txt | 2 | ||||
-rw-r--r-- | plugins/Actman/services.ini | 124 | ||||
-rw-r--r-- | plugins/Actman/sparam.res (renamed from plugins/Actman30/sparam.res) | bin | 624 -> 624 bytes | |||
-rw-r--r-- | plugins/Actman/structopts.res (renamed from plugins/Actman30/structopts.res) | bin | 12408 -> 12408 bytes | |||
-rw-r--r-- | plugins/Actman/tasks.res (renamed from plugins/Actman30/tasks/tasks.res) | bin | 1288 -> 1288 bytes | |||
-rw-r--r-- | plugins/Actman/tasks/i_opt_dlg.inc | 11 | ||||
-rw-r--r-- | plugins/Actman/tasks/i_options.inc | 1 | ||||
-rw-r--r-- | plugins/Actman/tasks/scheduler.pas | 24 | ||||
-rw-r--r-- | plugins/Actman/ua.res (renamed from plugins/Actman30/ua.res) | bin | 3944 -> 3944 bytes | |||
-rw-r--r-- | plugins/Actman/ua/action.ico | bin | 1150 -> 2550 bytes | |||
-rw-r--r-- | plugins/Actman/ua/i_inoutjson.inc (renamed from plugins/Actman30/ua/i_inoutjson.inc) | 0 | ||||
-rw-r--r-- | plugins/Actman/ua/i_inoutxm.inc | 14 | ||||
-rw-r--r-- | plugins/Actman/ua/i_opt_dlg.inc | 471 | ||||
-rw-r--r-- | plugins/Actman/ua/i_options.inc | 93 | ||||
-rw-r--r-- | plugins/Actman/ua/i_ua.inc | 100 | ||||
-rw-r--r-- | plugins/Actman/ua/i_uaplaces.inc | 108 | ||||
-rw-r--r-- | plugins/Actman/ua/i_uavars.inc | 15 | ||||
-rw-r--r-- | plugins/Actman/ua/i_uconst.inc | 40 | ||||
-rw-r--r-- | plugins/Actman/ua/ua.pas | 69 | ||||
-rw-r--r-- | plugins/Actman/ua/ua.rc | 47 | ||||
-rw-r--r-- | plugins/Actman/ua/ua.res | bin | 2512 -> 3992 bytes | |||
-rw-r--r-- | plugins/Actman30/i_const.inc | 31 | ||||
-rw-r--r-- | plugins/Actman30/i_opt_dlg.inc | 52 | ||||
-rw-r--r-- | plugins/Actman30/i_opt_dlg2.inc | 1319 | ||||
-rw-r--r-- | plugins/Actman30/i_options.inc | 475 | ||||
-rw-r--r-- | plugins/Actman30/i_services.inc | 317 | ||||
-rw-r--r-- | plugins/Actman30/ico/advance.ico | bin | 2550 -> 0 bytes | |||
-rw-r--r-- | plugins/Actman30/ico/apply.ico | bin | 1406 -> 0 bytes | |||
-rw-r--r-- | plugins/Actman30/ico/chain.ico | bin | 2550 -> 0 bytes | |||
-rw-r--r-- | plugins/Actman30/ico/contact.ico | bin | 2550 -> 0 bytes | |||
-rw-r--r-- | plugins/Actman30/ico/delete.ico | bin | 2550 -> 0 bytes | |||
-rw-r--r-- | plugins/Actman30/ico/down.ico | bin | 2550 -> 0 bytes | |||
-rw-r--r-- | plugins/Actman30/ico/export.ico | bin | 2550 -> 0 bytes | |||
-rw-r--r-- | plugins/Actman30/ico/format.ico | bin | 2550 -> 0 bytes | |||
-rw-r--r-- | plugins/Actman30/ico/import.ico | bin | 2550 -> 0 bytes | |||
-rw-r--r-- | plugins/Actman30/ico/insert.ico | bin | 2550 -> 0 bytes | |||
-rw-r--r-- | plugins/Actman30/ico/message.ico | bin | 2550 -> 0 bytes | |||
-rw-r--r-- | plugins/Actman30/ico/new.ico | bin | 2550 -> 0 bytes | |||
-rw-r--r-- | plugins/Actman30/ico/program.ico | bin | 2550 -> 0 bytes | |||
-rw-r--r-- | plugins/Actman30/ico/reload.ico | bin | 2550 -> 0 bytes | |||
-rw-r--r-- | plugins/Actman30/ico/rw.ico | bin | 2550 -> 0 bytes | |||
-rw-r--r-- | plugins/Actman30/ico/service.ico | bin | 2550 -> 0 bytes | |||
-rw-r--r-- | plugins/Actman30/ico/test.ico | bin | 2550 -> 0 bytes | |||
-rw-r--r-- | plugins/Actman30/ico/up.ico | bin | 2550 -> 0 bytes | |||
-rw-r--r-- | plugins/Actman30/options.rc | 70 | ||||
-rw-r--r-- | plugins/Actman30/options.res | bin | 1004 -> 0 bytes | |||
-rw-r--r-- | plugins/Actman30/ua/action.ico | bin | 2550 -> 0 bytes | |||
-rw-r--r-- | plugins/Actman30/ua/i_uconst.inc | 36 | ||||
-rw-r--r-- | plugins/Actman30/ua/ua.pas | 119 | ||||
-rw-r--r-- | plugins/Actman30/ua/ua.rc | 54 | ||||
-rw-r--r-- | plugins/Actman30/ua/ua.res | bin | 3992 -> 0 bytes |
229 files changed, 6266 insertions, 6284 deletions
diff --git a/bin10/pascal32.bat b/bin10/pascal32.bat index c974b6aa3a..91aba6b768 100644 --- a/bin10/pascal32.bat +++ b/bin10/pascal32.bat @@ -7,11 +7,6 @@ call make.bat fpc 10 if errorlevel 1 goto :Error
popd
-pushd Actman30
-call make.bat fpc 10
-if errorlevel 1 goto :Error
-popd
-
pushd ImportTXT
call make.bat fpc 10
if errorlevel 1 goto :Error
diff --git a/bin10/pascal64.bat b/bin10/pascal64.bat index 3bf3fc90ea..a6a7c2c9a2 100644 --- a/bin10/pascal64.bat +++ b/bin10/pascal64.bat @@ -7,11 +7,6 @@ call make.bat fpc64 10 if errorlevel 1 goto :Error
popd
-pushd Actman30
-call make.bat fpc64 10
-if errorlevel 1 goto :Error
-popd
-
pushd mRadio
call make.bat fpc64 10
if errorlevel 1 goto :Error
diff --git a/bin12/pascal32.bat b/bin12/pascal32.bat index 9ec75975d7..3e19a14491 100644 --- a/bin12/pascal32.bat +++ b/bin12/pascal32.bat @@ -7,11 +7,6 @@ call make.bat fpc 12 if errorlevel 1 goto :Error
popd
-pushd Actman30
-call make.bat fpc 12
-if errorlevel 1 goto :Error
-popd
-
pushd ImportTXT
call make.bat fpc 12
if errorlevel 1 goto :Error
@@ -40,4 +35,5 @@ goto :eof :Error
echo ============================= FAIL! =============================
+pause
exit
diff --git a/bin12/pascal64.bat b/bin12/pascal64.bat index 6796e19d13..5da0fc70c4 100644 --- a/bin12/pascal64.bat +++ b/bin12/pascal64.bat @@ -7,11 +7,6 @@ call make.bat fpc64 12 if errorlevel 1 goto :Error
popd
-pushd Actman30
-call make.bat fpc64 12
-if errorlevel 1 goto :Error
-popd
-
pushd mRadio
call make.bat fpc64 12
if errorlevel 1 goto :Error
@@ -35,4 +30,5 @@ goto :eof :Error
echo ============================= FAIL! =============================
+pause
exit
diff --git a/plugins/Actman/actman.dpr b/plugins/!Deprecated/Actman20/actman.dpr index e2a67414f5..e2a67414f5 100644 --- a/plugins/Actman/actman.dpr +++ b/plugins/!Deprecated/Actman20/actman.dpr diff --git a/plugins/Actman30/global.pas b/plugins/!Deprecated/Actman20/global.pas index 276f71dea7..50254b383e 100644 --- a/plugins/Actman30/global.pas +++ b/plugins/!Deprecated/Actman20/global.pas @@ -2,14 +2,6 @@ unit global; interface
-const
- DBBranch = 'ActMan';
-const
- ACF_SELECTED = $08000000;
- ACF_EXPORT = ACF_SELECTED;
- ACF_IMPORT = ACF_SELECTED;
- ACF_OVERLOAD = $01000000;
-
type
tAddOption = function(var tmpl:pAnsiChar;var proc:pointer;var name:PAnsiChar):integer;
type
diff --git a/plugins/Actman30/hooks/hooks.pas b/plugins/!Deprecated/Actman20/hooks/hooks.pas index 0bfa508afe..b3309c327a 100644 --- a/plugins/Actman30/hooks/hooks.pas +++ b/plugins/!Deprecated/Actman20/hooks/hooks.pas @@ -2,15 +2,21 @@ unit hooks; interface
+procedure Init;
+procedure DeInit;
+function AddOptionPage(var tmpl:pAnsiChar;var proc:pointer;var name:PAnsiChar):integer;
+
implementation
uses
windows, commctrl, messages,
- mirutils, common, dbsettings, m_api, wrapper,
+ mirutils, common, dbsettings, io, m_api, wrapper,
global, mApiCardM;
{$R hooks.res}
+{$include m_actman.inc}
+
{$include i_hook.inc}
{$include i_hconst.inc}
{$include i_options.inc}
diff --git a/plugins/Actman30/hooks/hooks.rc b/plugins/!Deprecated/Actman20/hooks/hooks.rc index ff351cc94d..ff351cc94d 100644 --- a/plugins/Actman30/hooks/hooks.rc +++ b/plugins/!Deprecated/Actman20/hooks/hooks.rc diff --git a/plugins/Actman30/hooks.res b/plugins/!Deprecated/Actman20/hooks/hooks.res Binary files differindex 1cf202f414..1cf202f414 100644 --- a/plugins/Actman30/hooks.res +++ b/plugins/!Deprecated/Actman20/hooks/hooks.res diff --git a/plugins/Actman30/hooks/i_hconst.inc b/plugins/!Deprecated/Actman20/hooks/i_hconst.inc index d011278b7e..d011278b7e 100644 --- a/plugins/Actman30/hooks/i_hconst.inc +++ b/plugins/!Deprecated/Actman20/hooks/i_hconst.inc diff --git a/plugins/Actman30/hooks/i_hook.inc b/plugins/!Deprecated/Actman20/hooks/i_hook.inc index 7bdf64fd47..8b7b487d98 100644 --- a/plugins/Actman30/hooks/i_hook.inc +++ b/plugins/!Deprecated/Actman20/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/!Deprecated/Actman20/hooks/i_opt_dlg.inc index 23adcf0848..d208ec4384 100644 --- a/plugins/Actman30/hooks/i_opt_dlg.inc +++ b/plugins/!Deprecated/Actman20/hooks/i_opt_dlg.inc @@ -133,9 +133,7 @@ end; procedure SaveHookData(Dialog:HWND; item:integer=-1);
var
wnd:HWND;
- li:LV_ITEMW;
- p:pAnsiChar;
- buf:array [0..127] of WideChar;
+ li:LV_ITEM;
begin
wnd:=GetDlgItem(Dialog,IDC_HOOKLIST);
if item<0 then
@@ -148,23 +146,9 @@ begin SendMessageW(wnd,LVM_SETITEMW,0,LPARAM(@li));
li.mask :=LVIF_TEXT;
li.iSubItem :=1;
- p:=ApiCard.NameFromList(GetDlgItem(Dialog,IDC_EVENTLIST));
- li.pszText :=FastAnsitoWideBuf(p,buf);
+ li.pszText :=GetDlgText(Dialog,IDC_EVENTLIST);
SendMessageW(wnd,LVM_SETITEMW,0,LPARAM(@li));
-end;
-
-procedure CheckButtons(Dialog:HWND);
-var
- b:bool;
-begin
- b:=SendDlgItemMessage(Dialog,IDC_HOOKLIST,LVM_GETITEMCOUNT, 0, 0)>0;
-
- EnableWindow(GetDlgItem(Dialog,IDC_EVENTLIST ),b);
- EnableWindow(GetDlgItem(Dialog,IDC_ACTIONLIST ),b);
- EnableWindow(GetDlgItem(Dialog,IDC_HOOK_DELETE),b);
- EnableWindow(GetDlgItem(Dialog,IDC_HOOK_APPLY ),b);
- EnableWindow(GetDlgItem(Dialog,IDC_EVENT_CHELP),b);
- EnableWindow(GetDlgItem(Dialog,IDC_EVENT_HELP ),b);
+ mFreeMem(li.pszText);
end;
function NewHook(Dialog:HWND;item:integer=-1):integer;
@@ -181,33 +165,25 @@ begin li.iSubItem:=0;
li.pszText :=TranslateW('hook sample');
result:=SendMessageW(wnd,LVM_INSERTITEMW,0,LPARAM(@li));
- Listview_SetItemState(wnd,result,
- LVIS_FOCUSED or LVIS_SELECTED,
- LVIS_FOCUSED or LVIS_SELECTED);
- CheckButtons(Dialog);
end;
function DeleteHook(Dialog:HWND):integer;
var
wnd:HWND;
- i,j:integer;
+ i:integer;
begin
result:=0;
wnd:=GetDlgItem(Dialog,IDC_HOOKLIST);
- j:=SendMessage(wnd,LVM_GETITEMCOUNT,0,0);
- for i:=j-1 downto 0 do
+ for i:=ListView_GetItemCount(wnd)-1 downto 0 do
begin
- if SendMessage(wnd,LVM_GETITEMSTATE,i,LVIS_SELECTED)<>0 then
+ if ListView_GetItemState(wnd,i,LVIS_SELECTED)<>0 then
SendMessage(wnd,LVM_DELETEITEM,i,0);
end;
- Listview_SetItemState(wnd,0,
- LVIS_FOCUSED or LVIS_SELECTED,
- LVIS_FOCUSED or LVIS_SELECTED);
-
- CheckButtons(Dialog);
+ Listview_SetItemState(wnd,0,LVIS_FOCUSED or LVIS_SELECTED,
+ LVIS_FOCUSED or LVIS_SELECTED);
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
@@ -278,31 +254,10 @@ begin SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,LPARAM(@ti));
end;
-procedure CreateHKTable(Dialog:HWND);
+function DlgProcOpt(Dialog:HWnd;hMessage:UINT;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
var
wnd:HWND;
lv:LV_COLUMNW;
-begin
- wnd:=GetDlgItem(Dialog,IDC_HOOKLIST);
- SendMessage(wnd,LVM_SETUNICODEFORMAT,1,0);
- FillChar(lv,SizeOf(lv),0);
- lv.mask :=LVCF_TEXT or LVCF_WIDTH;
- lv.pszText:=TranslateW('Description');
- lv.cx :=110;
- SendMessageW(wnd,LVM_INSERTCOLUMNW ,0,TLPARAM(@lv));
- lv.pszText:=TranslateW('Name');
- lv.cx :=110;
- SendMessageW(wnd,LVM_INSERTCOLUMNW ,1,TLPARAM(@lv));
- SendMessageW(wnd,LVM_SETCOLUMNWIDTH,1,LVSCW_AUTOSIZE_USEHEADER);
-// SendMessage (wnd,LVM_SETEXTENDEDLISTVIEWSTYLE,LVS_EX_CHECKBOXES,LVS_EX_CHECKBOXES);
- SendMessage (wnd,LVM_SETEXTENDEDLISTVIEWSTYLE,0,
- LVS_EX_FULLROWSELECT or LVS_EX_CHECKBOXES or LVS_EX_GRIDLINES);
- SendMessage(wnd,LVM_SETUNICODEFORMAT,1,0);
- OldTableProc:=pointer(SetWindowLongPtrW(wnd,GWL_WNDPROC,LONG_PTR(@NewHKTableProc)));
-end;
-
-function DlgProcOpt(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
-var
i:integer;
tmp:pAnsiChar;
buf:array [0..255] of AnsiChar;
@@ -319,29 +274,36 @@ begin WM_INITDIALOG: begin
ApiCard:=CreateEventCard(Dialog);
+ wnd:=GetDlgItem(Dialog,IDC_HOOKLIST);
+ SendMessage(wnd,LVM_SETUNICODEFORMAT,1,0);
+ FillChar(lv,SizeOf(lv),0);
+ lv.mask :=LVCF_TEXT or LVCF_WIDTH;
+ lv.pszText:=TranslateW('Description');
+ lv.cx :=110;
+ SendMessageW(wnd,LVM_INSERTCOLUMNW ,0,TLPARAM(@lv));
+ lv.pszText:=TranslateW('Name');
+ lv.cx :=110;
+ SendMessageW(wnd,LVM_INSERTCOLUMNW ,1,TLPARAM(@lv));
+ SendMessageW(wnd,LVM_SETCOLUMNWIDTH,1,LVSCW_AUTOSIZE_USEHEADER);
+// SendMessage (wnd,LVM_SETEXTENDEDLISTVIEWSTYLE,LVS_EX_CHECKBOXES,LVS_EX_CHECKBOXES);
+ SendMessage (wnd,LVM_SETEXTENDEDLISTVIEWSTYLE,0,
+ LVS_EX_FULLROWSELECT or LVS_EX_CHECKBOXES or LVS_EX_GRIDLINES);
+ SendMessage(wnd,LVM_SETUNICODEFORMAT,1,0);
+ OldTableProc:=pointer(SetWindowLongPtrW(wnd,GWL_WNDPROC,LONG_PTR(@NewHKTableProc)));
TranslateDialogDefault(Dialog);
SetIcons(Dialog);
- ApiCard.FillList(GetDlgItem(Dialog,IDC_EVENTLIST),
- DBReadByte(0,DBBranch,'SrvListMode'));
-
+ ApiCard.FillList(GetDlgItem(Dialog,IDC_EVENTLIST));
FillActionList(GetDlgItem(Dialog,IDC_ACTIONLIST));
-
- CreateHKTable(Dialog);
- FillHookList(GetDlgItem(Dialog,IDC_HOOKLIST));
+ FillHookList(wnd);
ShowHookData(Dialog);
- CheckButtons(Dialog);
-
onactchanged:=HookEvent(ME_ACT_CHANGED,@ActListChange);
settings:=Dialog;
end;
WM_HELP: begin
- tmp:=ApiCard.NameFromList(GetDlgItem(Dialog,IDC_EVENTLIST));
- ApiCard.Event:=tmp;
- mFreeMem(tmp);
ApiCard.Show;
end;
@@ -388,7 +350,7 @@ begin BN_CLICKED: begin
case loword(wParam) of
- IDC_EVENT_CHELP: SendMessage(Dialog,WM_HELP,0,0);
+ IDC_EVENT_CHELP: ;
IDC_EVENT_HELP : ;
IDC_HOOK_NEW : NewHook(Dialog);
IDC_HOOK_DELETE: DeleteHook(Dialog);
diff --git a/plugins/Actman30/hooks/i_options.inc b/plugins/!Deprecated/Actman20/hooks/i_options.inc index 4404cfbde6..4404cfbde6 100644 --- a/plugins/Actman30/hooks/i_options.inc +++ b/plugins/!Deprecated/Actman20/hooks/i_options.inc diff --git a/plugins/Actman/i_action.inc b/plugins/!Deprecated/Actman20/i_action.inc index 01b02d1b2f..01b02d1b2f 100644 --- a/plugins/Actman/i_action.inc +++ b/plugins/!Deprecated/Actman20/i_action.inc diff --git a/plugins/Actman/i_actlow.inc b/plugins/!Deprecated/Actman20/i_actlow.inc index a620471398..a620471398 100644 --- a/plugins/Actman/i_actlow.inc +++ b/plugins/!Deprecated/Actman20/i_actlow.inc diff --git a/plugins/!Deprecated/Actman20/i_const.inc b/plugins/!Deprecated/Actman20/i_const.inc new file mode 100644 index 0000000000..3e9950414f --- /dev/null +++ b/plugins/!Deprecated/Actman20/i_const.inc @@ -0,0 +1,219 @@ +{resource constants}
+const
+ // dialogs
+ IDD_ACTION = 1025;
+ IDD_STRUCTURE = 1027;
+ IDD_ASK = 1028;
+
+ // icons
+ IDI_NEW = 1025;
+ IDI_UP = 1026;
+ IDI_DOWN = 1027;
+ IDI_DELETE = 1028;
+ IDI_RELOAD = 1029;
+ IDI_CONTACT = 1030;
+ IDI_SERVICE = 1031;
+ IDI_PROGRAM = 1032;
+ IDI_INSERT = 1033;
+ IDI_ADVANCE = 1034;
+ IDI_CHAIN = 1035;
+ IDI_RW = 1036;
+ IDI_TEST = 1037;
+ IDI_EXPORT = 1038;
+ IDI_IMPORT = 1039;
+ IDI_MESSAGE = 1040;
+ IDI_VAR_CHECKED = 1041;
+ IDI_VAR_UNCHECKED = 1042;
+ IDI_FORMAT = 1043;
+ IDI_APPLY = 1044;
+
+ // Structure editor
+ IDC_DATA_FULL = 2001;
+ IDC_DATA_TYPE = 2002;
+ IDC_DATA_EDIT = 2005;
+ IDC_DATA_LEN = 2006;
+ IDC_DATA_HELP = 2007;
+
+ IDC_DATA_NEW = 2008;
+ IDC_DATA_DELETE = 2009;
+ IDC_DATA_UP = 2010;
+ IDC_DATA_DOWN = 2011;
+ IDC_DATA_CHANGE = 2012;
+ IDC_DATA_VARS = 2013;
+ IDC_DATA_PACKED = 2014;
+
+ // Action page
+// IDC_RESET = 2001;
+
+ IDC_ACTION_TYPE = 2005;
+ IDC_STAT_ACTION = 2006;
+
+ IDC_ACTION_LIST = 2007;
+ IDC_ACTION_NEW = 2008;
+ IDC_ACTION_DELETE = 2009;
+ IDC_ACTION_UP = 2010;
+ IDC_ACTION_DOWN = 2011;
+
+ IDC_ACTION_GROUP = 2012;
+ IDC_GROUP_NEW = 2015;
+ IDC_GROUP_RELOAD = 2016;
+ IDC_GROUP_DELETE = 2017;
+ IDC_GROUP_TEST = 2018;
+ IDC_GROUP_UP = 2019;
+ IDC_GROUP_DOWN = 2020;
+ IDC_GROUP_EXPORT = 2021;
+ IDC_GROUP_IMPORT = 2022;
+ IDC_ACTION_HELP = 2023;
+
+ IDC_STAT_CONTACT = 2140;
+ IDC_CONTACTLIST = 2141;
+ IDC_CNT_KEEP = 2142;
+ IDC_STAT_FORMAT = 2143;
+ IDC_EDIT_FORMAT = 2144;
+ IDC_CNT_FILTER = 2145;
+ IDC_CNT_APPLY = 2146;
+ IDC_STAT_FHELP = 2147;
+
+ IDC_STAT_WPAR1 = 2150;
+ IDC_STAT_LPAR1 = 2151;
+ IDC_STAT_WPAR = 2152;
+ IDC_STAT_LPAR = 2153;
+ IDC_FLAG_WPAR = 2154;
+ IDC_FLAG_LPAR = 2155;
+ IDC_EDIT_WPAR = 2156;
+ IDC_EDIT_LPAR = 2157;
+ IDC_STAT_SERVICE = 2158;
+ IDC_EDIT_SERVICE = 2159;
+ IDC_WSTRUCT = 2160;
+ IDC_LSTRUCT = 2161;
+
+ IDC_RES_POPUP = 2251;
+ IDC_RES_MESSAGE = 2252;
+ IDC_RES_INSERT = 2253;
+ IDC_SRV_RESSTAT = 2254;
+ IDC_SRV_RESULT = 2255;
+ IDC_RES_FREEMEM = 2256;
+ IDC_RES_UNICODE = 2257;
+ IDC_RES_SIGNED = 2258;
+ IDC_RES_GROUP = 2259;
+
+ IDC_FLAG_MINIMIZE = 2350;
+ IDC_STAT_PRGPATH = 2351;
+ IDC_EDIT_PRGPATH = 2352;
+ IDC_PROGRAM = 2353;
+ IDC_STAT_PRGARGS = 2354;
+ IDC_EDIT_PRGARGS = 2355;
+ IDC_EDIT_PROCTIME = 2356;
+ IDC_PROCESS_GROUP = 2357;
+ IDC_STAT_PROCTIME = 2358;
+ IDC_PRSTART_GROUP = 2359;
+ IDC_FLAG_NORMAL = 2360;
+ IDC_FLAG_HIDDEN = 2361;
+ IDC_FLAG_MAXIMIZE = 2362;
+ IDC_FLAG_CURPATH = 2363;
+ IDC_FLAG_PARALLEL = 2364;
+ IDC_FLAG_CONTINUE = 2365;
+ IDC_HLP_FVARS = 2366;
+
+ IDC_HLP_VARS = 2451;
+ IDC_STAT_INSERT = 2452;
+ IDC_EDIT_INSERT = 2453;
+
+ IDC_FLAG_CLIP = 2454;
+ IDC_FLAG_MESSAGE = 2455;
+ IDC_CLIP_COPYTO = 2456;
+ IDC_CLIP_PASTE = 2457;
+ IDC_CLIP_GROUP = 2458;
+ IDC_FILE_ENC = 2459;
+// IDC_CLIP_ANSI = 2459;
+// IDC_CLIP_WIDE = 2460;
+ IDC_FLAG_FILE = 2461;
+ IDC_FILE_PATH = 2462;
+ IDC_FILE_FILEBTN = 2463;
+ IDC_FILE_READ = 2464;
+ IDC_FILE_WRITE = 2465;
+ IDC_FILE_APPEND = 2466;
+ IDC_FILE_GROUP = 2467;
+
+ IDC_STAT_GROUPS = 2500;
+ IDC_GROUP_LIST = 2501;
+
+ IDC_CONDITION = 2505;
+ IDC_FLAG_GT = 2506;
+ IDC_FLAG_LT = 2507;
+ IDC_FLAG_EQ = 2508;
+ IDC_FLAG_NOP = 2509;
+ IDC_FLAG_NOT = 2510;
+
+ IDC_OPERATION = 2511;
+ IDC_FLAG_BREAK = 2512;
+ IDC_FLAG_JUMP = 2513;
+ IDC_FLAG_ANOP = 2514;
+ IDC_ADV_VALUE = 2515;
+ IDC_STAT_VAL = 2516;
+
+ IDC_FLAG_MATH = 2519;
+ IDC_ADV_OPER = 2520;
+ IDC_ADV_VAL1 = 2521;
+ IDC_ADV_VAL2 = 2522;
+ IDC_FLAG_VARS = 2523;
+ IDC_ADV_VARS = 2524;
+ IDC_ADV_HVARS = 2526;
+ IDC_ADV_ASINT = 2527;
+
+ IDC_RW_READ = 2601;
+ IDC_RW_WRITE = 2602;
+ IDC_RW_DELETE = 2603;
+ IDC_RW_STATM = 2605;
+ IDC_RW_MODULE = 2606;
+ IDC_RW_STATS = 2607;
+ IDC_RW_SETTING = 2608;
+ IDC_RW_TEXT = 2609;
+ IDC_RW_VALUE = 2610;
+ IDC_RW_DATATYPE = 2611;
+ IDC_RW_CURRENT = 2614;
+ IDC_RW_PARAM = 2615;
+ IDC_RW_MANUAL = 2616;
+ IDC_RW_OPER = 2617;
+ IDC_RW_VAL = 2618;
+ IDC_RW_RESULT = 2619;
+ IDC_RW_LAST = 2620;
+
+ IDC_MSG_STAT1 = 2701;
+ IDC_MSG_STAT2 = 2702;
+ IDC_MSG_TITLE = 2703;
+ IDC_MSG_TEXT = 2704;
+ IDC_MSG_BTNS = 2705;
+ IDC_MSGB_ARI = 2706;
+ IDC_MSGB_OK = 2707;
+ IDC_MSGB_OC = 2708;
+ IDC_MSGB_RC = 2709;
+ IDC_MSGB_YN = 2710;
+ IDC_MSGB_YNC = 2711;
+ IDC_MSG_ICONS = 2712;
+ IDC_MSGI_NONE = 2713;
+ IDC_MSGI_WARN = 2714;
+ IDC_MSGI_INFO = 2715;
+ IDC_MSGI_QUEST = 2716;
+ IDC_MSGI_ERROR = 2717;
+ IDC_MSG_KEEP = 2718;
+
+// Variables buttons
+ IDC_SRV_WPAR = 3000;
+ IDC_SRV_LPAR = 3001;
+ IDC_SRV_SRVC = 3002;
+ IDC_PRG_PRG = 3003;
+ IDC_PRG_ARG = 3004;
+ IDC_TXT_FILE = 3005;
+ IDC_TXT_TEXT = 3006;
+ IDC_RW_MVAR = 3008;
+ IDC_RW_SVAR = 3009;
+ IDC_RW_TVAR = 3010;
+ IDC_MSG_TTL = 3011;
+ IDC_MSG_TXT = 3012;
+
+// Question
+ IDC_ASK = 1025;
+ IDC_YESALL = 1026;
+ IDC_NOALL = 1027;
+ IDC_APPEND = 1028;
diff --git a/plugins/Actman/i_contact.inc b/plugins/!Deprecated/Actman20/i_contact.inc index c73df31435..c73df31435 100644 --- a/plugins/Actman/i_contact.inc +++ b/plugins/!Deprecated/Actman20/i_contact.inc diff --git a/plugins/Actman/i_dlglists.inc b/plugins/!Deprecated/Actman20/i_dlglists.inc index 52808e63cd..52808e63cd 100644 --- a/plugins/Actman/i_dlglists.inc +++ b/plugins/!Deprecated/Actman20/i_dlglists.inc diff --git a/plugins/Actman/i_inoutxm.inc b/plugins/!Deprecated/Actman20/i_inoutxm.inc index 41e705f418..41e705f418 100644 --- a/plugins/Actman/i_inoutxm.inc +++ b/plugins/!Deprecated/Actman20/i_inoutxm.inc diff --git a/plugins/!Deprecated/Actman20/i_opt_dlg.inc b/plugins/!Deprecated/Actman20/i_opt_dlg.inc new file mode 100644 index 0000000000..3e07cd97ae --- /dev/null +++ b/plugins/!Deprecated/Actman20/i_opt_dlg.inc @@ -0,0 +1,215 @@ +{}
+const
+ etHK = 1; // Groups changed
+ etACT = 2; // Actions changed
+const
+ ACI_APPLY :PAnsiChar = 'ACI_Apply';
+ ACI_NEW :PAnsiChar = 'ACI_New';
+ ACI_UP :PAnsiChar = 'ACI_Up';
+ ACI_DOWN :PAnsiChar = 'ACI_Down';
+ ACI_DELETE :PAnsiChar = 'ACI_Delete';
+ ACI_RELOAD :PAnsiChar = 'ACI_Reload';
+ ACI_TEST :PAnsiChar = 'ACI_Test';
+ ACI_IMPORT :PAnsiChar = 'ACI_Import';
+ ACI_EXPORT :PAnsiChar = 'ACI_Export';
+const
+ ACI_CONTACT = 'ACI_Contact';
+ ACI_SERVICE = 'ACI_Service';
+ ACI_PROGRAM = 'ACI_Program';
+ ACI_INSERT = 'ACI_Insert';
+ ACI_ADVANCE = 'ACI_Advanced';
+ ACI_CHAIN = 'ACI_Chain';
+ ACI_RW = 'ACI_Database';
+ ACI_MESSAGE = 'ACI_Message';
+
+ ACI_FORMAT = 'ACI_Format';
+
+ ACI_VAR_UNCHECKED = 'ACI_VarUnChecked';
+ ACI_VAR_CHECKED = 'ACI_VarChecked';
+
+const
+ sresInt = 0;
+ sresHex = 1;
+ sresString = 2;
+ sresStruct = 3;
+type
+ tActId = record
+ code:dword;
+ id :dword;
+ icon:PAnsiChar;
+ text:PAnsiChar;
+ end;
+const
+ ActIds:array [0..ACT_MAXTYPE-1] of tActId = (
+ (code:ACT_CONTACT; id:IDI_CONTACT; icon:ACI_CONTACT; text:'Open contact window'),
+ (code:ACT_SERVICE; id:IDI_SERVICE; icon:ACI_SERVICE; text:'Call service'),
+ (code:ACT_PROGRAM; id:IDI_PROGRAM; icon:ACI_PROGRAM; text:'Execute program'),
+ (code:ACT_TEXT ; id:IDI_INSERT ; icon:ACI_INSERT ; text:'Insert text'),
+ (code:ACT_ADVANCE; id:IDI_ADVANCE; icon:ACI_ADVANCE; text:'Advanced'),
+ (code:ACT_CHAIN ; id:IDI_CHAIN ; icon:ACI_CHAIN ; text:'Link to action'),
+ (code:ACT_RW ; id:IDI_RW ; icon:ACI_RW ; text:'Profile'),
+ (code:ACT_MESSAGE; id:IDI_MESSAGE; icon:ACI_MESSAGE; text:'MessageBox'));
+
+procedure RegisterIcon(var sid:TSKINICONDESC;id:uint_ptr;name:PAnsiChar;descr:PAnsiChar);
+var
+ buf:array [0..63] of WideChar;
+begin
+ sid.hDefaultIcon :=LoadImage(hInstance,MAKEINTRESOURCE(id),IMAGE_ICON,16,16,0);
+ sid.pszName :=name;
+ sid.szDescription.w:=FastAnsiToWideBuf(descr,buf);
+ Skin_AddIcon(@sid);
+ DestroyIcon(sid.hDefaultIcon);
+end;
+
+procedure RegisterIcons;
+var
+ sid:TSKINICONDESC;
+ i:integer;
+begin
+ FillChar(sid,SizeOf(TSKINICONDESC),0);
+ sid.cbSize :=SizeOf(TSKINICONDESC);
+ sid.cx :=16;
+ sid.cy :=16;
+ sid.flags :=SIDF_UNICODE;
+ sid.szSection.w:='Actions';
+
+ RegisterIcon(sid,IDI_APPLY ,ACI_APPLY ,'Apply');
+ RegisterIcon(sid,IDI_NEW ,ACI_NEW ,'New');
+ RegisterIcon(sid,IDI_DELETE ,ACI_DELETE ,'Delete');
+ RegisterIcon(sid,IDI_UP ,ACI_UP ,'Up');
+ RegisterIcon(sid,IDI_DOWN ,ACI_DOWN ,'Down');
+ RegisterIcon(sid,IDI_RELOAD ,ACI_RELOAD ,'Reload');
+ RegisterIcon(sid,IDI_TEST ,ACI_TEST ,'Test');
+ RegisterIcon(sid,IDI_IMPORT ,ACI_IMPORT ,'Import');
+ RegisterIcon(sid,IDI_EXPORT ,ACI_EXPORT ,'Export');
+
+ RegisterIcon(sid,IDI_FORMAT ,ACI_FORMAT ,'Contact list format');
+
+ for i:=0 to ACT_MAXTYPE-1 do
+ with ActIds[i] do
+ RegisterIcon(sid,id,icon,text);
+
+ sid.cx:=8;
+ sid.cy:=8;
+ RegisterIcon(sid,IDI_VAR_CHECKED ,ACI_VAR_CHECKED ,'Use Variables');
+ RegisterIcon(sid,IDI_VAR_UNCHECKED,ACI_VAR_UNCHECKED,'Don''t use Variables');
+end;
+
+procedure SetStart;
+begin
+ if NewGroupList=nil then
+ begin
+ NewGroupList:=GroupList;
+ NewMaxGroups:=MaxGroups;
+ end;
+ if NewActionList=nil then
+ begin
+ NewActionList:=ActionList;
+ NewMaxActions:=MaxActions;
+ end;
+end;
+
+procedure SetChanged(wnd:HWND;atype:integer);
+begin
+ SendMessage(GetParent(wnd),PSM_CHANGED,0,0);
+ if ((atype and etHK )<>0) and (NewGroupList =GroupList ) then NewGroupList :=CloneGroupList;
+ if ((atype and etACT)<>0) and (NewActionList=ActionList) then NewActionList:=CloneActionList;
+end;
+
+procedure SetSave(Dialog:HWND;curIdx:integer);
+var
+ i,j:integer;
+ li:LV_ITEMW;
+ wnd:HWND;
+begin
+ if NewGroupList<>GroupList then
+ begin
+
+ DestroyGroups(GroupList,MaxGroups);
+ wnd:=GetDlgItem(Dialog,IDC_ACTION_GROUP);
+ j:=SendMessageW(wnd,LVM_GETITEMCOUNT,0,0);
+ MaxGroups:=j;
+ if j>0 then
+ begin
+ GetMem (GroupList ,MaxGroups*SizeOf(tHKRecord));
+ FillChar(GroupList^,MaxGroups*SizeOf(tHKRecord),0);
+ li.mask :=LVIF_PARAM;
+ li.iSubItem:=0;
+ for i:=0 to j-1 do
+ begin
+ li.iItem:=i;
+ SendMessageW(wnd,LVM_GETITEMW,0,lparam(@li)); // GetLParam(wnd,i);
+ move(NewGroupList^[li.lParam],GroupList^[i],SizeOf(tHKRecord));
+ li.lParam:=i;
+ SendMessageW(wnd,LVM_SETITEMW,0,lparam(@li));
+ end;
+ end
+ else
+ GroupList:=nil;
+
+ FreeMem(NewGroupList);
+ NewGroupList:=GroupList;
+ NewMaxGroups:=MaxGroups;
+ end;
+end;
+
+procedure SetCancel;
+begin
+ if NewActionList<>nil then
+ begin
+ if (NewActionList<>ActionList) then
+ DestroyActions(NewActionList,NewMaxActions);
+ NewActionList:=nil;
+ end;
+ if NewGroupList<>nil then
+ begin
+ if (NewGroupList<>GroupList) then
+ DestroyGroups(NewGroupList,NewMaxGroups);
+ NewGroupList:=nil;
+ end;
+end;
+
+{$include i_opt_dlg2.inc}
+
+function OnOptInitialise(wParam:WPARAM;lParam:LPARAM):int;cdecl;
+var
+ odp:TOPTIONSDIALOGPAGE;
+ ptr:pActionLink;
+ tmpl:pAnsiChar;
+ name:pansiChar;
+ proc:pointer;
+ i:integer;
+begin
+ result:=0;
+ NoDescription :=TranslateW('No description');
+ StrCopyW(xmlfilename,'c:\export.xml');
+
+ DoInitCommonControls(ICC_USEREX_CLASSES);
+
+ FillChar(odp,SizeOf(odp),0);
+ odp.cbSize :=SizeOf(odp);
+ odp.flags :=ODPF_BOLDGROUPS;
+ odp.Position :=900003000;
+ odp.hInstance :=hInstance;
+ odp.szGroup.a :='Services';
+ odp.szTitle.a :='Actions';
+ odp.szTab.a :='Actions';
+ odp.pfnDlgProc :=@DlgProcOpt2;
+ odp.pszTemplate:=PAnsiChar(IDD_ACTION);
+ Options_AddPage(wParam,@odp);
+
+ ptr:=ActionLink;
+ while ptr<>nil do
+ begin
+ if @ptr^.AddOption<>nil then
+ begin
+ i:=ptr^.AddOption(tmpl,proc,name);
+ odp.pszTemplate:=tmpl;
+ odp.pfnDlgProc :=proc;
+ odp.szTab.a :=name;
+ Options_AddPage(wParam,@odp);
+ if i>0 then continue;
+ end;
+ ptr:=ptr^.Next;
+ end;
+end;
diff --git a/plugins/!Deprecated/Actman20/i_opt_dlg2.inc b/plugins/!Deprecated/Actman20/i_opt_dlg2.inc new file mode 100644 index 0000000000..4462c12d7d --- /dev/null +++ b/plugins/!Deprecated/Actman20/i_opt_dlg2.inc @@ -0,0 +1,2095 @@ +{}
+
+const
+ inoutfilter:pWideChar = 'XML files'#0'*.xml'#0'All files'#0'*.*'#0#0;
+const
+ NoChainText:PWideChar = 'not defined';
+const
+ ActionNames:array [0..ACT_MAXTYPE] of pWideChar=(
+ 'Unknown','Contact','Service','Program','Text','Advanced','Action','Profile','Message');
+const
+ checknames:array [BST_UNCHECKED..BST_CHECKED] of PAnsiChar=(
+ ACI_VAR_UNCHECKED,ACI_VAR_CHECKED);
+const
+ MaxDescrLen = 128;
+const
+ hlpContact = 0;
+ hlpService = 1;
+ hlpProgram = 2;
+ hlpText = 3;
+ hlpAdvance = 4;
+ hlpChain = 5;
+ hlpDBRW = 6;
+ hlpMessage = 7;
+ hlpVariables = 30;
+ hlpAdvVariables = 31;
+const
+ ptNumber = 0;
+ ptString = 1;
+ ptUnicode = 2;
+ ptCurrent = 3;
+ ptResult = 4;
+ ptParam = 5;
+ ptStruct = 6;
+
+var
+ wstruct,lstruct:pAnsiChar;
+ DontReact:bool;
+ OldGroupTableProc,
+ OldActTableProc:pointer;
+ ChMask:dword;
+
+function GetNumValue(wnd:HWND;usevar:boolean;var dst):boolean;
+var
+ tmp:pWideChar;
+begin
+ result:=false;
+ pWideChar(dst):=GetDlgText(wnd);
+ if Pointer(dst)=nil then exit;
+ if not usevar then
+ begin
+ tmp:=PWideChar(dst);
+ if pWideChar(dst)^='$' then
+ begin
+ integer(dst):=HexToInt(pWideChar(dst)+1);
+ result:=true;
+ end
+ else
+ integer(dst):=StrToInt(pWideChar(dst));
+ mFreeMem(tmp);
+ end;
+end;
+
+function GetGroupName(id:dword):pWideChar;
+var
+ i:integer;
+begin
+ for i:=0 to NewMaxGroups-1 do
+ begin
+ if ((NewGroupList^[i].flags and ACF_ASSIGNED)<>0) and (id=NewGroupList^[i].id) then
+ begin
+ result:=NewGroupList^[i].descr;
+ exit;
+ end;
+ end;
+ result:=NoChainText;
+end;
+
+function AddGroup(Dialog:HWND;HKnum:dword):integer;
+var
+ li:LV_ITEMW;
+ list:HWND;
+begin
+ with NewGroupList^[HKnum] do
+ begin
+ if (flags and ACF_ASSIGNED)<>0 then
+ begin
+ list:=GetDlgItem(Dialog,IDC_ACTION_GROUP);
+ li.mask :=LVIF_PARAM+LVIF_TEXT;
+ li.iItem :=SendMessage(list,LVM_GETNEXTITEM,-1,LVNI_FOCUSED)+1;
+ li.iSubItem :=0;
+ li.lParam :=HKnum;
+ if descr=nil then
+ li.pszText:=NoDescription
+ else
+ li.pszText:=descr;
+ li.iItem :=SendMessageW(list,LVM_INSERTITEMW,0,lparam(@li));
+ if li.iItem>0 then
+ dec(li.iItem);
+ ListView_SetItemState(list,li.iItem,LVIS_FOCUSED or LVIS_SELECTED,
+ LVIS_FOCUSED or LVIS_SELECTED);
+ result:=li.iItem;
+ end
+ else
+ result:=-1;
+ end;
+end;
+
+// Fill action type combobox
+procedure FillActTypeList(list:hwnd);
+var
+ cbei:TCOMBOBOXEXITEMW;
+ il:HIMAGELIST;
+ i:integer;
+ buf:array [0..127] of WideChar;
+begin
+ SendMessage(list,CB_RESETCONTENT,0,0);
+ il:=ImageList_Create(16,16,ILC_COLOR32 or ILC_MASK,0,1);
+
+ cbei.mask:=CBEIF_IMAGE or CBEIF_SELECTEDIMAGE or CBEIF_TEXT; //!!
+ for i:=0 to ACT_MAXTYPE-1 do
+ begin
+ ImageList_AddIcon(il,CallService(MS_SKIN2_GETICON,0,lparam(ActIds[i].icon)));
+
+ cbei.pszText :=TranslateW(FastAnsiToWideBuf(ActIds[i].text,buf));
+ cbei.iItem :=i;
+ cbei.iImage :=i;
+ cbei.iSelectedImage:=i;
+ if SendMessageW(list,CBEM_INSERTITEMW,0,lparam(@cbei))=-1 then break;
+ end;
+ ImageList_Destroy(SendMessage(list,CBEM_SETIMAGELIST,0,il));
+ SendMessage(list,CB_SETCURSEL,0,0);
+end;
+
+procedure FillSubList(Dialog:hwnd);
+var
+ list,wnd:HWND;
+ i,act:integer;
+ arr:array [0..127] of WideChar;
+ li:LV_ITEMW;
+begin
+ wnd:=GetDlgItem(Dialog,IDC_ADV_VAL2);
+
+ SendMessage(wnd,CB_RESETCONTENT,0,0);
+
+ list:=GetDlgItem(Dialog,IDC_ACTION_LIST);
+ act:=SendMessageW(list,LVM_GETITEMCOUNT,0,0);
+ i:=0;
+ li.mask :=LVIF_TEXT;
+ li.iSubItem :=0;
+ li.pszText :=@arr;
+ li.cchTextMax:=SizeOf(arr) div SizeOf(WideChar);
+ while i<act do
+ begin
+ li.iItem:=i;
+ SendMessageW(list,LVM_GETITEMW,0,lparam(@li));
+ SendMessageW(wnd,CB_ADDSTRING,0,lparam(PWideChar(@arr)));
+ inc(i);
+ end;
+ SendMessage(wnd,CB_SETCURSEL,0,0);
+end;
+
+procedure FillChainList(Dialog:hwnd);
+var
+ wnd:HWND;
+ i:integer;
+// num:integer;
+begin
+ wnd:=GetDlgItem(Dialog,IDC_GROUP_LIST);
+// for current chain exclude
+// num:=SendDlgItemMessage(Dialog,IDC_ACTION_GROUP,LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
+
+ SendMessage(wnd,CB_RESETCONTENT,0,0);
+ SendMessage(wnd,CB_SETITEMDATA,
+ SendMessageW(wnd,CB_ADDSTRING,0,lparam(TranslateW(NoChainText))),0);
+ for i:=0 to NewMaxGroups-1 do
+ begin
+ if (NewGroupList^[i].flags and (ACF_ASSIGNED or ACF_VOLATILE))=ACF_ASSIGNED then
+ begin
+ SendMessage(wnd,CB_SETITEMDATA,
+ SendMessageW(wnd,CB_ADDSTRING,0,lparam(NewGroupList^[i].descr)),
+ NewGroupList^[i].id);
+ end;
+ end;
+end;
+
+// action group table procedure (key hook)
+function NewGroupTableProc(Dialog:HWnd;hMessage:uint;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+var
+ i:integer;
+begin
+ result:=0;
+ case hMessage of
+ WM_KEYDOWN: begin
+ if (lParam and (1 shl 30))=0 then
+ begin
+ case wParam of
+ VK_F2: begin
+ i:=SendMessage(Dialog,LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
+ if i>=0 then
+ PostMessageW(Dialog,LVM_EDITLABELW,i,0);
+ exit;
+ end;
+ VK_INSERT: begin
+ PostMessage(GetParent(Dialog),WM_COMMAND,(BN_CLICKED shl 16)+IDC_GROUP_NEW,0);
+ exit;
+ end;
+ VK_DELETE: begin
+ PostMessage(GetParent(Dialog),WM_COMMAND,(BN_CLICKED shl 16)+IDC_GROUP_DELETE,0);
+ exit;
+ end;
+ VK_UP: begin
+ if (GetKeyState(VK_CONTROL) and $8000)<>0 then
+ begin
+ PostMessage(GetParent(Dialog),WM_COMMAND,(BN_CLICKED shl 16)+IDC_GROUP_UP,0);
+ exit;
+ end;
+ end;
+ VK_DOWN: begin
+ if (GetKeyState(VK_CONTROL) and $8000)<>0 then
+ begin
+ PostMessage(GetParent(Dialog),WM_COMMAND,(BN_CLICKED shl 16)+IDC_GROUP_DOWN,0);
+ exit;
+ end;
+ end;
+ end;
+ end;
+ end;
+ end;
+ result:=CallWindowProc(OldGroupTableProc,Dialog,hMessage,wParam,lParam);
+end;
+
+// action (chain) table procedure (key hook)
+function NewActTableProc(Dialog:HWnd;hMessage:uint;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+var
+ i:integer;
+begin
+ result:=0;
+ case hMessage of
+ WM_KEYDOWN: begin
+ if (lParam and (1 shl 30))=0 then
+ begin
+ case wParam of
+ VK_F2: begin
+ i:=SendMessage(Dialog,LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
+ if i>=0 then
+ PostMessageW(Dialog,LVM_EDITLABELW,i,0);
+ exit;
+ end;
+ VK_UP: begin
+ if (GetKeyState(VK_CONTROL) and $8000)<>0 then
+ begin
+ PostMessage(GetParent(Dialog),WM_COMMAND,(BN_CLICKED shl 16)+IDC_ACTION_UP,0);
+ exit;
+ end;
+ end;
+ VK_DOWN: begin
+ if (GetKeyState(VK_CONTROL) and $8000)<>0 then
+ begin
+ PostMessage(GetParent(Dialog),WM_COMMAND,(BN_CLICKED shl 16)+IDC_ACTION_DOWN,0);
+ exit;
+ end;
+ end;
+ VK_INSERT: begin
+ PostMessage(GetParent(Dialog),WM_COMMAND,(BN_CLICKED shl 16)+IDC_ACTION_NEW,0);
+ exit;
+ end;
+ VK_DELETE: begin
+ PostMessage(GetParent(Dialog),WM_COMMAND,(BN_CLICKED shl 16)+IDC_ACTION_DELETE,0);
+ exit;
+ end;
+ end;
+ end;
+ end;
+ end;
+ result:=CallWindowProc(OldActTableProc,Dialog,hMessage,wParam,lParam);
+end;
+
+// miranda button icon paint
+procedure SetButtonIcons2(Dialog:HWND);
+var
+ ti:TTOOLINFOW;
+ hwndTooltip: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);
+
+ FillChar(ti,SizeOf(ti),0);
+ ti.cbSize :=sizeof(TOOLINFO);
+ ti.uFlags :=TTF_IDISHWND or TTF_SUBCLASS;
+ ti.hwnd :=Dialog;
+ ti.hinst :=hInstance;
+
+ ti.uId :=GetDlgItem(Dialog,IDC_ACTION_HELP);
+ ti.lpszText:=TranslateW('Help');
+ SendMessage(ti.uId,BM_SETIMAGE,IMAGE_ICON,
+ CallService(MS_SKIN_LOADICON,SKINICON_OTHER_HELP,0));
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
+
+ ti.uId :=GetDlgItem(Dialog,IDC_ACTION_NEW);
+ ti.lpszText:=TranslateW('New');
+ SetButtonIcon(ti.uId,ACI_NEW);
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
+
+ ti.uId :=GetDlgItem(Dialog,IDC_GROUP_NEW);
+ SetButtonIcon(ti.uId,ACI_NEW);
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
+
+ ti.uId :=GetDlgItem(Dialog,IDC_ACTION_UP);
+ ti.lpszText:=TranslateW('Up');
+ SetButtonIcon(ti.uId,ACI_UP);
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
+
+ ti.uId :=GetDlgItem(Dialog,IDC_GROUP_UP);
+ SetButtonIcon(ti.uId,ACI_UP);
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
+
+ ti.uId :=GetDlgItem(Dialog,IDC_ACTION_DOWN);
+ ti.lpszText:=TranslateW('Down');
+ SetButtonIcon(ti.uId,ACI_DOWN);
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
+
+ ti.uId :=GetDlgItem(Dialog,IDC_GROUP_DOWN);
+ SetButtonIcon(ti.uId,ACI_DOWN);
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
+
+ ti.uId :=GetDlgItem(Dialog,IDC_ACTION_DELETE);
+ ti.lpszText:=TranslateW('Delete');
+ SetButtonIcon(ti.uId,ACI_DELETE);
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
+
+ ti.uId :=GetDlgItem(Dialog,IDC_GROUP_DELETE);
+ SetButtonIcon(ti.uId,ACI_DELETE);
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
+
+ ti.uId :=GetDlgItem(Dialog,IDC_GROUP_RELOAD);
+ ti.lpszText:=TranslateW('Reload');
+ SetButtonIcon(ti.uId,ACI_RELOAD);
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
+
+ ti.uId :=GetDlgItem(Dialog,IDC_GROUP_TEST);
+ ti.lpszText:=TranslateW('Test');
+ SetButtonIcon(ti.uId,ACI_TEST);
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
+
+ ti.uId :=GetDlgItem(Dialog,IDC_CNT_APPLY);
+ ti.lpszText:=TranslateW('Apply format');
+ SetButtonIcon(ti.uId,ACI_FORMAT);
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
+
+ ti.uId :=GetDlgItem(Dialog,IDC_GROUP_IMPORT);
+ ti.lpszText:=TranslateW('Import');
+ SetButtonIcon(ti.uId,ACI_IMPORT);
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
+
+ ti.uId :=GetDlgItem(Dialog,IDC_GROUP_EXPORT);
+ ti.lpszText:=TranslateW('Export');
+ SetButtonIcon(ti.uId,ACI_EXPORT);
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
+
+ ti.lpszText:=TranslateW('Use Variables');
+ ti.uId:=GetDlgItem(Dialog,IDC_SRV_WPAR);
+ SetButtonIcon(ti.uId,ACI_VAR_UNCHECKED);
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
+
+{
+ pc:=TranslateW('');
+ wnd:=GetDlgItem(Dialog,IDC_NEW);
+ SendMessage(hNew,BUTTONADDTOOLTIP,TWPARAM(pc),BATF_UNICODE);
+ SetButtonIcon(wnd,QS_NEW);
+}
+ ti.uId:=GetDlgItem(Dialog,IDC_SRV_LPAR);
+ SetButtonIcon(ti.uId,ACI_VAR_UNCHECKED);
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
+
+ ti.uId:=GetDlgItem(Dialog,IDC_SRV_SRVC);
+ SetButtonIcon(ti.uId,ACI_VAR_UNCHECKED);
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
+
+ ti.uId:=GetDlgItem(Dialog,IDC_PRG_PRG);
+ SetButtonIcon(ti.uId,ACI_VAR_UNCHECKED);
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
+
+ ti.uId:=GetDlgItem(Dialog,IDC_PRG_ARG);
+ SetButtonIcon(ti.uId,ACI_VAR_UNCHECKED);
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
+
+ ti.uId:=GetDlgItem(Dialog,IDC_TXT_FILE);
+ SetButtonIcon(ti.uId,ACI_VAR_UNCHECKED);
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
+
+ ti.uId:=GetDlgItem(Dialog,IDC_TXT_TEXT);
+ SetButtonIcon(ti.uId,ACI_VAR_UNCHECKED);
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
+
+ ti.uId:=GetDlgItem(Dialog,IDC_RW_MVAR);
+ SetButtonIcon(ti.uId,ACI_VAR_UNCHECKED);
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
+
+ ti.uId:=GetDlgItem(Dialog,IDC_RW_SVAR);
+ SetButtonIcon(ti.uId,ACI_VAR_UNCHECKED);
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
+
+ ti.uId:=GetDlgItem(Dialog,IDC_RW_TVAR);
+ SetButtonIcon(ti.uId,ACI_VAR_UNCHECKED);
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
+
+ ti.uId:=GetDlgItem(Dialog,IDC_MSG_TTL);
+ SetButtonIcon(ti.uId,ACI_VAR_UNCHECKED);
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
+
+ ti.uId:=GetDlgItem(Dialog,IDC_MSG_TXT);
+ SetButtonIcon(ti.uId,ACI_VAR_UNCHECKED);
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
+
+end;
+
+function MoveLVItem(list:HWND;num:integer;incr:integer):integer;
+var
+ li:LV_ITEM;
+ buf:array [0..127] of WideChar;
+begin
+ li.mask :=LVIF_PARAM+LVIF_STATE+LVIF_TEXT;
+ li.iItem :=num;
+ li.iSubItem :=0;
+ li.StateMask :=dword(-1);
+ li.pszText :=@buf;
+ li.cchTextMax:=127;
+ SendMessageW(list,LVM_GETITEMW,0,lparam(@li));
+ SendMessageW(list,LVM_DELETEITEM,li.iItem,0);
+ inc(li.iItem,incr);
+
+ SendMessageW(list,LVM_INSERTITEMW,0,lparam(@li));
+ SendMessageW(list,LVM_SETITEMSTATE,li.iItem,lparam(@li));
+ result:=li.iItem;
+end;
+
+function MoveGroup(list:HWND;num:integer=-1;incr:integer=0):integer;
+var
+ i,j:integer;
+begin
+ if num<0 then
+ begin
+ result:=-1;
+ j:=SendMessage(list,LVM_GETITEMCOUNT,0,0)-1;
+ if incr<0 then // up, from beginning
+ begin
+ for i:=0 to j do
+ begin
+ if SendMessage(list,LVM_GETITEMSTATE,i,LVIS_SELECTED)<>0 then
+ begin
+ if i=0 then break;
+ LV_MoveItem(list,incr,i);
+// MoveLVItem(list,i,incr);
+ if result<0 then result:=i+incr;
+ end;
+ end;
+ end
+ else // down, from the end
+ begin
+ for i:=j downto 0 do
+ begin
+ if SendMessage(list,LVM_GETITEMSTATE,i,LVIS_SELECTED)<>0 then
+ begin
+ if i=j then break;
+ LV_MoveItem(list,incr,i);
+// MoveLVItem(list,i,incr);
+ if result<0 then result:=i+incr;
+ end;
+ end;
+ end;
+ end
+ else
+ begin
+ MoveLVItem(list,num,incr);
+ result:=num;
+ end;
+end;
+
+{$include i_dlglists.inc}
+
+procedure SetNumValue(wnd:HWND;value:dword;isvar:boolean;ishex:boolean);
+var
+ buf:array [0..31] of WideChar;
+begin
+ if isvar then
+ SendMessageW(wnd,WM_SETTEXT,0,value)
+ else if ishex then
+ begin
+ buf[0]:='$';
+ IntToHex(PWideChar(@buf[1]),value);
+ SendMessageW(wnd,WM_SETTEXT,0,tlparam(@buf));
+ end
+ else
+ SendMessageW(wnd,WM_SETTEXT,0,tlparam(IntToStr(buf,value)));
+end;
+
+function DlgProcOpt2(Dialog:HWnd;hMessage:uint;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+
+ {$include i_visual.inc}
+
+ procedure ShowHelp(code:integer);
+ var
+ buf:PAnsiChar;
+ vhi:TVARHELPINFO;
+ begin
+ case code of
+ hlpVariables: 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;
+ hlpAdvVariables: begin
+ FillChar(vhi,SizeOf(vhi),0);
+ with vhi do
+ begin
+ cbSize :=SizeOf(vhi);
+ flags :=VHF_FULLDLG or VHF_SETLASTSUBJECT;
+ hwndCtrl :=GetDlgItem(Dialog,IDC_ADV_VARS);
+ szSubjectDesc:='test your variables';
+ end;
+ CallService(MS_VARS_SHOWHELPEX,Dialog,tlparam(@vhi));
+ end;
+ hlpContact: begin
+ MessageBoxW(0,
+ TranslateW('Select contact to open its window'),
+ TranslateW('Contacts'),0);
+ end;
+ hlpService: begin
+ buf:=GetDlgText(Dialog,IDC_EDIT_SERVICE,true);
+//!! if buf<>nil then
+ begin
+ ApiCard.Service:=buf;
+ mFreeMem(buf);
+ ApiCard.Show;
+ end;
+ end;
+ hlpProgram: begin
+ MessageBoxW(0,
+ TranslateW('Text <last> replacing'#13#10+
+ 'by last result'#13#10#13#10+
+ 'Text <param> replacing'#13#10+
+ 'by parameter'),
+ TranslateW('Text'),0);
+ end;
+ hlpText: begin
+ MessageBoxW(0,
+ TranslateW('^s - selected (and replaced) part'#13#10+
+ '^e - replaced by empty string'#13#10+
+ '^v - paste text from Clipboard'#13#10+
+ '^t - replaced by tabulation'#13#10+
+ '^l - replaced by last result as unicode'#13#10+
+ '^h - replaced by last result as hex'#13#10+
+ '^a - in the end: autosend'#13#10+
+ '^f(name[,str])'#13#10+
+ ' paste line from text file.'#13#10+
+ ' brackets contents must be w/o spaces'),
+ TranslateW('Text'),0);
+ end;
+ hlpAdvance: begin
+ end;
+ hlpChain: begin
+ MessageBoxW(0,
+ TranslateW('You can select another group from combobox, '+
+ 'then it will be executed, after that current '+
+ 'action group will be continued.'),
+ TranslateW('Macros'),0);
+ end;
+ hlpDBRW: begin
+ end;
+ hlpMessage: begin
+ MessageBoxW(0,
+ TranslateW(
+ 'Text <last> replacing'#13#10+
+ 'by last result'#13#10#13#10+
+ 'Returns:'#13#10+
+ '--------'#13#10+
+ 'OK'#9'= 1'#13#10+
+ 'CANCEL'#9'= 2'#13#10+
+ 'ABORT'#9'= 3'#13#10+
+ 'RETRY'#9'= 4'#13#10+
+ 'IGNORE'#9'= 5'#13#10+
+ 'YES'#9'= 6'#13#10+
+ 'NO'#9'= 7'#13#10+
+ 'CLOSE'#9'= 8'),
+ TranslateW('MessageBox'),0);
+ end;
+ end;
+ end;
+
+ // enable/disable navigation chain buttons
+ procedure CheckGrpList(num:integer=-1);
+ var
+ wnd:HWND;
+ dir:integer;
+ okup,okdown:boolean;
+ begin
+ wnd:=GetDlgItem(Dialog,IDC_ACTION_GROUP);
+// if num<0 then
+ begin
+ dir:=LV_CheckDirection(wnd);
+ okup :=odd(loword(dir));
+ okdown:=(loword(dir) and 2)<>0;
+ end;
+{
+ else
+ begin
+ okup :=num>0;
+ okdown:=(num+1)<SendMessage(wnd,LVM_GETITEMCOUNT,0,0);
+ SendMessage(wnd,LVM_ENSUREVISIBLE,num,0);
+ end;
+}
+ EnableWindow(GetDlgItem(Dialog,IDC_GROUP_UP ),okup);
+ EnableWindow(GetDlgItem(Dialog,IDC_GROUP_DOWN),okdown);
+ SendMessage(wnd,LVM_ENSUREVISIBLE,hiword(dir)-1,0);
+(*
+ wnd:=GetDlgItem(Dialog,IDC_ACTION_GROUP);
+ if num<0 then
+ num:=SendMessage(wnd,LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
+ EnableWindow(GetDlgItem(Dialog,IDC_GROUP_UP),num>0);
+ EnableWindow(GetDlgItem(Dialog,IDC_GROUP_DOWN),
+ (num+1)<SendMessage(wnd,LVM_GETITEMCOUNT,0,0));
+ SendMessage(wnd,LVM_ENSUREVISIBLE,num,0);
+ result:=num;
+*)
+ end;
+ procedure CheckActList(num:integer=-1);
+ var
+ wnd:HWND;
+ dir:integer;
+ okup,okdown:boolean;
+ begin
+ wnd:=GetDlgItem(Dialog,IDC_ACTION_LIST);
+// if num<0 then
+ begin
+ dir:=LV_CheckDirection(wnd);
+ okup :=odd(loword(dir));
+ okdown:=(loword(dir) and 2)<>0;
+ end;
+{
+ else
+ begin
+ okup :=num>0;
+ okdown:=(num+1)<SendMessage(wnd,LVM_GETITEMCOUNT,0,0);
+ SendMessage(wnd,LVM_ENSUREVISIBLE,num,0);
+ end;
+}
+ EnableWindow(GetDlgItem(Dialog,IDC_ACTION_UP ),okup);
+ EnableWindow(GetDlgItem(Dialog,IDC_ACTION_DOWN),okdown);
+ SendMessage(wnd,LVM_ENSUREVISIBLE,hiword(dir)-1,0);
+(*
+ wnd:=GetDlgItem(Dialog,IDC_ACTION_LIST);
+ if num<0 then
+ num:=SendMessage(wnd,LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
+ EnableWindow(GetDlgItem(Dialog,IDC_ACTION_UP),num>0);
+ EnableWindow(GetDlgItem(Dialog,IDC_ACTION_DOWN),
+ (num+1)<SendMessage(wnd,LVM_GETITEMCOUNT,0,0));
+ SendMessage(wnd,LVM_ENSUREVISIBLE,num,0);
+*)
+ end;
+
+ // change current action name (by type)
+ procedure ChangeActionName(num:integer=-1;acttype:integer=0;str:PWideChar=nil);
+ var
+ li:LV_ITEMW;
+ wnd:HWND;
+ str1:pWideChar;
+ begin
+ wnd:=GetDlgItem(Dialog,IDC_ACTION_LIST);
+ if num<0 then
+ li.iItem:=SendMessage(wnd,LVM_GETNEXTITEM,-1,LVNI_FOCUSED)
+ else
+ li.iItem:=num;
+ if li.iItem>=0 then
+ begin
+ li.iSubItem:=0;
+ // getting SubAction number
+ li.mask:=LVIF_PARAM;
+ SendMessage(wnd,LVM_GETITEM,0,tlparam(@li));
+
+ // changing to default name
+ if str=nil then
+ begin
+ if num>=0 then // new item - screen only
+ str1:=TranslateW(ActionNames[ACT_CONTACT])
+ else // change action type
+ begin
+ str1:=NewActionList[li.lParam].descr;
+ if str1=nil then // not in memory yet
+ str1:=TranslateW(ActionNames[acttype])
+ else
+ exit;
+ end;
+ end
+ else // rename
+ begin
+ str1:=str;
+ mFreeMem(NewActionList[li.lParam].descr);
+ StrDupW (NewActionList[li.lParam].descr,str);
+ end;
+
+// screen
+ li.mask :=LVIF_TEXT;
+ li.pszText:=str1;
+ SendMessageW(wnd,LVM_SETITEMW,0,tlparam(@li));
+ end;
+ end;
+
+ // Fill Chain list
+ procedure MakeActionList(HK:pHKRecord);
+ var
+ i,idx:integer;
+ wnd:HWND;
+ li:LV_ITEMW;
+ p:pWideChar;
+ begin
+ wnd:=GetDlgItem(Dialog,IDC_ACTION_LIST);
+ SendMessage(wnd,LVM_DELETEALLITEMS,0,0);
+
+ EnableWindow(GetDlgItem(Dialog,IDC_ACTION_UP),false);
+ if (HK=nil) or (HK^.firstAction=0) then
+ begin
+ SHWindows;
+ SHActButtons(SW_HIDE);
+ EnableWindow(GetDlgItem(Dialog,IDC_ACTION_LIST ),false);
+ EnableWindow(GetDlgItem(Dialog,IDC_GROUP_TEST ),false);
+ EnableWindow(GetDlgItem(Dialog,IDC_ACTION_HELP ),false);
+ EnableWindow(GetDlgItem(Dialog,IDC_ACTION_DELETE),false);
+ EnableWindow(GetDlgItem(Dialog,IDC_ACTION_DOWN ),false);
+ exit;
+ end;
+ SHActButtons(SW_SHOW);
+
+ li.mask :=LVIF_TEXT or LVIF_PARAM;
+ li.iSubitem:=0;
+ i:=HK^.firstAction;
+ idx:=0;
+ repeat
+ p:=NewActionList^[i].descr;
+ if p=nil then
+ p:=TranslateW(ActionNames[NewActionList^[i].actionType]);
+ li.pszText:=p;
+ li.iItem :=idx;
+ li.lParam :=i;
+ SendMessageW(wnd,LVM_INSERTITEMW,0,tlparam(@li));
+ ListView_SetCheckState(wnd,idx,(NewActionList^[i].flags and ACF_DISABLED)=0);
+
+ i:=NewActionList^[i].next;
+ inc(idx);
+ until i=0;
+
+ Listview_SetItemState(wnd,0,
+ LVIS_FOCUSED or LVIS_SELECTED,
+ LVIS_FOCUSED or LVIS_SELECTED);
+ EnableWindow(GetDlgItem(Dialog,IDC_ACTION_LIST ),true);
+ EnableWindow(GetDlgItem(Dialog,IDC_GROUP_TEST ),true);
+ EnableWindow(GetDlgItem(Dialog,IDC_ACTION_HELP ),true);
+ EnableWindow(GetDlgItem(Dialog,IDC_ACTION_DELETE),true);
+ EnableWindow(GetDlgItem(Dialog,IDC_ACTION_DOWN),idx>1);
+// FillSubList(Dialog);
+ FillAction(HK^.firstAction);
+ CheckActList(0);
+ end;
+
+ procedure SaveAction(listnum,actnum:integer);
+ var
+ wnd:HWND;
+ i:integer;
+ tmp:pWideChar;
+ arr: array [0..255] of WideChar;
+ li:LV_ITEMW;
+ begin
+ if (ChMask and ACTM_ACT)=0 then exit;
+ ChMask:=ChMask and not ACTM_ACT;
+ wnd:=GetDlgItem(Dialog,IDC_ACTION_LIST);
+ if listnum<0 then
+ begin
+ listnum:=SendMessageW(wnd,LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
+ if listnum<0 then
+ exit;
+ end;
+ if actnum<0 then
+ actnum:=LV_GetLParam(wnd,listnum);
+ StrDupW(tmp,NewActionList^[actnum].descr); // keeping old name
+ FreeAction(@NewActionList^[actnum]);
+ with NewActionList^[actnum] do
+ begin
+ flags :=ACF_ASSIGNED;
+ flags2:=0;
+
+ descr:=tmp;
+ if descr=nil then
+ begin
+ li.iItem :=listnum;
+ li.mask :=LVIF_TEXT;
+ li.iSubItem :=0;
+ li.pszText :=@arr;
+ li.cchTextMax:=SizeOf(arr) div SizeOf(WideChar);
+ SendDlgItemMessageW(Dialog,IDC_ACTION_LIST,LVM_GETITEMW,0,tlparam(@li));
+ StrDupW(descr,arr);
+ end;
+
+ if ListView_GetCheckState(wnd,listnum)=0 then
+ flags:=flags or ACF_DISABLED;
+
+ actionType:=ActIds[SendDlgItemMessage(Dialog,IDC_ACTION_TYPE,CB_GETCURSEL,0,0)].code;
+ case actionType of
+ ACT_CONTACT: begin
+ contact:=SendDlgItemMessage(Dialog,IDC_CONTACTLIST,CB_GETITEMDATA,
+ SendDlgItemMessage(Dialog,IDC_CONTACTLIST,CB_GETCURSEL,0,0),0);
+ if IsDlgButtonChecked(Dialog,IDC_CNT_KEEP)=BST_CHECKED then
+ flags:=flags or ACF_KEEPONLY;
+ end;
+
+ ACT_SERVICE: begin
+ if IsDlgButtonChecked(Dialog,IDC_SRV_WPAR)=BST_CHECKED then
+ flags2:=flags2 or ACF2_SRV_WPAR;
+ if IsDlgButtonChecked(Dialog,IDC_SRV_LPAR)=BST_CHECKED then
+ flags2:=flags2 or ACF2_SRV_LPAR;
+ if IsDlgButtonChecked(Dialog,IDC_SRV_SRVC)=BST_CHECKED then
+ flags2:=flags2 or ACF2_SRV_SRVC;
+
+ case CB_GetData(GetDlgItem(Dialog,IDC_FLAG_WPAR)) of
+ ptParam: begin
+ flags:=flags or ACF_WPARAM
+ end;
+ ptResult: begin
+ flags:=flags or ACF_WRESULT
+ end;
+ ptCurrent: begin
+ flags:=flags or ACF_WPARNUM or ACF_WCURRENT
+ end;
+ ptNumber: begin
+ flags:=flags or ACF_WPARNUM;
+ if GetNumValue(GetDlgItem(Dialog,IDC_EDIT_WPAR),
+ (flags2 and ACF2_SRV_WPAR)<>0,wparam) then
+ flags2:=flags2 or ACF2_SRV_WHEX;
+// wparam:=GetDlgItemInt(Dialog,IDC_EDIT_WPAR,pbool(nil)^,true);
+ end;
+ ptStruct: begin
+ flags:=flags or ACF_WSTRUCT;
+ StrDup(pAnsiChar(wparam),wstruct);
+ end;
+ ptUnicode: begin
+ flags:=flags or ACF_WUNICODE;
+ pointer(wparam):=GetDlgText(Dialog,IDC_EDIT_WPAR);
+ end;
+ ptString: pointer(wparam):=GetDlgText(Dialog,IDC_EDIT_WPAR,true);
+ end;
+
+ case CB_GetData(GetDlgItem(Dialog,IDC_FLAG_LPAR)) of
+ ptParam: begin
+ flags:=flags or ACF_LPARAM
+ end;
+ ptResult: begin
+ flags:=flags or ACF_LRESULT
+ end;
+ ptCurrent: begin
+ flags:=flags or ACF_LPARNUM or ACF_LCURRENT
+ end;
+ ptNumber: begin
+ flags:=flags or ACF_LPARNUM;
+ if GetNumValue(GetDlgItem(Dialog,IDC_EDIT_LPAR),
+ (flags2 and ACF2_SRV_LPAR)<>0,lparam) then
+ flags2:=flags2 or ACF2_SRV_LHEX;
+// lparam:=GetDlgItemInt(Dialog,IDC_EDIT_LPAR,pbool(nil)^,true);
+ end;
+ ptStruct: begin
+ flags:=flags or ACF_LSTRUCT;
+ StrDup(pAnsiChar(lparam),lstruct);
+ end;
+ ptUnicode: begin
+ flags:=flags or ACF_LUNICODE;
+ pointer(lparam):=GetDlgText(Dialog,IDC_EDIT_LPAR);
+ end;
+ ptString: pointer(lparam):=GetDlgText(Dialog,IDC_EDIT_LPAR,true);
+ end;
+
+ if IsDlgButtonChecked(Dialog,IDC_RES_INSERT)=BST_CHECKED then
+ flags:=flags or ACF_INSERT;
+ if IsDlgButtonChecked(Dialog,IDC_RES_MESSAGE)=BST_CHECKED then
+ flags:=flags or ACF_MESSAGE;
+ if IsDlgButtonChecked(Dialog,IDC_RES_POPUP)=BST_CHECKED then
+ flags:=flags or ACF_POPUP;
+
+ case CB_GetData(GetDlgItem(Dialog,IDC_SRV_RESULT)) of
+ sresHex: flags:=flags or ACF_HEX;
+ sresInt: begin
+ if IsDlgButtonChecked(Dialog,IDC_RES_SIGNED)=BST_CHECKED then
+ flags:=flags or ACF_SIGNED;
+ end;
+ sresString: begin
+ flags:=flags or ACF_STRING;
+ if IsDlgButtonChecked(Dialog,IDC_RES_UNICODE)=BST_CHECKED then
+ flags:=flags or ACF_UNICODE;
+ if IsDlgButtonChecked(Dialog,IDC_RES_FREEMEM)=BST_CHECKED then
+ flags2:=flags2 or ACF2_FREEMEM;
+ end;
+ sresStruct: flags:=flags or ACF_STRUCT;
+ end;
+
+ service:=GetDlgText(Dialog,IDC_EDIT_SERVICE,true);
+
+ end;
+
+ ACT_PROGRAM: begin
+ prgname:=GetDlgText(Dialog,IDC_EDIT_PRGPATH);
+ args:=GetDlgText(Dialog,IDC_EDIT_PRGARGS);
+ if IsDlgButtonChecked(Dialog,IDC_FLAG_PARALLEL)=BST_CHECKED then
+ flags:=flags or ACF_PRTHREAD;
+ if IsDlgButtonChecked(Dialog,IDC_FLAG_CURPATH)=BST_CHECKED then
+ flags:=flags or ACF_CURPATH;
+ time:=GetDlgItemInt(Dialog,IDC_EDIT_PROCTIME,pbool(nil)^,false);
+ if IsDlgButtonChecked(Dialog,IDC_FLAG_MINIMIZE)=BST_CHECKED then
+ show:=SW_SHOWMINIMIZED
+ else if IsDlgButtonChecked(Dialog,IDC_FLAG_MAXIMIZE)=BST_CHECKED then
+ show:=SW_SHOWMAXIMIZED
+ else if IsDlgButtonChecked(Dialog,IDC_FLAG_HIDDEN)=BST_CHECKED then
+ show:=SW_HIDE
+ else //if IsDlgButtonChecked(Dialog,IDC_FLAG_NORMAL)=BST_CHECKED then
+ show:=SW_SHOWNORMAL;
+
+ if IsDlgButtonChecked(Dialog,IDC_PRG_PRG)=BST_CHECKED then
+ flags2:=flags2 or ACF2_PRG_PRG;
+ if IsDlgButtonChecked(Dialog,IDC_PRG_ARG)=BST_CHECKED then
+ flags2:=flags2 or ACF2_PRG_ARG;
+ end;
+
+ ACT_TEXT: begin
+ if IsDlgButtonChecked(Dialog,IDC_FLAG_CLIP)<>BST_UNCHECKED then
+ begin
+ flags:=flags or ACF_CLIPBRD;
+ if IsDlgButtonChecked(Dialog,IDC_CLIP_COPYTO)<>BST_UNCHECKED then
+ flags:=flags or ACF_COPYTO;
+ end
+ else
+ begin
+ if IsDlgButtonChecked(Dialog,IDC_TXT_TEXT)=BST_CHECKED then
+ flags2:=flags2 or ACF2_TXT_TEXT;
+ text:=GetDlgText(Dialog,IDC_EDIT_INSERT);
+ if IsDlgButtonChecked(Dialog,IDC_FLAG_FILE)<>BST_UNCHECKED then
+ begin
+ flags:=flags or ACF_FILE;
+ case CB_GetData(GetDlgItem(Dialog,IDC_FILE_ENC)) of
+ 0: flags:=flags or ACF_ANSI;
+ 1: flags:=flags or ACF_UTF8;
+ 2: flags:=flags or ACF_UTF8 or ACF_SIGN;
+ 3: flags:=flags or 0;
+ 4: flags:=flags or ACF_SIGN;
+ end;
+
+ if IsDlgButtonChecked(Dialog,IDC_TXT_FILE)=BST_CHECKED then
+ flags2:=flags2 or ACF2_TXT_FILE;
+ tfile:=GetDlgText(Dialog,IDC_FILE_PATH);
+ if IsDlgButtonChecked(Dialog,IDC_FILE_APPEND)<>BST_UNCHECKED then
+ flags:=flags or ACF_FAPPEND
+ else if IsDlgButtonChecked(Dialog,IDC_FILE_WRITE)<>BST_UNCHECKED then
+ flags:=flags or ACF_FWRITE;
+ end;
+ end;
+ end;
+
+ ACT_ADVANCE: begin
+ condition:=ADV_COND_NOP;
+ if IsDlgButtonChecked(Dialog,IDC_FLAG_GT )=BST_CHECKED then
+ condition:=ADV_COND_GT
+ else if IsDlgButtonChecked(Dialog,IDC_FLAG_LT )=BST_CHECKED then
+ condition:=ADV_COND_LT
+ else if IsDlgButtonChecked(Dialog,IDC_FLAG_EQ )=BST_CHECKED then
+ condition:=ADV_COND_EQ;
+ value:=GetDlgItemInt(Dialog,IDC_ADV_VALUE,pbool(nil)^,false);
+
+ if IsDlgButtonChecked(Dialog,IDC_FLAG_NOT)=BST_CHECKED then
+ condition:=condition or ADV_COND_NOT;
+
+ if IsDlgButtonChecked(Dialog,IDC_FLAG_BREAK)=BST_CHECKED then
+ action:=ADV_ACT_BREAK
+ else if IsDlgButtonChecked(Dialog,IDC_FLAG_JUMP )=BST_CHECKED then
+ action:=ADV_ACT_JUMP
+ else
+ action:=ADV_ACT_NOP;
+
+ case action of
+ ADV_ACT_JUMP: operval:=GetDlgText(Dialog,IDC_ADV_VAL2);
+ end;
+
+ if IsDlgButtonChecked(Dialog,IDC_FLAG_VARS)<>BST_UNCHECKED then
+ begin
+ varval:=GetDlgText(Dialog,IDC_ADV_VARS);
+ action:=action or ADV_ACT_VARS;
+ if IsDlgButtonChecked(Dialog,IDC_ADV_ASINT)<>BST_UNCHECKED then
+ flags:=flags or ACF_VARASINT;
+ end
+;{//!!executively!!
+ else }if IsDlgButtonChecked(Dialog,IDC_FLAG_MATH)=BST_CHECKED then
+ begin
+ mathval:=GetDlgItemInt(Dialog,IDC_ADV_VAL1,pbool(nil)^,true);
+ action :=action or ADV_ACT_MATH;
+ oper :=CB_GetData(GetDlgItem(Dialog,IDC_ADV_OPER));
+// oper :=SendDlgItemMessage(Dialog,IDC_ADV_OPER,CB_GETCURSEL,0,0);
+ end;
+ end;
+
+ ACT_CHAIN: begin
+ wnd:=GetDlgItem(Dialog,IDC_GROUP_LIST);
+ i:=SendMessage(wnd,CB_GETCURSEL,0,0);
+ if i>0 then
+ id:=SendMessage(wnd,CB_GETITEMDATA,i,0)
+ else
+ id:=0;
+ end;
+
+ ACT_RW: begin
+ if IsDlgButtonChecked(Dialog,IDC_RW_CURRENT)=BST_CHECKED then
+ flags:=flags or ACF_CURRENT
+ else if IsDlgButtonChecked(Dialog,IDC_RW_RESULT)=BST_CHECKED then
+ flags:=flags or ACF_RESULT
+ else if IsDlgButtonChecked(Dialog,IDC_RW_PARAM)=BST_CHECKED then
+ flags:=flags or ACF_PARAM
+ else
+ dbcontact:=SendDlgItemMessage(Dialog,IDC_CONTACTLIST,CB_GETITEMDATA,
+ SendDlgItemMessage(Dialog,IDC_CONTACTLIST,CB_GETCURSEL,0,0),0);
+ dbmodule :=GetDlgText(Dialog,IDC_RW_MODULE ,true);
+ dbsetting:=GetDlgText(Dialog,IDC_RW_SETTING,true);
+ if IsDlgButtonChecked(Dialog,IDC_RW_MVAR)=BST_CHECKED then
+ flags2:=flags2 or ACF2_RW_MVAR;
+ if IsDlgButtonChecked(Dialog,IDC_RW_SVAR)=BST_CHECKED then
+ flags2:=flags2 or ACF2_RW_SVAR;
+
+ if IsDlgButtonChecked(Dialog,IDC_RW_WRITE)=BST_CHECKED then
+ flags:=flags or ACF_DBWRITE
+ else if IsDlgButtonChecked(Dialog,IDC_RW_DELETE)=BST_CHECKED then
+ flags:=flags or ACF_DBDELETE;
+
+ if IsDlgButtonChecked(Dialog,IDC_RW_LAST)=BST_CHECKED then
+ flags:=flags or ACF_LAST;
+
+ if IsDlgButtonChecked(Dialog,IDC_RW_TVAR)=BST_CHECKED then
+ flags2:=flags2 or ACF2_RW_TVAR;
+
+ i:=CB_GetData(GetDlgItem(Dialog,IDC_RW_DATATYPE));
+ case i of
+ 0: flags:=flags or ACF_DBBYTE;
+ 1: flags:=flags or ACF_DBWORD;
+ 2: flags:=flags or 0;
+ 3: flags:=flags or ACF_DBANSI;
+ 4: flags:=flags or ACF_DBUTEXT;
+ end;
+ if i<3 then
+ begin
+ if (flags and ACF_LAST)=0 then
+ begin
+ if GetNumValue(GetDlgItem(Dialog,IDC_RW_VALUE),
+ (flags2 and ACF2_RW_TVAR)<>0,dbvalue) then
+ flags2:=flags2 or ACF2_RW_HEX;
+ end;
+ end
+ else
+ begin
+ if (flags and ACF_LAST)=0 then
+ pWideChar(dbvalue):=GetDlgText(Dialog,IDC_RW_TEXT);
+ end;
+
+ if (IsDlgButtonChecked(Dialog,IDC_RW_LAST)=BST_CHECKED) or
+ ((flags and ACF_LAST)<>0) then
+ flags:=flags or ACF_LAST;
+ end;
+
+ ACT_MESSAGE: begin
+ pWideChar(msgtitle):=GetDlgText(Dialog,IDC_MSG_TITLE);
+ pWideChar(msgtext ):=GetDlgText(Dialog,IDC_MSG_TEXT);
+ if IsDlgButtonChecked(Dialog,IDC_MSG_KEEP)=BST_CHECKED then
+ flags:=flags or ACF_MSG_KEEP;
+ if IsDlgButtonChecked(Dialog,IDC_MSG_TTL)=BST_CHECKED then
+ flags2:=flags2 or ACF2_MSG_TTL;
+ if IsDlgButtonChecked(Dialog,IDC_MSG_TXT)=BST_CHECKED then
+ flags2:=flags2 or ACF2_MSG_TXT;
+
+ if IsDlgButtonChecked(Dialog,IDC_MSGB_OC )=BST_CHECKED then boxopts:=MB_OKCANCEL
+ else if IsDlgButtonChecked(Dialog,IDC_MSGB_ARI)=BST_CHECKED then boxopts:=MB_ABORTRETRYIGNORE
+ else if IsDlgButtonChecked(Dialog,IDC_MSGB_YNC)=BST_CHECKED then boxopts:=MB_YESNOCANCEL
+ else if IsDlgButtonChecked(Dialog,IDC_MSGB_YN )=BST_CHECKED then boxopts:=MB_YESNO
+ else if IsDlgButtonChecked(Dialog,IDC_MSGB_RC )=BST_CHECKED then boxopts:=MB_RETRYCANCEL
+ else{if IsDlgButtonChecked(Dialog,IDC_MSGB_OK )=BST_CHECKED then}boxopts:=MB_OK;
+
+ if IsDlgButtonChecked(Dialog,IDC_MSGI_ERROR)=BST_CHECKED then boxopts:=boxopts or MB_ICONHAND
+ else if IsDlgButtonChecked(Dialog,IDC_MSGI_QUEST)=BST_CHECKED then boxopts:=boxopts or MB_ICONQUESTION
+ else if IsDlgButtonChecked(Dialog,IDC_MSGI_WARN )=BST_CHECKED then boxopts:=boxopts or MB_ICONWARNING
+ else if IsDlgButtonChecked(Dialog,IDC_MSGI_INFO )=BST_CHECKED then boxopts:=boxopts or MB_ICONINFORMATION
+ ;//else if IsDlgButtonChecked(Dialog,IDC_MSGI_NONE)=BST_CHECKED then ;
+ end;
+
+ end;
+ end;
+ end;
+
+ procedure BuildActionChain(group:integer=-1);
+ var
+ i,j,item:integer;
+ wnd:HWND;
+ act:pHKAction;
+ idx:integer;
+ begin
+ if (ChMask and ACTM_ACTS)=0 then exit;
+ ChMask:=ChMask and not ACTM_ACTS;
+ SaveAction(-1,-1);
+ wnd:=GetDlgItem(Dialog,IDC_ACTION_LIST);
+ i:=SendMessageW(wnd,LVM_GETITEMCOUNT,0,0);
+ idx:=LV_GetLParam(GetDlgItem(Dialog,IDC_ACTION_GROUP),group);
+ if i>0 then
+ begin
+ j:=LV_GetLParam(wnd,0);
+ NewGroupList^[idx].firstAction:=j;
+ act:=@NewActionList^[j];
+ for item:=1 to i-1 do
+ begin
+ j:=LV_GetLParam(wnd,item);
+ act^.next:=j;
+ act:=@NewActionList^[j];
+ end;
+ act^.next:=0;
+ end
+ else
+ begin
+ if idx>=0 then
+ NewGroupList^[idx].firstAction:=0;
+ end;
+ end;
+
+ procedure CheckActionList(next:integer);
+ var
+ i:integer;
+ wnd:HWND;
+ begin
+ wnd:=GetDlgItem(Dialog,IDC_ACTION_LIST);
+ i:=SendMessage(wnd,LVM_GETITEMCOUNT,0,0);
+ if i>0 then
+ begin
+ EnableWindow(GetDlgItem(Dialog,IDC_ACTION_HELP),true);
+ if next=i then
+ dec(next);
+ ListView_SetItemState(wnd,next,
+ LVIS_FOCUSED or LVIS_SELECTED,
+ LVIS_FOCUSED or LVIS_SELECTED);
+ end
+ else
+ begin
+ SHWindows;
+ SHActButtons(SW_HIDE);
+ EnableWindow(wnd,false);
+ EnableWindow(GetDlgItem(Dialog,IDC_ACTION_HELP ),false);
+ EnableWindow(GetDlgItem(Dialog,IDC_GROUP_TEST ),false);
+ EnableWindow(GetDlgItem(Dialog,IDC_ACTION_DELETE),false);
+ next:=0;
+ end;
+ CheckActList(next);
+ end;
+
+ procedure CheckGroupList(next:integer);
+ var
+ i:integer;
+ wnd:HWND;
+ li:LV_ITEMW;
+ begin
+ wnd:=GetDlgItem(Dialog,IDC_ACTION_GROUP);
+ i:=SendMessage(wnd,LVM_GETITEMCOUNT,0,0);
+ if i>0 then
+ begin
+ if next=i then
+ dec(next);
+ ListView_SetItemState(wnd,next,LVIS_FOCUSED or LVIS_SELECTED,
+ LVIS_FOCUSED or LVIS_SELECTED);
+ li.iItem :=next;
+ li.iSubItem:=0;
+ li.mask :=LVIF_PARAM;
+ SendMessage(wnd,LVM_GETITEM,0,tlparam(@li));
+ end
+ else
+ begin
+ EnableWindow(wnd,false);
+ EnableWindow(GetDlgItem(Dialog,IDC_GROUP_DELETE),false);
+ CheckActionList(0);
+ EnableWindow(GetDlgItem(Dialog,IDC_ACTION_NEW),false);
+ end;
+ CheckGrpList(next);
+ end;
+
+ // Fill action group list and disable chain controls
+ function FillGroupList{(Dialog:hwnd)}:integer;
+ var
+ CurGroup:pHKRecord;
+ i:integer;
+ list:HWND;
+ lvi:TLVITEMW;
+ begin
+ SendDlgItemMessage(Dialog,IDC_ACTION_LIST,LVM_DELETEALLITEMS,0,0);
+ CheckActionList(-1);
+ list:=GetDlgItem(Dialog,IDC_ACTION_GROUP);
+
+ SendMessage(list,LVM_DELETEALLITEMS,0,0);
+ CurGroup:=@NewGroupList^;
+ result:=-1;
+ lvi.mask:=LVIF_TEXT+LVIF_PARAM;
+ lvi.iSubItem:=0;
+ for i:=0 to NewMaxGroups-1 do
+ begin
+ if (CurGroup^.flags and ACF_ASSIGNED)<>0 then
+ begin
+ lvi.iItem :=i;
+ lvi.lParam:=i;
+ if CurGroup^.descr=nil then
+ lvi.pszText:=NoDescription
+ else
+ lvi.pszText:=CurGroup^.descr;
+ SendMessageW(list,LVM_INSERTITEMW,0,tlparam(@lvi));
+ inc(result);
+ end;
+ inc(CurGroup);
+ end;
+
+ EnableWindow(GetDlgItem(Dialog,IDC_ACTION_GROUP ),result>=0);
+ EnableWindow(GetDlgItem(Dialog,IDC_ACTION_LIST ),result>=0);
+ EnableWindow(GetDlgItem(Dialog,IDC_ACTION_NEW ),result>=0);
+ EnableWindow(GetDlgItem(Dialog,IDC_GROUP_DELETE ),result>=0);
+ if result<0 then
+ begin
+ EnableWindow(GetDlgItem(Dialog,IDC_GROUP_TEST ),false);
+ EnableWindow(GetDlgItem(Dialog,IDC_ACTION_HELP ),false);
+ EnableWindow(GetDlgItem(Dialog,IDC_ACTION_DELETE),false);
+ EnableWindow(GetDlgItem(Dialog,IDC_ACTION_UP ),false);
+ EnableWindow(GetDlgItem(Dialog,IDC_ACTION_DOWN ),false);
+ EnableWindow(GetDlgItem(Dialog,IDC_STAT_GROUPS ),false);
+ EnableWindow(GetDlgItem(Dialog,IDC_ACTION_TYPE ),false);
+ end
+ else
+ result:=0;
+ SendMessage(list,CB_SETCURSEL,0,0);
+ SendMessage(list,LVM_SETCOLUMNWIDTH,0,LVSCW_AUTOSIZE_USEHEADER);
+
+ ListView_SetItemState(list,0,
+ LVIS_FOCUSED or LVIS_SELECTED,
+ LVIS_FOCUSED or LVIS_SELECTED);
+ end;
+
+ procedure SHMath(show:boolean);
+ var
+ wnd:HWND;
+ begin
+ EnableWindow(GetDlgItem(Dialog,IDC_ADV_ASINT),not show);
+ EnableWindow(GetDlgItem(Dialog,IDC_ADV_VARS ),not show);
+
+ wnd:=GetDlgItem(Dialog,IDC_ADV_OPER);
+ EnableWindow(wnd,show);
+ EnableWindow(GetDlgItem(Dialog,IDC_ADV_VAL1),
+ show and (CB_GetData(wnd)<>lresult(aeNot)));//(SendMessage(wnd,CB_GETCURSEL,0,0)<>0));
+ end;
+
+ procedure SetMBRadioIcon(h:THANDLE;id:dword;icon:uint_ptr);
+ begin
+ SendDlgItemMessage(Dialog,id,BM_SETIMAGE,IMAGE_ICON,
+ LoadImage(h,MAKEINTRESOURCE(icon),IMAGE_ICON,16,16,0{LR_SHARED}));
+ // SendDlgItemMessage(Dialog,id,BM_SETIMAGE,IMAGE_ICON,LoadIcon(0,icon));
+ end;
+
+ procedure SetMBRadioIcons;
+ var
+ h:THANDLE;
+ begin
+ h:=LoadLibrary('user32.dll');
+ // SetMBRadioIcon(IDC_MSGI_NONE,IDI_); //?
+ SetMBRadioIcon(h,IDC_MSGI_ERROR,103{IDI_HAND});
+ SetMBRadioIcon(h,IDC_MSGI_QUEST,102{IDI_QUESTION});
+ SetMBRadioIcon(h,IDC_MSGI_WARN ,101{IDI_EXCLAMATION});
+ SetMBRadioIcon(h,IDC_MSGI_INFO ,104{IDI_ASTERISK});
+ FreeLibrary(h);
+ end;
+
+ procedure FillFileName(idc:integer);
+ var
+ pw,ppw:pWideChar;
+ begin
+ mGetMem(pw,1024*SizeOf(WideChar));
+ ppw:=GetDlgText(Dialog,idc);
+ if ShowDlgW(pw,ppw) then
+ SetDlgItemTextW(Dialog,idc,pw);
+ mFreeMem(ppw);
+ mFreeMem(pw);
+ end;
+
+var
+ wnd,wnd1,wnd2:HWND;
+ i,j:int_ptr;
+ lvflag:integer;
+ pc:pAnsiChar;
+ li:LV_ITEMW;
+ lv:LV_COLUMNW;
+ b:boolean;
+ ico:HICON;
+begin
+ result:=0;
+ case hMessage of
+ WM_DESTROY: begin
+ ApiCard.Free;
+ SetCancel;
+ mFreeMem(wstruct);
+ mFreeMem(lstruct);
+ end;
+
+ WM_INITDIALOG: begin
+ ApiCard:=CreateServiceCard(Dialog);
+ wstruct:=nil;
+ lstruct:=nil;
+ SetStart;
+ DontReact :=true;
+ SHWindows;
+ TranslateDialogDefault(Dialog);
+ SetButtonIcons2(Dialog);
+ wnd:=GetDlgItem(Dialog,IDC_ACTION_LIST);
+ SendMessage(wnd,LVM_SETEXTENDEDLISTVIEWSTYLE,LVS_EX_CHECKBOXES,LVS_EX_CHECKBOXES);
+ SendMessage(wnd,LVM_SETUNICODEFORMAT,1,0);
+ zeromemory(@lv,sizeof(lv));
+ lv.mask:=LVCF_WIDTH;
+ lv.cx :=110;
+ SendMessageW(wnd,LVM_INSERTCOLUMNW ,0,tlparam(@lv));
+ SendMessageW(wnd,LVM_SETCOLUMNWIDTH,0,LVSCW_AUTOSIZE_USEHEADER);
+
+ MakeResultTypeList(GetDlgItem(Dialog,IDC_SRV_RESULT));
+ MakeParamTypeList (GetDlgItem(Dialog,IDC_FLAG_WPAR));
+ MakeParamTypeList (GetDlgItem(Dialog,IDC_FLAG_LPAR));
+ MakeMathOperList (GetDlgItem(Dialog,IDC_ADV_OPER));
+ MakeFileEncList (GetDlgItem(Dialog,IDC_FILE_ENC));
+ MakeDataTypeList (GetDlgItem(Dialog,IDC_RW_DATATYPE));
+
+ // service list for RunService
+ ApiCard.FillList(GetDlgItem(Dialog,IDC_EDIT_SERVICE));
+ // contact list for ContactMessage
+ FillContactList(GetDlgItem(Dialog,IDC_CONTACTLIST),fCLfilter,fCLformat);
+ // action type combobox
+ FillActTypeList(GetDlgItem(Dialog,IDC_ACTION_TYPE));
+
+ if isVarsInstalled then
+ begin
+ ico:=CallService(MS_VARS_GETSKINITEM,0,VSI_HELPICON);
+ SendDlgItemMessage(Dialog,IDC_HLP_FVARS,BM_SETIMAGE,IMAGE_ICON,ico);
+ SendDlgItemMessage(Dialog,IDC_HLP_VARS ,BM_SETIMAGE,IMAGE_ICON,ico);
+ SendDlgItemMessage(Dialog,IDC_ADV_HVARS,BM_SETIMAGE,IMAGE_ICON,ico);
+ end;
+
+ if ServiceExists(MS_SYSTEM_GET_XI)=0 then
+ begin
+ EnableWindow(GetDlgItem(Dialog,IDC_GROUP_EXPORT),false);
+ EnableWindow(GetDlgItem(Dialog,IDC_GROUP_IMPORT),false);
+ end;
+
+ OldActTableProc :=pointer(SetWindowLongPtrW(wnd,GWL_WNDPROC,long_ptr(@NewActTableProc)));
+ OldGroupTableProc:=pointer(SetWindowLongPtrW(GetDlgItem(Dialog,IDC_ACTION_GROUP),
+ GWL_WNDPROC,long_ptr(@NewGroupTableProc)));
+
+ // fill group list
+ wnd:=GetDlgItem(Dialog,IDC_ACTION_GROUP);
+ SendMessage(wnd,LVM_SETUNICODEFORMAT,1,0);
+ lv.mask:=LVCF_WIDTH;
+ lv.cx :=110;
+ SendMessageW(wnd,LVM_INSERTCOLUMNW,0,tlparam(@lv));
+ FillGroupList{(Dialog)};
+ FillChainList(Dialog);
+
+ SetMBRadioIcons;
+
+ // fill current group
+ MakeActionList(@NewGroupList^);
+ ChMask:=0;
+ CheckGrpList(-1);
+ DontReact:=false;
+ end;
+
+ WM_COMMAND: begin
+ if DontReact then exit;
+ case wParam shr 16 of
+ CBN_EDITCHANGE: begin
+ ChMask:=ChMask or ACTM_ACT or ACTM_ACTS;
+ SetChanged(Dialog,etACT);
+ end;
+ EN_CHANGE: begin
+// check for group renaming
+ if loword(wParam)<>IDC_EDIT_FORMAT then
+ begin
+ ChMask:=ChMask or ACTM_ACT or ACTM_ACTS;
+ SetChanged(Dialog,etACT);
+ end;
+ end;
+ CBN_SELCHANGE: begin
+ ChMask:=ChMask or ACTM_ACT or ACTM_ACTS;
+ SetChanged(Dialog,etACT);
+ case loword(wParam) of
+ IDC_SRV_RESULT: begin
+ i:=CB_GetData(lParam);
+ case i of
+ sresHex,sresInt,sresStruct: begin
+ SHControl(IDC_RES_FREEMEM,SW_HIDE);
+ SHControl(IDC_RES_UNICODE,SW_HIDE);
+ if i=sresInt then
+ SHControl(IDC_RES_SIGNED,SW_SHOW)
+ else
+ SHControl(IDC_RES_SIGNED,SW_HIDE);
+ end;
+ sresString: begin
+ SHControl(IDC_RES_FREEMEM,SW_SHOW);
+ SHControl(IDC_RES_UNICODE,SW_SHOW);
+ SHControl(IDC_RES_SIGNED ,SW_HIDE);
+ end;
+ end;
+ end;
+
+ IDC_ADV_OPER: begin
+ EnableWindow(GetDlgItem(Dialog,IDC_ADV_VAL1),
+ (CB_GetData(lParam)<>lresult(aeNot)));
+// SendMessage(lParam,CB_GETCURSEL,0,0)<>0);
+ end;
+
+ IDC_RW_DATATYPE: begin
+ if CB_GetData(GetDlgItem(Dialog,IDC_RW_DATATYPE))>2 then
+ begin
+ SHControl(IDC_RW_TEXT ,SW_SHOW);
+ SHControl(IDC_RW_VALUE,SW_HIDE);
+ end
+ else
+ begin
+ SHControl(IDC_RW_TEXT ,SW_HIDE);
+ SHControl(IDC_RW_VALUE,SW_SHOW);
+ end;
+ end;
+
+ IDC_ACTION_TYPE: begin
+ i:=SendMessage(lParam,CB_GETCURSEL,0,0);
+ SHWindows(ActIds[i].code);
+ ChangeActionName(-1,i+1);
+ case ActIds[i].code of
+ ACT_CONTACT: EnableWindow(GetDlgItem(Dialog,IDC_CONTACTLIST),true);
+ ACT_RW: begin
+ EnableWindow(GetDlgItem(Dialog,IDC_CONTACTLIST),
+ (IsDlgButtonChecked(Dialog,IDC_RW_MANUAL)=BST_CHECKED));
+
+ if CB_GetData(GetDlgItem(Dialog,IDC_RW_DATATYPE))>2 then
+ begin
+ SHControl(IDC_RW_TEXT ,SW_SHOW);
+ SHControl(IDC_RW_VALUE,SW_HIDE);
+ end
+ else
+ begin
+ SHControl(IDC_RW_TEXT ,SW_HIDE);
+ SHControl(IDC_RW_VALUE,SW_SHOW);
+ end;
+
+ end;
+ ACT_ADVANCE: FillSubList(Dialog);
+ end;
+ end;
+{
+ IDC_EDIT_WPAR,IDC_EDIT_LPAR: begin
+ SendMessage(lParam,CB_GETLBTEXT,
+ SendMessage(lParam,CB_GETCURSEL,0,0),TLPARAM(@buf));
+ if loword(wParam)=IDC_EDIT_WPAR then
+ FixParam(buf,IDC_EDIT_WPAR,IDC_FLAG_WPAR)
+ else
+ FixParam(buf,IDC_EDIT_LPAR,IDC_FLAG_LPAR)
+ end;
+}
+ IDC_FLAG_WPAR,IDC_FLAG_LPAR: begin
+ if loword(wParam)=IDC_FLAG_WPAR then
+ begin
+ wnd :=GetDlgItem(Dialog,IDC_EDIT_WPAR);
+ wnd1:=GetDlgItem(Dialog,IDC_WSTRUCT);
+ wnd2:=GetDlgItem(Dialog,IDC_SRV_WPAR);
+ end
+ else
+ begin
+ wnd :=GetDlgItem(Dialog,IDC_EDIT_LPAR);
+ wnd1:=GetDlgItem(Dialog,IDC_LSTRUCT);
+ wnd2:=GetDlgItem(Dialog,IDC_SRV_LPAR);
+ end;
+ i:=CB_GetData(GetDlgItem(Dialog,loword(wParam)));
+
+ if i=ptStruct then
+ begin
+ ShowWindow(wnd ,SW_HIDE);
+ ShowWindow(wnd2,SW_HIDE);
+ ShowWindow(wnd1,SW_SHOW);
+ end
+ else
+ begin
+ ShowWindow(wnd ,SW_SHOW);
+ ShowWindow(wnd2,SW_SHOW);
+ ShowWindow(wnd1,SW_HIDE);
+ if i in [ptCurrent,ptResult,ptParam] then
+ EnableWindow(wnd,false)
+ else
+ begin
+ EnableWindow(wnd,true);
+{
+ flag:=GetWindowLongPtr(wnd,GWL_STYLE);
+ if i=ptNumber then
+ flag:=flag or ES_NUMBER
+ else
+ flag:=flag and not ES_NUMBER;
+ SetWindowLongPtr(wnd,GWL_STYLE,flag);
+}
+ end;
+ end;
+ end;
+ IDC_EDIT_SERVICE: ReloadService;
+ end;
+ end;
+ BN_CLICKED: begin
+ case loword(wParam) of
+ IDC_GROUP_RELOAD, // don't affect to saved (DB) datas
+ IDC_WSTRUCT, // 'Changed' on process
+ IDC_LSTRUCT, // 'Changed' on process
+ IDC_HLP_FVARS,
+ IDC_HLP_VARS,
+ IDC_ADV_HVARS,
+ IDC_ACTION_HELP,
+ IDC_GROUP_EXPORT,
+ IDC_CNT_APPLY,
+ IDC_CNT_FILTER,
+ IDC_GROUP_TEST: ;
+
+ IDC_GROUP_UP,
+ IDC_GROUP_DOWN,
+ IDC_GROUP_NEW : SetChanged(Dialog,etHK);
+
+ IDC_GROUP_DELETE, // action deleting with subactions
+ IDC_GROUP_IMPORT,
+ IDC_ACTION_NEW,
+ IDC_ACTION_DELETE,
+ IDC_ACTION_UP,
+ IDC_ACTION_DOWN: begin
+ ChMask:=ChMask or ACTM_ACT or ACTM_ACTS;
+ SetChanged(Dialog,etHK+etACT);
+ end;
+ else
+ ChMask:=ChMask or ACTM_ACT or ACTM_ACTS;
+ SetChanged(Dialog,etACT);
+ end;
+
+ case loword(wParam) of
+ IDC_SRV_WPAR,
+ IDC_SRV_LPAR,
+ IDC_SRV_SRVC,
+ IDC_PRG_PRG ,
+ IDC_PRG_ARG ,
+ IDC_TXT_FILE,
+ IDC_TXT_TEXT,
+ IDC_RW_MVAR ,
+ IDC_RW_SVAR ,
+ IDC_RW_TVAR ,
+ IDC_MSG_TTL ,
+ IDC_MSG_TXT : SetButtonIcon(lParam,checknames[IsDlgButtonChecked(Dialog,loword(wParam))]);
+ end;
+
+ case loword(wParam) of
+ IDC_CNT_FILTER,
+ IDC_CNT_APPLY: begin
+ if loword(wParam)=IDC_CNT_APPLY then
+ begin
+ mFreeMem(fCLformat);
+ fCLformat:=GetDlgText(Dialog,IDC_EDIT_FORMAT);
+ DBWriteUnicode(0,DBBranch,'CLformat',fCLformat);
+ end
+ else
+ begin
+ fCLfilter:=IsDlgButtonChecked(Dialog,IDC_CNT_FILTER)<>BST_UNCHECKED;
+ DBWriteByte(0,DBBranch,'CLfilter',ord(fCLfilter));
+ end;
+// Saving and restoring contact after list rebuild
+ wnd:=GetDlgItem(Dialog,IDC_CONTACTLIST);
+ i:=SendMessage(wnd,CB_GETITEMDATA,SendMessage(wnd,CB_GETCURSEL,0,0),0);
+
+ FillContactList(wnd,fCLfilter,fCLformat);
+
+ SendMessage(wnd,CB_SETCURSEL,FindContact(wnd,i),0);
+ end;
+ IDC_HLP_FVARS,
+ IDC_HLP_VARS : ShowHelp(hlpVariables);
+ IDC_ADV_HVARS: ShowHelp(hlpAdvVariables);
+
+ IDC_GROUP_EXPORT: begin
+ if ShowDlgW(xmlfilename,xmlfilename,inoutfilter,false) then
+ begin
+ wnd:=GetDlgItem(Dialog,IDC_ACTION_GROUP);
+ for i:=0 to ListView_GetItemCount(wnd)-1 do
+ begin
+ if ListView_GetItemState(wnd,i,LVIS_SELECTED)<>0 then
+ begin
+ with GroupList[LV_GetLParam(wnd,i)] do
+ if (flags and ACF_ASSIGNED)<>0 then // must be always true
+ flags:=flags or ACF_EXPORT;
+ end
+ else
+ with GroupList[i] do
+ if (flags and (ACF_EXPORT or ACF_ASSIGNED))=
+ (ACF_EXPORT or ACF_ASSIGNED) then
+ flags:=flags and not ACF_EXPORT;
+ end;
+ i:=ACIO_EXPORT or ACIO_SELECTED;
+ if GetFSize(xmlfilename)>0 then
+ if MessageBoxW(Dialog,TranslateW('Append data to file?'),
+ PluginName,MB_YESNO+MB_ICONWARNING)=IDYES then
+ i:=i or ACIO_APPEND;
+ CallService(MS_ACT_INOUT,i,TLPARAM(@xmlfilename));
+// Export({GetLParam(GetDlgItem(Dialog,IDC_ACTION_GROUP)),}xmlfilename,i);
+ for i:=0 to MaxGroups-1 do
+ with GroupList[i] do
+ if (flags and (ACF_EXPORT or ACF_ASSIGNED))=
+ (ACF_EXPORT or ACF_ASSIGNED) then
+ flags:=flags and not ACF_EXPORT;
+ end;
+ end;
+
+ IDC_GROUP_IMPORT: begin
+ if ShowDlgW(xmlfilename,xmlfilename,inoutfilter) then
+ begin
+// if Import(xmlfilename) then
+ if CallService(MS_ACT_INOUT,0,TLPARAM(@xmlfilename))<>0 then
+ begin
+ ChMask:=ChMask or ACTM_NEW;
+ SendMessage(Dialog,WM_COMMAND,IDC_GROUP_RELOAD+(BN_CLICKED shl 16),
+ GetDlgItem(Dialog,IDC_GROUP_RELOAD));
+//(in reload) FillChainList(Dialog);
+ end;
+ end;
+ end;
+
+ IDC_WSTRUCT, IDC_LSTRUCT: begin
+ if loword(wParam)=IDC_WSTRUCT then
+ pc:=wstruct
+ else
+ pc:=lstruct;
+//!!!!
+ pAnsiChar(j):=EditStructure(pAnsiChar(pc),Dialog);
+ if j<>0 then
+ begin
+ ChMask:=ChMask or ACTM_ACT or ACTM_ACTS;
+ SetChanged(Dialog,etACT);
+ mFreeMem(pAnsiChar(pc));
+ pc:=pAnsiChar(j);
+
+ if loword(wParam)=IDC_WSTRUCT then
+ wstruct:=pc
+ else
+ lstruct:=pc;
+ end;
+ end;
+
+ IDC_PROGRAM: begin
+ FillFileName(IDC_EDIT_PRGPATH);
+ end;
+ IDC_FILE_FILEBTN: begin
+ FillFileName(IDC_FILE_PATH);
+ end;
+
+ IDC_GROUP_TEST: begin
+ wnd:=GetDlgItem(Dialog,IDC_ACTION_LIST);
+ li.mask :=LVIF_PARAM;
+ li.iSubItem:=0;
+ li.iItem :=0;
+ SendMessageW(wnd,LVM_GETITEMW,0,tlparam(@li));
+ j:=SendMessage(wnd,LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
+
+ ActionStarterWait(li.lParam);
+ // doubling from "reload" button
+ wnd:=GetDlgItem(Dialog,IDC_ACTION_GROUP);
+ i:=SendMessage(wnd,LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
+ NewGroupList :=GroupList;
+ NewMaxGroups :=MaxGroups;
+ NewActionList:=ActionList;
+ NewMaxActions:=MaxActions;
+ FillGroupList{(Dialog)};
+ FillChainList(Dialog);
+
+ Listview_SetItemState(wnd,0,0,LVIS_FOCUSED or LVIS_SELECTED);
+ Listview_SetItemState(wnd,i,
+ LVIS_FOCUSED or LVIS_SELECTED,
+ LVIS_FOCUSED or LVIS_SELECTED);
+ SendMessage(wnd,LVM_ENSUREVISIBLE,i,0);
+
+ wnd:=GetDlgItem(Dialog,IDC_ACTION_LIST);
+ Listview_SetItemState(wnd,0,0,LVIS_FOCUSED or LVIS_SELECTED);
+ Listview_SetItemState(wnd,j,
+ LVIS_FOCUSED or LVIS_SELECTED,
+ LVIS_FOCUSED or LVIS_SELECTED);
+ SendMessage(wnd,LVM_ENSUREVISIBLE,j,0);
+
+ end;
+ IDC_GROUP_NEW: begin
+ i:=AddGroup(Dialog,NewGroup(NewGroupList,NewMaxGroups));
+ if i>=0 then
+ begin
+ ChMask:=ChMask or ACTM_NEW or ACTM_SORT;
+ EnableWindow(GetDlgItem(Dialog,IDC_ACTION_GROUP),true);
+ EnableWindow(GetDlgItem(Dialog,IDC_GROUP_DELETE),true);
+ EnableWindow(GetDlgItem(Dialog,IDC_ACTION_NEW ),true);
+ FillChainList(Dialog);
+ CheckGrpList(i);
+ end;
+ end;
+ IDC_GROUP_DELETE: begin
+ wnd:=GetDlgItem(Dialog,IDC_ACTION_GROUP);
+ for i:=ListView_GetItemCount(wnd)-1 downto 0 do
+ begin
+ if ListView_GetItemState(wnd,i,LVIS_SELECTED)<>0 then
+ begin
+ ChMask:=ChMask or ACTM_DELETE or ACTM_SORT;
+
+ with NewGroupList^[LV_GetLParam(wnd,i)] do
+ begin
+ flags:=0;
+ mFreeMem(descr);
+ FreeActions(NewActionList,firstAction);
+ end;
+
+ SendMessage(wnd,LVM_DELETEITEM,i,0);
+ end;
+ end;
+ SendDlgItemMessage(Dialog,IDC_ACTION_LIST,LVM_DELETEALLITEMS,0,0);
+ FillChainList(Dialog);
+ Listview_SetItemState(wnd,0,LVIS_FOCUSED or LVIS_SELECTED,
+ LVIS_FOCUSED or LVIS_SELECTED);
+ CheckGroupList(-1);
+{
+ i:=SendMessageW(wnd,LVM_GETNEXTITEM,-1,LVNI_FOCUSED); //??
+ if i>=0 then
+ begin
+ ChMask:=ChMask or ACTM_DELETE;
+ j:=GetLParam(wnd,i);
+
+ with NewGroupList^[j] do
+ begin
+ flags:=0;
+ mFreeMem(descr);
+ FreeActions(NewActionList,firstAction);
+ end;
+ SendDlgItemMessage(Dialog,IDC_ACTION_LIST,LVM_DELETEALLITEMS,0,0);
+
+//?? i:=ListView_GetNextItem(wnd,-1,LVNI_FOCUSED);
+ SendMessage(wnd,LVM_DELETEITEM,i,0);
+ FillChainList(Dialog);
+ CheckGroupList(i);
+ end;
+}
+ end;
+ IDC_GROUP_RELOAD: begin
+ ChMask:=ChMask or ACTM_RELOAD;
+ SetCancel;
+ NewGroupList :=GroupList;
+ NewMaxGroups :=MaxGroups;
+ NewActionList:=ActionList;
+ NewMaxActions:=MaxActions;
+ FillGroupList{(Dialog)};
+ FillChainList(Dialog);
+ end;
+
+ IDC_ACTION_HELP: begin
+ ShowHelp(SendDlgItemMessage(Dialog,IDC_ACTION_TYPE,CB_GETCURSEL,0,0));
+ end;
+
+ IDC_ACTION_NEW: begin
+ wnd:=GetDlgItem(Dialog,IDC_ACTION_LIST);
+ li.mask :=LVIF_PARAM;
+ i :=SendMessage(wnd,LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
+ li.iItem :=i+1;
+ li.iSubItem:=0;
+ li.lParam :=NewAction(NewActionList,NewMaxActions);
+ SendMessageW(wnd,LVM_INSERTITEMW,0,tlparam(@li));
+ ListView_SetCheckState(wnd,li.iItem,true);
+ if li.iItem=0 then
+ begin
+ ListView_SetItemState(wnd,0,LVIS_FOCUSED or LVIS_SELECTED,
+ LVIS_FOCUSED or LVIS_SELECTED);
+ SHActButtons(SW_SHOW);
+ end;
+ ChangeActionName(li.iItem);
+ EnableWindow(GetDlgItem(Dialog,IDC_ACTION_LIST ),true);
+ EnableWindow(GetDlgItem(Dialog,IDC_ACTION_HELP ),true);
+ EnableWindow(GetDlgItem(Dialog,IDC_GROUP_TEST ),true);
+ EnableWindow(GetDlgItem(Dialog,IDC_ACTION_DELETE),true);
+ EnableWindow(GetDlgItem(Dialog,IDC_ACTION_TYPE ),true);
+ CheckActList(i);
+
+ wnd:=GetDlgItem(Dialog,IDC_ADV_VAL2);
+ i:=SendMessage(wnd,CB_GETCURSEL,0,0);
+ FillSubList(Dialog);
+ SendMessage(wnd,CB_SETCURSEL,i,0);
+ end;
+ IDC_ACTION_DELETE: begin
+ wnd:=GetDlgItem(Dialog,IDC_ACTION_LIST);
+ for i:=ListView_GetItemCount(wnd)-1 downto 0 do
+ begin
+ if ListView_GetItemState(wnd,i,LVIS_SELECTED)<>0 then
+ begin
+ FreeAction(@NewActionList^[LV_GetLParam(wnd,i)]);
+ SendMessage(wnd,LVM_DELETEITEM,i,0);
+ end;
+ end;
+ Listview_SetItemState(wnd,0,LVIS_FOCUSED or LVIS_SELECTED,
+ LVIS_FOCUSED or LVIS_SELECTED);
+ CheckActionList(0);
+{
+ wnd:=GetDlgItem(Dialog,IDC_ACTION_LIST);
+ li.iItem:=SendMessage(wnd,LVM_GETNEXTITEM,-1,LVNI_FOCUSED); //??
+ if li.iItem>=0 then
+ begin
+ li.mask :=LVIF_PARAM;
+ li.iSubItem:=0;
+ SendMessageW(wnd,LVM_GETITEM,0,TLPARAM(@li));
+ FreeAction(@NewActionList^[li.lParam]);
+
+ SendMessage(wnd,LVM_DELETEITEM,li.iItem,0);
+ CheckActionList(li.iItem);
+ end;
+}
+ end;
+
+ IDC_GROUP_UP: begin
+ wnd:=GetDlgItem(Dialog,IDC_ACTION_GROUP);
+// i:=SendMessage(wnd,LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
+// if i>0 then
+ begin
+ CheckGrpList(MoveGroup(wnd,-1,-1));
+ ChMask:=ChMask or ACTM_SORT;
+ end;
+ end;
+ IDC_GROUP_DOWN: begin
+ wnd:=GetDlgItem(Dialog,IDC_ACTION_GROUP);
+// i:=SendMessage(wnd,LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
+// if i<(SendMessage(wnd,LVM_GETITEMCOUNT,0,0)-1) then
+ begin
+ CheckGrpList(MoveGroup(wnd,-1,1));
+ ChMask:=ChMask or ACTM_SORT;
+ end;
+ end;
+
+ IDC_ACTION_UP: begin
+ wnd:=GetDlgItem(Dialog,IDC_ACTION_LIST);
+// i:=SendMessage(wnd,LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
+// if i>0 then
+ CheckActList(MoveGroup(wnd,-1,-1));
+ end;
+ IDC_ACTION_DOWN: begin
+ wnd:=GetDlgItem(Dialog,IDC_ACTION_LIST);
+// i:=SendMessage(wnd,LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
+// if i<(SendMessage(wnd,LVM_GETITEMCOUNT,0,0)-1) then
+ CheckActList(MoveGroup(wnd,-1,1));
+ end;
+
+ IDC_FILE_WRITE, IDC_FILE_READ, IDC_FILE_APPEND:
+ EnableWindow(GetDlgItem(Dialog,IDC_EDIT_INSERT),
+ loword(wParam)<>IDC_FILE_APPEND);
+
+ IDC_RW_DELETE,
+ IDC_RW_READ,
+ IDC_RW_WRITE: begin
+ b:=loword(wParam)<>IDC_RW_DELETE;
+ EnableWindow(GetDlgItem(Dialog,IDC_RW_DATATYPE),b);
+ EnableWindow(GetDlgItem(Dialog,IDC_RW_LAST ),b);
+ EnableWindow(GetDlgItem(Dialog,IDC_RW_VALUE ),b);
+ EnableWindow(GetDlgItem(Dialog,IDC_RW_TEXT ),b);
+ end;
+
+ IDC_FLAG_CLIP,IDC_FLAG_FILE,IDC_FLAG_MESSAGE: begin
+ b:=loword(wParam)=IDC_FLAG_CLIP;
+//!! +text read = disabled
+ EnableWindow(GetDlgItem(Dialog,IDC_CLIP_COPYTO),b);
+ EnableWindow(GetDlgItem(Dialog,IDC_CLIP_PASTE ),b);
+ b:=b or ((loword(wParam)=IDC_FLAG_FILE) and
+ (IsDlgButtonChecked(Dialog,IDC_FILE_READ)<>BST_UNCHECKED));
+ EnableWindow(GetDlgItem(Dialog,IDC_EDIT_INSERT),not b);
+
+ b:=loword(wParam)=IDC_FLAG_FILE;
+ EnableWindow(GetDlgItem(Dialog,IDC_FILE_ENC ),b);
+ EnableWindow(GetDlgItem(Dialog,IDC_FILE_PATH ),b);
+ EnableWindow(GetDlgItem(Dialog,IDC_FILE_FILEBTN),b);
+ EnableWindow(GetDlgItem(Dialog,IDC_FILE_READ ),b);
+ EnableWindow(GetDlgItem(Dialog,IDC_FILE_WRITE ),b);
+ EnableWindow(GetDlgItem(Dialog,IDC_FILE_APPEND ),b);
+ end;
+
+ IDC_FLAG_JUMP: begin
+ EnableWindow(GetDlgItem(Dialog,IDC_ADV_VAL2),true);
+ end;
+
+ IDC_FLAG_BREAK,IDC_FLAG_ANOP:
+ begin
+ EnableWindow(GetDlgItem(Dialog,IDC_ADV_VAL2),false);
+ end;
+
+ IDC_FLAG_VARS: begin
+ if IsDlgButtonChecked(Dialog,IDC_FLAG_VARS)<>BST_UNCHECKED then
+ begin
+ SHMath(false);
+ CheckDlgButton(Dialog,IDC_FLAG_MATH,BST_UNCHECKED);
+ end
+ else
+ begin
+ EnableWindow(GetDlgItem(Dialog,IDC_ADV_ASINT),false);
+ EnableWindow(GetDlgItem(Dialog,IDC_ADV_VARS ),false);
+ end;
+ end;
+ IDC_FLAG_MATH: begin
+ if IsDlgButtonChecked(Dialog,IDC_FLAG_MATH)<>BST_UNCHECKED then
+ begin
+ SHMath(true);
+ CheckDlgButton(Dialog,IDC_FLAG_VARS,BST_UNCHECKED);
+ end
+ else
+ begin
+ EnableWindow(GetDlgItem(Dialog,IDC_ADV_OPER),false);
+ EnableWindow(GetDlgItem(Dialog,IDC_ADV_VAL1),false);
+ end;
+ end;
+
+ IDC_RW_CURRENT, IDC_RW_RESULT, IDC_RW_PARAM: begin
+ EnableWindow(GetDlgItem(Dialog,IDC_CONTACTLIST),false);
+ end;
+ IDC_RW_MANUAL: EnableWindow(GetDlgItem(Dialog,IDC_CONTACTLIST),true);
+
+ IDC_RW_LAST: begin
+ b :=IsDlgButtonChecked(Dialog,IDC_RW_LAST )=BST_UNCHECKED;
+ EnableWindow(GetDlgItem(Dialog,IDC_RW_VALUE), b);
+ EnableWindow(GetDlgItem(Dialog,IDC_RW_TEXT ), b);
+ end;
+ end;
+ end;
+ end;
+ end;
+
+ WM_HELP: begin
+ if (PHELPINFO(lParam)^.iContextType=HELPINFO_WINDOW) then
+ ShowHelp(SendDlgItemMessage(Dialog,IDC_ACTION_TYPE,CB_GETCURSEL,0,0));
+ end;
+
+ WM_NOTIFY: begin
+ case integer(PNMHdr(lParam)^.code) of
+ PSN_APPLY: begin
+ BuildActionChain;
+ SetSave(Dialog,LV_GetLParam(GetDlgItem(Dialog,IDC_ACTION_GROUP)));
+
+ if ActionList<>NewActionList then
+ begin
+ DestroyActions(ActionList,MaxActions);
+ ActionList:=NewActionList;
+ MaxActions:=NewMaxActions;
+ end;
+
+ SaveGroups;
+
+ if ChMask<>0 then //??
+ begin
+ NotifyEventHooks(hHookChanged,ChMask,0);
+ ChMask:=0;
+ end;
+
+ end;
+
+ NM_DBLCLK: begin
+ if PNMListView(lParam)^.iItem>=0 then
+ PostMessageW(PNMHdr(lParam)^.hWndFrom,LVM_EDITLABELW,
+ PNMListView(lParam)^.iItem,0);
+ end;
+
+ LVN_ITEMCHANGED: begin
+ if DontReact then exit; // bug when group moved avoid
+
+ if wParam=IDC_ACTION_GROUP then
+ begin
+ if PNMLISTVIEW(lParam)^.uChanged=LVIF_STATE then
+ begin
+ lvflag:=(PNMLISTVIEW(lParam)^.uOldState and LVNI_FOCUSED)-
+ (PNMLISTVIEW(lParam)^.uNewState and LVNI_FOCUSED);
+
+ if lvflag>0 then // old focus
+ BuildActionChain(PNMLISTVIEW(lParam)^.iItem)
+ else if lvflag<0 then // new focus
+ begin
+ DontReact:=true;
+
+ ClearDialogData;
+ MakeActionList(@NewGroupList^[PNMLISTVIEW(lParam)^.lParam]);
+ CheckGrpList(PNMLISTVIEW(lParam)^.iItem);
+
+ DontReact:=false;
+ end
+ else
+ begin
+ lvflag:=(PNMLISTVIEW(lParam)^.uOldState and LVNI_SELECTED)-
+ (PNMLISTVIEW(lParam)^.uNewState and LVNI_SELECTED);
+ if lvflag<>0 then
+ CheckGrpList(PNMLISTVIEW(lParam)^.iItem);
+ end;
+ end;
+ end
+ else if wParam=IDC_ACTION_LIST then
+ begin
+ lvflag:=(PNMLISTVIEW(lParam)^.uOldState and LVNI_FOCUSED)-
+ (PNMLISTVIEW(lParam)^.uNewState and LVNI_FOCUSED);
+ if lvflag>0 then // old focus
+ SaveAction(PNMLISTVIEW(lParam)^.iItem,
+ PNMLISTVIEW(lParam)^.lParam)
+ else if lvflag<0 then // new focus
+ begin
+ DontReact:=true;
+
+ ClearDialogData;
+ j:=PNMLISTVIEW(lParam)^.lParam;
+ FillAction(j);
+ CheckActList(PNMLISTVIEW(lParam)^.iItem);
+
+ DontReact:=false;
+ end
+ else
+ begin // checkboxes
+ lvflag:=(PNMLISTVIEW(lParam)^.uOldState and LVNI_SELECTED)-
+ (PNMLISTVIEW(lParam)^.uNewState and LVNI_SELECTED);
+ if lvflag<>0 then
+ CheckGrpList(PNMLISTVIEW(lParam)^.iItem);
+
+ if (PNMLISTVIEW(lParam)^.uOldState or PNMLISTVIEW(lParam)^.uNewState)=$3000 then
+ begin
+ if PNMLISTVIEW(lParam)^.uOldState=$1000 then
+ i:=0
+ else
+ i:=ACF_DISABLED;
+ j:=PNMLISTVIEW(lParam)^.lParam;
+ NewActionList^[j].flags:=(NewActionList^[j].flags and not ACF_DISABLED) or dword(i);
+ ChMask:=ChMask or ACTM_ACT or ACTM_ACTS;
+ SetChanged(Dialog,etACT);
+ end;
+ end;
+ end;
+ end;
+
+ LVN_ENDLABELEDITW: begin
+ if DontReact then exit;
+ if wParam=IDC_ACTION_GROUP then
+ begin
+ with PLVDISPINFOW(lParam)^ do
+ begin
+ if item.pszText<>nil then
+ begin
+ ChMask:=ChMask or ACTM_RENAME;
+ SetChanged(Dialog,etHK);
+ item.mask:=LVIF_TEXT;
+ if pWideChar(item.pszText)^=#0 then
+ pWideChar(item.pszText):=NoDescription;
+ SendMessageW(hdr.hWndFrom,LVM_SETITEMW,0,tlparam(@item));
+
+ with NewGroupList^[item.lParam] do
+ begin
+ mFreeMem(descr);
+ StrDupW(descr,item.pszText);
+ end;
+
+ FillChainList(Dialog);
+ result:=1;
+ end;
+ end;
+ end
+ else if wParam=IDC_ACTION_LIST then
+ begin
+ with PLVDISPINFOW(lParam)^ do
+ begin
+ if item.pszText<>nil then
+ begin
+ ChMask:=ChMask or ACTM_ACT or ACTM_ACTS;
+ SetChanged(Dialog,etACT);
+ ChangeActionName(item.iItem,0,pWideChar(item.pszText));
+ result:=1;
+ end;
+//??
+ end;
+ end;
+ end;
+
+ end;
+ end;
+ else
+// {result:=}DefWindowProc(Dialog,hMessage,wParam,lParam);
+ end;
+// {result:=}DefWindowProc(Dialog,hMessage,wParam,lParam);
+end;
diff --git a/plugins/!Deprecated/Actman20/i_options.inc b/plugins/!Deprecated/Actman20/i_options.inc new file mode 100644 index 0000000000..26dd8e1f08 --- /dev/null +++ b/plugins/!Deprecated/Actman20/i_options.inc @@ -0,0 +1,459 @@ +{Save/load options}
+
+const
+ opt_group = 'Group';
+ opt_actions = 'Action';
+ opt_numacts = 'numactions';
+ opt_numhk = 'numgroups';
+ opt_firstAction = 'firstaction';
+
+ opt_cproto = 'cproto';
+ opt_cuid = 'cuid';
+ opt_ischat = 'ischat';
+
+ opt_descr = 'descr';
+ opt_id = 'id';
+ opt_flags = 'flags';
+ opt_flags2 = 'flags2';
+ opt_time = 'time';
+ opt_show = 'show';
+ opt_action = 'action';
+ opt_value = 'value';
+ opt_file = 'file';
+
+ opt_next = 'next';
+ opt_type = 'type';
+ opt_contact = 'contact';
+ opt_text = 'text';
+ opt_prg = 'program';
+ opt_args = 'arguments';
+ opt_service = 'service';
+ opt_wparam = 'wparam';
+ opt_wlparam = 'wparamlen';
+ opt_llparam = 'lparamlen';
+ opt_lparam = 'lparam';
+ opt_chain = 'chain';
+ opt_cond = 'condition';
+ opt_count = 'count';
+ opt_module = 'module';
+ opt_setting = 'setting';
+ opt_oper = 'operation';
+ opt_mathval = 'mathval';
+ opt_operval = 'operval';
+ opt_varval = 'varval';
+ opt_msgtitle = 'msgtitle';
+ opt_msgtext = 'msgtext';
+ opt_boxopts = 'boxopts';
+
+
+//----- Save settings -----
+
+procedure SaveNumValue(setting:pAnsiChar;value:uint_ptr;isvar:boolean);
+begin
+ if isvar then
+ DBWriteUnicode(0,DBBranch,setting,pWideChar(value))
+ else
+ DBWriteDWord (0,DBBranch,setting,value);
+end;
+
+function SaveActions(section:pAnsiChar;first:integer):integer;
+var
+ p,p1:PAnsiChar;
+ act:pHKAction;
+ i:integer;
+begin
+ result:=0;
+ // in: section = "Group#/"
+ p1:=StrCopyE(StrEnd(section),opt_actions); // "Group#/Action"
+ DBDeleteGroup(0,DBBranch,section);
+ i:=1;
+ while first<>0 do
+ begin
+ act:=@ActionList[first];
+ p:=StrEnd(IntToStr(p1,i)); //!!!
+ p^:='/'; inc(p); // "Group#/Action#/"
+
+ StrCopy(p,opt_flags ); DBWriteDWord(0,DBBranch,section,act^.flags);
+ StrCopy(p,opt_flags2); DBWriteDWord(0,DBBranch,section,act^.flags2);
+ StrCopy(p,opt_type ); DBWriteByte (0,DBBranch,section,act^.actionType);
+ if act^.descr<>nil then
+ begin
+ StrCopy(p,opt_descr); DBWriteUnicode(0,DBBranch,section,act^.descr);
+ end;
+
+ case act^.actionType of
+ ACT_CONTACT: begin
+ p^:=#0;
+ SaveContact(act^.contact,DBBranch,section);
+ end;
+
+ ACT_SERVICE: begin
+ StrCopy(p,opt_service); DBWriteString(0,DBBranch,section,act^.service);
+
+ if (act^.flags and (ACF_WCURRENT or ACF_WRESULT or ACF_WPARAM))=0 then
+ begin
+ StrCopy(p,opt_wparam);
+ if (act^.flags and ACF_WPARNUM)<>0 then
+ SaveNumValue(section,act^.wparam,(act^.flags2 and ACF2_SRV_WPAR)<>0)
+// DBWriteDWord(0,DBBranch,section,act^.wparam)
+ else if act^.wparam<>0 then
+ begin
+ if (act^.flags and ACF_WSTRUCT)<>0 then
+ DBWriteUTF8(0,DBBranch,section,pAnsiChar(act^.wparam))
+ else if (act^.flags and ACF_WUNICODE)<>0 then
+ DBWriteUnicode(0,DBBranch,section,pWideChar(act^.wparam))
+ else
+ DBWriteString(0,DBBranch,section,PAnsiChar(act^.wparam));
+ end;
+ end;
+
+ if (act^.flags and (ACF_LCURRENT or ACF_LRESULT or ACF_LPARAM))=0 then
+ begin
+ StrCopy(p,opt_lparam);
+ if (act^.flags and ACF_LPARNUM)<>0 then
+ SaveNumValue(section,act^.lparam,(act^.flags2 and ACF2_SRV_LPAR)<>0)
+// DBWriteDWord(0,DBBranch,section,act^.lparam)
+ else if act^.lparam<>0 then
+ begin
+ if (act^.flags and ACF_LSTRUCT)<>0 then
+ DBWriteUTF8(0,DBBranch,section,pAnsiChar(act^.lparam))
+ else if (act^.flags and ACF_LUNICODE)<>0 then
+ DBWriteUnicode(0,DBBranch,section,pWideChar(act^.lparam))
+ else
+ DBWriteString(0,DBBranch,section,PAnsiChar(act^.lparam));
+ end;
+ end;
+
+ end;
+
+ ACT_PROGRAM: begin
+ StrCopy(p,opt_prg ); DBWriteUnicode(0,DBBranch,section,act^.prgname);
+ StrCopy(p,opt_args); DBWriteUnicode(0,DBBranch,section,act^.args);
+ StrCopy(p,opt_time); DBWriteDWord (0,DBBranch,section,act^.time);
+ StrCopy(p,opt_show); DBWriteDWord (0,DBBranch,section,act^.show);
+ end;
+
+ ACT_TEXT: begin
+ if (act^.flags and ACF_CLIPBRD)=0 then
+ begin
+ StrCopy(p,opt_text); DBWriteUnicode(0,DBBranch,section,act^.text);
+ if (act^.flags and ACF_FILE)<>0 then
+ begin
+ StrCopy(p,opt_file); DBWriteUnicode(0,DBBranch,section,act^.tfile);
+ end;
+ end;
+ end;
+
+ ACT_ADVANCE: begin
+ StrCopy(p,opt_cond ); DBWriteByte (0,DBBranch,section,act^.condition);
+ StrCopy(p,opt_value ); DBWriteDWord (0,DBBranch,section,act^.value);
+ StrCopy(p,opt_action ); DBWriteByte (0,DBBranch,section,act^.action);
+ StrCopy(p,opt_operval); DBWriteUnicode(0,DBBranch,section,act^.operval);
+ StrCopy(p,opt_oper ); DBWriteByte (0,DBBranch,section,act^.oper);
+ StrCopy(p,opt_mathval); DBWriteDWord (0,DBBranch,section,act^.mathval);
+ StrCopy(p,opt_varval ); DBWriteUnicode(0,DBBranch,section,act^.varval);
+ end;
+
+ ACT_CHAIN: begin
+ StrCopy(p,opt_text); DBWriteDWord(0,DBBranch,section,act^.id);
+ end;
+
+ ACT_RW: begin
+ if (act^.flags and ACF_NOCNTCT)=0 then
+ begin
+ p^:=#0;
+ SaveContact(act^.dbcontact,DBBranch,section);
+ end;
+ StrCopy(p,opt_module ); DBWriteString(0,DBBranch,section,act^.dbmodule);
+ StrCopy(p,opt_setting); DBWriteString(0,DBBranch,section,act^.dbsetting);
+ StrCopy(p,opt_value );
+ if (act^.flags and ACF_DBUTEXT)=0 then
+ begin
+ SaveNumValue(section,act^.dbvalue,(act^.flags2 and ACF2_RW_TVAR)<>0);
+// DBWriteDWord(0,DBBranch,section,act^.dbvalue)
+ end
+ else
+ DBWriteUnicode(0,DBBranch,section,pWideChar(act^.dbvalue));
+ end;
+
+ ACT_MESSAGE: begin
+ StrCopy(p,opt_msgtitle); DBWriteUnicode(0,DBBranch,section,act^.msgtitle);
+ StrCopy(p,opt_msgtext ); DBWriteUnicode(0,DBBranch,section,act^.msgtext);
+ StrCopy(p,opt_boxopts ); DBWriteByte (0,DBBranch,section,act^.boxopts); //!!
+ end;
+
+ end;
+ inc(result);
+ inc(i);
+ first:=ActionList^[first].next;
+ end;
+end;
+
+procedure SaveGroups;
+var
+ HK:pHKRecord;
+ NumHK:integer;
+ i,num:integer;
+ section:array [0..127] of AnsiChar;
+ p,p1:PAnsiChar;
+ Actions:integer;
+begin
+// even if crap in settings, skip on read
+// DBDeleteGroup(0,DBBranch,opt_group);
+ HK:=@GroupList^;
+ i:=MaxGroups;
+ NumHK:=0;
+ Actions:=1;
+ DBWriteUnicode(0,DBBranch,'CLformat',fCLformat);
+ DBWriteByte (0,DBBranch,'CLfilter',ord(fCLfilter));
+
+ p1:=StrCopyE(section,opt_group);
+ while i>0 do
+ begin
+ with HK^ do
+ begin
+ if (flags and (ACF_ASSIGNED or ACF_VOLATILE))=ACF_ASSIGNED then
+ begin
+ p:=StrEnd(IntToStr(p1,NumHK));
+ p^:='/'; inc(p);
+
+ StrCopy(p,opt_id ); DBWriteDWord(0,DBBranch,section,id);
+ StrCopy(p,opt_flags); DBWriteDWord(0,DBBranch,section,flags);
+ StrCopy(p,opt_descr);
+ if descr<>nil then
+ DBWriteUnicode (0,DBBranch,section,descr)
+ else
+ DBDeleteSetting(0,DBBranch,section);
+
+ p^:=#0;
+ //??
+ num:=SaveActions(section,firstAction);
+ StrCopy(p,opt_numacts); DBWriteWord(0,DBBranch,section,num);
+
+ inc(Actions,num);
+ inc(NumHK);
+ end;
+ end;
+ inc(HK);
+ dec(i);
+ end;
+ DBWriteWord(0,DBBranch,opt_numhk ,NumHK);
+ DBWriteWord(0,DBBranch,opt_numacts,Actions-1);
+end;
+
+//----- Load settings -----
+
+function LoadNumValue(setting:pAnsiChar;isvar:boolean):uint_ptr;
+begin
+ if isvar then
+ result:=uint_ptr(DBReadUnicode(0,DBBranch,setting,nil))
+ else
+ result:=DBReadDWord(0,DBBranch,setting);
+end;
+
+function LoadActions(section:pAnsiChar;count:integer):integer;
+var
+ p,p1:PAnsiChar;
+ act:tHKAction;
+ i,num,oldnum:integer;
+begin
+ result:=0;
+ p1:=StrCopyE(StrEnd(section),opt_actions); // "Group#/Action"
+
+ oldnum:=0;
+ for i:=1 to count do
+ begin
+ p:=StrEnd(IntToStr(p1,i));
+ p^:='/'; inc(p); // "Group#/Action#/"
+ FillChar(act,SizeOf(act),0);
+
+ StrCopy(p,opt_flags ); act.flags :=DBReadDWord (0,DBBranch,section,0);
+ if (act.flags and ACF_ASSIGNED)<>0 then
+ begin
+ StrCopy(p,opt_flags2); act.flags2 :=DBReadDWord (0,DBBranch,section,0);
+ StrCopy(p,opt_descr ); act.descr :=DBReadUnicode(0,DBBranch,section,nil);
+ StrCopy(p,opt_type ); act.actionType:=DBReadByte (0,DBBranch,section,ACT_CONTACT);
+
+ case act.actionType of
+ ACT_CONTACT: begin
+ p^:=#0;
+ act.contact:=LoadContact(DBBranch,section);
+ end;
+
+ ACT_SERVICE: begin
+ StrCopy(p,opt_service);
+ act.service:=DBReadString(0,DBBranch,section,nil);
+
+ if (act.flags and (ACF_WCURRENT or ACF_WRESULT or ACF_WPARAM))=0 then
+ begin
+ StrCopy(p,opt_wparam);
+ if (act.flags and ACF_WPARNUM)<>0 then
+ act.wparam:=LoadNumValue(section,(act.flags2 and ACF2_SRV_WPAR)<>0)
+ else if (act.flags and ACF_WSTRUCT)<>0 then
+ act.wparam:=wparam(DBReadUTF8(0,DBBranch,section,nil))
+ else if (act.flags and ACF_WUNICODE)<>0 then
+ act.wparam:=wparam(DBReadUnicode(0,DBBranch,section,nil))
+ else
+ act.wparam:=wparam(DBReadString (0,DBBranch,section,nil));
+ end;
+
+ if (act.flags and (ACF_LCURRENT or ACF_LRESULT or ACF_LPARAM))=0 then
+ begin
+ StrCopy(p,opt_lparam);
+ if (act.flags and ACF_LPARNUM)<>0 then
+ act.lparam:=LoadNumValue(section,(act.flags2 and ACF2_SRV_LPAR)<>0)
+ // act.lparam:=DBReadDWord(0,DBBranch,section,0)
+ else if (act.flags and ACF_LSTRUCT)<>0 then
+ act.lparam:=lparam(DBReadUTF8(0,DBBranch,section,nil))
+ else if (act.flags and ACF_LUNICODE)<>0 then
+ act.lparam:=lparam(DBReadUnicode(0,DBBranch,section,nil))
+ else
+ act.lparam:=lparam(DBReadString(0,DBBranch,section,nil));
+ end;
+
+ end;
+
+ ACT_PROGRAM: begin
+ StrCopy(p,opt_prg ); act.prgname:=DBReadUnicode(0,DBBranch,section,nil);
+ StrCopy(p,opt_args); act.args :=DBReadUnicode(0,DBBranch,section,nil);
+ StrCopy(p,opt_time); act.time :=DBReadDWord (0,DBBranch,section,0);
+ StrCopy(p,opt_show); act.show :=DBReadDWord (0,DBBranch,section,SW_SHOW);
+ end;
+
+ ACT_TEXT: begin
+ if (act.flags and ACF_CLIPBRD)=0 then
+ begin
+ StrCopy(p,opt_text); act.text:=DBReadUnicode(0,DBBranch,section,nil);
+ if (act.flags and ACF_FILE)<>0 then
+ begin
+ StrCopy(p,opt_file); act.tfile:=DBReadUnicode(0,DBBranch,section,nil);
+ end;
+ end;
+ end;
+
+ ACT_ADVANCE: begin
+ StrCopy(p,opt_cond ); act.condition:=DBReadByte (0,DBBranch,section);
+ StrCopy(p,opt_value ); act.value :=DBReadDWord (0,DBBranch,section);
+ StrCopy(p,opt_action ); act.action :=DBReadByte (0,DBBranch,section);
+ StrCopy(p,opt_oper ); act.oper :=DBReadByte (0,DBBranch,section);
+ StrCopy(p,opt_mathval); act.mathval :=DBReadDWord (0,DBBranch,section);
+ StrCopy(p,opt_operval); act.operval :=DBReadUnicode(0,DBBranch,section);
+ StrCopy(p,opt_varval ); act.varval :=DBReadUnicode(0,DBBranch,section);
+ end;
+
+ ACT_CHAIN: begin
+ StrCopy(p,opt_text); act.id:=DBReadDWord(0,DBBranch,section);
+ end;
+
+ ACT_RW: begin
+ if (act.flags and ACF_NOCNTCT)=0 then
+ begin
+ p^:=#0;
+ act.dbcontact:=LoadContact(DBBranch,section);
+ end;
+ StrCopy(p,opt_module ); act.dbmodule :=DBReadString(0,DBBranch,section);
+ StrCopy(p,opt_setting); act.dbsetting:=DBReadString(0,DBBranch,section);
+ StrCopy(p,opt_value );
+
+ if (act.flags and ACF_DBUTEXT)=0 then
+ act.dbvalue:=LoadNumValue(section,(act.flags2 and ACF2_RW_TVAR)<>0)
+ else
+ act.dbvalue:=uint_ptr(DBReadUnicode(0,DBBranch,section));
+ end;
+
+ ACT_MESSAGE: begin
+ StrCopy(p,opt_msgtitle); act.msgtitle:=DBReadUnicode(0,DBBranch,section);
+ StrCopy(p,opt_msgtext ); act.msgtext :=DBReadUnicode(0,DBBranch,section);
+ StrCopy(p,opt_boxopts ); act.boxopts :=DBReadByte (0,DBBranch,section);
+ end;
+
+ end;
+ num:=NewAction(ActionList,MaxActions);
+ move(act,ActionList^[num],SizeOf(tHKAction));
+ if i=1 then
+ result:=num
+ else
+ ActionList^[oldnum].next:=num;
+ oldnum:=num;
+ end;
+ end;
+end;
+
+procedure LoadGroups;
+var
+ HK:pHKRecord;
+ i,num:cardinal;
+ p,p1:PAnsiChar;
+ section:array [0..127] of AnsiChar;
+ NumGroups,NumActions:cardinal;
+begin
+{ remove doubling - no need? (called just once)
+ if MaxGroups>0 then
+ begin
+ while MaxGroups>0 do
+ begin
+ FreeGroup(MaxGroups);
+ dec(MaxGroups);
+ end;
+ FreeMem(GroupList);
+ end;
+}
+ NumGroups:=DBReadWord(0,DBBranch,opt_numhk,HKListPage);
+ if NumGroups<HKListPage then
+ MaxGroups:=HKListPage
+ else
+ MaxGroups:=NumGroups;
+ GetMem (GroupList ,MaxGroups*SizeOf(tHKRecord));
+ FillChar(GroupList^,MaxGroups*SizeOf(tHKRecord),0);
+
+{ remove doubling - no need? (called just once)
+ if MaxActions<>0 then
+ begin
+ act:=@ActionList[1];
+ while MaxActions>0 do
+ begin
+ FreeAction(act);
+ inc(act);
+ dec(MaxActions);
+ end;
+ FreeMem(ActionList);
+ end;
+}
+ NumActions:=DBReadWord(0,DBBranch,opt_numacts,ActListPage);
+ if NumActions<ActListPage then
+ MaxActions:=ActListPage
+ else
+ MaxActions:=NumActions+1;
+ GetMem (ActionList ,MaxActions*SizeOf(tHKAction));
+ FillChar(ActionList^,MaxActions*SizeOf(tHKAction),0);
+
+ HK:=@GroupList^; //??
+ i:=0;
+ p1:=StrCopyE(section,opt_group);
+ while i<NumGroups do
+ begin
+ p:=StrEnd(IntToStr(p1,i));
+ p^:='/'; inc(p);
+
+ StrCopy(p,opt_flags);
+ with HK^ do
+ begin
+ flags:=DBReadDWord(0,DBBranch,section,0{integer(ACF_ASSIGNED or ACF_DISABLED)});
+ if (flags and ACF_ASSIGNED)<>0 then // not needed in normal cases
+ begin
+ StrCopy(p,opt_id ); id :=DBReadDWord (0,DBBranch,section);
+ StrCopy(p,opt_descr); descr:=DBReadUnicode(0,DBBranch,section,nil);
+ if descr=nil then
+ StrDupW(descr,TranslateW('No description'));
+
+ StrCopy(p,opt_numacts); num:=DBReadWord(0,DBBranch,section);
+ p^:=#0;
+ firstAction:=LoadActions(section,num);
+ end;
+ end;
+ inc(HK);
+ inc(i);
+ end;
+ fCLfilter:=DBReadByte (0,DBBranch,'CLfilter',0)<>0;
+ fCLformat:=DBReadUnicode(0,DBBranch,'CLformat');
+end;
diff --git a/plugins/!Deprecated/Actman20/i_services.inc b/plugins/!Deprecated/Actman20/i_services.inc new file mode 100644 index 0000000000..d835c9225a --- /dev/null +++ b/plugins/!Deprecated/Actman20/i_services.inc @@ -0,0 +1,131 @@ +{Basic ActMan services}
+
+function ActFreeList(wParam:WPARAM;lParam:LPARAM):int_ptr;cdecl;
+begin
+ result:=0;
+ mFreeMem(PAnsiChar(lParam));
+end;
+
+function ActGetList(wParam:WPARAM;lParam:LPARAM):int_ptr;cdecl;
+var
+ pc:^tChain;
+ p:pHKRecord;
+ i,cnt:integer;
+begin
+ p:=@GroupList[0];
+ cnt:=0;
+ for i:=0 to MaxGroups-1 do
+ begin
+ if (p^.flags and (ACF_ASSIGNED or ACF_VOLATILE))=ACF_ASSIGNED then inc(cnt);
+ inc(p);
+ end;
+ result:=cnt;
+ if lParam=0 then exit;
+ if cnt>0 then
+ begin
+ mGetMem(pc,cnt*SizeOf(tChain)+4);
+ puint_ptr(lParam)^:=uint_ptr(pc);
+// {$IFDEF WIN64}pqword{$ELSE}pdword{$ENDIF}(lParam)^:=uint_ptr(pc);
+ pdword(pc)^:=SizeOf(tChain);
+ inc(PByte(pc),4);
+
+ p:=@GroupList[0];
+ for i:=0 to MaxGroups-1 do
+ begin
+ if (p^.flags and (ACF_ASSIGNED or ACF_VOLATILE))=ACF_ASSIGNED then
+ begin
+ pc^.descr:=p^.descr;
+ pc^.id :=p^.id;
+ pc^.flags:=p^.flags;
+ inc(pc);
+ end;
+ inc(p);
+ end;
+ end
+ else
+ puint_ptr(lParam)^:=0;
+// {$IFDEF WIN64}pqword{$ELSE}pdword{$ENDIF}(lParam)^:=0;
+end;
+
+function ActRun(wParam:WPARAM;lParam:LPARAM):int_ptr;cdecl;
+var
+ i:integer;
+ p:pHKRecord;
+begin
+ result:=-1;
+ p:=@GroupList[0];
+ for i:=0 to MaxGroups-1 do
+ begin
+ if ((p^.flags and ACF_ASSIGNED)<>0) and (p^.id=dword(wParam)) then
+ begin
+ result:=p^.firstAction;
+ break;
+ end;
+ inc(p);
+ end;
+ if result>0 then
+ result:=ActionStarter(result,lParam,p);
+end;
+
+function ActRunGroup(wParam:WPARAM;lParam:LPARAM):int_ptr;cdecl;
+var
+ i:integer;
+ p:pHKRecord;
+begin
+ result:=-1;
+ p:=@GroupList[0];
+ for i:=0 to MaxGroups-1 do
+ begin
+ if ((p^.flags and ACF_ASSIGNED)<>0) and (StrCmpW(p^.descr,pWideChar(wParam))=0) then
+ begin
+ result:=p^.firstAction;
+ break;
+ end;
+ inc(p);
+ end;
+ if result>0 then
+ result:=ActionStarter(result,lParam,p);
+end;
+
+function ActRunParam(wParam:WPARAM;lParam:LPARAM):int_ptr;cdecl;
+var
+ i:integer;
+ p:pHKRecord;
+begin
+ result:=-1;
+ p:=@GroupList[0];
+
+ if (pAct_Param(lParam)^.flags and ACTP_BYNAME)=0 then
+ begin
+ for i:=0 to MaxGroups-1 do
+ begin
+ if ((p^.flags and ACF_ASSIGNED)<>0) and (p^.id=pAct_Param(lParam)^.Id) then
+ begin
+ result:=p^.firstAction;
+ break;
+ end;
+ inc(p);
+ end;
+ end
+ else
+ begin
+ for i:=0 to MaxGroups-1 do
+ begin
+ if ((p^.flags and ACF_ASSIGNED)<>0) and
+ (StrCmpW(p^.descr,pWideChar(pAct_Param(lParam)^.Id))=0) then
+ begin
+ result:=p^.firstAction;
+ break;
+ end;
+ inc(p);
+ end;
+ end;
+
+ if result>0 then
+ begin
+ if (pAct_Param(lParam)^.flags and ACTP_WAIT)=0 then
+ result:=ActionStarter (result,pAct_Param(lParam)^.wParam,p,pAct_Param(lParam)^.lParam)
+ else
+ result:=ActionStarterWait(result,pAct_Param(lParam)^.wParam,p,pAct_Param(lParam)^.lParam);
+ end;
+end;
diff --git a/plugins/Actman/i_vars.inc b/plugins/!Deprecated/Actman20/i_vars.inc index 4ca6764191..4ca6764191 100644 --- a/plugins/Actman/i_vars.inc +++ b/plugins/!Deprecated/Actman20/i_vars.inc diff --git a/plugins/Actman/i_visual.inc b/plugins/!Deprecated/Actman20/i_visual.inc index ab32488165..ab32488165 100644 --- a/plugins/Actman/i_visual.inc +++ b/plugins/!Deprecated/Actman20/i_visual.inc diff --git a/plugins/!Deprecated/Actman20/ico/advance.ico b/plugins/!Deprecated/Actman20/ico/advance.ico Binary files differnew file mode 100644 index 0000000000..6cc054ccc3 --- /dev/null +++ b/plugins/!Deprecated/Actman20/ico/advance.ico diff --git a/plugins/!Deprecated/Actman20/ico/apply.ico b/plugins/!Deprecated/Actman20/ico/apply.ico Binary files differnew file mode 100644 index 0000000000..27def2fb4b --- /dev/null +++ b/plugins/!Deprecated/Actman20/ico/apply.ico diff --git a/plugins/!Deprecated/Actman20/ico/chain.ico b/plugins/!Deprecated/Actman20/ico/chain.ico Binary files differnew file mode 100644 index 0000000000..d3a9c9b59c --- /dev/null +++ b/plugins/!Deprecated/Actman20/ico/chain.ico diff --git a/plugins/!Deprecated/Actman20/ico/contact.ico b/plugins/!Deprecated/Actman20/ico/contact.ico Binary files differnew file mode 100644 index 0000000000..5f06f02312 --- /dev/null +++ b/plugins/!Deprecated/Actman20/ico/contact.ico diff --git a/plugins/!Deprecated/Actman20/ico/delete.ico b/plugins/!Deprecated/Actman20/ico/delete.ico Binary files differnew file mode 100644 index 0000000000..3770daf2fc --- /dev/null +++ b/plugins/!Deprecated/Actman20/ico/delete.ico diff --git a/plugins/!Deprecated/Actman20/ico/down.ico b/plugins/!Deprecated/Actman20/ico/down.ico Binary files differnew file mode 100644 index 0000000000..79ec3929df --- /dev/null +++ b/plugins/!Deprecated/Actman20/ico/down.ico diff --git a/plugins/!Deprecated/Actman20/ico/export.ico b/plugins/!Deprecated/Actman20/ico/export.ico Binary files differnew file mode 100644 index 0000000000..7c6b07c71a --- /dev/null +++ b/plugins/!Deprecated/Actman20/ico/export.ico diff --git a/plugins/!Deprecated/Actman20/ico/format.ico b/plugins/!Deprecated/Actman20/ico/format.ico Binary files differnew file mode 100644 index 0000000000..7c6b07c71a --- /dev/null +++ b/plugins/!Deprecated/Actman20/ico/format.ico diff --git a/plugins/!Deprecated/Actman20/ico/import.ico b/plugins/!Deprecated/Actman20/ico/import.ico Binary files differnew file mode 100644 index 0000000000..a3d5232741 --- /dev/null +++ b/plugins/!Deprecated/Actman20/ico/import.ico diff --git a/plugins/!Deprecated/Actman20/ico/insert.ico b/plugins/!Deprecated/Actman20/ico/insert.ico Binary files differnew file mode 100644 index 0000000000..a3d5232741 --- /dev/null +++ b/plugins/!Deprecated/Actman20/ico/insert.ico diff --git a/plugins/!Deprecated/Actman20/ico/message.ico b/plugins/!Deprecated/Actman20/ico/message.ico Binary files differnew file mode 100644 index 0000000000..6cc054ccc3 --- /dev/null +++ b/plugins/!Deprecated/Actman20/ico/message.ico diff --git a/plugins/!Deprecated/Actman20/ico/new.ico b/plugins/!Deprecated/Actman20/ico/new.ico Binary files differnew file mode 100644 index 0000000000..fcfa03a6ad --- /dev/null +++ b/plugins/!Deprecated/Actman20/ico/new.ico diff --git a/plugins/!Deprecated/Actman20/ico/program.ico b/plugins/!Deprecated/Actman20/ico/program.ico Binary files differnew file mode 100644 index 0000000000..0ce8a9a24d --- /dev/null +++ b/plugins/!Deprecated/Actman20/ico/program.ico diff --git a/plugins/!Deprecated/Actman20/ico/reload.ico b/plugins/!Deprecated/Actman20/ico/reload.ico Binary files differnew file mode 100644 index 0000000000..feadf04bf2 --- /dev/null +++ b/plugins/!Deprecated/Actman20/ico/reload.ico diff --git a/plugins/!Deprecated/Actman20/ico/rw.ico b/plugins/!Deprecated/Actman20/ico/rw.ico Binary files differnew file mode 100644 index 0000000000..df5cd0f6c7 --- /dev/null +++ b/plugins/!Deprecated/Actman20/ico/rw.ico diff --git a/plugins/!Deprecated/Actman20/ico/service.ico b/plugins/!Deprecated/Actman20/ico/service.ico Binary files differnew file mode 100644 index 0000000000..7c6b07c71a --- /dev/null +++ b/plugins/!Deprecated/Actman20/ico/service.ico diff --git a/plugins/!Deprecated/Actman20/ico/test.ico b/plugins/!Deprecated/Actman20/ico/test.ico Binary files differnew file mode 100644 index 0000000000..06db21a127 --- /dev/null +++ b/plugins/!Deprecated/Actman20/ico/test.ico diff --git a/plugins/!Deprecated/Actman20/ico/up.ico b/plugins/!Deprecated/Actman20/ico/up.ico Binary files differnew file mode 100644 index 0000000000..6efc4d7257 --- /dev/null +++ b/plugins/!Deprecated/Actman20/ico/up.ico diff --git a/plugins/Actman/ico/vcheck.ico b/plugins/!Deprecated/Actman20/ico/vcheck.ico Binary files differindex d7c042119c..d7c042119c 100644 --- a/plugins/Actman/ico/vcheck.ico +++ b/plugins/!Deprecated/Actman20/ico/vcheck.ico diff --git a/plugins/Actman/ico/vuncheck.ico b/plugins/!Deprecated/Actman20/ico/vuncheck.ico Binary files differindex 05c93a1281..05c93a1281 100644 --- a/plugins/Actman/ico/vuncheck.ico +++ b/plugins/!Deprecated/Actman20/ico/vuncheck.ico diff --git a/plugins/Actman/m_actions.inc b/plugins/!Deprecated/Actman20/m_actions.inc index 7600d0dcdf..7600d0dcdf 100644 --- a/plugins/Actman/m_actions.inc +++ b/plugins/!Deprecated/Actman20/m_actions.inc diff --git a/plugins/Actman30/make.bat b/plugins/!Deprecated/Actman20/make.bat index 5a6d1e1a33..7f324c52a0 100644 --- a/plugins/Actman30/make.bat +++ b/plugins/!Deprecated/Actman20/make.bat @@ -10,7 +10,7 @@ if /i '%1' == 'fpc' ( set OUTDIR="..\..\bin%2\Release64\Plugins"
set FPCBIN=ppcrossx64.exe
)
-set PROJECT=Actman30
+set PROJECT=Actman
if not exist %OUTDIR% mkdir %OUTDIR%
md tmp
diff --git a/plugins/!Deprecated/Actman20/options.rc b/plugins/!Deprecated/Actman20/options.rc new file mode 100644 index 0000000000..c221bf0f49 --- /dev/null +++ b/plugins/!Deprecated/Actman20/options.rc @@ -0,0 +1,328 @@ +#include "i_const.inc"
+
+LANGUAGE 0,0
+/*
+IDD_STRUCTURE DIALOGEX 0, 0, 332,184, 0
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_VISIBLE | WS_THICKFRAME
+CAPTION "Structure editor"
+//EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 0, 0
+{
+ CONTROL "" , IDC_DATA_FULL, "SysListView32",
+ WS_BORDER | WS_TABSTOP |
+ LVS_NOCOLUMNHEADER | LVS_SHOWSELALWAYS |
+ LVS_SINGLESEL | LVS_REPORT,
+ 2, 2, 160, 180, WS_EX_CONTROLPARENT
+
+ CONTROL "New" ,IDC_DATA_NEW ,"MButtonClass",WS_TABSTOP,166, 2,16,16,$18000000// | WS_GROUP
+ CONTROL "Up" ,IDC_DATA_UP ,"MButtonClass",WS_TABSTOP,166,22,16,16,$18000000
+ CONTROL "Down" ,IDC_DATA_DOWN ,"MButtonClass",WS_TABSTOP,166,40,16,16,$18000000
+ CONTROL "Delete",IDC_DATA_DELETE,"MButtonClass",WS_TABSTOP,166,60,16,16,$18000000
+
+ COMBOBOX IDC_DATA_TYPE , 186, 2, 142, 96, CBS_DROPDOWNLIST | WS_VSCROLL
+ EDITTEXT IDC_DATA_LEN , 186, 18, 32, 11
+ LTEXT "Data length" ,-1 , 222, 18, 106, 11, SS_CENTERIMAGE
+ EDITTEXT IDC_DATA_EDIT, 186, 32, 142, 11, ES_AUTOHSCROLL
+ AUTOCHECKBOX "Use Variables", IDC_DATA_VARS, 186, 45, 142, 14
+
+ DEFPUSHBUTTON "&Change", IDC_DATA_CHANGE, 186, 62, 46, 14//, WS_GROUP
+ PUSHBUTTON "&OK" , IDOK , 234, 62, 46, 14
+ PUSHBUTTON "C&ancel", IDCANCEL , 282, 62, 46, 14
+
+ AUTOCHECKBOX "Packed structure", IDC_DATA_PACKED, 166, 78, 162, 14
+
+ CTEXT "Use Byte array/pointer for ANSI strings\n"\
+ "Use Word array/pointer for Unicode strings\n\n"\
+ "$## replaces by byte with hex value ##\n"\
+ "$#### replaces by word with hex value #### (for Unicode strings only)\n\n"\
+ "All data length calculating in bytes",
+ IDC_DATA_HELP,166,94,162,88
+
+}
+*/
+IDD_ACTION DIALOGEX 0, 0, 304, 226, 0
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 0, 0
+{
+ CONTROL "New" ,IDC_GROUP_NEW ,"MButtonClass",WS_TABSTOP,114, 1,16,16,$18000000 | WS_GROUP
+ CONTROL "Up" ,IDC_GROUP_UP ,"MButtonClass",WS_TABSTOP,114, 18,16,16,$18000000
+ CONTROL "Down" ,IDC_GROUP_DOWN ,"MButtonClass",WS_TABSTOP,114, 34,16,16,$18000000
+ CONTROL "Reload",IDC_GROUP_RELOAD,"MButtonClass",WS_TABSTOP,114, 51,16,16,$18000000
+ CONTROL "Delete",IDC_GROUP_DELETE,"MButtonClass",WS_TABSTOP,114, 68,16,16,$18000000
+ CONTROL "Test" ,IDC_GROUP_TEST ,"MButtonClass",WS_TABSTOP,114, 85,16,16,$18000000
+ CONTROL "Export",IDC_GROUP_EXPORT,"MButtonClass",WS_TABSTOP,114,102,16,16,$18000000
+ CONTROL "Import",IDC_GROUP_IMPORT,"MButtonClass",WS_TABSTOP,114,119,16,16,$18000000
+
+ CONTROL "", IDC_ACTION_GROUP, "SysListView32",
+ WS_BORDER | WS_TABSTOP |
+ LVS_NOCOLUMNHEADER | LVS_SHOWSELALWAYS | LVS_REPORT | LVS_EDITLABELS,// | LVS_SINGLESEL,
+ 0, 2, 110, 132, WS_EX_CONTROLPARENT
+
+ CONTROL "", IDC_ACTION_LIST, "SysListView32",
+ WS_BORDER | WS_TABSTOP |
+ LVS_NOCOLUMNHEADER | LVS_SHOWSELALWAYS| LVS_REPORT | LVS_EDITLABELS,// | LVS_SINGLESEL
+ 0, 138, 110, 86, WS_EX_CONTROLPARENT
+
+ CONTROL "Help" ,IDC_ACTION_HELP ,"MButtonClass",WS_TABSTOP,114,138,16,16,$18000000 | WS_GROUP
+ CONTROL "New" ,IDC_ACTION_NEW ,"MButtonClass",WS_TABSTOP,114,156,16,16,$18000000
+ CONTROL "Up" ,IDC_ACTION_UP ,"MButtonClass",WS_TABSTOP,114,174,16,16,$18000000
+ CONTROL "Down" ,IDC_ACTION_DOWN ,"MButtonClass",WS_TABSTOP,114,190,16,16,$18000000
+ CONTROL "Delete",IDC_ACTION_DELETE,"MButtonClass",WS_TABSTOP,114,208,16,16,$18000000
+
+// PUSHBUTTON "Reset", IDC_RESET, 264, 2, 40, 12
+ GROUPBOX "" , -1, 132, 0, 172, 226
+
+ RTEXT "Action",IDC_STAT_ACTION, 135, 6, 63, 12, SS_CENTERIMAGE
+ CONTROL "", IDC_ACTION_TYPE, "ComboBoxEx32",
+ WS_TABSTOP | WS_VSCROLL | CBS_AUTOHSCROLL | CBS_DROPDOWNLIST, 200, 6, 101, 96
+
+// Contact
+ RTEXT "Choose contact", IDC_STAT_CONTACT , 135, 24, 160, 10
+ COMBOBOX IDC_CONTACTLIST, 135, 35, 166, 128, CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL
+ AUTOCHECKBOX "Keep handle only" , IDC_CNT_KEEP , 135, 53, 160, 11
+ AUTOCHECKBOX "Active accounts only",IDC_CNT_FILTER, 135, 65, 160, 11
+ RTEXT "Dropdown list format",IDC_STAT_FORMAT, 135, 78, 160, 11
+ EDITTEXT IDC_EDIT_FORMAT , 153, 92, 142, 12, ES_AUTOHSCROLL
+ CONTROL "Apply",IDC_CNT_APPLY,"MButtonClass",WS_TABSTOP,135,90,16,16,$18000000
+ CTEXT "You can use %name%, %uid%, %account% and %group% macros",IDC_STAT_FHELP, 135, 107, 160, 24
+
+// Service
+ RTEXT "wParam type", IDC_STAT_WPAR1, 135, 125, 63, 14, SS_CENTERIMAGE
+ COMBOBOX IDC_FLAG_WPAR , 200, 125, 102, 56, CBS_DROPDOWNLIST | WS_VSCROLL
+ RTEXT "lParam type", IDC_STAT_LPAR1, 135, 140, 63, 14, SS_CENTERIMAGE
+ COMBOBOX IDC_FLAG_LPAR , 200, 140, 102, 56, CBS_DROPDOWNLIST | WS_VSCROLL
+
+ RTEXT "Service name", IDC_STAT_SERVICE, 135, 153, 160, 8
+ AUTOCHECKBOX "", IDC_SRV_SRVC,135,162,8,8,BS_ICON | BS_PUSHLIKE
+ COMBOBOX IDC_EDIT_SERVICE, 144, 162, 157, 96, CBS_DROPDOWN | WS_VSCROLL | CBS_AUTOHSCROLL | CBS_SORT
+ RTEXT "wParam" , IDC_STAT_WPAR , 135, 177, 160, 8
+ AUTOCHECKBOX "", IDC_SRV_WPAR,135,186,8,8,BS_ICON | BS_PUSHLIKE
+ COMBOBOX IDC_EDIT_WPAR , 144, 186, 157, 76, CBS_DROPDOWN | WS_VSCROLL | CBS_AUTOHSCROLL
+ RTEXT "lParam" , IDC_STAT_LPAR , 135, 201, 160, 8
+ AUTOCHECKBOX "", IDC_SRV_LPAR,135,210,8,8,BS_ICON | BS_PUSHLIKE
+ COMBOBOX IDC_EDIT_LPAR , 144, 210, 157, 76, CBS_DROPDOWN | WS_VSCROLL | CBS_AUTOHSCROLL
+ PUSHBUTTON "Structure" , IDC_WSTRUCT , 135, 186, 166, 14
+ PUSHBUTTON "Structure" , IDC_LSTRUCT , 135, 210, 166, 14
+
+ GROUPBOX "Result action" , IDC_RES_GROUP , 135, 24, 166, 99, WS_GROUP
+ AUTOCHECKBOX "Show in popup" , IDC_RES_POPUP , 138, 34, 159, 11
+ AUTOCHECKBOX "Show in messagebox" , IDC_RES_MESSAGE, 138, 45, 159, 11
+ AUTOCHECKBOX "Insert into message", IDC_RES_INSERT , 138, 56, 159, 11
+
+ LTEXT "Service result" , IDC_SRV_RESSTAT, 138, 72, 159, 11
+ COMBOBOX IDC_SRV_RESULT , 138, 83, 159, 76, CBS_DROPDOWN | WS_VSCROLL | CBS_AUTOHSCROLL
+ AUTOCHECKBOX "Free memory" , IDC_RES_FREEMEM, 138, 99, 159, 11
+ AUTOCHECKBOX "Unicode string" , IDC_RES_UNICODE, 138, 110, 159, 11
+ AUTOCHECKBOX "Signed value" , IDC_RES_SIGNED , 138, 99, 159, 11
+
+// Program
+ GROUPBOX "Process options" , IDC_PROCESS_GROUP, 135, 24, 166, 46, WS_GROUP
+ AUTORADIOBUTTON "Parallel" , IDC_FLAG_PARALLEL, 138, 33, 161, 11
+ AUTORADIOBUTTON "Continued" , IDC_FLAG_CONTINUE, 138, 44, 161, 11
+ EDITTEXT IDC_EDIT_PROCTIME, 138, 56, 31, 11, ES_RIGHT | ES_NUMBER
+ LTEXT "Process time, ms", IDC_STAT_PROCTIME, 171, 56, 128, 11, SS_CENTERIMAGE
+
+ AUTOCHECKBOX "Current path" , IDC_FLAG_CURPATH, 138, 72, 161, 11
+
+ GROUPBOX "Window option" , IDC_PRSTART_GROUP, 135, 83, 166, 55, WS_GROUP
+ AUTORADIOBUTTON "Start normal" , IDC_FLAG_NORMAL , 138, 92, 162, 11
+ AUTORADIOBUTTON "Start hidden" , IDC_FLAG_HIDDEN , 138, 103, 162, 11
+ AUTORADIOBUTTON "Start minimized", IDC_FLAG_MINIMIZE, 138, 114, 162, 11
+ AUTORADIOBUTTON "Start maximized", IDC_FLAG_MAXIMIZE, 138, 125, 162, 11
+
+ CONTROL "V", IDC_HLP_FVARS, "MButtonClass",WS_TABSTOP, 285,139,16,16,$18000000
+ RTEXT "Program path", IDC_STAT_PRGPATH, 135, 155, 160, 8
+ AUTOCHECKBOX "", IDC_PRG_PRG,135,164,8,8,BS_ICON | BS_PUSHLIKE
+ EDITTEXT IDC_EDIT_PRGPATH, 144, 164, 139, 12, ES_AUTOHSCROLL
+ PUSHBUTTON "..." , IDC_PROGRAM , 285, 164, 16, 12
+ RTEXT "Program args", IDC_STAT_PRGARGS, 135, 179, 160, 8
+ AUTOCHECKBOX "", IDC_PRG_ARG,135,186,8,8,BS_ICON | BS_PUSHLIKE
+ EDITTEXT IDC_EDIT_PRGARGS, 144, 188, 157, 12, ES_AUTOHSCROLL
+
+// Text
+ AUTORADIOBUTTON "Clipboard" , IDC_FLAG_CLIP , 135, 20, 166, 11, WS_GROUP
+ AUTORADIOBUTTON "File" , IDC_FLAG_FILE , 135, 66, 166, 11
+ AUTORADIOBUTTON "Message window", IDC_FLAG_MESSAGE, 135, 128, 166, 11
+
+ GROUPBOX "" , IDC_CLIP_GROUP , 135, 30, 166, 33
+ AUTORADIOBUTTON "Copy to" , IDC_CLIP_COPYTO, 140, 36, 160, 11, WS_GROUP
+ AUTORADIOBUTTON "Paste from", IDC_CLIP_PASTE , 140, 47, 160, 11
+
+ GROUPBOX "" , IDC_FILE_GROUP , 135, 75, 166, 52
+ AUTORADIOBUTTON "Read" , IDC_FILE_READ , 138, 83, 52, 11, WS_GROUP
+ AUTORADIOBUTTON "Write" , IDC_FILE_WRITE , 191, 83, 52, 11
+ AUTORADIOBUTTON "Append" , IDC_FILE_APPEND , 244, 83, 52, 11
+ AUTOCHECKBOX "", IDC_TXT_FILE,138,96,8,8,BS_ICON | BS_PUSHLIKE
+ EDITTEXT IDC_FILE_PATH , 147, 96, 131, 12, ES_AUTOHSCROLL
+ PUSHBUTTON "..." , IDC_FILE_FILEBTN, 281, 96, 16, 12
+ COMBOBOX IDC_FILE_ENC , 138, 111, 160, 76, CBS_DROPDOWNLIST | WS_VSCROLL
+
+ CONTROL "V", IDC_HLP_VARS, "MButtonClass",WS_TABSTOP, 285,139,16,16,$18000000
+// PUSHBUTTON "vars" , IDC_HLP_VARS , 264, 140, 37, 14
+ RTEXT "Text to insert", IDC_STAT_INSERT , 135, 155, 160, 9
+ AUTOCHECKBOX "", IDC_TXT_TEXT,135,164,8,8,BS_ICON | BS_PUSHLIKE
+ EDITTEXT IDC_EDIT_INSERT , 144, 164, 157, 59,
+ ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN
+
+// Advanced
+ GROUPBOX "Condition" , IDC_CONDITION , 135, 24, 166, 34, WS_GROUP
+ AUTORADIOBUTTON ">" , IDC_FLAG_GT , 138, 33, 32, 11
+ AUTORADIOBUTTON "<" , IDC_FLAG_LT , 170, 33, 32, 11
+ AUTORADIOBUTTON "=" , IDC_FLAG_EQ , 202, 33, 32, 11
+ AUTORADIOBUTTON "NOP" , IDC_FLAG_NOP , 234, 33, 32, 11
+ AUTOCHECKBOX "NOT" , IDC_FLAG_NOT , 138, 44, 32, 11
+ RTEXT "Value" , IDC_STAT_VAL , 170, 44, 78, 11, SS_CENTERIMAGE
+ EDITTEXT IDC_ADV_VALUE , 250, 44, 48, 11, ES_RIGHT //| ES_NUMBER
+
+ AUTOCHECKBOX "Math" , IDC_FLAG_MATH , 138, 61, 64, 13, WS_GROUP
+ COMBOBOX IDC_ADV_OPER , 204, 61, 44, 96,
+ CBS_DROPDOWNLIST | WS_VSCROLL
+ EDITTEXT IDC_ADV_VAL1 , 250, 61, 48, 13, ES_RIGHT //| ES_NUMBER
+
+ AUTOCHECKBOX "Variables" , IDC_FLAG_VARS , 138, 78, 124, 12
+ CONTROL "V", IDC_ADV_HVARS, "MButtonClass",WS_TABSTOP, 285,75,16,16,$18000000
+// PUSHBUTTON "vars" , IDC_ADV_HVARS , 264, 78, 37, 12
+ EDITTEXT IDC_ADV_VARS , 144, 92, 157, 68,
+ ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN
+ AUTOCHECKBOX "Result as integer", IDC_ADV_ASINT , 135, 161, 164, 13, BS_RIGHT | BS_LEFTTEXT
+
+ GROUPBOX "Operation" , IDC_OPERATION , 135, 174, 166, 49, WS_GROUP
+ AUTORADIOBUTTON "JUMP" , IDC_FLAG_JUMP , 138, 183, 62, 12
+ AUTORADIOBUTTON "BREAK" , IDC_FLAG_BREAK, 138, 196, 62, 12
+ AUTORADIOBUTTON "NOP" , IDC_FLAG_ANOP , 138, 209, 62, 12
+ COMBOBOX IDC_ADV_VAL2 , 200, 183, 99, 96, CBS_DROPDOWNLIST | WS_VSCROLL | CBS_AUTOHSCROLL
+
+// Chain
+ RTEXT "Other Action groups",IDC_STAT_GROUPS,135, 24, 160, 10
+ COMBOBOX IDC_GROUP_LIST, 135, 35, 166, 128,
+ CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL
+
+// Read / write setting
+
+ AUTORADIOBUTTON "Own settings", IDC_RW_CURRENT, 135, 50, 80, 11, BS_RIGHT | BS_LEFTTEXT | WS_GROUP
+ AUTORADIOBUTTON "Manual" , IDC_RW_MANUAL , 135, 62, 80, 11, BS_RIGHT | BS_LEFTTEXT
+ AUTORADIOBUTTON "Parameter" , IDC_RW_PARAM , 217, 50, 80, 11
+ AUTORADIOBUTTON "Last result" , IDC_RW_RESULT , 217, 62, 80, 11
+
+ RTEXT "Module" , IDC_RW_STATM , 135, 75, 160, 8, SS_CENTERIMAGE
+ AUTOCHECKBOX "", IDC_RW_MVAR,135,84,8,8,BS_ICON | BS_PUSHLIKE
+ EDITTEXT IDC_RW_MODULE , 144, 84, 157, 12, ES_AUTOHSCROLL
+ RTEXT "Setting" , IDC_RW_STATS , 135, 99, 160, 8, SS_CENTERIMAGE
+ AUTOCHECKBOX "", IDC_RW_SVAR,135,108,8,8,BS_ICON | BS_PUSHLIKE
+ EDITTEXT IDC_RW_SETTING, 144, 108, 157, 12, ES_AUTOHSCROLL
+
+ GROUPBOX "Operation" , IDC_RW_OPER , 135, 124, 166, 21, WS_GROUP
+ AUTORADIOBUTTON "Read" , IDC_RW_READ , 138, 133, 52, 11
+ AUTORADIOBUTTON "Write" , IDC_RW_WRITE , 191, 133, 52, 11
+ AUTORADIOBUTTON "Delete" , IDC_RW_DELETE , 244, 133, 52, 11
+
+ GROUPBOX "Value" , IDC_RW_VAL , 135, 146, 166, 76, WS_GROUP
+
+ COMBOBOX IDC_RW_DATATYPE, 220, 155, 79, 96,
+ CBS_DROPDOWNLIST | WS_VSCROLL
+
+ AUTOCHECKBOX "Last result" , IDC_RW_LAST , 140, 179, 156, 11, BS_RIGHT | BS_LEFTTEXT
+ EDITTEXT IDC_RW_VALUE , 149, 191, 147, 11, ES_AUTOHSCROLL | ES_RIGHT// | ES_NUMBER
+ AUTOCHECKBOX "", IDC_RW_TVAR,140,191,8,8,BS_ICON | BS_PUSHLIKE
+ EDITTEXT IDC_RW_TEXT , 149, 191, 147, 29,
+ ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN
+
+// MessageBox
+
+ AUTOCHECKBOX "", IDC_MSG_TTL,135,32,8,8,BS_ICON | BS_PUSHLIKE
+ EDITTEXT IDC_MSG_TITLE, 144, 32, 157, 12,
+ ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN
+ RTEXT "Message text" ,IDC_MSG_STAT2, 137, 46, 164, 11, SS_CENTERIMAGE
+ AUTOCHECKBOX "", IDC_MSG_TXT,135,58,8,8,BS_ICON | BS_PUSHLIKE
+ EDITTEXT IDC_MSG_TEXT , 144, 58, 157, 49,
+ ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN
+ AUTOCHECKBOX "Keep last result" , IDC_MSG_KEEP, 138, 109, 163, 11, BS_RIGHT | BS_LEFTTEXT
+
+ GROUPBOX "Icons" , IDC_MSG_ICONS , 135, 123, 166, 28, WS_GROUP
+ AUTORADIOBUTTON "Error" , IDC_MSGI_ERROR, 140, 130, 24, 20, BS_ICON
+ AUTORADIOBUTTON "Question", IDC_MSGI_QUEST, 166, 130, 24, 20, BS_ICON
+ AUTORADIOBUTTON "Warning" , IDC_MSGI_WARN , 192, 130, 24, 20, BS_ICON
+ AUTORADIOBUTTON "Info" , IDC_MSGI_INFO , 218, 130, 24, 20, BS_ICON
+ AUTORADIOBUTTON "None" , IDC_MSGI_NONE , 246, 130, 53, 20//, BS_ICON
+
+ GROUPBOX "Buttons" , IDC_MSG_BTNS, 135, 152, 166, 71, WS_GROUP
+ AUTORADIOBUTTON "OK" , IDC_MSGB_OK , 140, 161, 156, 10
+ AUTORADIOBUTTON "OK, Cancel" , IDC_MSGB_OC , 140, 171, 156, 10
+ AUTORADIOBUTTON "Abort, Retry, Ignore", IDC_MSGB_ARI, 140, 181, 156, 10
+ AUTORADIOBUTTON "Yes, No, Cancel" , IDC_MSGB_YNC, 140, 191, 156, 10
+ AUTORADIOBUTTON "Yes, No" , IDC_MSGB_YN , 140, 201, 156, 10
+ AUTORADIOBUTTON "Retry, Cancel" , IDC_MSGB_RC , 140, 211, 156, 10
+
+ RTEXT "Message title",IDC_MSG_STAT1, 137, 20, 164, 11, SS_CENTERIMAGE
+}
+
+IDD_ASK DIALOGEX 0, 0, 276, 72, 0
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+EXSTYLE WS_EX_CONTROLPARENT
+CAPTION "Choose action"
+FONT 8, "MS Shell Dlg", 0, 0
+{
+ CTEXT "", IDC_ASK,4,4,268,42,SS_CENTERIMAGE
+
+ CONTROL "", -1, "STATIC", SS_ETCHEDHORZ, 2, 50, 272, 2
+
+ DEFPUSHBUTTON "&Yes" , IDOK , 4, 54, 40, 16
+ PUSHBUTTON "&No" , IDCANCEL , 52, 54, 40, 16
+ PUSHBUTTON "A&ppend" , IDC_APPEND, 100, 54, 52, 16
+ PUSHBUTTON "Yes to &All", IDC_YESALL, 160, 54, 52, 16
+ PUSHBUTTON "N&o to All" , IDC_NOALL , 220, 54, 52, 16
+}
+
+IDI_NEW ICON "ico\new.ico"
+IDI_UP ICON "ico\up.ico"
+IDI_DOWN ICON "ico\down.ico"
+IDI_DELETE ICON "ico\delete.ico"
+IDI_RELOAD ICON "ico\reload.ico"
+IDI_TEST ICON "ico\test.ico"
+IDI_EXPORT ICON "ico\export.ico"
+IDI_IMPORT ICON "ico\import.ico"
+
+IDI_CONTACT ICON "ico\contact.ico"
+IDI_SERVICE ICON "ico\service.ico"
+IDI_PROGRAM ICON "ico\program.ico"
+IDI_INSERT ICON "ico\insert.ico"
+IDI_ADVANCE ICON "ico\advance.ico"
+IDI_CHAIN ICON "ico\chain.ico"
+IDI_RW ICON "ico\rw.ico"
+IDI_MESSAGE ICON "ico\message.ico"
+IDI_FORMAT ICON "ico\format.ico"
+
+IDI_APPLY ICON "ico\apply.ico"
+
+IDI_VAR_CHECKED ICON "ico\vcheck.ico"
+IDI_VAR_UNCHECKED ICON "ico\vuncheck.ico"
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 0,2,0,1
+ PRODUCTVERSION 0,2,0,1
+ FILEFLAGSMASK $3F
+ FILEOS 4
+ FILETYPE 2
+ FILESUBTYPE 0
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "000004b0"
+ BEGIN
+ VALUE "CompanyName",""
+ VALUE "Comments", "Plugin for managing different Miranda actions "0
+ VALUE "FileDescription", "Action manager for Miranda NG"0
+ VALUE "FileVersion", "0, 2, 0, 1 "0
+ VALUE "InternalName", "ActManager"0
+ VALUE "OriginalFilename", "actman.dll"0
+ VALUE "ProductName", "Action Manager Dynamic Link Library (DLL)"0
+ VALUE "ProductVersion", "0, 2, 0, 1 "0
+ VALUE "SpecialBuild", "18.08.2011 "0
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation",0,1200
+ END
+END
diff --git a/plugins/!Deprecated/Actman20/options.res b/plugins/!Deprecated/Actman20/options.res Binary files differnew file mode 100644 index 0000000000..6385d76f43 --- /dev/null +++ b/plugins/!Deprecated/Actman20/options.res diff --git a/plugins/Actman30/question.pas b/plugins/!Deprecated/Actman20/question.pas index d936b65794..84bbd60604 100644 --- a/plugins/Actman30/question.pas +++ b/plugins/!Deprecated/Actman20/question.pas @@ -3,14 +3,13 @@ unit question; interface
uses windows,messages;
-function ShowQuestion(ask:pWideChar):integer;
+function QuestionDlg(Dialog:HWnd;hMessage:UINT;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
implementation
uses m_api;
{$include i_const.inc}
-{$resource ask.res}
const
imp_yes = 1;
@@ -19,7 +18,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
@@ -49,10 +48,4 @@ begin end;
end;
-function ShowQuestion(ask:pWideChar):integer;
-begin
- result:=DialogBoxParam(hInstance,MAKEINTRESOURCE(IDD_ASK),0,
- @QuestionDlg,TLPARAM(ask));
-end;
-
end.
diff --git a/plugins/Actman30/readme.txt b/plugins/!Deprecated/Actman20/readme.txt index 1831a1efe2..0c6359ebe3 100644 --- a/plugins/Actman30/readme.txt +++ b/plugins/!Deprecated/Actman20/readme.txt @@ -101,7 +101,7 @@ This subaction is for database reading/writing (see Operation block). Value and value type is for type of data, reading or writing from/to database.
'Last result' mean that value is result of previous action.
Group of radioboxes is for contact type.
- 'Own settings' - all settings only for our contact (our profile settings)
+ 'Own settings' - all settings only for our contact (our profle settings)
'Parameter' - settings for contact with handle, passed from start parameter
'Last result' - contact handle is result of last action
'Manual' - contact handle selected from combobox
diff --git a/plugins/Actman30/services.ini b/plugins/!Deprecated/Actman20/services.ini index 7d0bda9289..fcf82289c6 100644 --- a/plugins/Actman30/services.ini +++ b/plugins/!Deprecated/Actman20/services.ini @@ -2,19 +2,15 @@ ;if wparam or lparam consists of list, "|" is separator
;in list: if translation not needed, just add space before help
;numeric parameter format: number<space>help
-;'hContact' will setup "Current contact" feature
-;'structure' will setup "structure" feature
-;'Unicode' as first word will setup "Unicode text" feature
-; not sure what next are usable
-;'parameter' will setup "Parameter" feature
-;'result' will setup "last result" feature
+;hContact will setup "Current contact" feature
+;structure will setup "structure" feature
;if "return" starts from int/hex/str/struct then separator, result type will set
-;[Event:Event (name or constant)]
+;[Event:Event (name or constant]
;alias=constant name
;descr=text
-;plugin=placement (including "core" and empty = "unknown")
+;plugin=placement (including "core" and empty = "unknown"
;wparam=
;lparam=
@@ -23,14 +19,6 @@ ;descr: structure description
;plugin: where defined
-[Service:DB/UI/ChangePassword]
-alias=MS_DB_CHANGEPASSWORD
-wparam=0
-lparam=0
-return=0
-descr=Show window for new/changed profile password
-plugin=db3x_mmap
-
[Service:CListFrames/HideALLFramesTB]
alias=MS_CLIST_FRAMES_HIDEALLFRAMESTB
wparam=0
@@ -109,7 +97,7 @@ alias=MS_DBEDIT_IMPORT wparam=hContact
lparam=Ansi Text
return=int 0
-descr=Import settings/contacts from file
+descr=Import settings\contacts from file
plugin=Database Editor++ (dbeditorpp.dll)
[Service:DBEditorpp/MenuCommand]
@@ -136,7 +124,7 @@ descr=displays File Transfer window [Service:Help/AboutCommand]
wparam=0 on Desktop|parent window handle
lparam=0
-descr=Show "About..." window
+Show "About..." window
[Service:Help/IndexCommand]
wparam=0
@@ -146,7 +134,7 @@ descr=Open support (originaly - Miranda wiki) page [Service:Help/WebsiteCommand]
wparam=0
lparam=0
-descr=Go to Miranda Homepage
+descr=Go to Miranda IM Homepage
[Service:Help/BugCommand]
wparam=0
@@ -187,11 +175,23 @@ lparam=-1 Ignore all|1 Ignore messages|2 Ignore URLs|3 Ignore files|4 Ignore Use return=int 0, if successful
descr=Unignore Contact
+[Service:mDynDNS/GetIP]
+wparam=0 auto|1 mDynDNS-checkip|2 DNS querry
+lparam=structure|*b.arr 16|
+return=struct
+descr=Returns the IP (empty string on failure)
+
+[Service:MIMLocker/Lock]
+wparam=0
+wparam=0
+plugin=MIMLocker (MIMLocker.dll)
+descr=Locks & hides Miranda's contact list and message sessions until password is entered
+
[Service:Miranda/System/Restart]
alias=MS_SYSTEM_RESTART
wparam=0 restart in default profile or profile manager|1 restart with current profile
lparam=0
-descr=Restarts Miranda
+descr=Restarts Miranda ver.0.8+
[Service:mRadio/PlayStop]
alias=MS_RADIO_PLAYSTOP
@@ -239,26 +239,14 @@ descr=Open Options dialog [Service:Opt/OpenOptions]
alias=MS_OPT_OPENOPTIONS
wparam=0
-lparam=structure|0|dword|b.ptr|b.ptr|b.ptr|
+lparam=structure|0|native|bptr|bptr|bptr|
return=int 0, if successful
descr=Opens the options dialog, optionally at the specified page
-[Service:PackUpdater/CheckUpdates]
-wparam=0
-lparam=0
-plugin=Pack Updater (packupdater.dll)
-descr=Check for updates
-
-[Service:PackUpdater/EmptyFolder]
-wparam=0
-lparam=0 with confirmation| 1 - without confirmation
-plugin=Pack Updater (packupdater.dll)
-descr=Empty updater download folder
-
[Service:Popup/EnableDisableMenuCommand]
wparam=0
lparam=0
-plugin=Popup Plus (popup.dll) latest YAPP (yapp.dll)
+plugin=Popup Plus (popup.dll)
descr=Enables or disables Popup windows
[Service:Popup/ShowMessage]
@@ -274,14 +262,14 @@ alias=MS_POPUP_SHOWMESSAGEW wparam=Unicode Text
lparam=1 Warning|2 Notify|3 Error
return=int 0, if successful
-plugin=YAPP or Popup
+plugin=YAPP only
descr=Popup window
[Service:Popup/ToggleEnabled]
wparam=0
lparam=0
plugin=YAPP (yapp.dll)
-descr=Enables or disables Popup windows (maybe deprecated)
+descr=Enables or disables Popup windows
[Service:Proto/CallContactService]
alias=MS_PROTO_CALLCONTACTSERVICE
@@ -290,13 +278,6 @@ lparam=structure|0|native|b.ptr|native|native| return=result of protocol service call
descr=Send a general request through the protocol chain for a contact
-[Service:Proto/GetContactBaseAccount]
-alias=MS_PROTO_GETCONTACTBASEACCOUNT
-wparam=hContact
-lparam=0
-return=str, account name
-descr=Return account name associated to contact (no need to free it)
-
[Service:Protos/ShowAccountManager]
alias=MS_PROTO_SHOWACCMGR
wparam=0
@@ -312,7 +293,7 @@ descr=Show the dialog to select the contact [Service:QuickSearch_PLUGIN/Show]
wparam=0|filter text
-lparam=0 wParam is unicode|1 wParam is Ansi|2 Reserved
+lparam=0 wparam is unicode|1 wparam is Ansi|2 reserved
plugin=Quick Search (Mod) (quicksearch.dll)
descr=
@@ -366,16 +347,23 @@ descr=remove all temporary contacts from db alias=MS_AV_CONTACTOPTIONS
wparam=hContact
lparam=0
-plugin=Avatar service (AVS.dll)
+plugin=Avatar service (loadavatars.dll)
descr=Call avatar option dialog for contact
[Service:SV_Avatars/SetAvatar]
alias=MS_AV_SETAVATAR
wparam=hContact
lparam=0|Filename
-plugin=Avatar service (AVS.dll)
+plugin=Avatar service (loadavatars.dll)
descr=Set (and optionally protect) a local contact picture for the given hContact. If lParam = NIL, the service will open a file selection dialog.
+[Service:Update/CheckForUpdates]
+wparam=0
+lparam=0
+return=int 0
+plugin=Updater (updater.dll)
+descr=Check for plugin updates
+
[Service:UserInfo/ShowDialog]
alias=MS_USERINFO_SHOWDIALOG
wparam=0 System|hContact
@@ -507,47 +495,3 @@ native (LPARAM) lParam| short=0|param|b.ptr|native|native|
descr=
plugin=
-
-[Const:CALLSERVICE_NOTFOUND]
-value=$80000000
-value64=$8000000000000000
-;signed=0
-;plugin=core
-
-[Const:ID_STATUS_OFFLINE]
-value=40071
-[Const:ID_STATUS_ONLINE]
-value=40072
-[Const:ID_STATUS_AWAY]
-value=40073
-[Const:ID_STATUS_DND]
-value=40074
-[Const:ID_STATUS_NA]
-value=40075
-[Const:ID_STATUS_OCCUPIED]
-value=40076
-[Const:ID_STATUS_FREECHAT]
-value=40077
-[Const:ID_STATUS_INVISIBLE]
-value=40078
-[Const:ID_STATUS_ONTHEPHONE]
-value=40079
-[Const:ID_STATUS_OUTTOLUNCH]
-value=40080
-[Const:ID_STATUS_IDLE]
-value=40081
-
-[Function:user32.dll$MessageBoxA]
-;dll=
-calltype=stdcall
-argcount=4
-argvalue1=0
-argvalue2=Ansi message
-argvalue3=Ansi caption
-argvalue4=0
-argname1=hWnd
-argname2=lpText
-argname3=lpCaption
-argname4=uType
-return=int 0
-descr=Displays a modal dialog box that contains a system icon, a set of buttons, and a brief application-specific message, such as status or error information.
diff --git a/plugins/Actman30/tasks/i_opt_dlg.inc b/plugins/!Deprecated/Actman20/tasks/i_opt_dlg.inc index bf8d45f63c..c8025c278d 100644 --- a/plugins/Actman30/tasks/i_opt_dlg.inc +++ b/plugins/!Deprecated/Actman20/tasks/i_opt_dlg.inc @@ -275,14 +275,13 @@ function DeleteTask(Dialog:HWND):integer; var
li:LV_ITEM;
wnd:HWND;
- i,j:integer;
+ i:integer;
begin
result:=0;
wnd:=GetDlgItem(Dialog,IDC_TASK_NAME);
- j:=SendMessage(wnd,LVM_GETITEMCOUNT,0,0);
- for i:=j-1 downto 0 do
+ for i:=ListView_GetItemCount(wnd)-1 downto 0 do
begin
- if SendMessage(wnd,LVM_GETITEMSTATE,i,LVIS_SELECTED)<>0 then
+ if ListView_GetItemState(wnd,i,LVIS_SELECTED)<>0 then
begin
li.iItem :=i;
li.mask :=LVIF_PARAM;
@@ -300,7 +299,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 +403,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/!Deprecated/Actman20/tasks/i_options.inc index da5cce0c40..527e8d0c88 100644 --- a/plugins/Actman30/tasks/i_options.inc +++ b/plugins/!Deprecated/Actman20/tasks/i_options.inc @@ -83,7 +83,6 @@ 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/tasks/i_service.inc b/plugins/!Deprecated/Actman20/tasks/i_service.inc index 376e75cba0..376e75cba0 100644 --- a/plugins/Actman30/tasks/i_service.inc +++ b/plugins/!Deprecated/Actman20/tasks/i_service.inc diff --git a/plugins/Actman30/tasks/i_task.inc b/plugins/!Deprecated/Actman20/tasks/i_task.inc index 2c860db85f..2c860db85f 100644 --- a/plugins/Actman30/tasks/i_task.inc +++ b/plugins/!Deprecated/Actman20/tasks/i_task.inc diff --git a/plugins/Actman30/tasks/i_tconst.inc b/plugins/!Deprecated/Actman20/tasks/i_tconst.inc index f4df810d32..f4df810d32 100644 --- a/plugins/Actman30/tasks/i_tconst.inc +++ b/plugins/!Deprecated/Actman20/tasks/i_tconst.inc diff --git a/plugins/Actman30/tasks/scheduler.pas b/plugins/!Deprecated/Actman20/tasks/scheduler.pas index 1ec1202f26..05e9cb6a58 100644 --- a/plugins/Actman30/tasks/scheduler.pas +++ b/plugins/!Deprecated/Actman20/tasks/scheduler.pas @@ -2,15 +2,21 @@ unit scheduler; interface
+procedure Init;
+procedure DeInit;
+function AddOptionPage(var tmpl:pAnsiChar;var proc:pointer;var name:PAnsiChar):integer;
+
implementation
uses
windows, commctrl, messages,
- mirutils, common, dbsettings, m_api, wrapper,
+ mirutils, common, dbsettings, io, m_api, wrapper,
global;
{$R tasks.res}
+{$include m_actman.inc}
+
var
hevent: THANDLE;
@@ -22,6 +28,11 @@ var // ------------ base interface functions -------------
+var
+ hendis,
+ hcount,
+ hdel: THANDLE;
+
procedure Init;
begin
@@ -34,18 +45,19 @@ begin else
SetAllTasks;
- CreateServiceFunction(MS_ACT_TASKCOUNT ,@TaskCount);
- CreateServiceFunction(MS_ACT_TASKENABLE,@TaskEnable);
- CreateServiceFunction(MS_ACT_TASKDELETE,@TaskDelete);
-
+ hcount:=CreateServiceFunction(MS_ACT_TASKCOUNT ,@TaskCount);
+ hendis:=CreateServiceFunction(MS_ACT_TASKENABLE,@TaskEnable);
+ hdel :=CreateServiceFunction(MS_ACT_TASKDELETE,@TaskDelete);
hevent:=CreateHookableEvent(ME_ACT_BELL);
end;
procedure DeInit;
begin
- DestroyHookableEvent(hevent);
StopAllTasks;
+ DestroyServiceFunction(hendis);
+ DestroyServiceFunction(hdel);
+ DestroyServiceFunction(hcount);
ClearTasks;
end;
diff --git a/plugins/Actman30/tasks/tasks.rc b/plugins/!Deprecated/Actman20/tasks/tasks.rc index 2bc558fbc3..2bc558fbc3 100644 --- a/plugins/Actman30/tasks/tasks.rc +++ b/plugins/!Deprecated/Actman20/tasks/tasks.rc diff --git a/plugins/Actman30/tasks.res b/plugins/!Deprecated/Actman20/tasks/tasks.res Binary files differindex bc72f06406..bc72f06406 100644 --- a/plugins/Actman30/tasks.res +++ b/plugins/!Deprecated/Actman20/tasks/tasks.res diff --git a/plugins/!Deprecated/Actman20/ua/action.ico b/plugins/!Deprecated/Actman20/ua/action.ico Binary files differnew file mode 100644 index 0000000000..06db21a127 --- /dev/null +++ b/plugins/!Deprecated/Actman20/ua/action.ico diff --git a/plugins/Actman30/ua/i_inoutxm.inc b/plugins/!Deprecated/Actman20/ua/i_inoutxm.inc index bf53ff954a..098a262b1e 100644 --- a/plugins/Actman30/ua/i_inoutxm.inc +++ b/plugins/!Deprecated/Actman20/ua/i_inoutxm.inc @@ -25,7 +25,6 @@ const ioMenuShow :PWideChar = 'Show';
ioMenuUsed :PWideChar = 'Used';
ioMenuSeparated :PWideChar = 'Separated';
- ioNoTranslate :PWideChar = 'NoTranslate';
function ImportMenuItems(node:HXML;var MenuItem:tUAMenuItem):integer;
@@ -49,9 +48,6 @@ 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;
@@ -154,18 +150,18 @@ begin inc(pbyte(ptr),4);
for i:=0 to num-1 do
begin
- if (ptr.flags and ACF_SELECTED)<>0 then
+ if (ptr.flags and ACCF_IMPORTED)<>0 then
begin
if StrCmpw(pcw,ptr.descr)=0 then
begin
// delete old UA for overwrited actions
- if (ptr.flags and ACF_OVERLOAD)<>0 then
+ if (ptr.flags and ACCF_OVERLOAD)<>0 then
begin
for act:=0 to HIGH(UActionList) do
begin
if ptr.id=UActionList[act].dwActID then
begin
- DeleteUAction(act,true);
+ DeleteUAction(act);
break;
end;
end;
@@ -195,7 +191,7 @@ end; //--------------------------
-function ExportMenuItems(node:HXML;const MenuItem:tUAMenuItem):HXML;
+function ExportMenuItems(node:HXML;MenuItem:tUAMenuItem):HXML;
begin
with xmlparser do
begin
@@ -215,8 +211,6 @@ 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_opt_dlg.inc b/plugins/!Deprecated/Actman20/ua/i_opt_dlg.inc index 6e5cc4d117..e9d7dc5048 100644 --- a/plugins/Actman30/ua/i_opt_dlg.inc +++ b/plugins/!Deprecated/Actman20/ua/i_opt_dlg.inc @@ -1,133 +1,127 @@ {}
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;
-//----- Static (no option-depended) control view -----
-
-procedure HideAllControls(Dialog:HWND);
+procedure CheckPlacesAbility;
+var
+ i:integer;
begin
- 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);
-
+ for i:=0 to NumTypes-1 do
+ begin
+ with NamesArray[i] do
+ begin
+ enable:=(service=nil) or (ServiceExists(service)<>0);
+ end;
+ end;
+end;
- 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);
+function CompareItem(lParam1,lParam2:LPARAM;SortType:LPARAM):int; stdcall;
+begin
+ result:=UActionList[lParam1].wSortIndex-UActionList[lParam2].wSortIndex;
end;
-// Show or hide option items ("static options")
-procedure ShowHideControls(Dialog:HWND;atype:integer;item:integer=-1);
+// Show or hide option items
+procedure SetupControls(Dialog:HWND;atype:integer;item:integer=-1);
var
- show:integer;
+ i: cardinal;
+ typ:integer;
+ wnd,wnd1:HWND;
+ enable:boolean;
begin
- HideAllControls(Dialog);
- if atype>=0 then
+ if atype<0 then
begin
- 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);
-
- 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);
-
- 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);
-
- 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);
+ 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;
- ShowWindow(GetDlgItem(Dialog,IDC_UA_SHOWVART ),SW_SHOW);
- ShowEditField(Dialog,IDC_UA_SHOWVARV ,SW_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;
- 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);
+ // common settings
+ EnableWindow(GetDlgItem(Dialog,IDC_UA_SAVSTATE),
+ IsDlgButtonChecked(Dialog,IDC_UA_TWOSTATE)<>BST_UNCHECKED);
-// ShowWindow(GetDlgItem(Dialog,IDC_UA_NOTRANSLATE),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);
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
@@ -135,111 +129,20 @@ var begin
s:=settings;
settings:=0;
- // 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_TWOSTATE ,BST_UNCHECKED);
+ CheckDlgButton (Dialog,IDC_UA_SAVSTATE ,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);
- MakeEditField(Dialog,IDC_UA_TTPRESSEDV);
-
- 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;
s:HWND;
- i:integer;
begin
s:=settings;
settings:=0;
@@ -266,11 +169,6 @@ begin SetDlgItemTextA(Dialog,IDC_UA_TTNORMALV ,UA.szTTBTooltip);
SetDlgItemTextA(Dialog,IDC_UA_TTPRESSEDV,UA.szTTBTooltipPressed);
SetDlgItemTextW(Dialog,IDC_UA_SHOWVARV ,UA.szTTBShowWhenVars);
-
- if (UA.flags and UAF_TTBTTUV)<>0 then i:=EF_SCRIPT else i:=0;
- SetEditFlags(Dialog,IDC_UA_TTNORMALV ,EF_ALL,i);
- if (UA.flags and UAF_TTBTTPV)<>0 then i:=EF_SCRIPT else i:=0;
- SetEditFlags(Dialog,IDC_UA_TTPRESSEDV,EF_ALL,i);
end;
uaTAB: begin // TabSRMM toolbar
@@ -283,15 +181,9 @@ 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);
- if (menu_opt and UAF_MNAMVAR)<>0 then i:=EF_SCRIPT else i:=0;
- SetEditFlags(Dialog,IDC_UA_VARNAMESV,EF_ALL,i);
- if (menu_opt and UAF_MSUBVAR)<>0 then i:=EF_SCRIPT else i:=0;
- SetEditFlags(Dialog,IDC_UA_POPUPV,EF_ALL,i);
end;
end;
@@ -299,8 +191,7 @@ begin // Settings in Customize/Hotkeys
end;
end;
- ShowHideControls(Dialog,aType,-1);
- EnableDisableCheck(Dialog);
+ SetupControls(Dialog,aType,-1);
settings:=s;
end;
@@ -364,12 +255,10 @@ begin else
begin
ClearControls(Dialog);
- ShowHideControls(Dialog,-1,-1);
+ SetupControls(Dialog,-1,-1);
end;
end;
-//----- Saving -----
-
procedure SetChangedFlag(Dialog:HWND);
var
num,atype:integer;
@@ -387,14 +276,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;
- if (GetEditFlags(Dialog,IDC_UA_VARNAMESV) and EF_SCRIPT)<>0 then
- menu_opt:=menu_opt or UAF_MNAMVAR;
- if (GetEditFlags(Dialog,IDC_UA_POPUPV) and EF_SCRIPT)<>0 then
- menu_opt:=menu_opt or UAF_MSUBVAR;
end;
end;
@@ -448,10 +331,6 @@ begin mFreeMem(szTTBTooltip ); szTTBTooltip :=GetDlgText(Dialog,IDC_UA_TTNORMALV ,true);
mFreeMem(szTTBTooltipPressed); szTTBTooltipPressed:=GetDlgText(Dialog,IDC_UA_TTPRESSEDV,true);
mFreeMem(szTTBShowWhenVars ); szTTBShowWhenVars :=GetDlgText(Dialog,IDC_UA_SHOWVARV);
- if (GetEditFlags(Dialog,IDC_UA_TTNORMALV ) and EF_SCRIPT)<>0 then
- flags:=flags or UAF_TTBTTUV;
- if (GetEditFlags(Dialog,IDC_UA_TTPRESSEDV) and EF_SCRIPT)<>0 then
- flags:=flags or UAF_TTBTTPV;
end;
uaTAB: begin // TabSRMM toolbar
@@ -475,46 +354,70 @@ begin end;
end;
-procedure ChangeBlock(Dialog:HWND);
+procedure FillActionList(wnd:HWND);
var
- pc:pWideChar;
- sh_main,sh_add:integer;
+ i:integer;
+ li:LV_ITEMW;
+ il:HIMAGELIST;
+ lmenu:tMenuType;
begin
- if IsWindowVisible(GetDlgItem(Dialog,IDC_UA_POPUPV)) then
- begin
- pc:='<';
- sh_main:=SW_HIDE;
- sh_add :=SW_SHOW;
- end
- else
- begin
- pc:='>';
- sh_main:=SW_SHOW;
- sh_add :=SW_HIDE;
+ 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_AddIcon(il,
+ 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;
- 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));
+ 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;
-//----- Main Dialog -----
+// 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);
-function DlgProcOpt(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
+ 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_AddIcon(il,
+ 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;
+
+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
@@ -527,8 +430,6 @@ 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);
@@ -549,6 +450,16 @@ 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;
@@ -569,36 +480,28 @@ begin begin
case loword(wParam) of
IDC_UA_TWOSTATE: begin
- 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,
+ SetupControls(Dialog,
LV_GetLParam(GetDlgItem(Dialog,IDC_UA_PLACELIST)),-1);
-
- if twostate then
- AddIcolibIconP(
+ {
+ EnableWindow(GetDlgItem(Dialog,IDC_UA_TTPRESSEDV),
+ IsDlgButtonChecked(Dialog,IDC_UA_TWOSTATE)<>BST_UNCHECKED);
+ }
+ if IsDlgButtonChecked(Dialog,IDC_UA_TWOSTATE)=BST_UNCHECKED then
+ DeleteIcolibIconP(
UActionList[LV_GetLParam(GetDlgItem(Dialog,IDC_UA_ACTIONLIST),-1)])
else
- DeleteIcolibIconP(
+ AddIcolibIconP(
UActionList[LV_GetLParam(GetDlgItem(Dialog,IDC_UA_ACTIONLIST),-1)]);
SendMessage(GetParent(Dialog),PSM_CHANGED,0,0);
end;
-//was commented. why?
+ IDC_UA_VARNAMESH: ShowVarHelp(Dialog,IDC_UA_VARNAMESV);
+ IDC_UA_SHOWVARH : ShowVarHelp(Dialog,IDC_UA_SHOWVARV);
+
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);
@@ -644,7 +547,6 @@ 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
@@ -656,7 +558,8 @@ begin LVIS_FOCUSED or LVIS_SELECTED,
LVIS_FOCUSED or LVIS_SELECTED)
else
- EnableDisableCheck(Dialog);
+ SetupControls(Dialog,LV_GetLParam(wnd,PNMLISTVIEW(lParam)^.iItem),
+ PNMLISTVIEW(lParam)^.iItem);
SendMessage(GetParent(Dialog),PSM_CHANGED,0,0);
end;
diff --git a/plugins/Actman30/ua/i_options.inc b/plugins/!Deprecated/Actman20/ua/i_options.inc index 977ff7891b..91f54e89d8 100644 --- a/plugins/Actman30/ua/i_options.inc +++ b/plugins/!Deprecated/Actman20/ua/i_options.inc @@ -26,10 +26,7 @@ begin begin
p:=StrCopyE(p,opt_UA);
p^:='/'; inc(p);
-{!!
- p^:='*'; inc(p); p^:=#0;
- DBDeleteGroup(0,DBBranch,setting);
-!!}
+
StrCopy(p,opt_Flags); DBDeleteSetting(0,DBBranch,setting);
StrCopy(p,opt_TTBTooltip ); DBDeleteSetting(0,DBBranch,setting);
@@ -199,6 +196,8 @@ end; *)
procedure SetAllActionUsers(var ActionItem:tMyActionItem; initial:boolean);
var
+ setting:array [0..63] of AnsiChar;
+ p:pAnsiChar;
luse:boolean;
lmenu:tMenuType;
begin
@@ -249,4 +248,90 @@ begin DestroyServiceFunction(ActionItem.hMenuService);
ActionItem.hMenuService:=0;
end;
+
+ // First run (ok ok, if ppl ask for it....)
+ p:=GetUABranch(setting,ActionItem.dwActID);
+ if p<>nil then
+ begin
+ p:=StrCopyE(p,opt_UA);
+ p^:='/'; inc(p);
+ StrCopy(p,'_FirstRun');
+ if DBReadByte(0,DBBranch,setting,0)<>0 then
+ begin
+ CAllService(MS_ACT_RUNBYID,ActionItem.dwActID,0);
+ DBDeleteSetting(0,DBBranch,setting);
+ end;
+ end;
+
+end;
+
+procedure DeleteUAction(num:integer);
+var
+ ActionItem:pMyActionItem;
+ setting:array [0..63] of AnsiChar;
+ p:pAnsiChar;
+ luse:boolean;
+ lmenu:tMenuType;
+begin
+ DeleteUASettings(num);
+
+ ActionItem:=@UActionList[num];
+
+ DeleteIcolibIcon(ActionItem^);
+
+ if (ActionItem.flags and UAF_REGHOTKEY)<>0 then
+ DeleteCoreHotkey(ActionItem^);
+
+ if (ActionItem.flags and UAF_REGTTBB)<>0 then
+ DeleteTTBButton(ActionItem^);
+ mFreeMem(ActionItem.szTTBTooltip);
+ mFreeMem(ActionItem.szTTBTooltipPressed);
+ mFreeMem(ActionItem.szTTBShowWhenVars);
+
+ if (ActionItem.flags and UAF_REGTABB)<>0 then
+ DeleteTabBBButton(ActionItem^);
+ mFreeMem(ActionItem.szTabBTooltip);
+ mFreeMem(ActionItem.szTabBTooltipPressed);
+
+ luse:=false;
+ for lmenu:=main_menu to HIGH(tMenuType) do
+ begin
+ with ActionItem.UAMenuItem[lmenu] do
+ begin
+ if (menu_opt and UAF_MENUUSE)<>0 then
+ begin
+ luse:=true;
+ DeleteMenuItem(ActionItem^,lmenu);
+ end;
+ mFreeMem(szMenuPopup);
+ mFreeMem(szMenuNameVars);
+ mFreeMem(szMenuShowWhenVars);
+ end;
+ end;
+
+ if (not luse) and (ActionItem.hMenuService<>0) then
+ begin
+ DestroyServiceFunction(ActionItem.hMenuService);
+ ActionItem.hMenuService:=0;
+ end;
+
+ p:=GetUABranch(setting,ActionItem.dwActID);
+ if p<>nil then
+ begin
+ p:=StrCopyE(p,opt_UA);
+ p^:='/'; inc(p);
+ StrCopy(p,'_FirstRun');
+ DBDeleteSetting(0,DBBranch,setting);
+ end;
+
+ // Free Memory
+ mFreeMem(ActionItem.szNameID);
+ mFreeMem(ActionItem.szActDescr);
+
+ // compact list
+ if num<HIGH(UActionList) then
+ begin
+ move(UActionList[num+1],UActionList[num],(HIGH(UACtionList)-num)*SizeOf(tMyActionItem));
+ end;
+ SetLength(UActionList,Length(UActionList)-1);
end;
diff --git a/plugins/Actman30/ua/i_ua.inc b/plugins/!Deprecated/Actman20/ua/i_ua.inc index b3b4cdaa47..61641a7447 100644 --- a/plugins/Actman30/ua/i_ua.inc +++ b/plugins/!Deprecated/Actman20/ua/i_ua.inc @@ -13,6 +13,8 @@ begin begin
// get Action settings
dwActID:=ptr^.id;
+ if (ptr^.flags and ACCF_DISABLED)<>0 then
+ flags:=UAF_DISABLED;
StrDupW(szActDescr,ptr^.descr);
wSortIndex:=idx;
@@ -55,71 +57,6 @@ begin end;
end;
-// "compact" means need to compact list/delete settings (Delete, not just exit)
-procedure DeleteUAction(num:integer;compact:boolean);
-var
- ActionItem:pMyActionItem;
- luse:boolean;
- lmenu:tMenuType;
-begin
- if compact then
- DeleteUASettings(num);
-
- ActionItem:=@UActionList[num];
-
- DeleteIcolibIcon(ActionItem^);
-
- if (ActionItem.flags and UAF_REGHOTKEY)<>0 then
- DeleteCoreHotkey(ActionItem^);
-
- if (ActionItem.flags and UAF_REGTTBB)<>0 then
- DeleteTTBButton(ActionItem^);
- mFreeMem(ActionItem.szTTBTooltip);
- mFreeMem(ActionItem.szTTBTooltipPressed);
- mFreeMem(ActionItem.szTTBShowWhenVars);
-
- if (ActionItem.flags and UAF_REGTABB)<>0 then
- DeleteTabBBButton(ActionItem^);
- mFreeMem(ActionItem.szTabBTooltip);
- mFreeMem(ActionItem.szTabBTooltipPressed);
-
- luse:=false;
- for lmenu:=main_menu to HIGH(tMenuType) do
- begin
- with ActionItem.UAMenuItem[lmenu] do
- begin
- if (menu_opt and UAF_MENUUSE)<>0 then
- begin
- luse:=true;
- DeleteMenuItem(ActionItem^,lmenu);
- end;
- mFreeMem(szMenuPopup);
- mFreeMem(szMenuNameVars);
- mFreeMem(szMenuShowWhenVars);
- end;
- end;
-
- if (not luse) and (ActionItem.hMenuService<>0) then
- begin
- DestroyServiceFunction(ActionItem.hMenuService);
- ActionItem.hMenuService:=0;
- end;
-
- // Free Memory
- mFreeMem(ActionItem.szNameID);
- mFreeMem(ActionItem.szActDescr);
-
- if compact then
- begin
- // compact list
- if num<HIGH(UActionList) then
- begin
- move(UActionList[num+1],UActionList[num],(HIGH(UActionList)-num)*SizeOf(tMyActionItem));
- end;
- SetLength(UActionList,Length(UActionList)-1);
- end;
-end;
-
function ActListChange(wParam:WPARAM;lParam:LPARAM):integer; cdecl;
var
ptr,ptr1:pChain;
@@ -134,8 +71,8 @@ begin begin
ptr1:=ptr;
inc(pbyte(ptr),4);
- if wParam<>0 then
-// if (wParam and (ACTM_NEW or ACTM_RENAME or ACTM_SORT or ACTM_DELETE))<>0 then
+ // maybe add ACTM_RELOAD (as NEW and DELETE) here too?
+ if (wParam and (ACTM_NEW or ACTM_RENAME or ACTM_SORT or ACTM_DELETE))<>0 then
for i:=0 to count-1 do
begin
// search corresponding element
@@ -150,9 +87,7 @@ begin end;
// if we have no item in list for this action - then add new one
if idx<0 then
- begin
- idx:=AddUAction(-1,ptr);
- end
+ AddUAction(-1,ptr)
else
begin
if (wParam and ACTM_RENAME)<>0 then
@@ -164,11 +99,10 @@ begin StrDupW (UActionList[idx].szActDescr,ptr^.descr);
end;
end;
- end;
-// not so necessary to check really
-// if (wParam and (ACTM_SORT or ACTM_DELETE or ACTM_NEW))<>0 then
- UActionList[idx].wSortIndex:=i;
+ if (wParam and (ACTM_SORT or ACTM_DELETE or ACTM_NEW))<>0 then
+ UActionList[idx].wSortIndex:=i;
+ end;
inc(ptr);
end;
end
@@ -196,24 +130,26 @@ begin end;
end;
if not bFound then
- DeleteUAction(j,true);
+ DeleteUAction(j);
end;
end;
if count>0 then
CallService(MS_ACT_FREELIST,0,TLPARAM(ptr1));
- // show changes in dialog
if settings<>0 then
begin
FillActionList(settings);
ShowAction(settings,-1);
- end;
-
- SaveUAs;
- FillChar(arMenuRec[0],Length(arMenuRec)*SizeOf(tuaMenuRecA),0);
- for i:=0 to HIGH(UActionList) do
+ SendMessage(GetParent(settings),PSM_CHANGED,0,0);
+ end
+ else
begin
- SetAllActionUsers(UActionList[i],false);
+ SaveUAs;
+ FillChar(arMenuRec[0],Length(arMenuRec)*SizeOf(tuaMenuRecA),0);
+ for i:=0 to HIGH(UActionList) do
+ begin
+ SetAllActionUsers(UActionList[i],false);
+ end;
end;
end;
diff --git a/plugins/Actman30/ua/i_uaplaces.inc b/plugins/!Deprecated/Actman20/ua/i_uaplaces.inc index 222065b460..4b1f46a762 100644 --- a/plugins/Actman30/ua/i_uaplaces.inc +++ b/plugins/!Deprecated/Actman20/ua/i_uaplaces.inc @@ -1,5 +1,5 @@ {}
-(*
+
const
MenuServices:array [tMenuType] of pAnsiChar = (
'CList/AddMainMenuItem' {MS_CLIST_ADDMAINMENUITEM },
@@ -8,7 +8,6 @@ const 'CList/AddProtoMenuItem' {MS_CLIST_ADDPROTOMENUITEM },
'CList/AddStatusMenuItem' {MS_CLIST_ADDSTATUSMENUITEM }
);
-*)
type
tuaMenuRec = record
hMenuRoot:HMENU;
@@ -26,7 +25,7 @@ begin result:=CallService(MS_ACT_RUNBYID, lParam, wParam);
end;
-procedure SetTTBState(const ActionItem:tMyActionItem);
+procedure SetTTBState(var ActionItem:tMyActionItem);
var
lflag:integer;
begin
@@ -48,7 +47,7 @@ begin CallService(MS_TTB_SETBUTTONSTATE,ActionItem.hTTBButton,lflag);
end;
-procedure SetTABState(hContact:THANDLE;const ActionItem:tMyActionItem;pressed:integer);
+procedure SetTABState(hContact:THANDLE;var ActionItem:tMyActionItem;pressed:integer);
var
tabb:TBBButton;
pc:pWideChar;
@@ -225,8 +224,8 @@ begin if (ActionItem.flags and UAF_HKREGGED)=0 then
begin
FillChar(hkd,SizeOf(hkd),0);
- hkd.cbSize := SizeOf(hkd); // HOTKEYDESC_SIZE_V1 for pre-0.9
- hkd.dwFlags := HKD_UNICODE; // since 0.9 only
+ hkd.cbSize := SizeOf(hkd);
+ hkd.dwFlags := HKD_UNICODE;
hkd.pszName := ActionItem.szNameID;
hkd.pszDescription.w:= ActionItem.szActDescr;
hkd.pszSection .w:= MODULE_NAME;
@@ -342,12 +341,12 @@ end; procedure CreateMenuItem(var ActionItem:tMyActionItem;mtype:tMenuType);
var
- extra:pWideChar;
+ i:integer;
ActItem:pMyActionItem;
ActMItem,UAMenuItem:pUAMenuItem;
clmi:TCListMenuItem;
- i:integer;
res:boolean;
+ extra:pWideChar;
begin
{}
UAMenuItem:=@ActionItem.UAMenuItem[mtype];
@@ -376,26 +375,16 @@ begin end;
end;
end;
- // need to create popup menu
+ // popup menu not found
if not res then
begin
FillChar(clmi,SizeOf(clmi),0);
clmi.cbSize:=SizeOf(clmi);
- if (UAMenuItem.menu_opt and UAF_NOTRANS)<>0 then
- clmi.flags :=CMIF_UNICODE or CMIF_KEEPUNTRANSLATED
- else
- clmi.flags :=CMIF_UNICODE{ or CMIF_ICONFROMICOLIB};
+ clmi.flags :=CMIF_UNICODE;
if (UAMenuItem.szMenuPopup<>nil) and (UAMenuItem.szMenuPopup^<>#0) then
- begin
- if (UAMenuItem.menu_opt and UAF_MSUBVAR)<>0 then
- clmi.szName.w:=ParseVarString(UAMenuItem.szMenuPopup)
- else
- clmi.szName.w:=UAMenuItem.szMenuPopup;
- end
+ clmi.szName.w:=ParseVarString(UAMenuItem.szMenuPopup)
else
- clmi.szName.w:=nil;
- if clmi.szName.w=nil then
clmi.szName.w:=ActionItem.szActDescr;
clmi.hIcon :=AddRootMenuIcon(clmi.szName.w);
@@ -406,9 +395,8 @@ begin (UAMenuItem.menu_opt and UAF_MENUSEP)<>0));
UAMenuItem.hMenuRoot:=MakeMenuItem(mtype,@clmi);
-
- if (clmi.szName.w<>ActionItem.szActDescr) and
- (clmi.szName.w<>UAMenuItem.szMenuPopup) then
+ //CallService(MenuServices[mtype],0,LPARAM(@clmi));
+ if clmi.szName.w<>ActionItem.szActDescr then
mFreeMem(clmi.szName.w);
for i:=1 to HIGH(arMenuRec) do
@@ -429,10 +417,7 @@ begin {}{}
FillChar(clmi,SizeOf(clmi),0);
clmi.cbSize:=SizeOf(clmi);
- if (UAMenuItem.menu_opt and UAF_NOTRANS)<>0 then
- clmi.flags :=CMIF_UNICODE or CMIF_KEEPUNTRANSLATED
- else
- clmi.flags :=CMIF_UNICODE{ or CMIF_ICONFROMICOLIB};
+ clmi.flags:=CMIF_UNICODE;
if (ActionItem.flags and (UAF_2STATE+UAF_PRESSED))<>(UAF_2STATE+UAF_PRESSED) then
begin
clmi.hIcon:=ActionItem.hIcolibIcon;
@@ -441,26 +426,22 @@ begin else
begin
clmi.hIcon:=ActionItem.hIcolibIconPressed;
- clmi.flags:=clmi.flags or CMIF_CHECKED;
+ clmi.flags:=CMIF_UNICODE or CMIF_CHECKED;
extra:='1';
end;
- if (UAMenuItem.szMenuNameVars<>nil) and (UAMenuItem.szMenuNameVars^<>#0) then
+ with ActionItem.UAMenuItem[mtype] do
begin
- if (UAMenuItem.menu_opt and UAF_MNAMVAR)<>0 then
- clmi.szName.w:=ParseVarString(UAMenuItem.szMenuNameVars,0,extra)
+ if (szMenuNameVars<>nil) and (szMenuNameVars^<>#0) then
+ clmi.szName.w:=ParseVarString(szMenuNameVars,0,extra)
else
- clmi.szName.w:=UAMenuItem.szMenuNameVars;
- end
- else
- clmi.szName.w:=nil;
- if clmi.szName.w=nil then
- clmi.szName.w:=ActionItem.szActDescr;
+ clmi.szName.w:=ActionItem.szActDescr;
- if UAMenuItem.hMenuRoot<>0 then
- begin
- clmi.flags:=clmi.flags or CMIF_ROOTHANDLE;
- clmi.szPopupName.w:=pWideChar(UAMenuItem.hMenuRoot);
+ if hMenuRoot<>0 then
+ begin
+ clmi.flags:=clmi.flags or CMIF_ROOTHANDLE;
+ clmi.szPopupName.w:=pWideChar(hMenuRoot);
+ end;
end;
clmi.pszService:=ActionItem.szNameID;
@@ -475,14 +456,13 @@ begin UAMenuItem.hMenuItem:=MakeMenuItem(mtype,@clmi);
//CallService(MenuServices[mtype],0,LPARAM(@clmi));
- if (clmi.szName.w<>ActionItem.szActDescr) and
- (clmi.szName.w<>UAMenuItem.szMenuNameVars) then
+ if clmi.szName.w<>ActionItem.szActDescr then
mFreeMem(clmi.szName.w);
{}
end;
-function PreBuildMenu(mtype:tMenuType;hContact:TMCONTACT=0):int;
+function PreBuildMenu(mtype:tMenuType;hContact:THANDLE=0):int;
var
i:integer;
mi:TCListMenuItem;
@@ -524,7 +504,7 @@ begin if (mi.flags and CMIF_HIDDEN)=0 then
begin
//!!!! icon (check for contact menu)
- mi.flags:=mi.flags or CMIM_ICON or CMIM_FLAGS{ or CMIF_ICONFROMICOLIB};
+ mi.flags:=mi.flags or CMIM_ICON or CMIM_FLAGS;
if (mtype=contact_menu) and IsLocalItem(UActionList[i]) then
begin
@@ -563,22 +543,14 @@ begin // new name
mi.flags:=mi.flags or CMIM_NAME or CMIF_UNICODE;
if (szMenuNameVars<>nil) and (szMenuNameVars^<>#0) then
- begin
- if (menu_opt and UAF_MNAMVAR)<>0 then
- mi.szName.w:=ParseVarString(szMenuNameVars,hContact,extra)
- else
- mi.szName.w:=szMenuNameVars;
- end
- else
- mi.szName.w:=nil;
+ mi.szName.w:=ParseVarString(szMenuNameVars,hContact,extra);
+
if mi.szName.w=nil then
mi.szName.w:=szActDescr;
end;
CallService(MS_CLIST_MODIFYMENUITEM,hMenuItem,LPARAM(@mi));
-
- if (mi.szName.w<>szActDescr) and
- (mi.szName.w<>szMenuNameVars) then
+ if mi.szName.w<>szActDescr then
mFreeMem(mi.szName.w);
end;
end;
@@ -652,24 +624,13 @@ begin if ActionItem.szTTBTooltip =nil then
pc1:=pc
- else
- begin
- if (ActionItem.flags and UAF_TTBTTUV)<>0 then
- pc1:=ParseVarString(ActionItem.szTTBTooltip)
- else
- pc1:=ActionItem.szTTBTooltip;
- end;
+ else pc1:=ActionItem.szTTBTooltip;
if ((ActionItem.flags and UAF_2STATE)=0) or
(ActionItem.szTTBTooltipPressed=nil) then
pc2:=pc1
else
- begin
- if (ActionItem.flags and UAF_TTBTTPV)<>0 then
- pc2:=ParseVarString(ActionItem.szTTBTooltipPressed)
- else
- pc2:=ActionItem.szTTBTooltipPressed;
- end;
+ pc2:=ActionItem.szTTBTooltipPressed;
mtButton.Name :=pc;
mtButton.pszTooltipUp :=pc1;
@@ -678,11 +639,6 @@ begin ActionItem.hTTBButton:=TopToolbar_AddButton(@mtButton);
if ActionItem.hTTBButton=THANDLE(-1) then
ActionItem.hTTBButton:=0;
- if (pc2<>pc1) and (pc2<>ActionItem.szTTBTooltipPressed) then
- mFreeMem(pc2);
- if (pc1<>pc) and (pc1<>ActionItem.szTTBTooltip) then
- mFreeMem(pc1);
-
mFreeMem(pc);
end;
end;
@@ -795,7 +751,7 @@ end; function OnTabButtonPressed(wParam:WPARAM;lParam:LPARAM):int; cdecl;
var
cbcd:pCustomButtonClickData;
-// tabb:BBButton;
+// tabb:TBBButton;
// pc:pWideChar;
i:integer;
begin
diff --git a/plugins/Actman30/ua/i_uavars.inc b/plugins/!Deprecated/Actman20/ua/i_uavars.inc index f2cf1ba42f..bab2ac12a1 100644 --- a/plugins/Actman30/ua/i_uavars.inc +++ b/plugins/!Deprecated/Actman20/ua/i_uavars.inc @@ -29,6 +29,9 @@ 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
@@ -47,10 +50,6 @@ 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
@@ -62,8 +61,6 @@ const UAF_REGTABB = 1 shl 5; // TabSRMM toolbar
UAF_USING = UAF_REGHOTKEY or UAF_REGTTBB or UAF_REGTABB;
- UAF_TTBTTPV = 1 shl 9; // TTB pressed hint script
- UAF_TTBTTUV = 1 shl 10; // TTB unpressed hint script
UAF_2STATE = 1 shl 11; // Buttons/menu items are 2-state
UAF_PRESSED = 1 shl 12; // Button pressed/menu item selected
UAF_SAVESTATE = 1 shl 13; // Save or not "pressed" state
@@ -79,10 +76,7 @@ const // menu options
UAF_MENUSEP = 1 shl 1; // menu item separated
- UAF_MSUBVAR = 1 shl 2; // submenu name script
- UAF_MNAMVAR = 1 shl 3; // menu name script
UAF_MENUUSE = 1 shl 8; // use this menu
- UAF_NOTRANS = 1 shl 9; // do not translate menus
type
tNameRec = record
@@ -125,3 +119,6 @@ var UActionList:array of tMyActionItem;
var
szMyPath:array [0..MAX_PATH] of WideChar;
+var
+ hServiceWithLParam:THANDLE;
+ hTTBService:THANDLE;
diff --git a/plugins/!Deprecated/Actman20/ua/i_uconst.inc b/plugins/!Deprecated/Actman20/ua/i_uconst.inc new file mode 100644 index 0000000000..34dde3ee9e --- /dev/null +++ b/plugins/!Deprecated/Actman20/ua/i_uconst.inc @@ -0,0 +1,34 @@ +{resource constants}
+const
+ IDD_UA = 1031;
+
+ IDC_UA_ACTIONLIST = 1025;
+ IDC_UA_PLACELIST = 1026;
+
+ // menu settings
+ IDC_UA_SEPARATE = 1027;
+ IDC_UA_POPUPT = 1028;
+ IDC_UA_POPUPV = 1029;
+
+ IDC_UA_VARNAMEST = 1030;
+ IDC_UA_VARNAMESV = 1031;
+ IDC_UA_VARNAMESH = 1032;
+
+ IDC_UA_SHOWVART = 1033;
+ IDC_UA_SHOWVARV = 1034;
+ IDC_UA_SHOWVARH = 1035;
+
+ // toolbar settings
+ 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_GLOBAL = 2003;
+
+ IDI_ACTION = 101;
diff --git a/plugins/!Deprecated/Actman20/ua/ua.pas b/plugins/!Deprecated/Actman20/ua/ua.pas new file mode 100644 index 0000000000..62b9604286 --- /dev/null +++ b/plugins/!Deprecated/Actman20/ua/ua.pas @@ -0,0 +1,124 @@ +unit ua;
+
+interface
+
+procedure Init;
+procedure DeInit;
+function AddOptionPage(var tmpl:pAnsiChar;var proc:pointer;var name:PAnsiChar):integer;
+
+implementation
+
+uses
+ windows, commctrl, messages,
+ mirutils, common, dbsettings, io, m_api, wrapper,
+ global;
+
+{$R ua.res}
+
+{$include m_actman.inc}
+
+{$include i_uconst.inc}
+{$include i_uavars.inc}
+
+// in - Action ID, out - action (group) number
+function GetUABranch(setting:pAnsiChar;id:cardinal):pAnsiChar;
+var
+ i:integer;
+ p,p1:pAnsiChar;
+begin
+ result:=nil;
+ p1:=StrCopyE(setting,opt_groups);
+ for i:=0 to CallService(MS_ACT_GETLIST,0,0)-1 do
+ begin
+ p:=StrEnd(IntToStr(p1,i));
+ p^:='/'; inc(p);
+ StrCopy(p,opt_id);
+ if DBReadDWord(0,DBBranch,setting)=id then
+ begin
+ p^:=#0;
+ result:=p;
+ break;
+ end;
+ end;
+end;
+
+var
+ amLink:tActionLink;
+
+{$include i_uaplaces.inc}
+{$include i_options.inc}
+{$include i_opt_dlg.inc}
+{$include i_ua.inc}
+{$include i_inoutxm.inc}
+
+// ------------ base interface functions -------------
+
+var
+ iohook:THANDLE;
+ hontabloaded,
+ honttbloaded,
+ ontabbtnpressed,
+ onactchanged:THANDLE;
+ hPreBuildMMenu,
+ hPreBuildCMenu,
+ hPreBuildTMenu:THANDLE;
+
+procedure Init;
+begin
+ GetModuleFileNameW(hInstance,szMyPath,MAX_PATH);
+
+ hServiceWithLParam:=CreateServiceFunction(SERVICE_WITH_LPARAM_NAME,@ServiceCallWithLParam);
+ hTTBService :=CreateServiceFunction(TTB_SERVICE_NAME ,@TTBServiceCall);
+ CheckPlacesAbility;
+
+ CreateUActionList;
+
+ honttbloaded :=HookEvent(ME_TTB_MODULELOADED ,@OnTTBLoaded);
+ hontabloaded :=HookEvent(ME_MSG_TOOLBARLOADED,@OnTabBBLoaded);
+ ontabbtnpressed:=HookEvent(ME_MSG_BUTTONPRESSED,@OnTabButtonPressed);
+ onactchanged :=HookEvent(ME_ACT_CHANGED ,@ActListChange);
+
+ hPreBuildMMenu:=HookEvent(ME_CLIST_PREBUILDMAINMENU , PreBuildMainMenu);
+ hPreBuildCMenu:=HookEvent(ME_CLIST_PREBUILDCONTACTMENU, PreBuildContactMenu);
+ hPreBuildTMenu:=HookEvent(ME_CLIST_PREBUILDTRAYMENU , PreBuildTrayMenu);
+
+ iohook:=HookEvent(ME_ACT_INOUT,@ActInOut);
+end;
+
+procedure DeInit;
+begin
+ SetLength(arMenuRec,0);
+
+ UnhookEvent(hPreBuildMMenu);
+ UnhookEvent(hPreBuildCMenu);
+ UnhookEvent(hPreBuildTMenu);
+
+ UnhookEvent(honttbloaded);
+ UnhookEvent(hontabloaded);
+ UnhookEvent(ontabbtnpressed);
+ UnhookEvent(onactchanged);
+ UnhookEvent(iohook);
+ DestroyServiceFunction(hServiceWithLParam);
+ DestroyServiceFunction(hTTBService);
+end;
+
+function AddOptionPage(var tmpl:pAnsiChar;var proc:pointer;var name:PAnsiChar):integer;
+begin
+ result:=0;
+ tmpl:=PAnsiChar(IDD_UA);
+ proc:=@DlgProcOpt;
+ name:='Use Actions';
+end;
+
+procedure InitLink;
+begin
+ amLink.Next :=ActionLink;
+ amLink.Init :=@Init;
+ amLink.DeInit :=@DeInit;
+ amLink.AddOption:=@AddOptionPage;
+ ActionLink :=@amLink;
+end;
+
+initialization
+ InitLink;
+end.
diff --git a/plugins/!Deprecated/Actman20/ua/ua.rc b/plugins/!Deprecated/Actman20/ua/ua.rc new file mode 100644 index 0000000000..76d8c0ad77 --- /dev/null +++ b/plugins/!Deprecated/Actman20/ua/ua.rc @@ -0,0 +1,51 @@ +#include "i_uconst.inc"
+
+LANGUAGE 0,0
+
+IDD_UA DIALOGEX 0, 0, 304, 226, 0
+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
+ CONTROL "", IDC_UA_ACTIONLIST, "SysListView32",
+ WS_BORDER | WS_TABSTOP |
+ LVS_NOCOLUMNHEADER | LVS_SHOWSELALWAYS | LVS_REPORT | LVS_SINGLESEL,
+ 2, 12, 132, 212, WS_EX_CONTROLPARENT
+
+ CTEXT "Where to use",-1, 138,2,160,10, 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
+
+ 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
+
+ AUTOCHECKBOX "Contact related", IDC_UA_GLOBAL, 138,128,160,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 "Pressed button tooltip",IDC_UA_TTPRESSEDT, 138,172,160,8
+ EDITTEXT IDC_UA_TTPRESSEDV, 138,182,160,12, ES_AUTOHSCROLL
+
+ // Menu settings block
+ AUTOCHECKBOX "Separated",IDC_UA_SEPARATE, 138,142,160,14, BS_LEFTTEXT | BS_RIGHT
+
+ RTEXT "Root popup:",IDC_UA_POPUPT,138,158,80,12, SS_CENTERIMAGE
+ EDITTEXT IDC_UA_POPUPV, 218,158,80,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 "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
+
+}
+
+IDI_ACTION ICON "action.ico"
diff --git a/plugins/!Deprecated/Actman20/ua/ua.res b/plugins/!Deprecated/Actman20/ua/ua.res Binary files differnew file mode 100644 index 0000000000..c8f5fd5ea1 --- /dev/null +++ b/plugins/!Deprecated/Actman20/ua/ua.res diff --git a/plugins/Actman30/actman30.dpr b/plugins/Actman/actman30.dpr index 6e7e2d6f3c..6e7e2d6f3c 100644 --- a/plugins/Actman30/actman30.dpr +++ b/plugins/Actman/actman30.dpr diff --git a/plugins/Actman30/ask.rc b/plugins/Actman/ask.rc index cb36bcf8ee..cb36bcf8ee 100644 --- a/plugins/Actman30/ask.rc +++ b/plugins/Actman/ask.rc diff --git a/plugins/Actman30/ask.res b/plugins/Actman/ask.res Binary files differindex 15a00e0218..15a00e0218 100644 --- a/plugins/Actman30/ask.res +++ b/plugins/Actman/ask.res diff --git a/plugins/Actman30/dlgshare.pas b/plugins/Actman/dlgshare.pas index 0fc89a975b..0fc89a975b 100644 --- a/plugins/Actman30/dlgshare.pas +++ b/plugins/Actman/dlgshare.pas diff --git a/plugins/Actman30/dlgshare.rc b/plugins/Actman/dlgshare.rc index dfeb197281..dfeb197281 100644 --- a/plugins/Actman30/dlgshare.rc +++ b/plugins/Actman/dlgshare.rc diff --git a/plugins/Actman30/dlgshare.res b/plugins/Actman/dlgshare.res Binary files differindex 13c4bf49cd..13c4bf49cd 100644 --- a/plugins/Actman30/dlgshare.res +++ b/plugins/Actman/dlgshare.res diff --git a/plugins/Actman/global.pas b/plugins/Actman/global.pas index 50254b383e..276f71dea7 100644 --- a/plugins/Actman/global.pas +++ b/plugins/Actman/global.pas @@ -2,6 +2,14 @@ unit global; interface
+const
+ DBBranch = 'ActMan';
+const
+ ACF_SELECTED = $08000000;
+ ACF_EXPORT = ACF_SELECTED;
+ ACF_IMPORT = ACF_SELECTED;
+ ACF_OVERLOAD = $01000000;
+
type
tAddOption = function(var tmpl:pAnsiChar;var proc:pointer;var name:PAnsiChar):integer;
type
diff --git a/plugins/Actman30/hooks/hooks.res b/plugins/Actman/hooks.res Binary files differindex 1cf202f414..1cf202f414 100644 --- a/plugins/Actman30/hooks/hooks.res +++ b/plugins/Actman/hooks.res diff --git a/plugins/Actman/hooks/hooks.pas b/plugins/Actman/hooks/hooks.pas index b3309c327a..0bfa508afe 100644 --- a/plugins/Actman/hooks/hooks.pas +++ b/plugins/Actman/hooks/hooks.pas @@ -2,21 +2,15 @@ unit hooks; interface
-procedure Init;
-procedure DeInit;
-function AddOptionPage(var tmpl:pAnsiChar;var proc:pointer;var name:PAnsiChar):integer;
-
implementation
uses
windows, commctrl, messages,
- mirutils, common, dbsettings, io, m_api, wrapper,
+ mirutils, common, dbsettings, m_api, wrapper,
global, mApiCardM;
{$R hooks.res}
-{$include m_actman.inc}
-
{$include i_hook.inc}
{$include i_hconst.inc}
{$include i_options.inc}
diff --git a/plugins/Actman/hooks/i_hook.inc b/plugins/Actman/hooks/i_hook.inc index 8b7b487d98..7bdf64fd47 100644 --- a/plugins/Actman/hooks/i_hook.inc +++ b/plugins/Actman/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/Actman/hooks/i_opt_dlg.inc b/plugins/Actman/hooks/i_opt_dlg.inc index d208ec4384..23adcf0848 100644 --- a/plugins/Actman/hooks/i_opt_dlg.inc +++ b/plugins/Actman/hooks/i_opt_dlg.inc @@ -133,7 +133,9 @@ end; procedure SaveHookData(Dialog:HWND; item:integer=-1);
var
wnd:HWND;
- li:LV_ITEM;
+ li:LV_ITEMW;
+ p:pAnsiChar;
+ buf:array [0..127] of WideChar;
begin
wnd:=GetDlgItem(Dialog,IDC_HOOKLIST);
if item<0 then
@@ -146,9 +148,23 @@ begin SendMessageW(wnd,LVM_SETITEMW,0,LPARAM(@li));
li.mask :=LVIF_TEXT;
li.iSubItem :=1;
- li.pszText :=GetDlgText(Dialog,IDC_EVENTLIST);
+ p:=ApiCard.NameFromList(GetDlgItem(Dialog,IDC_EVENTLIST));
+ li.pszText :=FastAnsitoWideBuf(p,buf);
SendMessageW(wnd,LVM_SETITEMW,0,LPARAM(@li));
- mFreeMem(li.pszText);
+end;
+
+procedure CheckButtons(Dialog:HWND);
+var
+ b:bool;
+begin
+ b:=SendDlgItemMessage(Dialog,IDC_HOOKLIST,LVM_GETITEMCOUNT, 0, 0)>0;
+
+ EnableWindow(GetDlgItem(Dialog,IDC_EVENTLIST ),b);
+ EnableWindow(GetDlgItem(Dialog,IDC_ACTIONLIST ),b);
+ EnableWindow(GetDlgItem(Dialog,IDC_HOOK_DELETE),b);
+ EnableWindow(GetDlgItem(Dialog,IDC_HOOK_APPLY ),b);
+ EnableWindow(GetDlgItem(Dialog,IDC_EVENT_CHELP),b);
+ EnableWindow(GetDlgItem(Dialog,IDC_EVENT_HELP ),b);
end;
function NewHook(Dialog:HWND;item:integer=-1):integer;
@@ -165,25 +181,33 @@ begin li.iSubItem:=0;
li.pszText :=TranslateW('hook sample');
result:=SendMessageW(wnd,LVM_INSERTITEMW,0,LPARAM(@li));
+ Listview_SetItemState(wnd,result,
+ LVIS_FOCUSED or LVIS_SELECTED,
+ LVIS_FOCUSED or LVIS_SELECTED);
+ CheckButtons(Dialog);
end;
function DeleteHook(Dialog:HWND):integer;
var
wnd:HWND;
- i:integer;
+ i,j:integer;
begin
result:=0;
wnd:=GetDlgItem(Dialog,IDC_HOOKLIST);
- for i:=ListView_GetItemCount(wnd)-1 downto 0 do
+ j:=SendMessage(wnd,LVM_GETITEMCOUNT,0,0);
+ for i:=j-1 downto 0 do
begin
- if ListView_GetItemState(wnd,i,LVIS_SELECTED)<>0 then
+ if SendMessage(wnd,LVM_GETITEMSTATE,i,LVIS_SELECTED)<>0 then
SendMessage(wnd,LVM_DELETEITEM,i,0);
end;
- Listview_SetItemState(wnd,0,LVIS_FOCUSED or LVIS_SELECTED,
- LVIS_FOCUSED or LVIS_SELECTED);
+ Listview_SetItemState(wnd,0,
+ LVIS_FOCUSED or LVIS_SELECTED,
+ LVIS_FOCUSED or LVIS_SELECTED);
+
+ 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
@@ -254,10 +278,31 @@ begin SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,LPARAM(@ti));
end;
-function DlgProcOpt(Dialog:HWnd;hMessage:UINT;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+procedure CreateHKTable(Dialog:HWND);
var
wnd:HWND;
lv:LV_COLUMNW;
+begin
+ wnd:=GetDlgItem(Dialog,IDC_HOOKLIST);
+ SendMessage(wnd,LVM_SETUNICODEFORMAT,1,0);
+ FillChar(lv,SizeOf(lv),0);
+ lv.mask :=LVCF_TEXT or LVCF_WIDTH;
+ lv.pszText:=TranslateW('Description');
+ lv.cx :=110;
+ SendMessageW(wnd,LVM_INSERTCOLUMNW ,0,TLPARAM(@lv));
+ lv.pszText:=TranslateW('Name');
+ lv.cx :=110;
+ SendMessageW(wnd,LVM_INSERTCOLUMNW ,1,TLPARAM(@lv));
+ SendMessageW(wnd,LVM_SETCOLUMNWIDTH,1,LVSCW_AUTOSIZE_USEHEADER);
+// SendMessage (wnd,LVM_SETEXTENDEDLISTVIEWSTYLE,LVS_EX_CHECKBOXES,LVS_EX_CHECKBOXES);
+ SendMessage (wnd,LVM_SETEXTENDEDLISTVIEWSTYLE,0,
+ LVS_EX_FULLROWSELECT or LVS_EX_CHECKBOXES or LVS_EX_GRIDLINES);
+ SendMessage(wnd,LVM_SETUNICODEFORMAT,1,0);
+ OldTableProc:=pointer(SetWindowLongPtrW(wnd,GWL_WNDPROC,LONG_PTR(@NewHKTableProc)));
+end;
+
+function DlgProcOpt(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
+var
i:integer;
tmp:pAnsiChar;
buf:array [0..255] of AnsiChar;
@@ -274,36 +319,29 @@ begin WM_INITDIALOG: begin
ApiCard:=CreateEventCard(Dialog);
- wnd:=GetDlgItem(Dialog,IDC_HOOKLIST);
- SendMessage(wnd,LVM_SETUNICODEFORMAT,1,0);
- FillChar(lv,SizeOf(lv),0);
- lv.mask :=LVCF_TEXT or LVCF_WIDTH;
- lv.pszText:=TranslateW('Description');
- lv.cx :=110;
- SendMessageW(wnd,LVM_INSERTCOLUMNW ,0,TLPARAM(@lv));
- lv.pszText:=TranslateW('Name');
- lv.cx :=110;
- SendMessageW(wnd,LVM_INSERTCOLUMNW ,1,TLPARAM(@lv));
- SendMessageW(wnd,LVM_SETCOLUMNWIDTH,1,LVSCW_AUTOSIZE_USEHEADER);
-// SendMessage (wnd,LVM_SETEXTENDEDLISTVIEWSTYLE,LVS_EX_CHECKBOXES,LVS_EX_CHECKBOXES);
- SendMessage (wnd,LVM_SETEXTENDEDLISTVIEWSTYLE,0,
- LVS_EX_FULLROWSELECT or LVS_EX_CHECKBOXES or LVS_EX_GRIDLINES);
- SendMessage(wnd,LVM_SETUNICODEFORMAT,1,0);
- OldTableProc:=pointer(SetWindowLongPtrW(wnd,GWL_WNDPROC,LONG_PTR(@NewHKTableProc)));
TranslateDialogDefault(Dialog);
SetIcons(Dialog);
- ApiCard.FillList(GetDlgItem(Dialog,IDC_EVENTLIST));
+ ApiCard.FillList(GetDlgItem(Dialog,IDC_EVENTLIST),
+ DBReadByte(0,DBBranch,'SrvListMode'));
+
FillActionList(GetDlgItem(Dialog,IDC_ACTIONLIST));
- FillHookList(wnd);
+
+ CreateHKTable(Dialog);
+ FillHookList(GetDlgItem(Dialog,IDC_HOOKLIST));
ShowHookData(Dialog);
+ CheckButtons(Dialog);
+
onactchanged:=HookEvent(ME_ACT_CHANGED,@ActListChange);
settings:=Dialog;
end;
WM_HELP: begin
+ tmp:=ApiCard.NameFromList(GetDlgItem(Dialog,IDC_EVENTLIST));
+ ApiCard.Event:=tmp;
+ mFreeMem(tmp);
ApiCard.Show;
end;
@@ -350,7 +388,7 @@ begin BN_CLICKED: begin
case loword(wParam) of
- IDC_EVENT_CHELP: ;
+ IDC_EVENT_CHELP: SendMessage(Dialog,WM_HELP,0,0);
IDC_EVENT_HELP : ;
IDC_HOOK_NEW : NewHook(Dialog);
IDC_HOOK_DELETE: DeleteHook(Dialog);
diff --git a/plugins/Actman30/i_cnst_call.inc b/plugins/Actman/i_cnst_call.inc index 8b8118ed28..8b8118ed28 100644 --- a/plugins/Actman30/i_cnst_call.inc +++ b/plugins/Actman/i_cnst_call.inc diff --git a/plugins/Actman30/i_cnst_chain.inc b/plugins/Actman/i_cnst_chain.inc index 477d8ce137..477d8ce137 100644 --- a/plugins/Actman30/i_cnst_chain.inc +++ b/plugins/Actman/i_cnst_chain.inc diff --git a/plugins/Actman30/i_cnst_contact.inc b/plugins/Actman/i_cnst_contact.inc index 5b2cf3991d..5b2cf3991d 100644 --- a/plugins/Actman30/i_cnst_contact.inc +++ b/plugins/Actman/i_cnst_contact.inc diff --git a/plugins/Actman30/i_cnst_database.inc b/plugins/Actman/i_cnst_database.inc index 0727d68451..0727d68451 100644 --- a/plugins/Actman30/i_cnst_database.inc +++ b/plugins/Actman/i_cnst_database.inc diff --git a/plugins/Actman30/i_cnst_dlgshare.inc b/plugins/Actman/i_cnst_dlgshare.inc index 396499e68a..396499e68a 100644 --- a/plugins/Actman30/i_cnst_dlgshare.inc +++ b/plugins/Actman/i_cnst_dlgshare.inc diff --git a/plugins/Actman30/i_cnst_ini.inc b/plugins/Actman/i_cnst_ini.inc index 85212e9c56..85212e9c56 100644 --- a/plugins/Actman30/i_cnst_ini.inc +++ b/plugins/Actman/i_cnst_ini.inc diff --git a/plugins/Actman30/i_cnst_inout.inc b/plugins/Actman/i_cnst_inout.inc index ff1cf50d7c..ff1cf50d7c 100644 --- a/plugins/Actman30/i_cnst_inout.inc +++ b/plugins/Actman/i_cnst_inout.inc diff --git a/plugins/Actman30/i_cnst_jump.inc b/plugins/Actman/i_cnst_jump.inc index 9782c9a9d3..9782c9a9d3 100644 --- a/plugins/Actman30/i_cnst_jump.inc +++ b/plugins/Actman/i_cnst_jump.inc diff --git a/plugins/Actman30/i_cnst_message.inc b/plugins/Actman/i_cnst_message.inc index 02db4c3d9b..02db4c3d9b 100644 --- a/plugins/Actman30/i_cnst_message.inc +++ b/plugins/Actman/i_cnst_message.inc diff --git a/plugins/Actman30/i_cnst_notes.inc b/plugins/Actman/i_cnst_notes.inc index d7e779210d..d7e779210d 100644 --- a/plugins/Actman30/i_cnst_notes.inc +++ b/plugins/Actman/i_cnst_notes.inc diff --git a/plugins/Actman30/i_cnst_program.inc b/plugins/Actman/i_cnst_program.inc index 93d2ed5d0b..93d2ed5d0b 100644 --- a/plugins/Actman30/i_cnst_program.inc +++ b/plugins/Actman/i_cnst_program.inc diff --git a/plugins/Actman30/i_cnst_settings.inc b/plugins/Actman/i_cnst_settings.inc index c8c495a24a..c8c495a24a 100644 --- a/plugins/Actman30/i_cnst_settings.inc +++ b/plugins/Actman/i_cnst_settings.inc diff --git a/plugins/Actman30/i_cnst_storage.inc b/plugins/Actman/i_cnst_storage.inc index adaa7690c6..adaa7690c6 100644 --- a/plugins/Actman30/i_cnst_storage.inc +++ b/plugins/Actman/i_cnst_storage.inc diff --git a/plugins/Actman30/i_cnst_text.inc b/plugins/Actman/i_cnst_text.inc index b25f155ef2..b25f155ef2 100644 --- a/plugins/Actman30/i_cnst_text.inc +++ b/plugins/Actman/i_cnst_text.inc diff --git a/plugins/Actman/i_const.inc b/plugins/Actman/i_const.inc index 3e9950414f..baf5b5edf3 100644 --- a/plugins/Actman/i_const.inc +++ b/plugins/Actman/i_const.inc @@ -2,49 +2,8 @@ const
// dialogs
IDD_ACTION = 1025;
- IDD_STRUCTURE = 1027;
IDD_ASK = 1028;
- // icons
- IDI_NEW = 1025;
- IDI_UP = 1026;
- IDI_DOWN = 1027;
- IDI_DELETE = 1028;
- IDI_RELOAD = 1029;
- IDI_CONTACT = 1030;
- IDI_SERVICE = 1031;
- IDI_PROGRAM = 1032;
- IDI_INSERT = 1033;
- IDI_ADVANCE = 1034;
- IDI_CHAIN = 1035;
- IDI_RW = 1036;
- IDI_TEST = 1037;
- IDI_EXPORT = 1038;
- IDI_IMPORT = 1039;
- IDI_MESSAGE = 1040;
- IDI_VAR_CHECKED = 1041;
- IDI_VAR_UNCHECKED = 1042;
- IDI_FORMAT = 1043;
- IDI_APPLY = 1044;
-
- // Structure editor
- IDC_DATA_FULL = 2001;
- IDC_DATA_TYPE = 2002;
- IDC_DATA_EDIT = 2005;
- IDC_DATA_LEN = 2006;
- IDC_DATA_HELP = 2007;
-
- IDC_DATA_NEW = 2008;
- IDC_DATA_DELETE = 2009;
- IDC_DATA_UP = 2010;
- IDC_DATA_DOWN = 2011;
- IDC_DATA_CHANGE = 2012;
- IDC_DATA_VARS = 2013;
- IDC_DATA_PACKED = 2014;
-
- // Action page
-// IDC_RESET = 2001;
-
IDC_ACTION_TYPE = 2005;
IDC_STAT_ACTION = 2006;
@@ -54,7 +13,7 @@ const IDC_ACTION_UP = 2010;
IDC_ACTION_DOWN = 2011;
- IDC_ACTION_GROUP = 2012;
+ IDC_MACRO_LIST = 2012;
IDC_GROUP_NEW = 2015;
IDC_GROUP_RELOAD = 2016;
IDC_GROUP_DELETE = 2017;
@@ -65,153 +24,6 @@ const IDC_GROUP_IMPORT = 2022;
IDC_ACTION_HELP = 2023;
- IDC_STAT_CONTACT = 2140;
- IDC_CONTACTLIST = 2141;
- IDC_CNT_KEEP = 2142;
- IDC_STAT_FORMAT = 2143;
- IDC_EDIT_FORMAT = 2144;
- IDC_CNT_FILTER = 2145;
- IDC_CNT_APPLY = 2146;
- IDC_STAT_FHELP = 2147;
-
- IDC_STAT_WPAR1 = 2150;
- IDC_STAT_LPAR1 = 2151;
- IDC_STAT_WPAR = 2152;
- IDC_STAT_LPAR = 2153;
- IDC_FLAG_WPAR = 2154;
- IDC_FLAG_LPAR = 2155;
- IDC_EDIT_WPAR = 2156;
- IDC_EDIT_LPAR = 2157;
- IDC_STAT_SERVICE = 2158;
- IDC_EDIT_SERVICE = 2159;
- IDC_WSTRUCT = 2160;
- IDC_LSTRUCT = 2161;
-
- IDC_RES_POPUP = 2251;
- IDC_RES_MESSAGE = 2252;
- IDC_RES_INSERT = 2253;
- IDC_SRV_RESSTAT = 2254;
- IDC_SRV_RESULT = 2255;
- IDC_RES_FREEMEM = 2256;
- IDC_RES_UNICODE = 2257;
- IDC_RES_SIGNED = 2258;
- IDC_RES_GROUP = 2259;
-
- IDC_FLAG_MINIMIZE = 2350;
- IDC_STAT_PRGPATH = 2351;
- IDC_EDIT_PRGPATH = 2352;
- IDC_PROGRAM = 2353;
- IDC_STAT_PRGARGS = 2354;
- IDC_EDIT_PRGARGS = 2355;
- IDC_EDIT_PROCTIME = 2356;
- IDC_PROCESS_GROUP = 2357;
- IDC_STAT_PROCTIME = 2358;
- IDC_PRSTART_GROUP = 2359;
- IDC_FLAG_NORMAL = 2360;
- IDC_FLAG_HIDDEN = 2361;
- IDC_FLAG_MAXIMIZE = 2362;
- IDC_FLAG_CURPATH = 2363;
- IDC_FLAG_PARALLEL = 2364;
- IDC_FLAG_CONTINUE = 2365;
- IDC_HLP_FVARS = 2366;
-
- IDC_HLP_VARS = 2451;
- IDC_STAT_INSERT = 2452;
- IDC_EDIT_INSERT = 2453;
-
- IDC_FLAG_CLIP = 2454;
- IDC_FLAG_MESSAGE = 2455;
- IDC_CLIP_COPYTO = 2456;
- IDC_CLIP_PASTE = 2457;
- IDC_CLIP_GROUP = 2458;
- IDC_FILE_ENC = 2459;
-// IDC_CLIP_ANSI = 2459;
-// IDC_CLIP_WIDE = 2460;
- IDC_FLAG_FILE = 2461;
- IDC_FILE_PATH = 2462;
- IDC_FILE_FILEBTN = 2463;
- IDC_FILE_READ = 2464;
- IDC_FILE_WRITE = 2465;
- IDC_FILE_APPEND = 2466;
- IDC_FILE_GROUP = 2467;
-
- IDC_STAT_GROUPS = 2500;
- IDC_GROUP_LIST = 2501;
-
- IDC_CONDITION = 2505;
- IDC_FLAG_GT = 2506;
- IDC_FLAG_LT = 2507;
- IDC_FLAG_EQ = 2508;
- IDC_FLAG_NOP = 2509;
- IDC_FLAG_NOT = 2510;
-
- IDC_OPERATION = 2511;
- IDC_FLAG_BREAK = 2512;
- IDC_FLAG_JUMP = 2513;
- IDC_FLAG_ANOP = 2514;
- IDC_ADV_VALUE = 2515;
- IDC_STAT_VAL = 2516;
-
- IDC_FLAG_MATH = 2519;
- IDC_ADV_OPER = 2520;
- IDC_ADV_VAL1 = 2521;
- IDC_ADV_VAL2 = 2522;
- IDC_FLAG_VARS = 2523;
- IDC_ADV_VARS = 2524;
- IDC_ADV_HVARS = 2526;
- IDC_ADV_ASINT = 2527;
-
- IDC_RW_READ = 2601;
- IDC_RW_WRITE = 2602;
- IDC_RW_DELETE = 2603;
- IDC_RW_STATM = 2605;
- IDC_RW_MODULE = 2606;
- IDC_RW_STATS = 2607;
- IDC_RW_SETTING = 2608;
- IDC_RW_TEXT = 2609;
- IDC_RW_VALUE = 2610;
- IDC_RW_DATATYPE = 2611;
- IDC_RW_CURRENT = 2614;
- IDC_RW_PARAM = 2615;
- IDC_RW_MANUAL = 2616;
- IDC_RW_OPER = 2617;
- IDC_RW_VAL = 2618;
- IDC_RW_RESULT = 2619;
- IDC_RW_LAST = 2620;
-
- IDC_MSG_STAT1 = 2701;
- IDC_MSG_STAT2 = 2702;
- IDC_MSG_TITLE = 2703;
- IDC_MSG_TEXT = 2704;
- IDC_MSG_BTNS = 2705;
- IDC_MSGB_ARI = 2706;
- IDC_MSGB_OK = 2707;
- IDC_MSGB_OC = 2708;
- IDC_MSGB_RC = 2709;
- IDC_MSGB_YN = 2710;
- IDC_MSGB_YNC = 2711;
- IDC_MSG_ICONS = 2712;
- IDC_MSGI_NONE = 2713;
- IDC_MSGI_WARN = 2714;
- IDC_MSGI_INFO = 2715;
- IDC_MSGI_QUEST = 2716;
- IDC_MSGI_ERROR = 2717;
- IDC_MSG_KEEP = 2718;
-
-// Variables buttons
- IDC_SRV_WPAR = 3000;
- IDC_SRV_LPAR = 3001;
- IDC_SRV_SRVC = 3002;
- IDC_PRG_PRG = 3003;
- IDC_PRG_ARG = 3004;
- IDC_TXT_FILE = 3005;
- IDC_TXT_TEXT = 3006;
- IDC_RW_MVAR = 3008;
- IDC_RW_SVAR = 3009;
- IDC_RW_TVAR = 3010;
- IDC_MSG_TTL = 3011;
- IDC_MSG_TXT = 3012;
-
// Question
IDC_ASK = 1025;
IDC_YESALL = 1026;
diff --git a/plugins/Actman/i_opt_dlg.inc b/plugins/Actman/i_opt_dlg.inc index 3e07cd97ae..e7a9e206ef 100644 --- a/plugins/Actman/i_opt_dlg.inc +++ b/plugins/Actman/i_opt_dlg.inc @@ -1,173 +1,9 @@ {}
-const
- etHK = 1; // Groups changed
- etACT = 2; // Actions changed
-const
- ACI_APPLY :PAnsiChar = 'ACI_Apply';
- ACI_NEW :PAnsiChar = 'ACI_New';
- ACI_UP :PAnsiChar = 'ACI_Up';
- ACI_DOWN :PAnsiChar = 'ACI_Down';
- ACI_DELETE :PAnsiChar = 'ACI_Delete';
- ACI_RELOAD :PAnsiChar = 'ACI_Reload';
- ACI_TEST :PAnsiChar = 'ACI_Test';
- ACI_IMPORT :PAnsiChar = 'ACI_Import';
- ACI_EXPORT :PAnsiChar = 'ACI_Export';
-const
- ACI_CONTACT = 'ACI_Contact';
- ACI_SERVICE = 'ACI_Service';
- ACI_PROGRAM = 'ACI_Program';
- ACI_INSERT = 'ACI_Insert';
- ACI_ADVANCE = 'ACI_Advanced';
- ACI_CHAIN = 'ACI_Chain';
- ACI_RW = 'ACI_Database';
- ACI_MESSAGE = 'ACI_Message';
-
- ACI_FORMAT = 'ACI_Format';
-
- ACI_VAR_UNCHECKED = 'ACI_VarUnChecked';
- ACI_VAR_CHECKED = 'ACI_VarChecked';
-
-const
- sresInt = 0;
- sresHex = 1;
- sresString = 2;
- sresStruct = 3;
-type
- tActId = record
- code:dword;
- id :dword;
- icon:PAnsiChar;
- text:PAnsiChar;
- end;
-const
- ActIds:array [0..ACT_MAXTYPE-1] of tActId = (
- (code:ACT_CONTACT; id:IDI_CONTACT; icon:ACI_CONTACT; text:'Open contact window'),
- (code:ACT_SERVICE; id:IDI_SERVICE; icon:ACI_SERVICE; text:'Call service'),
- (code:ACT_PROGRAM; id:IDI_PROGRAM; icon:ACI_PROGRAM; text:'Execute program'),
- (code:ACT_TEXT ; id:IDI_INSERT ; icon:ACI_INSERT ; text:'Insert text'),
- (code:ACT_ADVANCE; id:IDI_ADVANCE; icon:ACI_ADVANCE; text:'Advanced'),
- (code:ACT_CHAIN ; id:IDI_CHAIN ; icon:ACI_CHAIN ; text:'Link to action'),
- (code:ACT_RW ; id:IDI_RW ; icon:ACI_RW ; text:'Profile'),
- (code:ACT_MESSAGE; id:IDI_MESSAGE; icon:ACI_MESSAGE; text:'MessageBox'));
-
-procedure RegisterIcon(var sid:TSKINICONDESC;id:uint_ptr;name:PAnsiChar;descr:PAnsiChar);
var
- buf:array [0..63] of WideChar;
-begin
- sid.hDefaultIcon :=LoadImage(hInstance,MAKEINTRESOURCE(id),IMAGE_ICON,16,16,0);
- sid.pszName :=name;
- sid.szDescription.w:=FastAnsiToWideBuf(descr,buf);
- Skin_AddIcon(@sid);
- DestroyIcon(sid.hDefaultIcon);
-end;
-
-procedure RegisterIcons;
-var
- sid:TSKINICONDESC;
- i:integer;
-begin
- FillChar(sid,SizeOf(TSKINICONDESC),0);
- sid.cbSize :=SizeOf(TSKINICONDESC);
- sid.cx :=16;
- sid.cy :=16;
- sid.flags :=SIDF_UNICODE;
- sid.szSection.w:='Actions';
-
- RegisterIcon(sid,IDI_APPLY ,ACI_APPLY ,'Apply');
- RegisterIcon(sid,IDI_NEW ,ACI_NEW ,'New');
- RegisterIcon(sid,IDI_DELETE ,ACI_DELETE ,'Delete');
- RegisterIcon(sid,IDI_UP ,ACI_UP ,'Up');
- RegisterIcon(sid,IDI_DOWN ,ACI_DOWN ,'Down');
- RegisterIcon(sid,IDI_RELOAD ,ACI_RELOAD ,'Reload');
- RegisterIcon(sid,IDI_TEST ,ACI_TEST ,'Test');
- RegisterIcon(sid,IDI_IMPORT ,ACI_IMPORT ,'Import');
- RegisterIcon(sid,IDI_EXPORT ,ACI_EXPORT ,'Export');
-
- RegisterIcon(sid,IDI_FORMAT ,ACI_FORMAT ,'Contact list format');
-
- for i:=0 to ACT_MAXTYPE-1 do
- with ActIds[i] do
- RegisterIcon(sid,id,icon,text);
-
- sid.cx:=8;
- sid.cy:=8;
- RegisterIcon(sid,IDI_VAR_CHECKED ,ACI_VAR_CHECKED ,'Use Variables');
- RegisterIcon(sid,IDI_VAR_UNCHECKED,ACI_VAR_UNCHECKED,'Don''t use Variables');
-end;
-
-procedure SetStart;
-begin
- if NewGroupList=nil then
- begin
- NewGroupList:=GroupList;
- NewMaxGroups:=MaxGroups;
- end;
- if NewActionList=nil then
- begin
- NewActionList:=ActionList;
- NewMaxActions:=MaxActions;
- end;
-end;
-
-procedure SetChanged(wnd:HWND;atype:integer);
-begin
- SendMessage(GetParent(wnd),PSM_CHANGED,0,0);
- if ((atype and etHK )<>0) and (NewGroupList =GroupList ) then NewGroupList :=CloneGroupList;
- if ((atype and etACT)<>0) and (NewActionList=ActionList) then NewActionList:=CloneActionList;
-end;
-
-procedure SetSave(Dialog:HWND;curIdx:integer);
-var
- i,j:integer;
- li:LV_ITEMW;
- wnd:HWND;
-begin
- if NewGroupList<>GroupList then
- begin
-
- DestroyGroups(GroupList,MaxGroups);
- wnd:=GetDlgItem(Dialog,IDC_ACTION_GROUP);
- j:=SendMessageW(wnd,LVM_GETITEMCOUNT,0,0);
- MaxGroups:=j;
- if j>0 then
- begin
- GetMem (GroupList ,MaxGroups*SizeOf(tHKRecord));
- FillChar(GroupList^,MaxGroups*SizeOf(tHKRecord),0);
- li.mask :=LVIF_PARAM;
- li.iSubItem:=0;
- for i:=0 to j-1 do
- begin
- li.iItem:=i;
- SendMessageW(wnd,LVM_GETITEMW,0,lparam(@li)); // GetLParam(wnd,i);
- move(NewGroupList^[li.lParam],GroupList^[i],SizeOf(tHKRecord));
- li.lParam:=i;
- SendMessageW(wnd,LVM_SETITEMW,0,lparam(@li));
- end;
- end
- else
- GroupList:=nil;
-
- FreeMem(NewGroupList);
- NewGroupList:=GroupList;
- NewMaxGroups:=MaxGroups;
- end;
-end;
-
-procedure SetCancel;
-begin
- if NewActionList<>nil then
- begin
- if (NewActionList<>ActionList) then
- DestroyActions(NewActionList,NewMaxActions);
- NewActionList:=nil;
- end;
- if NewGroupList<>nil then
- begin
- if (NewGroupList<>GroupList) then
- DestroyGroups(NewGroupList,NewMaxGroups);
- NewGroupList:=nil;
- end;
-end;
+ xmlfilename:array [0..511] of WideChar;
+const
+ etMacro = 1; // Groups changed
+ etACT = 2; // Actions changed
{$include i_opt_dlg2.inc}
@@ -181,7 +17,8 @@ var i:integer;
begin
result:=0;
- NoDescription :=TranslateW('No description');
+ NoDescription:=TranslateW('No description');
+
StrCopyW(xmlfilename,'c:\export.xml');
DoInitCommonControls(ICC_USEREX_CLASSES);
diff --git a/plugins/Actman/i_opt_dlg2.inc b/plugins/Actman/i_opt_dlg2.inc index 4462c12d7d..75e1a51685 100644 --- a/plugins/Actman/i_opt_dlg2.inc +++ b/plugins/Actman/i_opt_dlg2.inc @@ -3,188 +3,533 @@ const
inoutfilter:pWideChar = 'XML files'#0'*.xml'#0'All files'#0'*.*'#0#0;
const
- NoChainText:PWideChar = 'not defined';
-const
- ActionNames:array [0..ACT_MAXTYPE] of pWideChar=(
- 'Unknown','Contact','Service','Program','Text','Advanced','Action','Profile','Message');
-const
- checknames:array [BST_UNCHECKED..BST_CHECKED] of PAnsiChar=(
- ACI_VAR_UNCHECKED,ACI_VAR_CHECKED);
-const
MaxDescrLen = 128;
const
- hlpContact = 0;
- hlpService = 1;
- hlpProgram = 2;
- hlpText = 3;
- hlpAdvance = 4;
- hlpChain = 5;
- hlpDBRW = 6;
- hlpMessage = 7;
hlpVariables = 30;
hlpAdvVariables = 31;
-const
- ptNumber = 0;
- ptString = 1;
- ptUnicode = 2;
- ptCurrent = 3;
- ptResult = 4;
- ptParam = 5;
- ptStruct = 6;
var
- wstruct,lstruct:pAnsiChar;
DontReact:bool;
OldGroupTableProc,
OldActTableProc:pointer;
- ChMask:dword;
+ EventMask:dword;
-function GetNumValue(wnd:HWND;usevar:boolean;var dst):boolean;
+procedure ChangeListNotify(list:integer);
var
- tmp:pWideChar;
+ p:pActModule;
begin
- result:=false;
- pWideChar(dst):=GetDlgText(wnd);
- if Pointer(dst)=nil then exit;
- if not usevar then
+ p:=ModuleLink;
+ while p<>nil do
begin
- tmp:=PWideChar(dst);
- if pWideChar(dst)^='$' then
- begin
- integer(dst):=HexToInt(pWideChar(dst)+1);
- result:=true;
- end
- else
- integer(dst):=StrToInt(pWideChar(dst));
- mFreeMem(tmp);
+ SendMessage(p^.DlgHandle,WM_ACT_LISTCHANGE,list,0);
+ p:=p^.Next;
end;
end;
-function GetGroupName(id:dword):pWideChar;
+procedure ResetDialogs;
var
- i:integer;
+ p:pActModule;
+begin
+ p:=ModuleLink;
+ while p<>nil do
+ begin
+ SendMessage(p^.DlgHandle,WM_ACT_RESET,0,0);
+ p:=p^.Next;
+ end;
+end;
+
+procedure ClearDialogData;
+var
+ p:pActModule;
+begin
+ p:=ModuleLink;
+ while p<>nil do
+ begin
+ if p^.DlgHandle<>0 then ShowWindow(p^.DlgHandle,SW_HIDE);
+ p:=p^.Next;
+ end;
+end;
+
+function CheckChanges:dword;
+var
+ i,j:integer;
+ found:boolean;
begin
- for i:=0 to NewMaxGroups-1 do
+ result:=0;
+ // 1 - search new items (EditMacroList elements which don't exists in MacroList)
+ found:=true;
+ for i:=0 to EditMacroList.Count-1 do
begin
- if ((NewGroupList^[i].flags and ACF_ASSIGNED)<>0) and (id=NewGroupList^[i].id) then
+ if (EditMacroList[i]^.flags and ACF_ASSIGNED)<>0 then
begin
- result:=NewGroupList^[i].descr;
- exit;
+ found:=false;
+ for j:=0 to MacroList.Count-1 do
+ begin
+ if (MacroList[j]^.flags and ACF_ASSIGNED)<>0 then
+ begin
+ if EditMacroList[i]^.id=MacroList[j]^.id then
+ begin
+ found:=true;
+ break;
+ end;
+ end;
+ end;
+ if not found then break;
+ end;
+ end;
+ if not found then
+ result:=result or ACTM_NEW;
+ // 2 - search deleted items (MacroList elements which don't exists in EditMacroList)
+ found:=true;
+ for i:=0 to MacroList.Count-1 do
+ begin
+ if (MacroList[i]^.flags and ACF_ASSIGNED)<>0 then
+ begin
+ found:=false;
+ for j:=0 to EditMacroList.Count-1 do
+ begin
+ if (EditMacroList[j]^.flags and ACF_ASSIGNED)<>0 then
+ begin
+ if MacroList[i]^.id=EditMacroList[j]^.id then
+ begin
+ found:=true;
+ break;
+ end;
+ end;
+ end;
+ if not found then break;
end;
end;
- result:=NoChainText;
+ if not found then
+ result:=result or ACTM_DELETE;
+ // 3 - resort? (maybe ANY EditMacroList position changes)
+end;
+
+procedure SetChanged(wnd:HWND;atype:integer);
+begin
+ SendMessage(GetParent(wnd),PSM_CHANGED,0,0);
+// if ((atype and etMacro)<>0) and (NewGroupList =GroupList ) then NewGroupList :=CloneGroupList;
+// if ((atype and etACT )<>0) and (NewActionList=ActionList) then NewActionList:=CloneActionList;
+end;
+
+procedure SetStart;
+begin
+ EditMacroList:=MacroList.Clone();
end;
-function AddGroup(Dialog:HWND;HKnum:dword):integer;
+// Cancel button pressed OR Edit window closed (After apply action)
+// No main list changed (except flags clearance - not necessary)
+// Edit macro list freeing with actions marked as introduced
+procedure SetCancel;
var
+ i,j:integer;
+begin
+ // Delete changed data
+ EditMacroList.Clear(ACF_INTRODUCED);
+ EditMacroList.Free;
+
+ // Clear editing flags
+ for i:=0 to MacroList.Count-1 do
+ begin
+ with MacroList[i]^ do
+ if (flags and ACF_ASSIGNED)<>0 then
+ begin
+ for j:=0 to ActionCount-1 do
+ begin
+ ActionList^[j].flags:=ActionList^[j].flags and not ACF_REPLACED;
+ end;
+ end;
+ end;
+end;
+
+// SAVE: fill edit macro list by dialog options,
+// Free main macro list with actions marked as replaced
+// copy content to main macro list (state as at option editing start)
+// clear "introduced" and "replaced" flags
+procedure SetSave(Dialog:HWND);
+var
+ i,j:integer;
+ TmpMacroList:tMacroList;
+ TmpMacroCount:integer;
+ wnd:HWND;
li:LV_ITEMW;
- list:HWND;
begin
- with NewGroupList^[HKnum] do
+ wnd:=MacroListWindow;
+ TmpMacroCount:=SendMessageW(wnd,LVM_GETITEMCOUNT,0,0);
+
+ // need to clear flags and resort
+ if TmpMacroCount>0 then
begin
- if (flags and ACF_ASSIGNED)<>0 then
+ // Clear actions editing flags
+ for i:=0 to EditMacroList.Count-1 do
begin
- list:=GetDlgItem(Dialog,IDC_ACTION_GROUP);
- li.mask :=LVIF_PARAM+LVIF_TEXT;
- li.iItem :=SendMessage(list,LVM_GETNEXTITEM,-1,LVNI_FOCUSED)+1;
- li.iSubItem :=0;
- li.lParam :=HKnum;
- if descr=nil then
- li.pszText:=NoDescription
+ with EditMacroList[i]^ do
+ if (flags and ACF_ASSIGNED)<>0 then
+ begin
+ for j:=0 to ActionCount-1 do
+ begin
+ ActionList^[j].flags:=ActionList^[j].flags and not ACF_INTRODUCED;
+ end;
+ end;
+ end;
+
+ TmpMacroList:=tMacroList.Create(TmpMacroCount);
+
+ // resort/copy macros
+ li.mask :=LVIF_PARAM;
+ li.iSubItem:=0;
+ for i:=0 to TmpMacroCount-1 do
+ begin
+ li.iItem:=i;
+ SendMessageW(wnd,LVM_GETITEMW,0,lparam(@li)); // GetLParam(wnd,i);
+ move(EditMacroList[loword(li.lParam)]^,TmpMacroList[i]^,SizeOf(tMacroRecord));
+ if (li.lParam and ACF_FIRSTRUN)<>0 then
+ TmpMacroList[i]^.flags:=TmpMacroList[i]^.flags or ACF_FIRSTRUN
else
- li.pszText:=descr;
- li.iItem :=SendMessageW(list,LVM_INSERTITEMW,0,lparam(@li));
- if li.iItem>0 then
- dec(li.iItem);
- ListView_SetItemState(list,li.iItem,LVIS_FOCUSED or LVIS_SELECTED,
- LVIS_FOCUSED or LVIS_SELECTED);
- result:=li.iItem;
- end
- else
- result:=-1;
+ TmpMacroList[i]^.flags:=TmpMacroList[i]^.flags and not ACF_FIRSTRUN;
+ li.lParam:=(li.lParam and (not $FFFF)) or i;
+ SendMessageW(wnd,LVM_SETITEMW,0,lparam(@li));
+ end;
+
+ EditMacroList.Free;
+ EditMacroList:=TmpMacroList;
end;
+
+ MacroList.Clear(ACF_REPLACED);
+ MacroList.Free;
+ MacroList:=EditMacroList.Clone;
end;
// Fill action type combobox
-procedure FillActTypeList(list:hwnd);
+function FillActTypeList(list:HWND):HWND;
var
cbei:TCOMBOBOXEXITEMW;
il:HIMAGELIST;
i:integer;
buf:array [0..127] of WideChar;
+ p:pActModule;
+ rc:TRECT;
+ dlg:HWND;
begin
- SendMessage(list,CB_RESETCONTENT,0,0);
il:=ImageList_Create(16,16,ILC_COLOR32 or ILC_MASK,0,1);
+ SendMessage(list,CB_RESETCONTENT,0,0);
- cbei.mask:=CBEIF_IMAGE or CBEIF_SELECTEDIMAGE or CBEIF_TEXT; //!!
- for i:=0 to ACT_MAXTYPE-1 do
+ FillChar(cbei,SizeOf(cbei),0);
+ cbei.mask:=CBEIF_IMAGE or CBEIF_SELECTEDIMAGE or CBEIF_TEXT or CBEIF_LPARAM;
+ p:=ModuleLink;
+ i:=0;
+ // initial action dialogs position
+ SetRect(rc,134,22,0,0);
+ dlg:=GetParent(list);
+ MapDialogRect(dlg,rc);
+ while p<>nil do
begin
- ImageList_AddIcon(il,CallService(MS_SKIN2_GETICON,0,lparam(ActIds[i].icon)));
+ StrCopy(StrCopyE(@buf,IcoLibPrefix),p^.Name);
+ ImageList_ReplaceIcon(il,-1,CallService(MS_SKIN2_GETICON,0,lparam(@buf)));
- cbei.pszText :=TranslateW(FastAnsiToWideBuf(ActIds[i].text,buf));
+ cbei.pszText :=TranslateW(FastAnsiToWideBuf(p^.Name,buf));
cbei.iItem :=i;
+ cbei.lParam :=p^.Hash;
cbei.iImage :=i;
cbei.iSelectedImage:=i;
- if SendMessageW(list,CBEM_INSERTITEMW,0,lparam(@cbei))=-1 then break;
+ if SendMessageW(list,CBEM_INSERTITEMW,0,lparam(@cbei))=-1 then
+ break;
+ p^.DlgHandle:=p^.Dialog(dlg);
+ SetWindowPos(p^.DlgHandle,0,rc.left,rc.top,0,0,SWP_NOZORDER or SWP_NOSIZE or SWP_HIDEWINDOW);
+ p:=p^.Next;
+ inc(i);
end;
ImageList_Destroy(SendMessage(list,CBEM_SETIMAGELIST,0,il));
+
SendMessage(list,CB_SETCURSEL,0,0);
+ result:=GetLink(CB_GetData(list,0))^.DlgHandle;
+end;
+
+//----- Action list stuff -----
+
+procedure SHActButtons(Dialog:HWND;mode:integer);
+begin
+ ShowWindow(GetDlgItem(Dialog,IDC_STAT_ACTION),mode);
+ ShowWindow(GetDlgItem(Dialog,IDC_ACTION_TYPE),mode);
+ if mode=SW_HIDE then
+ ClearDialogData;
end;
-procedure FillSubList(Dialog:hwnd);
+procedure CheckActListDirectionButtons(Dialog:HWND);
var
- list,wnd:HWND;
- i,act:integer;
- arr:array [0..127] of WideChar;
+ wnd:HWND;
+ dir:integer;
+ okup,okdown:boolean;
+begin
+ wnd:=ActionListWindow;
+
+ dir:=LV_CheckDirection(wnd);
+ okup :=odd(loword(dir));
+ okdown:=(loword(dir) and 2)<>0;
+
+ EnableWindow(GetDlgItem(Dialog,IDC_ACTION_UP ),okup);
+ EnableWindow(GetDlgItem(Dialog,IDC_ACTION_DOWN),okdown);
+ SendMessage(wnd,LVM_ENSUREVISIBLE,hiword(dir)-1,0);
+end;
+
+procedure CheckActListButtons(Dialog:HWND);
+var
+ mode:integer;
+ wnd:HWND;
+ b:boolean;
+begin
+ wnd:=ActionListWindow;
+ b:=SendMessage(wnd,LVM_GETITEMCOUNT,0,0)>0;
+ if b then
+{
+ ListView_SetItemState(wnd,next,
+ LVIS_FOCUSED or LVIS_SELECTED,
+ LVIS_FOCUSED or LVIS_SELECTED);
+}
+ mode:=SW_SHOW
+ else
+ mode:=SW_HIDE;
+
+ SHActButtons(Dialog,mode);
+
+ EnableWindow(wnd,b);
+ EnableWindow(GetDlgItem(Dialog,IDC_ACTION_HELP ),b);
+ EnableWindow(GetDlgItem(Dialog,IDC_GROUP_TEST ),b);
+ EnableWindow(GetDlgItem(Dialog,IDC_ACTION_DELETE),b);
+ EnableWindow(GetDlgItem(Dialog,IDC_ACTION_TYPE ),b);
+
+ CheckActListDirectionButtons(Dialog);
+end;
+
+// Fill dialog fields by choosen action
+procedure FillAction(Dialog:HWND;act:tBaseAction);
+var
+ p:pActModule;
+ i:LRESULT;
+ wnd:HWND;
+begin
+ if act<>nil then
+ begin
+ p:=GetLink(act.UID);
+ if p<>nil then
+ SendMessage(p^.DlgHandle,WM_ACT_SETVALUE,0,tlparam(act));
+ end
+ // for newly added and activated action
+ else
+ p:=ModuleLink;
+
+ if p<>nil then
+ begin
+ wnd:=GetDlgItem(Dialog,IDC_ACTION_TYPE);
+ i:=CB_SelectData(wnd,tlparam(p^.Hash));
+ ShowWindow(p^.DlgHandle,SW_SHOW);
+ // Saving "normal" action type
+ if p^.Hash>10 then
+ begin
+ SetWindowLongPtrW(wnd,GWLP_USERDATA,i);
+ end;
+ end;
+end;
+
+// Fill Chain list
+procedure FillActionList(Dialog:HWND;Macro:pMacroRecord);
+var
+ idx:integer;
+ wnd:HWND;
li:LV_ITEMW;
begin
- wnd:=GetDlgItem(Dialog,IDC_ADV_VAL2);
+ wnd:=ActionListWindow;
+ SendMessage(wnd,LVM_DELETEALLITEMS,0,0);
- SendMessage(wnd,CB_RESETCONTENT,0,0);
+ if (Macro<>nil) and (Macro^.ActionCount>0) then
+ begin
+ li.mask :=LVIF_TEXT or LVIF_PARAM;
+ li.iSubitem:=0;
+ idx:=0;
+ while idx<Macro^.ActionCount do
+ begin
+ li.pszText:=Macro^.ActionList^[idx].ActionDescr;
+ li.iItem :=idx;
+ li.lParam :=tlparam(Macro^.ActionList^[idx]);
+ SendMessageW(wnd,LVM_INSERTITEMW,0,tlparam(@li));
+ ListView_SetCheckState(wnd,idx,(Macro^.ActionList^[idx].flags and ACF_DISABLED)=0);
+ inc(idx);
+ end;
- list:=GetDlgItem(Dialog,IDC_ACTION_LIST);
- act:=SendMessageW(list,LVM_GETITEMCOUNT,0,0);
- i:=0;
+ Listview_SetItemState(wnd,0,
+ LVIS_FOCUSED or LVIS_SELECTED,
+ LVIS_FOCUSED or LVIS_SELECTED);
+
+ FillAction(Dialog,Macro^.ActionList^[0]);
+ end;
+ CheckActListButtons(Dialog);
+end;
+
+// change current action name ONLY IN LIST
+procedure ChangeActionName(Dialog:HWND; num:integer=-1;str:PWideChar=nil);
+var
+ li:LV_ITEMW;
+ wnd:HWND;
+ buf:array [0..127] of WideChar;
+begin
+ wnd:=ActionListWindow;
+ if num<0 then
+ li.iItem:=SendMessage(wnd,LVM_GETNEXTITEM,-1,LVNI_FOCUSED)
+
+ else
+ li.iItem:=num;
+ if li.iItem>=0 then
+ begin
+ li.iSubItem:=0;
+ // getting SubAction number
+ li.mask:=LVIF_PARAM;
+ SendMessage(wnd,LVM_GETITEM,0,tlparam(@li));
+
+ // changing to default name
+ if str=nil then
+ begin
+ str:=StrCopyEW(@buf,TranslateW('Action'));
+ str^:=' '; inc(str);
+ IntToStr(str,SendMessage(wnd,LVM_GETITEMCOUNT,0,0));
+ str:=@buf;
+ end;
+
+ li.mask :=LVIF_TEXT;
+ li.pszText:=str;
+ SendMessageW(wnd,LVM_SETITEMW,0,tlparam(@li));
+ end;
+end;
+
+procedure SaveAction(Dialog:HWND;listnum:integer;actptr:tBaseAction);
+var
+ wnd:HWND;
+// li:LV_ITEMW;
+// arr: array [0..255] of WideChar;
+ p:pActModule;
+begin
+ wnd:=GetDlgItem(Dialog,IDC_ACTION_TYPE);
+ p:=GetLink(CB_GetData(wnd));
+ if p^.Hash<10 then
+ begin
+ p:=GetLink(CB_GetData(wnd,GetWindowLongPtrW(wnd,GWLP_USERDATA)));
+ end;
+
+ wnd:=ActionListWindow;
+
+ if listnum<0 then
+ begin
+ listnum:=SendMessageW(wnd,LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
+ if listnum<0 then
+ exit;
+ actptr:=tBaseAction(LV_GetLParam(wnd,listnum));
+ end;
+
+ // changed existing action
+ if actptr<>nil then
+ begin
+ if (actptr.flags and ACF_INTRODUCED)<>0 then // new but changed
+ actptr.Free
+ else // old
+ actptr.flags:=actptr.flags or ACF_REPLACED;
+ end;
+
+ // Action saving
+ actptr:=p.Create;
+ SendMessage(p.DlgHandle,WM_ACT_SAVE,0,tlparam(actptr));
+ actptr.flags:=actptr.flags or ACF_INTRODUCED;
+{ maybe do it at full chain saving?
+
+ li.iItem :=listnum;
li.mask :=LVIF_TEXT;
li.iSubItem :=0;
li.pszText :=@arr;
li.cchTextMax:=SizeOf(arr) div SizeOf(WideChar);
- while i<act do
- begin
- li.iItem:=i;
- SendMessageW(list,LVM_GETITEMW,0,lparam(@li));
- SendMessageW(wnd,CB_ADDSTRING,0,lparam(PWideChar(@arr)));
- inc(i);
- end;
- SendMessage(wnd,CB_SETCURSEL,0,0);
+ SendDlgItemMessageW(Dialog,IDC_ACTION_LIST,LVM_GETITEMW,0,tlparam(@li));
+ StrDupW(actptr.ActionDescr,arr);
+
+ if ListView_GetCheckState(wnd,listnum)=0 then
+ actptr.flags:=actptr.flags or ACF_DISABLED;
+}
+ LV_SetLParam(wnd,tlparam(actptr),listnum);
end;
-procedure FillChainList(Dialog:hwnd);
+procedure BuildActionChain(Dialog:HWND;group:integer=-1);
var
+ item:integer;
wnd:HWND;
- i:integer;
-// num:integer;
+ idx:integer;
+ li:LV_ITEMW;
+ arr: array [0..255] of WideChar;
begin
- wnd:=GetDlgItem(Dialog,IDC_GROUP_LIST);
-// for current chain exclude
-// num:=SendDlgItemMessage(Dialog,IDC_ACTION_GROUP,LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
-
- SendMessage(wnd,CB_RESETCONTENT,0,0);
- SendMessage(wnd,CB_SETITEMDATA,
- SendMessageW(wnd,CB_ADDSTRING,0,lparam(TranslateW(NoChainText))),0);
- for i:=0 to NewMaxGroups-1 do
+ idx:=smallint(loword(LV_GetLParam(MacroListWindow,group)));
+ if idx>=0 then // we have macro to save
begin
- if (NewGroupList^[i].flags and (ACF_ASSIGNED or ACF_VOLATILE))=ACF_ASSIGNED then
+ SaveAction(Dialog,-1,nil);
+
+ with EditMacroList[idx]^ do
begin
- SendMessage(wnd,CB_SETITEMDATA,
- SendMessageW(wnd,CB_ADDSTRING,0,lparam(NewGroupList^[i].descr)),
- NewGroupList^[i].id);
+ if ActionCount>0 then
+ begin
+ ActionCount:=0;
+ FreeMem(ActionList);
+ ActionList:=nil;
+ end;
+ end;
+
+ wnd:=ActionListWindow;
+ with EditMacroList[idx]^ do
+ begin
+ ActionCount:=SendMessageW(wnd,LVM_GETITEMCOUNT,0,0);
+ if ActionCount>0 then // have some actions - need to build list
+ begin
+ // fix count for empty actions
+ item:=0;
+ idx:=0;
+ while item<ActionCount do
+ begin
+ // if created but not changed action (fools proof)
+ if LV_GetLParam(wnd,item)<>0 then
+ Inc(idx);
+ Inc(item);
+ end;
+ // if REAL amount to save>0 (macro not empty)
+ if idx>0 then
+ begin
+ GetMem(ActionList,SizeOf(tBaseAction)*idx);
+
+ li.mask :=LVIF_TEXT;
+ li.iSubItem :=0;
+ li.pszText :=@arr;
+ li.cchTextMax:=SizeOf(arr) div SizeOf(WideChar);
+
+ idx:=0;
+ for item:=0 to ActionCount-1 do
+ begin
+ ActionList^[idx]:=tBaseAction(LV_GetLParam(wnd,item));
+ if ActionList^[idx]<>nil then
+ begin
+ // set name and enabled/disabled flag
+ li.iItem:=item;
+ SendDlgItemMessageW(Dialog,IDC_ACTION_LIST,LVM_GETITEMW,0,tlparam(@li));
+ mFreeMem(ActionList^[idx].ActionDescr);
+ StrDupW(ActionList^[idx].ActionDescr,arr);
+
+ if ListView_GetCheckState(wnd,item)=0 then
+ ActionList^[idx].flags:=ActionList^[item].flags or ACF_DISABLED
+ else
+ ActionList^[idx].flags:=ActionList^[item].flags and not ACF_DISABLED;
+ inc(idx);
+ end;
+ end;
+ end;
+ ActionCount:=idx; // fix for empty actions
+ end;
end;
end;
end;
-// action group table procedure (key hook)
-function NewGroupTableProc(Dialog:HWnd;hMessage:uint;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+// action (chain) table procedure (key hook)
+function NewActTableProc(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
var
i:integer;
begin
@@ -200,37 +545,39 @@ begin PostMessageW(Dialog,LVM_EDITLABELW,i,0);
exit;
end;
- VK_INSERT: begin
- PostMessage(GetParent(Dialog),WM_COMMAND,(BN_CLICKED shl 16)+IDC_GROUP_NEW,0);
- exit;
- end;
- VK_DELETE: begin
- PostMessage(GetParent(Dialog),WM_COMMAND,(BN_CLICKED shl 16)+IDC_GROUP_DELETE,0);
- exit;
- end;
VK_UP: begin
if (GetKeyState(VK_CONTROL) and $8000)<>0 then
begin
- PostMessage(GetParent(Dialog),WM_COMMAND,(BN_CLICKED shl 16)+IDC_GROUP_UP,0);
+ PostMessage(GetParent(Dialog),WM_COMMAND,(BN_CLICKED shl 16)+IDC_ACTION_UP,0);
exit;
end;
end;
VK_DOWN: begin
if (GetKeyState(VK_CONTROL) and $8000)<>0 then
begin
- PostMessage(GetParent(Dialog),WM_COMMAND,(BN_CLICKED shl 16)+IDC_GROUP_DOWN,0);
+ PostMessage(GetParent(Dialog),WM_COMMAND,(BN_CLICKED shl 16)+IDC_ACTION_DOWN,0);
exit;
end;
end;
+ VK_INSERT: begin
+ PostMessage(GetParent(Dialog),WM_COMMAND,(BN_CLICKED shl 16)+IDC_ACTION_NEW,0);
+ exit;
+ end;
+ VK_DELETE: begin
+ PostMessage(GetParent(Dialog),WM_COMMAND,(BN_CLICKED shl 16)+IDC_ACTION_DELETE,0);
+ exit;
+ end;
end;
end;
end;
end;
- result:=CallWindowProc(OldGroupTableProc,Dialog,hMessage,wParam,lParam);
+ result:=CallWindowProc(OldActTableProc,Dialog,hMessage,wParam,lParam);
end;
-// action (chain) table procedure (key hook)
-function NewActTableProc(Dialog:HWnd;hMessage:uint;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
+//----- Macro list stuff -----
+
+// action group table procedure (key hook)
+function NewGroupTableProc(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
var
i:integer;
begin
@@ -246,197 +593,59 @@ begin PostMessageW(Dialog,LVM_EDITLABELW,i,0);
exit;
end;
+ VK_INSERT: begin
+ PostMessage(GetParent(Dialog),WM_COMMAND,(BN_CLICKED shl 16)+IDC_GROUP_NEW,0);
+ exit;
+ end;
+ VK_DELETE: begin
+ PostMessage(GetParent(Dialog),WM_COMMAND,(BN_CLICKED shl 16)+IDC_GROUP_DELETE,0);
+ exit;
+ end;
VK_UP: begin
if (GetKeyState(VK_CONTROL) and $8000)<>0 then
begin
- PostMessage(GetParent(Dialog),WM_COMMAND,(BN_CLICKED shl 16)+IDC_ACTION_UP,0);
+ PostMessage(GetParent(Dialog),WM_COMMAND,(BN_CLICKED shl 16)+IDC_GROUP_UP,0);
exit;
end;
end;
VK_DOWN: begin
if (GetKeyState(VK_CONTROL) and $8000)<>0 then
begin
- PostMessage(GetParent(Dialog),WM_COMMAND,(BN_CLICKED shl 16)+IDC_ACTION_DOWN,0);
+ PostMessage(GetParent(Dialog),WM_COMMAND,(BN_CLICKED shl 16)+IDC_GROUP_DOWN,0);
exit;
end;
end;
- VK_INSERT: begin
- PostMessage(GetParent(Dialog),WM_COMMAND,(BN_CLICKED shl 16)+IDC_ACTION_NEW,0);
- exit;
- end;
- VK_DELETE: begin
- PostMessage(GetParent(Dialog),WM_COMMAND,(BN_CLICKED shl 16)+IDC_ACTION_DELETE,0);
- exit;
- end;
end;
end;
end;
end;
- result:=CallWindowProc(OldActTableProc,Dialog,hMessage,wParam,lParam);
-end;
-
-// miranda button icon paint
-procedure SetButtonIcons2(Dialog:HWND);
-var
- ti:TTOOLINFOW;
- hwndTooltip: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);
-
- FillChar(ti,SizeOf(ti),0);
- ti.cbSize :=sizeof(TOOLINFO);
- ti.uFlags :=TTF_IDISHWND or TTF_SUBCLASS;
- ti.hwnd :=Dialog;
- ti.hinst :=hInstance;
-
- ti.uId :=GetDlgItem(Dialog,IDC_ACTION_HELP);
- ti.lpszText:=TranslateW('Help');
- SendMessage(ti.uId,BM_SETIMAGE,IMAGE_ICON,
- CallService(MS_SKIN_LOADICON,SKINICON_OTHER_HELP,0));
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
-
- ti.uId :=GetDlgItem(Dialog,IDC_ACTION_NEW);
- ti.lpszText:=TranslateW('New');
- SetButtonIcon(ti.uId,ACI_NEW);
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
-
- ti.uId :=GetDlgItem(Dialog,IDC_GROUP_NEW);
- SetButtonIcon(ti.uId,ACI_NEW);
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
-
- ti.uId :=GetDlgItem(Dialog,IDC_ACTION_UP);
- ti.lpszText:=TranslateW('Up');
- SetButtonIcon(ti.uId,ACI_UP);
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
-
- ti.uId :=GetDlgItem(Dialog,IDC_GROUP_UP);
- SetButtonIcon(ti.uId,ACI_UP);
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
-
- ti.uId :=GetDlgItem(Dialog,IDC_ACTION_DOWN);
- ti.lpszText:=TranslateW('Down');
- SetButtonIcon(ti.uId,ACI_DOWN);
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
-
- ti.uId :=GetDlgItem(Dialog,IDC_GROUP_DOWN);
- SetButtonIcon(ti.uId,ACI_DOWN);
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
-
- ti.uId :=GetDlgItem(Dialog,IDC_ACTION_DELETE);
- ti.lpszText:=TranslateW('Delete');
- SetButtonIcon(ti.uId,ACI_DELETE);
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
-
- ti.uId :=GetDlgItem(Dialog,IDC_GROUP_DELETE);
- SetButtonIcon(ti.uId,ACI_DELETE);
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
-
- ti.uId :=GetDlgItem(Dialog,IDC_GROUP_RELOAD);
- ti.lpszText:=TranslateW('Reload');
- SetButtonIcon(ti.uId,ACI_RELOAD);
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
-
- ti.uId :=GetDlgItem(Dialog,IDC_GROUP_TEST);
- ti.lpszText:=TranslateW('Test');
- SetButtonIcon(ti.uId,ACI_TEST);
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
-
- ti.uId :=GetDlgItem(Dialog,IDC_CNT_APPLY);
- ti.lpszText:=TranslateW('Apply format');
- SetButtonIcon(ti.uId,ACI_FORMAT);
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
-
- ti.uId :=GetDlgItem(Dialog,IDC_GROUP_IMPORT);
- ti.lpszText:=TranslateW('Import');
- SetButtonIcon(ti.uId,ACI_IMPORT);
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
-
- ti.uId :=GetDlgItem(Dialog,IDC_GROUP_EXPORT);
- ti.lpszText:=TranslateW('Export');
- SetButtonIcon(ti.uId,ACI_EXPORT);
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
-
- ti.lpszText:=TranslateW('Use Variables');
- ti.uId:=GetDlgItem(Dialog,IDC_SRV_WPAR);
- SetButtonIcon(ti.uId,ACI_VAR_UNCHECKED);
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
-
-{
- pc:=TranslateW('');
- wnd:=GetDlgItem(Dialog,IDC_NEW);
- SendMessage(hNew,BUTTONADDTOOLTIP,TWPARAM(pc),BATF_UNICODE);
- SetButtonIcon(wnd,QS_NEW);
-}
- ti.uId:=GetDlgItem(Dialog,IDC_SRV_LPAR);
- SetButtonIcon(ti.uId,ACI_VAR_UNCHECKED);
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
-
- ti.uId:=GetDlgItem(Dialog,IDC_SRV_SRVC);
- SetButtonIcon(ti.uId,ACI_VAR_UNCHECKED);
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
-
- ti.uId:=GetDlgItem(Dialog,IDC_PRG_PRG);
- SetButtonIcon(ti.uId,ACI_VAR_UNCHECKED);
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
-
- ti.uId:=GetDlgItem(Dialog,IDC_PRG_ARG);
- SetButtonIcon(ti.uId,ACI_VAR_UNCHECKED);
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
-
- ti.uId:=GetDlgItem(Dialog,IDC_TXT_FILE);
- SetButtonIcon(ti.uId,ACI_VAR_UNCHECKED);
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
-
- ti.uId:=GetDlgItem(Dialog,IDC_TXT_TEXT);
- SetButtonIcon(ti.uId,ACI_VAR_UNCHECKED);
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
-
- ti.uId:=GetDlgItem(Dialog,IDC_RW_MVAR);
- SetButtonIcon(ti.uId,ACI_VAR_UNCHECKED);
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
-
- ti.uId:=GetDlgItem(Dialog,IDC_RW_SVAR);
- SetButtonIcon(ti.uId,ACI_VAR_UNCHECKED);
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
-
- ti.uId:=GetDlgItem(Dialog,IDC_RW_TVAR);
- SetButtonIcon(ti.uId,ACI_VAR_UNCHECKED);
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
-
- ti.uId:=GetDlgItem(Dialog,IDC_MSG_TTL);
- SetButtonIcon(ti.uId,ACI_VAR_UNCHECKED);
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
-
- ti.uId:=GetDlgItem(Dialog,IDC_MSG_TXT);
- SetButtonIcon(ti.uId,ACI_VAR_UNCHECKED);
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
-
+ result:=CallWindowProc(OldGroupTableProc,Dialog,hMessage,wParam,lParam);
end;
-function MoveLVItem(list:HWND;num:integer;incr:integer):integer;
+function AddMacro(Dialog:HWND;MacroNum:cardinal):integer;
var
- li:LV_ITEM;
- buf:array [0..127] of WideChar;
+ li:LV_ITEMW;
+ list:HWND;
begin
- li.mask :=LVIF_PARAM+LVIF_STATE+LVIF_TEXT;
- li.iItem :=num;
- li.iSubItem :=0;
- li.StateMask :=dword(-1);
- li.pszText :=@buf;
- li.cchTextMax:=127;
- SendMessageW(list,LVM_GETITEMW,0,lparam(@li));
- SendMessageW(list,LVM_DELETEITEM,li.iItem,0);
- inc(li.iItem,incr);
-
- SendMessageW(list,LVM_INSERTITEMW,0,lparam(@li));
- SendMessageW(list,LVM_SETITEMSTATE,li.iItem,lparam(@li));
- result:=li.iItem;
+ with EditMacroList[MacroNum]^ do
+ begin
+ list:=MacroListWindow;
+ li.mask :=LVIF_PARAM+LVIF_TEXT;
+ li.iItem :=SendMessage(list,LVM_GETNEXTITEM,-1,LVNI_FOCUSED)+1;
+ li.iSubItem :=0;
+ li.lParam :=MacroNum;
+ li.pszText :=@descr;
+ li.iItem :=SendMessageW(list,LVM_INSERTITEMW,0,lparam(@li));
+ if li.iItem>0 then
+ dec(li.iItem);
+ ListView_SetItemState(list,li.iItem,
+ LVIS_FOCUSED or LVIS_SELECTED,
+ LVIS_FOCUSED or LVIS_SELECTED);
+ result:=li.iItem;
+ end;
end;
-function MoveGroup(list:HWND;num:integer=-1;incr:integer=0):integer;
+function MoveMacro(list:HWND;num:integer;incr:integer):integer;
var
i,j:integer;
begin
@@ -450,9 +659,8 @@ begin begin
if SendMessage(list,LVM_GETITEMSTATE,i,LVIS_SELECTED)<>0 then
begin
- if i=0 then break;
+ if i=0 then break; // first selected is first already, nothing to move
LV_MoveItem(list,incr,i);
-// MoveLVItem(list,i,incr);
if result<0 then result:=i+incr;
end;
end;
@@ -463,9 +671,8 @@ begin begin
if SendMessage(list,LVM_GETITEMSTATE,i,LVIS_SELECTED)<>0 then
begin
- if i=j then break;
+ if i=j then break; // last selected is last already, nothing to move
LV_MoveItem(list,incr,i);
-// MoveLVItem(list,i,incr);
if result<0 then result:=i+incr;
end;
end;
@@ -473,1066 +680,288 @@ begin end
else
begin
- MoveLVItem(list,num,incr);
+ LV_MoveItem(list,incr,num);
result:=num;
end;
end;
-{$include i_dlglists.inc}
-
-procedure SetNumValue(wnd:HWND;value:dword;isvar:boolean;ishex:boolean);
+// enable/disable navigation chain buttons
+procedure CheckMacroListDirectionButtons(Dialog:HWND);
var
- buf:array [0..31] of WideChar;
+ wnd:HWND;
+ dir:integer;
+ okup,okdown:boolean;
begin
- if isvar then
- SendMessageW(wnd,WM_SETTEXT,0,value)
- else if ishex then
- begin
- buf[0]:='$';
- IntToHex(PWideChar(@buf[1]),value);
- SendMessageW(wnd,WM_SETTEXT,0,tlparam(@buf));
- end
- else
- SendMessageW(wnd,WM_SETTEXT,0,tlparam(IntToStr(buf,value)));
+ wnd:=MacroListWindow;
+ dir:=LV_CheckDirection(wnd);
+ okup :=odd(loword(dir));
+ okdown:=(loword(dir) and 2)<>0;
+
+ EnableWindow(GetDlgItem(Dialog,IDC_GROUP_UP ),okup);
+ EnableWindow(GetDlgItem(Dialog,IDC_GROUP_DOWN),okdown);
+ SendMessage(wnd,LVM_ENSUREVISIBLE,hiword(dir)-1,0);
end;
-function DlgProcOpt2(Dialog:HWnd;hMessage:uint;wParam:WPARAM;lParam:LPARAM):lresult; stdcall;
-
- {$include i_visual.inc}
-
- procedure ShowHelp(code:integer);
- var
- buf:PAnsiChar;
- vhi:TVARHELPINFO;
- begin
- case code of
- hlpVariables: 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;
- hlpAdvVariables: begin
- FillChar(vhi,SizeOf(vhi),0);
- with vhi do
- begin
- cbSize :=SizeOf(vhi);
- flags :=VHF_FULLDLG or VHF_SETLASTSUBJECT;
- hwndCtrl :=GetDlgItem(Dialog,IDC_ADV_VARS);
- szSubjectDesc:='test your variables';
- end;
- CallService(MS_VARS_SHOWHELPEX,Dialog,tlparam(@vhi));
- end;
- hlpContact: begin
- MessageBoxW(0,
- TranslateW('Select contact to open its window'),
- TranslateW('Contacts'),0);
- end;
- hlpService: begin
- buf:=GetDlgText(Dialog,IDC_EDIT_SERVICE,true);
-//!! if buf<>nil then
- begin
- ApiCard.Service:=buf;
- mFreeMem(buf);
- ApiCard.Show;
- end;
- end;
- hlpProgram: begin
- MessageBoxW(0,
- TranslateW('Text <last> replacing'#13#10+
- 'by last result'#13#10#13#10+
- 'Text <param> replacing'#13#10+
- 'by parameter'),
- TranslateW('Text'),0);
- end;
- hlpText: begin
- MessageBoxW(0,
- TranslateW('^s - selected (and replaced) part'#13#10+
- '^e - replaced by empty string'#13#10+
- '^v - paste text from Clipboard'#13#10+
- '^t - replaced by tabulation'#13#10+
- '^l - replaced by last result as unicode'#13#10+
- '^h - replaced by last result as hex'#13#10+
- '^a - in the end: autosend'#13#10+
- '^f(name[,str])'#13#10+
- ' paste line from text file.'#13#10+
- ' brackets contents must be w/o spaces'),
- TranslateW('Text'),0);
- end;
- hlpAdvance: begin
- end;
- hlpChain: begin
- MessageBoxW(0,
- TranslateW('You can select another group from combobox, '+
- 'then it will be executed, after that current '+
- 'action group will be continued.'),
- TranslateW('Macros'),0);
- end;
- hlpDBRW: begin
- end;
- hlpMessage: begin
- MessageBoxW(0,
- TranslateW(
- 'Text <last> replacing'#13#10+
- 'by last result'#13#10#13#10+
- 'Returns:'#13#10+
- '--------'#13#10+
- 'OK'#9'= 1'#13#10+
- 'CANCEL'#9'= 2'#13#10+
- 'ABORT'#9'= 3'#13#10+
- 'RETRY'#9'= 4'#13#10+
- 'IGNORE'#9'= 5'#13#10+
- 'YES'#9'= 6'#13#10+
- 'NO'#9'= 7'#13#10+
- 'CLOSE'#9'= 8'),
- TranslateW('MessageBox'),0);
- end;
- end;
- end;
-
- // enable/disable navigation chain buttons
- procedure CheckGrpList(num:integer=-1);
- var
- wnd:HWND;
- dir:integer;
- okup,okdown:boolean;
- begin
- wnd:=GetDlgItem(Dialog,IDC_ACTION_GROUP);
-// if num<0 then
- begin
- dir:=LV_CheckDirection(wnd);
- okup :=odd(loword(dir));
- okdown:=(loword(dir) and 2)<>0;
- end;
-{
- else
- begin
- okup :=num>0;
- okdown:=(num+1)<SendMessage(wnd,LVM_GETITEMCOUNT,0,0);
- SendMessage(wnd,LVM_ENSUREVISIBLE,num,0);
- end;
-}
- EnableWindow(GetDlgItem(Dialog,IDC_GROUP_UP ),okup);
- EnableWindow(GetDlgItem(Dialog,IDC_GROUP_DOWN),okdown);
- SendMessage(wnd,LVM_ENSUREVISIBLE,hiword(dir)-1,0);
-(*
- wnd:=GetDlgItem(Dialog,IDC_ACTION_GROUP);
- if num<0 then
- num:=SendMessage(wnd,LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
- EnableWindow(GetDlgItem(Dialog,IDC_GROUP_UP),num>0);
- EnableWindow(GetDlgItem(Dialog,IDC_GROUP_DOWN),
- (num+1)<SendMessage(wnd,LVM_GETITEMCOUNT,0,0));
- SendMessage(wnd,LVM_ENSUREVISIBLE,num,0);
- result:=num;
-*)
- end;
- procedure CheckActList(num:integer=-1);
- var
- wnd:HWND;
- dir:integer;
- okup,okdown:boolean;
- begin
- wnd:=GetDlgItem(Dialog,IDC_ACTION_LIST);
-// if num<0 then
- begin
- dir:=LV_CheckDirection(wnd);
- okup :=odd(loword(dir));
- okdown:=(loword(dir) and 2)<>0;
- end;
-{
- else
- begin
- okup :=num>0;
- okdown:=(num+1)<SendMessage(wnd,LVM_GETITEMCOUNT,0,0);
- SendMessage(wnd,LVM_ENSUREVISIBLE,num,0);
- end;
-}
- EnableWindow(GetDlgItem(Dialog,IDC_ACTION_UP ),okup);
- EnableWindow(GetDlgItem(Dialog,IDC_ACTION_DOWN),okdown);
- SendMessage(wnd,LVM_ENSUREVISIBLE,hiword(dir)-1,0);
-(*
- wnd:=GetDlgItem(Dialog,IDC_ACTION_LIST);
- if num<0 then
- num:=SendMessage(wnd,LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
- EnableWindow(GetDlgItem(Dialog,IDC_ACTION_UP),num>0);
- EnableWindow(GetDlgItem(Dialog,IDC_ACTION_DOWN),
- (num+1)<SendMessage(wnd,LVM_GETITEMCOUNT,0,0));
- SendMessage(wnd,LVM_ENSUREVISIBLE,num,0);
-*)
- end;
-
- // change current action name (by type)
- procedure ChangeActionName(num:integer=-1;acttype:integer=0;str:PWideChar=nil);
- var
- li:LV_ITEMW;
- wnd:HWND;
- str1:pWideChar;
- begin
- wnd:=GetDlgItem(Dialog,IDC_ACTION_LIST);
- if num<0 then
- li.iItem:=SendMessage(wnd,LVM_GETNEXTITEM,-1,LVNI_FOCUSED)
- else
- li.iItem:=num;
- if li.iItem>=0 then
- begin
- li.iSubItem:=0;
- // getting SubAction number
- li.mask:=LVIF_PARAM;
- SendMessage(wnd,LVM_GETITEM,0,tlparam(@li));
-
- // changing to default name
- if str=nil then
- begin
- if num>=0 then // new item - screen only
- str1:=TranslateW(ActionNames[ACT_CONTACT])
- else // change action type
- begin
- str1:=NewActionList[li.lParam].descr;
- if str1=nil then // not in memory yet
- str1:=TranslateW(ActionNames[acttype])
- else
- exit;
- end;
- end
- else // rename
- begin
- str1:=str;
- mFreeMem(NewActionList[li.lParam].descr);
- StrDupW (NewActionList[li.lParam].descr,str);
- end;
-
-// screen
- li.mask :=LVIF_TEXT;
- li.pszText:=str1;
- SendMessageW(wnd,LVM_SETITEMW,0,tlparam(@li));
- end;
- end;
+procedure CheckMacroList(Dialog:HWND);
+var
+ wnd:HWND;
+ b:boolean;
+begin
+ wnd:=MacroListWindow;
- // Fill Chain list
- procedure MakeActionList(HK:pHKRecord);
- var
- i,idx:integer;
- wnd:HWND;
- li:LV_ITEMW;
- p:pWideChar;
- begin
- wnd:=GetDlgItem(Dialog,IDC_ACTION_LIST);
- SendMessage(wnd,LVM_DELETEALLITEMS,0,0);
+ b:=SendMessage(wnd,LVM_GETITEMCOUNT,0,0)>0;
+ if not b then
+ CheckActListButtons(Dialog);
- EnableWindow(GetDlgItem(Dialog,IDC_ACTION_UP),false);
- if (HK=nil) or (HK^.firstAction=0) then
- begin
- SHWindows;
- SHActButtons(SW_HIDE);
- EnableWindow(GetDlgItem(Dialog,IDC_ACTION_LIST ),false);
- EnableWindow(GetDlgItem(Dialog,IDC_GROUP_TEST ),false);
- EnableWindow(GetDlgItem(Dialog,IDC_ACTION_HELP ),false);
- EnableWindow(GetDlgItem(Dialog,IDC_ACTION_DELETE),false);
- EnableWindow(GetDlgItem(Dialog,IDC_ACTION_DOWN ),false);
- exit;
- end;
- SHActButtons(SW_SHOW);
+ EnableWindow(wnd,b);
+ EnableWindow(GetDlgItem(Dialog,IDC_ACTION_NEW ),b);
+ EnableWindow(GetDlgItem(Dialog,IDC_GROUP_DELETE),b);
+ EnableWindow(GetDlgItem(Dialog,IDC_GROUP_EXPORT),b);
- li.mask :=LVIF_TEXT or LVIF_PARAM;
- li.iSubitem:=0;
- i:=HK^.firstAction;
- idx:=0;
- repeat
- p:=NewActionList^[i].descr;
- if p=nil then
- p:=TranslateW(ActionNames[NewActionList^[i].actionType]);
- li.pszText:=p;
- li.iItem :=idx;
- li.lParam :=i;
- SendMessageW(wnd,LVM_INSERTITEMW,0,tlparam(@li));
- ListView_SetCheckState(wnd,idx,(NewActionList^[i].flags and ACF_DISABLED)=0);
+ CheckMacroListDirectionButtons(Dialog);
+end;
- i:=NewActionList^[i].next;
- inc(idx);
- until i=0;
+// Fill action group list and disable chain controls
+function FillMacroList(Dialog:HWND):integer;
+var
+ CurMacro:pMacroRecord;
+ i:integer;
+ list:HWND;
+ lvi:TLVITEMW;
+begin
+ SendDlgItemMessage(Dialog,IDC_ACTION_LIST,LVM_DELETEALLITEMS,0,0);
+ CheckActListButtons(Dialog);
- Listview_SetItemState(wnd,0,
- LVIS_FOCUSED or LVIS_SELECTED,
- LVIS_FOCUSED or LVIS_SELECTED);
- EnableWindow(GetDlgItem(Dialog,IDC_ACTION_LIST ),true);
- EnableWindow(GetDlgItem(Dialog,IDC_GROUP_TEST ),true);
- EnableWindow(GetDlgItem(Dialog,IDC_ACTION_HELP ),true);
- EnableWindow(GetDlgItem(Dialog,IDC_ACTION_DELETE),true);
- EnableWindow(GetDlgItem(Dialog,IDC_ACTION_DOWN),idx>1);
-// FillSubList(Dialog);
- FillAction(HK^.firstAction);
- CheckActList(0);
- end;
+ list:=MacroListWindow;
- procedure SaveAction(listnum,actnum:integer);
- var
- wnd:HWND;
- i:integer;
- tmp:pWideChar;
- arr: array [0..255] of WideChar;
- li:LV_ITEMW;
+ SendMessage(list,LVM_DELETEALLITEMS,0,0);
+ result:=-1;
+ if EditMacroList.Count>0 then
begin
- if (ChMask and ACTM_ACT)=0 then exit;
- ChMask:=ChMask and not ACTM_ACT;
- wnd:=GetDlgItem(Dialog,IDC_ACTION_LIST);
- if listnum<0 then
- begin
- listnum:=SendMessageW(wnd,LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
- if listnum<0 then
- exit;
- end;
- if actnum<0 then
- actnum:=LV_GetLParam(wnd,listnum);
- StrDupW(tmp,NewActionList^[actnum].descr); // keeping old name
- FreeAction(@NewActionList^[actnum]);
- with NewActionList^[actnum] do
+ CurMacro:=EditMacroList[0];
+ lvi.mask:=LVIF_TEXT+LVIF_PARAM;
+ lvi.iSubItem:=0;
+ for i:=0 to EditMacroList.Count-1 do
begin
- flags :=ACF_ASSIGNED;
- flags2:=0;
-
- descr:=tmp;
- if descr=nil then
+ if (CurMacro^.flags and ACF_ASSIGNED)<>0 then
begin
- li.iItem :=listnum;
- li.mask :=LVIF_TEXT;
- li.iSubItem :=0;
- li.pszText :=@arr;
- li.cchTextMax:=SizeOf(arr) div SizeOf(WideChar);
- SendDlgItemMessageW(Dialog,IDC_ACTION_LIST,LVM_GETITEMW,0,tlparam(@li));
- StrDupW(descr,arr);
- end;
-
- if ListView_GetCheckState(wnd,listnum)=0 then
- flags:=flags or ACF_DISABLED;
-
- actionType:=ActIds[SendDlgItemMessage(Dialog,IDC_ACTION_TYPE,CB_GETCURSEL,0,0)].code;
- case actionType of
- ACT_CONTACT: begin
- contact:=SendDlgItemMessage(Dialog,IDC_CONTACTLIST,CB_GETITEMDATA,
- SendDlgItemMessage(Dialog,IDC_CONTACTLIST,CB_GETCURSEL,0,0),0);
- if IsDlgButtonChecked(Dialog,IDC_CNT_KEEP)=BST_CHECKED then
- flags:=flags or ACF_KEEPONLY;
- end;
-
- ACT_SERVICE: begin
- if IsDlgButtonChecked(Dialog,IDC_SRV_WPAR)=BST_CHECKED then
- flags2:=flags2 or ACF2_SRV_WPAR;
- if IsDlgButtonChecked(Dialog,IDC_SRV_LPAR)=BST_CHECKED then
- flags2:=flags2 or ACF2_SRV_LPAR;
- if IsDlgButtonChecked(Dialog,IDC_SRV_SRVC)=BST_CHECKED then
- flags2:=flags2 or ACF2_SRV_SRVC;
-
- case CB_GetData(GetDlgItem(Dialog,IDC_FLAG_WPAR)) of
- ptParam: begin
- flags:=flags or ACF_WPARAM
- end;
- ptResult: begin
- flags:=flags or ACF_WRESULT
- end;
- ptCurrent: begin
- flags:=flags or ACF_WPARNUM or ACF_WCURRENT
- end;
- ptNumber: begin
- flags:=flags or ACF_WPARNUM;
- if GetNumValue(GetDlgItem(Dialog,IDC_EDIT_WPAR),
- (flags2 and ACF2_SRV_WPAR)<>0,wparam) then
- flags2:=flags2 or ACF2_SRV_WHEX;
-// wparam:=GetDlgItemInt(Dialog,IDC_EDIT_WPAR,pbool(nil)^,true);
- end;
- ptStruct: begin
- flags:=flags or ACF_WSTRUCT;
- StrDup(pAnsiChar(wparam),wstruct);
- end;
- ptUnicode: begin
- flags:=flags or ACF_WUNICODE;
- pointer(wparam):=GetDlgText(Dialog,IDC_EDIT_WPAR);
- end;
- ptString: pointer(wparam):=GetDlgText(Dialog,IDC_EDIT_WPAR,true);
- end;
-
- case CB_GetData(GetDlgItem(Dialog,IDC_FLAG_LPAR)) of
- ptParam: begin
- flags:=flags or ACF_LPARAM
- end;
- ptResult: begin
- flags:=flags or ACF_LRESULT
- end;
- ptCurrent: begin
- flags:=flags or ACF_LPARNUM or ACF_LCURRENT
- end;
- ptNumber: begin
- flags:=flags or ACF_LPARNUM;
- if GetNumValue(GetDlgItem(Dialog,IDC_EDIT_LPAR),
- (flags2 and ACF2_SRV_LPAR)<>0,lparam) then
- flags2:=flags2 or ACF2_SRV_LHEX;
-// lparam:=GetDlgItemInt(Dialog,IDC_EDIT_LPAR,pbool(nil)^,true);
- end;
- ptStruct: begin
- flags:=flags or ACF_LSTRUCT;
- StrDup(pAnsiChar(lparam),lstruct);
- end;
- ptUnicode: begin
- flags:=flags or ACF_LUNICODE;
- pointer(lparam):=GetDlgText(Dialog,IDC_EDIT_LPAR);
- end;
- ptString: pointer(lparam):=GetDlgText(Dialog,IDC_EDIT_LPAR,true);
- end;
-
- if IsDlgButtonChecked(Dialog,IDC_RES_INSERT)=BST_CHECKED then
- flags:=flags or ACF_INSERT;
- if IsDlgButtonChecked(Dialog,IDC_RES_MESSAGE)=BST_CHECKED then
- flags:=flags or ACF_MESSAGE;
- if IsDlgButtonChecked(Dialog,IDC_RES_POPUP)=BST_CHECKED then
- flags:=flags or ACF_POPUP;
-
- case CB_GetData(GetDlgItem(Dialog,IDC_SRV_RESULT)) of
- sresHex: flags:=flags or ACF_HEX;
- sresInt: begin
- if IsDlgButtonChecked(Dialog,IDC_RES_SIGNED)=BST_CHECKED then
- flags:=flags or ACF_SIGNED;
- end;
- sresString: begin
- flags:=flags or ACF_STRING;
- if IsDlgButtonChecked(Dialog,IDC_RES_UNICODE)=BST_CHECKED then
- flags:=flags or ACF_UNICODE;
- if IsDlgButtonChecked(Dialog,IDC_RES_FREEMEM)=BST_CHECKED then
- flags2:=flags2 or ACF2_FREEMEM;
- end;
- sresStruct: flags:=flags or ACF_STRUCT;
- end;
-
- service:=GetDlgText(Dialog,IDC_EDIT_SERVICE,true);
-
- end;
-
- ACT_PROGRAM: begin
- prgname:=GetDlgText(Dialog,IDC_EDIT_PRGPATH);
- args:=GetDlgText(Dialog,IDC_EDIT_PRGARGS);
- if IsDlgButtonChecked(Dialog,IDC_FLAG_PARALLEL)=BST_CHECKED then
- flags:=flags or ACF_PRTHREAD;
- if IsDlgButtonChecked(Dialog,IDC_FLAG_CURPATH)=BST_CHECKED then
- flags:=flags or ACF_CURPATH;
- time:=GetDlgItemInt(Dialog,IDC_EDIT_PROCTIME,pbool(nil)^,false);
- if IsDlgButtonChecked(Dialog,IDC_FLAG_MINIMIZE)=BST_CHECKED then
- show:=SW_SHOWMINIMIZED
- else if IsDlgButtonChecked(Dialog,IDC_FLAG_MAXIMIZE)=BST_CHECKED then
- show:=SW_SHOWMAXIMIZED
- else if IsDlgButtonChecked(Dialog,IDC_FLAG_HIDDEN)=BST_CHECKED then
- show:=SW_HIDE
- else //if IsDlgButtonChecked(Dialog,IDC_FLAG_NORMAL)=BST_CHECKED then
- show:=SW_SHOWNORMAL;
-
- if IsDlgButtonChecked(Dialog,IDC_PRG_PRG)=BST_CHECKED then
- flags2:=flags2 or ACF2_PRG_PRG;
- if IsDlgButtonChecked(Dialog,IDC_PRG_ARG)=BST_CHECKED then
- flags2:=flags2 or ACF2_PRG_ARG;
- end;
-
- ACT_TEXT: begin
- if IsDlgButtonChecked(Dialog,IDC_FLAG_CLIP)<>BST_UNCHECKED then
- begin
- flags:=flags or ACF_CLIPBRD;
- if IsDlgButtonChecked(Dialog,IDC_CLIP_COPYTO)<>BST_UNCHECKED then
- flags:=flags or ACF_COPYTO;
- end
- else
- begin
- if IsDlgButtonChecked(Dialog,IDC_TXT_TEXT)=BST_CHECKED then
- flags2:=flags2 or ACF2_TXT_TEXT;
- text:=GetDlgText(Dialog,IDC_EDIT_INSERT);
- if IsDlgButtonChecked(Dialog,IDC_FLAG_FILE)<>BST_UNCHECKED then
- begin
- flags:=flags or ACF_FILE;
- case CB_GetData(GetDlgItem(Dialog,IDC_FILE_ENC)) of
- 0: flags:=flags or ACF_ANSI;
- 1: flags:=flags or ACF_UTF8;
- 2: flags:=flags or ACF_UTF8 or ACF_SIGN;
- 3: flags:=flags or 0;
- 4: flags:=flags or ACF_SIGN;
- end;
-
- if IsDlgButtonChecked(Dialog,IDC_TXT_FILE)=BST_CHECKED then
- flags2:=flags2 or ACF2_TXT_FILE;
- tfile:=GetDlgText(Dialog,IDC_FILE_PATH);
- if IsDlgButtonChecked(Dialog,IDC_FILE_APPEND)<>BST_UNCHECKED then
- flags:=flags or ACF_FAPPEND
- else if IsDlgButtonChecked(Dialog,IDC_FILE_WRITE)<>BST_UNCHECKED then
- flags:=flags or ACF_FWRITE;
- end;
- end;
- end;
-
- ACT_ADVANCE: begin
- condition:=ADV_COND_NOP;
- if IsDlgButtonChecked(Dialog,IDC_FLAG_GT )=BST_CHECKED then
- condition:=ADV_COND_GT
- else if IsDlgButtonChecked(Dialog,IDC_FLAG_LT )=BST_CHECKED then
- condition:=ADV_COND_LT
- else if IsDlgButtonChecked(Dialog,IDC_FLAG_EQ )=BST_CHECKED then
- condition:=ADV_COND_EQ;
- value:=GetDlgItemInt(Dialog,IDC_ADV_VALUE,pbool(nil)^,false);
-
- if IsDlgButtonChecked(Dialog,IDC_FLAG_NOT)=BST_CHECKED then
- condition:=condition or ADV_COND_NOT;
-
- if IsDlgButtonChecked(Dialog,IDC_FLAG_BREAK)=BST_CHECKED then
- action:=ADV_ACT_BREAK
- else if IsDlgButtonChecked(Dialog,IDC_FLAG_JUMP )=BST_CHECKED then
- action:=ADV_ACT_JUMP
- else
- action:=ADV_ACT_NOP;
-
- case action of
- ADV_ACT_JUMP: operval:=GetDlgText(Dialog,IDC_ADV_VAL2);
- end;
-
- if IsDlgButtonChecked(Dialog,IDC_FLAG_VARS)<>BST_UNCHECKED then
- begin
- varval:=GetDlgText(Dialog,IDC_ADV_VARS);
- action:=action or ADV_ACT_VARS;
- if IsDlgButtonChecked(Dialog,IDC_ADV_ASINT)<>BST_UNCHECKED then
- flags:=flags or ACF_VARASINT;
- end
-;{//!!executively!!
- else }if IsDlgButtonChecked(Dialog,IDC_FLAG_MATH)=BST_CHECKED then
- begin
- mathval:=GetDlgItemInt(Dialog,IDC_ADV_VAL1,pbool(nil)^,true);
- action :=action or ADV_ACT_MATH;
- oper :=CB_GetData(GetDlgItem(Dialog,IDC_ADV_OPER));
-// oper :=SendDlgItemMessage(Dialog,IDC_ADV_OPER,CB_GETCURSEL,0,0);
- end;
- end;
-
- ACT_CHAIN: begin
- wnd:=GetDlgItem(Dialog,IDC_GROUP_LIST);
- i:=SendMessage(wnd,CB_GETCURSEL,0,0);
- if i>0 then
- id:=SendMessage(wnd,CB_GETITEMDATA,i,0)
- else
- id:=0;
- end;
-
- ACT_RW: begin
- if IsDlgButtonChecked(Dialog,IDC_RW_CURRENT)=BST_CHECKED then
- flags:=flags or ACF_CURRENT
- else if IsDlgButtonChecked(Dialog,IDC_RW_RESULT)=BST_CHECKED then
- flags:=flags or ACF_RESULT
- else if IsDlgButtonChecked(Dialog,IDC_RW_PARAM)=BST_CHECKED then
- flags:=flags or ACF_PARAM
- else
- dbcontact:=SendDlgItemMessage(Dialog,IDC_CONTACTLIST,CB_GETITEMDATA,
- SendDlgItemMessage(Dialog,IDC_CONTACTLIST,CB_GETCURSEL,0,0),0);
- dbmodule :=GetDlgText(Dialog,IDC_RW_MODULE ,true);
- dbsetting:=GetDlgText(Dialog,IDC_RW_SETTING,true);
- if IsDlgButtonChecked(Dialog,IDC_RW_MVAR)=BST_CHECKED then
- flags2:=flags2 or ACF2_RW_MVAR;
- if IsDlgButtonChecked(Dialog,IDC_RW_SVAR)=BST_CHECKED then
- flags2:=flags2 or ACF2_RW_SVAR;
-
- if IsDlgButtonChecked(Dialog,IDC_RW_WRITE)=BST_CHECKED then
- flags:=flags or ACF_DBWRITE
- else if IsDlgButtonChecked(Dialog,IDC_RW_DELETE)=BST_CHECKED then
- flags:=flags or ACF_DBDELETE;
-
- if IsDlgButtonChecked(Dialog,IDC_RW_LAST)=BST_CHECKED then
- flags:=flags or ACF_LAST;
-
- if IsDlgButtonChecked(Dialog,IDC_RW_TVAR)=BST_CHECKED then
- flags2:=flags2 or ACF2_RW_TVAR;
-
- i:=CB_GetData(GetDlgItem(Dialog,IDC_RW_DATATYPE));
- case i of
- 0: flags:=flags or ACF_DBBYTE;
- 1: flags:=flags or ACF_DBWORD;
- 2: flags:=flags or 0;
- 3: flags:=flags or ACF_DBANSI;
- 4: flags:=flags or ACF_DBUTEXT;
- end;
- if i<3 then
- begin
- if (flags and ACF_LAST)=0 then
- begin
- if GetNumValue(GetDlgItem(Dialog,IDC_RW_VALUE),
- (flags2 and ACF2_RW_TVAR)<>0,dbvalue) then
- flags2:=flags2 or ACF2_RW_HEX;
- end;
- end
- else
- begin
- if (flags and ACF_LAST)=0 then
- pWideChar(dbvalue):=GetDlgText(Dialog,IDC_RW_TEXT);
- end;
-
- if (IsDlgButtonChecked(Dialog,IDC_RW_LAST)=BST_CHECKED) or
- ((flags and ACF_LAST)<>0) then
- flags:=flags or ACF_LAST;
- end;
+ lvi.iItem :=i;
- ACT_MESSAGE: begin
- pWideChar(msgtitle):=GetDlgText(Dialog,IDC_MSG_TITLE);
- pWideChar(msgtext ):=GetDlgText(Dialog,IDC_MSG_TEXT);
- if IsDlgButtonChecked(Dialog,IDC_MSG_KEEP)=BST_CHECKED then
- flags:=flags or ACF_MSG_KEEP;
- if IsDlgButtonChecked(Dialog,IDC_MSG_TTL)=BST_CHECKED then
- flags2:=flags2 or ACF2_MSG_TTL;
- if IsDlgButtonChecked(Dialog,IDC_MSG_TXT)=BST_CHECKED then
- flags2:=flags2 or ACF2_MSG_TXT;
-
- if IsDlgButtonChecked(Dialog,IDC_MSGB_OC )=BST_CHECKED then boxopts:=MB_OKCANCEL
- else if IsDlgButtonChecked(Dialog,IDC_MSGB_ARI)=BST_CHECKED then boxopts:=MB_ABORTRETRYIGNORE
- else if IsDlgButtonChecked(Dialog,IDC_MSGB_YNC)=BST_CHECKED then boxopts:=MB_YESNOCANCEL
- else if IsDlgButtonChecked(Dialog,IDC_MSGB_YN )=BST_CHECKED then boxopts:=MB_YESNO
- else if IsDlgButtonChecked(Dialog,IDC_MSGB_RC )=BST_CHECKED then boxopts:=MB_RETRYCANCEL
- else{if IsDlgButtonChecked(Dialog,IDC_MSGB_OK )=BST_CHECKED then}boxopts:=MB_OK;
-
- if IsDlgButtonChecked(Dialog,IDC_MSGI_ERROR)=BST_CHECKED then boxopts:=boxopts or MB_ICONHAND
- else if IsDlgButtonChecked(Dialog,IDC_MSGI_QUEST)=BST_CHECKED then boxopts:=boxopts or MB_ICONQUESTION
- else if IsDlgButtonChecked(Dialog,IDC_MSGI_WARN )=BST_CHECKED then boxopts:=boxopts or MB_ICONWARNING
- else if IsDlgButtonChecked(Dialog,IDC_MSGI_INFO )=BST_CHECKED then boxopts:=boxopts or MB_ICONINFORMATION
- ;//else if IsDlgButtonChecked(Dialog,IDC_MSGI_NONE)=BST_CHECKED then ;
- end;
+ lvi.lParam:=i;
+ if (CurMacro^.flags and ACF_FIRSTRUN)<>0 then
+ lvi.lParam:=lvi.lParam or ACF_FIRSTRUN;
+ lvi.pszText:=@(CurMacro^.descr);
+ SendMessageW(list,LVM_INSERTITEMW,0,tlparam(@lvi));
+ inc(result);
end;
+ inc(CurMacro);
end;
end;
- procedure BuildActionChain(group:integer=-1);
- var
- i,j,item:integer;
- wnd:HWND;
- act:pHKAction;
- idx:integer;
- begin
- if (ChMask and ACTM_ACTS)=0 then exit;
- ChMask:=ChMask and not ACTM_ACTS;
- SaveAction(-1,-1);
- wnd:=GetDlgItem(Dialog,IDC_ACTION_LIST);
- i:=SendMessageW(wnd,LVM_GETITEMCOUNT,0,0);
- idx:=LV_GetLParam(GetDlgItem(Dialog,IDC_ACTION_GROUP),group);
- if i>0 then
- begin
- j:=LV_GetLParam(wnd,0);
- NewGroupList^[idx].firstAction:=j;
- act:=@NewActionList^[j];
- for item:=1 to i-1 do
- begin
- j:=LV_GetLParam(wnd,item);
- act^.next:=j;
- act:=@NewActionList^[j];
- end;
- act^.next:=0;
- end
- else
- begin
- if idx>=0 then
- NewGroupList^[idx].firstAction:=0;
- end;
- end;
+ CheckMacroList(Dialog);
+//?? SendMessage(list,CB_SETCURSEL,0,0);
+ SendMessage(list,LVM_SETCOLUMNWIDTH,0,LVSCW_AUTOSIZE_USEHEADER);
- procedure CheckActionList(next:integer);
- var
- i:integer;
- wnd:HWND;
- begin
- wnd:=GetDlgItem(Dialog,IDC_ACTION_LIST);
- i:=SendMessage(wnd,LVM_GETITEMCOUNT,0,0);
- if i>0 then
- begin
- EnableWindow(GetDlgItem(Dialog,IDC_ACTION_HELP),true);
- if next=i then
- dec(next);
- ListView_SetItemState(wnd,next,
- LVIS_FOCUSED or LVIS_SELECTED,
- LVIS_FOCUSED or LVIS_SELECTED);
- end
- else
- begin
- SHWindows;
- SHActButtons(SW_HIDE);
- EnableWindow(wnd,false);
- EnableWindow(GetDlgItem(Dialog,IDC_ACTION_HELP ),false);
- EnableWindow(GetDlgItem(Dialog,IDC_GROUP_TEST ),false);
- EnableWindow(GetDlgItem(Dialog,IDC_ACTION_DELETE),false);
- next:=0;
- end;
- CheckActList(next);
- end;
+ ListView_SetItemState(list,0,
+ LVIS_FOCUSED or LVIS_SELECTED,
+ LVIS_FOCUSED or LVIS_SELECTED);
+end;
- procedure CheckGroupList(next:integer);
- var
- i:integer;
- wnd:HWND;
- li:LV_ITEMW;
- begin
- wnd:=GetDlgItem(Dialog,IDC_ACTION_GROUP);
- i:=SendMessage(wnd,LVM_GETITEMCOUNT,0,0);
- if i>0 then
- begin
- if next=i then
- dec(next);
- ListView_SetItemState(wnd,next,LVIS_FOCUSED or LVIS_SELECTED,
- LVIS_FOCUSED or LVIS_SELECTED);
- li.iItem :=next;
- li.iSubItem:=0;
- li.mask :=LVIF_PARAM;
- SendMessage(wnd,LVM_GETITEM,0,tlparam(@li));
- end
- else
- begin
- EnableWindow(wnd,false);
- EnableWindow(GetDlgItem(Dialog,IDC_GROUP_DELETE),false);
- CheckActionList(0);
- EnableWindow(GetDlgItem(Dialog,IDC_ACTION_NEW),false);
- end;
- CheckGrpList(next);
- end;
+//----- Other stuff -----
- // Fill action group list and disable chain controls
- function FillGroupList{(Dialog:hwnd)}:integer;
- var
- CurGroup:pHKRecord;
- i:integer;
- list:HWND;
- lvi:TLVITEMW;
- begin
- SendDlgItemMessage(Dialog,IDC_ACTION_LIST,LVM_DELETEALLITEMS,0,0);
- CheckActionList(-1);
- list:=GetDlgItem(Dialog,IDC_ACTION_GROUP);
+procedure SetButtonIcons2(Dialog:HWND);
+var
+ ti:TTOOLINFOW;
+ hwndTooltip: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);
- SendMessage(list,LVM_DELETEALLITEMS,0,0);
- CurGroup:=@NewGroupList^;
- result:=-1;
- lvi.mask:=LVIF_TEXT+LVIF_PARAM;
- lvi.iSubItem:=0;
- for i:=0 to NewMaxGroups-1 do
- begin
- if (CurGroup^.flags and ACF_ASSIGNED)<>0 then
- begin
- lvi.iItem :=i;
- lvi.lParam:=i;
- if CurGroup^.descr=nil then
- lvi.pszText:=NoDescription
- else
- lvi.pszText:=CurGroup^.descr;
- SendMessageW(list,LVM_INSERTITEMW,0,tlparam(@lvi));
- inc(result);
- end;
- inc(CurGroup);
- end;
+ FillChar(ti,SizeOf(ti),0);
+ ti.cbSize :=sizeof(TOOLINFO);
+ ti.uFlags :=TTF_IDISHWND or TTF_SUBCLASS;
+ ti.hwnd :=Dialog;
+ ti.hinst :=hInstance;
- EnableWindow(GetDlgItem(Dialog,IDC_ACTION_GROUP ),result>=0);
- EnableWindow(GetDlgItem(Dialog,IDC_ACTION_LIST ),result>=0);
- EnableWindow(GetDlgItem(Dialog,IDC_ACTION_NEW ),result>=0);
- EnableWindow(GetDlgItem(Dialog,IDC_GROUP_DELETE ),result>=0);
- if result<0 then
- begin
- EnableWindow(GetDlgItem(Dialog,IDC_GROUP_TEST ),false);
- EnableWindow(GetDlgItem(Dialog,IDC_ACTION_HELP ),false);
- EnableWindow(GetDlgItem(Dialog,IDC_ACTION_DELETE),false);
- EnableWindow(GetDlgItem(Dialog,IDC_ACTION_UP ),false);
- EnableWindow(GetDlgItem(Dialog,IDC_ACTION_DOWN ),false);
- EnableWindow(GetDlgItem(Dialog,IDC_STAT_GROUPS ),false);
- EnableWindow(GetDlgItem(Dialog,IDC_ACTION_TYPE ),false);
- end
- else
- result:=0;
- SendMessage(list,CB_SETCURSEL,0,0);
- SendMessage(list,LVM_SETCOLUMNWIDTH,0,LVSCW_AUTOSIZE_USEHEADER);
-
- ListView_SetItemState(list,0,
- LVIS_FOCUSED or LVIS_SELECTED,
- LVIS_FOCUSED or LVIS_SELECTED);
- end;
+ ti.uId :=GetDlgItem(Dialog,IDC_ACTION_HELP);
+ ti.lpszText:=TranslateW('Help');
+ SendMessage(ti.uId,BM_SETIMAGE,IMAGE_ICON,
+ CallService(MS_SKIN_LOADICON,SKINICON_OTHER_HELP,0));
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
+
+ ti.uId :=GetDlgItem(Dialog,IDC_ACTION_NEW);
+ ti.lpszText:=TranslateW('New');
+ OptSetButtonIcon(ti.uId,ACI_NEW);
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
+{
+ hNew:=GetDlgItem(Dialog,IDC_NEW);
+ SendMessage (hNew,BUTTONADDTOOLTIP,TWPARAM(TranslateW('New')),BATF_UNICODE);
+ OptSetButtonIcon(hNew,ACI_NEW);
+}
- procedure SHMath(show:boolean);
- var
- wnd:HWND;
- begin
- EnableWindow(GetDlgItem(Dialog,IDC_ADV_ASINT),not show);
- EnableWindow(GetDlgItem(Dialog,IDC_ADV_VARS ),not show);
+ ti.uId :=GetDlgItem(Dialog,IDC_GROUP_NEW);
+ OptSetButtonIcon(ti.uId,ACI_NEW);
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
- wnd:=GetDlgItem(Dialog,IDC_ADV_OPER);
- EnableWindow(wnd,show);
- EnableWindow(GetDlgItem(Dialog,IDC_ADV_VAL1),
- show and (CB_GetData(wnd)<>lresult(aeNot)));//(SendMessage(wnd,CB_GETCURSEL,0,0)<>0));
- end;
+ ti.uId :=GetDlgItem(Dialog,IDC_ACTION_UP);
+ ti.lpszText:=TranslateW('Up');
+ OptSetButtonIcon(ti.uId,ACI_UP);
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
- procedure SetMBRadioIcon(h:THANDLE;id:dword;icon:uint_ptr);
- begin
- SendDlgItemMessage(Dialog,id,BM_SETIMAGE,IMAGE_ICON,
- LoadImage(h,MAKEINTRESOURCE(icon),IMAGE_ICON,16,16,0{LR_SHARED}));
- // SendDlgItemMessage(Dialog,id,BM_SETIMAGE,IMAGE_ICON,LoadIcon(0,icon));
- end;
+ ti.uId :=GetDlgItem(Dialog,IDC_GROUP_UP);
+ OptSetButtonIcon(ti.uId,ACI_UP);
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
- procedure SetMBRadioIcons;
- var
- h:THANDLE;
- begin
- h:=LoadLibrary('user32.dll');
- // SetMBRadioIcon(IDC_MSGI_NONE,IDI_); //?
- SetMBRadioIcon(h,IDC_MSGI_ERROR,103{IDI_HAND});
- SetMBRadioIcon(h,IDC_MSGI_QUEST,102{IDI_QUESTION});
- SetMBRadioIcon(h,IDC_MSGI_WARN ,101{IDI_EXCLAMATION});
- SetMBRadioIcon(h,IDC_MSGI_INFO ,104{IDI_ASTERISK});
- FreeLibrary(h);
- end;
+ ti.uId :=GetDlgItem(Dialog,IDC_ACTION_DOWN);
+ ti.lpszText:=TranslateW('Down');
+ OptSetButtonIcon(ti.uId,ACI_DOWN);
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
- procedure FillFileName(idc:integer);
- var
- pw,ppw:pWideChar;
- begin
- mGetMem(pw,1024*SizeOf(WideChar));
- ppw:=GetDlgText(Dialog,idc);
- if ShowDlgW(pw,ppw) then
- SetDlgItemTextW(Dialog,idc,pw);
- mFreeMem(ppw);
- mFreeMem(pw);
- end;
+ ti.uId :=GetDlgItem(Dialog,IDC_GROUP_DOWN);
+ OptSetButtonIcon(ti.uId,ACI_DOWN);
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
+
+ ti.uId :=GetDlgItem(Dialog,IDC_ACTION_DELETE);
+ ti.lpszText:=TranslateW('Delete');
+ OptSetButtonIcon(ti.uId,ACI_DELETE);
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
+ ti.uId :=GetDlgItem(Dialog,IDC_GROUP_DELETE);
+ OptSetButtonIcon(ti.uId,ACI_DELETE);
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
+{
+ ti.uId :=GetDlgItem(Dialog,IDC_GROUP_RELOAD);
+ ti.lpszText:=TranslateW('Reload');
+ OptSetButtonIcon(ti.uId,ACI_RELOAD);
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
+}
+ ti.uId :=GetDlgItem(Dialog,IDC_GROUP_TEST);
+ ti.lpszText:=TranslateW('Test');
+ OptSetButtonIcon(ti.uId,ACI_TEST);
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
+{!!
+ ti.uId :=GetDlgItem(Dialog,IDC_GROUP_IMPORT);
+ ti.lpszText:=TranslateW('Import');
+ OptSetButtonIcon(ti.uId,ACI_IMPORT);
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
+
+ ti.uId :=GetDlgItem(Dialog,IDC_GROUP_EXPORT);
+ ti.lpszText:=TranslateW('Export');
+ OptSetButtonIcon(ti.uId,ACI_EXPORT);
+ SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
+}
+end;
+
+function DlgProcOpt2(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
var
- wnd,wnd1,wnd2:HWND;
- i,j:int_ptr;
+ wnd:HWND;
+ p:pActModule;
+ i,j,num:int_ptr;
lvflag:integer;
- pc:pAnsiChar;
li:LV_ITEMW;
lv:LV_COLUMNW;
- b:boolean;
- ico:HICON;
begin
result:=0;
case hMessage of
WM_DESTROY: begin
- ApiCard.Free;
SetCancel;
- mFreeMem(wstruct);
- mFreeMem(lstruct);
end;
WM_INITDIALOG: begin
- ApiCard:=CreateServiceCard(Dialog);
- wstruct:=nil;
- lstruct:=nil;
SetStart;
DontReact :=true;
- SHWindows;
+ // variant - put after all dialogs adds (to translate them too)
TranslateDialogDefault(Dialog);
+ // For some actions
+ MacroListWindow :=GetDlgItem(Dialog,IDC_MACRO_LIST);
+ ActionListWindow:=GetDlgItem(Dialog,IDC_ACTION_LIST);
+
SetButtonIcons2(Dialog);
- wnd:=GetDlgItem(Dialog,IDC_ACTION_LIST);
+ wnd:=ActionListWindow;
SendMessage(wnd,LVM_SETEXTENDEDLISTVIEWSTYLE,LVS_EX_CHECKBOXES,LVS_EX_CHECKBOXES);
SendMessage(wnd,LVM_SETUNICODEFORMAT,1,0);
- zeromemory(@lv,sizeof(lv));
+ FillChar(lv,SizeOf(lv),0);
lv.mask:=LVCF_WIDTH;
lv.cx :=110;
SendMessageW(wnd,LVM_INSERTCOLUMNW ,0,tlparam(@lv));
SendMessageW(wnd,LVM_SETCOLUMNWIDTH,0,LVSCW_AUTOSIZE_USEHEADER);
- MakeResultTypeList(GetDlgItem(Dialog,IDC_SRV_RESULT));
- MakeParamTypeList (GetDlgItem(Dialog,IDC_FLAG_WPAR));
- MakeParamTypeList (GetDlgItem(Dialog,IDC_FLAG_LPAR));
- MakeMathOperList (GetDlgItem(Dialog,IDC_ADV_OPER));
- MakeFileEncList (GetDlgItem(Dialog,IDC_FILE_ENC));
- MakeDataTypeList (GetDlgItem(Dialog,IDC_RW_DATATYPE));
-
- // service list for RunService
- ApiCard.FillList(GetDlgItem(Dialog,IDC_EDIT_SERVICE));
- // contact list for ContactMessage
- FillContactList(GetDlgItem(Dialog,IDC_CONTACTLIST),fCLfilter,fCLformat);
// action type combobox
FillActTypeList(GetDlgItem(Dialog,IDC_ACTION_TYPE));
-
- if isVarsInstalled then
- begin
- ico:=CallService(MS_VARS_GETSKINITEM,0,VSI_HELPICON);
- SendDlgItemMessage(Dialog,IDC_HLP_FVARS,BM_SETIMAGE,IMAGE_ICON,ico);
- SendDlgItemMessage(Dialog,IDC_HLP_VARS ,BM_SETIMAGE,IMAGE_ICON,ico);
- SendDlgItemMessage(Dialog,IDC_ADV_HVARS,BM_SETIMAGE,IMAGE_ICON,ico);
- end;
-
+{!!
+ // XML import/export service
if ServiceExists(MS_SYSTEM_GET_XI)=0 then
begin
EnableWindow(GetDlgItem(Dialog,IDC_GROUP_EXPORT),false);
EnableWindow(GetDlgItem(Dialog,IDC_GROUP_IMPORT),false);
end;
-
+}
OldActTableProc :=pointer(SetWindowLongPtrW(wnd,GWL_WNDPROC,long_ptr(@NewActTableProc)));
- OldGroupTableProc:=pointer(SetWindowLongPtrW(GetDlgItem(Dialog,IDC_ACTION_GROUP),
+ OldGroupTableProc:=pointer(SetWindowLongPtrW(MacroListWindow,
GWL_WNDPROC,long_ptr(@NewGroupTableProc)));
+ ClearDialogData;
+ ResetDialogs;
+
// fill group list
- wnd:=GetDlgItem(Dialog,IDC_ACTION_GROUP);
+ wnd:=MacroListWindow;
SendMessage(wnd,LVM_SETUNICODEFORMAT,1,0);
lv.mask:=LVCF_WIDTH;
lv.cx :=110;
SendMessageW(wnd,LVM_INSERTCOLUMNW,0,tlparam(@lv));
- FillGroupList{(Dialog)};
- FillChainList(Dialog);
-
- SetMBRadioIcons;
+ FillMacroList(Dialog);
+ ChangeListNotify(1);
// fill current group
- MakeActionList(@NewGroupList^);
- ChMask:=0;
- CheckGrpList(-1);
+ FillActionList(Dialog,EditMacroList[0]);
+ ChangeListNotify(2);
+ EventMask:=0;
DontReact:=false;
end;
WM_COMMAND: begin
if DontReact then exit;
case wParam shr 16 of
- CBN_EDITCHANGE: begin
- ChMask:=ChMask or ACTM_ACT or ACTM_ACTS;
- SetChanged(Dialog,etACT);
- end;
+{
EN_CHANGE: begin
// check for group renaming
if loword(wParam)<>IDC_EDIT_FORMAT then
begin
- ChMask:=ChMask or ACTM_ACT or ACTM_ACTS;
SetChanged(Dialog,etACT);
end;
end;
+}
CBN_SELCHANGE: begin
- ChMask:=ChMask or ACTM_ACT or ACTM_ACTS;
- SetChanged(Dialog,etACT);
case loword(wParam) of
- IDC_SRV_RESULT: begin
- i:=CB_GetData(lParam);
- case i of
- sresHex,sresInt,sresStruct: begin
- SHControl(IDC_RES_FREEMEM,SW_HIDE);
- SHControl(IDC_RES_UNICODE,SW_HIDE);
- if i=sresInt then
- SHControl(IDC_RES_SIGNED,SW_SHOW)
- else
- SHControl(IDC_RES_SIGNED,SW_HIDE);
- end;
- sresString: begin
- SHControl(IDC_RES_FREEMEM,SW_SHOW);
- SHControl(IDC_RES_UNICODE,SW_SHOW);
- SHControl(IDC_RES_SIGNED ,SW_HIDE);
- end;
- end;
- end;
-
- IDC_ADV_OPER: begin
- EnableWindow(GetDlgItem(Dialog,IDC_ADV_VAL1),
- (CB_GetData(lParam)<>lresult(aeNot)));
-// SendMessage(lParam,CB_GETCURSEL,0,0)<>0);
- end;
-
- IDC_RW_DATATYPE: begin
- if CB_GetData(GetDlgItem(Dialog,IDC_RW_DATATYPE))>2 then
- begin
- SHControl(IDC_RW_TEXT ,SW_SHOW);
- SHControl(IDC_RW_VALUE,SW_HIDE);
- end
- else
- begin
- SHControl(IDC_RW_TEXT ,SW_HIDE);
- SHControl(IDC_RW_VALUE,SW_SHOW);
- end;
- end;
-
IDC_ACTION_TYPE: begin
- i:=SendMessage(lParam,CB_GETCURSEL,0,0);
- SHWindows(ActIds[i].code);
- ChangeActionName(-1,i+1);
- case ActIds[i].code of
- ACT_CONTACT: EnableWindow(GetDlgItem(Dialog,IDC_CONTACTLIST),true);
- ACT_RW: begin
- EnableWindow(GetDlgItem(Dialog,IDC_CONTACTLIST),
- (IsDlgButtonChecked(Dialog,IDC_RW_MANUAL)=BST_CHECKED));
-
- if CB_GetData(GetDlgItem(Dialog,IDC_RW_DATATYPE))>2 then
- begin
- SHControl(IDC_RW_TEXT ,SW_SHOW);
- SHControl(IDC_RW_VALUE,SW_HIDE);
- end
- else
- begin
- SHControl(IDC_RW_TEXT ,SW_HIDE);
- SHControl(IDC_RW_VALUE,SW_SHOW);
- end;
-
- end;
- ACT_ADVANCE: FillSubList(Dialog);
- end;
- end;
-{
- IDC_EDIT_WPAR,IDC_EDIT_LPAR: begin
- SendMessage(lParam,CB_GETLBTEXT,
- SendMessage(lParam,CB_GETCURSEL,0,0),TLPARAM(@buf));
- if loword(wParam)=IDC_EDIT_WPAR then
- FixParam(buf,IDC_EDIT_WPAR,IDC_FLAG_WPAR)
- else
- FixParam(buf,IDC_EDIT_LPAR,IDC_FLAG_LPAR)
- end;
-}
- IDC_FLAG_WPAR,IDC_FLAG_LPAR: begin
- if loword(wParam)=IDC_FLAG_WPAR then
- begin
- wnd :=GetDlgItem(Dialog,IDC_EDIT_WPAR);
- wnd1:=GetDlgItem(Dialog,IDC_WSTRUCT);
- wnd2:=GetDlgItem(Dialog,IDC_SRV_WPAR);
- end
- else
- begin
- wnd :=GetDlgItem(Dialog,IDC_EDIT_LPAR);
- wnd1:=GetDlgItem(Dialog,IDC_LSTRUCT);
- wnd2:=GetDlgItem(Dialog,IDC_SRV_LPAR);
- end;
- i:=CB_GetData(GetDlgItem(Dialog,loword(wParam)));
+ ClearDialogData;
+ p:=GetLink(CB_GetData(lParam));
+ ShowWindow(p^.DlgHandle,SW_SHOW);
- if i=ptStruct then
- begin
- ShowWindow(wnd ,SW_HIDE);
- ShowWindow(wnd2,SW_HIDE);
- ShowWindow(wnd1,SW_SHOW);
- end
- else
+ // Saving prevoius "normal" action type
+ if p^.Hash>10 then
begin
- ShowWindow(wnd ,SW_SHOW);
- ShowWindow(wnd2,SW_SHOW);
- ShowWindow(wnd1,SW_HIDE);
- if i in [ptCurrent,ptResult,ptParam] then
- EnableWindow(wnd,false)
- else
- begin
- EnableWindow(wnd,true);
-{
- flag:=GetWindowLongPtr(wnd,GWL_STYLE);
- if i=ptNumber then
- flag:=flag or ES_NUMBER
- else
- flag:=flag and not ES_NUMBER;
- SetWindowLongPtr(wnd,GWL_STYLE,flag);
-}
- end;
+ SetWindowLongPtrW(lParam,GWLP_USERDATA,
+ SendMessage(lParam,CB_GETCURSEL,0,0));
+ SetChanged(Dialog,etACT);
end;
end;
- IDC_EDIT_SERVICE: ReloadService;
end;
end;
+
BN_CLICKED: begin
case loword(wParam) of
IDC_GROUP_RELOAD, // don't affect to saved (DB) datas
- IDC_WSTRUCT, // 'Changed' on process
- IDC_LSTRUCT, // 'Changed' on process
- IDC_HLP_FVARS,
- IDC_HLP_VARS,
- IDC_ADV_HVARS,
IDC_ACTION_HELP,
IDC_GROUP_EXPORT,
- IDC_CNT_APPLY,
- IDC_CNT_FILTER,
IDC_GROUP_TEST: ;
IDC_GROUP_UP,
IDC_GROUP_DOWN,
- IDC_GROUP_NEW : SetChanged(Dialog,etHK);
+ IDC_GROUP_NEW : SetChanged(Dialog,etMacro);
IDC_GROUP_DELETE, // action deleting with subactions
IDC_GROUP_IMPORT,
@@ -1540,69 +969,28 @@ begin IDC_ACTION_DELETE,
IDC_ACTION_UP,
IDC_ACTION_DOWN: begin
- ChMask:=ChMask or ACTM_ACT or ACTM_ACTS;
- SetChanged(Dialog,etHK+etACT);
+ SetChanged(Dialog,etMacro+etACT);
end;
else
- ChMask:=ChMask or ACTM_ACT or ACTM_ACTS;
SetChanged(Dialog,etACT);
end;
case loword(wParam) of
- IDC_SRV_WPAR,
- IDC_SRV_LPAR,
- IDC_SRV_SRVC,
- IDC_PRG_PRG ,
- IDC_PRG_ARG ,
- IDC_TXT_FILE,
- IDC_TXT_TEXT,
- IDC_RW_MVAR ,
- IDC_RW_SVAR ,
- IDC_RW_TVAR ,
- IDC_MSG_TTL ,
- IDC_MSG_TXT : SetButtonIcon(lParam,checknames[IsDlgButtonChecked(Dialog,loword(wParam))]);
- end;
-
- case loword(wParam) of
- IDC_CNT_FILTER,
- IDC_CNT_APPLY: begin
- if loword(wParam)=IDC_CNT_APPLY then
- begin
- mFreeMem(fCLformat);
- fCLformat:=GetDlgText(Dialog,IDC_EDIT_FORMAT);
- DBWriteUnicode(0,DBBranch,'CLformat',fCLformat);
- end
- else
- begin
- fCLfilter:=IsDlgButtonChecked(Dialog,IDC_CNT_FILTER)<>BST_UNCHECKED;
- DBWriteByte(0,DBBranch,'CLfilter',ord(fCLfilter));
- end;
-// Saving and restoring contact after list rebuild
- wnd:=GetDlgItem(Dialog,IDC_CONTACTLIST);
- i:=SendMessage(wnd,CB_GETITEMDATA,SendMessage(wnd,CB_GETCURSEL,0,0),0);
-
- FillContactList(wnd,fCLfilter,fCLformat);
-
- SendMessage(wnd,CB_SETCURSEL,FindContact(wnd,i),0);
- end;
- IDC_HLP_FVARS,
- IDC_HLP_VARS : ShowHelp(hlpVariables);
- IDC_ADV_HVARS: ShowHelp(hlpAdvVariables);
-
+{
IDC_GROUP_EXPORT: begin
- if ShowDlgW(xmlfilename,xmlfilename,inoutfilter,false) then
+ if ShowDlgW(xmlfilename,xmlfilename,TranslateW(inoutfilter),false) then
begin
- wnd:=GetDlgItem(Dialog,IDC_ACTION_GROUP);
+ wnd:=MacroListWindow;
for i:=0 to ListView_GetItemCount(wnd)-1 do
begin
if ListView_GetItemState(wnd,i,LVIS_SELECTED)<>0 then
begin
- with GroupList[LV_GetLParam(wnd,i)] do
+ with EditMacroList[LV_GetLParam(wnd,i)] do
if (flags and ACF_ASSIGNED)<>0 then // must be always true
flags:=flags or ACF_EXPORT;
end
else
- with GroupList[i] do
+ with EditMacroList[i] do
if (flags and (ACF_EXPORT or ACF_ASSIGNED))=
(ACF_EXPORT or ACF_ASSIGNED) then
flags:=flags and not ACF_EXPORT;
@@ -1612,357 +1000,190 @@ begin if MessageBoxW(Dialog,TranslateW('Append data to file?'),
PluginName,MB_YESNO+MB_ICONWARNING)=IDYES then
i:=i or ACIO_APPEND;
+//!!!!!!!!!!!!!!!
+// we MUST Export EditMacroList, NOT MacroList
+// OR
+// Use "Apply" code before
CallService(MS_ACT_INOUT,i,TLPARAM(@xmlfilename));
-// Export({GetLParam(GetDlgItem(Dialog,IDC_ACTION_GROUP)),}xmlfilename,i);
for i:=0 to MaxGroups-1 do
- with GroupList[i] do
+ with EditMacroList[i] do
if (flags and (ACF_EXPORT or ACF_ASSIGNED))=
(ACF_EXPORT or ACF_ASSIGNED) then
flags:=flags and not ACF_EXPORT;
end;
end;
-
+}
IDC_GROUP_IMPORT: begin
- if ShowDlgW(xmlfilename,xmlfilename,inoutfilter) then
+ if ShowDlgW(xmlfilename,xmlfilename,TranslateW(inoutfilter)) then
begin
-// if Import(xmlfilename) then
- if CallService(MS_ACT_INOUT,0,TLPARAM(@xmlfilename))<>0 then
+ // "save" selected macro (in edit list only)
+ BuildActionChain(Dialog);
+
+ if Import(EditMacroList,xmlfilename,0)<>0 then
+// if CallService(MS_ACT_INOUT,0,TLPARAM(@xmlfilename))<>0 then
begin
- ChMask:=ChMask or ACTM_NEW;
- SendMessage(Dialog,WM_COMMAND,IDC_GROUP_RELOAD+(BN_CLICKED shl 16),
- GetDlgItem(Dialog,IDC_GROUP_RELOAD));
-//(in reload) FillChainList(Dialog);
- end;
- end;
- end;
+ // copy from WM_INITDIALOG
+ FillMacroList(Dialog);
+ ChangeListNotify(1);
- IDC_WSTRUCT, IDC_LSTRUCT: begin
- if loword(wParam)=IDC_WSTRUCT then
- pc:=wstruct
- else
- pc:=lstruct;
-//!!!!
- pAnsiChar(j):=EditStructure(pAnsiChar(pc),Dialog);
- if j<>0 then
- begin
- ChMask:=ChMask or ACTM_ACT or ACTM_ACTS;
- SetChanged(Dialog,etACT);
- mFreeMem(pAnsiChar(pc));
- pc:=pAnsiChar(j);
+ // fill current group
+ FillActionList(Dialog,EditMacroList[0]);
+ ChangeListNotify(2);
- if loword(wParam)=IDC_WSTRUCT then
- wstruct:=pc
- else
- lstruct:=pc;
+ CheckMacroListDirectionButtons(Dialog);
+ end;
end;
end;
- IDC_PROGRAM: begin
- FillFileName(IDC_EDIT_PRGPATH);
- end;
- IDC_FILE_FILEBTN: begin
- FillFileName(IDC_FILE_PATH);
- end;
-
IDC_GROUP_TEST: begin
- wnd:=GetDlgItem(Dialog,IDC_ACTION_LIST);
li.mask :=LVIF_PARAM;
li.iSubItem:=0;
- li.iItem :=0;
- SendMessageW(wnd,LVM_GETITEMW,0,tlparam(@li));
- j:=SendMessage(wnd,LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
-
- ActionStarterWait(li.lParam);
- // doubling from "reload" button
- wnd:=GetDlgItem(Dialog,IDC_ACTION_GROUP);
- i:=SendMessage(wnd,LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
- NewGroupList :=GroupList;
- NewMaxGroups :=MaxGroups;
- NewActionList:=ActionList;
- NewMaxActions:=MaxActions;
- FillGroupList{(Dialog)};
- FillChainList(Dialog);
-
- Listview_SetItemState(wnd,0,0,LVIS_FOCUSED or LVIS_SELECTED);
- Listview_SetItemState(wnd,i,
- LVIS_FOCUSED or LVIS_SELECTED,
- LVIS_FOCUSED or LVIS_SELECTED);
- SendMessage(wnd,LVM_ENSUREVISIBLE,i,0);
-
- wnd:=GetDlgItem(Dialog,IDC_ACTION_LIST);
- Listview_SetItemState(wnd,0,0,LVIS_FOCUSED or LVIS_SELECTED);
- Listview_SetItemState(wnd,j,
- LVIS_FOCUSED or LVIS_SELECTED,
- LVIS_FOCUSED or LVIS_SELECTED);
- SendMessage(wnd,LVM_ENSUREVISIBLE,j,0);
-
+ // Get selected macro
+ li.iItem :=SendMessage(MacroListWindow,LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
+ // "save" selected macro (in edit list only)
+ BuildActionChain(Dialog,li.iItem);
+ // Get lParam = EditMacroList element
+ SendMessageW(MacroListWindow,LVM_GETITEMW,0,tlparam(@li));
+
+ ActionStarter(EditMacroList[loword(li.lParam)],nil,ACTP_SAMETHREAD or ACTP_WAIT);
end;
+
IDC_GROUP_NEW: begin
- i:=AddGroup(Dialog,NewGroup(NewGroupList,NewMaxGroups));
- if i>=0 then
+ if AddMacro(Dialog,EditMacroList.NewMacro())>=0 then
begin
- ChMask:=ChMask or ACTM_NEW or ACTM_SORT;
- EnableWindow(GetDlgItem(Dialog,IDC_ACTION_GROUP),true);
- EnableWindow(GetDlgItem(Dialog,IDC_GROUP_DELETE),true);
- EnableWindow(GetDlgItem(Dialog,IDC_ACTION_NEW ),true);
- FillChainList(Dialog);
- CheckGrpList(i);
+ CheckMacroList(Dialog);
+ ChangeListNotify(1);
end;
end;
IDC_GROUP_DELETE: begin
- wnd:=GetDlgItem(Dialog,IDC_ACTION_GROUP);
+ DontReact:=true;
+ wnd:=MacroListWindow;
for i:=ListView_GetItemCount(wnd)-1 downto 0 do
begin
if ListView_GetItemState(wnd,i,LVIS_SELECTED)<>0 then
begin
- ChMask:=ChMask or ACTM_DELETE or ACTM_SORT;
-
- with NewGroupList^[LV_GetLParam(wnd,i)] do
- begin
- flags:=0;
- mFreeMem(descr);
- FreeActions(NewActionList,firstAction);
- end;
+ num:=Loword(LV_GetLParam(wnd,i));
+ // mark old to delete on apply (must be first)
+ with EditMacroList[num]^ do
+ for j:=0 to ActionCount-1 do
+ ActionList[j].flags:=ActionList[j].flags or ACF_REPLACED;
+ // delete new actions
+ FreeMacro(EditMacroList[num],ACF_INTRODUCED);
SendMessage(wnd,LVM_DELETEITEM,i,0);
end;
end;
+ Listview_SetItemState(wnd,-1,0,LVIS_FOCUSED or LVIS_SELECTED);
+ DontReact:=false;
SendDlgItemMessage(Dialog,IDC_ACTION_LIST,LVM_DELETEALLITEMS,0,0);
- FillChainList(Dialog);
Listview_SetItemState(wnd,0,LVIS_FOCUSED or LVIS_SELECTED,
LVIS_FOCUSED or LVIS_SELECTED);
- CheckGroupList(-1);
-{
- i:=SendMessageW(wnd,LVM_GETNEXTITEM,-1,LVNI_FOCUSED); //??
- if i>=0 then
- begin
- ChMask:=ChMask or ACTM_DELETE;
- j:=GetLParam(wnd,i);
-
- with NewGroupList^[j] do
- begin
- flags:=0;
- mFreeMem(descr);
- FreeActions(NewActionList,firstAction);
- end;
- SendDlgItemMessage(Dialog,IDC_ACTION_LIST,LVM_DELETEALLITEMS,0,0);
-
-//?? i:=ListView_GetNextItem(wnd,-1,LVNI_FOCUSED);
- SendMessage(wnd,LVM_DELETEITEM,i,0);
- FillChainList(Dialog);
- CheckGroupList(i);
- end;
-}
- end;
- IDC_GROUP_RELOAD: begin
- ChMask:=ChMask or ACTM_RELOAD;
- SetCancel;
- NewGroupList :=GroupList;
- NewMaxGroups :=MaxGroups;
- NewActionList:=ActionList;
- NewMaxActions:=MaxActions;
- FillGroupList{(Dialog)};
- FillChainList(Dialog);
+ CheckMacroList(Dialog);
+ ChangeListNotify(1);
end;
IDC_ACTION_HELP: begin
- ShowHelp(SendDlgItemMessage(Dialog,IDC_ACTION_TYPE,CB_GETCURSEL,0,0));
+ SendMessage(
+ GetLink(CB_GetData(GetDlgItem(Dialog,IDC_ACTION_TYPE)))^.DlgHandle,
+ WM_HELP,0,0);
end;
IDC_ACTION_NEW: begin
- wnd:=GetDlgItem(Dialog,IDC_ACTION_LIST);
+ wnd:=ActionListWindow;
li.mask :=LVIF_PARAM;
i :=SendMessage(wnd,LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
li.iItem :=i+1;
li.iSubItem:=0;
- li.lParam :=NewAction(NewActionList,NewMaxActions);
+ li.lParam :=0;{NewAction(NewActionList,NewMaxActions);}
SendMessageW(wnd,LVM_INSERTITEMW,0,tlparam(@li));
ListView_SetCheckState(wnd,li.iItem,true);
if li.iItem=0 then
begin
ListView_SetItemState(wnd,0,LVIS_FOCUSED or LVIS_SELECTED,
LVIS_FOCUSED or LVIS_SELECTED);
- SHActButtons(SW_SHOW);
+ SHActButtons(Dialog,SW_SHOW);
+ SendDlgItemMessage(Dialog,IDC_ACTION_TYPE,CB_SETCURSEL,0,0);
end;
- ChangeActionName(li.iItem);
- EnableWindow(GetDlgItem(Dialog,IDC_ACTION_LIST ),true);
- EnableWindow(GetDlgItem(Dialog,IDC_ACTION_HELP ),true);
- EnableWindow(GetDlgItem(Dialog,IDC_GROUP_TEST ),true);
- EnableWindow(GetDlgItem(Dialog,IDC_ACTION_DELETE),true);
- EnableWindow(GetDlgItem(Dialog,IDC_ACTION_TYPE ),true);
- CheckActList(i);
-
- wnd:=GetDlgItem(Dialog,IDC_ADV_VAL2);
- i:=SendMessage(wnd,CB_GETCURSEL,0,0);
- FillSubList(Dialog);
- SendMessage(wnd,CB_SETCURSEL,i,0);
+ ChangeActionName(Dialog,li.iItem);
+
+ CheckActListButtons(Dialog);
+ ChangeListNotify(2);
end;
IDC_ACTION_DELETE: begin
- wnd:=GetDlgItem(Dialog,IDC_ACTION_LIST);
+ DontReact:=true;
+ wnd:=ActionListWindow;
for i:=ListView_GetItemCount(wnd)-1 downto 0 do
begin
if ListView_GetItemState(wnd,i,LVIS_SELECTED)<>0 then
begin
- FreeAction(@NewActionList^[LV_GetLParam(wnd,i)]);
+ j:=LV_GetLParam(wnd,i);
+ if j<>0 then
+ begin
+ if (tBaseAction(j).flags and ACF_INTRODUCED)<>0 then
+ tBaseAction(j).Free
+ else
+ tBaseAction(j).flags:=tBaseAction(j).flags or ACF_REPLACED;
+ end;
SendMessage(wnd,LVM_DELETEITEM,i,0);
end;
end;
+ Listview_SetItemState(wnd,-1,0,LVIS_FOCUSED or LVIS_SELECTED);
+ DontReact:=false;
Listview_SetItemState(wnd,0,LVIS_FOCUSED or LVIS_SELECTED,
LVIS_FOCUSED or LVIS_SELECTED);
- CheckActionList(0);
-{
- wnd:=GetDlgItem(Dialog,IDC_ACTION_LIST);
- li.iItem:=SendMessage(wnd,LVM_GETNEXTITEM,-1,LVNI_FOCUSED); //??
- if li.iItem>=0 then
- begin
- li.mask :=LVIF_PARAM;
- li.iSubItem:=0;
- SendMessageW(wnd,LVM_GETITEM,0,TLPARAM(@li));
- FreeAction(@NewActionList^[li.lParam]);
-
- SendMessage(wnd,LVM_DELETEITEM,li.iItem,0);
- CheckActionList(li.iItem);
- end;
-}
+ CheckActListButtons(Dialog);
+ ChangeListNotify(2);
end;
IDC_GROUP_UP: begin
- wnd:=GetDlgItem(Dialog,IDC_ACTION_GROUP);
-// i:=SendMessage(wnd,LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
-// if i>0 then
- begin
- CheckGrpList(MoveGroup(wnd,-1,-1));
- ChMask:=ChMask or ACTM_SORT;
- end;
+ MoveMacro(MacroListWindow,-1,-1);
+ CheckMacroListDirectionButtons(Dialog);
+ EventMask:=EventMask or ACTM_SORT;
+ ChangeListNotify(1);
end;
IDC_GROUP_DOWN: begin
- wnd:=GetDlgItem(Dialog,IDC_ACTION_GROUP);
-// i:=SendMessage(wnd,LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
-// if i<(SendMessage(wnd,LVM_GETITEMCOUNT,0,0)-1) then
- begin
- CheckGrpList(MoveGroup(wnd,-1,1));
- ChMask:=ChMask or ACTM_SORT;
- end;
+ MoveMacro(MacroListWindow,-1,1);
+ CheckMacroListDirectionButtons(Dialog);
+ EventMask:=EventMask or ACTM_SORT;
+ ChangeListNotify(1);
end;
IDC_ACTION_UP: begin
- wnd:=GetDlgItem(Dialog,IDC_ACTION_LIST);
-// i:=SendMessage(wnd,LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
-// if i>0 then
- CheckActList(MoveGroup(wnd,-1,-1));
+ MoveMacro(ActionListWindow,-1,-1);
+ CheckActListDirectionButtons(Dialog);
+ ChangeListNotify(2);
end;
IDC_ACTION_DOWN: begin
- wnd:=GetDlgItem(Dialog,IDC_ACTION_LIST);
-// i:=SendMessage(wnd,LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
-// if i<(SendMessage(wnd,LVM_GETITEMCOUNT,0,0)-1) then
- CheckActList(MoveGroup(wnd,-1,1));
- end;
-
- IDC_FILE_WRITE, IDC_FILE_READ, IDC_FILE_APPEND:
- EnableWindow(GetDlgItem(Dialog,IDC_EDIT_INSERT),
- loword(wParam)<>IDC_FILE_APPEND);
-
- IDC_RW_DELETE,
- IDC_RW_READ,
- IDC_RW_WRITE: begin
- b:=loword(wParam)<>IDC_RW_DELETE;
- EnableWindow(GetDlgItem(Dialog,IDC_RW_DATATYPE),b);
- EnableWindow(GetDlgItem(Dialog,IDC_RW_LAST ),b);
- EnableWindow(GetDlgItem(Dialog,IDC_RW_VALUE ),b);
- EnableWindow(GetDlgItem(Dialog,IDC_RW_TEXT ),b);
+ MoveMacro(ActionListWindow,-1,1);
+ CheckActListDirectionButtons(Dialog);
+ ChangeListNotify(2);
end;
- IDC_FLAG_CLIP,IDC_FLAG_FILE,IDC_FLAG_MESSAGE: begin
- b:=loword(wParam)=IDC_FLAG_CLIP;
-//!! +text read = disabled
- EnableWindow(GetDlgItem(Dialog,IDC_CLIP_COPYTO),b);
- EnableWindow(GetDlgItem(Dialog,IDC_CLIP_PASTE ),b);
- b:=b or ((loword(wParam)=IDC_FLAG_FILE) and
- (IsDlgButtonChecked(Dialog,IDC_FILE_READ)<>BST_UNCHECKED));
- EnableWindow(GetDlgItem(Dialog,IDC_EDIT_INSERT),not b);
-
- b:=loword(wParam)=IDC_FLAG_FILE;
- EnableWindow(GetDlgItem(Dialog,IDC_FILE_ENC ),b);
- EnableWindow(GetDlgItem(Dialog,IDC_FILE_PATH ),b);
- EnableWindow(GetDlgItem(Dialog,IDC_FILE_FILEBTN),b);
- EnableWindow(GetDlgItem(Dialog,IDC_FILE_READ ),b);
- EnableWindow(GetDlgItem(Dialog,IDC_FILE_WRITE ),b);
- EnableWindow(GetDlgItem(Dialog,IDC_FILE_APPEND ),b);
- end;
-
- IDC_FLAG_JUMP: begin
- EnableWindow(GetDlgItem(Dialog,IDC_ADV_VAL2),true);
- end;
-
- IDC_FLAG_BREAK,IDC_FLAG_ANOP:
- begin
- EnableWindow(GetDlgItem(Dialog,IDC_ADV_VAL2),false);
- end;
-
- IDC_FLAG_VARS: begin
- if IsDlgButtonChecked(Dialog,IDC_FLAG_VARS)<>BST_UNCHECKED then
- begin
- SHMath(false);
- CheckDlgButton(Dialog,IDC_FLAG_MATH,BST_UNCHECKED);
- end
- else
- begin
- EnableWindow(GetDlgItem(Dialog,IDC_ADV_ASINT),false);
- EnableWindow(GetDlgItem(Dialog,IDC_ADV_VARS ),false);
- end;
- end;
- IDC_FLAG_MATH: begin
- if IsDlgButtonChecked(Dialog,IDC_FLAG_MATH)<>BST_UNCHECKED then
- begin
- SHMath(true);
- CheckDlgButton(Dialog,IDC_FLAG_VARS,BST_UNCHECKED);
- end
- else
- begin
- EnableWindow(GetDlgItem(Dialog,IDC_ADV_OPER),false);
- EnableWindow(GetDlgItem(Dialog,IDC_ADV_VAL1),false);
- end;
- end;
-
- IDC_RW_CURRENT, IDC_RW_RESULT, IDC_RW_PARAM: begin
- EnableWindow(GetDlgItem(Dialog,IDC_CONTACTLIST),false);
- end;
- IDC_RW_MANUAL: EnableWindow(GetDlgItem(Dialog,IDC_CONTACTLIST),true);
-
- IDC_RW_LAST: begin
- b :=IsDlgButtonChecked(Dialog,IDC_RW_LAST )=BST_UNCHECKED;
- EnableWindow(GetDlgItem(Dialog,IDC_RW_VALUE), b);
- EnableWindow(GetDlgItem(Dialog,IDC_RW_TEXT ), b);
- end;
end;
end;
end;
end;
WM_HELP: begin
- if (PHELPINFO(lParam)^.iContextType=HELPINFO_WINDOW) then
- ShowHelp(SendDlgItemMessage(Dialog,IDC_ACTION_TYPE,CB_GETCURSEL,0,0));
+ SendMessage(
+ GetLink(CB_GetData(GetDlgItem(Dialog,IDC_ACTION_TYPE)))^.DlgHandle,
+ WM_HELP,0,lParam);
+ result:=1;
end;
WM_NOTIFY: begin
case integer(PNMHdr(lParam)^.code) of
PSN_APPLY: begin
- BuildActionChain;
- SetSave(Dialog,LV_GetLParam(GetDlgItem(Dialog,IDC_ACTION_GROUP)));
+ BuildActionChain(Dialog);
- if ActionList<>NewActionList then
- begin
- DestroyActions(ActionList,MaxActions);
- ActionList:=NewActionList;
- MaxActions:=NewMaxActions;
- end;
-
- SaveGroups;
+ EventMask:=EventMask or CheckChanges();
+ SetSave(Dialog);
+ SaveMacros;
- if ChMask<>0 then //??
+ if EventMask<>0 then //??
begin
- NotifyEventHooks(hHookChanged,ChMask,0);
- ChMask:=0;
+ NotifyEventHooks(hHookChanged,EventMask,0);
+ EventMask:=0;
end;
end;
@@ -1976,7 +1197,7 @@ begin LVN_ITEMCHANGED: begin
if DontReact then exit; // bug when group moved avoid
- if wParam=IDC_ACTION_GROUP then
+ if wParam=IDC_MACRO_LIST then
begin
if PNMLISTVIEW(lParam)^.uChanged=LVIF_STATE then
begin
@@ -1984,60 +1205,64 @@ begin (PNMLISTVIEW(lParam)^.uNewState and LVNI_FOCUSED);
if lvflag>0 then // old focus
- BuildActionChain(PNMLISTVIEW(lParam)^.iItem)
+ BuildActionChain(Dialog,PNMLISTVIEW(lParam)^.iItem)
else if lvflag<0 then // new focus
begin
DontReact:=true;
ClearDialogData;
- MakeActionList(@NewGroupList^[PNMLISTVIEW(lParam)^.lParam]);
- CheckGrpList(PNMLISTVIEW(lParam)^.iItem);
+ ResetDialogs;
+ FillActionList(Dialog,EditMacroList[Loword(PNMLISTVIEW(lParam)^.lParam)]);
+ CheckMacroListDirectionButtons(Dialog);
+ ChangeListNotify(2);
DontReact:=false;
end
else
begin
+{??
lvflag:=(PNMLISTVIEW(lParam)^.uOldState and LVNI_SELECTED)-
(PNMLISTVIEW(lParam)^.uNewState and LVNI_SELECTED);
+
if lvflag<>0 then
- CheckGrpList(PNMLISTVIEW(lParam)^.iItem);
+ CheckMacroListDirectionButtons(Dialog);
+}
end;
end;
end
+
else if wParam=IDC_ACTION_LIST then
begin
lvflag:=(PNMLISTVIEW(lParam)^.uOldState and LVNI_FOCUSED)-
(PNMLISTVIEW(lParam)^.uNewState and LVNI_FOCUSED);
if lvflag>0 then // old focus
- SaveAction(PNMLISTVIEW(lParam)^.iItem,
- PNMLISTVIEW(lParam)^.lParam)
+ begin
+ SaveAction(Dialog,
+ PNMLISTVIEW(lParam)^.iItem,
+ tBaseAction(PNMLISTVIEW(lParam)^.lParam));
+ end
else if lvflag<0 then // new focus
begin
DontReact:=true;
ClearDialogData;
- j:=PNMLISTVIEW(lParam)^.lParam;
- FillAction(j);
- CheckActList(PNMLISTVIEW(lParam)^.iItem);
+ ResetDialogs;
+ FillAction(Dialog,tBaseAction(PNMLISTVIEW(lParam)^.lParam));
+ CheckActListDirectionButtons(Dialog);
DontReact:=false;
end
else
begin // checkboxes
+{??
lvflag:=(PNMLISTVIEW(lParam)^.uOldState and LVNI_SELECTED)-
(PNMLISTVIEW(lParam)^.uNewState and LVNI_SELECTED);
- if lvflag<>0 then
- CheckGrpList(PNMLISTVIEW(lParam)^.iItem);
+ if lvflag<>0 then
+ CheckMacroListDirectionButtons(Dialog);
+}
if (PNMLISTVIEW(lParam)^.uOldState or PNMLISTVIEW(lParam)^.uNewState)=$3000 then
begin
- if PNMLISTVIEW(lParam)^.uOldState=$1000 then
- i:=0
- else
- i:=ACF_DISABLED;
- j:=PNMLISTVIEW(lParam)^.lParam;
- NewActionList^[j].flags:=(NewActionList^[j].flags and not ACF_DISABLED) or dword(i);
- ChMask:=ChMask or ACTM_ACT or ACTM_ACTS;
SetChanged(Dialog,etACT);
end;
end;
@@ -2046,26 +1271,26 @@ begin LVN_ENDLABELEDITW: begin
if DontReact then exit;
- if wParam=IDC_ACTION_GROUP then
+
+ if wParam=IDC_MACRO_LIST then
begin
with PLVDISPINFOW(lParam)^ do
begin
if item.pszText<>nil then
begin
- ChMask:=ChMask or ACTM_RENAME;
- SetChanged(Dialog,etHK);
+ EventMask:=EventMask or ACTM_RENAME;
+ SetChanged(Dialog,etMacro);
item.mask:=LVIF_TEXT;
if pWideChar(item.pszText)^=#0 then
pWideChar(item.pszText):=NoDescription;
SendMessageW(hdr.hWndFrom,LVM_SETITEMW,0,tlparam(@item));
- with NewGroupList^[item.lParam] do
+ with EditMacroList[loword(item.lParam)]^ do
begin
- mFreeMem(descr);
- StrDupW(descr,item.pszText);
+ StrCopyW(descr,item.pszText,MacroNameLen-1);
end;
+ ChangeListNotify(1);
- FillChainList(Dialog);
result:=1;
end;
end;
@@ -2076,12 +1301,11 @@ begin begin
if item.pszText<>nil then
begin
- ChMask:=ChMask or ACTM_ACT or ACTM_ACTS;
SetChanged(Dialog,etACT);
- ChangeActionName(item.iItem,0,pWideChar(item.pszText));
+ ChangeActionName(Dialog,item.iItem,pWideChar(item.pszText));
+ ChangeListNotify(2);
result:=1;
end;
-//??
end;
end;
end;
diff --git a/plugins/Actman/i_options.inc b/plugins/Actman/i_options.inc index 26dd8e1f08..fbbf6c558c 100644 --- a/plugins/Actman/i_options.inc +++ b/plugins/Actman/i_options.inc @@ -1,459 +1,475 @@ {Save/load options}
const
- opt_group = 'Group';
- opt_actions = 'Action';
- opt_numacts = 'numactions';
- opt_numhk = 'numgroups';
- opt_firstAction = 'firstaction';
-
- opt_cproto = 'cproto';
- opt_cuid = 'cuid';
- opt_ischat = 'ischat';
+ opt_group = 'Group';
+ opt_actions = 'Action';
+ opt_numacts = 'numactions';
+ opt_nummacro = 'numgroups';
opt_descr = 'descr';
opt_id = 'id';
+ opt_uid = 'uid';
opt_flags = 'flags';
- opt_flags2 = 'flags2';
- opt_time = 'time';
- opt_show = 'show';
- opt_action = 'action';
- opt_value = 'value';
- opt_file = 'file';
-
- opt_next = 'next';
- opt_type = 'type';
- opt_contact = 'contact';
- opt_text = 'text';
- opt_prg = 'program';
- opt_args = 'arguments';
- opt_service = 'service';
- opt_wparam = 'wparam';
- opt_wlparam = 'wparamlen';
- opt_llparam = 'lparamlen';
- opt_lparam = 'lparam';
- opt_chain = 'chain';
- opt_cond = 'condition';
- opt_count = 'count';
- opt_module = 'module';
- opt_setting = 'setting';
- opt_oper = 'operation';
- opt_mathval = 'mathval';
- opt_operval = 'operval';
- opt_varval = 'varval';
- opt_msgtitle = 'msgtitle';
- opt_msgtext = 'msgtext';
- opt_boxopts = 'boxopts';
-
//----- Save settings -----
-procedure SaveNumValue(setting:pAnsiChar;value:uint_ptr;isvar:boolean);
-begin
- if isvar then
- DBWriteUnicode(0,DBBranch,setting,pWideChar(value))
- else
- DBWriteDWord (0,DBBranch,setting,value);
-end;
-
-function SaveActions(section:pAnsiChar;first:integer):integer;
+procedure SaveActions(Macro:pMacroRecord;section:pAnsiChar);
var
p,p1:PAnsiChar;
- act:pHKAction;
i:integer;
begin
- result:=0;
+ p:=StrEnd(section);
+ StrCopy(p,opt_numacts); DBWriteWord(0,DBBranch,section,Macro^.ActionCount);
+
// in: section = "Group#/"
- p1:=StrCopyE(StrEnd(section),opt_actions); // "Group#/Action"
+ p1:=StrCopyE(p,opt_actions); // "Group#/Action"
DBDeleteGroup(0,DBBranch,section);
- i:=1;
- while first<>0 do
+
+ for i:=0 to Macro^.ActionCount-1 do
begin
- act:=@ActionList[first];
- p:=StrEnd(IntToStr(p1,i)); //!!!
+ p:=StrEnd(IntToStr(p1,i));
p^:='/'; inc(p); // "Group#/Action#/"
- StrCopy(p,opt_flags ); DBWriteDWord(0,DBBranch,section,act^.flags);
- StrCopy(p,opt_flags2); DBWriteDWord(0,DBBranch,section,act^.flags2);
- StrCopy(p,opt_type ); DBWriteByte (0,DBBranch,section,act^.actionType);
- if act^.descr<>nil then
- begin
- StrCopy(p,opt_descr); DBWriteUnicode(0,DBBranch,section,act^.descr);
- end;
-
- case act^.actionType of
- ACT_CONTACT: begin
- p^:=#0;
- SaveContact(act^.contact,DBBranch,section);
- end;
-
- ACT_SERVICE: begin
- StrCopy(p,opt_service); DBWriteString(0,DBBranch,section,act^.service);
-
- if (act^.flags and (ACF_WCURRENT or ACF_WRESULT or ACF_WPARAM))=0 then
- begin
- StrCopy(p,opt_wparam);
- if (act^.flags and ACF_WPARNUM)<>0 then
- SaveNumValue(section,act^.wparam,(act^.flags2 and ACF2_SRV_WPAR)<>0)
-// DBWriteDWord(0,DBBranch,section,act^.wparam)
- else if act^.wparam<>0 then
- begin
- if (act^.flags and ACF_WSTRUCT)<>0 then
- DBWriteUTF8(0,DBBranch,section,pAnsiChar(act^.wparam))
- else if (act^.flags and ACF_WUNICODE)<>0 then
- DBWriteUnicode(0,DBBranch,section,pWideChar(act^.wparam))
- else
- DBWriteString(0,DBBranch,section,PAnsiChar(act^.wparam));
- end;
- end;
-
- if (act^.flags and (ACF_LCURRENT or ACF_LRESULT or ACF_LPARAM))=0 then
- begin
- StrCopy(p,opt_lparam);
- if (act^.flags and ACF_LPARNUM)<>0 then
- SaveNumValue(section,act^.lparam,(act^.flags2 and ACF2_SRV_LPAR)<>0)
-// DBWriteDWord(0,DBBranch,section,act^.lparam)
- else if act^.lparam<>0 then
- begin
- if (act^.flags and ACF_LSTRUCT)<>0 then
- DBWriteUTF8(0,DBBranch,section,pAnsiChar(act^.lparam))
- else if (act^.flags and ACF_LUNICODE)<>0 then
- DBWriteUnicode(0,DBBranch,section,pWideChar(act^.lparam))
- else
- DBWriteString(0,DBBranch,section,PAnsiChar(act^.lparam));
- end;
- end;
-
- end;
-
- ACT_PROGRAM: begin
- StrCopy(p,opt_prg ); DBWriteUnicode(0,DBBranch,section,act^.prgname);
- StrCopy(p,opt_args); DBWriteUnicode(0,DBBranch,section,act^.args);
- StrCopy(p,opt_time); DBWriteDWord (0,DBBranch,section,act^.time);
- StrCopy(p,opt_show); DBWriteDWord (0,DBBranch,section,act^.show);
- end;
-
- ACT_TEXT: begin
- if (act^.flags and ACF_CLIPBRD)=0 then
- begin
- StrCopy(p,opt_text); DBWriteUnicode(0,DBBranch,section,act^.text);
- if (act^.flags and ACF_FILE)<>0 then
- begin
- StrCopy(p,opt_file); DBWriteUnicode(0,DBBranch,section,act^.tfile);
- end;
- end;
- end;
-
- ACT_ADVANCE: begin
- StrCopy(p,opt_cond ); DBWriteByte (0,DBBranch,section,act^.condition);
- StrCopy(p,opt_value ); DBWriteDWord (0,DBBranch,section,act^.value);
- StrCopy(p,opt_action ); DBWriteByte (0,DBBranch,section,act^.action);
- StrCopy(p,opt_operval); DBWriteUnicode(0,DBBranch,section,act^.operval);
- StrCopy(p,opt_oper ); DBWriteByte (0,DBBranch,section,act^.oper);
- StrCopy(p,opt_mathval); DBWriteDWord (0,DBBranch,section,act^.mathval);
- StrCopy(p,opt_varval ); DBWriteUnicode(0,DBBranch,section,act^.varval);
- end;
-
- ACT_CHAIN: begin
- StrCopy(p,opt_text); DBWriteDWord(0,DBBranch,section,act^.id);
- end;
-
- ACT_RW: begin
- if (act^.flags and ACF_NOCNTCT)=0 then
- begin
- p^:=#0;
- SaveContact(act^.dbcontact,DBBranch,section);
- end;
- StrCopy(p,opt_module ); DBWriteString(0,DBBranch,section,act^.dbmodule);
- StrCopy(p,opt_setting); DBWriteString(0,DBBranch,section,act^.dbsetting);
- StrCopy(p,opt_value );
- if (act^.flags and ACF_DBUTEXT)=0 then
- begin
- SaveNumValue(section,act^.dbvalue,(act^.flags2 and ACF2_RW_TVAR)<>0);
-// DBWriteDWord(0,DBBranch,section,act^.dbvalue)
- end
- else
- DBWriteUnicode(0,DBBranch,section,pWideChar(act^.dbvalue));
- end;
-
- ACT_MESSAGE: begin
- StrCopy(p,opt_msgtitle); DBWriteUnicode(0,DBBranch,section,act^.msgtitle);
- StrCopy(p,opt_msgtext ); DBWriteUnicode(0,DBBranch,section,act^.msgtext);
- StrCopy(p,opt_boxopts ); DBWriteByte (0,DBBranch,section,act^.boxopts); //!!
- end;
-
- end;
- inc(result);
- inc(i);
- first:=ActionList^[first].next;
+//?? StrCopy(p,opt_uid); DBWriteDWord(0,DBBranch,section,Macro^.ActionList[i].uid);
+ p^:=#0;
+ Macro^.ActionList[i].Save(section,0);
end;
+
end;
-procedure SaveGroups;
+procedure SaveMacros;
var
- HK:pHKRecord;
- NumHK:integer;
- i,num:integer;
+ Macro:pMacroRecord;
+ OldNumMacros,NumMacros:integer;
+ i:integer;
section:array [0..127] of AnsiChar;
p,p1:PAnsiChar;
- Actions:integer;
begin
// even if crap in settings, skip on read
-// DBDeleteGroup(0,DBBranch,opt_group);
- HK:=@GroupList^;
- i:=MaxGroups;
- NumHK:=0;
- Actions:=1;
- DBWriteUnicode(0,DBBranch,'CLformat',fCLformat);
- DBWriteByte (0,DBBranch,'CLfilter',ord(fCLfilter));
+ DBWriteByte(0,DBBranch,'version' ,3);
+
+ OldNumMacros:=DBReadWord(0,DBBranch,opt_nummacro,0);
+
+ Macro:=MacroList[0];
+ i:=MacroList.Count;
+ NumMacros:=0;
p1:=StrCopyE(section,opt_group);
while i>0 do
begin
- with HK^ do
+ with Macro^ do
begin
if (flags and (ACF_ASSIGNED or ACF_VOLATILE))=ACF_ASSIGNED then
begin
- p:=StrEnd(IntToStr(p1,NumHK));
+ p:=StrEnd(IntToStr(p1,NumMacros));
p^:='/'; inc(p);
StrCopy(p,opt_id ); DBWriteDWord(0,DBBranch,section,id);
StrCopy(p,opt_flags); DBWriteDWord(0,DBBranch,section,flags);
- StrCopy(p,opt_descr);
- if descr<>nil then
- DBWriteUnicode (0,DBBranch,section,descr)
- else
- DBDeleteSetting(0,DBBranch,section);
+ StrCopy(p,opt_descr); DBWriteUnicode (0,DBBranch,section,descr);
p^:=#0;
- //??
- num:=SaveActions(section,firstAction);
- StrCopy(p,opt_numacts); DBWriteWord(0,DBBranch,section,num);
- inc(Actions,num);
- inc(NumHK);
+ SaveActions(Macro,section);
+
+ inc(NumMacros);
end;
end;
- inc(HK);
+ inc(Macro);
dec(i);
end;
- DBWriteWord(0,DBBranch,opt_numhk ,NumHK);
- DBWriteWord(0,DBBranch,opt_numacts,Actions-1);
+ DBWriteWord(0,DBBranch,opt_nummacro,NumMacros);
+
+ // deleting old unused macro settings
+ while OldNumMacros>NumMacros do
+ begin
+ dec(OldNumMacros);
+ IntToStr(p1,OldNumMacros);
+ DBDeleteGroup(0,DBBranch,section);
+ end;
end;
-//----- Load settings -----
+//===== Load settings =====
+
+//----- V2 settings processing -----
+
+const
+ ACT_CONTACT = 1;
+ ACT_SERVICE = 2;
+ ACT_PROGRAM = 3;
+ ACT_TEXT = 4;
+ ACT_ADVANCE = 5;
+ ACT_CHAIN = 6;
+ ACT_RW = 7;
+ ACT_MESSAGE = 8;
+
+// action flags
+const
+ ACF_MASK = $00FFFFFF;
-function LoadNumValue(setting:pAnsiChar;isvar:boolean):uint_ptr;
+ ACF_OLD_CLIPBRD = $00000002; // Clipboard operations, not window
+ ACF_OLD_FILE = $00000010; // File operations
+ ACF_OLD_FWRITE = $00000020; // read/write file
+ ACF_OLD_FAPPEND = $00000040; // append file
+
+const
+ OldVersion = 'Your Actman settings are for old version. If you are ready to upgrade settings, ' +
+ 'press OK. Else press Cancel and change manually Actman plugin back to old version ' +
+ 'or make settings backup. To keep previously exported macros please import them back ' +
+ 'before conversion.';
+ Notes = 'Please, don''t use macro test for non-saved macros. If you had ''Advanced'' or file ' +
+ 'writing actions previously, check them - their logic was changed.';
+ ConvResult = 'Actman settings converted to new version';
+
+procedure CheckActionList(Macro:pMacroRecord;num:integer);
+var
+ tmplist:pActionList;
begin
- if isvar then
- result:=uint_ptr(DBReadUnicode(0,DBBranch,setting,nil))
- else
- result:=DBReadDWord(0,DBBranch,setting);
+ if num=Macro^.ActionCount then
+ begin
+ GetMem(tmplist,SizeOf(tBaseAction)*(num+1));
+ move(Macro^.ActionList^,tmplist^,Macro^.ActionCount*SizeOf(tBaseAction));
+ FreeMem(Macro^.ActionList);
+ Macro^.ActionList:=tmplist;
+ Inc(Macro^.ActionCount);
+ end;
end;
-function LoadActions(section:pAnsiChar;count:integer):integer;
+function LoadActionsV2(Macro:pMacroRecord;section:pAnsiChar):boolean; stdcall;
var
- p,p1:PAnsiChar;
- act:tHKAction;
- i,num,oldnum:integer;
+ buf:array [0..31] of WideChar;
+ p,p1,pc:PAnsiChar;
+ action:tBaseAction;
+ actm:pActModule;
+ flags2,actionType:dword;
+ code,i,num,count:integer;
+ cond,act:byte;
begin
- result:=0;
- p1:=StrCopyE(StrEnd(section),opt_actions); // "Group#/Action"
+ result:=false;
+ p:=StrEnd(section);
+ StrCopy(p,opt_numacts); Macro^.ActionCount:=DBReadWord(0,DBBranch,section);
- oldnum:=0;
- for i:=1 to count do
+ if Macro^.ActionCount>0 then
begin
- p:=StrEnd(IntToStr(p1,i));
- p^:='/'; inc(p); // "Group#/Action#/"
- FillChar(act,SizeOf(act),0);
+ GetMem(Macro^.ActionList,SizeOf(tBaseAction)*Macro^.ActionCount);
+ p1:=StrCopyE(p,opt_actions); // "Group#/Action"
- StrCopy(p,opt_flags ); act.flags :=DBReadDWord (0,DBBranch,section,0);
- if (act.flags and ACF_ASSIGNED)<>0 then
+ num:=0;
+ count:=Macro^.ActionCount;
+ for i:=1 to count do
begin
- StrCopy(p,opt_flags2); act.flags2 :=DBReadDWord (0,DBBranch,section,0);
- StrCopy(p,opt_descr ); act.descr :=DBReadUnicode(0,DBBranch,section,nil);
- StrCopy(p,opt_type ); act.actionType:=DBReadByte (0,DBBranch,section,ACT_CONTACT);
+ p:=StrEnd(IntToStr(p1,i));
+ p^:='/'; inc(p); // "Group#/Action#/"
+
+ StrCopy(p,'type' ); actionType:=DBReadByte (0,DBBranch,section,ACT_CONTACT);
+ case actionType of
+ ACT_CONTACT: pc:='Contact';
+ ACT_SERVICE: pc:='Service';
+ ACT_PROGRAM: pc:='Program';
+ ACT_TEXT: pc:=nil;
+ ACT_ADVANCE: pc:=nil;
+ ACT_CHAIN: pc:='Chain';
+ ACT_RW: pc:='Database';
+ ACT_MESSAGE: pc:='MessageBox';
+ else
+ pc:=nil;
+ end;
+ if pc<>nil then
+ begin
+ actm :=GetLinkByName(pc);
+ action:=actm.Create;
+ end
+ else
+ begin
+ action:=nil;
+ end;
- case act.actionType of
+ p^:=#0;
+ case actionType of
ACT_CONTACT: begin
- p^:=#0;
- act.contact:=LoadContact(DBBranch,section);
+ action.Load(section,0);
end;
ACT_SERVICE: begin
- StrCopy(p,opt_service);
- act.service:=DBReadString(0,DBBranch,section,nil);
-
- if (act.flags and (ACF_WCURRENT or ACF_WRESULT or ACF_WPARAM))=0 then
- begin
- StrCopy(p,opt_wparam);
- if (act.flags and ACF_WPARNUM)<>0 then
- act.wparam:=LoadNumValue(section,(act.flags2 and ACF2_SRV_WPAR)<>0)
- else if (act.flags and ACF_WSTRUCT)<>0 then
- act.wparam:=wparam(DBReadUTF8(0,DBBranch,section,nil))
- else if (act.flags and ACF_WUNICODE)<>0 then
- act.wparam:=wparam(DBReadUnicode(0,DBBranch,section,nil))
- else
- act.wparam:=wparam(DBReadString (0,DBBranch,section,nil));
- end;
-
- if (act.flags and (ACF_LCURRENT or ACF_LRESULT or ACF_LPARAM))=0 then
- begin
- StrCopy(p,opt_lparam);
- if (act.flags and ACF_LPARNUM)<>0 then
- act.lparam:=LoadNumValue(section,(act.flags2 and ACF2_SRV_LPAR)<>0)
- // act.lparam:=DBReadDWord(0,DBBranch,section,0)
- else if (act.flags and ACF_LSTRUCT)<>0 then
- act.lparam:=lparam(DBReadUTF8(0,DBBranch,section,nil))
- else if (act.flags and ACF_LUNICODE)<>0 then
- act.lparam:=lparam(DBReadUnicode(0,DBBranch,section,nil))
- else
- act.lparam:=lparam(DBReadString(0,DBBranch,section,nil));
- end;
-
+ action.Load(section,100);
end;
ACT_PROGRAM: begin
- StrCopy(p,opt_prg ); act.prgname:=DBReadUnicode(0,DBBranch,section,nil);
- StrCopy(p,opt_args); act.args :=DBReadUnicode(0,DBBranch,section,nil);
- StrCopy(p,opt_time); act.time :=DBReadDWord (0,DBBranch,section,0);
- StrCopy(p,opt_show); act.show :=DBReadDWord (0,DBBranch,section,SW_SHOW);
+ action.Load(section,100);
end;
ACT_TEXT: begin
- if (act.flags and ACF_CLIPBRD)=0 then
+ StrCopy(p,opt_flags); flags2:=DBReadDWord(0,DBBranch,section,0);
+ p^:=#0;
+ if ((flags2 and ACF_OLD_CLIPBRD)=0) then
begin
- StrCopy(p,opt_text); act.text:=DBReadUnicode(0,DBBranch,section,nil);
- if (act.flags and ACF_FILE)<>0 then
+ if ((flags2 and ACF_OLD_FILE)=0) or ((flags2 and (ACF_OLD_FWRITE or ACF_OLD_FAPPEND)<>0)) then
begin
- StrCopy(p,opt_file); act.tfile:=DBReadUnicode(0,DBBranch,section,nil);
+ actm :=GetLinkByName('Text');
+ action:=actm.Create;
+
+ action.Load(section,100);
+
+ CheckActionList(Macro,num);
+ Macro^.ActionList^[num]:=action;
+ inc(num);
end;
end;
+
+ actm :=GetLinkByName('In/Out');
+ action:=actm.Create;
+
+ action.Load(section,100);
end;
ACT_ADVANCE: begin
- StrCopy(p,opt_cond ); act.condition:=DBReadByte (0,DBBranch,section);
- StrCopy(p,opt_value ); act.value :=DBReadDWord (0,DBBranch,section);
- StrCopy(p,opt_action ); act.action :=DBReadByte (0,DBBranch,section);
- StrCopy(p,opt_oper ); act.oper :=DBReadByte (0,DBBranch,section);
- StrCopy(p,opt_mathval); act.mathval :=DBReadDWord (0,DBBranch,section);
- StrCopy(p,opt_operval); act.operval :=DBReadUnicode(0,DBBranch,section);
- StrCopy(p,opt_varval ); act.varval :=DBReadUnicode(0,DBBranch,section);
+ StrCopy(p,'condition' ); cond:=DBReadByte(0,DBBranch,section);
+ StrCopy(p,'action'); act :=DBReadByte(0,DBBranch,section);
+ p^:=#0;
+ // get code of my list
+ code:=0;
+ if (cond and $0F)=0 then
+ begin
+ if act<>0 then code:=4; // action and jump
+ if (act and $F0)=0 then code:=6; // no action
+ if (act and $0F)=0 then code:=5; // no jump
+ end
+ else // with condition
+ begin
+ if act<>0 then code:=1; // action and jump
+ if (act and $F0)=0 then code:=2; // no action
+ if (act and $0F)=0 then code:=3; // no jump
+ end;
+ case code of
+ 1: begin // conditional action and jump
+ actm :=GetLinkByName('Jump'); // reversed condition jump to tmplabel
+ action:=actm.Create;
+ action.Load(section,102+i);
+ CheckActionList(Macro,num);
+ Macro^.ActionList^[num]:=action;
+ inc(num);
+
+ actm :=GetLinkByName('Text'); // action
+ action:=actm.Create;
+ action.Load(section,101);
+ CheckActionList(Macro,num);
+ Macro^.ActionList^[num]:=action;
+ inc(num);
+
+ actm :=GetLinkByName('Jump'); // jump to label (no condition)
+ action:=actm.Create;
+ action.Load(section,101);
+ CheckActionList(Macro,num);
+ Macro^.ActionList^[num]:=action;
+ inc(num);
+
+ actm :=GetLinkByName('Notes'); // tmplabel
+ action:=actm.Create;
+ mFreeMem(action.ActionDescr); // created by constructor
+ buf[0]:='$'; buf[1]:='$';
+ IntToStr(PWideChar(@buf[2]),i);
+ StrDupW(action.ActionDescr,buf);
+ end;
+ 2,6: begin // conditional and unconditional jump
+ actm :=GetLinkByName('Jump');
+ action:=actm.Create;
+
+ action.Load(section,100);
+ end;
+ 3: begin // conditional action
+ actm :=GetLinkByName('Jump');
+ action:=actm.Create;
+ action.Load(section,101+num);
+ CheckActionList(Macro,num);
+ Macro^.ActionList^[num]:=action;
+ inc(num);
+
+ actm :=GetLinkByName('Text');
+ action:=actm.Create;
+ action.Load(section,101);
+ CheckActionList(Macro,num);
+ Macro^.ActionList^[num]:=action;
+ inc(num);
+
+ actm :=GetLinkByName('Notes');
+ action:=actm.Create;
+ mFreeMem(action.ActionDescr); // created by constructor
+ buf[0]:='$'; buf[1]:='$';
+ StrDupW(action.ActionDescr,IntToStr(PWideChar(@buf[2]),num));
+ end;
+ 4: begin // action + unconditional jump
+ actm :=GetLinkByName('Text');
+ action:=actm.Create;
+ action.Load(section,101);
+ CheckActionList(Macro,num);
+ Macro^.ActionList^[num]:=action;
+ inc(num);
+
+ actm :=GetLinkByName('Jump');
+ action:=actm.Create;
+
+ action.Load(section,100);
+ end;
+ 5: begin // direct text action
+ actm :=GetLinkByName('Text');
+ action:=actm.Create;
+
+ action.Load(section,101);
+ end;
+ end;
end;
ACT_CHAIN: begin
- StrCopy(p,opt_text); act.id:=DBReadDWord(0,DBBranch,section);
+ action.Load(section,100);
end;
ACT_RW: begin
- if (act.flags and ACF_NOCNTCT)=0 then
- begin
- p^:=#0;
- act.dbcontact:=LoadContact(DBBranch,section);
- end;
- StrCopy(p,opt_module ); act.dbmodule :=DBReadString(0,DBBranch,section);
- StrCopy(p,opt_setting); act.dbsetting:=DBReadString(0,DBBranch,section);
- StrCopy(p,opt_value );
-
- if (act.flags and ACF_DBUTEXT)=0 then
- act.dbvalue:=LoadNumValue(section,(act.flags2 and ACF2_RW_TVAR)<>0)
- else
- act.dbvalue:=uint_ptr(DBReadUnicode(0,DBBranch,section));
+ action.Load(section,100);
end;
ACT_MESSAGE: begin
- StrCopy(p,opt_msgtitle); act.msgtitle:=DBReadUnicode(0,DBBranch,section);
- StrCopy(p,opt_msgtext ); act.msgtext :=DBReadUnicode(0,DBBranch,section);
- StrCopy(p,opt_boxopts ); act.boxopts :=DBReadByte (0,DBBranch,section);
+ action.Load(section,0);
+
+ StrCopy(p,'flags2'); flags2:=DBReadDWord(0,DBBranch,section,0);
+ action.flags:=(action.flags and not ACF_MASK) or flags2;
end;
end;
- num:=NewAction(ActionList,MaxActions);
- move(act,ActionList^[num],SizeOf(tHKAction));
- if i=1 then
- result:=num
- else
- ActionList^[oldnum].next:=num;
- oldnum:=num;
+
+ if action<>nil then
+ begin
+ CheckActionList(Macro,num);
+ Macro^.ActionList^[num]:=action;
+ inc(num);
+ end;
end;
end;
end;
-procedure LoadGroups;
+//----- V3 settings processing -----
+
+function LoadActions(Macro:pMacroRecord;section:pAnsiChar):integer; stdcall;
var
- HK:pHKRecord;
- i,num:cardinal;
p,p1:PAnsiChar;
- section:array [0..127] of AnsiChar;
- NumGroups,NumActions:cardinal;
+ actm:pActModule;
+ action:tBaseAction;
+ tmp:pActionList;
+ uid:dword;
+ i,num:integer;
begin
-{ remove doubling - no need? (called just once)
- if MaxGroups>0 then
+ result:=0;
+ p:=StrEnd(section);
+ StrCopy(p,opt_numacts); Macro^.ActionCount:=DBReadWord(0,DBBranch,section);
+ if Macro^.ActionCount>0 then
begin
- while MaxGroups>0 do
+ GetMem(Macro^.ActionList,SizeOf(tBaseAction)*Macro^.ActionCount);
+ p1:=StrCopyE(p,opt_actions); // "Group#/Action"
+
+ num:=0;
+ for i:=0 to Macro^.ActionCount-1 do
begin
- FreeGroup(MaxGroups);
- dec(MaxGroups);
+ p:=StrEnd(IntToStr(p1,i));
+ p^:='/'; inc(p); // "Group#/Action#/"
+
+ // get uid
+ StrCopy(p,opt_uid); uid:=DBReadDWord(0,DBBranch,section,0);
+ if uid<>0 then
+ begin
+ p^:=#0;
+ // call proper constructor
+ actm:=GetLink(uid);
+ if actm=nil then
+ continue;
+
+ action:=actm.Create;
+ // call proper loader
+ action.Load(section,0);
+
+ Macro^.ActionList^[num]:=action;
+ inc(num);
+ end;
end;
- FreeMem(GroupList);
- end;
-}
- NumGroups:=DBReadWord(0,DBBranch,opt_numhk,HKListPage);
- if NumGroups<HKListPage then
- MaxGroups:=HKListPage
- else
- MaxGroups:=NumGroups;
- GetMem (GroupList ,MaxGroups*SizeOf(tHKRecord));
- FillChar(GroupList^,MaxGroups*SizeOf(tHKRecord),0);
-
-{ remove doubling - no need? (called just once)
- if MaxActions<>0 then
- begin
- act:=@ActionList[1];
- while MaxActions>0 do
+ if Macro^.ActionCount<>num then
begin
- FreeAction(act);
- inc(act);
- dec(MaxActions);
+ GetMem(tmp,SizeOf(tBaseAction)*num);
+ move(Macro^.ActionList^,tmp^,SizeOf(tBaseAction)*num);
+ Macro^.ActionCount:=num;
+ FreeMem(Macro^.ActionList);
+ Macro^.ActionList:=tmp;
end;
- FreeMem(ActionList);
end;
-}
- NumActions:=DBReadWord(0,DBBranch,opt_numacts,ActListPage);
- if NumActions<ActListPage then
- MaxActions:=ActListPage
- else
- MaxActions:=NumActions+1;
- GetMem (ActionList ,MaxActions*SizeOf(tHKAction));
- FillChar(ActionList^,MaxActions*SizeOf(tHKAction),0);
-
- HK:=@GroupList^; //??
- i:=0;
- p1:=StrCopyE(section,opt_group);
- while i<NumGroups do
+end;
+
+procedure LoadMacros;
+var
+ Macro:pMacroRecord;
+ p,p1:PAnsiChar;
+ section:array [0..127] of AnsiChar;
+ tmp:pWideChar;
+ i:cardinal;
+ NumMacros:cardinal;
+ v2:bool;
+begin
+ NumMacros:=DBReadWord(0,DBBranch,opt_nummacro,0);
+ v2:=false;
+
+ // Check if old actman version used
+ if NumMacros>0 then
begin
- p:=StrEnd(IntToStr(p1,i));
- p^:='/'; inc(p);
+ // V2 counts actions from 1, not 0
+ v2:=DBReadDWord(0,DBBranch,'Group0/Action0/flags',$FFFFFFFF)=$FFFFFFFF;
- StrCopy(p,opt_flags);
- with HK^ do
+ if v2 then
begin
- flags:=DBReadDWord(0,DBBranch,section,0{integer(ACF_ASSIGNED or ACF_DISABLED)});
- if (flags and ACF_ASSIGNED)<>0 then // not needed in normal cases
+ if MessageBoxW(0,TranslateW(OldVersion),'Actman',MB_OKCANCEL or MB_ICONWARNING)<>IDOK then
begin
- StrCopy(p,opt_id ); id :=DBReadDWord (0,DBBranch,section);
- StrCopy(p,opt_descr); descr:=DBReadUnicode(0,DBBranch,section,nil);
- if descr=nil then
- StrDupW(descr,TranslateW('No description'));
+ MacroList:=tMacroList.Create(0);
+ exit;
+ end;
+ end;
+ end;
- StrCopy(p,opt_numacts); num:=DBReadWord(0,DBBranch,section);
- p^:=#0;
- firstAction:=LoadActions(section,num);
+ // Allocate macro list
+ MacroList:=tMacroList.Create(NumMacros);
+
+ // read macro list settings
+ if NumMacros>0 then //?? really, not so necessary
+ begin
+ Macro:=MacroList[0];
+ i:=0;
+ p1:=StrCopyE(section,opt_group);
+ while i<NumMacros do
+ begin
+ p:=StrEnd(IntToStr(p1,i));
+ p^:='/'; inc(p);
+
+ StrCopy(p,opt_flags);
+ with Macro^ do
+ begin
+ flags:=DBReadDWord(0,DBBranch,section,0) and ACF_TOSAVE;
+ if (flags and ACF_ASSIGNED)<>0 then //?? not needed in normal cases
+ begin
+ StrCopy(p,opt_id ); id :=DBReadDWord (0,DBBranch,section);
+ StrCopy(p,opt_descr); tmp:=DBReadUnicode(0,DBBranch,section,NoDescription);
+ StrCopyW(descr,tmp,MacroNameLen-1);
+ mFreeMem(tmp);
+ p^:=#0;
+ if v2 then
+ LoadActionsV2(Macro,section)
+ else
+ LoadActions(Macro,section);
+ end;
end;
+ inc(Macro);
+ inc(i);
+ end;
+
+ if v2 then
+ begin
+ DBDeleteSetting(0,DBBranch,opt_numacts);
+ SaveMacros;
+ MessageBoxW(0,TranslateW(Notes),TranslateW(ConvResult),MB_ICONINFORMATION);
end;
- inc(HK);
- inc(i);
end;
- fCLfilter:=DBReadByte (0,DBBranch,'CLfilter',0)<>0;
- fCLformat:=DBReadUnicode(0,DBBranch,'CLformat');
+
end;
diff --git a/plugins/Actman/i_services.inc b/plugins/Actman/i_services.inc index d835c9225a..2954fa4b15 100644 --- a/plugins/Actman/i_services.inc +++ b/plugins/Actman/i_services.inc @@ -1,5 +1,27 @@ {Basic ActMan services}
+function ActSelect(wParam:WPARAM;lParam:LPARAM):int_ptr;cdecl;
+begin
+ if odd(wParam) then
+ result:=int_ptr(MacroList.GetMacro(lParam))
+ else
+ result:=int_ptr(MacroList.GetMacro(pWideChar(lParam)));
+
+ if result<>0 then
+ with pMacroRecord(result)^ do
+ begin
+ if (wParam and 4)<>0 then
+ result:=ord((flags and ACF_SELECTED)<>0)
+ else
+ begin
+ if (wParam and 2)<>0 then
+ flags:=flags and not ACF_SELECTED
+ else
+ flags:=flags or ACF_SELECTED;
+ end;
+ end;
+end;
+
function ActFreeList(wParam:WPARAM;lParam:LPARAM):int_ptr;cdecl;
begin
result:=0;
@@ -9,12 +31,12 @@ end; function ActGetList(wParam:WPARAM;lParam:LPARAM):int_ptr;cdecl;
var
pc:^tChain;
- p:pHKRecord;
+ p:pMacroRecord;
i,cnt:integer;
begin
- p:=@GroupList[0];
+ p:=MacroList[0];
cnt:=0;
- for i:=0 to MaxGroups-1 do
+ for i:=0 to MacroList.Count-1 do
begin
if (p^.flags and (ACF_ASSIGNED or ACF_VOLATILE))=ACF_ASSIGNED then inc(cnt);
inc(p);
@@ -25,12 +47,11 @@ begin begin
mGetMem(pc,cnt*SizeOf(tChain)+4);
puint_ptr(lParam)^:=uint_ptr(pc);
-// {$IFDEF WIN64}pqword{$ELSE}pdword{$ENDIF}(lParam)^:=uint_ptr(pc);
pdword(pc)^:=SizeOf(tChain);
inc(PByte(pc),4);
- p:=@GroupList[0];
- for i:=0 to MaxGroups-1 do
+ p:=MacroList[0];
+ for i:=0 to MacroList.Count-1 do
begin
if (p^.flags and (ACF_ASSIGNED or ACF_VOLATILE))=ACF_ASSIGNED then
begin
@@ -44,88 +65,253 @@ begin end
else
puint_ptr(lParam)^:=0;
-// {$IFDEF WIN64}pqword{$ELSE}pdword{$ENDIF}(lParam)^:=0;
end;
-function ActRun(wParam:WPARAM;lParam:LPARAM):int_ptr;cdecl;
+//====================== Execute code =======================
+
+{$IFDEF DEBUG}
+procedure ActmanMacroDebug(txt:pWideChar);
+begin
+ OutputDebugStringW(txt);
+end;
+{$ENDIF}
+
+procedure DoAction(Macro:pMacroRecord;var WorkData:tWorkData);
var
- i:integer;
- p:pHKRecord;
+ res:LRESULT;
+ i,cnt:integer;
+{$IFDEF DEBUG}
+ buf:array [0..1023] of WideChar;
+ buf1,buf2:array [0..31] of WideChar;
+ p:pWideChar;
+{$ENDIF}
begin
- result:=-1;
- p:=@GroupList[0];
- for i:=0 to MaxGroups-1 do
+ cnt:=Macro^.ActionCount;
+ if cnt<>0 then
begin
- if ((p^.flags and ACF_ASSIGNED)<>0) and (p^.id=dword(wParam)) then
+//!! act:=CloneActions(action);
+ i:=0;
+ WorkData.ActionList :=Macro^.ActionList;
+ WorkData.ActionCount:=Macro^.ActionCount;
+ while i<cnt do
begin
- result:=p^.firstAction;
- break;
+ if (Macro^.ActionList^[i].flags and ACF_DISABLED)=0 then
+ begin
+{$IFDEF DEBUG}
+ if WorkData.ResultType=rtWide then
+ p:=pWideChar(WorkData.LastResult)
+ else
+ p:=IntToStr(buf2,WorkData.LastResult);
+ StrCopyEW(
+ StrCopyEW(
+ StrCopyEW(
+ StrCopyEW(
+ StrCopyEW(
+ StrCopyEW(
+ StrCopyEW(
+ StrCopyEW(buf,'ActMan: Macro "'),
+ Macro^.descr
+ ),'", Action #'
+ ),IntToStr(buf1,i)
+ ),' "'
+ ),Macro^.ActionList^[i].ActionDescr
+ ),'", LR: '
+ ),p{IIF(WorkData.ResultType=rtWide,
+ pWideChar(WorkData.LastResult),
+ IntToStr(buf1,WorkData.LastResult))}
+ );
+ ActmanMacroDebug(buf);
+{$ENDIF}
+ res:=Macro^.ActionList^[i].DoAction(WorkData);
+ if res<0 then break
+ else if res>0 then // res = next action number+1
+ begin
+ i:=res-1;
+ continue;
+ end;
+ end;
+ inc(i);
end;
- inc(p);
+//!! FreeActionsContinued(act_org);
end;
- if result>0 then
- result:=ActionStarter(result,lParam,p);
end;
-function ActRunGroup(wParam:WPARAM;lParam:LPARAM):int_ptr;cdecl;
+type
+ pActStartData = ^tActStartData;
+ tActStartData = record
+ macro :pMacroRecord;
+ event :THANDLE;
+ WorkData:tWorkData;
+ flags :dword;
+ end;
+
+procedure ThDoAction(arg:pActStartData); cdecl;
var
i:integer;
- p:pHKRecord;
begin
- result:=-1;
- p:=@GroupList[0];
- for i:=0 to MaxGroups-1 do
+ if (arg^.flags and ACTP_NOTIFY)<>0 then
begin
- if ((p^.flags and ACF_ASSIGNED)<>0) and (StrCmpW(p^.descr,pWideChar(wParam))=0) then
- begin
- result:=p^.firstAction;
- break;
- end;
- inc(p);
+ NotifyEventHooks(hevaction,arg^.macro.id,0); // started
+ arg^.macro.flags:=arg^.macro.flags or ACF_USEDNOW;
+ end;
+
+ DoAction(arg^.macro,arg^.WorkData);
+
+ if (arg^.flags and ACTP_NOTIFY)<>0 then
+ begin
+ arg^.macro.flags:=arg^.macro.flags and not ACF_USEDNOW;
+ NotifyEventHooks(hevaction,arg^.macro.id,1); // finished
+ end;
+
+ if arg^.event<>0 then // service, waiting
+ SetEvent(arg^.event)
+ else if (arg^.flags and ACTP_SAMETHREAD)=0 then // no waiting
+ begin
+ ClearResult(arg^.WorkData); // free last result memory if needs
+ // Free Storage
+ for i:=0 to 9 do
+ ClearResult(arg^.WorkData,i);
+ mFreeMem(arg); // free ActStartData (no time to free after)
end;
- if result>0 then
- result:=ActionStarter(result,lParam,p);
end;
-function ActRunParam(wParam:WPARAM;lParam:LPARAM):int_ptr;cdecl;
+function ActionStarter(macro:pMacroRecord;wd:pWorkData;flags:dword):LPARAM;
var
+ tmp:pActStartData;
i:integer;
- p:pHKRecord;
begin
- result:=-1;
- p:=@GroupList[0];
-
- if (pAct_Param(lParam)^.flags and ACTP_BYNAME)=0 then
+ mGetMem (tmp ,SizeOf(tActStartData));
+ FillChar(tmp^,SizeOf(tActStartData),0);
+
+ if wd<>nil then
begin
- for i:=0 to MaxGroups-1 do
- begin
- if ((p^.flags and ACF_ASSIGNED)<>0) and (p^.id=pAct_Param(lParam)^.Id) then
- begin
- result:=p^.firstAction;
- break;
+ tmp^.WorkData.ResultType:=wd^.ResultType;
+ case wd^.ResultType of
+ rtInt : tmp^.WorkData.LastResult:=wd^.LastResult;
+ rtWide: StrDupW(pWideChar(tmp^.WorkData.LastResult),pWideChar(wd^.LastResult));
+ rtAnsi: begin
+ AnsiToWide(pAnsiChar(wd^.LastResult),pWideChar(tmp^.WorkData.LastResult));
+ tmp^.WorkData.ResultType:=rtWide;
+ end;
+ rtUTF8: begin
+ UTF8ToWide(pAnsiChar(wd^.LastResult),pWideChar(tmp^.WorkData.LastResult));
+ tmp^.WorkData.ResultType:=rtWide;
end;
- inc(p);
end;
+ tmp^.WorkData.Parameter:=wd^.Parameter;
end
else
+ tmp^.WorkData.ResultType:=rtInt;
+
+ tmp^.macro :=macro;
+ tmp^.flags :=flags;
+
+ if (flags and ACTP_SAMETHREAD)<>0 then // with waiting, macro or service
begin
- for i:=0 to MaxGroups-1 do
+ tmp^.event:=0;
+ ThDoAction(tmp);
+ // keep text result (for macro from macro)
+ if (flags and ACTP_KEEPRESULT)<>0 then
begin
- if ((p^.flags and ACF_ASSIGNED)<>0) and
- (StrCmpW(p^.descr,pWideChar(pAct_Param(lParam)^.Id))=0) then
- begin
- result:=p^.firstAction;
- break;
- end;
- inc(p);
- end;
- end;
+ wd^.ResultType:=tmp^.WorkData.ResultType;
+ if wd^.ResultType=rtInt then
+ wd^.LastResult:=tmp^.WorkData.LastResult
+ else
+ StrDupW(pWideChar(wd^.LastResult),pWideChar(tmp^.WorkData.LastResult));
+ result:=0;
+ end
+ else if tmp^.WorkData.ResultType=rtInt then
+ result:=tmp^.WorkData.LastResult
+ // result no needs or macro from service
+ else
+ result:=StrToInt(pWideChar(tmp^.WorkData.LastResult));
+ end
- if result>0 then
+ else if (flags and ACTP_WAIT)<>0 then // with waiting, service
begin
- if (pAct_Param(lParam)^.flags and ACTP_WAIT)=0 then
- result:=ActionStarter (result,pAct_Param(lParam)^.wParam,p,pAct_Param(lParam)^.lParam)
+ tmp^.event:=CreateEvent(nil,FALSE,FALSE,nil);
+ {CloseHandle}(mir_forkthread(@ThDoAction,tmp));
+ //!!!!!!!!! movetmp structure (event handle) to array, not stack?
+ WaitForSingleObjectEx(tmp^.event,INFINITE,true);
+ CloseHandle(tmp^.event);
+ if tmp^.WorkData.ResultType=rtWide then
+ result:=StrToInt(pWideChar(tmp^.WorkData.LastResult))
else
- result:=ActionStarterWait(result,pAct_Param(lParam)^.wParam,p,pAct_Param(lParam)^.lParam);
+ result:=tmp^.WorkData.LastResult;
+ end
+
+ else // no waiting, service or macro
+ begin
+ tmp^.event:=0;
+ {CloseHandle}(mir_forkthread(@ThDoAction,tmp));
+ result:=0;
+ exit;
+ end;
+
+ ClearResult(tmp^.WorkData); // free last result memory if needs
+ // Free Storage
+ for i:=0 to 9 do
+ ClearResult(tmp^.WorkData,i);
+ mFreeMem(tmp); // free ActStartData (no time to free after)
+end;
+
+//----- execute services -----
+
+function ActRun(wParam:WPARAM;lParam:LPARAM):int_ptr;cdecl;
+var
+ p:pMacroRecord;
+ w:tWorkData;
+begin
+ result:=-1;
+ p:=MacroList.GetMacro(wParam);
+ if p<>nil then
+ begin
+ FillChar(w,SizeOf(w),0);
+ w.ResultType:=rtInt;
+ w.Parameter:=lParam;
+ result:=ActionStarter(p,@w,ACTP_SAMETHREAD);
+ end;
+end;
+
+function ActRunGroup(wParam:WPARAM;lParam:LPARAM):int_ptr;cdecl;
+var
+ p:pMacroRecord;
+ w:tWorkData;
+begin
+ result:=-1;
+ p:=MacroList.GetMacro(pWideChar(wParam));
+ if p<>nil then
+ begin
+ FillChar(w,SizeOf(w),0);
+ w.ResultType:=rtInt;
+ w.Parameter:=lParam;
+ result:=ActionStarter(p,@w,ACTP_SAMETHREAD);
+ end;
+end;
+
+function ActRunParam(wParam:WPARAM;lParam:LPARAM):int_ptr;cdecl;
+var
+ p:pMacroRecord;
+ w:tWorkData;
+begin
+ result:=-1;
+ if (pAct_Param(lParam)^.flags and ACTP_BYNAME)=0 then
+ p:=MacroList.GetMacro(pAct_Param(lParam)^.Id)
+ else
+ p:=MacroList.GetMacro(pWideChar(pAct_Param(lParam)^.Id));
+
+ if p<>nil then
+ begin
+ FillChar(w,SizeOf(w),0);
+ w.Parameter :=pAct_Param(lParam)^.wParam;
+ w.LastResult:=pAct_Param(lParam)^.lParam;
+ w.ResultType:=pAct_Param(lParam)^.lPType;
+ result:=ActionStarter(p,@w,pAct_Param(lParam)^.flags);
+ if (pAct_Param(lParam)^.flags and (ACTP_KEEPRESULT or ACTP_SAMETHREAD))=
+ (ACTP_KEEPRESULT or ACTP_SAMETHREAD) then
+ begin
+ pAct_Param(lParam)^.lParam:=w.LastResult;
+ pAct_Param(lParam)^.lPType:=w.ResultType;
+ end;
end;
end;
diff --git a/plugins/Actman30/iac_.pas b/plugins/Actman/iac_.pas index 5a47ba96a1..5a47ba96a1 100644 --- a/plugins/Actman30/iac_.pas +++ b/plugins/Actman/iac_.pas diff --git a/plugins/Actman30/iac_call.pas b/plugins/Actman/iac_call.pas index f5235e2f2e..f5235e2f2e 100644 --- a/plugins/Actman30/iac_call.pas +++ b/plugins/Actman/iac_call.pas diff --git a/plugins/Actman30/iac_call.rc b/plugins/Actman/iac_call.rc index f32f7bc303..f32f7bc303 100644 --- a/plugins/Actman30/iac_call.rc +++ b/plugins/Actman/iac_call.rc diff --git a/plugins/Actman30/iac_call.res b/plugins/Actman/iac_call.res Binary files differindex bda9bc40b1..bda9bc40b1 100644 --- a/plugins/Actman30/iac_call.res +++ b/plugins/Actman/iac_call.res diff --git a/plugins/Actman30/iac_chain.pas b/plugins/Actman/iac_chain.pas index 48b187259f..48b187259f 100644 --- a/plugins/Actman30/iac_chain.pas +++ b/plugins/Actman/iac_chain.pas diff --git a/plugins/Actman30/iac_chain.rc b/plugins/Actman/iac_chain.rc index edde6de616..edde6de616 100644 --- a/plugins/Actman30/iac_chain.rc +++ b/plugins/Actman/iac_chain.rc diff --git a/plugins/Actman30/iac_chain.res b/plugins/Actman/iac_chain.res Binary files differindex 777e3bc186..777e3bc186 100644 --- a/plugins/Actman30/iac_chain.res +++ b/plugins/Actman/iac_chain.res diff --git a/plugins/Actman30/iac_contact.pas b/plugins/Actman/iac_contact.pas index 55afcfba2f..55afcfba2f 100644 --- a/plugins/Actman30/iac_contact.pas +++ b/plugins/Actman/iac_contact.pas diff --git a/plugins/Actman30/iac_contact.rc b/plugins/Actman/iac_contact.rc index 65a7d2843e..65a7d2843e 100644 --- a/plugins/Actman30/iac_contact.rc +++ b/plugins/Actman/iac_contact.rc diff --git a/plugins/Actman30/iac_contact.res b/plugins/Actman/iac_contact.res Binary files differindex e146eaf451..e146eaf451 100644 --- a/plugins/Actman30/iac_contact.res +++ b/plugins/Actman/iac_contact.res diff --git a/plugins/Actman30/iac_database.rc b/plugins/Actman/iac_database.rc index cc9f309ebf..cc9f309ebf 100644 --- a/plugins/Actman30/iac_database.rc +++ b/plugins/Actman/iac_database.rc diff --git a/plugins/Actman30/iac_database.res b/plugins/Actman/iac_database.res Binary files differindex b4de95c9e7..b4de95c9e7 100644 --- a/plugins/Actman30/iac_database.res +++ b/plugins/Actman/iac_database.res diff --git a/plugins/Actman30/iac_dbrw.pas b/plugins/Actman/iac_dbrw.pas index 7ddbe0b61c..7ddbe0b61c 100644 --- a/plugins/Actman30/iac_dbrw.pas +++ b/plugins/Actman/iac_dbrw.pas diff --git a/plugins/Actman30/iac_global.pas b/plugins/Actman/iac_global.pas index 03425c6027..03425c6027 100644 --- a/plugins/Actman30/iac_global.pas +++ b/plugins/Actman/iac_global.pas diff --git a/plugins/Actman30/iac_ini.pas b/plugins/Actman/iac_ini.pas index 03c8d7a9d6..03c8d7a9d6 100644 --- a/plugins/Actman30/iac_ini.pas +++ b/plugins/Actman/iac_ini.pas diff --git a/plugins/Actman30/iac_ini.rc b/plugins/Actman/iac_ini.rc index 56658b91c4..56658b91c4 100644 --- a/plugins/Actman30/iac_ini.rc +++ b/plugins/Actman/iac_ini.rc diff --git a/plugins/Actman30/iac_ini.res b/plugins/Actman/iac_ini.res Binary files differindex 177a309738..177a309738 100644 --- a/plugins/Actman30/iac_ini.res +++ b/plugins/Actman/iac_ini.res diff --git a/plugins/Actman30/iac_inout.pas b/plugins/Actman/iac_inout.pas index 42e36913ff..42e36913ff 100644 --- a/plugins/Actman30/iac_inout.pas +++ b/plugins/Actman/iac_inout.pas diff --git a/plugins/Actman30/iac_inout.rc b/plugins/Actman/iac_inout.rc index ca61e5f492..ca61e5f492 100644 --- a/plugins/Actman30/iac_inout.rc +++ b/plugins/Actman/iac_inout.rc diff --git a/plugins/Actman30/iac_inout.res b/plugins/Actman/iac_inout.res Binary files differindex f912dc3066..f912dc3066 100644 --- a/plugins/Actman30/iac_inout.res +++ b/plugins/Actman/iac_inout.res diff --git a/plugins/Actman30/iac_jump.pas b/plugins/Actman/iac_jump.pas index 4ac0473405..4ac0473405 100644 --- a/plugins/Actman30/iac_jump.pas +++ b/plugins/Actman/iac_jump.pas diff --git a/plugins/Actman30/iac_jump.rc b/plugins/Actman/iac_jump.rc index 4731042c38..4731042c38 100644 --- a/plugins/Actman30/iac_jump.rc +++ b/plugins/Actman/iac_jump.rc diff --git a/plugins/Actman30/iac_jump.res b/plugins/Actman/iac_jump.res Binary files differindex 387b85dfdd..387b85dfdd 100644 --- a/plugins/Actman30/iac_jump.res +++ b/plugins/Actman/iac_jump.res diff --git a/plugins/Actman30/iac_messagebox.pas b/plugins/Actman/iac_messagebox.pas index 41a1068ab2..41a1068ab2 100644 --- a/plugins/Actman30/iac_messagebox.pas +++ b/plugins/Actman/iac_messagebox.pas diff --git a/plugins/Actman30/iac_messagebox.rc b/plugins/Actman/iac_messagebox.rc index 09710dfb2f..09710dfb2f 100644 --- a/plugins/Actman30/iac_messagebox.rc +++ b/plugins/Actman/iac_messagebox.rc diff --git a/plugins/Actman30/iac_messagebox.res b/plugins/Actman/iac_messagebox.res Binary files differindex 70c7638087..70c7638087 100644 --- a/plugins/Actman30/iac_messagebox.res +++ b/plugins/Actman/iac_messagebox.res diff --git a/plugins/Actman30/iac_notes.pas b/plugins/Actman/iac_notes.pas index 182e1aba9e..182e1aba9e 100644 --- a/plugins/Actman30/iac_notes.pas +++ b/plugins/Actman/iac_notes.pas diff --git a/plugins/Actman30/iac_notes.rc b/plugins/Actman/iac_notes.rc index a9ca1bc5ef..a9ca1bc5ef 100644 --- a/plugins/Actman30/iac_notes.rc +++ b/plugins/Actman/iac_notes.rc diff --git a/plugins/Actman30/iac_notes.res b/plugins/Actman/iac_notes.res Binary files differindex 72d05137cd..72d05137cd 100644 --- a/plugins/Actman30/iac_notes.res +++ b/plugins/Actman/iac_notes.res diff --git a/plugins/Actman30/iac_program.pas b/plugins/Actman/iac_program.pas index 33924c4279..33924c4279 100644 --- a/plugins/Actman30/iac_program.pas +++ b/plugins/Actman/iac_program.pas diff --git a/plugins/Actman30/iac_program.rc b/plugins/Actman/iac_program.rc index 0460c5c9ac..0460c5c9ac 100644 --- a/plugins/Actman30/iac_program.rc +++ b/plugins/Actman/iac_program.rc diff --git a/plugins/Actman30/iac_program.res b/plugins/Actman/iac_program.res Binary files differindex a7754455b4..a7754455b4 100644 --- a/plugins/Actman30/iac_program.res +++ b/plugins/Actman/iac_program.res diff --git a/plugins/Actman30/iac_service.pas b/plugins/Actman/iac_service.pas index 205bc67a6f..205bc67a6f 100644 --- a/plugins/Actman30/iac_service.pas +++ b/plugins/Actman/iac_service.pas diff --git a/plugins/Actman30/iac_service.rc b/plugins/Actman/iac_service.rc index ff9f972ff4..ff9f972ff4 100644 --- a/plugins/Actman30/iac_service.rc +++ b/plugins/Actman/iac_service.rc diff --git a/plugins/Actman30/iac_service.res b/plugins/Actman/iac_service.res Binary files differindex c26f2d4319..c26f2d4319 100644 --- a/plugins/Actman30/iac_service.res +++ b/plugins/Actman/iac_service.res diff --git a/plugins/Actman30/iac_settings.pas b/plugins/Actman/iac_settings.pas index 3997fbe73d..3997fbe73d 100644 --- a/plugins/Actman30/iac_settings.pas +++ b/plugins/Actman/iac_settings.pas diff --git a/plugins/Actman30/iac_settings.rc b/plugins/Actman/iac_settings.rc index 69487dd87d..69487dd87d 100644 --- a/plugins/Actman30/iac_settings.rc +++ b/plugins/Actman/iac_settings.rc diff --git a/plugins/Actman30/iac_settings.res b/plugins/Actman/iac_settings.res Binary files differindex 1aaef00324..1aaef00324 100644 --- a/plugins/Actman30/iac_settings.res +++ b/plugins/Actman/iac_settings.res diff --git a/plugins/Actman30/iac_storage.pas b/plugins/Actman/iac_storage.pas index 500d366334..500d366334 100644 --- a/plugins/Actman30/iac_storage.pas +++ b/plugins/Actman/iac_storage.pas diff --git a/plugins/Actman30/iac_storage.rc b/plugins/Actman/iac_storage.rc index 6e4391e15c..6e4391e15c 100644 --- a/plugins/Actman30/iac_storage.rc +++ b/plugins/Actman/iac_storage.rc diff --git a/plugins/Actman30/iac_storage.res b/plugins/Actman/iac_storage.res Binary files differindex b87ec5fec2..b87ec5fec2 100644 --- a/plugins/Actman30/iac_storage.res +++ b/plugins/Actman/iac_storage.res diff --git a/plugins/Actman30/iac_text.pas b/plugins/Actman/iac_text.pas index 68f9acf7ba..68f9acf7ba 100644 --- a/plugins/Actman30/iac_text.pas +++ b/plugins/Actman/iac_text.pas diff --git a/plugins/Actman30/iac_text.rc b/plugins/Actman/iac_text.rc index 63fd664420..63fd664420 100644 --- a/plugins/Actman30/iac_text.rc +++ b/plugins/Actman/iac_text.rc diff --git a/plugins/Actman30/iac_text.res b/plugins/Actman/iac_text.res Binary files differindex 21f8140ee7..21f8140ee7 100644 --- a/plugins/Actman30/iac_text.res +++ b/plugins/Actman/iac_text.res diff --git a/plugins/Actman/ico/advance.ico b/plugins/Actman/ico/advance.ico Binary files differindex 6cc054ccc3..fa6c604542 100644 --- a/plugins/Actman/ico/advance.ico +++ b/plugins/Actman/ico/advance.ico diff --git a/plugins/Actman/ico/apply.ico b/plugins/Actman/ico/apply.ico Binary files differindex 27def2fb4b..80c3802c09 100644 --- a/plugins/Actman/ico/apply.ico +++ b/plugins/Actman/ico/apply.ico diff --git a/plugins/Actman30/ico/call.ico b/plugins/Actman/ico/call.ico Binary files differindex ddddb59074..ddddb59074 100644 --- a/plugins/Actman30/ico/call.ico +++ b/plugins/Actman/ico/call.ico diff --git a/plugins/Actman/ico/chain.ico b/plugins/Actman/ico/chain.ico Binary files differindex d3a9c9b59c..3a98b8ac30 100644 --- a/plugins/Actman/ico/chain.ico +++ b/plugins/Actman/ico/chain.ico diff --git a/plugins/Actman/ico/contact.ico b/plugins/Actman/ico/contact.ico Binary files differindex 5f06f02312..8174fa221a 100644 --- a/plugins/Actman/ico/contact.ico +++ b/plugins/Actman/ico/contact.ico diff --git a/plugins/Actman/ico/delete.ico b/plugins/Actman/ico/delete.ico Binary files differindex 3770daf2fc..eea851da19 100644 --- a/plugins/Actman/ico/delete.ico +++ b/plugins/Actman/ico/delete.ico diff --git a/plugins/Actman/ico/down.ico b/plugins/Actman/ico/down.ico Binary files differindex 79ec3929df..d4fdb83bbf 100644 --- a/plugins/Actman/ico/down.ico +++ b/plugins/Actman/ico/down.ico diff --git a/plugins/Actman/ico/export.ico b/plugins/Actman/ico/export.ico Binary files differindex 7c6b07c71a..ddddb59074 100644 --- a/plugins/Actman/ico/export.ico +++ b/plugins/Actman/ico/export.ico diff --git a/plugins/Actman/ico/format.ico b/plugins/Actman/ico/format.ico Binary files differindex 7c6b07c71a..ddddb59074 100644 --- a/plugins/Actman/ico/format.ico +++ b/plugins/Actman/ico/format.ico diff --git a/plugins/Actman/ico/import.ico b/plugins/Actman/ico/import.ico Binary files differindex a3d5232741..481da4dbaf 100644 --- a/plugins/Actman/ico/import.ico +++ b/plugins/Actman/ico/import.ico diff --git a/plugins/Actman30/ico/ini.ico b/plugins/Actman/ico/ini.ico Binary files differindex 481da4dbaf..481da4dbaf 100644 --- a/plugins/Actman30/ico/ini.ico +++ b/plugins/Actman/ico/ini.ico diff --git a/plugins/Actman/ico/insert.ico b/plugins/Actman/ico/insert.ico Binary files differindex a3d5232741..481da4dbaf 100644 --- a/plugins/Actman/ico/insert.ico +++ b/plugins/Actman/ico/insert.ico diff --git a/plugins/Actman30/ico/jump.ico b/plugins/Actman/ico/jump.ico Binary files differindex 3a98b8ac30..3a98b8ac30 100644 --- a/plugins/Actman30/ico/jump.ico +++ b/plugins/Actman/ico/jump.ico diff --git a/plugins/Actman/ico/message.ico b/plugins/Actman/ico/message.ico Binary files differindex 6cc054ccc3..fa6c604542 100644 --- a/plugins/Actman/ico/message.ico +++ b/plugins/Actman/ico/message.ico diff --git a/plugins/Actman/ico/new.ico b/plugins/Actman/ico/new.ico Binary files differindex fcfa03a6ad..73937210e0 100644 --- a/plugins/Actman/ico/new.ico +++ b/plugins/Actman/ico/new.ico diff --git a/plugins/Actman30/ico/notes.ico b/plugins/Actman/ico/notes.ico Binary files differindex fa6c604542..fa6c604542 100644 --- a/plugins/Actman30/ico/notes.ico +++ b/plugins/Actman/ico/notes.ico diff --git a/plugins/Actman/ico/program.ico b/plugins/Actman/ico/program.ico Binary files differindex 0ce8a9a24d..30c7df1875 100644 --- a/plugins/Actman/ico/program.ico +++ b/plugins/Actman/ico/program.ico diff --git a/plugins/Actman/ico/reload.ico b/plugins/Actman/ico/reload.ico Binary files differindex feadf04bf2..dc070c5083 100644 --- a/plugins/Actman/ico/reload.ico +++ b/plugins/Actman/ico/reload.ico diff --git a/plugins/Actman/ico/rw.ico b/plugins/Actman/ico/rw.ico Binary files differindex df5cd0f6c7..d5927ebb08 100644 --- a/plugins/Actman/ico/rw.ico +++ b/plugins/Actman/ico/rw.ico diff --git a/plugins/Actman/ico/service.ico b/plugins/Actman/ico/service.ico Binary files differindex 7c6b07c71a..ddddb59074 100644 --- a/plugins/Actman/ico/service.ico +++ b/plugins/Actman/ico/service.ico diff --git a/plugins/Actman30/ico/settings.ico b/plugins/Actman/ico/settings.ico Binary files differindex ddddb59074..ddddb59074 100644 --- a/plugins/Actman30/ico/settings.ico +++ b/plugins/Actman/ico/settings.ico diff --git a/plugins/Actman30/ico/storage.ico b/plugins/Actman/ico/storage.ico Binary files differindex dc070c5083..dc070c5083 100644 --- a/plugins/Actman30/ico/storage.ico +++ b/plugins/Actman/ico/storage.ico diff --git a/plugins/Actman/ico/test.ico b/plugins/Actman/ico/test.ico Binary files differindex 06db21a127..345530ba76 100644 --- a/plugins/Actman/ico/test.ico +++ b/plugins/Actman/ico/test.ico diff --git a/plugins/Actman30/ico/text.ico b/plugins/Actman/ico/text.ico Binary files differindex fa6c604542..fa6c604542 100644 --- a/plugins/Actman30/ico/text.ico +++ b/plugins/Actman/ico/text.ico diff --git a/plugins/Actman/ico/up.ico b/plugins/Actman/ico/up.ico Binary files differindex 6efc4d7257..56fde31eda 100644 --- a/plugins/Actman/ico/up.ico +++ b/plugins/Actman/ico/up.ico diff --git a/plugins/Actman30/inoutini.pas b/plugins/Actman/inoutini.pas index 38dab2be45..38dab2be45 100644 --- a/plugins/Actman30/inoutini.pas +++ b/plugins/Actman/inoutini.pas diff --git a/plugins/Actman30/inoutxml.pas b/plugins/Actman/inoutxml.pas index cd11c1a963..cd11c1a963 100644 --- a/plugins/Actman30/inoutxml.pas +++ b/plugins/Actman/inoutxml.pas diff --git a/plugins/Actman30/lowlevelc.pas b/plugins/Actman/lowlevelc.pas index fe6d9bde31..fe6d9bde31 100644 --- a/plugins/Actman30/lowlevelc.pas +++ b/plugins/Actman/lowlevelc.pas diff --git a/plugins/Actman30/mApiCard.res b/plugins/Actman/mApiCard.res Binary files differindex 7d6ed320b9..7d6ed320b9 100644 --- a/plugins/Actman30/mApiCard.res +++ b/plugins/Actman/mApiCard.res diff --git a/plugins/Actman30/m_actman.h b/plugins/Actman/m_actman.h index c900ba9c6c..c900ba9c6c 100644 --- a/plugins/Actman30/m_actman.h +++ b/plugins/Actman/m_actman.h diff --git a/plugins/Actman/options.rc b/plugins/Actman/options.rc index c221bf0f49..98be11b605 100644 --- a/plugins/Actman/options.rc +++ b/plugins/Actman/options.rc @@ -1,45 +1,7 @@ #include "i_const.inc"
LANGUAGE 0,0
-/*
-IDD_STRUCTURE DIALOGEX 0, 0, 332,184, 0
-STYLE DS_SETFONT | DS_FIXEDSYS | WS_VISIBLE | WS_THICKFRAME
-CAPTION "Structure editor"
-//EXSTYLE WS_EX_CONTROLPARENT
-FONT 8, "MS Shell Dlg", 0, 0
-{
- CONTROL "" , IDC_DATA_FULL, "SysListView32",
- WS_BORDER | WS_TABSTOP |
- LVS_NOCOLUMNHEADER | LVS_SHOWSELALWAYS |
- LVS_SINGLESEL | LVS_REPORT,
- 2, 2, 160, 180, WS_EX_CONTROLPARENT
-
- CONTROL "New" ,IDC_DATA_NEW ,"MButtonClass",WS_TABSTOP,166, 2,16,16,$18000000// | WS_GROUP
- CONTROL "Up" ,IDC_DATA_UP ,"MButtonClass",WS_TABSTOP,166,22,16,16,$18000000
- CONTROL "Down" ,IDC_DATA_DOWN ,"MButtonClass",WS_TABSTOP,166,40,16,16,$18000000
- CONTROL "Delete",IDC_DATA_DELETE,"MButtonClass",WS_TABSTOP,166,60,16,16,$18000000
-
- COMBOBOX IDC_DATA_TYPE , 186, 2, 142, 96, CBS_DROPDOWNLIST | WS_VSCROLL
- EDITTEXT IDC_DATA_LEN , 186, 18, 32, 11
- LTEXT "Data length" ,-1 , 222, 18, 106, 11, SS_CENTERIMAGE
- EDITTEXT IDC_DATA_EDIT, 186, 32, 142, 11, ES_AUTOHSCROLL
- AUTOCHECKBOX "Use Variables", IDC_DATA_VARS, 186, 45, 142, 14
-
- DEFPUSHBUTTON "&Change", IDC_DATA_CHANGE, 186, 62, 46, 14//, WS_GROUP
- PUSHBUTTON "&OK" , IDOK , 234, 62, 46, 14
- PUSHBUTTON "C&ancel", IDCANCEL , 282, 62, 46, 14
-
- AUTOCHECKBOX "Packed structure", IDC_DATA_PACKED, 166, 78, 162, 14
- CTEXT "Use Byte array/pointer for ANSI strings\n"\
- "Use Word array/pointer for Unicode strings\n\n"\
- "$## replaces by byte with hex value ##\n"\
- "$#### replaces by word with hex value #### (for Unicode strings only)\n\n"\
- "All data length calculating in bytes",
- IDC_DATA_HELP,166,94,162,88
-
-}
-*/
IDD_ACTION DIALOGEX 0, 0, 304, 226, 0
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE
EXSTYLE WS_EX_CONTROLPARENT
@@ -48,13 +10,12 @@ FONT 8, "MS Shell Dlg", 0, 0 CONTROL "New" ,IDC_GROUP_NEW ,"MButtonClass",WS_TABSTOP,114, 1,16,16,$18000000 | WS_GROUP
CONTROL "Up" ,IDC_GROUP_UP ,"MButtonClass",WS_TABSTOP,114, 18,16,16,$18000000
CONTROL "Down" ,IDC_GROUP_DOWN ,"MButtonClass",WS_TABSTOP,114, 34,16,16,$18000000
- CONTROL "Reload",IDC_GROUP_RELOAD,"MButtonClass",WS_TABSTOP,114, 51,16,16,$18000000
CONTROL "Delete",IDC_GROUP_DELETE,"MButtonClass",WS_TABSTOP,114, 68,16,16,$18000000
CONTROL "Test" ,IDC_GROUP_TEST ,"MButtonClass",WS_TABSTOP,114, 85,16,16,$18000000
- CONTROL "Export",IDC_GROUP_EXPORT,"MButtonClass",WS_TABSTOP,114,102,16,16,$18000000
- CONTROL "Import",IDC_GROUP_IMPORT,"MButtonClass",WS_TABSTOP,114,119,16,16,$18000000
+// CONTROL "Export",IDC_GROUP_EXPORT,"MButtonClass",WS_TABSTOP,114,102,16,16,$18000000
+// CONTROL "Import",IDC_GROUP_IMPORT,"MButtonClass",WS_TABSTOP,114,119,16,16,$18000000
- CONTROL "", IDC_ACTION_GROUP, "SysListView32",
+ CONTROL "", IDC_MACRO_LIST, "SysListView32",
WS_BORDER | WS_TABSTOP |
LVS_NOCOLUMNHEADER | LVS_SHOWSELALWAYS | LVS_REPORT | LVS_EDITLABELS,// | LVS_SINGLESEL,
0, 2, 110, 132, WS_EX_CONTROLPARENT
@@ -76,231 +37,11 @@ FONT 8, "MS Shell Dlg", 0, 0 RTEXT "Action",IDC_STAT_ACTION, 135, 6, 63, 12, SS_CENTERIMAGE
CONTROL "", IDC_ACTION_TYPE, "ComboBoxEx32",
WS_TABSTOP | WS_VSCROLL | CBS_AUTOHSCROLL | CBS_DROPDOWNLIST, 200, 6, 101, 96
-
-// Contact
- RTEXT "Choose contact", IDC_STAT_CONTACT , 135, 24, 160, 10
- COMBOBOX IDC_CONTACTLIST, 135, 35, 166, 128, CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL
- AUTOCHECKBOX "Keep handle only" , IDC_CNT_KEEP , 135, 53, 160, 11
- AUTOCHECKBOX "Active accounts only",IDC_CNT_FILTER, 135, 65, 160, 11
- RTEXT "Dropdown list format",IDC_STAT_FORMAT, 135, 78, 160, 11
- EDITTEXT IDC_EDIT_FORMAT , 153, 92, 142, 12, ES_AUTOHSCROLL
- CONTROL "Apply",IDC_CNT_APPLY,"MButtonClass",WS_TABSTOP,135,90,16,16,$18000000
- CTEXT "You can use %name%, %uid%, %account% and %group% macros",IDC_STAT_FHELP, 135, 107, 160, 24
-
-// Service
- RTEXT "wParam type", IDC_STAT_WPAR1, 135, 125, 63, 14, SS_CENTERIMAGE
- COMBOBOX IDC_FLAG_WPAR , 200, 125, 102, 56, CBS_DROPDOWNLIST | WS_VSCROLL
- RTEXT "lParam type", IDC_STAT_LPAR1, 135, 140, 63, 14, SS_CENTERIMAGE
- COMBOBOX IDC_FLAG_LPAR , 200, 140, 102, 56, CBS_DROPDOWNLIST | WS_VSCROLL
-
- RTEXT "Service name", IDC_STAT_SERVICE, 135, 153, 160, 8
- AUTOCHECKBOX "", IDC_SRV_SRVC,135,162,8,8,BS_ICON | BS_PUSHLIKE
- COMBOBOX IDC_EDIT_SERVICE, 144, 162, 157, 96, CBS_DROPDOWN | WS_VSCROLL | CBS_AUTOHSCROLL | CBS_SORT
- RTEXT "wParam" , IDC_STAT_WPAR , 135, 177, 160, 8
- AUTOCHECKBOX "", IDC_SRV_WPAR,135,186,8,8,BS_ICON | BS_PUSHLIKE
- COMBOBOX IDC_EDIT_WPAR , 144, 186, 157, 76, CBS_DROPDOWN | WS_VSCROLL | CBS_AUTOHSCROLL
- RTEXT "lParam" , IDC_STAT_LPAR , 135, 201, 160, 8
- AUTOCHECKBOX "", IDC_SRV_LPAR,135,210,8,8,BS_ICON | BS_PUSHLIKE
- COMBOBOX IDC_EDIT_LPAR , 144, 210, 157, 76, CBS_DROPDOWN | WS_VSCROLL | CBS_AUTOHSCROLL
- PUSHBUTTON "Structure" , IDC_WSTRUCT , 135, 186, 166, 14
- PUSHBUTTON "Structure" , IDC_LSTRUCT , 135, 210, 166, 14
-
- GROUPBOX "Result action" , IDC_RES_GROUP , 135, 24, 166, 99, WS_GROUP
- AUTOCHECKBOX "Show in popup" , IDC_RES_POPUP , 138, 34, 159, 11
- AUTOCHECKBOX "Show in messagebox" , IDC_RES_MESSAGE, 138, 45, 159, 11
- AUTOCHECKBOX "Insert into message", IDC_RES_INSERT , 138, 56, 159, 11
-
- LTEXT "Service result" , IDC_SRV_RESSTAT, 138, 72, 159, 11
- COMBOBOX IDC_SRV_RESULT , 138, 83, 159, 76, CBS_DROPDOWN | WS_VSCROLL | CBS_AUTOHSCROLL
- AUTOCHECKBOX "Free memory" , IDC_RES_FREEMEM, 138, 99, 159, 11
- AUTOCHECKBOX "Unicode string" , IDC_RES_UNICODE, 138, 110, 159, 11
- AUTOCHECKBOX "Signed value" , IDC_RES_SIGNED , 138, 99, 159, 11
-
-// Program
- GROUPBOX "Process options" , IDC_PROCESS_GROUP, 135, 24, 166, 46, WS_GROUP
- AUTORADIOBUTTON "Parallel" , IDC_FLAG_PARALLEL, 138, 33, 161, 11
- AUTORADIOBUTTON "Continued" , IDC_FLAG_CONTINUE, 138, 44, 161, 11
- EDITTEXT IDC_EDIT_PROCTIME, 138, 56, 31, 11, ES_RIGHT | ES_NUMBER
- LTEXT "Process time, ms", IDC_STAT_PROCTIME, 171, 56, 128, 11, SS_CENTERIMAGE
-
- AUTOCHECKBOX "Current path" , IDC_FLAG_CURPATH, 138, 72, 161, 11
-
- GROUPBOX "Window option" , IDC_PRSTART_GROUP, 135, 83, 166, 55, WS_GROUP
- AUTORADIOBUTTON "Start normal" , IDC_FLAG_NORMAL , 138, 92, 162, 11
- AUTORADIOBUTTON "Start hidden" , IDC_FLAG_HIDDEN , 138, 103, 162, 11
- AUTORADIOBUTTON "Start minimized", IDC_FLAG_MINIMIZE, 138, 114, 162, 11
- AUTORADIOBUTTON "Start maximized", IDC_FLAG_MAXIMIZE, 138, 125, 162, 11
-
- CONTROL "V", IDC_HLP_FVARS, "MButtonClass",WS_TABSTOP, 285,139,16,16,$18000000
- RTEXT "Program path", IDC_STAT_PRGPATH, 135, 155, 160, 8
- AUTOCHECKBOX "", IDC_PRG_PRG,135,164,8,8,BS_ICON | BS_PUSHLIKE
- EDITTEXT IDC_EDIT_PRGPATH, 144, 164, 139, 12, ES_AUTOHSCROLL
- PUSHBUTTON "..." , IDC_PROGRAM , 285, 164, 16, 12
- RTEXT "Program args", IDC_STAT_PRGARGS, 135, 179, 160, 8
- AUTOCHECKBOX "", IDC_PRG_ARG,135,186,8,8,BS_ICON | BS_PUSHLIKE
- EDITTEXT IDC_EDIT_PRGARGS, 144, 188, 157, 12, ES_AUTOHSCROLL
-
-// Text
- AUTORADIOBUTTON "Clipboard" , IDC_FLAG_CLIP , 135, 20, 166, 11, WS_GROUP
- AUTORADIOBUTTON "File" , IDC_FLAG_FILE , 135, 66, 166, 11
- AUTORADIOBUTTON "Message window", IDC_FLAG_MESSAGE, 135, 128, 166, 11
-
- GROUPBOX "" , IDC_CLIP_GROUP , 135, 30, 166, 33
- AUTORADIOBUTTON "Copy to" , IDC_CLIP_COPYTO, 140, 36, 160, 11, WS_GROUP
- AUTORADIOBUTTON "Paste from", IDC_CLIP_PASTE , 140, 47, 160, 11
-
- GROUPBOX "" , IDC_FILE_GROUP , 135, 75, 166, 52
- AUTORADIOBUTTON "Read" , IDC_FILE_READ , 138, 83, 52, 11, WS_GROUP
- AUTORADIOBUTTON "Write" , IDC_FILE_WRITE , 191, 83, 52, 11
- AUTORADIOBUTTON "Append" , IDC_FILE_APPEND , 244, 83, 52, 11
- AUTOCHECKBOX "", IDC_TXT_FILE,138,96,8,8,BS_ICON | BS_PUSHLIKE
- EDITTEXT IDC_FILE_PATH , 147, 96, 131, 12, ES_AUTOHSCROLL
- PUSHBUTTON "..." , IDC_FILE_FILEBTN, 281, 96, 16, 12
- COMBOBOX IDC_FILE_ENC , 138, 111, 160, 76, CBS_DROPDOWNLIST | WS_VSCROLL
-
- CONTROL "V", IDC_HLP_VARS, "MButtonClass",WS_TABSTOP, 285,139,16,16,$18000000
-// PUSHBUTTON "vars" , IDC_HLP_VARS , 264, 140, 37, 14
- RTEXT "Text to insert", IDC_STAT_INSERT , 135, 155, 160, 9
- AUTOCHECKBOX "", IDC_TXT_TEXT,135,164,8,8,BS_ICON | BS_PUSHLIKE
- EDITTEXT IDC_EDIT_INSERT , 144, 164, 157, 59,
- ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN
-
-// Advanced
- GROUPBOX "Condition" , IDC_CONDITION , 135, 24, 166, 34, WS_GROUP
- AUTORADIOBUTTON ">" , IDC_FLAG_GT , 138, 33, 32, 11
- AUTORADIOBUTTON "<" , IDC_FLAG_LT , 170, 33, 32, 11
- AUTORADIOBUTTON "=" , IDC_FLAG_EQ , 202, 33, 32, 11
- AUTORADIOBUTTON "NOP" , IDC_FLAG_NOP , 234, 33, 32, 11
- AUTOCHECKBOX "NOT" , IDC_FLAG_NOT , 138, 44, 32, 11
- RTEXT "Value" , IDC_STAT_VAL , 170, 44, 78, 11, SS_CENTERIMAGE
- EDITTEXT IDC_ADV_VALUE , 250, 44, 48, 11, ES_RIGHT //| ES_NUMBER
-
- AUTOCHECKBOX "Math" , IDC_FLAG_MATH , 138, 61, 64, 13, WS_GROUP
- COMBOBOX IDC_ADV_OPER , 204, 61, 44, 96,
- CBS_DROPDOWNLIST | WS_VSCROLL
- EDITTEXT IDC_ADV_VAL1 , 250, 61, 48, 13, ES_RIGHT //| ES_NUMBER
-
- AUTOCHECKBOX "Variables" , IDC_FLAG_VARS , 138, 78, 124, 12
- CONTROL "V", IDC_ADV_HVARS, "MButtonClass",WS_TABSTOP, 285,75,16,16,$18000000
-// PUSHBUTTON "vars" , IDC_ADV_HVARS , 264, 78, 37, 12
- EDITTEXT IDC_ADV_VARS , 144, 92, 157, 68,
- ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN
- AUTOCHECKBOX "Result as integer", IDC_ADV_ASINT , 135, 161, 164, 13, BS_RIGHT | BS_LEFTTEXT
-
- GROUPBOX "Operation" , IDC_OPERATION , 135, 174, 166, 49, WS_GROUP
- AUTORADIOBUTTON "JUMP" , IDC_FLAG_JUMP , 138, 183, 62, 12
- AUTORADIOBUTTON "BREAK" , IDC_FLAG_BREAK, 138, 196, 62, 12
- AUTORADIOBUTTON "NOP" , IDC_FLAG_ANOP , 138, 209, 62, 12
- COMBOBOX IDC_ADV_VAL2 , 200, 183, 99, 96, CBS_DROPDOWNLIST | WS_VSCROLL | CBS_AUTOHSCROLL
-
-// Chain
- RTEXT "Other Action groups",IDC_STAT_GROUPS,135, 24, 160, 10
- COMBOBOX IDC_GROUP_LIST, 135, 35, 166, 128,
- CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL
-
-// Read / write setting
-
- AUTORADIOBUTTON "Own settings", IDC_RW_CURRENT, 135, 50, 80, 11, BS_RIGHT | BS_LEFTTEXT | WS_GROUP
- AUTORADIOBUTTON "Manual" , IDC_RW_MANUAL , 135, 62, 80, 11, BS_RIGHT | BS_LEFTTEXT
- AUTORADIOBUTTON "Parameter" , IDC_RW_PARAM , 217, 50, 80, 11
- AUTORADIOBUTTON "Last result" , IDC_RW_RESULT , 217, 62, 80, 11
-
- RTEXT "Module" , IDC_RW_STATM , 135, 75, 160, 8, SS_CENTERIMAGE
- AUTOCHECKBOX "", IDC_RW_MVAR,135,84,8,8,BS_ICON | BS_PUSHLIKE
- EDITTEXT IDC_RW_MODULE , 144, 84, 157, 12, ES_AUTOHSCROLL
- RTEXT "Setting" , IDC_RW_STATS , 135, 99, 160, 8, SS_CENTERIMAGE
- AUTOCHECKBOX "", IDC_RW_SVAR,135,108,8,8,BS_ICON | BS_PUSHLIKE
- EDITTEXT IDC_RW_SETTING, 144, 108, 157, 12, ES_AUTOHSCROLL
-
- GROUPBOX "Operation" , IDC_RW_OPER , 135, 124, 166, 21, WS_GROUP
- AUTORADIOBUTTON "Read" , IDC_RW_READ , 138, 133, 52, 11
- AUTORADIOBUTTON "Write" , IDC_RW_WRITE , 191, 133, 52, 11
- AUTORADIOBUTTON "Delete" , IDC_RW_DELETE , 244, 133, 52, 11
-
- GROUPBOX "Value" , IDC_RW_VAL , 135, 146, 166, 76, WS_GROUP
-
- COMBOBOX IDC_RW_DATATYPE, 220, 155, 79, 96,
- CBS_DROPDOWNLIST | WS_VSCROLL
-
- AUTOCHECKBOX "Last result" , IDC_RW_LAST , 140, 179, 156, 11, BS_RIGHT | BS_LEFTTEXT
- EDITTEXT IDC_RW_VALUE , 149, 191, 147, 11, ES_AUTOHSCROLL | ES_RIGHT// | ES_NUMBER
- AUTOCHECKBOX "", IDC_RW_TVAR,140,191,8,8,BS_ICON | BS_PUSHLIKE
- EDITTEXT IDC_RW_TEXT , 149, 191, 147, 29,
- ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN
-
-// MessageBox
-
- AUTOCHECKBOX "", IDC_MSG_TTL,135,32,8,8,BS_ICON | BS_PUSHLIKE
- EDITTEXT IDC_MSG_TITLE, 144, 32, 157, 12,
- ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN
- RTEXT "Message text" ,IDC_MSG_STAT2, 137, 46, 164, 11, SS_CENTERIMAGE
- AUTOCHECKBOX "", IDC_MSG_TXT,135,58,8,8,BS_ICON | BS_PUSHLIKE
- EDITTEXT IDC_MSG_TEXT , 144, 58, 157, 49,
- ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN
- AUTOCHECKBOX "Keep last result" , IDC_MSG_KEEP, 138, 109, 163, 11, BS_RIGHT | BS_LEFTTEXT
-
- GROUPBOX "Icons" , IDC_MSG_ICONS , 135, 123, 166, 28, WS_GROUP
- AUTORADIOBUTTON "Error" , IDC_MSGI_ERROR, 140, 130, 24, 20, BS_ICON
- AUTORADIOBUTTON "Question", IDC_MSGI_QUEST, 166, 130, 24, 20, BS_ICON
- AUTORADIOBUTTON "Warning" , IDC_MSGI_WARN , 192, 130, 24, 20, BS_ICON
- AUTORADIOBUTTON "Info" , IDC_MSGI_INFO , 218, 130, 24, 20, BS_ICON
- AUTORADIOBUTTON "None" , IDC_MSGI_NONE , 246, 130, 53, 20//, BS_ICON
-
- GROUPBOX "Buttons" , IDC_MSG_BTNS, 135, 152, 166, 71, WS_GROUP
- AUTORADIOBUTTON "OK" , IDC_MSGB_OK , 140, 161, 156, 10
- AUTORADIOBUTTON "OK, Cancel" , IDC_MSGB_OC , 140, 171, 156, 10
- AUTORADIOBUTTON "Abort, Retry, Ignore", IDC_MSGB_ARI, 140, 181, 156, 10
- AUTORADIOBUTTON "Yes, No, Cancel" , IDC_MSGB_YNC, 140, 191, 156, 10
- AUTORADIOBUTTON "Yes, No" , IDC_MSGB_YN , 140, 201, 156, 10
- AUTORADIOBUTTON "Retry, Cancel" , IDC_MSGB_RC , 140, 211, 156, 10
-
- RTEXT "Message title",IDC_MSG_STAT1, 137, 20, 164, 11, SS_CENTERIMAGE
}
-
-IDD_ASK DIALOGEX 0, 0, 276, 72, 0
-STYLE DS_SETFONT | DS_FIXEDSYS | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
-EXSTYLE WS_EX_CONTROLPARENT
-CAPTION "Choose action"
-FONT 8, "MS Shell Dlg", 0, 0
-{
- CTEXT "", IDC_ASK,4,4,268,42,SS_CENTERIMAGE
-
- CONTROL "", -1, "STATIC", SS_ETCHEDHORZ, 2, 50, 272, 2
-
- DEFPUSHBUTTON "&Yes" , IDOK , 4, 54, 40, 16
- PUSHBUTTON "&No" , IDCANCEL , 52, 54, 40, 16
- PUSHBUTTON "A&ppend" , IDC_APPEND, 100, 54, 52, 16
- PUSHBUTTON "Yes to &All", IDC_YESALL, 160, 54, 52, 16
- PUSHBUTTON "N&o to All" , IDC_NOALL , 220, 54, 52, 16
-}
-
-IDI_NEW ICON "ico\new.ico"
-IDI_UP ICON "ico\up.ico"
-IDI_DOWN ICON "ico\down.ico"
-IDI_DELETE ICON "ico\delete.ico"
-IDI_RELOAD ICON "ico\reload.ico"
-IDI_TEST ICON "ico\test.ico"
-IDI_EXPORT ICON "ico\export.ico"
-IDI_IMPORT ICON "ico\import.ico"
-
-IDI_CONTACT ICON "ico\contact.ico"
-IDI_SERVICE ICON "ico\service.ico"
-IDI_PROGRAM ICON "ico\program.ico"
-IDI_INSERT ICON "ico\insert.ico"
-IDI_ADVANCE ICON "ico\advance.ico"
-IDI_CHAIN ICON "ico\chain.ico"
-IDI_RW ICON "ico\rw.ico"
-IDI_MESSAGE ICON "ico\message.ico"
-IDI_FORMAT ICON "ico\format.ico"
-
-IDI_APPLY ICON "ico\apply.ico"
-
-IDI_VAR_CHECKED ICON "ico\vcheck.ico"
-IDI_VAR_UNCHECKED ICON "ico\vuncheck.ico"
-
+/*
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 0,2,0,1
- PRODUCTVERSION 0,2,0,1
+ FILEVERSION 0,3,0,1
+ PRODUCTVERSION 0,3,0,1
FILEFLAGSMASK $3F
FILEOS 4
FILETYPE 2
@@ -313,12 +54,12 @@ BEGIN VALUE "CompanyName",""
VALUE "Comments", "Plugin for managing different Miranda actions "0
VALUE "FileDescription", "Action manager for Miranda NG"0
- VALUE "FileVersion", "0, 2, 0, 1 "0
+ VALUE "FileVersion", "0, 3, 0, 1 "0
VALUE "InternalName", "ActManager"0
VALUE "OriginalFilename", "actman.dll"0
VALUE "ProductName", "Action Manager Dynamic Link Library (DLL)"0
- VALUE "ProductVersion", "0, 2, 0, 1 "0
- VALUE "SpecialBuild", "18.08.2011 "0
+ VALUE "ProductVersion", "0, 3, 0, 1 "0
+ VALUE "SpecialBuild", "18.11.2012 "0
END
END
BLOCK "VarFileInfo"
@@ -326,3 +67,4 @@ BEGIN VALUE "Translation",0,1200
END
END
+*/
\ No newline at end of file diff --git a/plugins/Actman/options.res b/plugins/Actman/options.res Binary files differindex 6385d76f43..951c81f7f6 100644 --- a/plugins/Actman/options.res +++ b/plugins/Actman/options.res diff --git a/plugins/Actman/question.pas b/plugins/Actman/question.pas index 84bbd60604..d936b65794 100644 --- a/plugins/Actman/question.pas +++ b/plugins/Actman/question.pas @@ -3,13 +3,14 @@ unit question; interface
uses windows,messages;
-function QuestionDlg(Dialog:HWnd;hMessage:UINT;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
+function ShowQuestion(ask:pWideChar):integer;
implementation
uses m_api;
{$include i_const.inc}
+{$resource ask.res}
const
imp_yes = 1;
@@ -18,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
@@ -48,4 +49,10 @@ begin end;
end;
+function ShowQuestion(ask:pWideChar):integer;
+begin
+ result:=DialogBoxParam(hInstance,MAKEINTRESOURCE(IDD_ASK),0,
+ @QuestionDlg,TLPARAM(ask));
+end;
+
end.
diff --git a/plugins/Actman/readme.txt b/plugins/Actman/readme.txt index 0c6359ebe3..1831a1efe2 100644 --- a/plugins/Actman/readme.txt +++ b/plugins/Actman/readme.txt @@ -101,7 +101,7 @@ This subaction is for database reading/writing (see Operation block). Value and value type is for type of data, reading or writing from/to database.
'Last result' mean that value is result of previous action.
Group of radioboxes is for contact type.
- 'Own settings' - all settings only for our contact (our profle settings)
+ 'Own settings' - all settings only for our contact (our profile settings)
'Parameter' - settings for contact with handle, passed from start parameter
'Last result' - contact handle is result of last action
'Manual' - contact handle selected from combobox
diff --git a/plugins/Actman/services.ini b/plugins/Actman/services.ini index fcf82289c6..7d0bda9289 100644 --- a/plugins/Actman/services.ini +++ b/plugins/Actman/services.ini @@ -2,15 +2,19 @@ ;if wparam or lparam consists of list, "|" is separator
;in list: if translation not needed, just add space before help
;numeric parameter format: number<space>help
-;hContact will setup "Current contact" feature
-;structure will setup "structure" feature
+;'hContact' will setup "Current contact" feature
+;'structure' will setup "structure" feature
+;'Unicode' as first word will setup "Unicode text" feature
+; not sure what next are usable
+;'parameter' will setup "Parameter" feature
+;'result' will setup "last result" feature
;if "return" starts from int/hex/str/struct then separator, result type will set
-;[Event:Event (name or constant]
+;[Event:Event (name or constant)]
;alias=constant name
;descr=text
-;plugin=placement (including "core" and empty = "unknown"
+;plugin=placement (including "core" and empty = "unknown")
;wparam=
;lparam=
@@ -19,6 +23,14 @@ ;descr: structure description
;plugin: where defined
+[Service:DB/UI/ChangePassword]
+alias=MS_DB_CHANGEPASSWORD
+wparam=0
+lparam=0
+return=0
+descr=Show window for new/changed profile password
+plugin=db3x_mmap
+
[Service:CListFrames/HideALLFramesTB]
alias=MS_CLIST_FRAMES_HIDEALLFRAMESTB
wparam=0
@@ -97,7 +109,7 @@ alias=MS_DBEDIT_IMPORT wparam=hContact
lparam=Ansi Text
return=int 0
-descr=Import settings\contacts from file
+descr=Import settings/contacts from file
plugin=Database Editor++ (dbeditorpp.dll)
[Service:DBEditorpp/MenuCommand]
@@ -124,7 +136,7 @@ descr=displays File Transfer window [Service:Help/AboutCommand]
wparam=0 on Desktop|parent window handle
lparam=0
-Show "About..." window
+descr=Show "About..." window
[Service:Help/IndexCommand]
wparam=0
@@ -134,7 +146,7 @@ descr=Open support (originaly - Miranda wiki) page [Service:Help/WebsiteCommand]
wparam=0
lparam=0
-descr=Go to Miranda IM Homepage
+descr=Go to Miranda Homepage
[Service:Help/BugCommand]
wparam=0
@@ -175,23 +187,11 @@ lparam=-1 Ignore all|1 Ignore messages|2 Ignore URLs|3 Ignore files|4 Ignore Use return=int 0, if successful
descr=Unignore Contact
-[Service:mDynDNS/GetIP]
-wparam=0 auto|1 mDynDNS-checkip|2 DNS querry
-lparam=structure|*b.arr 16|
-return=struct
-descr=Returns the IP (empty string on failure)
-
-[Service:MIMLocker/Lock]
-wparam=0
-wparam=0
-plugin=MIMLocker (MIMLocker.dll)
-descr=Locks & hides Miranda's contact list and message sessions until password is entered
-
[Service:Miranda/System/Restart]
alias=MS_SYSTEM_RESTART
wparam=0 restart in default profile or profile manager|1 restart with current profile
lparam=0
-descr=Restarts Miranda ver.0.8+
+descr=Restarts Miranda
[Service:mRadio/PlayStop]
alias=MS_RADIO_PLAYSTOP
@@ -239,14 +239,26 @@ descr=Open Options dialog [Service:Opt/OpenOptions]
alias=MS_OPT_OPENOPTIONS
wparam=0
-lparam=structure|0|native|bptr|bptr|bptr|
+lparam=structure|0|dword|b.ptr|b.ptr|b.ptr|
return=int 0, if successful
descr=Opens the options dialog, optionally at the specified page
+[Service:PackUpdater/CheckUpdates]
+wparam=0
+lparam=0
+plugin=Pack Updater (packupdater.dll)
+descr=Check for updates
+
+[Service:PackUpdater/EmptyFolder]
+wparam=0
+lparam=0 with confirmation| 1 - without confirmation
+plugin=Pack Updater (packupdater.dll)
+descr=Empty updater download folder
+
[Service:Popup/EnableDisableMenuCommand]
wparam=0
lparam=0
-plugin=Popup Plus (popup.dll)
+plugin=Popup Plus (popup.dll) latest YAPP (yapp.dll)
descr=Enables or disables Popup windows
[Service:Popup/ShowMessage]
@@ -262,14 +274,14 @@ alias=MS_POPUP_SHOWMESSAGEW wparam=Unicode Text
lparam=1 Warning|2 Notify|3 Error
return=int 0, if successful
-plugin=YAPP only
+plugin=YAPP or Popup
descr=Popup window
[Service:Popup/ToggleEnabled]
wparam=0
lparam=0
plugin=YAPP (yapp.dll)
-descr=Enables or disables Popup windows
+descr=Enables or disables Popup windows (maybe deprecated)
[Service:Proto/CallContactService]
alias=MS_PROTO_CALLCONTACTSERVICE
@@ -278,6 +290,13 @@ lparam=structure|0|native|b.ptr|native|native| return=result of protocol service call
descr=Send a general request through the protocol chain for a contact
+[Service:Proto/GetContactBaseAccount]
+alias=MS_PROTO_GETCONTACTBASEACCOUNT
+wparam=hContact
+lparam=0
+return=str, account name
+descr=Return account name associated to contact (no need to free it)
+
[Service:Protos/ShowAccountManager]
alias=MS_PROTO_SHOWACCMGR
wparam=0
@@ -293,7 +312,7 @@ descr=Show the dialog to select the contact [Service:QuickSearch_PLUGIN/Show]
wparam=0|filter text
-lparam=0 wparam is unicode|1 wparam is Ansi|2 reserved
+lparam=0 wParam is unicode|1 wParam is Ansi|2 Reserved
plugin=Quick Search (Mod) (quicksearch.dll)
descr=
@@ -347,23 +366,16 @@ descr=remove all temporary contacts from db alias=MS_AV_CONTACTOPTIONS
wparam=hContact
lparam=0
-plugin=Avatar service (loadavatars.dll)
+plugin=Avatar service (AVS.dll)
descr=Call avatar option dialog for contact
[Service:SV_Avatars/SetAvatar]
alias=MS_AV_SETAVATAR
wparam=hContact
lparam=0|Filename
-plugin=Avatar service (loadavatars.dll)
+plugin=Avatar service (AVS.dll)
descr=Set (and optionally protect) a local contact picture for the given hContact. If lParam = NIL, the service will open a file selection dialog.
-[Service:Update/CheckForUpdates]
-wparam=0
-lparam=0
-return=int 0
-plugin=Updater (updater.dll)
-descr=Check for plugin updates
-
[Service:UserInfo/ShowDialog]
alias=MS_USERINFO_SHOWDIALOG
wparam=0 System|hContact
@@ -495,3 +507,47 @@ native (LPARAM) lParam| short=0|param|b.ptr|native|native|
descr=
plugin=
+
+[Const:CALLSERVICE_NOTFOUND]
+value=$80000000
+value64=$8000000000000000
+;signed=0
+;plugin=core
+
+[Const:ID_STATUS_OFFLINE]
+value=40071
+[Const:ID_STATUS_ONLINE]
+value=40072
+[Const:ID_STATUS_AWAY]
+value=40073
+[Const:ID_STATUS_DND]
+value=40074
+[Const:ID_STATUS_NA]
+value=40075
+[Const:ID_STATUS_OCCUPIED]
+value=40076
+[Const:ID_STATUS_FREECHAT]
+value=40077
+[Const:ID_STATUS_INVISIBLE]
+value=40078
+[Const:ID_STATUS_ONTHEPHONE]
+value=40079
+[Const:ID_STATUS_OUTTOLUNCH]
+value=40080
+[Const:ID_STATUS_IDLE]
+value=40081
+
+[Function:user32.dll$MessageBoxA]
+;dll=
+calltype=stdcall
+argcount=4
+argvalue1=0
+argvalue2=Ansi message
+argvalue3=Ansi caption
+argvalue4=0
+argname1=hWnd
+argname2=lpText
+argname3=lpCaption
+argname4=uType
+return=int 0
+descr=Displays a modal dialog box that contains a system icon, a set of buttons, and a brief application-specific message, such as status or error information.
diff --git a/plugins/Actman30/sparam.res b/plugins/Actman/sparam.res Binary files differindex 0491ec8f83..0491ec8f83 100644 --- a/plugins/Actman30/sparam.res +++ b/plugins/Actman/sparam.res diff --git a/plugins/Actman30/structopts.res b/plugins/Actman/structopts.res Binary files differindex f651b686f2..f651b686f2 100644 --- a/plugins/Actman30/structopts.res +++ b/plugins/Actman/structopts.res diff --git a/plugins/Actman30/tasks/tasks.res b/plugins/Actman/tasks.res Binary files differindex bc72f06406..bc72f06406 100644 --- a/plugins/Actman30/tasks/tasks.res +++ b/plugins/Actman/tasks.res diff --git a/plugins/Actman/tasks/i_opt_dlg.inc b/plugins/Actman/tasks/i_opt_dlg.inc index c8025c278d..bf8d45f63c 100644 --- a/plugins/Actman/tasks/i_opt_dlg.inc +++ b/plugins/Actman/tasks/i_opt_dlg.inc @@ -275,13 +275,14 @@ function DeleteTask(Dialog:HWND):integer; var
li:LV_ITEM;
wnd:HWND;
- i:integer;
+ i,j:integer;
begin
result:=0;
wnd:=GetDlgItem(Dialog,IDC_TASK_NAME);
- for i:=ListView_GetItemCount(wnd)-1 downto 0 do
+ j:=SendMessage(wnd,LVM_GETITEMCOUNT,0,0);
+ for i:=j-1 downto 0 do
begin
- if ListView_GetItemState(wnd,i,LVIS_SELECTED)<>0 then
+ if SendMessage(wnd,LVM_GETITEMSTATE,i,LVIS_SELECTED)<>0 then
begin
li.iItem :=i;
li.mask :=LVIF_PARAM;
@@ -299,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
@@ -403,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/Actman/tasks/i_options.inc b/plugins/Actman/tasks/i_options.inc index 527e8d0c88..da5cce0c40 100644 --- a/plugins/Actman/tasks/i_options.inc +++ b/plugins/Actman/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/Actman/tasks/scheduler.pas b/plugins/Actman/tasks/scheduler.pas index 05e9cb6a58..1ec1202f26 100644 --- a/plugins/Actman/tasks/scheduler.pas +++ b/plugins/Actman/tasks/scheduler.pas @@ -2,21 +2,15 @@ unit scheduler; interface
-procedure Init;
-procedure DeInit;
-function AddOptionPage(var tmpl:pAnsiChar;var proc:pointer;var name:PAnsiChar):integer;
-
implementation
uses
windows, commctrl, messages,
- mirutils, common, dbsettings, io, m_api, wrapper,
+ mirutils, common, dbsettings, m_api, wrapper,
global;
{$R tasks.res}
-{$include m_actman.inc}
-
var
hevent: THANDLE;
@@ -28,11 +22,6 @@ var // ------------ base interface functions -------------
-var
- hendis,
- hcount,
- hdel: THANDLE;
-
procedure Init;
begin
@@ -45,19 +34,18 @@ begin else
SetAllTasks;
- hcount:=CreateServiceFunction(MS_ACT_TASKCOUNT ,@TaskCount);
- hendis:=CreateServiceFunction(MS_ACT_TASKENABLE,@TaskEnable);
- hdel :=CreateServiceFunction(MS_ACT_TASKDELETE,@TaskDelete);
+ CreateServiceFunction(MS_ACT_TASKCOUNT ,@TaskCount);
+ CreateServiceFunction(MS_ACT_TASKENABLE,@TaskEnable);
+ CreateServiceFunction(MS_ACT_TASKDELETE,@TaskDelete);
+
hevent:=CreateHookableEvent(ME_ACT_BELL);
end;
procedure DeInit;
begin
+ DestroyHookableEvent(hevent);
StopAllTasks;
- DestroyServiceFunction(hendis);
- DestroyServiceFunction(hdel);
- DestroyServiceFunction(hcount);
ClearTasks;
end;
diff --git a/plugins/Actman30/ua.res b/plugins/Actman/ua.res Binary files differindex 8316b81f51..8316b81f51 100644 --- a/plugins/Actman30/ua.res +++ b/plugins/Actman/ua.res diff --git a/plugins/Actman/ua/action.ico b/plugins/Actman/ua/action.ico Binary files differindex 06db21a127..9e4c60d9d3 100644 --- a/plugins/Actman/ua/action.ico +++ b/plugins/Actman/ua/action.ico diff --git a/plugins/Actman30/ua/i_inoutjson.inc b/plugins/Actman/ua/i_inoutjson.inc index b560e99fb1..b560e99fb1 100644 --- a/plugins/Actman30/ua/i_inoutjson.inc +++ b/plugins/Actman/ua/i_inoutjson.inc diff --git a/plugins/Actman/ua/i_inoutxm.inc b/plugins/Actman/ua/i_inoutxm.inc index 098a262b1e..bf53ff954a 100644 --- a/plugins/Actman/ua/i_inoutxm.inc +++ b/plugins/Actman/ua/i_inoutxm.inc @@ -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;
@@ -150,18 +154,18 @@ begin inc(pbyte(ptr),4);
for i:=0 to num-1 do
begin
- if (ptr.flags and ACCF_IMPORTED)<>0 then
+ if (ptr.flags and ACF_SELECTED)<>0 then
begin
if StrCmpw(pcw,ptr.descr)=0 then
begin
// delete old UA for overwrited actions
- if (ptr.flags and ACCF_OVERLOAD)<>0 then
+ if (ptr.flags and ACF_OVERLOAD)<>0 then
begin
for act:=0 to HIGH(UActionList) do
begin
if ptr.id=UActionList[act].dwActID then
begin
- DeleteUAction(act);
+ DeleteUAction(act,true);
break;
end;
end;
@@ -191,7 +195,7 @@ end; //--------------------------
-function ExportMenuItems(node:HXML;MenuItem:tUAMenuItem):HXML;
+function ExportMenuItems(node:HXML;const MenuItem:tUAMenuItem):HXML;
begin
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;
diff --git a/plugins/Actman/ua/i_opt_dlg.inc b/plugins/Actman/ua/i_opt_dlg.inc index e9d7dc5048..6e5cc4d117 100644 --- a/plugins/Actman/ua/i_opt_dlg.inc +++ b/plugins/Actman/ua/i_opt_dlg.inc @@ -1,127 +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;
-begin
- for i:=0 to NumTypes-1 do
- begin
- with NamesArray[i] do
- begin
- enable:=(service=nil) or (ServiceExists(service)<>0);
- end;
- end;
-end;
+//----- Static (no option-depended) control view -----
-function CompareItem(lParam1,lParam2:LPARAM;SortType:LPARAM):int; stdcall;
+procedure HideAllControls(Dialog:HWND);
begin
- result:=UActionList[lParam1].wSortIndex-UActionList[lParam2].wSortIndex;
+ 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
- begin
- for i:=0 to NumControls-1 do
- begin
- ShowWindow(GetDlgItem(Dialog,IDsArray[i]),SW_HIDE);
- end;
- end
- else
+ HideAllControls(Dialog);
+ if atype>=0 then
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
@@ -129,20 +135,111 @@ 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);
+ MakeEditField(Dialog,IDC_UA_TTPRESSEDV);
+
+ 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;
s:HWND;
+ i:integer;
begin
s:=settings;
settings:=0;
@@ -169,6 +266,11 @@ begin SetDlgItemTextA(Dialog,IDC_UA_TTNORMALV ,UA.szTTBTooltip);
SetDlgItemTextA(Dialog,IDC_UA_TTPRESSEDV,UA.szTTBTooltipPressed);
SetDlgItemTextW(Dialog,IDC_UA_SHOWVARV ,UA.szTTBShowWhenVars);
+
+ if (UA.flags and UAF_TTBTTUV)<>0 then i:=EF_SCRIPT else i:=0;
+ SetEditFlags(Dialog,IDC_UA_TTNORMALV ,EF_ALL,i);
+ if (UA.flags and UAF_TTBTTPV)<>0 then i:=EF_SCRIPT else i:=0;
+ SetEditFlags(Dialog,IDC_UA_TTPRESSEDV,EF_ALL,i);
end;
uaTAB: begin // TabSRMM toolbar
@@ -181,9 +283,15 @@ 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);
+ if (menu_opt and UAF_MNAMVAR)<>0 then i:=EF_SCRIPT else i:=0;
+ SetEditFlags(Dialog,IDC_UA_VARNAMESV,EF_ALL,i);
+ if (menu_opt and UAF_MSUBVAR)<>0 then i:=EF_SCRIPT else i:=0;
+ SetEditFlags(Dialog,IDC_UA_POPUPV,EF_ALL,i);
end;
end;
@@ -191,7 +299,8 @@ begin // Settings in Customize/Hotkeys
end;
end;
- SetupControls(Dialog,aType,-1);
+ ShowHideControls(Dialog,aType,-1);
+ EnableDisableCheck(Dialog);
settings:=s;
end;
@@ -255,10 +364,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;
@@ -276,8 +387,14 @@ 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;
+ if (GetEditFlags(Dialog,IDC_UA_VARNAMESV) and EF_SCRIPT)<>0 then
+ menu_opt:=menu_opt or UAF_MNAMVAR;
+ if (GetEditFlags(Dialog,IDC_UA_POPUPV) and EF_SCRIPT)<>0 then
+ menu_opt:=menu_opt or UAF_MSUBVAR;
end;
end;
@@ -331,6 +448,10 @@ begin mFreeMem(szTTBTooltip ); szTTBTooltip :=GetDlgText(Dialog,IDC_UA_TTNORMALV ,true);
mFreeMem(szTTBTooltipPressed); szTTBTooltipPressed:=GetDlgText(Dialog,IDC_UA_TTPRESSEDV,true);
mFreeMem(szTTBShowWhenVars ); szTTBShowWhenVars :=GetDlgText(Dialog,IDC_UA_SHOWVARV);
+ if (GetEditFlags(Dialog,IDC_UA_TTNORMALV ) and EF_SCRIPT)<>0 then
+ flags:=flags or UAF_TTBTTUV;
+ if (GetEditFlags(Dialog,IDC_UA_TTPRESSEDV) and EF_SCRIPT)<>0 then
+ flags:=flags or UAF_TTBTTPV;
end;
uaTAB: begin // TabSRMM toolbar
@@ -354,70 +475,46 @@ begin end;
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_AddIcon(il,
- 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_AddIcon(il,
- 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 +527,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 +549,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,28 +569,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);
@@ -547,6 +644,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
@@ -558,8 +656,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/Actman/ua/i_options.inc b/plugins/Actman/ua/i_options.inc index 91f54e89d8..977ff7891b 100644 --- a/plugins/Actman/ua/i_options.inc +++ b/plugins/Actman/ua/i_options.inc @@ -26,7 +26,10 @@ begin begin
p:=StrCopyE(p,opt_UA);
p^:='/'; inc(p);
-
+{!!
+ p^:='*'; inc(p); p^:=#0;
+ DBDeleteGroup(0,DBBranch,setting);
+!!}
StrCopy(p,opt_Flags); DBDeleteSetting(0,DBBranch,setting);
StrCopy(p,opt_TTBTooltip ); DBDeleteSetting(0,DBBranch,setting);
@@ -196,8 +199,6 @@ end; *)
procedure SetAllActionUsers(var ActionItem:tMyActionItem; initial:boolean);
var
- setting:array [0..63] of AnsiChar;
- p:pAnsiChar;
luse:boolean;
lmenu:tMenuType;
begin
@@ -248,90 +249,4 @@ begin DestroyServiceFunction(ActionItem.hMenuService);
ActionItem.hMenuService:=0;
end;
-
- // First run (ok ok, if ppl ask for it....)
- p:=GetUABranch(setting,ActionItem.dwActID);
- if p<>nil then
- begin
- p:=StrCopyE(p,opt_UA);
- p^:='/'; inc(p);
- StrCopy(p,'_FirstRun');
- if DBReadByte(0,DBBranch,setting,0)<>0 then
- begin
- CAllService(MS_ACT_RUNBYID,ActionItem.dwActID,0);
- DBDeleteSetting(0,DBBranch,setting);
- end;
- end;
-
-end;
-
-procedure DeleteUAction(num:integer);
-var
- ActionItem:pMyActionItem;
- setting:array [0..63] of AnsiChar;
- p:pAnsiChar;
- luse:boolean;
- lmenu:tMenuType;
-begin
- DeleteUASettings(num);
-
- ActionItem:=@UActionList[num];
-
- DeleteIcolibIcon(ActionItem^);
-
- if (ActionItem.flags and UAF_REGHOTKEY)<>0 then
- DeleteCoreHotkey(ActionItem^);
-
- if (ActionItem.flags and UAF_REGTTBB)<>0 then
- DeleteTTBButton(ActionItem^);
- mFreeMem(ActionItem.szTTBTooltip);
- mFreeMem(ActionItem.szTTBTooltipPressed);
- mFreeMem(ActionItem.szTTBShowWhenVars);
-
- if (ActionItem.flags and UAF_REGTABB)<>0 then
- DeleteTabBBButton(ActionItem^);
- mFreeMem(ActionItem.szTabBTooltip);
- mFreeMem(ActionItem.szTabBTooltipPressed);
-
- luse:=false;
- for lmenu:=main_menu to HIGH(tMenuType) do
- begin
- with ActionItem.UAMenuItem[lmenu] do
- begin
- if (menu_opt and UAF_MENUUSE)<>0 then
- begin
- luse:=true;
- DeleteMenuItem(ActionItem^,lmenu);
- end;
- mFreeMem(szMenuPopup);
- mFreeMem(szMenuNameVars);
- mFreeMem(szMenuShowWhenVars);
- end;
- end;
-
- if (not luse) and (ActionItem.hMenuService<>0) then
- begin
- DestroyServiceFunction(ActionItem.hMenuService);
- ActionItem.hMenuService:=0;
- end;
-
- p:=GetUABranch(setting,ActionItem.dwActID);
- if p<>nil then
- begin
- p:=StrCopyE(p,opt_UA);
- p^:='/'; inc(p);
- StrCopy(p,'_FirstRun');
- DBDeleteSetting(0,DBBranch,setting);
- end;
-
- // Free Memory
- mFreeMem(ActionItem.szNameID);
- mFreeMem(ActionItem.szActDescr);
-
- // compact list
- if num<HIGH(UActionList) then
- begin
- move(UActionList[num+1],UActionList[num],(HIGH(UACtionList)-num)*SizeOf(tMyActionItem));
- end;
- SetLength(UActionList,Length(UActionList)-1);
end;
diff --git a/plugins/Actman/ua/i_ua.inc b/plugins/Actman/ua/i_ua.inc index 61641a7447..b3b4cdaa47 100644 --- a/plugins/Actman/ua/i_ua.inc +++ b/plugins/Actman/ua/i_ua.inc @@ -13,8 +13,6 @@ begin begin
// get Action settings
dwActID:=ptr^.id;
- if (ptr^.flags and ACCF_DISABLED)<>0 then
- flags:=UAF_DISABLED;
StrDupW(szActDescr,ptr^.descr);
wSortIndex:=idx;
@@ -57,6 +55,71 @@ begin end;
end;
+// "compact" means need to compact list/delete settings (Delete, not just exit)
+procedure DeleteUAction(num:integer;compact:boolean);
+var
+ ActionItem:pMyActionItem;
+ luse:boolean;
+ lmenu:tMenuType;
+begin
+ if compact then
+ DeleteUASettings(num);
+
+ ActionItem:=@UActionList[num];
+
+ DeleteIcolibIcon(ActionItem^);
+
+ if (ActionItem.flags and UAF_REGHOTKEY)<>0 then
+ DeleteCoreHotkey(ActionItem^);
+
+ if (ActionItem.flags and UAF_REGTTBB)<>0 then
+ DeleteTTBButton(ActionItem^);
+ mFreeMem(ActionItem.szTTBTooltip);
+ mFreeMem(ActionItem.szTTBTooltipPressed);
+ mFreeMem(ActionItem.szTTBShowWhenVars);
+
+ if (ActionItem.flags and UAF_REGTABB)<>0 then
+ DeleteTabBBButton(ActionItem^);
+ mFreeMem(ActionItem.szTabBTooltip);
+ mFreeMem(ActionItem.szTabBTooltipPressed);
+
+ luse:=false;
+ for lmenu:=main_menu to HIGH(tMenuType) do
+ begin
+ with ActionItem.UAMenuItem[lmenu] do
+ begin
+ if (menu_opt and UAF_MENUUSE)<>0 then
+ begin
+ luse:=true;
+ DeleteMenuItem(ActionItem^,lmenu);
+ end;
+ mFreeMem(szMenuPopup);
+ mFreeMem(szMenuNameVars);
+ mFreeMem(szMenuShowWhenVars);
+ end;
+ end;
+
+ if (not luse) and (ActionItem.hMenuService<>0) then
+ begin
+ DestroyServiceFunction(ActionItem.hMenuService);
+ ActionItem.hMenuService:=0;
+ end;
+
+ // Free Memory
+ mFreeMem(ActionItem.szNameID);
+ mFreeMem(ActionItem.szActDescr);
+
+ if compact then
+ begin
+ // compact list
+ if num<HIGH(UActionList) then
+ begin
+ move(UActionList[num+1],UActionList[num],(HIGH(UActionList)-num)*SizeOf(tMyActionItem));
+ end;
+ SetLength(UActionList,Length(UActionList)-1);
+ end;
+end;
+
function ActListChange(wParam:WPARAM;lParam:LPARAM):integer; cdecl;
var
ptr,ptr1:pChain;
@@ -71,8 +134,8 @@ begin begin
ptr1:=ptr;
inc(pbyte(ptr),4);
- // maybe add ACTM_RELOAD (as NEW and DELETE) here too?
- if (wParam and (ACTM_NEW or ACTM_RENAME or ACTM_SORT or ACTM_DELETE))<>0 then
+ if wParam<>0 then
+// if (wParam and (ACTM_NEW or ACTM_RENAME or ACTM_SORT or ACTM_DELETE))<>0 then
for i:=0 to count-1 do
begin
// search corresponding element
@@ -87,7 +150,9 @@ begin end;
// if we have no item in list for this action - then add new one
if idx<0 then
- AddUAction(-1,ptr)
+ begin
+ idx:=AddUAction(-1,ptr);
+ end
else
begin
if (wParam and ACTM_RENAME)<>0 then
@@ -99,10 +164,11 @@ begin StrDupW (UActionList[idx].szActDescr,ptr^.descr);
end;
end;
-
- if (wParam and (ACTM_SORT or ACTM_DELETE or ACTM_NEW))<>0 then
- UActionList[idx].wSortIndex:=i;
end;
+// not so necessary to check really
+// if (wParam and (ACTM_SORT or ACTM_DELETE or ACTM_NEW))<>0 then
+ UActionList[idx].wSortIndex:=i;
+
inc(ptr);
end;
end
@@ -130,26 +196,24 @@ begin end;
end;
if not bFound then
- DeleteUAction(j);
+ DeleteUAction(j,true);
end;
end;
if count>0 then
CallService(MS_ACT_FREELIST,0,TLPARAM(ptr1));
+ // show changes in dialog
if settings<>0 then
begin
FillActionList(settings);
ShowAction(settings,-1);
- SendMessage(GetParent(settings),PSM_CHANGED,0,0);
- end
- else
+ end;
+
+ SaveUAs;
+ FillChar(arMenuRec[0],Length(arMenuRec)*SizeOf(tuaMenuRecA),0);
+ for i:=0 to HIGH(UActionList) do
begin
- SaveUAs;
- FillChar(arMenuRec[0],Length(arMenuRec)*SizeOf(tuaMenuRecA),0);
- for i:=0 to HIGH(UActionList) do
- begin
- SetAllActionUsers(UActionList[i],false);
- end;
+ SetAllActionUsers(UActionList[i],false);
end;
end;
diff --git a/plugins/Actman/ua/i_uaplaces.inc b/plugins/Actman/ua/i_uaplaces.inc index 4b1f46a762..222065b460 100644 --- a/plugins/Actman/ua/i_uaplaces.inc +++ b/plugins/Actman/ua/i_uaplaces.inc @@ -1,5 +1,5 @@ {}
-
+(*
const
MenuServices:array [tMenuType] of pAnsiChar = (
'CList/AddMainMenuItem' {MS_CLIST_ADDMAINMENUITEM },
@@ -8,6 +8,7 @@ const 'CList/AddProtoMenuItem' {MS_CLIST_ADDPROTOMENUITEM },
'CList/AddStatusMenuItem' {MS_CLIST_ADDSTATUSMENUITEM }
);
+*)
type
tuaMenuRec = record
hMenuRoot:HMENU;
@@ -25,7 +26,7 @@ begin result:=CallService(MS_ACT_RUNBYID, lParam, wParam);
end;
-procedure SetTTBState(var ActionItem:tMyActionItem);
+procedure SetTTBState(const ActionItem:tMyActionItem);
var
lflag:integer;
begin
@@ -47,7 +48,7 @@ begin CallService(MS_TTB_SETBUTTONSTATE,ActionItem.hTTBButton,lflag);
end;
-procedure SetTABState(hContact:THANDLE;var ActionItem:tMyActionItem;pressed:integer);
+procedure SetTABState(hContact:THANDLE;const ActionItem:tMyActionItem;pressed:integer);
var
tabb:TBBButton;
pc:pWideChar;
@@ -224,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;
@@ -341,12 +342,12 @@ end; procedure CreateMenuItem(var ActionItem:tMyActionItem;mtype:tMenuType);
var
- i:integer;
+ extra:pWideChar;
ActItem:pMyActionItem;
ActMItem,UAMenuItem:pUAMenuItem;
clmi:TCListMenuItem;
+ i:integer;
res:boolean;
- extra:pWideChar;
begin
{}
UAMenuItem:=@ActionItem.UAMenuItem[mtype];
@@ -375,16 +376,26 @@ begin end;
end;
end;
- // popup menu not found
+ // need to create popup menu
if not res then
begin
FillChar(clmi,SizeOf(clmi),0);
clmi.cbSize:=SizeOf(clmi);
- clmi.flags :=CMIF_UNICODE;
+ 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)
+ begin
+ if (UAMenuItem.menu_opt and UAF_MSUBVAR)<>0 then
+ clmi.szName.w:=ParseVarString(UAMenuItem.szMenuPopup)
+ else
+ clmi.szName.w:=UAMenuItem.szMenuPopup;
+ end
else
+ clmi.szName.w:=nil;
+ if clmi.szName.w=nil then
clmi.szName.w:=ActionItem.szActDescr;
clmi.hIcon :=AddRootMenuIcon(clmi.szName.w);
@@ -395,8 +406,9 @@ begin (UAMenuItem.menu_opt and UAF_MENUSEP)<>0));
UAMenuItem.hMenuRoot:=MakeMenuItem(mtype,@clmi);
- //CallService(MenuServices[mtype],0,LPARAM(@clmi));
- if clmi.szName.w<>ActionItem.szActDescr then
+
+ if (clmi.szName.w<>ActionItem.szActDescr) and
+ (clmi.szName.w<>UAMenuItem.szMenuPopup) then
mFreeMem(clmi.szName.w);
for i:=1 to HIGH(arMenuRec) do
@@ -417,7 +429,10 @@ begin {}{}
FillChar(clmi,SizeOf(clmi),0);
clmi.cbSize:=SizeOf(clmi);
- clmi.flags:=CMIF_UNICODE;
+ 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;
@@ -426,22 +441,26 @@ begin else
begin
clmi.hIcon:=ActionItem.hIcolibIconPressed;
- clmi.flags:=CMIF_UNICODE or CMIF_CHECKED;
+ clmi.flags:=clmi.flags or CMIF_CHECKED;
extra:='1';
end;
- with ActionItem.UAMenuItem[mtype] do
+ if (UAMenuItem.szMenuNameVars<>nil) and (UAMenuItem.szMenuNameVars^<>#0) then
begin
- if (szMenuNameVars<>nil) and (szMenuNameVars^<>#0) then
- clmi.szName.w:=ParseVarString(szMenuNameVars,0,extra)
+ if (UAMenuItem.menu_opt and UAF_MNAMVAR)<>0 then
+ clmi.szName.w:=ParseVarString(UAMenuItem.szMenuNameVars,0,extra)
else
- clmi.szName.w:=ActionItem.szActDescr;
+ clmi.szName.w:=UAMenuItem.szMenuNameVars;
+ end
+ else
+ clmi.szName.w:=nil;
+ if clmi.szName.w=nil then
+ clmi.szName.w:=ActionItem.szActDescr;
- if hMenuRoot<>0 then
- begin
- clmi.flags:=clmi.flags or CMIF_ROOTHANDLE;
- clmi.szPopupName.w:=pWideChar(hMenuRoot);
- end;
+ if UAMenuItem.hMenuRoot<>0 then
+ begin
+ clmi.flags:=clmi.flags or CMIF_ROOTHANDLE;
+ clmi.szPopupName.w:=pWideChar(UAMenuItem.hMenuRoot);
end;
clmi.pszService:=ActionItem.szNameID;
@@ -456,13 +475,14 @@ begin UAMenuItem.hMenuItem:=MakeMenuItem(mtype,@clmi);
//CallService(MenuServices[mtype],0,LPARAM(@clmi));
- if clmi.szName.w<>ActionItem.szActDescr then
+ if (clmi.szName.w<>ActionItem.szActDescr) and
+ (clmi.szName.w<>UAMenuItem.szMenuNameVars) then
mFreeMem(clmi.szName.w);
{}
end;
-function PreBuildMenu(mtype:tMenuType;hContact:THANDLE=0):int;
+function PreBuildMenu(mtype:tMenuType;hContact:TMCONTACT=0):int;
var
i:integer;
mi:TCListMenuItem;
@@ -504,7 +524,7 @@ begin if (mi.flags and CMIF_HIDDEN)=0 then
begin
//!!!! icon (check for contact menu)
- mi.flags:=mi.flags or CMIM_ICON or CMIM_FLAGS;
+ mi.flags:=mi.flags or CMIM_ICON or CMIM_FLAGS{ or CMIF_ICONFROMICOLIB};
if (mtype=contact_menu) and IsLocalItem(UActionList[i]) then
begin
@@ -543,14 +563,22 @@ begin // new name
mi.flags:=mi.flags or CMIM_NAME or CMIF_UNICODE;
if (szMenuNameVars<>nil) and (szMenuNameVars^<>#0) then
- mi.szName.w:=ParseVarString(szMenuNameVars,hContact,extra);
-
+ begin
+ if (menu_opt and UAF_MNAMVAR)<>0 then
+ mi.szName.w:=ParseVarString(szMenuNameVars,hContact,extra)
+ else
+ mi.szName.w:=szMenuNameVars;
+ end
+ else
+ mi.szName.w:=nil;
if mi.szName.w=nil then
mi.szName.w:=szActDescr;
end;
CallService(MS_CLIST_MODIFYMENUITEM,hMenuItem,LPARAM(@mi));
- if mi.szName.w<>szActDescr then
+
+ if (mi.szName.w<>szActDescr) and
+ (mi.szName.w<>szMenuNameVars) then
mFreeMem(mi.szName.w);
end;
end;
@@ -624,13 +652,24 @@ begin if ActionItem.szTTBTooltip =nil then
pc1:=pc
- else pc1:=ActionItem.szTTBTooltip;
+ else
+ begin
+ if (ActionItem.flags and UAF_TTBTTUV)<>0 then
+ pc1:=ParseVarString(ActionItem.szTTBTooltip)
+ else
+ pc1:=ActionItem.szTTBTooltip;
+ end;
if ((ActionItem.flags and UAF_2STATE)=0) or
(ActionItem.szTTBTooltipPressed=nil) then
pc2:=pc1
else
- pc2:=ActionItem.szTTBTooltipPressed;
+ begin
+ if (ActionItem.flags and UAF_TTBTTPV)<>0 then
+ pc2:=ParseVarString(ActionItem.szTTBTooltipPressed)
+ else
+ pc2:=ActionItem.szTTBTooltipPressed;
+ end;
mtButton.Name :=pc;
mtButton.pszTooltipUp :=pc1;
@@ -639,6 +678,11 @@ begin ActionItem.hTTBButton:=TopToolbar_AddButton(@mtButton);
if ActionItem.hTTBButton=THANDLE(-1) then
ActionItem.hTTBButton:=0;
+ if (pc2<>pc1) and (pc2<>ActionItem.szTTBTooltipPressed) then
+ mFreeMem(pc2);
+ if (pc1<>pc) and (pc1<>ActionItem.szTTBTooltip) then
+ mFreeMem(pc1);
+
mFreeMem(pc);
end;
end;
@@ -751,7 +795,7 @@ end; function OnTabButtonPressed(wParam:WPARAM;lParam:LPARAM):int; cdecl;
var
cbcd:pCustomButtonClickData;
-// tabb:TBBButton;
+// tabb:BBButton;
// pc:pWideChar;
i:integer;
begin
diff --git a/plugins/Actman/ua/i_uavars.inc b/plugins/Actman/ua/i_uavars.inc index bab2ac12a1..f2cf1ba42f 100644 --- a/plugins/Actman/ua/i_uavars.inc +++ b/plugins/Actman/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
@@ -61,6 +62,8 @@ const UAF_REGTABB = 1 shl 5; // TabSRMM toolbar
UAF_USING = UAF_REGHOTKEY or UAF_REGTTBB or UAF_REGTABB;
+ UAF_TTBTTPV = 1 shl 9; // TTB pressed hint script
+ UAF_TTBTTUV = 1 shl 10; // TTB unpressed hint script
UAF_2STATE = 1 shl 11; // Buttons/menu items are 2-state
UAF_PRESSED = 1 shl 12; // Button pressed/menu item selected
UAF_SAVESTATE = 1 shl 13; // Save or not "pressed" state
@@ -76,7 +79,10 @@ const // menu options
UAF_MENUSEP = 1 shl 1; // menu item separated
+ UAF_MSUBVAR = 1 shl 2; // submenu name script
+ UAF_MNAMVAR = 1 shl 3; // menu name script
UAF_MENUUSE = 1 shl 8; // use this menu
+ UAF_NOTRANS = 1 shl 9; // do not translate menus
type
tNameRec = record
@@ -119,6 +125,3 @@ var UActionList:array of tMyActionItem;
var
szMyPath:array [0..MAX_PATH] of WideChar;
-var
- hServiceWithLParam:THANDLE;
- hTTBService:THANDLE;
diff --git a/plugins/Actman/ua/i_uconst.inc b/plugins/Actman/ua/i_uconst.inc index 34dde3ee9e..cffbfdcc76 100644 --- a/plugins/Actman/ua/i_uconst.inc +++ b/plugins/Actman/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/Actman/ua/ua.pas b/plugins/Actman/ua/ua.pas index 62b9604286..e6e33aeaad 100644 --- a/plugins/Actman/ua/ua.pas +++ b/plugins/Actman/ua/ua.pas @@ -2,21 +2,15 @@ unit ua; interface
-procedure Init;
-procedure DeInit;
-function AddOptionPage(var tmpl:pAnsiChar;var proc:pointer;var name:PAnsiChar):integer;
-
implementation
uses
windows, commctrl, messages,
- mirutils, common, dbsettings, io, m_api, wrapper,
+ mirutils, common, dbsettings, io, m_api, wrapper, editwrapper,
global;
{$R ua.res}
-{$include m_actman.inc}
-
{$include i_uconst.inc}
{$include i_uavars.inc}
@@ -53,53 +47,54 @@ var // ------------ base interface functions -------------
+procedure CheckPlacesAbility;
var
- iohook:THANDLE;
- hontabloaded,
- honttbloaded,
- ontabbtnpressed,
- onactchanged:THANDLE;
- hPreBuildMMenu,
- hPreBuildCMenu,
- hPreBuildTMenu:THANDLE;
+ 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);
- hServiceWithLParam:=CreateServiceFunction(SERVICE_WITH_LPARAM_NAME,@ServiceCallWithLParam);
- hTTBService :=CreateServiceFunction(TTB_SERVICE_NAME ,@TTBServiceCall);
+ CreateServiceFunction(SERVICE_WITH_LPARAM_NAME,@ServiceCallWithLParam);
+ CreateServiceFunction(TTB_SERVICE_NAME ,@TTBServiceCall);
CheckPlacesAbility;
CreateUActionList;
- honttbloaded :=HookEvent(ME_TTB_MODULELOADED ,@OnTTBLoaded);
- hontabloaded :=HookEvent(ME_MSG_TOOLBARLOADED,@OnTabBBLoaded);
- ontabbtnpressed:=HookEvent(ME_MSG_BUTTONPRESSED,@OnTabButtonPressed);
- onactchanged :=HookEvent(ME_ACT_CHANGED ,@ActListChange);
+ HookEvent(ME_TTB_MODULELOADED ,@OnTTBLoaded);
+ HookEvent(ME_MSG_TOOLBARLOADED,@OnTabBBLoaded);
+ HookEvent(ME_MSG_BUTTONPRESSED,@OnTabButtonPressed);
+ HookEvent(ME_ACT_CHANGED ,@ActListChange);
- hPreBuildMMenu:=HookEvent(ME_CLIST_PREBUILDMAINMENU , PreBuildMainMenu);
- hPreBuildCMenu:=HookEvent(ME_CLIST_PREBUILDCONTACTMENU, PreBuildContactMenu);
- hPreBuildTMenu:=HookEvent(ME_CLIST_PREBUILDTRAYMENU , PreBuildTrayMenu);
+ HookEvent(ME_CLIST_PREBUILDMAINMENU , PreBuildMainMenu);
+ HookEvent(ME_CLIST_PREBUILDCONTACTMENU, PreBuildContactMenu);
+ HookEvent(ME_CLIST_PREBUILDTRAYMENU , PreBuildTrayMenu);
- iohook:=HookEvent(ME_ACT_INOUT,@ActInOut);
+ HookEvent(ME_ACT_INOUT,@ActInOut);
end;
procedure DeInit;
+var
+ i:integer;
begin
+ if Length(UActionList)>0 then
+ begin
+ for i:=HIGH(UActionList) downto 0 do
+ begin
+ DeleteUAction(i,false);
+ end;
+ SetLength(UActionList,0);
+ end;
SetLength(arMenuRec,0);
-
- UnhookEvent(hPreBuildMMenu);
- UnhookEvent(hPreBuildCMenu);
- UnhookEvent(hPreBuildTMenu);
-
- UnhookEvent(honttbloaded);
- UnhookEvent(hontabloaded);
- UnhookEvent(ontabbtnpressed);
- UnhookEvent(onactchanged);
- UnhookEvent(iohook);
- DestroyServiceFunction(hServiceWithLParam);
- DestroyServiceFunction(hTTBService);
end;
function AddOptionPage(var tmpl:pAnsiChar;var proc:pointer;var name:PAnsiChar):integer;
diff --git a/plugins/Actman/ua/ua.rc b/plugins/Actman/ua/ua.rc index 76d8c0ad77..6e0fdde413 100644 --- a/plugins/Actman/ua/ua.rc +++ b/plugins/Actman/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
}
diff --git a/plugins/Actman/ua/ua.res b/plugins/Actman/ua/ua.res Binary files differindex c8f5fd5ea1..25b0f7f2ca 100644 --- a/plugins/Actman/ua/ua.res +++ b/plugins/Actman/ua/ua.res diff --git a/plugins/Actman30/i_const.inc b/plugins/Actman30/i_const.inc deleted file mode 100644 index baf5b5edf3..0000000000 --- a/plugins/Actman30/i_const.inc +++ /dev/null @@ -1,31 +0,0 @@ -{resource constants}
-const
- // dialogs
- IDD_ACTION = 1025;
- IDD_ASK = 1028;
-
- IDC_ACTION_TYPE = 2005;
- IDC_STAT_ACTION = 2006;
-
- IDC_ACTION_LIST = 2007;
- IDC_ACTION_NEW = 2008;
- IDC_ACTION_DELETE = 2009;
- IDC_ACTION_UP = 2010;
- IDC_ACTION_DOWN = 2011;
-
- IDC_MACRO_LIST = 2012;
- IDC_GROUP_NEW = 2015;
- IDC_GROUP_RELOAD = 2016;
- IDC_GROUP_DELETE = 2017;
- IDC_GROUP_TEST = 2018;
- IDC_GROUP_UP = 2019;
- IDC_GROUP_DOWN = 2020;
- IDC_GROUP_EXPORT = 2021;
- IDC_GROUP_IMPORT = 2022;
- IDC_ACTION_HELP = 2023;
-
-// Question
- IDC_ASK = 1025;
- IDC_YESALL = 1026;
- IDC_NOALL = 1027;
- IDC_APPEND = 1028;
diff --git a/plugins/Actman30/i_opt_dlg.inc b/plugins/Actman30/i_opt_dlg.inc deleted file mode 100644 index e7a9e206ef..0000000000 --- a/plugins/Actman30/i_opt_dlg.inc +++ /dev/null @@ -1,52 +0,0 @@ -{}
-var
- xmlfilename:array [0..511] of WideChar;
-const
- etMacro = 1; // Groups changed
- etACT = 2; // Actions changed
-
-{$include i_opt_dlg2.inc}
-
-function OnOptInitialise(wParam:WPARAM;lParam:LPARAM):int;cdecl;
-var
- odp:TOPTIONSDIALOGPAGE;
- ptr:pActionLink;
- tmpl:pAnsiChar;
- name:pansiChar;
- proc:pointer;
- i:integer;
-begin
- result:=0;
- NoDescription:=TranslateW('No description');
-
- StrCopyW(xmlfilename,'c:\export.xml');
-
- DoInitCommonControls(ICC_USEREX_CLASSES);
-
- FillChar(odp,SizeOf(odp),0);
- odp.cbSize :=SizeOf(odp);
- odp.flags :=ODPF_BOLDGROUPS;
- odp.Position :=900003000;
- odp.hInstance :=hInstance;
- odp.szGroup.a :='Services';
- odp.szTitle.a :='Actions';
- odp.szTab.a :='Actions';
- odp.pfnDlgProc :=@DlgProcOpt2;
- odp.pszTemplate:=PAnsiChar(IDD_ACTION);
- Options_AddPage(wParam,@odp);
-
- ptr:=ActionLink;
- while ptr<>nil do
- begin
- if @ptr^.AddOption<>nil then
- begin
- i:=ptr^.AddOption(tmpl,proc,name);
- odp.pszTemplate:=tmpl;
- odp.pfnDlgProc :=proc;
- odp.szTab.a :=name;
- Options_AddPage(wParam,@odp);
- if i>0 then continue;
- end;
- ptr:=ptr^.Next;
- end;
-end;
diff --git a/plugins/Actman30/i_opt_dlg2.inc b/plugins/Actman30/i_opt_dlg2.inc deleted file mode 100644 index 75e1a51685..0000000000 --- a/plugins/Actman30/i_opt_dlg2.inc +++ /dev/null @@ -1,1319 +0,0 @@ -{}
-
-const
- inoutfilter:pWideChar = 'XML files'#0'*.xml'#0'All files'#0'*.*'#0#0;
-const
- MaxDescrLen = 128;
-const
- hlpVariables = 30;
- hlpAdvVariables = 31;
-
-var
- DontReact:bool;
- OldGroupTableProc,
- OldActTableProc:pointer;
- EventMask:dword;
-
-procedure ChangeListNotify(list:integer);
-var
- p:pActModule;
-begin
- p:=ModuleLink;
- while p<>nil do
- begin
- SendMessage(p^.DlgHandle,WM_ACT_LISTCHANGE,list,0);
- p:=p^.Next;
- end;
-end;
-
-procedure ResetDialogs;
-var
- p:pActModule;
-begin
- p:=ModuleLink;
- while p<>nil do
- begin
- SendMessage(p^.DlgHandle,WM_ACT_RESET,0,0);
- p:=p^.Next;
- end;
-end;
-
-procedure ClearDialogData;
-var
- p:pActModule;
-begin
- p:=ModuleLink;
- while p<>nil do
- begin
- if p^.DlgHandle<>0 then ShowWindow(p^.DlgHandle,SW_HIDE);
- p:=p^.Next;
- end;
-end;
-
-function CheckChanges:dword;
-var
- i,j:integer;
- found:boolean;
-begin
- result:=0;
- // 1 - search new items (EditMacroList elements which don't exists in MacroList)
- found:=true;
- for i:=0 to EditMacroList.Count-1 do
- begin
- if (EditMacroList[i]^.flags and ACF_ASSIGNED)<>0 then
- begin
- found:=false;
- for j:=0 to MacroList.Count-1 do
- begin
- if (MacroList[j]^.flags and ACF_ASSIGNED)<>0 then
- begin
- if EditMacroList[i]^.id=MacroList[j]^.id then
- begin
- found:=true;
- break;
- end;
- end;
- end;
- if not found then break;
- end;
- end;
- if not found then
- result:=result or ACTM_NEW;
- // 2 - search deleted items (MacroList elements which don't exists in EditMacroList)
- found:=true;
- for i:=0 to MacroList.Count-1 do
- begin
- if (MacroList[i]^.flags and ACF_ASSIGNED)<>0 then
- begin
- found:=false;
- for j:=0 to EditMacroList.Count-1 do
- begin
- if (EditMacroList[j]^.flags and ACF_ASSIGNED)<>0 then
- begin
- if MacroList[i]^.id=EditMacroList[j]^.id then
- begin
- found:=true;
- break;
- end;
- end;
- end;
- if not found then break;
- end;
- end;
- if not found then
- result:=result or ACTM_DELETE;
- // 3 - resort? (maybe ANY EditMacroList position changes)
-end;
-
-procedure SetChanged(wnd:HWND;atype:integer);
-begin
- SendMessage(GetParent(wnd),PSM_CHANGED,0,0);
-// if ((atype and etMacro)<>0) and (NewGroupList =GroupList ) then NewGroupList :=CloneGroupList;
-// if ((atype and etACT )<>0) and (NewActionList=ActionList) then NewActionList:=CloneActionList;
-end;
-
-procedure SetStart;
-begin
- EditMacroList:=MacroList.Clone();
-end;
-
-// Cancel button pressed OR Edit window closed (After apply action)
-// No main list changed (except flags clearance - not necessary)
-// Edit macro list freeing with actions marked as introduced
-procedure SetCancel;
-var
- i,j:integer;
-begin
- // Delete changed data
- EditMacroList.Clear(ACF_INTRODUCED);
- EditMacroList.Free;
-
- // Clear editing flags
- for i:=0 to MacroList.Count-1 do
- begin
- with MacroList[i]^ do
- if (flags and ACF_ASSIGNED)<>0 then
- begin
- for j:=0 to ActionCount-1 do
- begin
- ActionList^[j].flags:=ActionList^[j].flags and not ACF_REPLACED;
- end;
- end;
- end;
-end;
-
-// SAVE: fill edit macro list by dialog options,
-// Free main macro list with actions marked as replaced
-// copy content to main macro list (state as at option editing start)
-// clear "introduced" and "replaced" flags
-procedure SetSave(Dialog:HWND);
-var
- i,j:integer;
- TmpMacroList:tMacroList;
- TmpMacroCount:integer;
- wnd:HWND;
- li:LV_ITEMW;
-begin
- wnd:=MacroListWindow;
- TmpMacroCount:=SendMessageW(wnd,LVM_GETITEMCOUNT,0,0);
-
- // need to clear flags and resort
- if TmpMacroCount>0 then
- begin
- // Clear actions editing flags
- for i:=0 to EditMacroList.Count-1 do
- begin
- with EditMacroList[i]^ do
- if (flags and ACF_ASSIGNED)<>0 then
- begin
- for j:=0 to ActionCount-1 do
- begin
- ActionList^[j].flags:=ActionList^[j].flags and not ACF_INTRODUCED;
- end;
- end;
- end;
-
- TmpMacroList:=tMacroList.Create(TmpMacroCount);
-
- // resort/copy macros
- li.mask :=LVIF_PARAM;
- li.iSubItem:=0;
- for i:=0 to TmpMacroCount-1 do
- begin
- li.iItem:=i;
- SendMessageW(wnd,LVM_GETITEMW,0,lparam(@li)); // GetLParam(wnd,i);
- move(EditMacroList[loword(li.lParam)]^,TmpMacroList[i]^,SizeOf(tMacroRecord));
- if (li.lParam and ACF_FIRSTRUN)<>0 then
- TmpMacroList[i]^.flags:=TmpMacroList[i]^.flags or ACF_FIRSTRUN
- else
- TmpMacroList[i]^.flags:=TmpMacroList[i]^.flags and not ACF_FIRSTRUN;
- li.lParam:=(li.lParam and (not $FFFF)) or i;
- SendMessageW(wnd,LVM_SETITEMW,0,lparam(@li));
- end;
-
- EditMacroList.Free;
- EditMacroList:=TmpMacroList;
- end;
-
- MacroList.Clear(ACF_REPLACED);
- MacroList.Free;
- MacroList:=EditMacroList.Clone;
-end;
-
-// Fill action type combobox
-function FillActTypeList(list:HWND):HWND;
-var
- cbei:TCOMBOBOXEXITEMW;
- il:HIMAGELIST;
- i:integer;
- buf:array [0..127] of WideChar;
- p:pActModule;
- rc:TRECT;
- dlg:HWND;
-begin
- il:=ImageList_Create(16,16,ILC_COLOR32 or ILC_MASK,0,1);
- SendMessage(list,CB_RESETCONTENT,0,0);
-
- FillChar(cbei,SizeOf(cbei),0);
- cbei.mask:=CBEIF_IMAGE or CBEIF_SELECTEDIMAGE or CBEIF_TEXT or CBEIF_LPARAM;
- p:=ModuleLink;
- i:=0;
- // initial action dialogs position
- SetRect(rc,134,22,0,0);
- dlg:=GetParent(list);
- MapDialogRect(dlg,rc);
- while p<>nil do
- begin
- StrCopy(StrCopyE(@buf,IcoLibPrefix),p^.Name);
- ImageList_ReplaceIcon(il,-1,CallService(MS_SKIN2_GETICON,0,lparam(@buf)));
-
- cbei.pszText :=TranslateW(FastAnsiToWideBuf(p^.Name,buf));
- cbei.iItem :=i;
- cbei.lParam :=p^.Hash;
- cbei.iImage :=i;
- cbei.iSelectedImage:=i;
- if SendMessageW(list,CBEM_INSERTITEMW,0,lparam(@cbei))=-1 then
- break;
- p^.DlgHandle:=p^.Dialog(dlg);
- SetWindowPos(p^.DlgHandle,0,rc.left,rc.top,0,0,SWP_NOZORDER or SWP_NOSIZE or SWP_HIDEWINDOW);
- p:=p^.Next;
- inc(i);
- end;
- ImageList_Destroy(SendMessage(list,CBEM_SETIMAGELIST,0,il));
-
- SendMessage(list,CB_SETCURSEL,0,0);
- result:=GetLink(CB_GetData(list,0))^.DlgHandle;
-end;
-
-//----- Action list stuff -----
-
-procedure SHActButtons(Dialog:HWND;mode:integer);
-begin
- ShowWindow(GetDlgItem(Dialog,IDC_STAT_ACTION),mode);
- ShowWindow(GetDlgItem(Dialog,IDC_ACTION_TYPE),mode);
- if mode=SW_HIDE then
- ClearDialogData;
-end;
-
-procedure CheckActListDirectionButtons(Dialog:HWND);
-var
- wnd:HWND;
- dir:integer;
- okup,okdown:boolean;
-begin
- wnd:=ActionListWindow;
-
- dir:=LV_CheckDirection(wnd);
- okup :=odd(loword(dir));
- okdown:=(loword(dir) and 2)<>0;
-
- EnableWindow(GetDlgItem(Dialog,IDC_ACTION_UP ),okup);
- EnableWindow(GetDlgItem(Dialog,IDC_ACTION_DOWN),okdown);
- SendMessage(wnd,LVM_ENSUREVISIBLE,hiword(dir)-1,0);
-end;
-
-procedure CheckActListButtons(Dialog:HWND);
-var
- mode:integer;
- wnd:HWND;
- b:boolean;
-begin
- wnd:=ActionListWindow;
- b:=SendMessage(wnd,LVM_GETITEMCOUNT,0,0)>0;
- if b then
-{
- ListView_SetItemState(wnd,next,
- LVIS_FOCUSED or LVIS_SELECTED,
- LVIS_FOCUSED or LVIS_SELECTED);
-}
- mode:=SW_SHOW
- else
- mode:=SW_HIDE;
-
- SHActButtons(Dialog,mode);
-
- EnableWindow(wnd,b);
- EnableWindow(GetDlgItem(Dialog,IDC_ACTION_HELP ),b);
- EnableWindow(GetDlgItem(Dialog,IDC_GROUP_TEST ),b);
- EnableWindow(GetDlgItem(Dialog,IDC_ACTION_DELETE),b);
- EnableWindow(GetDlgItem(Dialog,IDC_ACTION_TYPE ),b);
-
- CheckActListDirectionButtons(Dialog);
-end;
-
-// Fill dialog fields by choosen action
-procedure FillAction(Dialog:HWND;act:tBaseAction);
-var
- p:pActModule;
- i:LRESULT;
- wnd:HWND;
-begin
- if act<>nil then
- begin
- p:=GetLink(act.UID);
- if p<>nil then
- SendMessage(p^.DlgHandle,WM_ACT_SETVALUE,0,tlparam(act));
- end
- // for newly added and activated action
- else
- p:=ModuleLink;
-
- if p<>nil then
- begin
- wnd:=GetDlgItem(Dialog,IDC_ACTION_TYPE);
- i:=CB_SelectData(wnd,tlparam(p^.Hash));
- ShowWindow(p^.DlgHandle,SW_SHOW);
- // Saving "normal" action type
- if p^.Hash>10 then
- begin
- SetWindowLongPtrW(wnd,GWLP_USERDATA,i);
- end;
- end;
-end;
-
-// Fill Chain list
-procedure FillActionList(Dialog:HWND;Macro:pMacroRecord);
-var
- idx:integer;
- wnd:HWND;
- li:LV_ITEMW;
-begin
- wnd:=ActionListWindow;
- SendMessage(wnd,LVM_DELETEALLITEMS,0,0);
-
- if (Macro<>nil) and (Macro^.ActionCount>0) then
- begin
- li.mask :=LVIF_TEXT or LVIF_PARAM;
- li.iSubitem:=0;
- idx:=0;
- while idx<Macro^.ActionCount do
- begin
- li.pszText:=Macro^.ActionList^[idx].ActionDescr;
- li.iItem :=idx;
- li.lParam :=tlparam(Macro^.ActionList^[idx]);
- SendMessageW(wnd,LVM_INSERTITEMW,0,tlparam(@li));
- ListView_SetCheckState(wnd,idx,(Macro^.ActionList^[idx].flags and ACF_DISABLED)=0);
- inc(idx);
- end;
-
- Listview_SetItemState(wnd,0,
- LVIS_FOCUSED or LVIS_SELECTED,
- LVIS_FOCUSED or LVIS_SELECTED);
-
- FillAction(Dialog,Macro^.ActionList^[0]);
- end;
- CheckActListButtons(Dialog);
-end;
-
-// change current action name ONLY IN LIST
-procedure ChangeActionName(Dialog:HWND; num:integer=-1;str:PWideChar=nil);
-var
- li:LV_ITEMW;
- wnd:HWND;
- buf:array [0..127] of WideChar;
-begin
- wnd:=ActionListWindow;
- if num<0 then
- li.iItem:=SendMessage(wnd,LVM_GETNEXTITEM,-1,LVNI_FOCUSED)
-
- else
- li.iItem:=num;
- if li.iItem>=0 then
- begin
- li.iSubItem:=0;
- // getting SubAction number
- li.mask:=LVIF_PARAM;
- SendMessage(wnd,LVM_GETITEM,0,tlparam(@li));
-
- // changing to default name
- if str=nil then
- begin
- str:=StrCopyEW(@buf,TranslateW('Action'));
- str^:=' '; inc(str);
- IntToStr(str,SendMessage(wnd,LVM_GETITEMCOUNT,0,0));
- str:=@buf;
- end;
-
- li.mask :=LVIF_TEXT;
- li.pszText:=str;
- SendMessageW(wnd,LVM_SETITEMW,0,tlparam(@li));
- end;
-end;
-
-procedure SaveAction(Dialog:HWND;listnum:integer;actptr:tBaseAction);
-var
- wnd:HWND;
-// li:LV_ITEMW;
-// arr: array [0..255] of WideChar;
- p:pActModule;
-begin
- wnd:=GetDlgItem(Dialog,IDC_ACTION_TYPE);
- p:=GetLink(CB_GetData(wnd));
- if p^.Hash<10 then
- begin
- p:=GetLink(CB_GetData(wnd,GetWindowLongPtrW(wnd,GWLP_USERDATA)));
- end;
-
- wnd:=ActionListWindow;
-
- if listnum<0 then
- begin
- listnum:=SendMessageW(wnd,LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
- if listnum<0 then
- exit;
- actptr:=tBaseAction(LV_GetLParam(wnd,listnum));
- end;
-
- // changed existing action
- if actptr<>nil then
- begin
- if (actptr.flags and ACF_INTRODUCED)<>0 then // new but changed
- actptr.Free
- else // old
- actptr.flags:=actptr.flags or ACF_REPLACED;
- end;
-
- // Action saving
- actptr:=p.Create;
- SendMessage(p.DlgHandle,WM_ACT_SAVE,0,tlparam(actptr));
- actptr.flags:=actptr.flags or ACF_INTRODUCED;
-{ maybe do it at full chain saving?
-
- li.iItem :=listnum;
- li.mask :=LVIF_TEXT;
- li.iSubItem :=0;
- li.pszText :=@arr;
- li.cchTextMax:=SizeOf(arr) div SizeOf(WideChar);
- SendDlgItemMessageW(Dialog,IDC_ACTION_LIST,LVM_GETITEMW,0,tlparam(@li));
- StrDupW(actptr.ActionDescr,arr);
-
- if ListView_GetCheckState(wnd,listnum)=0 then
- actptr.flags:=actptr.flags or ACF_DISABLED;
-}
- LV_SetLParam(wnd,tlparam(actptr),listnum);
-end;
-
-procedure BuildActionChain(Dialog:HWND;group:integer=-1);
-var
- item:integer;
- wnd:HWND;
- idx:integer;
- li:LV_ITEMW;
- arr: array [0..255] of WideChar;
-begin
- idx:=smallint(loword(LV_GetLParam(MacroListWindow,group)));
- if idx>=0 then // we have macro to save
- begin
- SaveAction(Dialog,-1,nil);
-
- with EditMacroList[idx]^ do
- begin
- if ActionCount>0 then
- begin
- ActionCount:=0;
- FreeMem(ActionList);
- ActionList:=nil;
- end;
- end;
-
- wnd:=ActionListWindow;
- with EditMacroList[idx]^ do
- begin
- ActionCount:=SendMessageW(wnd,LVM_GETITEMCOUNT,0,0);
- if ActionCount>0 then // have some actions - need to build list
- begin
- // fix count for empty actions
- item:=0;
- idx:=0;
- while item<ActionCount do
- begin
- // if created but not changed action (fools proof)
- if LV_GetLParam(wnd,item)<>0 then
- Inc(idx);
- Inc(item);
- end;
- // if REAL amount to save>0 (macro not empty)
- if idx>0 then
- begin
- GetMem(ActionList,SizeOf(tBaseAction)*idx);
-
- li.mask :=LVIF_TEXT;
- li.iSubItem :=0;
- li.pszText :=@arr;
- li.cchTextMax:=SizeOf(arr) div SizeOf(WideChar);
-
- idx:=0;
- for item:=0 to ActionCount-1 do
- begin
- ActionList^[idx]:=tBaseAction(LV_GetLParam(wnd,item));
- if ActionList^[idx]<>nil then
- begin
- // set name and enabled/disabled flag
- li.iItem:=item;
- SendDlgItemMessageW(Dialog,IDC_ACTION_LIST,LVM_GETITEMW,0,tlparam(@li));
- mFreeMem(ActionList^[idx].ActionDescr);
- StrDupW(ActionList^[idx].ActionDescr,arr);
-
- if ListView_GetCheckState(wnd,item)=0 then
- ActionList^[idx].flags:=ActionList^[item].flags or ACF_DISABLED
- else
- ActionList^[idx].flags:=ActionList^[item].flags and not ACF_DISABLED;
- inc(idx);
- end;
- end;
- end;
- ActionCount:=idx; // fix for empty actions
- end;
- end;
- end;
-end;
-
-// action (chain) table procedure (key hook)
-function NewActTableProc(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
-var
- i:integer;
-begin
- result:=0;
- case hMessage of
- WM_KEYDOWN: begin
- if (lParam and (1 shl 30))=0 then
- begin
- case wParam of
- VK_F2: begin
- i:=SendMessage(Dialog,LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
- if i>=0 then
- PostMessageW(Dialog,LVM_EDITLABELW,i,0);
- exit;
- end;
- VK_UP: begin
- if (GetKeyState(VK_CONTROL) and $8000)<>0 then
- begin
- PostMessage(GetParent(Dialog),WM_COMMAND,(BN_CLICKED shl 16)+IDC_ACTION_UP,0);
- exit;
- end;
- end;
- VK_DOWN: begin
- if (GetKeyState(VK_CONTROL) and $8000)<>0 then
- begin
- PostMessage(GetParent(Dialog),WM_COMMAND,(BN_CLICKED shl 16)+IDC_ACTION_DOWN,0);
- exit;
- end;
- end;
- VK_INSERT: begin
- PostMessage(GetParent(Dialog),WM_COMMAND,(BN_CLICKED shl 16)+IDC_ACTION_NEW,0);
- exit;
- end;
- VK_DELETE: begin
- PostMessage(GetParent(Dialog),WM_COMMAND,(BN_CLICKED shl 16)+IDC_ACTION_DELETE,0);
- exit;
- end;
- end;
- end;
- end;
- end;
- result:=CallWindowProc(OldActTableProc,Dialog,hMessage,wParam,lParam);
-end;
-
-//----- Macro list stuff -----
-
-// action group table procedure (key hook)
-function NewGroupTableProc(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
-var
- i:integer;
-begin
- result:=0;
- case hMessage of
- WM_KEYDOWN: begin
- if (lParam and (1 shl 30))=0 then
- begin
- case wParam of
- VK_F2: begin
- i:=SendMessage(Dialog,LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
- if i>=0 then
- PostMessageW(Dialog,LVM_EDITLABELW,i,0);
- exit;
- end;
- VK_INSERT: begin
- PostMessage(GetParent(Dialog),WM_COMMAND,(BN_CLICKED shl 16)+IDC_GROUP_NEW,0);
- exit;
- end;
- VK_DELETE: begin
- PostMessage(GetParent(Dialog),WM_COMMAND,(BN_CLICKED shl 16)+IDC_GROUP_DELETE,0);
- exit;
- end;
- VK_UP: begin
- if (GetKeyState(VK_CONTROL) and $8000)<>0 then
- begin
- PostMessage(GetParent(Dialog),WM_COMMAND,(BN_CLICKED shl 16)+IDC_GROUP_UP,0);
- exit;
- end;
- end;
- VK_DOWN: begin
- if (GetKeyState(VK_CONTROL) and $8000)<>0 then
- begin
- PostMessage(GetParent(Dialog),WM_COMMAND,(BN_CLICKED shl 16)+IDC_GROUP_DOWN,0);
- exit;
- end;
- end;
- end;
- end;
- end;
- end;
- result:=CallWindowProc(OldGroupTableProc,Dialog,hMessage,wParam,lParam);
-end;
-
-function AddMacro(Dialog:HWND;MacroNum:cardinal):integer;
-var
- li:LV_ITEMW;
- list:HWND;
-begin
- with EditMacroList[MacroNum]^ do
- begin
- list:=MacroListWindow;
- li.mask :=LVIF_PARAM+LVIF_TEXT;
- li.iItem :=SendMessage(list,LVM_GETNEXTITEM,-1,LVNI_FOCUSED)+1;
- li.iSubItem :=0;
- li.lParam :=MacroNum;
- li.pszText :=@descr;
- li.iItem :=SendMessageW(list,LVM_INSERTITEMW,0,lparam(@li));
- if li.iItem>0 then
- dec(li.iItem);
- ListView_SetItemState(list,li.iItem,
- LVIS_FOCUSED or LVIS_SELECTED,
- LVIS_FOCUSED or LVIS_SELECTED);
- result:=li.iItem;
- end;
-end;
-
-function MoveMacro(list:HWND;num:integer;incr:integer):integer;
-var
- i,j:integer;
-begin
- if num<0 then
- begin
- result:=-1;
- j:=SendMessage(list,LVM_GETITEMCOUNT,0,0)-1;
- if incr<0 then // up, from beginning
- begin
- for i:=0 to j do
- begin
- if SendMessage(list,LVM_GETITEMSTATE,i,LVIS_SELECTED)<>0 then
- begin
- if i=0 then break; // first selected is first already, nothing to move
- LV_MoveItem(list,incr,i);
- if result<0 then result:=i+incr;
- end;
- end;
- end
- else // down, from the end
- begin
- for i:=j downto 0 do
- begin
- if SendMessage(list,LVM_GETITEMSTATE,i,LVIS_SELECTED)<>0 then
- begin
- if i=j then break; // last selected is last already, nothing to move
- LV_MoveItem(list,incr,i);
- if result<0 then result:=i+incr;
- end;
- end;
- end;
- end
- else
- begin
- LV_MoveItem(list,incr,num);
- result:=num;
- end;
-end;
-
-// enable/disable navigation chain buttons
-procedure CheckMacroListDirectionButtons(Dialog:HWND);
-var
- wnd:HWND;
- dir:integer;
- okup,okdown:boolean;
-begin
- wnd:=MacroListWindow;
- dir:=LV_CheckDirection(wnd);
- okup :=odd(loword(dir));
- okdown:=(loword(dir) and 2)<>0;
-
- EnableWindow(GetDlgItem(Dialog,IDC_GROUP_UP ),okup);
- EnableWindow(GetDlgItem(Dialog,IDC_GROUP_DOWN),okdown);
- SendMessage(wnd,LVM_ENSUREVISIBLE,hiword(dir)-1,0);
-end;
-
-procedure CheckMacroList(Dialog:HWND);
-var
- wnd:HWND;
- b:boolean;
-begin
- wnd:=MacroListWindow;
-
- b:=SendMessage(wnd,LVM_GETITEMCOUNT,0,0)>0;
- if not b then
- CheckActListButtons(Dialog);
-
- EnableWindow(wnd,b);
- EnableWindow(GetDlgItem(Dialog,IDC_ACTION_NEW ),b);
- EnableWindow(GetDlgItem(Dialog,IDC_GROUP_DELETE),b);
- EnableWindow(GetDlgItem(Dialog,IDC_GROUP_EXPORT),b);
-
- CheckMacroListDirectionButtons(Dialog);
-end;
-
-// Fill action group list and disable chain controls
-function FillMacroList(Dialog:HWND):integer;
-var
- CurMacro:pMacroRecord;
- i:integer;
- list:HWND;
- lvi:TLVITEMW;
-begin
- SendDlgItemMessage(Dialog,IDC_ACTION_LIST,LVM_DELETEALLITEMS,0,0);
- CheckActListButtons(Dialog);
-
- list:=MacroListWindow;
-
- SendMessage(list,LVM_DELETEALLITEMS,0,0);
- result:=-1;
- if EditMacroList.Count>0 then
- begin
- CurMacro:=EditMacroList[0];
- lvi.mask:=LVIF_TEXT+LVIF_PARAM;
- lvi.iSubItem:=0;
- for i:=0 to EditMacroList.Count-1 do
- begin
- if (CurMacro^.flags and ACF_ASSIGNED)<>0 then
- begin
- lvi.iItem :=i;
-
- lvi.lParam:=i;
- if (CurMacro^.flags and ACF_FIRSTRUN)<>0 then
- lvi.lParam:=lvi.lParam or ACF_FIRSTRUN;
-
- lvi.pszText:=@(CurMacro^.descr);
- SendMessageW(list,LVM_INSERTITEMW,0,tlparam(@lvi));
- inc(result);
- end;
- inc(CurMacro);
- end;
- end;
-
- CheckMacroList(Dialog);
-//?? SendMessage(list,CB_SETCURSEL,0,0);
- SendMessage(list,LVM_SETCOLUMNWIDTH,0,LVSCW_AUTOSIZE_USEHEADER);
-
- ListView_SetItemState(list,0,
- LVIS_FOCUSED or LVIS_SELECTED,
- LVIS_FOCUSED or LVIS_SELECTED);
-end;
-
-//----- Other stuff -----
-
-procedure SetButtonIcons2(Dialog:HWND);
-var
- ti:TTOOLINFOW;
- hwndTooltip: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);
-
- FillChar(ti,SizeOf(ti),0);
- ti.cbSize :=sizeof(TOOLINFO);
- ti.uFlags :=TTF_IDISHWND or TTF_SUBCLASS;
- ti.hwnd :=Dialog;
- ti.hinst :=hInstance;
-
- ti.uId :=GetDlgItem(Dialog,IDC_ACTION_HELP);
- ti.lpszText:=TranslateW('Help');
- SendMessage(ti.uId,BM_SETIMAGE,IMAGE_ICON,
- CallService(MS_SKIN_LOADICON,SKINICON_OTHER_HELP,0));
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
-
- ti.uId :=GetDlgItem(Dialog,IDC_ACTION_NEW);
- ti.lpszText:=TranslateW('New');
- OptSetButtonIcon(ti.uId,ACI_NEW);
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
-{
- hNew:=GetDlgItem(Dialog,IDC_NEW);
- SendMessage (hNew,BUTTONADDTOOLTIP,TWPARAM(TranslateW('New')),BATF_UNICODE);
- OptSetButtonIcon(hNew,ACI_NEW);
-}
-
- ti.uId :=GetDlgItem(Dialog,IDC_GROUP_NEW);
- OptSetButtonIcon(ti.uId,ACI_NEW);
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
-
- ti.uId :=GetDlgItem(Dialog,IDC_ACTION_UP);
- ti.lpszText:=TranslateW('Up');
- OptSetButtonIcon(ti.uId,ACI_UP);
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
-
- ti.uId :=GetDlgItem(Dialog,IDC_GROUP_UP);
- OptSetButtonIcon(ti.uId,ACI_UP);
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
-
- ti.uId :=GetDlgItem(Dialog,IDC_ACTION_DOWN);
- ti.lpszText:=TranslateW('Down');
- OptSetButtonIcon(ti.uId,ACI_DOWN);
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
-
- ti.uId :=GetDlgItem(Dialog,IDC_GROUP_DOWN);
- OptSetButtonIcon(ti.uId,ACI_DOWN);
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
-
- ti.uId :=GetDlgItem(Dialog,IDC_ACTION_DELETE);
- ti.lpszText:=TranslateW('Delete');
- OptSetButtonIcon(ti.uId,ACI_DELETE);
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
-
- ti.uId :=GetDlgItem(Dialog,IDC_GROUP_DELETE);
- OptSetButtonIcon(ti.uId,ACI_DELETE);
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
-{
- ti.uId :=GetDlgItem(Dialog,IDC_GROUP_RELOAD);
- ti.lpszText:=TranslateW('Reload');
- OptSetButtonIcon(ti.uId,ACI_RELOAD);
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
-}
- ti.uId :=GetDlgItem(Dialog,IDC_GROUP_TEST);
- ti.lpszText:=TranslateW('Test');
- OptSetButtonIcon(ti.uId,ACI_TEST);
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
-{!!
- ti.uId :=GetDlgItem(Dialog,IDC_GROUP_IMPORT);
- ti.lpszText:=TranslateW('Import');
- OptSetButtonIcon(ti.uId,ACI_IMPORT);
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
-
- ti.uId :=GetDlgItem(Dialog,IDC_GROUP_EXPORT);
- ti.lpszText:=TranslateW('Export');
- OptSetButtonIcon(ti.uId,ACI_EXPORT);
- SendMessageW(hwndTooltip,TTM_ADDTOOLW,0,lparam(@ti));
-}
-end;
-
-function DlgProcOpt2(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;
-var
- wnd:HWND;
- p:pActModule;
- i,j,num:int_ptr;
- lvflag:integer;
- li:LV_ITEMW;
- lv:LV_COLUMNW;
-begin
- result:=0;
- case hMessage of
- WM_DESTROY: begin
- SetCancel;
- end;
-
- WM_INITDIALOG: begin
- SetStart;
- DontReact :=true;
- // variant - put after all dialogs adds (to translate them too)
- TranslateDialogDefault(Dialog);
- // For some actions
- MacroListWindow :=GetDlgItem(Dialog,IDC_MACRO_LIST);
- ActionListWindow:=GetDlgItem(Dialog,IDC_ACTION_LIST);
-
- SetButtonIcons2(Dialog);
- wnd:=ActionListWindow;
- SendMessage(wnd,LVM_SETEXTENDEDLISTVIEWSTYLE,LVS_EX_CHECKBOXES,LVS_EX_CHECKBOXES);
- SendMessage(wnd,LVM_SETUNICODEFORMAT,1,0);
- FillChar(lv,SizeOf(lv),0);
- lv.mask:=LVCF_WIDTH;
- lv.cx :=110;
- SendMessageW(wnd,LVM_INSERTCOLUMNW ,0,tlparam(@lv));
- SendMessageW(wnd,LVM_SETCOLUMNWIDTH,0,LVSCW_AUTOSIZE_USEHEADER);
-
- // action type combobox
- FillActTypeList(GetDlgItem(Dialog,IDC_ACTION_TYPE));
-{!!
- // XML import/export service
- if ServiceExists(MS_SYSTEM_GET_XI)=0 then
- begin
- EnableWindow(GetDlgItem(Dialog,IDC_GROUP_EXPORT),false);
- EnableWindow(GetDlgItem(Dialog,IDC_GROUP_IMPORT),false);
- end;
-}
- OldActTableProc :=pointer(SetWindowLongPtrW(wnd,GWL_WNDPROC,long_ptr(@NewActTableProc)));
- OldGroupTableProc:=pointer(SetWindowLongPtrW(MacroListWindow,
- GWL_WNDPROC,long_ptr(@NewGroupTableProc)));
-
- ClearDialogData;
- ResetDialogs;
-
- // fill group list
- wnd:=MacroListWindow;
- SendMessage(wnd,LVM_SETUNICODEFORMAT,1,0);
- lv.mask:=LVCF_WIDTH;
- lv.cx :=110;
- SendMessageW(wnd,LVM_INSERTCOLUMNW,0,tlparam(@lv));
- FillMacroList(Dialog);
- ChangeListNotify(1);
-
- // fill current group
- FillActionList(Dialog,EditMacroList[0]);
- ChangeListNotify(2);
- EventMask:=0;
- DontReact:=false;
- end;
-
- WM_COMMAND: begin
- if DontReact then exit;
- case wParam shr 16 of
-{
- EN_CHANGE: begin
-// check for group renaming
- if loword(wParam)<>IDC_EDIT_FORMAT then
- begin
- SetChanged(Dialog,etACT);
- end;
- end;
-}
- CBN_SELCHANGE: begin
- case loword(wParam) of
- IDC_ACTION_TYPE: begin
- ClearDialogData;
- p:=GetLink(CB_GetData(lParam));
- ShowWindow(p^.DlgHandle,SW_SHOW);
-
- // Saving prevoius "normal" action type
- if p^.Hash>10 then
- begin
- SetWindowLongPtrW(lParam,GWLP_USERDATA,
- SendMessage(lParam,CB_GETCURSEL,0,0));
- SetChanged(Dialog,etACT);
- end;
- end;
- end;
- end;
-
- BN_CLICKED: begin
- case loword(wParam) of
- IDC_GROUP_RELOAD, // don't affect to saved (DB) datas
- IDC_ACTION_HELP,
- IDC_GROUP_EXPORT,
- IDC_GROUP_TEST: ;
-
- IDC_GROUP_UP,
- IDC_GROUP_DOWN,
- IDC_GROUP_NEW : SetChanged(Dialog,etMacro);
-
- IDC_GROUP_DELETE, // action deleting with subactions
- IDC_GROUP_IMPORT,
- IDC_ACTION_NEW,
- IDC_ACTION_DELETE,
- IDC_ACTION_UP,
- IDC_ACTION_DOWN: begin
- SetChanged(Dialog,etMacro+etACT);
- end;
- else
- SetChanged(Dialog,etACT);
- end;
-
- case loword(wParam) of
-{
- IDC_GROUP_EXPORT: begin
- if ShowDlgW(xmlfilename,xmlfilename,TranslateW(inoutfilter),false) then
- begin
- wnd:=MacroListWindow;
- for i:=0 to ListView_GetItemCount(wnd)-1 do
- begin
- if ListView_GetItemState(wnd,i,LVIS_SELECTED)<>0 then
- begin
- with EditMacroList[LV_GetLParam(wnd,i)] do
- if (flags and ACF_ASSIGNED)<>0 then // must be always true
- flags:=flags or ACF_EXPORT;
- end
- else
- with EditMacroList[i] do
- if (flags and (ACF_EXPORT or ACF_ASSIGNED))=
- (ACF_EXPORT or ACF_ASSIGNED) then
- flags:=flags and not ACF_EXPORT;
- end;
- i:=ACIO_EXPORT or ACIO_SELECTED;
- if GetFSize(xmlfilename)>0 then
- if MessageBoxW(Dialog,TranslateW('Append data to file?'),
- PluginName,MB_YESNO+MB_ICONWARNING)=IDYES then
- i:=i or ACIO_APPEND;
-//!!!!!!!!!!!!!!!
-// we MUST Export EditMacroList, NOT MacroList
-// OR
-// Use "Apply" code before
- CallService(MS_ACT_INOUT,i,TLPARAM(@xmlfilename));
- for i:=0 to MaxGroups-1 do
- with EditMacroList[i] do
- if (flags and (ACF_EXPORT or ACF_ASSIGNED))=
- (ACF_EXPORT or ACF_ASSIGNED) then
- flags:=flags and not ACF_EXPORT;
- end;
- end;
-}
- IDC_GROUP_IMPORT: begin
- if ShowDlgW(xmlfilename,xmlfilename,TranslateW(inoutfilter)) then
- begin
- // "save" selected macro (in edit list only)
- BuildActionChain(Dialog);
-
- if Import(EditMacroList,xmlfilename,0)<>0 then
-// if CallService(MS_ACT_INOUT,0,TLPARAM(@xmlfilename))<>0 then
- begin
- // copy from WM_INITDIALOG
- FillMacroList(Dialog);
- ChangeListNotify(1);
-
- // fill current group
- FillActionList(Dialog,EditMacroList[0]);
- ChangeListNotify(2);
-
- CheckMacroListDirectionButtons(Dialog);
- end;
- end;
- end;
-
- IDC_GROUP_TEST: begin
- li.mask :=LVIF_PARAM;
- li.iSubItem:=0;
- // Get selected macro
- li.iItem :=SendMessage(MacroListWindow,LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
- // "save" selected macro (in edit list only)
- BuildActionChain(Dialog,li.iItem);
- // Get lParam = EditMacroList element
- SendMessageW(MacroListWindow,LVM_GETITEMW,0,tlparam(@li));
-
- ActionStarter(EditMacroList[loword(li.lParam)],nil,ACTP_SAMETHREAD or ACTP_WAIT);
- end;
-
- IDC_GROUP_NEW: begin
- if AddMacro(Dialog,EditMacroList.NewMacro())>=0 then
- begin
- CheckMacroList(Dialog);
- ChangeListNotify(1);
- end;
- end;
- IDC_GROUP_DELETE: begin
- DontReact:=true;
- wnd:=MacroListWindow;
- for i:=ListView_GetItemCount(wnd)-1 downto 0 do
- begin
- if ListView_GetItemState(wnd,i,LVIS_SELECTED)<>0 then
- begin
- num:=Loword(LV_GetLParam(wnd,i));
- // mark old to delete on apply (must be first)
- with EditMacroList[num]^ do
- for j:=0 to ActionCount-1 do
- ActionList[j].flags:=ActionList[j].flags or ACF_REPLACED;
- // delete new actions
- FreeMacro(EditMacroList[num],ACF_INTRODUCED);
-
- SendMessage(wnd,LVM_DELETEITEM,i,0);
- end;
- end;
- Listview_SetItemState(wnd,-1,0,LVIS_FOCUSED or LVIS_SELECTED);
- DontReact:=false;
- SendDlgItemMessage(Dialog,IDC_ACTION_LIST,LVM_DELETEALLITEMS,0,0);
- Listview_SetItemState(wnd,0,LVIS_FOCUSED or LVIS_SELECTED,
- LVIS_FOCUSED or LVIS_SELECTED);
- CheckMacroList(Dialog);
- ChangeListNotify(1);
- end;
-
- IDC_ACTION_HELP: begin
- SendMessage(
- GetLink(CB_GetData(GetDlgItem(Dialog,IDC_ACTION_TYPE)))^.DlgHandle,
- WM_HELP,0,0);
- end;
-
- IDC_ACTION_NEW: begin
- wnd:=ActionListWindow;
- li.mask :=LVIF_PARAM;
- i :=SendMessage(wnd,LVM_GETNEXTITEM,-1,LVNI_FOCUSED);
- li.iItem :=i+1;
- li.iSubItem:=0;
- li.lParam :=0;{NewAction(NewActionList,NewMaxActions);}
- SendMessageW(wnd,LVM_INSERTITEMW,0,tlparam(@li));
- ListView_SetCheckState(wnd,li.iItem,true);
- if li.iItem=0 then
- begin
- ListView_SetItemState(wnd,0,LVIS_FOCUSED or LVIS_SELECTED,
- LVIS_FOCUSED or LVIS_SELECTED);
- SHActButtons(Dialog,SW_SHOW);
- SendDlgItemMessage(Dialog,IDC_ACTION_TYPE,CB_SETCURSEL,0,0);
- end;
- ChangeActionName(Dialog,li.iItem);
-
- CheckActListButtons(Dialog);
- ChangeListNotify(2);
- end;
- IDC_ACTION_DELETE: begin
- DontReact:=true;
- wnd:=ActionListWindow;
- for i:=ListView_GetItemCount(wnd)-1 downto 0 do
- begin
- if ListView_GetItemState(wnd,i,LVIS_SELECTED)<>0 then
- begin
- j:=LV_GetLParam(wnd,i);
- if j<>0 then
- begin
- if (tBaseAction(j).flags and ACF_INTRODUCED)<>0 then
- tBaseAction(j).Free
- else
- tBaseAction(j).flags:=tBaseAction(j).flags or ACF_REPLACED;
- end;
- SendMessage(wnd,LVM_DELETEITEM,i,0);
- end;
- end;
- Listview_SetItemState(wnd,-1,0,LVIS_FOCUSED or LVIS_SELECTED);
- DontReact:=false;
- Listview_SetItemState(wnd,0,LVIS_FOCUSED or LVIS_SELECTED,
- LVIS_FOCUSED or LVIS_SELECTED);
- CheckActListButtons(Dialog);
- ChangeListNotify(2);
- end;
-
- IDC_GROUP_UP: begin
- MoveMacro(MacroListWindow,-1,-1);
- CheckMacroListDirectionButtons(Dialog);
- EventMask:=EventMask or ACTM_SORT;
- ChangeListNotify(1);
- end;
- IDC_GROUP_DOWN: begin
- MoveMacro(MacroListWindow,-1,1);
- CheckMacroListDirectionButtons(Dialog);
- EventMask:=EventMask or ACTM_SORT;
- ChangeListNotify(1);
- end;
-
- IDC_ACTION_UP: begin
- MoveMacro(ActionListWindow,-1,-1);
- CheckActListDirectionButtons(Dialog);
- ChangeListNotify(2);
- end;
- IDC_ACTION_DOWN: begin
- MoveMacro(ActionListWindow,-1,1);
- CheckActListDirectionButtons(Dialog);
- ChangeListNotify(2);
- end;
-
- end;
- end;
- end;
- end;
-
- WM_HELP: begin
- SendMessage(
- GetLink(CB_GetData(GetDlgItem(Dialog,IDC_ACTION_TYPE)))^.DlgHandle,
- WM_HELP,0,lParam);
- result:=1;
- end;
-
- WM_NOTIFY: begin
- case integer(PNMHdr(lParam)^.code) of
- PSN_APPLY: begin
- BuildActionChain(Dialog);
-
- EventMask:=EventMask or CheckChanges();
- SetSave(Dialog);
- SaveMacros;
-
- if EventMask<>0 then //??
- begin
- NotifyEventHooks(hHookChanged,EventMask,0);
- EventMask:=0;
- end;
-
- end;
-
- NM_DBLCLK: begin
- if PNMListView(lParam)^.iItem>=0 then
- PostMessageW(PNMHdr(lParam)^.hWndFrom,LVM_EDITLABELW,
- PNMListView(lParam)^.iItem,0);
- end;
-
- LVN_ITEMCHANGED: begin
- if DontReact then exit; // bug when group moved avoid
-
- if wParam=IDC_MACRO_LIST then
- begin
- if PNMLISTVIEW(lParam)^.uChanged=LVIF_STATE then
- begin
- lvflag:=(PNMLISTVIEW(lParam)^.uOldState and LVNI_FOCUSED)-
- (PNMLISTVIEW(lParam)^.uNewState and LVNI_FOCUSED);
-
- if lvflag>0 then // old focus
- BuildActionChain(Dialog,PNMLISTVIEW(lParam)^.iItem)
- else if lvflag<0 then // new focus
- begin
- DontReact:=true;
-
- ClearDialogData;
- ResetDialogs;
- FillActionList(Dialog,EditMacroList[Loword(PNMLISTVIEW(lParam)^.lParam)]);
- CheckMacroListDirectionButtons(Dialog);
- ChangeListNotify(2);
-
- DontReact:=false;
- end
- else
- begin
-{??
- lvflag:=(PNMLISTVIEW(lParam)^.uOldState and LVNI_SELECTED)-
- (PNMLISTVIEW(lParam)^.uNewState and LVNI_SELECTED);
-
- if lvflag<>0 then
- CheckMacroListDirectionButtons(Dialog);
-}
- end;
- end;
- end
-
- else if wParam=IDC_ACTION_LIST then
- begin
- lvflag:=(PNMLISTVIEW(lParam)^.uOldState and LVNI_FOCUSED)-
- (PNMLISTVIEW(lParam)^.uNewState and LVNI_FOCUSED);
- if lvflag>0 then // old focus
- begin
- SaveAction(Dialog,
- PNMLISTVIEW(lParam)^.iItem,
- tBaseAction(PNMLISTVIEW(lParam)^.lParam));
- end
- else if lvflag<0 then // new focus
- begin
- DontReact:=true;
-
- ClearDialogData;
- ResetDialogs;
- FillAction(Dialog,tBaseAction(PNMLISTVIEW(lParam)^.lParam));
- CheckActListDirectionButtons(Dialog);
-
- DontReact:=false;
- end
- else
- begin // checkboxes
-{??
- lvflag:=(PNMLISTVIEW(lParam)^.uOldState and LVNI_SELECTED)-
- (PNMLISTVIEW(lParam)^.uNewState and LVNI_SELECTED);
-
- if lvflag<>0 then
- CheckMacroListDirectionButtons(Dialog);
-}
- if (PNMLISTVIEW(lParam)^.uOldState or PNMLISTVIEW(lParam)^.uNewState)=$3000 then
- begin
- SetChanged(Dialog,etACT);
- end;
- end;
- end;
- end;
-
- LVN_ENDLABELEDITW: begin
- if DontReact then exit;
-
- if wParam=IDC_MACRO_LIST then
- begin
- with PLVDISPINFOW(lParam)^ do
- begin
- if item.pszText<>nil then
- begin
- EventMask:=EventMask or ACTM_RENAME;
- SetChanged(Dialog,etMacro);
- item.mask:=LVIF_TEXT;
- if pWideChar(item.pszText)^=#0 then
- pWideChar(item.pszText):=NoDescription;
- SendMessageW(hdr.hWndFrom,LVM_SETITEMW,0,tlparam(@item));
-
- with EditMacroList[loword(item.lParam)]^ do
- begin
- StrCopyW(descr,item.pszText,MacroNameLen-1);
- end;
- ChangeListNotify(1);
-
- result:=1;
- end;
- end;
- end
- else if wParam=IDC_ACTION_LIST then
- begin
- with PLVDISPINFOW(lParam)^ do
- begin
- if item.pszText<>nil then
- begin
- SetChanged(Dialog,etACT);
- ChangeActionName(Dialog,item.iItem,pWideChar(item.pszText));
- ChangeListNotify(2);
- result:=1;
- end;
- end;
- end;
- end;
-
- end;
- end;
- else
-// {result:=}DefWindowProc(Dialog,hMessage,wParam,lParam);
- end;
-// {result:=}DefWindowProc(Dialog,hMessage,wParam,lParam);
-end;
diff --git a/plugins/Actman30/i_options.inc b/plugins/Actman30/i_options.inc deleted file mode 100644 index fbbf6c558c..0000000000 --- a/plugins/Actman30/i_options.inc +++ /dev/null @@ -1,475 +0,0 @@ -{Save/load options}
-
-const
- opt_group = 'Group';
- opt_actions = 'Action';
- opt_numacts = 'numactions';
- opt_nummacro = 'numgroups';
-
- opt_descr = 'descr';
- opt_id = 'id';
- opt_uid = 'uid';
- opt_flags = 'flags';
-
-//----- Save settings -----
-
-procedure SaveActions(Macro:pMacroRecord;section:pAnsiChar);
-var
- p,p1:PAnsiChar;
- i:integer;
-begin
- p:=StrEnd(section);
- StrCopy(p,opt_numacts); DBWriteWord(0,DBBranch,section,Macro^.ActionCount);
-
- // in: section = "Group#/"
- p1:=StrCopyE(p,opt_actions); // "Group#/Action"
- DBDeleteGroup(0,DBBranch,section);
-
- for i:=0 to Macro^.ActionCount-1 do
- begin
- p:=StrEnd(IntToStr(p1,i));
- p^:='/'; inc(p); // "Group#/Action#/"
-
-//?? StrCopy(p,opt_uid); DBWriteDWord(0,DBBranch,section,Macro^.ActionList[i].uid);
- p^:=#0;
- Macro^.ActionList[i].Save(section,0);
- end;
-
-end;
-
-procedure SaveMacros;
-var
- Macro:pMacroRecord;
- OldNumMacros,NumMacros:integer;
- i:integer;
- section:array [0..127] of AnsiChar;
- p,p1:PAnsiChar;
-begin
-// even if crap in settings, skip on read
- DBWriteByte(0,DBBranch,'version' ,3);
-
- OldNumMacros:=DBReadWord(0,DBBranch,opt_nummacro,0);
-
- Macro:=MacroList[0];
- i:=MacroList.Count;
- NumMacros:=0;
-
- p1:=StrCopyE(section,opt_group);
- while i>0 do
- begin
- with Macro^ do
- begin
- if (flags and (ACF_ASSIGNED or ACF_VOLATILE))=ACF_ASSIGNED then
- begin
- p:=StrEnd(IntToStr(p1,NumMacros));
- p^:='/'; inc(p);
-
- StrCopy(p,opt_id ); DBWriteDWord(0,DBBranch,section,id);
- StrCopy(p,opt_flags); DBWriteDWord(0,DBBranch,section,flags);
- StrCopy(p,opt_descr); DBWriteUnicode (0,DBBranch,section,descr);
-
- p^:=#0;
-
- SaveActions(Macro,section);
-
- inc(NumMacros);
- end;
- end;
- inc(Macro);
- dec(i);
- end;
- DBWriteWord(0,DBBranch,opt_nummacro,NumMacros);
-
- // deleting old unused macro settings
- while OldNumMacros>NumMacros do
- begin
- dec(OldNumMacros);
- IntToStr(p1,OldNumMacros);
- DBDeleteGroup(0,DBBranch,section);
- end;
-end;
-
-//===== Load settings =====
-
-//----- V2 settings processing -----
-
-const
- ACT_CONTACT = 1;
- ACT_SERVICE = 2;
- ACT_PROGRAM = 3;
- ACT_TEXT = 4;
- ACT_ADVANCE = 5;
- ACT_CHAIN = 6;
- ACT_RW = 7;
- ACT_MESSAGE = 8;
-
-// action flags
-const
- ACF_MASK = $00FFFFFF;
-
- ACF_OLD_CLIPBRD = $00000002; // Clipboard operations, not window
- ACF_OLD_FILE = $00000010; // File operations
- ACF_OLD_FWRITE = $00000020; // read/write file
- ACF_OLD_FAPPEND = $00000040; // append file
-
-const
- OldVersion = 'Your Actman settings are for old version. If you are ready to upgrade settings, ' +
- 'press OK. Else press Cancel and change manually Actman plugin back to old version ' +
- 'or make settings backup. To keep previously exported macros please import them back ' +
- 'before conversion.';
- Notes = 'Please, don''t use macro test for non-saved macros. If you had ''Advanced'' or file ' +
- 'writing actions previously, check them - their logic was changed.';
- ConvResult = 'Actman settings converted to new version';
-
-procedure CheckActionList(Macro:pMacroRecord;num:integer);
-var
- tmplist:pActionList;
-begin
- if num=Macro^.ActionCount then
- begin
- GetMem(tmplist,SizeOf(tBaseAction)*(num+1));
- move(Macro^.ActionList^,tmplist^,Macro^.ActionCount*SizeOf(tBaseAction));
- FreeMem(Macro^.ActionList);
- Macro^.ActionList:=tmplist;
- Inc(Macro^.ActionCount);
- end;
-end;
-
-function LoadActionsV2(Macro:pMacroRecord;section:pAnsiChar):boolean; stdcall;
-var
- buf:array [0..31] of WideChar;
- p,p1,pc:PAnsiChar;
- action:tBaseAction;
- actm:pActModule;
- flags2,actionType:dword;
- code,i,num,count:integer;
- cond,act:byte;
-begin
- result:=false;
- p:=StrEnd(section);
- StrCopy(p,opt_numacts); Macro^.ActionCount:=DBReadWord(0,DBBranch,section);
-
- if Macro^.ActionCount>0 then
- begin
- GetMem(Macro^.ActionList,SizeOf(tBaseAction)*Macro^.ActionCount);
- p1:=StrCopyE(p,opt_actions); // "Group#/Action"
-
- num:=0;
- count:=Macro^.ActionCount;
- for i:=1 to count do
- begin
- p:=StrEnd(IntToStr(p1,i));
- p^:='/'; inc(p); // "Group#/Action#/"
-
- StrCopy(p,'type' ); actionType:=DBReadByte (0,DBBranch,section,ACT_CONTACT);
- case actionType of
- ACT_CONTACT: pc:='Contact';
- ACT_SERVICE: pc:='Service';
- ACT_PROGRAM: pc:='Program';
- ACT_TEXT: pc:=nil;
- ACT_ADVANCE: pc:=nil;
- ACT_CHAIN: pc:='Chain';
- ACT_RW: pc:='Database';
- ACT_MESSAGE: pc:='MessageBox';
- else
- pc:=nil;
- end;
- if pc<>nil then
- begin
- actm :=GetLinkByName(pc);
- action:=actm.Create;
- end
- else
- begin
- action:=nil;
- end;
-
- p^:=#0;
- case actionType of
- ACT_CONTACT: begin
- action.Load(section,0);
- end;
-
- ACT_SERVICE: begin
- action.Load(section,100);
- end;
-
- ACT_PROGRAM: begin
- action.Load(section,100);
- end;
-
- ACT_TEXT: begin
- StrCopy(p,opt_flags); flags2:=DBReadDWord(0,DBBranch,section,0);
- p^:=#0;
- if ((flags2 and ACF_OLD_CLIPBRD)=0) then
- begin
- if ((flags2 and ACF_OLD_FILE)=0) or ((flags2 and (ACF_OLD_FWRITE or ACF_OLD_FAPPEND)<>0)) then
- begin
- actm :=GetLinkByName('Text');
- action:=actm.Create;
-
- action.Load(section,100);
-
- CheckActionList(Macro,num);
- Macro^.ActionList^[num]:=action;
- inc(num);
- end;
- end;
-
- actm :=GetLinkByName('In/Out');
- action:=actm.Create;
-
- action.Load(section,100);
- end;
-
- ACT_ADVANCE: begin
- StrCopy(p,'condition' ); cond:=DBReadByte(0,DBBranch,section);
- StrCopy(p,'action'); act :=DBReadByte(0,DBBranch,section);
- p^:=#0;
- // get code of my list
- code:=0;
- if (cond and $0F)=0 then
- begin
- if act<>0 then code:=4; // action and jump
- if (act and $F0)=0 then code:=6; // no action
- if (act and $0F)=0 then code:=5; // no jump
- end
- else // with condition
- begin
- if act<>0 then code:=1; // action and jump
- if (act and $F0)=0 then code:=2; // no action
- if (act and $0F)=0 then code:=3; // no jump
- end;
- case code of
- 1: begin // conditional action and jump
- actm :=GetLinkByName('Jump'); // reversed condition jump to tmplabel
- action:=actm.Create;
- action.Load(section,102+i);
- CheckActionList(Macro,num);
- Macro^.ActionList^[num]:=action;
- inc(num);
-
- actm :=GetLinkByName('Text'); // action
- action:=actm.Create;
- action.Load(section,101);
- CheckActionList(Macro,num);
- Macro^.ActionList^[num]:=action;
- inc(num);
-
- actm :=GetLinkByName('Jump'); // jump to label (no condition)
- action:=actm.Create;
- action.Load(section,101);
- CheckActionList(Macro,num);
- Macro^.ActionList^[num]:=action;
- inc(num);
-
- actm :=GetLinkByName('Notes'); // tmplabel
- action:=actm.Create;
- mFreeMem(action.ActionDescr); // created by constructor
- buf[0]:='$'; buf[1]:='$';
- IntToStr(PWideChar(@buf[2]),i);
- StrDupW(action.ActionDescr,buf);
- end;
- 2,6: begin // conditional and unconditional jump
- actm :=GetLinkByName('Jump');
- action:=actm.Create;
-
- action.Load(section,100);
- end;
- 3: begin // conditional action
- actm :=GetLinkByName('Jump');
- action:=actm.Create;
- action.Load(section,101+num);
- CheckActionList(Macro,num);
- Macro^.ActionList^[num]:=action;
- inc(num);
-
- actm :=GetLinkByName('Text');
- action:=actm.Create;
- action.Load(section,101);
- CheckActionList(Macro,num);
- Macro^.ActionList^[num]:=action;
- inc(num);
-
- actm :=GetLinkByName('Notes');
- action:=actm.Create;
- mFreeMem(action.ActionDescr); // created by constructor
- buf[0]:='$'; buf[1]:='$';
- StrDupW(action.ActionDescr,IntToStr(PWideChar(@buf[2]),num));
- end;
- 4: begin // action + unconditional jump
- actm :=GetLinkByName('Text');
- action:=actm.Create;
- action.Load(section,101);
- CheckActionList(Macro,num);
- Macro^.ActionList^[num]:=action;
- inc(num);
-
- actm :=GetLinkByName('Jump');
- action:=actm.Create;
-
- action.Load(section,100);
- end;
- 5: begin // direct text action
- actm :=GetLinkByName('Text');
- action:=actm.Create;
-
- action.Load(section,101);
- end;
- end;
- end;
-
- ACT_CHAIN: begin
- action.Load(section,100);
- end;
-
- ACT_RW: begin
- action.Load(section,100);
- end;
-
- ACT_MESSAGE: begin
- action.Load(section,0);
-
- StrCopy(p,'flags2'); flags2:=DBReadDWord(0,DBBranch,section,0);
- action.flags:=(action.flags and not ACF_MASK) or flags2;
- end;
-
- end;
-
- if action<>nil then
- begin
- CheckActionList(Macro,num);
- Macro^.ActionList^[num]:=action;
- inc(num);
- end;
- end;
- end;
-end;
-
-//----- V3 settings processing -----
-
-function LoadActions(Macro:pMacroRecord;section:pAnsiChar):integer; stdcall;
-var
- p,p1:PAnsiChar;
- actm:pActModule;
- action:tBaseAction;
- tmp:pActionList;
- uid:dword;
- i,num:integer;
-begin
- result:=0;
- p:=StrEnd(section);
- StrCopy(p,opt_numacts); Macro^.ActionCount:=DBReadWord(0,DBBranch,section);
- if Macro^.ActionCount>0 then
- begin
- GetMem(Macro^.ActionList,SizeOf(tBaseAction)*Macro^.ActionCount);
- p1:=StrCopyE(p,opt_actions); // "Group#/Action"
-
- num:=0;
- for i:=0 to Macro^.ActionCount-1 do
- begin
- p:=StrEnd(IntToStr(p1,i));
- p^:='/'; inc(p); // "Group#/Action#/"
-
- // get uid
- StrCopy(p,opt_uid); uid:=DBReadDWord(0,DBBranch,section,0);
- if uid<>0 then
- begin
- p^:=#0;
- // call proper constructor
- actm:=GetLink(uid);
- if actm=nil then
- continue;
-
- action:=actm.Create;
- // call proper loader
- action.Load(section,0);
-
- Macro^.ActionList^[num]:=action;
- inc(num);
- end;
- end;
- if Macro^.ActionCount<>num then
- begin
- GetMem(tmp,SizeOf(tBaseAction)*num);
- move(Macro^.ActionList^,tmp^,SizeOf(tBaseAction)*num);
- Macro^.ActionCount:=num;
- FreeMem(Macro^.ActionList);
- Macro^.ActionList:=tmp;
- end;
- end;
-end;
-
-procedure LoadMacros;
-var
- Macro:pMacroRecord;
- p,p1:PAnsiChar;
- section:array [0..127] of AnsiChar;
- tmp:pWideChar;
- i:cardinal;
- NumMacros:cardinal;
- v2:bool;
-begin
- NumMacros:=DBReadWord(0,DBBranch,opt_nummacro,0);
- v2:=false;
-
- // Check if old actman version used
- if NumMacros>0 then
- begin
- // V2 counts actions from 1, not 0
- v2:=DBReadDWord(0,DBBranch,'Group0/Action0/flags',$FFFFFFFF)=$FFFFFFFF;
-
- if v2 then
- begin
- if MessageBoxW(0,TranslateW(OldVersion),'Actman',MB_OKCANCEL or MB_ICONWARNING)<>IDOK then
- begin
- MacroList:=tMacroList.Create(0);
- exit;
- end;
- end;
- end;
-
- // Allocate macro list
- MacroList:=tMacroList.Create(NumMacros);
-
- // read macro list settings
- if NumMacros>0 then //?? really, not so necessary
- begin
- Macro:=MacroList[0];
- i:=0;
- p1:=StrCopyE(section,opt_group);
- while i<NumMacros do
- begin
- p:=StrEnd(IntToStr(p1,i));
- p^:='/'; inc(p);
-
- StrCopy(p,opt_flags);
- with Macro^ do
- begin
- flags:=DBReadDWord(0,DBBranch,section,0) and ACF_TOSAVE;
- if (flags and ACF_ASSIGNED)<>0 then //?? not needed in normal cases
- begin
- StrCopy(p,opt_id ); id :=DBReadDWord (0,DBBranch,section);
- StrCopy(p,opt_descr); tmp:=DBReadUnicode(0,DBBranch,section,NoDescription);
- StrCopyW(descr,tmp,MacroNameLen-1);
- mFreeMem(tmp);
- p^:=#0;
- if v2 then
- LoadActionsV2(Macro,section)
- else
- LoadActions(Macro,section);
- end;
- end;
- inc(Macro);
- inc(i);
- end;
-
- if v2 then
- begin
- DBDeleteSetting(0,DBBranch,opt_numacts);
- SaveMacros;
- MessageBoxW(0,TranslateW(Notes),TranslateW(ConvResult),MB_ICONINFORMATION);
- end;
- end;
-
-end;
diff --git a/plugins/Actman30/i_services.inc b/plugins/Actman30/i_services.inc deleted file mode 100644 index 2954fa4b15..0000000000 --- a/plugins/Actman30/i_services.inc +++ /dev/null @@ -1,317 +0,0 @@ -{Basic ActMan services}
-
-function ActSelect(wParam:WPARAM;lParam:LPARAM):int_ptr;cdecl;
-begin
- if odd(wParam) then
- result:=int_ptr(MacroList.GetMacro(lParam))
- else
- result:=int_ptr(MacroList.GetMacro(pWideChar(lParam)));
-
- if result<>0 then
- with pMacroRecord(result)^ do
- begin
- if (wParam and 4)<>0 then
- result:=ord((flags and ACF_SELECTED)<>0)
- else
- begin
- if (wParam and 2)<>0 then
- flags:=flags and not ACF_SELECTED
- else
- flags:=flags or ACF_SELECTED;
- end;
- end;
-end;
-
-function ActFreeList(wParam:WPARAM;lParam:LPARAM):int_ptr;cdecl;
-begin
- result:=0;
- mFreeMem(PAnsiChar(lParam));
-end;
-
-function ActGetList(wParam:WPARAM;lParam:LPARAM):int_ptr;cdecl;
-var
- pc:^tChain;
- p:pMacroRecord;
- i,cnt:integer;
-begin
- p:=MacroList[0];
- cnt:=0;
- for i:=0 to MacroList.Count-1 do
- begin
- if (p^.flags and (ACF_ASSIGNED or ACF_VOLATILE))=ACF_ASSIGNED then inc(cnt);
- inc(p);
- end;
- result:=cnt;
- if lParam=0 then exit;
- if cnt>0 then
- begin
- mGetMem(pc,cnt*SizeOf(tChain)+4);
- puint_ptr(lParam)^:=uint_ptr(pc);
- pdword(pc)^:=SizeOf(tChain);
- inc(PByte(pc),4);
-
- p:=MacroList[0];
- for i:=0 to MacroList.Count-1 do
- begin
- if (p^.flags and (ACF_ASSIGNED or ACF_VOLATILE))=ACF_ASSIGNED then
- begin
- pc^.descr:=p^.descr;
- pc^.id :=p^.id;
- pc^.flags:=p^.flags;
- inc(pc);
- end;
- inc(p);
- end;
- end
- else
- puint_ptr(lParam)^:=0;
-end;
-
-//====================== Execute code =======================
-
-{$IFDEF DEBUG}
-procedure ActmanMacroDebug(txt:pWideChar);
-begin
- OutputDebugStringW(txt);
-end;
-{$ENDIF}
-
-procedure DoAction(Macro:pMacroRecord;var WorkData:tWorkData);
-var
- res:LRESULT;
- i,cnt:integer;
-{$IFDEF DEBUG}
- buf:array [0..1023] of WideChar;
- buf1,buf2:array [0..31] of WideChar;
- p:pWideChar;
-{$ENDIF}
-begin
- cnt:=Macro^.ActionCount;
- if cnt<>0 then
- begin
-//!! act:=CloneActions(action);
- i:=0;
- WorkData.ActionList :=Macro^.ActionList;
- WorkData.ActionCount:=Macro^.ActionCount;
- while i<cnt do
- begin
- if (Macro^.ActionList^[i].flags and ACF_DISABLED)=0 then
- begin
-{$IFDEF DEBUG}
- if WorkData.ResultType=rtWide then
- p:=pWideChar(WorkData.LastResult)
- else
- p:=IntToStr(buf2,WorkData.LastResult);
- StrCopyEW(
- StrCopyEW(
- StrCopyEW(
- StrCopyEW(
- StrCopyEW(
- StrCopyEW(
- StrCopyEW(
- StrCopyEW(buf,'ActMan: Macro "'),
- Macro^.descr
- ),'", Action #'
- ),IntToStr(buf1,i)
- ),' "'
- ),Macro^.ActionList^[i].ActionDescr
- ),'", LR: '
- ),p{IIF(WorkData.ResultType=rtWide,
- pWideChar(WorkData.LastResult),
- IntToStr(buf1,WorkData.LastResult))}
- );
- ActmanMacroDebug(buf);
-{$ENDIF}
- res:=Macro^.ActionList^[i].DoAction(WorkData);
- if res<0 then break
- else if res>0 then // res = next action number+1
- begin
- i:=res-1;
- continue;
- end;
- end;
- inc(i);
- end;
-//!! FreeActionsContinued(act_org);
- end;
-end;
-
-type
- pActStartData = ^tActStartData;
- tActStartData = record
- macro :pMacroRecord;
- event :THANDLE;
- WorkData:tWorkData;
- flags :dword;
- end;
-
-procedure ThDoAction(arg:pActStartData); cdecl;
-var
- i:integer;
-begin
- if (arg^.flags and ACTP_NOTIFY)<>0 then
- begin
- NotifyEventHooks(hevaction,arg^.macro.id,0); // started
- arg^.macro.flags:=arg^.macro.flags or ACF_USEDNOW;
- end;
-
- DoAction(arg^.macro,arg^.WorkData);
-
- if (arg^.flags and ACTP_NOTIFY)<>0 then
- begin
- arg^.macro.flags:=arg^.macro.flags and not ACF_USEDNOW;
- NotifyEventHooks(hevaction,arg^.macro.id,1); // finished
- end;
-
- if arg^.event<>0 then // service, waiting
- SetEvent(arg^.event)
- else if (arg^.flags and ACTP_SAMETHREAD)=0 then // no waiting
- begin
- ClearResult(arg^.WorkData); // free last result memory if needs
- // Free Storage
- for i:=0 to 9 do
- ClearResult(arg^.WorkData,i);
- mFreeMem(arg); // free ActStartData (no time to free after)
- end;
-end;
-
-function ActionStarter(macro:pMacroRecord;wd:pWorkData;flags:dword):LPARAM;
-var
- tmp:pActStartData;
- i:integer;
-begin
- mGetMem (tmp ,SizeOf(tActStartData));
- FillChar(tmp^,SizeOf(tActStartData),0);
-
- if wd<>nil then
- begin
- tmp^.WorkData.ResultType:=wd^.ResultType;
- case wd^.ResultType of
- rtInt : tmp^.WorkData.LastResult:=wd^.LastResult;
- rtWide: StrDupW(pWideChar(tmp^.WorkData.LastResult),pWideChar(wd^.LastResult));
- rtAnsi: begin
- AnsiToWide(pAnsiChar(wd^.LastResult),pWideChar(tmp^.WorkData.LastResult));
- tmp^.WorkData.ResultType:=rtWide;
- end;
- rtUTF8: begin
- UTF8ToWide(pAnsiChar(wd^.LastResult),pWideChar(tmp^.WorkData.LastResult));
- tmp^.WorkData.ResultType:=rtWide;
- end;
- end;
- tmp^.WorkData.Parameter:=wd^.Parameter;
- end
- else
- tmp^.WorkData.ResultType:=rtInt;
-
- tmp^.macro :=macro;
- tmp^.flags :=flags;
-
- if (flags and ACTP_SAMETHREAD)<>0 then // with waiting, macro or service
- begin
- tmp^.event:=0;
- ThDoAction(tmp);
- // keep text result (for macro from macro)
- if (flags and ACTP_KEEPRESULT)<>0 then
- begin
- wd^.ResultType:=tmp^.WorkData.ResultType;
- if wd^.ResultType=rtInt then
- wd^.LastResult:=tmp^.WorkData.LastResult
- else
- StrDupW(pWideChar(wd^.LastResult),pWideChar(tmp^.WorkData.LastResult));
- result:=0;
- end
- else if tmp^.WorkData.ResultType=rtInt then
- result:=tmp^.WorkData.LastResult
- // result no needs or macro from service
- else
- result:=StrToInt(pWideChar(tmp^.WorkData.LastResult));
- end
-
- else if (flags and ACTP_WAIT)<>0 then // with waiting, service
- begin
- tmp^.event:=CreateEvent(nil,FALSE,FALSE,nil);
- {CloseHandle}(mir_forkthread(@ThDoAction,tmp));
- //!!!!!!!!! movetmp structure (event handle) to array, not stack?
- WaitForSingleObjectEx(tmp^.event,INFINITE,true);
- CloseHandle(tmp^.event);
- if tmp^.WorkData.ResultType=rtWide then
- result:=StrToInt(pWideChar(tmp^.WorkData.LastResult))
- else
- result:=tmp^.WorkData.LastResult;
- end
-
- else // no waiting, service or macro
- begin
- tmp^.event:=0;
- {CloseHandle}(mir_forkthread(@ThDoAction,tmp));
- result:=0;
- exit;
- end;
-
- ClearResult(tmp^.WorkData); // free last result memory if needs
- // Free Storage
- for i:=0 to 9 do
- ClearResult(tmp^.WorkData,i);
- mFreeMem(tmp); // free ActStartData (no time to free after)
-end;
-
-//----- execute services -----
-
-function ActRun(wParam:WPARAM;lParam:LPARAM):int_ptr;cdecl;
-var
- p:pMacroRecord;
- w:tWorkData;
-begin
- result:=-1;
- p:=MacroList.GetMacro(wParam);
- if p<>nil then
- begin
- FillChar(w,SizeOf(w),0);
- w.ResultType:=rtInt;
- w.Parameter:=lParam;
- result:=ActionStarter(p,@w,ACTP_SAMETHREAD);
- end;
-end;
-
-function ActRunGroup(wParam:WPARAM;lParam:LPARAM):int_ptr;cdecl;
-var
- p:pMacroRecord;
- w:tWorkData;
-begin
- result:=-1;
- p:=MacroList.GetMacro(pWideChar(wParam));
- if p<>nil then
- begin
- FillChar(w,SizeOf(w),0);
- w.ResultType:=rtInt;
- w.Parameter:=lParam;
- result:=ActionStarter(p,@w,ACTP_SAMETHREAD);
- end;
-end;
-
-function ActRunParam(wParam:WPARAM;lParam:LPARAM):int_ptr;cdecl;
-var
- p:pMacroRecord;
- w:tWorkData;
-begin
- result:=-1;
- if (pAct_Param(lParam)^.flags and ACTP_BYNAME)=0 then
- p:=MacroList.GetMacro(pAct_Param(lParam)^.Id)
- else
- p:=MacroList.GetMacro(pWideChar(pAct_Param(lParam)^.Id));
-
- if p<>nil then
- begin
- FillChar(w,SizeOf(w),0);
- w.Parameter :=pAct_Param(lParam)^.wParam;
- w.LastResult:=pAct_Param(lParam)^.lParam;
- w.ResultType:=pAct_Param(lParam)^.lPType;
- result:=ActionStarter(p,@w,pAct_Param(lParam)^.flags);
- if (pAct_Param(lParam)^.flags and (ACTP_KEEPRESULT or ACTP_SAMETHREAD))=
- (ACTP_KEEPRESULT or ACTP_SAMETHREAD) then
- begin
- pAct_Param(lParam)^.lParam:=w.LastResult;
- pAct_Param(lParam)^.lPType:=w.ResultType;
- end;
- end;
-end;
diff --git a/plugins/Actman30/ico/advance.ico b/plugins/Actman30/ico/advance.ico Binary files differdeleted file mode 100644 index fa6c604542..0000000000 --- a/plugins/Actman30/ico/advance.ico +++ /dev/null diff --git a/plugins/Actman30/ico/apply.ico b/plugins/Actman30/ico/apply.ico Binary files differdeleted file mode 100644 index 80c3802c09..0000000000 --- a/plugins/Actman30/ico/apply.ico +++ /dev/null diff --git a/plugins/Actman30/ico/chain.ico b/plugins/Actman30/ico/chain.ico Binary files differdeleted file mode 100644 index 3a98b8ac30..0000000000 --- a/plugins/Actman30/ico/chain.ico +++ /dev/null diff --git a/plugins/Actman30/ico/contact.ico b/plugins/Actman30/ico/contact.ico Binary files differdeleted file mode 100644 index 8174fa221a..0000000000 --- a/plugins/Actman30/ico/contact.ico +++ /dev/null diff --git a/plugins/Actman30/ico/delete.ico b/plugins/Actman30/ico/delete.ico Binary files differdeleted file mode 100644 index eea851da19..0000000000 --- a/plugins/Actman30/ico/delete.ico +++ /dev/null diff --git a/plugins/Actman30/ico/down.ico b/plugins/Actman30/ico/down.ico Binary files differdeleted file mode 100644 index d4fdb83bbf..0000000000 --- a/plugins/Actman30/ico/down.ico +++ /dev/null diff --git a/plugins/Actman30/ico/export.ico b/plugins/Actman30/ico/export.ico Binary files differdeleted file mode 100644 index ddddb59074..0000000000 --- a/plugins/Actman30/ico/export.ico +++ /dev/null diff --git a/plugins/Actman30/ico/format.ico b/plugins/Actman30/ico/format.ico Binary files differdeleted file mode 100644 index ddddb59074..0000000000 --- a/plugins/Actman30/ico/format.ico +++ /dev/null diff --git a/plugins/Actman30/ico/import.ico b/plugins/Actman30/ico/import.ico Binary files differdeleted file mode 100644 index 481da4dbaf..0000000000 --- a/plugins/Actman30/ico/import.ico +++ /dev/null diff --git a/plugins/Actman30/ico/insert.ico b/plugins/Actman30/ico/insert.ico Binary files differdeleted file mode 100644 index 481da4dbaf..0000000000 --- a/plugins/Actman30/ico/insert.ico +++ /dev/null diff --git a/plugins/Actman30/ico/message.ico b/plugins/Actman30/ico/message.ico Binary files differdeleted file mode 100644 index fa6c604542..0000000000 --- a/plugins/Actman30/ico/message.ico +++ /dev/null diff --git a/plugins/Actman30/ico/new.ico b/plugins/Actman30/ico/new.ico Binary files differdeleted file mode 100644 index 73937210e0..0000000000 --- a/plugins/Actman30/ico/new.ico +++ /dev/null diff --git a/plugins/Actman30/ico/program.ico b/plugins/Actman30/ico/program.ico Binary files differdeleted file mode 100644 index 30c7df1875..0000000000 --- a/plugins/Actman30/ico/program.ico +++ /dev/null diff --git a/plugins/Actman30/ico/reload.ico b/plugins/Actman30/ico/reload.ico Binary files differdeleted file mode 100644 index dc070c5083..0000000000 --- a/plugins/Actman30/ico/reload.ico +++ /dev/null diff --git a/plugins/Actman30/ico/rw.ico b/plugins/Actman30/ico/rw.ico Binary files differdeleted file mode 100644 index d5927ebb08..0000000000 --- a/plugins/Actman30/ico/rw.ico +++ /dev/null diff --git a/plugins/Actman30/ico/service.ico b/plugins/Actman30/ico/service.ico Binary files differdeleted file mode 100644 index ddddb59074..0000000000 --- a/plugins/Actman30/ico/service.ico +++ /dev/null diff --git a/plugins/Actman30/ico/test.ico b/plugins/Actman30/ico/test.ico Binary files differdeleted file mode 100644 index 345530ba76..0000000000 --- a/plugins/Actman30/ico/test.ico +++ /dev/null diff --git a/plugins/Actman30/ico/up.ico b/plugins/Actman30/ico/up.ico Binary files differdeleted file mode 100644 index 56fde31eda..0000000000 --- a/plugins/Actman30/ico/up.ico +++ /dev/null diff --git a/plugins/Actman30/options.rc b/plugins/Actman30/options.rc deleted file mode 100644 index 98be11b605..0000000000 --- a/plugins/Actman30/options.rc +++ /dev/null @@ -1,70 +0,0 @@ -#include "i_const.inc"
-
-LANGUAGE 0,0
-
-IDD_ACTION DIALOGEX 0, 0, 304, 226, 0
-STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE
-EXSTYLE WS_EX_CONTROLPARENT
-FONT 8, "MS Shell Dlg", 0, 0
-{
- CONTROL "New" ,IDC_GROUP_NEW ,"MButtonClass",WS_TABSTOP,114, 1,16,16,$18000000 | WS_GROUP
- CONTROL "Up" ,IDC_GROUP_UP ,"MButtonClass",WS_TABSTOP,114, 18,16,16,$18000000
- CONTROL "Down" ,IDC_GROUP_DOWN ,"MButtonClass",WS_TABSTOP,114, 34,16,16,$18000000
- CONTROL "Delete",IDC_GROUP_DELETE,"MButtonClass",WS_TABSTOP,114, 68,16,16,$18000000
- CONTROL "Test" ,IDC_GROUP_TEST ,"MButtonClass",WS_TABSTOP,114, 85,16,16,$18000000
-// CONTROL "Export",IDC_GROUP_EXPORT,"MButtonClass",WS_TABSTOP,114,102,16,16,$18000000
-// CONTROL "Import",IDC_GROUP_IMPORT,"MButtonClass",WS_TABSTOP,114,119,16,16,$18000000
-
- CONTROL "", IDC_MACRO_LIST, "SysListView32",
- WS_BORDER | WS_TABSTOP |
- LVS_NOCOLUMNHEADER | LVS_SHOWSELALWAYS | LVS_REPORT | LVS_EDITLABELS,// | LVS_SINGLESEL,
- 0, 2, 110, 132, WS_EX_CONTROLPARENT
-
- CONTROL "", IDC_ACTION_LIST, "SysListView32",
- WS_BORDER | WS_TABSTOP |
- LVS_NOCOLUMNHEADER | LVS_SHOWSELALWAYS| LVS_REPORT | LVS_EDITLABELS,// | LVS_SINGLESEL
- 0, 138, 110, 86, WS_EX_CONTROLPARENT
-
- CONTROL "Help" ,IDC_ACTION_HELP ,"MButtonClass",WS_TABSTOP,114,138,16,16,$18000000 | WS_GROUP
- CONTROL "New" ,IDC_ACTION_NEW ,"MButtonClass",WS_TABSTOP,114,156,16,16,$18000000
- CONTROL "Up" ,IDC_ACTION_UP ,"MButtonClass",WS_TABSTOP,114,174,16,16,$18000000
- CONTROL "Down" ,IDC_ACTION_DOWN ,"MButtonClass",WS_TABSTOP,114,190,16,16,$18000000
- CONTROL "Delete",IDC_ACTION_DELETE,"MButtonClass",WS_TABSTOP,114,208,16,16,$18000000
-
-// PUSHBUTTON "Reset", IDC_RESET, 264, 2, 40, 12
- GROUPBOX "" , -1, 132, 0, 172, 226
-
- RTEXT "Action",IDC_STAT_ACTION, 135, 6, 63, 12, SS_CENTERIMAGE
- CONTROL "", IDC_ACTION_TYPE, "ComboBoxEx32",
- WS_TABSTOP | WS_VSCROLL | CBS_AUTOHSCROLL | CBS_DROPDOWNLIST, 200, 6, 101, 96
-}
-/*
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 0,3,0,1
- PRODUCTVERSION 0,3,0,1
- FILEFLAGSMASK $3F
- FILEOS 4
- FILETYPE 2
- FILESUBTYPE 0
-BEGIN
- BLOCK "StringFileInfo"
- BEGIN
- BLOCK "000004b0"
- BEGIN
- VALUE "CompanyName",""
- VALUE "Comments", "Plugin for managing different Miranda actions "0
- VALUE "FileDescription", "Action manager for Miranda NG"0
- VALUE "FileVersion", "0, 3, 0, 1 "0
- VALUE "InternalName", "ActManager"0
- VALUE "OriginalFilename", "actman.dll"0
- VALUE "ProductName", "Action Manager Dynamic Link Library (DLL)"0
- VALUE "ProductVersion", "0, 3, 0, 1 "0
- VALUE "SpecialBuild", "18.11.2012 "0
- END
- END
- BLOCK "VarFileInfo"
- BEGIN
- VALUE "Translation",0,1200
- END
-END
-*/
\ No newline at end of file diff --git a/plugins/Actman30/options.res b/plugins/Actman30/options.res Binary files differdeleted file mode 100644 index 951c81f7f6..0000000000 --- a/plugins/Actman30/options.res +++ /dev/null diff --git a/plugins/Actman30/ua/action.ico b/plugins/Actman30/ua/action.ico Binary files differdeleted file mode 100644 index 9e4c60d9d3..0000000000 --- a/plugins/Actman30/ua/action.ico +++ /dev/null diff --git a/plugins/Actman30/ua/i_uconst.inc b/plugins/Actman30/ua/i_uconst.inc deleted file mode 100644 index cffbfdcc76..0000000000 --- a/plugins/Actman30/ua/i_uconst.inc +++ /dev/null @@ -1,36 +0,0 @@ -{resource constants}
-const
- IDD_UA = 1031;
-
- IDC_UA_ACTIONLIST = 1025;
- IDC_UA_PLACELIST = 1026;
-
- // menu settings
- IDC_UA_POPUPT = 1030;
- IDC_UA_POPUPV = 1031;
-
- IDC_UA_VARNAMEST = 1032;
- IDC_UA_VARNAMESV = 1033;
-
- 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;
-
- // common
- IDC_UA_COMMON = 2000;
- IDC_UA_TWOSTATE = 2001;
- IDC_UA_SAVSTATE = 2002;
-
- IDC_UA_GLOBAL = 2003;
-
- IDI_ACTION = 101;
diff --git a/plugins/Actman30/ua/ua.pas b/plugins/Actman30/ua/ua.pas deleted file mode 100644 index e6e33aeaad..0000000000 --- a/plugins/Actman30/ua/ua.pas +++ /dev/null @@ -1,119 +0,0 @@ -unit ua;
-
-interface
-
-implementation
-
-uses
- windows, commctrl, messages,
- mirutils, common, dbsettings, io, m_api, wrapper, editwrapper,
- global;
-
-{$R ua.res}
-
-{$include i_uconst.inc}
-{$include i_uavars.inc}
-
-// in - Action ID, out - action (group) number
-function GetUABranch(setting:pAnsiChar;id:cardinal):pAnsiChar;
-var
- i:integer;
- p,p1:pAnsiChar;
-begin
- result:=nil;
- p1:=StrCopyE(setting,opt_groups);
- for i:=0 to CallService(MS_ACT_GETLIST,0,0)-1 do
- begin
- p:=StrEnd(IntToStr(p1,i));
- p^:='/'; inc(p);
- StrCopy(p,opt_id);
- if DBReadDWord(0,DBBranch,setting)=id then
- begin
- p^:=#0;
- result:=p;
- break;
- end;
- end;
-end;
-
-var
- amLink:tActionLink;
-
-{$include i_uaplaces.inc}
-{$include i_options.inc}
-{$include i_opt_dlg.inc}
-{$include i_ua.inc}
-{$include i_inoutxm.inc}
-
-// ------------ 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);
-
- CreateServiceFunction(SERVICE_WITH_LPARAM_NAME,@ServiceCallWithLParam);
- CreateServiceFunction(TTB_SERVICE_NAME ,@TTBServiceCall);
- CheckPlacesAbility;
-
- CreateUActionList;
-
- HookEvent(ME_TTB_MODULELOADED ,@OnTTBLoaded);
- HookEvent(ME_MSG_TOOLBARLOADED,@OnTabBBLoaded);
- HookEvent(ME_MSG_BUTTONPRESSED,@OnTabButtonPressed);
- HookEvent(ME_ACT_CHANGED ,@ActListChange);
-
- HookEvent(ME_CLIST_PREBUILDMAINMENU , PreBuildMainMenu);
- HookEvent(ME_CLIST_PREBUILDCONTACTMENU, PreBuildContactMenu);
- HookEvent(ME_CLIST_PREBUILDTRAYMENU , PreBuildTrayMenu);
-
- HookEvent(ME_ACT_INOUT,@ActInOut);
-end;
-
-procedure DeInit;
-var
- i:integer;
-begin
- if Length(UActionList)>0 then
- begin
- for i:=HIGH(UActionList) downto 0 do
- begin
- DeleteUAction(i,false);
- end;
- SetLength(UActionList,0);
- end;
- SetLength(arMenuRec,0);
-end;
-
-function AddOptionPage(var tmpl:pAnsiChar;var proc:pointer;var name:PAnsiChar):integer;
-begin
- result:=0;
- tmpl:=PAnsiChar(IDD_UA);
- proc:=@DlgProcOpt;
- name:='Use Actions';
-end;
-
-procedure InitLink;
-begin
- amLink.Next :=ActionLink;
- amLink.Init :=@Init;
- amLink.DeInit :=@DeInit;
- amLink.AddOption:=@AddOptionPage;
- ActionLink :=@amLink;
-end;
-
-initialization
- InitLink;
-end.
diff --git a/plugins/Actman30/ua/ua.rc b/plugins/Actman30/ua/ua.rc deleted file mode 100644 index 6e0fdde413..0000000000 --- a/plugins/Actman30/ua/ua.rc +++ /dev/null @@ -1,54 +0,0 @@ -#include "i_uconst.inc"
-
-LANGUAGE 0,0
-
-IDD_UA DIALOGEX 0, 0, 304, 226, 0
-STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE
-EXSTYLE WS_EX_CONTROLPARENT
-FONT 8, "MS Shell Dlg", 0, 0
-{
- 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,
- 0, 13, 134, 212, WS_EX_CONTROLPARENT
-
- 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, 13, 160, 74, WS_EX_CONTROLPARENT
-
- 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,164,14, BS_LEFTTEXT | BS_RIGHT
-
- // Buttons settings block
- 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,164,12, SS_CENTERIMAGE
- EDITTEXT IDC_UA_TTPRESSEDV, 138,185,164,12, ES_AUTOHSCROLL
-
- PUSHBUTTON ">" , IDC_UA_BLOCK, 292,146, 10,52
- GROUPBOX "Main settings", IDC_UA_MENU , 138,142,152,58
-
- // 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, 140,174,146,12, SS_CENTERIMAGE
- EDITTEXT IDC_UA_VARNAMESV, 141,186,146,12, ES_AUTOHSCROLL
-
- // 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
-
-}
-
-IDI_ACTION ICON "action.ico"
diff --git a/plugins/Actman30/ua/ua.res b/plugins/Actman30/ua/ua.res Binary files differdeleted file mode 100644 index 25b0f7f2ca..0000000000 --- a/plugins/Actman30/ua/ua.res +++ /dev/null |