-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLayerManager.h
More file actions
60 lines (49 loc) · 1.63 KB
/
Copy pathLayerManager.h
File metadata and controls
60 lines (49 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// =============================================================================
// LayerManager.h ── 图层管理器声明
// 放置在画布左侧,显示所有曲线图层
// =============================================================================
#pragma once
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include <windows.h>
#include <string>
#include <vector>
class Canvas;
class LayerManager
{
public:
LayerManager(HWND parent, Canvas* canvas);
~LayerManager();
void Resize(int x, int y, int w, int h);
void UpdateFromCanvas();
HWND GetHWND() const { return m_hwnd; }
private:
static LRESULT CALLBACK PanelProc(HWND, UINT, WPARAM, LPARAM);
LRESULT HandleMsg(UINT, WPARAM, LPARAM);
void CreateControls();
void LayoutControls(int w, int h);
// 图层项区域计算
int GetItemY(int index) const;
int GetItemCount() const;
int HitTestItem(int mouseY) const;
int HitTestIcon(int mouseX, int mouseY, int itemIdx) const;
// 返回值: 0=visibility, 1=lock, -1=无
HWND m_hwnd = nullptr;
HWND m_parent = nullptr;
Canvas* m_canvas = nullptr;
// 控件
HWND m_titleLabel = nullptr;
HWND m_addBtn = nullptr;
HWND m_delBtn = nullptr;
HWND m_upBtn = nullptr;
HWND m_downBtn = nullptr;
// 主题色
HBRUSH m_bgBrush = nullptr;
HBRUSH m_selBrush = nullptr;
HBRUSH m_itemBgBrush = nullptr;
HFONT m_font = nullptr;
HFONT m_smallFont = nullptr;
// 布局基准常量(实际运行时由 g_dpiScale 缩放)
// 设计基准: ITEM_H=32, ICON_SIZE=20, COLOR_SQ=16, BTN_H=26
};