Skip to content

Commit fae9840

Browse files
committed
键盘指示器、响度计插件增加图标
1 parent 27ed05f commit fae9840

17 files changed

+56
-2
lines changed

Plugins/IpAddress/OptionsDlg.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ BOOL COptionsDlg::OnInitDialog()
6060
{
6161
CDialog::OnInitDialog();
6262

63+
SetIcon(g_data.GetIcon(IDI_IP_ADDRESS), FALSE);
64+
6365
//初始化下拉列表
6466
InitConnectionsCombobox();
6567

Plugins/KeyboardIndicator/KeyboardIndicator.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ void CKeyboardIndicator::OnExtenedInfo(ExtendedInfoIndex index, const wchar_t* d
8686
}
8787
}
8888

89+
void* CKeyboardIndicator::GetPluginIcon()
90+
{
91+
return g_data.GetIcon(IDI_ICON1);
92+
}
93+
8994
bool CKeyboardIndicator::IsCapsLockOn()
9095
{
9196
return (GetKeyState(VK_CAPITAL) & 0x0001) != 0;

Plugins/KeyboardIndicator/KeyboardIndicator.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ class CKeyboardIndicator : public ITMPlugin
1717
virtual OptionReturn ShowOptionsDialog(void* hParent) override;
1818
virtual const wchar_t* GetInfo(PluginInfoIndex index) override;
1919
virtual void OnExtenedInfo(ExtendedInfoIndex index, const wchar_t* data) override;
20+
virtual void* GetPluginIcon() override;
2021

2122
static bool IsCapsLockOn();
2223
static bool IsNumLockOn();

Plugins/KeyboardIndicator/KeyboardIndicator.rc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,16 @@ BEGIN
148148
END
149149

150150

151+
/////////////////////////////////////////////////////////////////////////////
152+
//
153+
// Icon
154+
//
155+
156+
// Icon with lowest ID value placed first to ensure application icon
157+
// remains consistent on all systems.
158+
IDI_ICON1 ICON "res\\icon.ico"
159+
160+
151161
/////////////////////////////////////////////////////////////////////////////
152162
//
153163
// String Table

Plugins/KeyboardIndicator/KeyboardIndicator.vcxproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,9 @@
269269
<ItemGroup>
270270
<ResourceCompile Include="KeyboardIndicator.rc" />
271271
</ItemGroup>
272+
<ItemGroup>
273+
<Image Include="res\icon.ico" />
274+
</ItemGroup>
272275
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
273276
<ImportGroup Label="ExtensionTargets">
274277
</ImportGroup>

Plugins/KeyboardIndicator/KeyboardIndicator.vcxproj.filters

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,9 @@
7777
<Filter>资源文件</Filter>
7878
</ResourceCompile>
7979
</ItemGroup>
80+
<ItemGroup>
81+
<Image Include="res\icon.ico">
82+
<Filter>资源文件</Filter>
83+
</Image>
84+
</ItemGroup>
8085
</Project>

Plugins/KeyboardIndicator/OptionsDlg.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ END_MESSAGE_MAP()
3636
BOOL COptionsDlg::OnInitDialog()
3737
{
3838
CDialog::OnInitDialog();
39+
SetIcon(g_data.GetIcon(IDI_ICON1), FALSE);
3940

4041
CheckDlgButton(IDC_SHOW_CAPS_LOCK_CHECK, m_data.show_caps_lock);
4142
CheckDlgButton(IDC_SHOW_NUM_LOCK_CHECK, m_data.show_num_lock);
9.4 KB
Binary file not shown.

Plugins/KeyboardIndicator/resource.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#define IDD_OPTIONS_DIALOG 102
66
#define IDS_PLUGIN_NAME 103
77
#define IDS_PLUGIN_DESCRIPTION 104
8+
#define IDI_ICON1 104
89
#define IDS_PLUGIN_ITEM_NAME 105
910
#define IDS_SELECT_AT_LEAST_WARNING 106
1011
#define IDC_SHOW_CAPS_LOCK_CHECK 1000
@@ -16,7 +17,7 @@
1617
//
1718
#ifdef APSTUDIO_INVOKED
1819
#ifndef APSTUDIO_READONLY_SYMBOLS
19-
#define _APS_NEXT_RESOURCE_VALUE 104
20+
#define _APS_NEXT_RESOURCE_VALUE 105
2021
#define _APS_NEXT_COMMAND_VALUE 40001
2122
#define _APS_NEXT_CONTROL_VALUE 1004
2223
#define _APS_NEXT_SYMED_VALUE 103

Plugins/LoudnessMeter/LoudnessMeter.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ void CLoudnessMeter::OnExtenedInfo(ExtendedInfoIndex index, const wchar_t* data)
111111
}
112112
}
113113

114+
void* CLoudnessMeter::GetPluginIcon()
115+
{
116+
return g_data.GetIcon(IDI_ICON1);
117+
}
118+
114119
void CLoudnessMeter::DoDataAcquire()
115120
{
116121
float peakValue = 0.0f;

0 commit comments

Comments
 (0)