diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-22 21:27:15 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-22 21:27:15 +0000 |
commit | fbfa53dcd5e9622613286c32ee2cab42aec0897e (patch) | |
tree | e7305d55dd44df287c22b3eac0b73bb456ff1672 /plugins/mRadio | |
parent | 88790eed4ffd9ca555c8f9b73cb014a93b57a34f (diff) |
Menu_ModifyItem applied to the pascal code
git-svn-id: http://svn.miranda-ng.org/main/trunk@14335 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/mRadio')
-rw-r--r-- | plugins/mRadio/i_tray.inc | 36 | ||||
-rw-r--r-- | plugins/mRadio/i_visual.inc | 33 |
2 files changed, 12 insertions, 57 deletions
diff --git a/plugins/mRadio/i_tray.inc b/plugins/mRadio/i_tray.inc index 3ccdccc045..7ed794c1a7 100644 --- a/plugins/mRadio/i_tray.inc +++ b/plugins/mRadio/i_tray.inc @@ -232,45 +232,21 @@ begin end;
function TrayPrebuild(wParam:WPARAM;lParam:LPARAM):int; cdecl;
-var
- mi:tClistMenuItem;
- playstr:pWideChar;
- ico:pAnsiChar;
begin
- FillChar(mi,sizeof(mi),0);
-
- mi.flags:=CMIM_NAME or CMIF_UNICODE;
if PluginStatus=ID_STATUS_ONLINE then
- begin
- playstr:='mRadio off';
- end
+ Menu_ModifyItem(trayprotoh, 'mRadio off')
else
- begin
- playstr:='mRadio on';
- end;
- mi.szName.w:=playstr;
- CallService(MS_CLIST_MODIFYMENUITEM,trayprotoh,tlparam(@mi));
+ Menu_ModifyItem(trayprotoh, 'mRadio on');
if gVolume<0 then
- begin
- ico:=IcoBtnOff;
- end
+ Menu_ModifyItem(traymute, nil, IcoLib_GetIcon(IcoBtnOff,0))
else
- begin
- ico:=IcoBtnOn;
- end;
- mi.flags:=CMIM_FLAGS or CMIM_ICON;
- mi.hIcon:=IcoLib_GetIcon(ico,0);
- CallService(MS_CLIST_MODIFYMENUITEM,traymute,tlparam(@mi));
- mi.hIcon:=0;
+ Menu_ModifyItem(traymute, nil, IcoLib_GetIcon(IcoBtnOn,0));
- mi.flags:=CMIM_NAME or CMIF_UNICODE;
if CallService(MS_RADIO_COMMAND,MRC_STATUS,RD_STATUS_GET)<>RD_STATUS_PLAYING then
- playstr:='Play'
+ Menu_ModifyItem(trayplay, 'Play')
else
- playstr:='Pause';
- mi.szName.w:=playstr;
- CallService(MS_CLIST_MODIFYMENUITEM,trayplay,tlparam(@mi));
+ Menu_ModifyItem(trayplay, 'Pause');
MakeStationsMenu();
result:=0;
diff --git a/plugins/mRadio/i_visual.inc b/plugins/mRadio/i_visual.inc index 915c001aa0..f3ab3615a5 100644 --- a/plugins/mRadio/i_visual.inc +++ b/plugins/mRadio/i_visual.inc @@ -4,45 +4,24 @@ var hCMenuItemPlay:THANDLE;
function OnContactMenu(hContact:WPARAM;lParam:LPARAM):int;cdecl;
-var
- mi:TCListMenuItem;
begin
- FillChar(mi,SizeOf(mi),0);
if StrCmp(Proto_GetProtoName(hContact),PluginName)<>0 then
- begin
- mi.flags:=CMIM_FLAGS or CMIF_HIDDEN;
- CallService(MS_CLIST_MODIFYMENUITEM,hCMenuItemPlay,tlparam(@mi));
- end
+ Menu_ShowItem(hCMenuItemPlay, 0)
else
begin
// play/Stop
- mi.flags:=CMIM_FLAGS or CMIM_ICON or CMIM_NAME;
if THANDLE(hContact)<>ActiveContact then
- begin
- mi.szName.a:='Start broadcasting';
- mi.hIcon:=IcoLib_GetIcon(IcoBtnOn,0);
- end
+ Menu_ModifyItem(hCMenuItemPlay, 'Start broadcasting', IcoLib_GetIcon(IcoBtnOn,0))
else
- begin
- mi.szName.a:='Stop broadcasting';
- mi.hIcon:=IcoLib_GetIcon(IcoBtnOff,0);
- end;
- CallService(MS_CLIST_MODIFYMENUITEM,hCMenuItemPlay,tlparam(@mi));
+ Menu_ModifyItem(hCMenuItemPlay, 'Stop broadcasting', IcoLib_GetIcon(IcoBtnOff,0));
// record
- mi.flags:=CMIM_FLAGS or CMIM_ICON or CMIM_NAME;
if Service_RadioRecord(0,1)<>0 then
- begin
- mi.szName.a:='Stop record';
- mi.hIcon:=IcoLib_GetIcon(IcoBtnRecDn,0);
- end
+ Menu_ModifyItem(hCMenuItemRec, 'Stop record', IcoLib_GetIcon(IcoBtnRecDn,0))
else
- begin
- mi.szName.a:='Start record';
- mi.hIcon:=IcoLib_GetIcon(IcoBtnRecUp,0);
- end;
+ Menu_ModifyItem(hCMenuItemRec, 'Start record', IcoLib_GetIcon(IcoBtnRecUp,0));
end;
- CallService(MS_CLIST_MODIFYMENUITEM,hCMenuItemRec,tlparam(@mi));
+
result:=0;
end;
|