summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpescuma <pescuma@c086bb3d-8645-0410-b8da-73a8550f86e7>2009-04-08 04:22:23 +0000
committerpescuma <pescuma@c086bb3d-8645-0410-b8da-73a8550f86e7>2009-04-08 04:22:23 +0000
commit510d19974eab3364252df3ad1fa6965afe1c74f7 (patch)
tree58ed55ae6b0e594f7bb0498361b18521474d8d4d
parentb88e43ee05321968fa6ab3ae00155d5412cb9006 (diff)
extraicons:
- Added icons to combos - Added visibility git-svn-id: http://pescuma.googlecode.com/svn/trunk/Miranda@156 c086bb3d-8645-0410-b8da-73a8550f86e7
-rw-r--r--Plugins/extraicons/.cproject70
-rw-r--r--Plugins/extraicons/DefaultExtraIcons.cpp66
-rw-r--r--Plugins/extraicons/ExtraIcon.cpp2
-rw-r--r--Plugins/extraicons/extraicons.dsp8
-rw-r--r--Plugins/extraicons/options.cpp86
-rw-r--r--Plugins/extraicons/resource.rc3
6 files changed, 191 insertions, 44 deletions
diff --git a/Plugins/extraicons/.cproject b/Plugins/extraicons/.cproject
index 1a4ac42..d51e189 100644
--- a/Plugins/extraicons/.cproject
+++ b/Plugins/extraicons/.cproject
@@ -48,7 +48,13 @@
<option defaultValue="true" id="gnu.c.link.mingw.so.debug.option.shared.1575843488" name="Shared (-shared)" superClass="gnu.c.link.mingw.so.debug.option.shared" valueType="boolean"/>
</tool>
<tool commandLinePattern="${COMMAND} ${FLAGS} ${OUTPUT_FLAG}&quot;C:\Desenvolvimento\Miranda\bin\Debug Unicode\Plugins\${OUTPUT_PREFIX}${OUTPUT}&quot; ${INPUTS}" id="cdt.managedbuild.tool.gnu.cpp.linker.mingw.so.debug.836489507" name="MinGW C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.mingw.so.debug">
+<option id="gnu.cpp.link.option.paths.1417684678" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
+<listOptionValue builtIn="false" value="&quot;C:\Program Files\Microsoft SDK\Lib&quot;"/>
+</option>
<option defaultValue="true" id="gnu.cpp.link.mingw.so.debug.option.shared.1239249880" name="Shared (-shared)" superClass="gnu.cpp.link.mingw.so.debug.option.shared" valueType="boolean"/>
+<option id="gnu.cpp.link.option.libs.1498281393" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs">
+<listOptionValue builtIn="false" value="Gdi32.Lib"/>
+</option>
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.417851543" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
@@ -63,6 +69,20 @@
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets">
+<buildTargets>
+<target name="build" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+<buildCommand>make</buildCommand>
+<buildArguments/>
+<buildTarget>build</buildTarget>
+<stopOnError>true</stopOnError>
+<useDefaultCommand>true</useDefaultCommand>
+<runAllBuilders>true</runAllBuilders>
+</target>
+</buildTargets>
+</storageModule>
+<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
@@ -311,7 +331,7 @@
</scannerInfoProvider>
</profile>
</scannerConfigBuildInfo>
-<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.so.debug.15108384;cdt.managedbuild.config.gnu.mingw.so.debug.15108384.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.so.debug.1415411771;cdt.managedbuild.tool.gnu.cpp.compiler.input.1142292324">
+<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.so.release.1800759879;cdt.managedbuild.config.gnu.mingw.so.release.1800759879.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.so.release.1742438449;cdt.managedbuild.tool.gnu.cpp.compiler.input.1065609886">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
<buildOutputProvider>
@@ -394,7 +414,7 @@
</scannerInfoProvider>
</profile>
</scannerConfigBuildInfo>
-<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.so.release.1800759879;cdt.managedbuild.config.gnu.mingw.so.release.1800759879.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.so.release.1742438449;cdt.managedbuild.tool.gnu.cpp.compiler.input.1065609886">
+<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.so.debug.15108384;cdt.managedbuild.config.gnu.mingw.so.debug.15108384.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.so.debug.1415411771;cdt.managedbuild.tool.gnu.cpp.compiler.input.1142292324">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
<buildOutputProvider>
@@ -478,20 +498,6 @@
</profile>
</scannerConfigBuildInfo>
</storageModule>
-<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets">
-<buildTargets>
-<target name="build" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
-<buildCommand>make</buildCommand>
-<buildArguments/>
-<buildTarget>build</buildTarget>
-<stopOnError>true</stopOnError>
-<useDefaultCommand>true</useDefaultCommand>
-<runAllBuilders>true</runAllBuilders>
-</target>
-</buildTargets>
-</storageModule>
-<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
-<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
</cconfiguration>
<cconfiguration id="cdt.managedbuild.config.gnu.mingw.so.release.1800759879">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.so.release.1800759879" moduleId="org.eclipse.cdt.core.settings" name="Release">
@@ -550,6 +556,20 @@
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets">
+<buildTargets>
+<target name="build" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
+<buildCommand>make</buildCommand>
+<buildArguments/>
+<buildTarget>build</buildTarget>
+<stopOnError>true</stopOnError>
+<useDefaultCommand>true</useDefaultCommand>
+<runAllBuilders>true</runAllBuilders>
+</target>
+</buildTargets>
+</storageModule>
+<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
@@ -798,7 +818,7 @@
</scannerInfoProvider>
</profile>
</scannerConfigBuildInfo>
-<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.so.debug.15108384;cdt.managedbuild.config.gnu.mingw.so.debug.15108384.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.so.debug.1415411771;cdt.managedbuild.tool.gnu.cpp.compiler.input.1142292324">
+<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.so.release.1800759879;cdt.managedbuild.config.gnu.mingw.so.release.1800759879.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.so.release.1742438449;cdt.managedbuild.tool.gnu.cpp.compiler.input.1065609886">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
<buildOutputProvider>
@@ -881,7 +901,7 @@
</scannerInfoProvider>
</profile>
</scannerConfigBuildInfo>
-<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.so.release.1800759879;cdt.managedbuild.config.gnu.mingw.so.release.1800759879.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.so.release.1742438449;cdt.managedbuild.tool.gnu.cpp.compiler.input.1065609886">
+<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.so.debug.15108384;cdt.managedbuild.config.gnu.mingw.so.debug.15108384.;cdt.managedbuild.tool.gnu.cpp.compiler.mingw.so.debug.1415411771;cdt.managedbuild.tool.gnu.cpp.compiler.input.1142292324">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP"/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
<buildOutputProvider>
@@ -965,20 +985,6 @@
</profile>
</scannerConfigBuildInfo>
</storageModule>
-<storageModule moduleId="org.eclipse.cdt.make.core.buildtargets">
-<buildTargets>
-<target name="build" path="" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
-<buildCommand>make</buildCommand>
-<buildArguments/>
-<buildTarget>build</buildTarget>
-<stopOnError>true</stopOnError>
-<useDefaultCommand>true</useDefaultCommand>
-<runAllBuilders>true</runAllBuilders>
-</target>
-</buildTargets>
-</storageModule>
-<storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>
-<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
diff --git a/Plugins/extraicons/DefaultExtraIcons.cpp b/Plugins/extraicons/DefaultExtraIcons.cpp
index 3d65373..e267d72 100644
--- a/Plugins/extraicons/DefaultExtraIcons.cpp
+++ b/Plugins/extraicons/DefaultExtraIcons.cpp
@@ -34,11 +34,13 @@
static void ProtocolInit();
static void DBExtraIconsInit();
+static void VisibilityInit();
void DefaultExtraIcons_Load()
{
ProtocolInit();
DBExtraIconsInit();
+ VisibilityInit();
}
void DefaultExtraIcons_Unload()
@@ -47,6 +49,56 @@ void DefaultExtraIcons_Unload()
// DB extra icons ///////////////////////////////////////////////////////////////////////
+HANDLE hExtraVisibility = NULL;
+
+static void SetVisibility(HANDLE hContact, int apparentMode, BOOL clear)
+{
+ if (hContact == NULL)
+ return;
+
+ char *proto = (char*) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
+ if (IsEmpty(proto))
+ return;
+
+ if (apparentMode < 0)
+ apparentMode = DBGetContactSettingWord(hContact, proto, "ApparentMode", 0);
+
+ const char *ico = NULL;
+
+ if (DBGetContactSettingByte(hContact, proto, "ChatRoom", 0))
+ {
+ // Is chat
+ if (apparentMode == ID_STATUS_OFFLINE)
+ ico = "ChatActivity";
+ }
+ else
+ {
+ // Not chat
+ if (apparentMode == ID_STATUS_OFFLINE)
+ ico = "NeverVis";
+
+ else if (apparentMode == ID_STATUS_ONLINE)
+ ico = "AlwaysVis";
+ }
+
+ if (ico == NULL && !clear)
+ return;
+
+ ExtraIcon_SetIcon(hExtraVisibility, hContact, ico);
+}
+
+static void VisibilityInit()
+{
+ hExtraVisibility = ExtraIcon_Register("visibility", "Visibility/Chat activity", "AlwaysVis");
+
+ HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ while (hContact != NULL)
+ {
+ SetVisibility(hContact, -1, FALSE);
+
+ hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
+ }
+}
struct Info
{
@@ -111,6 +163,14 @@ static int SettingChanged(WPARAM wParam, LPARAM lParam)
if (IsEmpty(proto))
return 0;
+ bool isProto = (strcmp(cws->szModule, proto) == 0);
+
+ if (isProto && strcmp(cws->szSetting, "ApparentMode") == 0)
+ {
+ SetVisibility(hContact, cws->value.type == DBVT_DELETED ? 0 : cws->value.wVal, TRUE);
+ return 0;
+ }
+
for (unsigned int i = 0; i < MAX_REGS(infos); ++i)
{
Info &info = infos[i];
@@ -119,7 +179,9 @@ static int SettingChanged(WPARAM wParam, LPARAM lParam)
{
if (info.db[j + 1] == NULL)
break;
- if (strcmp(cws->szModule, info.db[j] == NULL ? proto : info.db[j]))
+ if (info.db[j] == NULL && !isProto)
+ continue;
+ if (info.db[j] != NULL && strcmp(cws->szModule, info.db[j]))
continue;
if (strcmp(cws->szSetting, info.db[j + 1]))
continue;
@@ -216,5 +278,5 @@ static void ProtocolApplyIcon(HANDLE hContact, int slot)
static void ProtocolInit()
{
- hExtraProto = ExtraIcon_Register("protocol", ProtocolRebuildIcons, ProtocolApplyIcon, "Protocol");
+ hExtraProto = ExtraIcon_Register("protocol", ProtocolRebuildIcons, ProtocolApplyIcon, "Account", "core_main_34");
}
diff --git a/Plugins/extraicons/ExtraIcon.cpp b/Plugins/extraicons/ExtraIcon.cpp
index 6c247d9..95c0265 100644
--- a/Plugins/extraicons/ExtraIcon.cpp
+++ b/Plugins/extraicons/ExtraIcon.cpp
@@ -20,7 +20,7 @@
#include "commons.h"
ExtraIcon::ExtraIcon(const char *name, const char *description, const char *descIcon) :
- name(name), description(description), descIcon(descIcon), slot(-1)
+ name(name), description(Translate(description)), descIcon(descIcon), slot(-1)
{
}
diff --git a/Plugins/extraicons/extraicons.dsp b/Plugins/extraicons/extraicons.dsp
index 5390a45..61d4eb2 100644
--- a/Plugins/extraicons/extraicons.dsp
+++ b/Plugins/extraicons/extraicons.dsp
@@ -57,7 +57,7 @@ BSC32=bscmake.exe
LINK32=link.exe
# ADD BASE LINK32 user32.lib shell32.lib wininet.lib gdi32.lib /nologo /base:"0x67100000" /dll /machine:I386 /filealign:0x200
# SUBTRACT BASE LINK32 /pdb:none /map
-# ADD LINK32 kernel32.lib user32.lib ole32.lib oleaut32.lib /nologo /base:"0x3EC20000" /dll /map /machine:I386 /out:"..\..\bin\release\Plugins\extraicons.dll" /filealign:0x200 /ALIGN:4096 /ignore:4108
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib /nologo /base:"0x3EC20000" /dll /map /machine:I386 /out:"..\..\bin\release\Plugins\extraicons.dll" /filealign:0x200 /ALIGN:4096 /ignore:4108
# SUBTRACT LINK32 /profile /pdb:none
!ELSEIF "$(CFG)" == "extraicons - Win32 Debug"
@@ -86,7 +86,7 @@ BSC32=bscmake.exe
LINK32=link.exe
# ADD BASE LINK32 comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"..\..bin\release\Plugins\extraicons.dll" /filealign:0x200 /ALIGN:4096 /ignore:4108
# SUBTRACT BASE LINK32 /profile /pdb:none
-# ADD LINK32 kernel32.lib user32.lib ole32.lib oleaut32.lib /nologo /base:"0x3EC20000" /dll /incremental:yes /debug /machine:I386 /out:"..\..\bin\debug unicode\Plugins\extraicons.dll" /filealign:0x200 /ALIGN:4096 /ignore:4108
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib /nologo /base:"0x3EC20000" /dll /incremental:yes /debug /machine:I386 /out:"..\..\bin\debug unicode\Plugins\extraicons.dll" /filealign:0x200 /ALIGN:4096 /ignore:4108
# SUBTRACT LINK32 /profile /pdb:none
!ELSEIF "$(CFG)" == "extraicons - Win32 Unicode Debug"
@@ -115,7 +115,7 @@ BSC32=bscmake.exe
LINK32=link.exe
# ADD BASE LINK32 comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x32100000" /dll /incremental:yes /debug /machine:I386 /out:"..\..\bin\debug\Plugins\extraicons.dll" /filealign:0x200 /ALIGN:4096 /ignore:4108
# SUBTRACT BASE LINK32 /profile /pdb:none
-# ADD LINK32 kernel32.lib user32.lib ole32.lib oleaut32.lib /nologo /base:"0x3EC20000" /dll /incremental:yes /debug /machine:I386 /out:"..\..\bin\debug unicode\Plugins\extraiconsW.dll" /filealign:0x200 /ALIGN:4096 /ignore:4108
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib /nologo /base:"0x3EC20000" /dll /incremental:yes /debug /machine:I386 /out:"..\..\bin\debug unicode\Plugins\extraiconsW.dll" /filealign:0x200 /ALIGN:4096 /ignore:4108
# SUBTRACT LINK32 /profile /pdb:none
!ELSEIF "$(CFG)" == "extraicons - Win32 Unicode Release"
@@ -144,7 +144,7 @@ BSC32=bscmake.exe
LINK32=link.exe
# ADD BASE LINK32 comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /base:"0x32100000" /dll /map /machine:I386 /out:"..\..\bin\release\Plugins\extraicons.dll" /filealign:0x200 /ALIGN:4096 /ignore:4108
# SUBTRACT BASE LINK32 /profile /pdb:none
-# ADD LINK32 kernel32.lib user32.lib ole32.lib oleaut32.lib /nologo /base:"0x3EC20000" /dll /map /machine:I386 /out:"..\..\bin\release unicode\Plugins\extraiconsW.dll" /filealign:0x200 /ALIGN:4096 /ignore:4108
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib /nologo /base:"0x3EC20000" /dll /map /machine:I386 /out:"..\..\bin\release unicode\Plugins\extraiconsW.dll" /filealign:0x200 /ALIGN:4096 /ignore:4108
# SUBTRACT LINK32 /profile /pdb:none
!ENDIF
diff --git a/Plugins/extraicons/options.cpp b/Plugins/extraicons/options.cpp
index 926796b..8a0e6ba 100644
--- a/Plugins/extraicons/options.cpp
+++ b/Plugins/extraicons/options.cpp
@@ -27,6 +27,8 @@
#define PSN_APPLY ((0U-200U)-2)
#endif
+#define ICON_SIZE 16
+
// Prototypes /////////////////////////////////////////////////////////////////////////////////////
HANDLE hOptHook = NULL;
@@ -145,7 +147,8 @@ static BOOL CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
SendMessage(tmp, WM_SETFONT, (WPARAM) hFont, FALSE);
HWND combo = CreateWindow("COMBOBOX", "",
- WS_CHILD | WS_VISIBLE | WS_TABSTOP | CBS_DROPDOWNLIST | WS_VSCROLL,
+ WS_CHILD | WS_VISIBLE | WS_TABSTOP | CBS_DROPDOWNLIST | WS_VSCROLL
+ | CBS_OWNERDRAWFIXED | CBS_HASSTRINGS,
rcCombo.left, rcCombo.top + i * height,
rcCombo.right - rcCombo.left, rcCombo.bottom - rcCombo.top,
hwndDlg, (HMENU) id, hInst, NULL);
@@ -154,13 +157,13 @@ static BOOL CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
// Fill combo
int sel = 0;
- SendDlgItemMessage(hwndDlg, id, CB_ADDSTRING, 0, (LPARAM) "<Empty>");
+ SendDlgItemMessage(hwndDlg, id, CB_ADDSTRING, 0, (LPARAM) Translate("<Empty>"));
for (int j = 0; j < (int) extraIcons.size(); ++j)
{
ExtraIcon *extra = extraIcons[j];
- SendDlgItemMessage(hwndDlg, id, CB_ADDSTRING, 0, (LPARAM) Translate(extra->getDescription()));
- SendDlgItemMessage(hwndDlg, id, CB_SETITEMDATA, j, (DWORD) extra);
+ int pos = SendDlgItemMessage(hwndDlg, id, CB_ADDSTRING, 0, (LPARAM) extra->getDescription());
+ SendDlgItemMessage(hwndDlg, id, CB_SETITEMDATA, pos, (DWORD) extra);
if (extra->getSlot() == i)
sel = j + 1;
@@ -212,6 +215,7 @@ static BOOL CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
if (GetExtraIconBySlot(j) == NULL)
continue;
+
// Had and icon and lost
RemoveExtraIcons(j);
}
@@ -240,6 +244,80 @@ static BOOL CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
break;
}
+ case WM_DRAWITEM:
+ {
+ LPDRAWITEMSTRUCT lpdis = (LPDRAWITEMSTRUCT) lParam;
+ if ((lpdis->CtlID % 2) != 0)
+ break;
+ int slot = (lpdis->CtlID - IDC_SLOT) / 2;
+ if (slot < 0 || slot > numSlots * 2)
+ break;
+ if (lpdis->itemID == -1)
+ break;
+
+ ExtraIcon *extra = (ExtraIcon *) lpdis->itemData;
+
+ TEXTMETRIC tm;
+ RECT rc;
+
+ GetTextMetrics(lpdis->hDC, &tm);
+
+ COLORREF clrfore = SetTextColor(lpdis->hDC, GetSysColor(lpdis->itemState & ODS_SELECTED
+ ? COLOR_HIGHLIGHTTEXT : COLOR_WINDOWTEXT));
+ COLORREF clrback = SetBkColor(lpdis->hDC, GetSysColor(lpdis->itemState & ODS_SELECTED ? COLOR_HIGHLIGHT
+ : COLOR_WINDOW));
+
+ FillRect(lpdis->hDC, &lpdis->rcItem, GetSysColorBrush(lpdis->itemState & ODS_SELECTED ? COLOR_HIGHLIGHT
+ : COLOR_WINDOW));
+
+ rc.left = lpdis->rcItem.left + 2;
+
+
+ // Draw icon
+ HICON hIcon = NULL;
+ if (extra != NULL && !IsEmpty(extra->getDescIcon()))
+ hIcon = (HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM) extra->getDescIcon());
+ if (hIcon != NULL)
+ {
+ rc.top = (lpdis->rcItem.bottom + lpdis->rcItem.top - ICON_SIZE) / 2;
+ DrawIconEx(lpdis->hDC, rc.left, rc.top, hIcon, 16, 16, 0, NULL, DI_NORMAL);
+ CallService(MS_SKIN2_RELEASEICON, (WPARAM) hIcon, 0);
+ }
+
+ rc.left += ICON_SIZE + 4;
+
+
+ // Draw text
+ rc.right = lpdis->rcItem.right - 2;
+ rc.top = (lpdis->rcItem.bottom + lpdis->rcItem.top - tm.tmHeight) / 2;
+ rc.bottom = rc.top + tm.tmHeight;
+ DrawText(lpdis->hDC, extra == NULL ? Translate("<Empty>") : extra->getDescription(), -1, &rc,
+ DT_END_ELLIPSIS | DT_NOPREFIX | DT_SINGLELINE);
+
+
+ // Restore old colors
+ SetTextColor(lpdis->hDC, clrfore);
+ SetBkColor(lpdis->hDC, clrback);
+
+ return TRUE;
+ }
+
+ case WM_MEASUREITEM:
+ {
+ LPMEASUREITEMSTRUCT lpmis = (LPMEASUREITEMSTRUCT) lParam;
+ if ((lpmis->CtlID % 2) != 0)
+ break;
+ int slot = (lpmis->CtlID - IDC_SLOT) / 2;
+ if (slot < 0 || slot > numSlots * 2)
+ break;
+
+ TEXTMETRIC tm;
+ GetTextMetrics(GetDC(hwndDlg), &tm);
+
+ lpmis->itemHeight = MAX(ICON_SIZE, tm.tmHeight);
+
+ return TRUE;
+ }
}
return 0;
diff --git a/Plugins/extraicons/resource.rc b/Plugins/extraicons/resource.rc
index 6e74506..570d21f 100644
--- a/Plugins/extraicons/resource.rc
+++ b/Plugins/extraicons/resource.rc
@@ -35,7 +35,8 @@ BEGIN
LTEXT "Select the extra icons to be shown in the contact list:",
IDC_STATIC,1,9,274,13
LTEXT "Slot 1:",IDC_SLOT_L,1,31,21,8
- COMBOBOX IDC_SLOT,35,28,173,60,CBS_DROPDOWNLIST | WS_VSCROLL |
+ COMBOBOX IDC_SLOT,35,28,173,60,CBS_DROPDOWNLIST |
+ CBS_OWNERDRAWFIXED | CBS_HASSTRINGS | WS_VSCROLL |
WS_TABSTOP
END