media:cpp --uinext win32xx 2/2

This commit is contained in:
lovebird 2026-04-15 20:33:22 +02:00
parent 08e690631e
commit 6bd416146b
1865 changed files with 2146 additions and 121 deletions

View File

@ -182,6 +182,7 @@ if(WIN32)
"${_UI_NEXT_DIR}/Ribbon.bml"
"/header:${_UI_NEXT_DIR}/RibbonUI.h"
"/res:${_UI_NEXT_DIR}/RibbonUI.rc"
"/name:APPLICATION"
DEPENDS "${_UI_NEXT_DIR}/Ribbon.xml"
COMMENT "Compiling Ribbon.xml Ribbon.bml + RibbonUI.h/rc (uicc)"
VERBATIM
@ -198,6 +199,7 @@ if(WIN32)
target_sources(pm-image PRIVATE
"${_UI_NEXT_DIR}/App.cpp"
"${_UI_NEXT_DIR}/DropView.cpp"
"${_UI_NEXT_DIR}/FileQueue.cpp"
"${_UI_NEXT_DIR}/SettingsPanel.cpp"
"${_UI_NEXT_DIR}/Mainfrm.cpp"

Binary file not shown.

Binary file not shown.

View File

@ -2,37 +2,103 @@
#include "DropView.h"
#include "Resource.h"
#include <shellapi.h>
#include <algorithm>
int CDropView::OnCreate(CREATESTRUCT&)
#pragma comment(lib, "gdiplus.lib")
CImagePreview::CImagePreview()
{
m_bgBrush.CreateSolidBrush(RGB(245, 245, 245));
m_label = L"Drop images here or use Add Files";
Gdiplus::GdiplusStartupInput si;
Gdiplus::GdiplusStartup(&m_gdipToken, &si, nullptr);
}
CImagePreview::~CImagePreview()
{
delete m_pImage;
if (m_gdipToken) Gdiplus::GdiplusShutdown(m_gdipToken);
}
int CImagePreview::OnCreate(CREATESTRUCT&)
{
m_bgBrush.CreateSolidBrush(RGB(48, 48, 48));
SetClassLongPtr(GCLP_HBRBACKGROUND, (LONG_PTR)m_bgBrush.GetHandle());
DragAcceptFiles(TRUE);
return 0;
}
void CDropView::PreCreate(CREATESTRUCT& cs)
bool CImagePreview::LoadPicture(LPCWSTR path)
{
cs.dwExStyle = WS_EX_CLIENTEDGE;
delete m_pImage;
m_pImage = nullptr;
auto* img = Gdiplus::Image::FromFile(path);
if (img && img->GetLastStatus() == Gdiplus::Ok) {
m_pImage = img;
m_label.Empty();
SetScrollSizes(CSize(0, 0));
Invalidate();
return true;
}
delete img;
m_label = L"Could not load image";
SetScrollSizes(CSize(0, 0));
Invalidate();
return false;
}
void CDropView::OnDraw(CDC& dc)
void CImagePreview::ClearPicture()
{
delete m_pImage;
m_pImage = nullptr;
m_label = L"Drop images here or use Add Files";
SetScrollSizes(CSize(0, 0));
Invalidate();
}
void CImagePreview::OnDraw(CDC& dc)
{
CRect rc = GetClientRect();
// Fill background
dc.FillRect(rc, m_bgBrush);
dc.SetBkMode(TRANSPARENT);
dc.SetTextColor(RGB(160, 160, 160));
dc.DrawText(L"Drop images here or use Add Files", -1, rc,
DT_CENTER | DT_VCENTER | DT_SINGLELINE);
if (m_pImage) {
UINT iw = m_pImage->GetWidth();
UINT ih = m_pImage->GetHeight();
if (iw > 0 && ih > 0) {
int cw = rc.Width();
int ch = rc.Height();
// Fit image within client area maintaining aspect ratio
double scaleX = (double)cw / iw;
double scaleY = (double)ch / ih;
double scale = (std::min)(scaleX, scaleY);
if (scale > 1.0) scale = 1.0;
int dw = (int)(iw * scale);
int dh = (int)(ih * scale);
int dx = (cw - dw) / 2;
int dy = (ch - dh) / 2;
Gdiplus::Graphics gfx(dc.GetHDC());
gfx.SetInterpolationMode(Gdiplus::InterpolationModeHighQualityBicubic);
gfx.DrawImage(m_pImage, dx, dy, dw, dh);
}
} else if (!m_label.IsEmpty()) {
dc.SetBkMode(TRANSPARENT);
dc.SetTextColor(RGB(160, 160, 160));
dc.DrawText(m_label, -1, rc, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
}
}
LRESULT CDropView::OnDropFiles(WPARAM wparam)
LRESULT CImagePreview::OnDropFiles(WPARAM wparam)
{
// Forward to parent (CMainFrame) which handles WM_DROPFILES.
return GetAncestor().SendMessage(WM_DROPFILES, wparam, 0);
}
LRESULT CDropView::WndProc(UINT msg, WPARAM wparam, LPARAM lparam)
LRESULT CImagePreview::WndProc(UINT msg, WPARAM wparam, LPARAM lparam)
{
try {
switch (msg) {

View File

@ -3,25 +3,32 @@
#include "stdafx.h"
#include <shellapi.h>
#include <gdiplus.h>
class CDropView : public CWnd
class CImagePreview : public CScrollView
{
public:
CDropView() = default;
virtual ~CDropView() override = default;
CImagePreview();
virtual ~CImagePreview() override;
bool LoadPicture(LPCWSTR path);
void ClearPicture();
protected:
virtual int OnCreate(CREATESTRUCT& cs) override;
virtual void OnDraw(CDC& dc) override;
virtual void PreCreate(CREATESTRUCT& cs) override;
virtual LRESULT WndProc(UINT msg, WPARAM wparam, LPARAM lparam) override;
private:
CDropView(const CDropView&) = delete;
CDropView& operator=(const CDropView&) = delete;
CImagePreview(const CImagePreview&) = delete;
CImagePreview& operator=(const CImagePreview&) = delete;
LRESULT OnDropFiles(WPARAM wparam);
Gdiplus::Image* m_pImage = nullptr;
ULONG_PTR m_gdipToken = 0;
CBrush m_bgBrush;
CString m_label;
};
#endif // PM_UI_DROPVIEW_H

View File

@ -1,8 +1,8 @@
#include "stdafx.h"
#include "FileQueue.h"
#include "Resource.h"
#include <filesystem>
#include <shellapi.h>
namespace fs = std::filesystem;
@ -13,33 +13,44 @@ namespace fs = std::filesystem;
void CQueueListView::OnAttach()
{
CListView::OnAttach();
SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES | LVS_EX_DOUBLEBUFFER);
SetupColumns();
DragAcceptFiles(TRUE);
}
DWORD exStyle = LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES | LVS_EX_DOUBLEBUFFER;
SendMessage(LVM_SETEXTENDEDLISTVIEWSTYLE, 0, exStyle);
void CQueueListView::PreCreate(CREATESTRUCT& cs)
{
CListView::PreCreate(cs);
cs.style |= LVS_REPORT | LVS_SHOWSELALWAYS;
}
void CQueueListView::SetupColumns()
{
DeleteAllItems();
LV_COLUMN col{};
col.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
col.fmt = LVCFMT_LEFT;
WCHAR names[COL_COUNT][16] = { L"Name", L"Status", L"Path" };
int widths[COL_COUNT] = { 220, 100, 400 };
col.pszText = const_cast<LPWSTR>(L"Name");
col.cx = DpiScaleInt(220);
col.iSubItem = COL_NAME;
InsertColumn(COL_NAME, col);
for (int i = 0; i < COL_COUNT; ++i) {
col.pszText = names[i];
col.cx = DpiScaleInt(widths[i]);
col.iSubItem = i;
InsertColumn(i, col);
}
col.pszText = const_cast<LPWSTR>(L"Status");
col.cx = DpiScaleInt(100);
col.iSubItem = COL_STATUS;
InsertColumn(COL_STATUS, col);
col.pszText = const_cast<LPWSTR>(L"Path");
col.cx = DpiScaleInt(400);
col.iSubItem = COL_PATH;
InsertColumn(COL_PATH, col);
}
int CQueueListView::AddFile(const CString& path)
{
// Derive filename from path.
fs::path p(std::wstring(path.c_str()));
CString name = p.filename().c_str();
@ -79,13 +90,13 @@ CString CQueueListView::GetItemPath(int item)
LRESULT CQueueListView::OnDropFiles(UINT, WPARAM wparam, LPARAM)
{
HDROP hDrop = reinterpret_cast<HDROP>(wparam);
UINT count = DragQueryFileW(hDrop, 0xFFFFFFFF, nullptr, 0);
UINT count = ::DragQueryFileW(hDrop, 0xFFFFFFFF, nullptr, 0);
for (UINT i = 0; i < count; ++i) {
UINT len = DragQueryFileW(hDrop, i, nullptr, 0);
UINT len = ::DragQueryFileW(hDrop, i, nullptr, 0);
if (len == 0) continue;
std::wstring w(static_cast<size_t>(len) + 1, L'\0');
DragQueryFileW(hDrop, i, w.data(), len + 1);
::DragQueryFileW(hDrop, i, w.data(), len + 1);
w.resize(len);
fs::path p(w);
@ -106,7 +117,26 @@ LRESULT CQueueListView::OnDropFiles(UINT, WPARAM wparam, LPARAM)
}
}
DragFinish(hDrop);
::DragFinish(hDrop);
// Notify the main frame to update status bar.
GetAncestor().PostMessage(WM_COMMAND, MAKEWPARAM(0, 0), 0);
return 0;
}
LRESULT CQueueListView::OnNotifyReflect(WPARAM, LPARAM lparam)
{
LPNMHDR pnm = reinterpret_cast<LPNMHDR>(lparam);
if (pnm->code == NM_CLICK) {
LPNMITEMACTIVATE pia = reinterpret_cast<LPNMITEMACTIVATE>(lparam);
if (pia->iItem >= 0)
GetAncestor().SendMessage(UWM_QUEUE_ITEM_CLICKED, (WPARAM)pia->iItem, 0);
} else if (pnm->code == LVN_ITEMCHANGED) {
LPNMLISTVIEW plv = reinterpret_cast<LPNMLISTVIEW>(lparam);
if (plv->iItem >= 0 && (plv->uChanged & LVIF_STATE) &&
(plv->uNewState & LVIS_SELECTED) && !(plv->uOldState & LVIS_SELECTED))
GetAncestor().SendMessage(UWM_QUEUE_ITEM_CLICKED, (WPARAM)plv->iItem, 0);
}
return 0;
}

View File

@ -23,7 +23,9 @@ public:
CString GetItemPath(int item);
protected:
virtual void OnAttach() override;
virtual void OnAttach() override;
virtual void PreCreate(CREATESTRUCT& cs) override;
virtual LRESULT OnNotifyReflect(WPARAM wparam, LPARAM lparam) override;
virtual LRESULT WndProc(UINT msg, WPARAM wparam, LPARAM lparam) override;
private:

View File

@ -35,7 +35,7 @@ STDMETHODIMP CMainFrame::Execute(UINT32 cmdID, UI_EXECUTIONVERB verb,
case IDC_CMD_ADD_FILES: OnAddFiles(); break;
case IDC_CMD_ADD_FOLDER: OnAddFolder(); break;
case IDC_CMD_CLEAR: OnClearQueue(); break;
case IDC_CMD_PROCESS: OnProcess(); break;
case IDC_CMD_RESIZE: OnResize(); break;
case IDC_CMD_ABOUT: OnHelp(); break;
case IDC_CMD_EXIT: OnExit(); break;
case IDC_RIBBONHELP: OnHelp(); break;
@ -72,7 +72,7 @@ BOOL CMainFrame::OnCommand(WPARAM wparam, LPARAM)
case IDM_ADD_FILES: OnAddFiles(); return TRUE;
case IDM_ADD_FOLDER: OnAddFolder(); return TRUE;
case IDM_CLEAR_QUEUE: OnClearQueue(); return TRUE;
case IDM_PROCESS: OnProcess(); return TRUE;
case IDM_RESIZE: OnResize(); return TRUE;
case IDM_EXIT: OnExit(); return TRUE;
case IDM_ABOUT: return OnHelp();
case IDW_VIEW_STATUSBAR: return OnViewStatusBar();
@ -83,7 +83,7 @@ BOOL CMainFrame::OnCommand(WPARAM wparam, LPARAM)
BOOL CMainFrame::OnHelp()
{
::MessageBox(GetHwnd(), L"pm-image resize & transform\nWin32++ UI",
::MessageBox(GetHwnd(), L"pm-image \u2014 resize & transform\nWin32++ UI",
L"About pm-image", MB_ICONINFORMATION | MB_OK);
return TRUE;
}
@ -93,7 +93,7 @@ void CMainFrame::OnInitialUpdate()
DWORD style = DS_CLIENTEDGE;
auto pDockQ = AddDockedChild(std::make_unique<CDockQueue>(),
DS_DOCKED_BOTTOM | style, DpiScaleInt(280));
DS_DOCKED_BOTTOM | style, DpiScaleInt(220));
m_pDockQueue = static_cast<CDockQueue*>(pDockQ);
m_pDockQueue->GetQueueContainer().SetHideSingleTab(TRUE);
@ -109,11 +109,8 @@ void CMainFrame::OnInitialUpdate()
void CMainFrame::SetupToolBar()
{
AddToolBarButton(IDM_ADD_FILES);
AddToolBarButton(IDM_ADD_FOLDER);
AddToolBarButton(0);
AddToolBarButton(IDM_PROCESS);
AddToolBarButton(IDM_CLEAR_QUEUE);
// Toolbar is unused — the ribbon provides all commands.
// Leaving this empty avoids the IDW_MAIN BITMAP resource requirement.
}
void CMainFrame::OnAddFiles()
@ -161,6 +158,9 @@ void CMainFrame::AddFilesToQueue(const std::vector<std::wstring>& paths)
if (!m_pDockQueue) return;
auto& lv = m_pDockQueue->GetQueueContainer().GetListView();
bool firstAdded = (lv.QueueCount() == 0);
int firstNewIdx = lv.QueueCount();
for (auto& p : paths) {
std::error_code ec;
fs::path fp(p);
@ -184,17 +184,23 @@ void CMainFrame::AddFilesToQueue(const std::vector<std::wstring>& paths)
CString status;
status.Format(L"%d file(s) in queue", lv.QueueCount());
GetStatusBar().SetPartText(0, status);
if (firstAdded && lv.QueueCount() > 0) {
CString firstPath = lv.GetItemPath(firstNewIdx);
m_view.LoadPicture(firstPath.c_str());
}
}
void CMainFrame::OnClearQueue()
{
if (m_pDockQueue) {
m_pDockQueue->GetQueueContainer().GetListView().ClearAll();
m_view.ClearPicture();
GetStatusBar().SetPartText(0, L"Queue cleared.");
}
}
void CMainFrame::OnProcess()
void CMainFrame::OnResize()
{
if (m_processing) {
::MessageBox(GetHwnd(), L"Already processing.", L"pm-image", MB_ICONWARNING);
@ -205,7 +211,7 @@ void CMainFrame::OnProcess()
auto& lv = m_pDockQueue->GetQueueContainer().GetListView();
int count = lv.QueueCount();
if (count == 0) {
::MessageBox(GetHwnd(), L"Queue is empty drop files first.", L"pm-image", MB_ICONINFORMATION);
::MessageBox(GetHwnd(), L"Queue is empty \u2014 drop files first.", L"pm-image", MB_ICONINFORMATION);
return;
}
@ -213,7 +219,6 @@ void CMainFrame::OnProcess()
std::string out_dir;
m_pDockSettings->GetSettingsContainer().GetSettingsView().ReadOptions(opt, out_dir);
// Gather paths
std::vector<std::pair<int, std::string>> items;
items.reserve(count);
for (int i = 0; i < count; ++i) {
@ -248,7 +253,7 @@ void CMainFrame::OnProcess()
});
m_worker.detach();
GetStatusBar().SetPartText(0, L"Processing…");
GetStatusBar().SetPartText(0, L"Resizing\u2026");
}
void CMainFrame::OnExit()
@ -272,11 +277,11 @@ LRESULT CMainFrame::OnQueueProgress(WPARAM wparam, LPARAM lparam)
int idx = static_cast<int>(wparam);
int state = static_cast<int>(lparam);
if (state == 1)
lv.SetItemStatus(idx, L"Processing…");
lv.SetItemStatus(idx, L"Resizing\u2026");
else if (state == 2)
lv.SetItemStatus(idx, L"Done");
lv.SetItemStatus(idx, L"\u2713 Done");
else
lv.SetItemStatus(idx, L"Error");
lv.SetItemStatus(idx, L"\u2717 Error");
return 0;
}
@ -299,7 +304,16 @@ LRESULT CMainFrame::WndProc(UINT msg, WPARAM wparam, LPARAM lparam)
switch (msg) {
case WM_GETMINMAXINFO: return OnGetMinMaxInfo(msg, wparam, lparam);
case UWM_QUEUE_PROGRESS: return OnQueueProgress(wparam, lparam);
case UWM_QUEUE_DONE: return OnQueueDone(wparam, lparam);
case UWM_QUEUE_DONE: return OnQueueDone(wparam, lparam);
case UWM_QUEUE_ITEM_CLICKED: {
int idx = static_cast<int>(wparam);
if (m_pDockQueue) {
CString path = m_pDockQueue->GetQueueContainer().GetListView().GetItemPath(idx);
if (!path.IsEmpty())
m_view.LoadPicture(path.c_str());
}
return 0;
}
case WM_DROPFILES: {
HDROP hDrop = reinterpret_cast<HDROP>(wparam);
UINT count = DragQueryFileW(hDrop, 0xFFFFFFFF, nullptr, 0);

View File

@ -31,14 +31,14 @@ private:
void OnAddFiles();
void OnAddFolder();
void OnClearQueue();
void OnProcess();
void OnResize();
void OnExit();
LRESULT OnGetMinMaxInfo(UINT msg, WPARAM wparam, LPARAM lparam);
LRESULT OnQueueProgress(WPARAM wparam, LPARAM lparam);
LRESULT OnQueueDone(WPARAM wparam, LPARAM lparam);
CDropView m_view;
CImagePreview m_view;
IUIRibbon* m_pIUIRibbon = nullptr;
CDockQueue* m_pDockQueue = nullptr;
CDockSettings* m_pDockSettings = nullptr;

View File

@ -5,7 +5,7 @@
#include "RibbonUI.h"
// Menu fallback IDs (when ribbon is unavailable)
#define IDM_PROCESS 200
#define IDM_RESIZE 200
#define IDM_CLEAR_QUEUE 201
#define IDM_ADD_FILES 202
#define IDM_ADD_FOLDER 203
@ -13,23 +13,6 @@
#define IDM_EXIT 205
#define IDM_ABOUT 206
// Ribbon command IDs (must match Ribbon.xml Symbol= values)
#define IDC_CMD_PROCESS 300
#define IDC_CMD_CLEAR 301
#define IDC_CMD_ADD_FILES 302
#define IDC_CMD_ADD_FOLDER 303
#define IDC_CMD_EXIT 304
#define IDC_CMD_ABOUT 305
// Ribbon tabs/groups
#define IDC_TAB_HOME 400
#define IDC_GROUP_QUEUE 401
#define IDC_GROUP_ACTIONS 402
// Dock / container
#define IDI_QUEUE 500
#define IDB_QUEUE 501
// Settings controls (for settings dock)
#define IDC_COMBO_PRESET_OUT 600
#define IDC_EDIT_OUT_DIR 601
@ -42,13 +25,10 @@
#define IDC_CHK_AUTOROT 608
#define IDC_CHK_STRIP 609
// Ribbon misc
#define IDC_RIBBONHELP 700
#define IDC_QAT 701
#define IDC_CUSTOMIZE_QAT 702
// User messages
#define UWM_QUEUE_PROGRESS (WM_USER + 100)
#define UWM_QUEUE_DONE (WM_USER + 101)
#define UWM_IMAGELOADED (WM_USER + 102)
#define UWM_QUEUE_ITEM_CLICKED (WM_USER + 103)
#endif // PM_UI_RESOURCE_H

View File

@ -22,7 +22,7 @@ BEGIN
END
POPUP "&Actions"
BEGIN
MENUITEM "&Process\tF5", IDM_PROCESS
MENUITEM "&Resize\tF5", IDM_RESIZE
MENUITEM "&Clear Queue", IDM_CLEAR_QUEUE
END
POPUP "&Help"
@ -48,7 +48,7 @@ END
// Accelerators
IDW_MAIN ACCELERATORS
BEGIN
VK_F5, IDM_PROCESS, VIRTKEY, NOINVERT
VK_F5, IDM_RESIZE, VIRTKEY, NOINVERT
END
// String table

View File

@ -26,21 +26,42 @@
<Command.LabelTitle>
<String Id="3021">Add Files</String>
</Command.LabelTitle>
<Command.LargeImages>
<Image Id="3022">res/AddFilesL.bmp</Image>
</Command.LargeImages>
<Command.SmallImages>
<Image Id="3023">res/AddFilesS.bmp</Image>
</Command.SmallImages>
</Command>
<Command Name="cmdAddFolder" Symbol="IDC_CMD_ADD_FOLDER" Id="303">
<Command.LabelTitle>
<String Id="3031">Add Folder</String>
</Command.LabelTitle>
<Command.LargeImages>
<Image Id="3032">res/AddFolderL.bmp</Image>
</Command.LargeImages>
<Command.SmallImages>
<Image Id="3033">res/AddFolderS.bmp</Image>
</Command.SmallImages>
</Command>
<Command Name="cmdClear" Symbol="IDC_CMD_CLEAR" Id="301">
<Command.LabelTitle>
<String Id="3011">Clear</String>
</Command.LabelTitle>
<Command.LargeImages>
<Image Id="3012">res/ClearL.bmp</Image>
</Command.LargeImages>
<Command.SmallImages>
<Image Id="3013">res/ClearS.bmp</Image>
</Command.SmallImages>
</Command>
<Command Name="cmdProcess" Symbol="IDC_CMD_PROCESS" Id="300">
<Command Name="cmdResize" Symbol="IDC_CMD_RESIZE" Id="300">
<Command.LabelTitle>
<String Id="3001">Process</String>
<String Id="3001">Resize</String>
</Command.LabelTitle>
<Command.LargeImages>
<Image Id="3002">res/ResizeL.bmp</Image>
</Command.LargeImages>
</Command>
<Command Name="cmdExit" Symbol="IDC_CMD_EXIT" Id="304">
<Command.LabelTitle>
@ -64,7 +85,6 @@
<Application.Views>
<Ribbon>
<!-- Application Menu -->
<Ribbon.ApplicationMenu>
<ApplicationMenu CommandName="cmdAppMenu">
<MenuGroup Class="MajorItems">
@ -80,7 +100,6 @@
</ApplicationMenu>
</Ribbon.ApplicationMenu>
<!-- Tabs -->
<Ribbon.Tabs>
<Tab CommandName="cmdTabHome">
<Tab.ScalingPolicy>
@ -99,21 +118,19 @@
<Button CommandName="cmdClear" />
</Group>
<Group CommandName="cmdGroupActions" SizeDefinition="OneButton">
<Button CommandName="cmdProcess" />
<Button CommandName="cmdResize" />
</Group>
</Tab>
</Ribbon.Tabs>
<!-- Help button -->
<Ribbon.HelpButton>
<HelpButton CommandName="cmdHelp" />
</Ribbon.HelpButton>
<!-- Quick Access toolbar -->
<Ribbon.QuickAccessToolbar>
<QuickAccessToolbar CommandName="cmdQAT" CustomizeCommandName="cmdCustomizeQAT">
<QuickAccessToolbar.ApplicationDefaults>
<Button CommandName="cmdProcess" ApplicationDefaults.IsChecked="true" />
<Button CommandName="cmdResize" ApplicationDefaults.IsChecked="true" />
</QuickAccessToolbar.ApplicationDefaults>
</QuickAccessToolbar>
</Ribbon.QuickAccessToolbar>

View File

@ -13,12 +13,19 @@
#define cmdGroupActions_LabelTitle_RESID 4021
#define IDC_CMD_ADD_FILES 302
#define IDC_CMD_ADD_FILES_LabelTitle_RESID 3021
#define IDC_CMD_ADD_FILES_SmallImages_RESID 3023
#define IDC_CMD_ADD_FILES_LargeImages_RESID 3022
#define IDC_CMD_ADD_FOLDER 303
#define IDC_CMD_ADD_FOLDER_LabelTitle_RESID 3031
#define IDC_CMD_ADD_FOLDER_SmallImages_RESID 3033
#define IDC_CMD_ADD_FOLDER_LargeImages_RESID 3032
#define IDC_CMD_CLEAR 301
#define IDC_CMD_CLEAR_LabelTitle_RESID 3011
#define IDC_CMD_PROCESS 300
#define IDC_CMD_PROCESS_LabelTitle_RESID 3001
#define IDC_CMD_CLEAR_SmallImages_RESID 3013
#define IDC_CMD_CLEAR_LargeImages_RESID 3012
#define IDC_CMD_RESIZE 300
#define IDC_CMD_RESIZE_LabelTitle_RESID 3001
#define IDC_CMD_RESIZE_LargeImages_RESID 3002
#define IDC_CMD_EXIT 304
#define IDC_CMD_EXIT_LabelTitle_RESID 3041
#define IDC_CMD_ABOUT 305

View File

@ -25,21 +25,28 @@ BEGIN
IDC_CMD_ADD_FILES_LabelTitle_RESID L"Add Files" /* LabelTitle IDC_CMD_ADD_FILES_LabelTitle_RESID: (null) */
END
IDC_CMD_ADD_FILES_SmallImages_RESID BITMAP "res\\AddFilesS.bmp" /* SmallImages IDC_CMD_ADD_FILES_SmallImages_RESID: (null) */
IDC_CMD_ADD_FILES_LargeImages_RESID BITMAP "res\\AddFilesL.bmp" /* LargeImages IDC_CMD_ADD_FILES_LargeImages_RESID: (null) */
STRINGTABLE
BEGIN
IDC_CMD_ADD_FOLDER_LabelTitle_RESID L"Add Folder" /* LabelTitle IDC_CMD_ADD_FOLDER_LabelTitle_RESID: (null) */
END
IDC_CMD_ADD_FOLDER_SmallImages_RESID BITMAP "res\\AddFolderS.bmp" /* SmallImages IDC_CMD_ADD_FOLDER_SmallImages_RESID: (null) */
IDC_CMD_ADD_FOLDER_LargeImages_RESID BITMAP "res\\AddFolderL.bmp" /* LargeImages IDC_CMD_ADD_FOLDER_LargeImages_RESID: (null) */
STRINGTABLE
BEGIN
IDC_CMD_CLEAR_LabelTitle_RESID L"Clear" /* LabelTitle IDC_CMD_CLEAR_LabelTitle_RESID: (null) */
END
IDC_CMD_CLEAR_SmallImages_RESID BITMAP "res\\ClearS.bmp" /* SmallImages IDC_CMD_CLEAR_SmallImages_RESID: (null) */
IDC_CMD_CLEAR_LargeImages_RESID BITMAP "res\\ClearL.bmp" /* LargeImages IDC_CMD_CLEAR_LargeImages_RESID: (null) */
STRINGTABLE
BEGIN
IDC_CMD_PROCESS_LabelTitle_RESID L"Process" /* LabelTitle IDC_CMD_PROCESS_LabelTitle_RESID: (null) */
IDC_CMD_RESIZE_LabelTitle_RESID L"Resize" /* LabelTitle IDC_CMD_RESIZE_LabelTitle_RESID: (null) */
END
IDC_CMD_RESIZE_LargeImages_RESID BITMAP "res\\ResizeL.bmp" /* LargeImages IDC_CMD_RESIZE_LargeImages_RESID: (null) */
STRINGTABLE
BEGIN
IDC_CMD_EXIT_LabelTitle_RESID L"Exit" /* LabelTitle IDC_CMD_EXIT_LabelTitle_RESID: (null) */

View File

@ -34,9 +34,19 @@ static std::wstring get_edit_text(HWND h) {
// CSettingsView
//////////////////////////////////////////
static BOOL CALLBACK SetChildFont(HWND hwnd, LPARAM lparam)
{
::SendMessageW(hwnd, WM_SETFONT, (WPARAM)lparam, TRUE);
return TRUE;
}
int CSettingsView::OnCreate(CREATESTRUCT&)
{
CreateControls();
HFONT hFont = static_cast<HFONT>(::GetStockObject(DEFAULT_GUI_FONT));
EnumChildWindows(GetHwnd(), SetChildFont, (LPARAM)hFont);
return 0;
}

View File

@ -0,0 +1,45 @@
Add-Type -AssemblyName System.Drawing
function Convert-PngToBmp {
param([string]$pngPath, [string]$bmpPath, [int]$targetSize)
if (-not (Test-Path $pngPath)) {
Write-Warning "Missing: $pngPath"
return
}
$src = [System.Drawing.Bitmap]::FromFile($pngPath)
$bmp = New-Object System.Drawing.Bitmap($targetSize, $targetSize, [System.Drawing.Imaging.PixelFormat]::Format32bppArgb)
$g = [System.Drawing.Graphics]::FromImage($bmp)
$g.InterpolationMode = [System.Drawing.Drawing2D.InterpolationMode]::HighQualityBicubic
$g.SmoothingMode = [System.Drawing.Drawing2D.SmoothingMode]::AntiAlias
$g.Clear([System.Drawing.Color]::Transparent)
$g.DrawImage($src, 0, 0, $targetSize, $targetSize)
$g.Dispose()
$src.Dispose()
$bmp.Save($bmpPath, [System.Drawing.Imaging.ImageFormat]::Bmp)
$bmp.Dispose()
Write-Output " $bmpPath"
}
$resDir = $PSScriptRoot + '\res'
Write-Output "Converting icons from famfamfam silk set..."
# Add Files -> image_add.png
Convert-PngToBmp "$resDir\32x32_0500\image_add.png" "$resDir\AddFilesL.bmp" 32
Convert-PngToBmp "$resDir\16x16_0500\image_add.png" "$resDir\AddFilesS.bmp" 16
# Add Folder -> folder_add.png
Convert-PngToBmp "$resDir\32x32_0440\folder_add.png" "$resDir\AddFolderL.bmp" 32
Convert-PngToBmp "$resDir\16x16_0440\folder_add.png" "$resDir\AddFolderS.bmp" 16
# Clear -> cross.png
Convert-PngToBmp "$resDir\32x32_0300\cross.png" "$resDir\ClearL.bmp" 32
Convert-PngToBmp "$resDir\16x16_0300\cross.png" "$resDir\ClearS.bmp" 16
# Resize -> arrow_out.png
Convert-PngToBmp "$resDir\32x32_0060\arrow_out.png" "$resDir\ResizeL.bmp" 32
Write-Output "Done."

Binary file not shown.

After

Width:  |  Height:  |  Size: 448 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 427 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 449 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 500 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 311 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 324 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 413 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 453 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 792 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 663 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 678 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 692 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 725 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 712 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 698 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 831 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 584 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 535 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 534 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 671 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 657 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 525 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 688 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 689 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 759 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 713 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 641 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 664 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 623 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 663 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 655 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 599 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 468 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 575 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 650 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 483 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 649 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 643 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 538 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 522 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 394 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 422 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 369 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 564 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 587 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 628 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 588 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 554 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 603 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 494 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 538 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 655 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 651 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 381 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 593 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 570 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 556 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 371 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 508 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 632 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 661 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 674 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 558 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 363 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 741 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 741 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 804 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 565 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 558 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

Some files were not shown because too many files have changed in this diff Show More