@@ -70,15 +70,15 @@ BOOL ce::Button::create(HWND hwnd_p, LPTSTR name, LPTSTR desc, int ic_or_str, LP
70
70
// ---------------------------------------------------------------------
71
71
void ce::Button::draw (COLORREF bg, LPRECT rect_wnd, LPTSTR content)
72
72
{
73
- d2d_setup (&canvas , rect_wnd, TO_BGR (bg));
73
+ d2d_setup (&bitmap_buffer , rect_wnd, TO_BGR (bg));
74
74
75
- ::SetBkColor (canvas .hdc_memory, bg);
75
+ ::SetBkColor (bitmap_buffer .hdc_memory, bg);
76
76
77
77
// 文字列を描画
78
78
if (icon_or_str == 1 ) {
79
- ::SelectObject (canvas .hdc_memory, font);
79
+ ::SelectObject (bitmap_buffer .hdc_memory, font);
80
80
::DrawText (
81
- canvas .hdc_memory,
81
+ bitmap_buffer .hdc_memory,
82
82
content,
83
83
strlen (content),
84
84
rect_wnd,
@@ -89,7 +89,7 @@ void ce::Button::draw(COLORREF bg, LPRECT rect_wnd, LPTSTR content)
89
89
// アイコンを描画
90
90
else {
91
91
::DrawIcon (
92
- canvas .hdc_memory,
92
+ bitmap_buffer .hdc_memory,
93
93
(rect_wnd->right - CE_ICON_SIZE) / 2,
94
94
(rect_wnd->bottom - CE_ICON_SIZE) / 2,
95
95
g_config.theme ? icon_light : icon_dark
@@ -104,7 +104,7 @@ void ce::Button::draw(COLORREF bg, LPRECT rect_wnd, LPTSTR content)
104
104
g_render_target->EndDraw ();
105
105
}
106
106
107
- canvas .transfer (rect_wnd);
107
+ bitmap_buffer .transfer (rect_wnd);
108
108
}
109
109
110
110
@@ -120,7 +120,7 @@ LRESULT ce::Button::wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
120
120
121
121
switch (msg) {
122
122
case WM_CREATE:
123
- canvas .init (hwnd);
123
+ bitmap_buffer .init (hwnd);
124
124
125
125
if (icon_or_str == 0 ) {
126
126
icon_dark = ::LoadIcon (g_fp->dll_hinst , icon_res_dark);
@@ -163,7 +163,7 @@ LRESULT ce::Button::wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
163
163
return 0 ;
164
164
165
165
case WM_CLOSE:
166
- canvas .exit ();
166
+ bitmap_buffer .exit ();
167
167
return 0 ;
168
168
169
169
case WM_SIZE:
@@ -185,7 +185,7 @@ LRESULT ce::Button::wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
185
185
else
186
186
bg = g_theme[g_config.theme ].bg ;
187
187
188
- ::SetTextColor (canvas .hdc_memory, g_theme[g_config.theme].bt_tx);
188
+ ::SetTextColor (bitmap_buffer .hdc_memory, g_theme[g_config.theme].bt_tx);
189
189
190
190
draw (bg, &rect_wnd, label);
191
191
return 0 ;
@@ -264,7 +264,7 @@ LRESULT ce::Button_Switch::wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lp
264
264
else
265
265
bg = g_theme[g_config.theme ].bt_selected ;
266
266
267
- ::SetTextColor (canvas .hdc_memory, g_theme[g_config.theme].bt_tx_selected);
267
+ ::SetTextColor (bitmap_buffer .hdc_memory, g_theme[g_config.theme].bt_tx_selected);
268
268
}
269
269
// 非選択時
270
270
else {
@@ -275,7 +275,7 @@ LRESULT ce::Button_Switch::wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lp
275
275
else
276
276
bg = g_theme[g_config.theme ].bt_unselected ;
277
277
278
- ::SetTextColor (canvas .hdc_memory, g_theme[g_config.theme].bt_tx);
278
+ ::SetTextColor (bitmap_buffer .hdc_memory, g_theme[g_config.theme].bt_tx);
279
279
}
280
280
281
281
draw (bg, &rect_wnd, label);
@@ -311,6 +311,42 @@ void ce::Button_Switch::set_status(BOOL bl)
311
311
312
312
313
313
314
+ // ---------------------------------------------------------------------
315
+ // ウィンドウプロシージャ(Value)
316
+ // ---------------------------------------------------------------------
317
+ LRESULT ce::Button_Value::wndproc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
318
+ {
319
+ RECT rect_wnd;
320
+
321
+ ::GetClientRect (hwnd, &rect_wnd);
322
+
323
+ switch (msg) {
324
+ case WM_PAINT:
325
+ {
326
+ COLORREF bg;
327
+ std::string str_value_4d = g_curve_value.create_value_4d ();
328
+ LPTSTR value_4d = const_cast <LPTSTR>(str_value_4d.c_str ());
329
+
330
+ if (clicked)
331
+ bg = BRIGHTEN (g_theme[g_config.theme ].bg , CE_CT_BR_CLICKED);
332
+ else if (hovered)
333
+ bg = BRIGHTEN (g_theme[g_config.theme ].bg , CE_CT_BR_HOVERED);
334
+ else
335
+ bg = g_theme[g_config.theme ].bg ;
336
+
337
+ ::SetTextColor (bitmap_buffer.hdc_memory, g_theme[g_config.theme].bt_tx);
338
+
339
+ draw (bg, &rect_wnd, value_4d);
340
+ return 0 ;
341
+ }
342
+
343
+ default :
344
+ return Button::wndproc (hwnd, msg, wparam, lparam);
345
+ }
346
+ }
347
+
348
+
349
+
314
350
// ---------------------------------------------------------------------
315
351
// ウィンドウプロシージャ(ID)
316
352
// ---------------------------------------------------------------------
@@ -335,7 +371,7 @@ LRESULT ce::Button_ID::wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam
335
371
else
336
372
bg = g_theme[g_config.theme ].bg ;
337
373
338
- ::SetTextColor (canvas .hdc_memory, g_theme[g_config.theme].bt_tx);
374
+ ::SetTextColor (bitmap_buffer .hdc_memory, g_theme[g_config.theme].bt_tx);
339
375
340
376
draw (bg, &rect_wnd, id_text);
341
377
return 0 ;
0 commit comments