diff options
author | Alexey Kulakov <panda75@bk.ru> | 2014-04-07 15:55:25 +0000 |
---|---|---|
committer | Alexey Kulakov <panda75@bk.ru> | 2014-04-07 15:55:25 +0000 |
commit | acb9afd1419ded31a4d9c4d151a0b79801b23d78 (patch) | |
tree | 7761e12600203eefb91b478e9cf8d600acc73e08 | |
parent | dea767bfe91ba408b09e4f9bcd503dd2150276a7 (diff) |
mRadio: Menu icons added
git-svn-id: http://svn.miranda-ng.org/main/trunk@8874 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | plugins/mRadio/i_myservice.inc | 6 | ||||
-rw-r--r-- | plugins/mRadio/i_tray.inc | 42 | ||||
-rw-r--r-- | plugins/mRadio/ico/open.ico | bin | 1150 -> 1150 bytes | |||
-rw-r--r-- | plugins/mRadio/rframeapi.pas | 5 |
4 files changed, 46 insertions, 7 deletions
diff --git a/plugins/mRadio/i_myservice.inc b/plugins/mRadio/i_myservice.inc index 74b4c11b4f..3aa403398d 100644 --- a/plugins/mRadio/i_myservice.inc +++ b/plugins/mRadio/i_myservice.inc @@ -118,9 +118,13 @@ begin else
gVolume:=-gVolume;
Result:=Service_RadioSetVolume(gVolume,0);
+ if hVolFrmMute<>0 then
+ begin
+ InvalidateRect(hVolFrmMute,nil,true);
+ RedrawWindow(hVolFrmMute,nil,0,RDW_INVALIDATE or RDW_ALLCHILDREN or RDW_ERASE);
+ end;
if hVolFrmCtrl<>0 then
EnableWindow(hVolFrmCtrl,gVolume>=0);
-
end;
function Service_EqOnOff(wParam:WPARAM;lParam:LPARAM):int;cdecl;
diff --git a/plugins/mRadio/i_tray.inc b/plugins/mRadio/i_tray.inc index 85d4841dcf..103865ffe5 100644 --- a/plugins/mRadio/i_tray.inc +++ b/plugins/mRadio/i_tray.inc @@ -138,6 +138,7 @@ procedure CreateTrayMenu(); var
mi:TCListMenuItem;
playstr:pWideChar;
+ ico:pAnsiChar;
begin
FillChar(mi, sizeof(mi), 0);
mi.cbSize :=sizeof(mi);
@@ -154,9 +155,13 @@ begin mi.szPopupName:=TChar(trayradioparent);
if PluginStatus=ID_STATUS_ONLINE then
- mi.szName.w :='mRadio off'
+ begin
+ mi.szName.w :='mRadio off';
+ end
else
+ begin
mi.szName.w :='mRadio on';
+ end;
mi.flags:=CMIF_UNICODE or CMIF_ROOTHANDLE;
mi.position :=0;
srvtraystop:=CreateServiceFunction('mRadio/TrayProto',@TrayProto);
@@ -167,9 +172,16 @@ begin trayprotoh:=Menu_AddMainMenuItem(@mi);
if gVolume<0 then
- mi.flags:=CMIF_UNICODE or CMIF_ROOTHANDLE or CMIF_CHECKED
+ begin
+ mi.flags:=CMIF_UNICODE or CMIF_ROOTHANDLE or CMIF_CHECKED;
+ ico:=IcoBtnOff;
+ end
else
+ begin
mi.flags:=CMIF_UNICODE or CMIF_ROOTHANDLE;
+ ico:=IcoBtnOn;
+ end;
+ mi.hIcon :=CallService(MS_SKIN2_GETICON,0,tlparam(ico));
mi.szName.w :='Mute';
mi.pszService:=MS_RADIO_MUTE;
mi.position :=1;
@@ -178,11 +190,17 @@ begin else
traymute:=Menu_AddMainMenuItem(@mi);
+ mi.hIcon:=0;
mi.flags:=CMIF_UNICODE or CMIF_ROOTHANDLE;
if CallService(MS_RADIO_COMMAND,MRC_STATUS,RD_STATUS_GET)<>RD_STATUS_PLAYING then
+ begin
playstr:='Play'
+ end
else
+ begin
playstr:='Pause';
+ end;
+// mi.hIcon:=CallService(MS_SKIN2_GETICON,0,tlparam(ico));
mi.szName.w :=playstr;
mi.position :=2;
srvtrayplaypause:=CreateServiceFunction('mRadio/TrayPlayPause',@TrayPlayPause);
@@ -204,11 +222,13 @@ begin mi.szName.w :='Quick Open';
mi.position :=4;
mi.pszService:=MS_RADIO_QUICKOPEN;
+ mi.hIcon :=CallService(MS_SKIN2_GETICON,0,tlparam(IcoBtnOpen));
if doTray then
Menu_AddTrayMenuItem(@mi)
else
Menu_AddMainMenuItem(@mi);
+ mi.hIcon :=0;
mi.szName.w :='Play Station';
mi.position :=1000;
mi.pszService:=nil;
@@ -222,23 +242,35 @@ function TrayPrebuild(wParam:WPARAM;lParam:LPARAM):int; cdecl; var
mi:tClistMenuItem;
playstr:pWideChar;
+ ico:pAnsiChar;
begin
FillChar(mi,sizeof(mi),0);
mi.cbSize:=sizeof(mi);
mi.flags:=CMIM_NAME or CMIF_UNICODE;
if PluginStatus=ID_STATUS_ONLINE then
- playstr:='mRadio off'
+ begin
+ playstr:='mRadio off';
+ end
else
+ begin
playstr:='mRadio on';
+ end;
mi.szName.w:=playstr;
CallService(MS_CLIST_MODIFYMENUITEM,trayprotoh,tlparam(@mi));
if gVolume<0 then
- mi.flags:=CMIM_FLAGS or CMIF_CHECKED
+ begin
+ ico:=IcoBtnOff;
+ end
else
- mi.flags:=CMIM_FLAGS;
+ begin
+ ico:=IcoBtnOn;
+ end;
+ mi.flags:=CMIM_FLAGS or CMIM_ICON;
+ mi.hIcon:=CallService(MS_SKIN2_GETICON,0,tlparam(ico));
CallService(MS_CLIST_MODIFYMENUITEM,traymute,tlparam(@mi));
+ mi.hIcon:=0;
mi.flags:=CMIM_NAME or CMIF_UNICODE;
if CallService(MS_RADIO_COMMAND,MRC_STATUS,RD_STATUS_GET)<>RD_STATUS_PLAYING then
diff --git a/plugins/mRadio/ico/open.ico b/plugins/mRadio/ico/open.ico Binary files differindex 4fc3d3ed0c..9fce52e2bc 100644 --- a/plugins/mRadio/ico/open.ico +++ b/plugins/mRadio/ico/open.ico diff --git a/plugins/mRadio/rframeapi.pas b/plugins/mRadio/rframeapi.pas index 84a5e25f76..03a38ea267 100644 --- a/plugins/mRadio/rframeapi.pas +++ b/plugins/mRadio/rframeapi.pas @@ -8,6 +8,7 @@ uses const
hVolFrmCtrl:HWND=0;
+ hVolFrmMute:HWND=0;
procedure CreateFrame(parent:HWND);
procedure DestroyFrame;
@@ -80,7 +81,8 @@ begin result:=0;
case hMessage of
WM_DESTROY: begin
- hVolFrmCtrl :=0;
+ hVolFrmCtrl:=0;
+ hVolFrmMute:=0;
DeleteObject(hbr);
end;
@@ -91,6 +93,7 @@ begin MakeTooltip(Dialog);
hVolFrmCtrl:=GetDlgItem(Dialog,IDC_RADIO_VOL);
+ hVolFrmMute:=GetDlgItem(Dialog,IDC_RADIO_MUTE);
SendMessage(hVolFrmCtrl,TBM_SETRANGE,0,MAKELONG(0,100));
SendMessage(hVolFrmCtrl,TBM_SETPAGESIZE,0,20);
SendMessage(hVolFrmCtrl,TBM_SETPOS,1,gVolume);
|