summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/delphi/m_helpers.inc9
-rw-r--r--plugins/Actman/ua/i_uaplaces.inc11
-rw-r--r--plugins/ExternalAPI/delphi/m_msg_buttonsbar.inc51
3 files changed, 18 insertions, 53 deletions
diff --git a/include/delphi/m_helpers.inc b/include/delphi/m_helpers.inc
index 88feb436ff..3e9d70b32f 100644
--- a/include/delphi/m_helpers.inc
+++ b/include/delphi/m_helpers.inc
@@ -50,6 +50,8 @@ function Menu_AddStatusMenuItem (mi:PMO_MenuItem):HGENMENU;
function Menu_AddProtoMenuItem (mi:PMO_MenuItem):HGENMENU;
function Menu_AddTrayMenuItem (mi:PMO_MenuItem):HGENMENU;
+procedure Srmm_AddButton(bbdi:pBBButton);
+
procedure SET_UID(pmi:PMO_MenuItem; strguid:PAnsiChar);
function Options_AddPage (wParam:WPARAM; odp:POPTIONSDIALOGPAGE):int_ptr;
@@ -78,6 +80,9 @@ function Crypto_GetProvider(pszName:PAnsiChar):PCRYPTO_PROVIDER;
var
hLangpack:int = 0;
+function _Srmm_AddButton(bbdi:pBBButton;_hLang:int) : integer; stdcall;
+ external AppDll name 'Srmm_AddButton';
+
function _AddMainMenuItem(mi:PMO_MenuItem) : HGENMENU; stdcall;
external AppDll name 'Menu_AddMainMenuItem';
@@ -451,6 +456,10 @@ begin
SendMessage(hwnd, ITCM_ADDITEM, WPARAM(@mit), 0);
end;
+procedure Srmm_AddButton(bbdi:pBBButton);
+begin
+ _Srmm_AddButton(bbdi,hLangpack);
+end;
function Crypto_RegisterEngine(pProvider:PCRYPTO_PROVIDER):THANDLE;
begin
diff --git a/plugins/Actman/ua/i_uaplaces.inc b/plugins/Actman/ua/i_uaplaces.inc
index c5ac67c4db..df8a23fc14 100644
--- a/plugins/Actman/ua/i_uaplaces.inc
+++ b/plugins/Actman/ua/i_uaplaces.inc
@@ -45,7 +45,6 @@ var
pc:pWideChar;
begin
FillChar(tabb,SizeOf(tabb),0);
- tabb.cbSize :=SizeOf(tabb);
tabb.dwButtonID :=ActionItem.dwActID;
tabb.pszModuleName:=MODULE_NAME;
@@ -64,7 +63,7 @@ begin
end;
if pc=nil then pc:=ActionItem.szActDescr;
tabb.szTooltip:=pc;
- CallService(MS_BB_SETBUTTONSTATE,hContact,TLPARAM(@tabb));
+ Srmm_SetButtonState(hContact,@tabb);
end;
function IsLocalItem(const UAItem:tMyActionItem):boolean;
@@ -731,7 +730,6 @@ begin
begin
FillChar(tabb,SizeOf(tabb),0);
// register Tab ButtonBar button
- tabb.cbSize :=SizeOf(tabb);
tabb.dwButtonID :=ActionItem.dwActID;
tabb.pszModuleName:=MODULE_NAME;
tabb.dwDefPos :=(TABTOOLBAR_INITPOS+ActionItem.wSortIndex*10) and $7FFF;
@@ -747,8 +745,8 @@ begin
else
tabb.szTooltip:=ActionItem.szActDescr;
- if CallService(MS_BB_ADDBUTTON,0,LPARAM(@tabb))=0 then
- ActionItem.flags:=ActionItem.flags or UAF_TBREGGED;
+ Srmm_AddButton(@tabb);
+ ActionItem.flags:=ActionItem.flags or UAF_TBREGGED;
end;
end;
@@ -759,10 +757,9 @@ begin
if (ActionItem.flags and UAF_TBREGGED)<>0 then
begin
FillChar(tabb,SizeOf(tabb),0);
- tabb.cbSize :=SizeOf(tabb);
tabb.dwButtonID :=ActionItem.dwActID;
tabb.pszModuleName:=MODULE_NAME;
- CallService(MS_BB_REMOVEBUTTON,0,LPARAM(@tabb));
+ Srmm_RemoveButton(@tabb);
ActionItem.flags:=ActionItem.flags and not UAF_TBREGGED;
end;
end;
diff --git a/plugins/ExternalAPI/delphi/m_msg_buttonsbar.inc b/plugins/ExternalAPI/delphi/m_msg_buttonsbar.inc
index 9caa4dc44a..9ead87cdb1 100644
--- a/plugins/ExternalAPI/delphi/m_msg_buttonsbar.inc
+++ b/plugins/ExternalAPI/delphi/m_msg_buttonsbar.inc
@@ -1,53 +1,12 @@
{$IFNDEF M_MSG_BUTTONSBAR}
{$DEFINE M_MSG_BUTTONSBAR}
-//////////////////////////////////////////////////////////////////////////
-// Services
-//
-//////////////////////////////////////////////////////////////////////////
-// Adding a button
-//
-// wParam = 0
-// lParam = (BBButton *) &description
const
- MS_BB_ADDBUTTON:PAnsiChar = 'TabSRMM/ButtonsBar/AddButton';
-
-//////////////////////////////////////////////////////////////////////////
-// Remove button
-//
-// wParam = 0
-// lParam = (BBButton *) &description, only button ID and ModuleName used
- MS_BB_REMOVEBUTTON:PAnsiChar = 'TabSRMM/ButtonsBar/RemoveButton';
-
-//////////////////////////////////////////////////////////////////////////
-// ModifyButton(global)
-//
-// wParam = 0
-// lParam = (BBButton *) &description
- MS_BB_MODIFYBUTTON:PAnsiChar = 'TabSRMM/ButtonsBar/ModifyButton';
-
-
BBSF_HIDDEN = 1;
BBSF_DISABLED = 2;
BBSF_PUSHED = 4;
BBSF_RELEASED = 8;
-//////////////////////////////////////////////////////////////////////////
-// GetButtonState(local)
-//
-// wParam = hContact
-// lParam = (BBButton *) &description , only ModuleName and ID used
-// Returns BBButton struct with BBSF_ bbbFlags:
- MS_BB_GETBUTTONSTATE:PansiChar = 'TabSRMM/ButtonsBar/GetButtonState';
-
-//////////////////////////////////////////////////////////////////////////
-// SetButtonState (local)
-//
-// wParam = hContact
-// lParam = (BBButton *) &description , ModuleName, ID,hIcon,Tooltip, and BBSF_ bbbFlags are used
- MS_BB_SETBUTTONSTATE:PAnsiChar = 'TabSRMM/ButtonsBar/SetButtonState';
-
-
////////////////////////////////////////////////////////////////
//Events
//
@@ -75,7 +34,6 @@ const
type
pCustomButtonClickData = ^tCustomButtonClickData;
tCustomButtonClickData = record
- cbSize :int;
pt :TPOINT; // screen coordinates for menus
pszModule :PAnsiChar; // button owners name
dwButtonId:dword; // registered button ID
@@ -97,8 +55,8 @@ const
BBBF_ISDUMMYBUTTON = $0200;
type
- tagBBButton = record
- cbSize :int; // size of structure
+ pBBButton = ^tBBButton;
+ tBBButton = record
dwButtonID :dword; // your button ID, will be combined with pszModuleName for storing settings, etc...
pszModuleName:PAnsiChar; // module name without spaces and underline symbols (e.g. "tabsrmm")
szTooltip :PWideChar; // button's tooltip
@@ -108,7 +66,8 @@ type
bbbFlags :dword; // combine of BBBF_ flags above
hIcon :HICON; // Handle to icolib registered icon, it's better to register with pszSection = "TabSRMM/Toolbar"
end;
- tBBButton = tagBBButton;
-
+function Srmm_RemoveButton(bbdi:pBBButton) : integer; stdcall; external AppDll;
+function Srmm_SetButtonState(hContact:TMCONTACT;bbdi:pBBButton) : integer; stdcall; external AppDll;
+
{$ENDIF}