diff options
author | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-10-08 18:43:29 +0000 |
---|---|---|
committer | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-10-08 18:43:29 +0000 |
commit | 864081102a5f252415f41950b3039a896b4ae9c5 (patch) | |
tree | c6b764651e9dd1f8f53b98eab05f16ba4a492a79 /plugins/Watrack/i_gui.inc | |
parent | db5149b48346c417e18add5702a9dfe7f6e28dd0 (diff) |
Awkwars's plugins - welcome to our trunk
git-svn-id: http://svn.miranda-ng.org/main/trunk@1822 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Watrack/i_gui.inc')
-rw-r--r-- | plugins/Watrack/i_gui.inc | 114 |
1 files changed, 114 insertions, 0 deletions
diff --git a/plugins/Watrack/i_gui.inc b/plugins/Watrack/i_gui.inc new file mode 100644 index 0000000000..dc79632b1e --- /dev/null +++ b/plugins/Watrack/i_gui.inc @@ -0,0 +1,114 @@ +{some visual stuff}
+
+function OnTTBLoaded(wParam:WPARAM;lParam:LPARAM):int;cdecl;
+var
+ ttb:m_api.TTBButton;
+begin
+ UnhookEvent(onloadhook);
+
+ FillChar(ttb,SizeOf(ttb),0);
+ ttb.cbSize :=SizeOf(ttb);
+ ttb.dwFlags:=TTBBF_VISIBLE or TTBBF_SHOWTOOLTIP;
+
+ // plugin status button
+ if DisablePlugin<>dsPermanent then
+ ttb.dwFlags:=ttb.dwFlags or TTBBF_PUSHED;
+
+ ttb.hIconDn :=CallService(MS_SKIN2_GETICON,0,tlparam(IcoBtnEnable));
+ ttb.hIconUp :=CallService(MS_SKIN2_GETICON,0,tlparam(IcoBtnDisable));
+ ttb.wParamUp :=1;
+// ttb.wParamDown :=0;
+ ttb.pszService:=MS_WAT_PLUGINSTATUS;
+ ttb.name :='WATrack status';
+// ttb.tooltipDn:='Disable Plugin';
+// ttb.tooltipUp:='Enable Plugin';
+ ttbState:=TopToolbar_AddButton(@ttb);
+ if ttbState=THANDLE(-1) then
+ ttbState:=0
+ else
+ CallService(MS_TTB_SETBUTTONOPTIONS,(ttbState shl 16)+TTBO_TIPNAME,
+ tlparam(Translate('Disable Plugin')));
+ result:=0;
+end;
+
+procedure CreateMenus;
+var
+ mi:TCListMenuItem;
+begin
+ FillChar(mi, sizeof(mi), 0);
+ mi.cbSize :=sizeof(mi);
+ mi.szPopupName.a:=PluginShort;
+
+ mi.hIcon :=CallService(MS_SKIN2_GETICON,0,lparam(IcoBtnEnable));
+ mi.szName.a :='Disable Plugin';
+ mi.pszService :=MS_WAT_PLUGINSTATUS;
+ mi.popupPosition:=MenuDisablePos;
+ hMenuDisable:=Menu_AddMainMenuItem(@mi);
+end;
+
+procedure ChangeMenuIcons(f1:cardinal);
+var
+ mi:tClistMenuItem;
+ p:PAnsiChar;
+begin
+ FillChar(mi,sizeof(mi),0);
+ mi.cbSize:=sizeof(mi);
+ mi.flags :=CMIM_NAME+CMIM_FLAGS+CMIM_ICON+f1;
+ if f1<>0 then
+ begin
+ mi.hIcon :=CallService(MS_SKIN2_GETICON,0,lparam(IcoBtnDisable));
+ mi.szName.a:='Enable Plugin';
+ end
+ else
+ begin
+ mi.hIcon :=CallService(MS_SKIN2_GETICON,0,lparam(IcoBtnEnable));
+ mi.szName.a:='Disable Plugin';
+ end;
+ CallService(MS_CLIST_MODIFYMENUITEM,hMenuDisable,lparam(@mi));
+
+ if ServiceExists(MS_TTB_SETBUTTONSTATE)<>0 then
+ begin
+ if f1<>0 then
+ begin
+ p:='Enable Plugin';
+ CallService(MS_TTB_SETBUTTONSTATE,ttbState,TTBST_RELEASED)
+ end
+ else
+ begin
+ p:='Disable Plugin';
+ CallService(MS_TTB_SETBUTTONSTATE,ttbState,TTBST_PUSHED);
+ end;
+ CallService(MS_TTB_SETBUTTONOPTIONS,(ttbState shl 16)+TTBO_TIPNAME,
+ lparam(Translate(p)));
+ end;
+end;
+
+function IconChanged(wParam:WPARAM;lParam:LPARAM):int;cdecl;
+var
+ mi:TCListMenuItem;
+ ttb:m_api.TTBButton;
+begin
+ result:=0;
+ FillChar(mi,SizeOf(mi),0);
+ mi.cbSize:=sizeof(mi);
+ mi.flags :=CMIM_ICON;
+
+ mi.hIcon:=CallService(MS_SKIN2_GETICON,0,tlparam(IcoBtnEnable));
+ CallService(MS_CLIST_MODIFYMENUITEM,hMenuDisable,tlparam(@mi));
+
+// toptoolbar
+ if ServiceExists(MS_TTB_GETBUTTONOPTIONS)<>0 then
+ begin
+{
+ CallService(MS_TTB_GETBUTTONOPTIONS,(ttbInfo shl 16)+TTBO_ALLDATA,tlparam(@ttb));
+ ttb.hIconUp:=CallService(MS_SKIN2_GETICON,0,tlparam(IcoBtnInfo));
+ ttb.hIconDn:=ttb.hIconUp;
+ CallService(MS_TTB_SETBUTTONOPTIONS,(ttbInfo shl 16)+TTBO_ALLDATA,tlparam(@ttb));
+}
+ CallService(MS_TTB_GETBUTTONOPTIONS,(ttbState shl 16)+TTBO_ALLDATA,tlparam(@ttb));
+ ttb.hIconDn:=CallService(MS_SKIN2_GETICON,0,tlparam(IcoBtnEnable));
+ ttb.hIconUp:=CallService(MS_SKIN2_GETICON,0,tlparam(IcoBtnDisable));
+ CallService(MS_TTB_SETBUTTONOPTIONS,(ttbState shl 16)+TTBO_ALLDATA,tlparam(@ttb));
+ end;
+
+end;
|