TNB Library
TnbMfcCustomWindowFrame.h
[詳解]
1#pragma once
12#include "TnbBitmapBankDrawer.h"
14#include "TnbTextDrawer.h"
15#include "TnbMfcDrawingMenu.h"
16#include "TnbHandleHandle.h"
17#include "TnbFontHandle.h"
19
20
21
22//TNB Library
23namespace TNB {
24namespace MFC {
25
26
27
28#ifndef _TnbDOXYGEN //Document作成用シンボル
29 #ifndef WM_NCMOUSELEAVE
30 #define WM_NCMOUSELEAVE 0x02A2
31 #endif
32 #ifndef TME_NONCLIENT
33 #define TME_NONCLIENT 0x10
34 #endif
35#endif
36
37
38
52{
53 DEFSUPER(CNullDrawer);
54public:
55
60 CWindowCaptionDrawer(HWND hWnd) : m_hWnd(hWnd), m_nWidthEllipse(5), m_nHeightEllipse(5)
61 , m_barColor(::GetSysColor(COLOR_ACTIVECAPTION)), m_naBarColor(::GetSysColor(COLOR_INACTIVECAPTION))
62 , m_textColor(::GetSysColor(COLOR_CAPTIONTEXT)), m_naTextColor(::GetSysColor(COLOR_INACTIVECAPTIONTEXT))
63 {
64 }
65
72 void SetBarColor(COLORREF c1, COLORREF c2)
73 {
74 m_barColor = c1;
75 m_naBarColor = c2;
76 }
77
84 void SetTextColor(COLORREF c1, COLORREF c2)
85 {
86 m_textColor = c1;
87 m_naTextColor = c2;
88 }
89
95 void SetBarEllipse(int widthEllipse = 5, int heightEllipse = 5)
96 {
97 m_nWidthEllipse = widthEllipse;
98 m_nHeightEllipse = heightEllipse;
99 }
100
106 virtual IDrawable* Clone(void) const
107 {
108 return new CWindowCaptionDrawer(*this);
109 }
110
120 virtual void DrawEx(HDC dc, int x, int y, LPARAM lParam) const
121 {
122 HWND hWnd = ::WindowFromDC(dc);
123 if ( hWnd != NULL )
124 {
125 m_hWnd = hWnd;
126 }
127 // バー
128 {
129 COLORREF c1 = (lParam == 0) ? m_barColor : m_naBarColor;
130 CBitmapImage bi;
131 bi.Set(m_size.cx, m_size.cy, c1);
132 CBitmapImage mb;
133 mb.Set(m_size.cx, m_size.cy);
134 mb.GradationFill(RGB(255, 255, 255), 0, true);
135 bi.CustomizeAlpha(mb);
136 if ( m_nWidthEllipse > 0 || m_nHeightEllipse > 0 )
137 {
138 HRGN rgn = ::CreateRoundRectRgn(x, y, x + m_size.cx, y + m_size.cy, m_nWidthEllipse, m_nHeightEllipse);
139 ::SelectClipRgn(dc, rgn);
140 bi.SemitransparectBlt(dc, x, y, -1, CLR_INVALID);
141 ::SelectClipRgn(dc, NULL);
142 _DeleteObject(rgn);
143 }
144 else
145 {
146 bi.SemitransparectBlt(dc, x, y, -1, CLR_INVALID);
147 }
148 }
149 // アイコン
150 HICON icon = reinterpret_cast<HICON>(::SendMessage(m_hWnd, WM_GETICON, 0, 0));
151 if ( icon != NULL )
152 {
153// ::DrawIconEx(dc, x + 2, (m_size.cy - 16) / 2 + y, icon, CalcScaleX(16, dc), CalcScaleY(16, dc), 0, 0, DI_NORMAL);
154 ::DrawIconEx(dc, x + 2, y + 1, icon, CalcScaleX(16, dc), CalcScaleY(16, dc), 0, 0, DI_NORMAL);
155 x += CalcScaleX(16 + 5, dc);
156 }
157 else
158 {
159 x += 2;
160 }
161 // 文字
162 CWorkMemT<TCHAR> w(256);
163 ::GetWindowText(m_hWnd, w.Ref(), 256);
164 if ( m_hFont.IsNull() )
165 {
166 VERIFY( m_hFont.SetSystemCaptionFont() );
167 }
168 RECT rc = { x, y, x + m_size.cx, y + m_size.cy };
169 COLORREF color = (lParam == 0) ? m_textColor : m_naTextColor;
170 //
171 CDcSelectAssistant dca(dc);
172 dca.SetBkMode(TRANSPARENT);
173 dca.SelectFont(m_hFont);
174 CTextDrawer::DrawTextRect(dc, rc, DT_LEFT | DT_VCENTER, color, w);
175 }
176
177private:
178 mutable HWND m_hWnd;
179 mutable CFontHandle m_hFont;
180 COLORREF m_barColor;
181 COLORREF m_naBarColor;
182 COLORREF m_textColor;
183 COLORREF m_naTextColor;
184 int m_nWidthEllipse;
185 int m_nHeightEllipse;
186};
187
188
189
240{
242public:
243
246 : m_pressedButton(BK_Nothing), m_transColor(CLR_INVALID), m_hNcRgn(NULL)
247 , m_isActive(true), m_boHasHover(false), m_isInit(false), m_isInitWindowRgn(true), m_canMenuCheck(true)
248 , m_frameWidths(0, 0, 0, 0), m_titleRect(0, 0, 0, 0), m_titleHeight(0), m_isEvenBackGround(false)
249 , m_textColor(CLR_INVALID), m_isMenuInit(false), m_isNcResized(false)
250 {
251 }
252
255 {
256 if ( m_hNcRgn != NULL )
257 {
258 _DeleteObject(m_hNcRgn);
259 m_hNcRgn = NULL;
260 }
261 }
262
268 {
269 CBitmapBorderDrawer bbd(bmp);
270 m_backGround[0] = ::CreatePatternBrush(bbd.GetParts(5)); //中央
271 m_backGround[1] = ::CreatePatternBrush(bbd.GetParts(5)); //中央
272 m_isEvenBackGround = true;
273 m_pFrameDrawer = bbd.Clone();
274 }
275
282 {
283 CBitmapBorderDrawer bbd1(bmp1);
284 CBitmapBorderDrawer bbd2(bmp2);
285 m_backGround[0] = ::CreatePatternBrush(bbd1.GetParts(5)); //中央
286 m_backGround[1] = ::CreatePatternBrush(bbd2.GetParts(5)); //中央
287 m_isEvenBackGround = false;
288 CBankDrawer db;
289 m_pFrameDrawer = db.Add(bbd1).Add(bbd2).Clone();
290 }
291
298 {
299 m_backGround[0] = ::CreatePatternBrush(bmp);
300 m_backGround[1] = ::CreatePatternBrush(bmp);
301 m_isEvenBackGround = true;
302 m_pFrameDrawer = draw.Clone();
303 }
304
311 void SetFrameTransColor(COLORREF color = CLR_AUTOSELECT)
312 {
313 m_transColor = color;
314 }
315
322 void SetTitleBitmap(const IDrawable& draw)
323 {
324 m_pTitleDrawer = draw.Clone();
325 }
326
334 void SetFrameWidths(const RECT& frameWidths, int titleHeight = -1)
335 {
336 if ( titleHeight <= 0 )
337 {
338 titleHeight = ::GetSystemMetrics(SM_CYCAPTION);
339 }
340 ::SetRect(&m_titleRect, frameWidths.left, frameWidths.top, 0, frameWidths.top + titleHeight);
341 m_titleHeight = titleHeight;
342 m_frameWidths = frameWidths;
343 m_frameWidths.top += titleHeight;
344 }
345
353 void SetFrameWidths(int frameWidth = -1, int titleHeight = -1)
354 {
355 RECT rc;
356 if ( frameWidth >= 0 )
357 {
358 ::SetRect(&rc, frameWidth, frameWidth, frameWidth, frameWidth);
359 }
360 else
361 {
362 ::SetRectEmpty(&rc);
363 }
364 SetFrameWidths(rc, titleHeight);
365 }
366
374 void SetCloseButtonBitmap(const POINT& pos, CBitmapHandle bmp, int num = 4, COLORREF color = CLR_INVALID)
375 {
376 CBitmapBankDrawer bbd(bmp, num, color);
377 m_button[BK_Close].SetDrawer(pos, bbd, HTCLOSE, SC_CLOSE);
378 }
379
387 void SetMinimumButtonBitmap(const POINT& pos, CBitmapHandle bmp, int num = 4, COLORREF color = CLR_INVALID)
388 {
389 CBitmapBankDrawer bbd(bmp, num, color);
390 m_button[BK_Minimum].SetDrawer(pos, bbd, HTMINBUTTON, SC_MINIMIZE);
391 }
392
400 void SetMaximumButtonBitmap(const POINT& pos, CBitmapHandle bmp, int num = 4, COLORREF color = CLR_INVALID)
401 {
402 CBitmapBankDrawer bbd(bmp, num, color);
403 m_button[BK_Maximum].SetDrawer(pos, bbd, HTMAXBUTTON, SC_MAXIMIZE);
404 }
405
413 void SetRestoreButtonBitmap(const POINT& pos, CBitmapHandle bmp, int num = 4, COLORREF color = CLR_INVALID)
414 {
415 CBitmapBankDrawer bbd(bmp, num, color);
416 m_button[BK_Restore].SetDrawer(pos, bbd, HTMAXBUTTON, SC_RESTORE);
417 }
418
426 void SetHelpButtonBitmap(const POINT& pos, CBitmapHandle bmp, int num = 4, COLORREF color = CLR_INVALID)
427 {
428 CBitmapBankDrawer bbd(bmp, num, color);
429 m_button[BK_Help].SetDrawer(pos, bbd, HTHELP, SC_CONTEXTHELP);
430 }
431
436 void SetTextColor(COLORREF color)
437 {
438 if ( color == RGB(255, 255, 255) )
439 {
440 color = RGB(255, 255, 254);
441 }
442 m_textColor = color;
443 m_menuBar.SetTextColor(color);
444 }
445
451 HBRUSH GetBackground(bool isActive)
452 {
453 return m_backGround[isActive ? 0 : 1];
454 }
455
462 {
463 m_pFrameDrawer = o.m_pFrameDrawer;
464 m_backGround[0] = o.m_backGround[0];
465 m_backGround[1] = o.m_backGround[1];
466 m_isEvenBackGround = o.m_isEvenBackGround;
467 m_pTitleDrawer.Null();
468 if ( ! o.m_pTitleDrawer.IsNull() )
469 {
470 m_pTitleDrawer = o.m_pTitleDrawer->Clone();
471 }
472 m_textColor = o.m_textColor;
473 m_frameWidths = o.m_frameWidths;
474 m_titleRect = o.m_titleRect;
475 m_titleHeight = o.m_titleHeight;
476 m_transColor = o.m_transColor;
477 loop ( i, BK_Max )
478 {
479 m_button[i] = o.m_button[i];
480 }
481 m_menuBar.CopyParameter(o.m_menuBar);
482 }
483
490 {
491 return m_menuBar;
492 }
493
500 {
501 return m_popupMenu;
502 }
503
504protected:
505
510 virtual void PreAttach(HWND hWnd)
511 {
512 int fx = ::GetSystemMetrics(SM_CXFIXEDFRAME);
513 int fy = ::GetSystemMetrics(SM_CYFIXEDFRAME);
514 int ch = ::GetSystemMetrics(SM_CYCAPTION);
515 DWORD style = ::GetWindowLong(hWnd, GWL_STYLE);
516 if ( (style & WS_THICKFRAME) != 0 )
517 {
518 fx = ::GetSystemMetrics(SM_CXSIZEFRAME);
519 fy = ::GetSystemMetrics(SM_CYSIZEFRAME);
520 }
521 if ( (::GetWindowLong(hWnd, GWL_EXSTYLE) & WS_EX_TOOLWINDOW) != 0 )
522 {
523 ch = ::GetSystemMetrics(SM_CYSMCAPTION);
524 }
525 if ( (style & WS_CAPTION) != WS_CAPTION )
526 {
527 ch = 0;
528 }
529 if ( (style & WS_BORDER) == 0 )
530 {
531 fx = fy = 0;
532 }
533 if ( m_frameWidths.IsRectNull() )
534 {
535 m_frameWidths.SetRect(fx, fy + ch, fx, fy);
536 }
537 if ( m_titleRect.IsRectNull() )
538 {
539 m_titleRect.SetRect(fx, fy, 0, fy + ch);
540 m_titleHeight = ch;
541 }
542 }
543
548 virtual void OnAttached(void)
549 {
550 m_CheckMenu();
551 //
552 if ( ! m_pTitleDrawer.IsNull() )
553 {
554 HDC dc = ::GetWindowDC(m_hWnd);
555 m_pTitleDrawer->DrawEx(dc, 0, 0, 0);
556 ::ReleaseDC(m_hWnd, dc);
557 }
558 CRect rc;
559 ::GetClientRect(m_hWnd, rc);
560 m_windowSize = rc.Size() + CSize(m_frameWidths.left + m_frameWidths.right, m_frameWidths.top + m_frameWidths.bottom);
561 m_menuHeight = 0;
562 MENUBARINFO mbi;
563 mbi.cbSize = sizeof(MENUBARINFO);
564 if ( ::GetMenuBarInfo(m_hWnd, OBJID_MENU, 0, &mbi) )
565 {
566 CRect r = mbi.rcBar;
567 m_menuHeight = r.Height() + 1;
568 m_windowSize.cy += m_menuHeight;
569 }
570 ::SetWindowPos(m_hWnd, NULL, 0, 0, m_windowSize.cx, m_windowSize.cy, SWP_NOMOVE | SWP_NOZORDER | SWP_FRAMECHANGED);
571 //
572 m_isInit = true;
573 }
574
579 virtual void PreDetach(void)
580 {
581 m_menuBar.Detach();
582 }
583
588 virtual void OnDetacted(void)
589 {
590 ::SetWindowPos(m_hWnd, NULL, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_FRAMECHANGED);
591 }
592
593private:
595 enum EButtonKind
596 {
597 BK_Close = 0,
598 BK_Minimum,
599 BK_Maximum,
600 BK_Restore,
601 BK_Help,
602 BK_Nothing,
603 BK_Max = BK_Nothing,
604 };
606 void m_CheckMenu(void)
607 {
608 if ( m_canMenuCheck )
609 {
610 LONG l = ::GetWindowLong(m_hWnd, GWL_STYLE);
611 loop ( i, BK_Max )
612 {
613 m_button[i].SetVisibleMode(false);
614 }
615 if ( (l & WS_SYSMENU) != 0 )
616 {
617 m_button[BK_Close].SetVisibleMode(true);
618 HMENU hMenu = ::GetSystemMenu(m_hWnd, FALSE);
619 UINT state = ::GetMenuState(hMenu, SC_CLOSE, MF_BYCOMMAND);
620 m_button[BK_Close].SetEnableMode((state & (MF_GRAYED | MF_DISABLED)) == 0);
621 if ( (l & WS_MINIMIZEBOX) != 0 )
622 {
623 m_button[BK_Minimum].SetVisibleMode(true);
624 m_button[BK_Minimum].SetEnableMode(true);
625 if ( (l & WS_MAXIMIZEBOX) == 0 )
626 {
627 m_button[BK_Maximum].SetVisibleMode(true);
628 m_button[BK_Maximum].SetEnableMode(false);
629 }
630 }
631 if ( (l & WS_MAXIMIZEBOX) != 0 )
632 {
633 int b = ::IsZoomed(m_hWnd) ? BK_Restore : BK_Maximum;
634 m_button[b].SetVisibleMode(true);
635 if ( (l & WS_MINIMIZEBOX) == 0 )
636 {
637 m_button[BK_Minimum].SetVisibleMode(true);
638 m_button[BK_Minimum].SetEnableMode(false);
639 }
640 }
641 }
642 if ( (l & DS_CONTEXTHELP) != 0 )
643 {
644 m_button[BK_Help].SetVisibleMode(true);
645 }
646 }
647 }
655 void m_OnFramePaint(HDC dc, const CSize& size, const CRect& rect, bool isActive)
656 {
657 CBitmapImage bi;
658 bi.Set(size.cx, size.cy);
659 {
660 HDC dc = bi.GetDC();
661 if ( ! m_pFrameDrawer.IsNull() )
662 {
663 ::SetBrushOrgEx(dc, m_frameWidths.left, m_frameWidths.top, NULL);
664 m_pFrameDrawer->Resize(size);
665 m_pFrameDrawer->DrawEx(dc, 0, 0, ! isActive);
666 }
667 if ( ! m_pTitleDrawer.IsNull() )
668 {
669 m_pTitleDrawer->Resize(rect.Size());
670 m_pTitleDrawer->DrawEx(dc, rect.left, rect.top, ! isActive);
671 }
672 else
673 {
675 t.Resize(rect.Size());
676 t.DrawEx(dc, rect.left, rect.top, ! isActive);
677 }
678 loop ( i, BK_Max )
679 {
680 m_button[i].Draw(dc, m_windowSize);
681 }
682 m_menuBar.Draw(dc);
683 bi.ReleaseDC();
684 }
685 bi.Draw(dc, 0, 0);
686 }
687
694 LRESULT m_OnNcHitTest(LRESULT r, const POINT& pos)
695 {
696 loop ( i, BK_Max )
697 {
698 LRESULT l = m_button[i].HitTest(pos, m_windowSize);
699 if ( l != HTNOWHERE )
700 {
701 return l;
702 }
703 }
704 if ( r == HTSYSMENU )
705 {
706 }
707 else if ( m_titleRect.PtInRect(pos) )
708 {
709 r = HTCAPTION;
710 }
711 else if ( r == HTCAPTION )
712 {
713 r = HTNOWHERE;
714 }
715 else if ( r == HTCLOSE || r == HTMINBUTTON || r == HTMAXBUTTON )
716 {
717 r = HTCAPTION;
718 }
719// TRACE3("OnNcHitTest x=%d, y=%d, r=%d\n", pos.x, pos.y, r);
720 return r;
721 }
722
727 void m_OnNcMouseMove(WPARAM wParam)
728 {
729 bool r = false;
730 if ( m_pressedButton == BK_Nothing )
731 {
732 loop ( i, BK_Max )
733 {
734 r |= m_button[i].SetHoverMode(wParam);
735 }
736 }
737 else
738 {
739 r |= m_button[m_pressedButton].SetPressMode(wParam);
740 r |= m_button[m_pressedButton].SetHoverMode(wParam);
741 }
742 if ( r )
743 {
744 m_NcPaint();
745 }
746 }
747
756 bool m_OnNcButton(UINT message, WPARAM wParam, LPARAM& _lParam)
757 {
758 switch ( message )
759 {
760 case WM_NCLBUTTONDBLCLK:
761 case WM_NCRBUTTONDBLCLK:
762 default:
763 return false;
764 case WM_NCRBUTTONDOWN:
765 case WM_NCRBUTTONUP:
766 if ( wParam == HTCLOSE )
767 {
768 _lParam = MAKELONG(-1, -1);
769 }
770 return false;
771 case WM_NCLBUTTONDOWN:
772 case WM_NCLBUTTONUP:
773 case WM_LBUTTONUP:
774 break;
775 }
776 if ( message == WM_NCLBUTTONUP || message == WM_LBUTTONUP)
777 {
778 if ( m_pressedButton == BK_Nothing )
779 {
780 return false;
781 }
782 EButtonKind b = m_pressedButton;
783 m_SetButtonPressState(BK_Nothing);
784 m_button[b].SetPressMode(false);
785 m_NcPaint();
786 if ( m_button[b].IsHitTest(wParam) )
787 {
788 m_button[b].PostSysCommand(GetSafeHwnd());
789 }
790 return true;
791 }
792 loop ( i, BK_Max )
793 {
794 if ( m_button[i].IsHitTest(wParam) && m_button[i].isEnable() )
795 {
796 m_SetButtonPressState(static_cast<EButtonKind>(i));
797 m_button[i].SetPressMode(true);
798 m_NcPaint();
799 return true;
800 }
801 }
802 return false;
803 }
804
828 void m_OnNcCalcSize(bool boCalcValidRects, NCCALCSIZE_PARAMS* pParams)
829 {
830 if ( pParams->lppos == NULL || ! boCalcValidRects )
831 {
832 return;
833 }
834 CPoint po(pParams->lppos->x, pParams->lppos->y);
835 CRect rc(CPoint(0, 0), CSize(pParams->lppos->cx, pParams->lppos->cy));
836 rc.DeflateRect(m_frameWidths);
837 MENUBARINFO mbi = { sizeof(MENUBARINFO) };
838 m_menuHeight = 0;
839 if ( ::GetMenuBarInfo(m_hWnd, OBJID_MENU, 0, &mbi) )
840 {
841 m_menuHeight = (mbi.rcBar.bottom - mbi.rcBar.top) + 1;
842 }
843 rc.top += m_menuHeight;
844 pParams->rgrc[0] = rc + po;
845 }
846
851 void m_SetButtonPressState(EButtonKind bn)
852 {
853 if ( bn == BK_Nothing )
854 {
855 if ( m_pressedButton != BK_Nothing )
856 {
857 m_pressedButton = BK_Nothing;
858 ::ReleaseCapture();
859 }
860 }
861 else
862 {
863 if ( m_pressedButton == BK_Nothing )
864 {
865 m_pressedButton = bn;
866 ::SetCapture(m_hWnd);
867 }
868 }
869 }
870
874 class CMyButton
875 {
876 public:
878 CMyButton(void) : m_onButton(false), m_isPress(false), m_isEnable(true), m_isVisible(false), m_size(0, 0), m_point(0, 0)
879 {
880 }
886 void GetRect(RECT& _rect, const SIZE& sz) const
887 {
888 if ( m_isVisible )
889 {
890 _rect.left = (m_point.x >= 0) ? (m_point.x) : (sz.cx + m_point.x - m_size.cx);
891 _rect.right = _rect.left + m_size.cx;
892 _rect.top = (m_point.y >= 0) ? (m_point.y) : (sz.cy + m_point.y - m_size.cy);
893 _rect.bottom = _rect.top + m_size.cy;
894 }
895 else
896 {
897 ::SetRectEmpty(&_rect);
898 }
899 }
905 bool isEnable(void) const
906 {
907 return m_isVisible && m_isEnable && ! m_pDrawer.IsNull();
908 }
916 LRESULT HitTest(const POINT& pos, const SIZE& sz) const
917 {
918 CRect rc;
919 GetRect(rc, sz);
920 return rc.PtInRect(pos) ? m_hitTest : HTNOWHERE;
921 }
928 bool IsHitTest(WPARAM wParam) const
929 {
930 return wParam == m_hitTest;
931 }
936 void SetVisibleMode(bool isVisible)
937 {
938 m_isVisible = isVisible;
939 }
944 void SetEnableMode(bool isEnable)
945 {
946 m_isEnable = isEnable;
947 }
954 bool SetHoverMode(WPARAM wParam)
955 {
956 bool isHover = (wParam == m_hitTest);
957 bool r = (m_onButton != isHover);
958 m_onButton = isHover;
959 return r;
960 }
967 bool SetPressMode(WPARAM wParam)
968 {
969 bool isPress = (wParam == m_hitTest);
970 bool r = (m_isPress != isPress);
971 m_isPress = isPress;
972 return r;
973 }
978 void SetPressMode(bool isPress)
979 {
980 m_isPress = isPress;
981 }
988 void Draw(HDC dc, const SIZE& sz) const
989 {
990 if ( ! m_isVisible || m_pDrawer.IsNull() )
991 {
992 return;
993 }
994 CRect rc;
995 GetRect(rc, sz);
996 LPARAM p = 0;
997 if ( ! m_isEnable )
998 {
999 p = 3;
1000 }
1001 else if ( m_isPress )
1002 {
1003 p = 1;
1004 }
1005 else if ( m_onButton )
1006 {
1007 p = 2;
1008 }
1009 m_pDrawer->DrawEx(dc, rc.left, rc.top, p);
1010 }
1018 void SetDrawer(const POINT& pos, const IDrawable& draw, UINT hitTest, UINT msg)
1019 {
1020 m_pDrawer = draw.Clone();
1021 m_point = pos;
1022 m_pDrawer->GetSize(m_size);
1023 m_hitTest = hitTest;
1024 m_message = msg;
1025 }
1030 void PostSysCommand(HWND hWnd)
1031 {
1032 ::PostMessage(hWnd, WM_SYSCOMMAND, m_message, 0);
1033 }
1034 private:
1035 CSize m_size;
1036 CPoint m_point;
1037 IDrawable::Ptr m_pDrawer;
1038 bool m_onButton;
1039 bool m_isPress;
1040 bool m_isEnable;
1041 bool m_isVisible;
1042 UINT m_hitTest;
1043 UINT m_message;
1044 };
1045
1046 // 専用Brush描画
1047 class CMyBrushDrawer : public CNullDrawer
1048 {
1049 DEFSUPER(CNullDrawer);
1050 CBrushHandle m_brush;
1051 public:
1053 CMyBrushDrawer(CBrushHandle brush) : m_brush(brush)
1054 {
1055 }
1057 virtual IDrawable* Clone(void) const
1058 {
1059 return new CMyBrushDrawer(*this);
1060 }
1062 virtual void Draw(HDC dc, int x = 0, int y = 0) const
1063 {
1064 RECT r = { x, y, x + m_size.cx, y + m_size.cy };
1065 ::FillRect(dc, &r, m_brush);
1066 }
1067 };
1068 COLORREF m_textColor;
1069 IDrawable::Ptr m_pFrameDrawer;
1070 CBrushHandle m_backGround[2];
1071 bool m_isEvenBackGround;
1072 IDrawable::Ptr m_pTitleDrawer;
1073 CRect m_frameWidths;
1074 CRect m_titleRect;
1075 int m_titleHeight;
1076 bool m_isActive;
1077 CPoint m_windowPoint;
1078 CSize m_windowSize;
1079 int m_menuHeight;
1080 bool m_isInitWindowRgn;
1081 HRGN m_hNcRgn;
1082 COLORREF m_transColor;
1083
1084 CMyButton m_button[BK_Max];
1085 EButtonKind m_pressedButton;
1086 bool m_boHasHover;
1087 bool m_isInit;
1088 bool m_canMenuCheck;
1089 //
1090 CDrawingMenuBar m_menuBar;
1091 CDrawingMenu m_popupMenu;
1092 bool m_isMenuInit;
1093 bool m_isNcResized;
1094
1096 void m_SetWindowRgn(void)
1097 {
1098 if ( m_hNcRgn != NULL )
1099 {
1100 HRGN rgn = ::CreateRectRgn(0, 0, 0, 0);
1101 ::CombineRgn(rgn, m_hNcRgn, NULL, RGN_COPY);
1102 ::SetWindowRgn(m_hWnd, rgn, true);
1103 }
1104 }
1108 LRESULT m_OrgWndProcWithNoSysmeny(UINT message, WPARAM wParam, LPARAM lParam)
1109 {
1110 m_canMenuCheck = false;
1111 LONG nowStyle = ::GetWindowLong(m_hWnd, GWL_STYLE);
1112 ::SetWindowLong(m_hWnd, GWL_STYLE, nowStyle & (~WS_SYSMENU));
1113 LRESULT r = _super::WindowProc(message, wParam, lParam);
1114 ::SetWindowLong(m_hWnd, GWL_STYLE, nowStyle);
1115 m_canMenuCheck = true;
1116 return r;
1117 }
1118
1119 void m_NcPaint(void)
1120 {
1121 CRect rc;
1122 ::GetWindowRect(m_hWnd, rc);
1123 CRect cliRc;
1124 ::GetClientRect(m_hWnd, cliRc);
1125 if ( m_isInitWindowRgn )
1126 {
1127 m_isInitWindowRgn = false;
1128 if ( m_hNcRgn != NULL )
1129 {
1130 _DeleteObject(m_hNcRgn);
1131 }
1132 if ( ! m_frameWidths.IsRectNull() && m_transColor != CLR_INVALID && ! m_pFrameDrawer.IsNull() )
1133 {
1134 m_pFrameDrawer->Resize(rc.Size());
1135 CBitmapImage bi = CBitmapDrawer::ToBitmap(*m_pFrameDrawer, m_transColor);
1136 m_hNcRgn = bi.CreateRgn(m_transColor);
1137 }
1138 m_SetWindowRgn();
1139 }
1140 cliRc.OffsetRect(m_frameWidths.left, m_frameWidths.top + m_menuHeight);
1141 HDC dc = ::GetWindowDC(m_hWnd);
1142 ::ExcludeClipRect(dc, cliRc.left, cliRc.top, cliRc.right, cliRc.bottom);
1143 m_titleRect.right = rc.Width() - m_frameWidths.right;
1144 if ( m_menuHeight != 0 )
1145 {
1146 // メニューあるなら、タイトルバーの高さは固定
1147 int h = ::GetSystemMetrics(SM_CYCAPTION);
1148 m_titleRect.bottom = m_titleRect.top + h;
1149 m_frameWidths.top -= m_titleHeight;
1150 m_frameWidths.top += h;
1151 m_titleHeight = h;
1152 }
1153 m_OnFramePaint(dc, rc.Size(), m_titleRect, m_isActive);
1154 ::ReleaseDC(m_hWnd, dc);
1155 }
1156
1165 virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
1166 {
1167 switch ( message )
1168 {
1169 case WM_INITDIALOG:
1170 {
1171 LRESULT r = _super::WindowProc(message, wParam, lParam);
1172 m_CheckMenu();
1173 return r;
1174 }
1175 break;
1176 case WM_CTLCOLOREDIT:
1177 {
1178 HWND hWnd = reinterpret_cast<HWND>(lParam);
1179 if ( (::GetWindowLong(hWnd, GWL_EXSTYLE) & WS_EX_TRANSPARENT) != 0 )
1180 {
1181 HDC dc = reinterpret_cast<HDC>(wParam);
1182 ::SetBkMode(dc, TRANSPARENT);
1183 HBRUSH b = m_backGround[m_isActive ? 0 : 1];
1184 _super::WindowProc(message, wParam, lParam);
1185 if ( IS_RGBVALUE(m_textColor) )
1186 {
1187 ::SetTextColor(dc, m_textColor);
1188 }
1189 return reinterpret_cast<LRESULT>(b);
1190 }
1191 }
1192 break;
1193 case WM_CTLCOLORSTATIC:
1194 {
1195 HWND hWnd = reinterpret_cast<HWND>(lParam);
1196 LRESULT r = ::SendMessage(hWnd, WM_GETDLGCODE, 0, 0);
1197 if ( (r & DLGC_HASSETSEL) != 0 )
1198 {
1199 // EDITのReadOnly
1200 }
1201 //以下に続く
1202 }
1203 case WM_CTLCOLORBTN:
1204 {
1205 HDC dc = reinterpret_cast<HDC>(wParam);
1206 ::SetBkMode(dc, TRANSPARENT);
1207 HBRUSH b = m_backGround[m_isActive ? 0 : 1];
1208 _super::WindowProc(message, wParam, lParam);
1209 if ( IS_RGBVALUE(m_textColor) )
1210 {
1211 ::SetTextColor(dc, m_textColor);
1212 }
1213 return reinterpret_cast<LRESULT>(b);
1214 }
1215 break;
1216 case WM_CTLCOLORDLG:
1217 case WM_CTLCOLORMSGBOX:
1218 {
1219 HDC dc = reinterpret_cast<HDC>(wParam);
1220 HBRUSH b = m_backGround[m_isActive ? 0 : 1];
1221 _super::WindowProc(message, wParam, lParam);
1222 if ( IS_RGBVALUE(m_textColor) )
1223 {
1224 ::SetTextColor(dc, m_textColor);
1225 }
1226 return reinterpret_cast<LRESULT>(b);
1227 }
1228 break;
1229 case WM_WINDOWPOSCHANGED:
1230 {
1231 CRect oldRc(m_windowPoint, m_windowSize);
1232 LRESULT r = _super::WindowProc(message, wParam, lParam);
1233 const WINDOWPOS* P = reinterpret_cast<const WINDOWPOS*>(lParam);
1234 m_windowPoint.x = P->x;
1235 m_windowPoint.y = P->y;
1236 bool b = false;
1237 b |= (m_windowSize.cx != P->cx);
1238 m_windowSize.cx = P->cx;
1239 b |= (m_windowSize.cy != P->cy);
1240 m_windowSize.cy = P->cy;
1241 if ( b )
1242 {
1243 m_isNcResized = true;
1244 POINT po;
1245 if ( ::GetCursorPos(&po) )
1246 {
1247 WPARAM w = SendMessage(WM_NCHITTEST, 0, MAKELONG(po.x, po.y));
1248 m_OnNcMouseMove(w);
1249 }
1250 m_isInit = true;
1251 m_isInitWindowRgn = true;
1252 m_CheckMenu();
1253 m_NcPaint();
1254 }
1255 return r;
1256 }
1257 break;
1258 case WM_NCCALCSIZE:
1259 if ( ! m_isMenuInit )
1260 {
1261 m_isMenuInit = true;
1262 CFrameDrawer f1(false, BDR_SUNKENINNER, BF_RECT);
1263 CFrameDrawer f2(false, BDR_RAISEDINNER, BF_RECT);
1264 m_menuBar.SetSelectMarkDrawer(f1, f2);
1265 m_menuBar.SetBackgroundDrawer(CMyBrushDrawer(m_backGround[0]));
1266 m_menuBar.ReferSubParameter().CopyParameter(m_menuBar);
1269 m_popupMenu.CopyParameter(m_menuBar);
1270 m_popupMenu.SetDefaultMarkDrawer();
1271 m_popupMenu.SetBackgroundDrawer(CMyBrushDrawer(m_backGround[0]));
1272 m_popupMenu.SetSelectMarkDrawer(CBoxInverter());
1273 m_menuBar.SetLeftMargin(-1);
1274 }
1275 if ( ::GetMenu(m_hWnd) != NULL && m_menuBar.m_hMenu == NULL )
1276 {
1277 m_menuBar.Attach(this, false);
1278 ::DrawMenuBar(m_hWnd);
1279 m_menuBar.Draw();
1280 }
1281 {
1282 NCCALCSIZE_PARAMS* P = reinterpret_cast<NCCALCSIZE_PARAMS*>(lParam);
1283 LRESULT r = _super::WindowProc(message, wParam, lParam);
1284 m_OnNcCalcSize(wParam != 0, P);
1285 return r;
1286 }
1287 break;
1288 case WM_SIZE:
1289 case WM_MOVE:
1290 m_SetWindowRgn();
1291 break;
1292 case WM_NCPAINT:
1293 m_NcPaint();
1294 return 0;
1295 break;
1296 case WM_SETCURSOR:
1297 return m_OrgWndProcWithNoSysmeny(message, wParam, lParam);
1298 break;
1299 case WM_NCHITTEST:
1300 {
1301 LRESULT r = _super::WindowProc(message, wParam, lParam);
1302 CPoint p(lParam);
1303 return m_OnNcHitTest(r, CPoint(p.x - m_windowPoint.x, p.y - m_windowPoint.y));
1304 }
1305 break;
1306 case WM_MOUSEMOVE:
1307 if ( m_pressedButton >= 0 )
1308 {
1309 CPoint po(lParam);
1310 ::ClientToScreen(m_hWnd, &po);
1311 WPARAM w = SendMessage(WM_NCHITTEST, 0, MAKELONG(po.x, po.y));
1312 m_OnNcMouseMove(w);
1313 }
1314 break;
1315 case WM_CAPTURECHANGED:
1316 if ( m_pressedButton != BK_Nothing )
1317 {
1318 m_SetButtonPressState(BK_Nothing);
1319 loop ( i, BK_Max )
1320 {
1321 m_button[i].SetPressMode(false);
1322 }
1323 }
1324 break;
1325 case WM_ACTIVATE:
1326 m_isActive = !! wParam;
1327 if ( ! m_isEvenBackGround )
1328 {
1329 m_menuBar.SetBackgroundDrawer(CMyBrushDrawer(m_backGround[m_isActive ? 0 : 1]));
1330 ::RedrawWindow(m_hWnd, NULL, NULL, RDW_ERASE | RDW_FRAME | RDW_INVALIDATE);
1331 }
1332 else
1333 {
1334 CRect rc(0, 0, 1, 1);
1335 ::RedrawWindow(m_hWnd, rc, NULL, RDW_FRAME | RDW_NOERASE | RDW_NOINTERNALPAINT | RDW_INVALIDATE);
1336 }
1337 m_SetWindowRgn();
1338 break;
1339 case WM_NCACTIVATE:
1340 m_NcPaint();
1341 return TRUE;
1342 break;
1343 case WM_NCMOUSELEAVE:
1344 if ( m_boHasHover )
1345 {
1346 m_boHasHover = false;
1347 POINT po;
1348 if ( ::GetCursorPos(&po) )
1349 {
1350 WPARAM w = SendMessage(WM_NCHITTEST, 0, MAKELONG(po.x, po.y));
1351 m_OnNcMouseMove(w);
1352 }
1353 }
1354 break;
1355 case WM_NCMOUSEMOVE:
1356 if ( m_isNcResized )
1357 {
1358 m_isNcResized = false;
1359 m_SetWindowRgn();
1360 }
1361 if ( m_isInit && m_isActive )
1362 {
1363 m_isInit = false;
1364 if ( (::GetWindowLong(m_hWnd, GWL_EXSTYLE) & WS_EX_TOOLWINDOW) == 0 )
1365 {
1366 SendMessage(WM_NCLBUTTONDOWN, HTCAPTION, 0);
1367 SendMessage(WM_NCLBUTTONUP, HTCAPTION, 0);
1368 }
1369 m_NcPaint();
1370 }
1371 m_OnNcMouseMove(wParam);
1372 if ( ! m_boHasHover )
1373 {
1374 m_boHasHover = true;
1375 TRACKMOUSEEVENT tme;
1376 tme.cbSize = sizeof (TRACKMOUSEEVENT);
1377 tme.hwndTrack = m_hWnd;
1378 tme.dwHoverTime = HOVER_DEFAULT;
1379 tme.dwFlags = TME_LEAVE | TME_NONCLIENT;
1380 ::_TrackMouseEvent(&tme);
1381 }
1382 if ( m_isInit )
1383 {
1384 m_NcPaint();
1385 }
1386 return m_OrgWndProcWithNoSysmeny(message, wParam, lParam);
1387 break;
1388 case WM_INITMENU:
1389 {
1390 LRESULT r = m_OrgWndProcWithNoSysmeny(message, wParam, lParam);
1391 m_NcPaint();
1392 return r;
1393 }
1394 break;
1395 case WM_INITMENUPOPUP:
1396 if ( m_popupMenu.m_hMenu != NULL )
1397 {
1398 m_popupMenu.Detach();
1399 }
1400 m_popupMenu.Attach(this, reinterpret_cast<HMENU>(wParam), true, true);
1401 if ( HIWORD(lParam) == 1 )
1402 {
1403 LRESULT r = m_OrgWndProcWithNoSysmeny(message, wParam, lParam);
1404 m_NcPaint();
1405 return r;
1406 }
1407 break;
1408 case WM_MENUSELECT:
1409 case WM_STYLECHANGED:
1410 if ( m_canMenuCheck )
1411 {
1412 m_CheckMenu();
1413 m_NcPaint();
1414 }
1415 break;
1416 case WM_LBUTTONUP:
1417 if ( m_pressedButton >= 0 )
1418 {
1419 CPoint po(lParam);
1420 ::ClientToScreen(m_hWnd, &po);
1421 WPARAM w = SendMessage(WM_NCHITTEST, 0, MAKELONG(po.x, po.y));
1422 if ( m_OnNcButton(message, w, lParam) )
1423 {
1424 return 0;
1425 }
1426 }
1427 break;
1428 case WM_NCLBUTTONDOWN:
1429 case WM_NCRBUTTONUP:
1430 if ( m_OnNcButton(message, wParam, lParam) )
1431 {
1432 return 0;
1433 }
1434 switch ( wParam )
1435 {
1436 case HTCAPTION:
1437 case HTLEFT:
1438 case HTRIGHT:
1439 case HTTOP:
1440 case HTTOPLEFT:
1441 case HTTOPRIGHT:
1442 case HTBOTTOM:
1443 case HTBOTTOMLEFT:
1444 case HTBOTTOMRIGHT:
1445 return m_OrgWndProcWithNoSysmeny(message, wParam, lParam);
1446 }
1447 break;
1448 case WM_NCLBUTTONUP :
1449 case WM_NCLBUTTONDBLCLK:
1450 case WM_NCRBUTTONDOWN:
1451 case WM_NCRBUTTONDBLCLK:
1452 if ( m_OnNcButton(message, wParam, lParam) )
1453 {
1454 return 0;
1455 }
1456 break;
1457 case WM_NCMBUTTONDOWN:
1458 case WM_NCMBUTTONUP:
1459 case WM_NCMBUTTONDBLCLK:
1460 return 0;
1461 case WM_DESTROY:
1462 case WM_NCDESTROY:
1463 {
1464 if ( m_hNcRgn != NULL )
1465 {
1466 _DeleteObject(m_hNcRgn);
1467 m_hNcRgn = NULL;
1468 }
1469 ::ReleaseCapture();
1470 LRESULT r = _super::WindowProc(message, wParam, lParam);
1471 _super::Destroy();
1472 return r;
1473 }
1474 break;
1475 case WM_THEMECHANGED:
1476 ::SetWindowPos(m_hWnd, NULL, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_FRAMECHANGED);
1477 ::InvalidateRect(m_hWnd, NULL, TRUE);
1478 break;
1479 }
1480 return _super::WindowProc(message, wParam, lParam);
1481 }
1482};
1483
1484
1485
1486}; //MFC
1487}; //TNB
ビットマップバンク描画情報関係のヘッダ
ビットマップ領域描画情報のヘッダ
デバイステキストセレクトアシスタント関係のヘッダ
#define loop(VAR, CNT)
loop構文.
Definition: TnbDef.h:343
フォントハンドル関係のヘッダ
ハンドルハンドル関係のヘッダ
描画情報メニュー関係のヘッダ
テキスト描画関係のヘッダ
ウィンドウプロシージャフック関係のヘッダ
バンク描画情報クラス
Definition: TnbBankDrawer.h:35
CBankDrawer & Add(const IDrawable &draw)
[追加] 追加
Definition: TnbBankDrawer.h:58
virtual IDrawable * Clone(void) const
[作成] クローン作成.
Definition: TnbBankDrawer.h:69
ビットマップバンク描画情報クラス
ビットマップ領域描画クラス
CBitmapHandle GetParts(int idx) const
[取得] ビットマップ
virtual IDrawable * Clone(void) const
[作成] クローン作成.
static CBitmapHandle ToBitmap(const IDrawable &draw, COLORREF color=CLR_INVALID)
[作成] ビットマップ作成.
HBITMAP型ハンドルハンドル
ビットマップイメージ管理クラス
bool GradationFill(COLORREF color1, COLORREF color2, EDirection direction, const RECT *pRect=NULL)
[処理] グラデーション描画.
HRGN CreateRgn(COLORREF transColor=CLR_AUTOSELECT) const
[作成] リージョン作成.
HDC GetDC(void)
[取得]デバイスコンテキストハンドル取得.
bool CustomizeAlpha(BYTE alpha)
[処理] アルファチャネル操作.
bool Set(int cx, int cy, COLORREF color=CLR_INVALID)
[設定] イメージ設定.
bool ReleaseDC(void)
[設定] デバイスコンテキストハンドル返却.
bool Draw(HDC hdc, int x=0, int y=0) const
[処理] イメージ描画.
bool SemitransparectBlt(HDC hdc, int x, int y, int parsent=100, COLORREF color=CLR_AUTOSELECT) const
[挿入] 半透明,透過イメージ描画.
反転描画クラス
Definition: TnbDrawable.h:594
HBRUSH型ハンドルハンドル
デバイステキストセレクトアシスタント
void SetBkMode(int mode)
[設定] 背景モード設定.
void SelectFont(HFONT font)
[選択] フォント選択.
HFONT型ハンドルハンドル
Definition: TnbFontHandle.h:80
bool SetSystemCaptionFont(void)
[設定] キャプションバーフォント設定.
フレーム描画クラス
Definition: TnbDrawable.h:653
NULL描画クラス
Definition: TnbDrawable.h:106
SIZE m_size
サイズ
Definition: TnbDrawable.h:109
bool IsNull(void) const
[確認] NULLチェック
void Null(void)
[設定] 開放.
static bool DrawTextRect(RECT &_rect, HDC dc, DWORD drawStyle, const POINT &offset, COLORREF color1, COLORREF color2, LPCTSTR str)
[表示] 範囲文字表示.
HWND m_hWnd
管理しているウィンドウ
LRESULT SendMessage(UINT message, WPARAM wParam, LPARAM lParam)
[処理] SendMessage.
BOOL PostMessage(UINT message, WPARAM wParam, LPARAM lParam)
[処理] PostMessage.
HWND GetSafeHwnd(void) const
[取得] ウィンドウハンドル取得
const TYP * Ref(void) const
[取得] ポインタ取得
Definition: TnbDef.h:712
bool SetSelectMarkDrawer(const IDrawable &draw, ESelectMarkType type=OVERLAP)
[設定] 選択マーク描画指定.
bool SetBackgroundDrawer(const IDrawable &draw)
[設定] 背景描画指定.
void CopyParameter(const CAbstractDrawingMenu &o)
[設定] 設定の複製.
void SetTextColor(COLORREF color1, COLORREF color2=CLR_INVALID)
[設定] 文字色指定
void SetDefaultMarkDrawer(COLORREF base=::GetSysColor(COLOR_MENU))
[設定] デフォルトのマーク描画指定.
void SetLeftMargin(int m)
[設定] 文字表示位置指定
カスタムウィンドウフレーム.
void SetFrameBitmap(CBitmapHandle bmp)
[設定] フレームビットマップ設定
void SetMinimumButtonBitmap(const POINT &pos, CBitmapHandle bmp, int num=4, COLORREF color=CLR_INVALID)
[設定] Minimumボタン設定
void SetRestoreButtonBitmap(const POINT &pos, CBitmapHandle bmp, int num=4, COLORREF color=CLR_INVALID)
[設定] Restoreボタン設定
CDrawingMenu & ReferPopupMenu(void)
[参照] メニューバー参照.
void SetFrameTransColor(COLORREF color=CLR_AUTOSELECT)
[設定] 透過色指定
CDrawingMenuBar & ReferMenuBar(void)
[参照] メニューバー参照.
void SetMaximumButtonBitmap(const POINT &pos, CBitmapHandle bmp, int num=4, COLORREF color=CLR_INVALID)
[設定] Maximumボタン設定
CCustomWindowFrame(void)
コンストラクタ
void SetFrameBitmap(CBitmapHandle bmp1, CBitmapHandle bmp2)
[設定] フレームビットマップ設定
void SetHelpButtonBitmap(const POINT &pos, CBitmapHandle bmp, int num=4, COLORREF color=CLR_INVALID)
[設定] Helpボタン設定
virtual void OnDetacted(void)
[通知] デタッチ通知.
virtual void PreAttach(HWND hWnd)
[通知] アタッチ直前通知
HBRUSH GetBackground(bool isActive)
[取得] 背景ブラシ取得
void SetTitleBitmap(const IDrawable &draw)
[設定] タイトルバー描画情報指定.
virtual void OnAttached(void)
[通知] アタッチ通知.
void SetCloseButtonBitmap(const POINT &pos, CBitmapHandle bmp, int num=4, COLORREF color=CLR_INVALID)
[設定] Closeボタン設定
~CCustomWindowFrame(void)
デストラクタ
void CopyParameter(const CCustomWindowFrame &o)
[設定] 設定の複製.
void SetTextColor(COLORREF color)
[設定] テキスト色.
virtual void PreDetach(void)
[通知] デタッチ直前通知.
void SetFrameBitmap(const IDrawable &draw, CBitmapHandle bmp)
[設定] フレームビットマップ設定
void SetFrameWidths(int frameWidth=-1, int titleHeight=-1)
[設定] 大きさ設定.
void SetFrameWidths(const RECT &frameWidths, int titleHeight=-1)
[設定] 大きさ設定.
描画情報メニューバー
BOOL Attach(COwnerdrawMenuSupportProcedureHooker *pProc, bool withSubMenu=false)
[設定] アタッチ.
void Draw(HDC dc)
[描画] 描画
描画情報メニュー
BOOL Attach(COwnerdrawMenuSupportProcedureHooker *pProc, HMENU hMenu, bool isAllOwnerDraw=false, bool withSubMenu=false)
[設定] アタッチ.
CAbstractDrawingMenu & ReferSubParameter(void)
[参照] サブメニュ描画情報.
オーナードローメニューサポートプロシージャ
ウィンドウタイトル描画情報クラス
CWindowCaptionDrawer(HWND hWnd)
コンストラクタ
void SetTextColor(COLORREF c1, COLORREF c2)
[設定] 文字の色指定.
void SetBarEllipse(int widthEllipse=5, int heightEllipse=5)
[設定] バーの丸み指定
virtual IDrawable * Clone(void) const
[作成] クローン作成.
void SetBarColor(COLORREF c1, COLORREF c2)
[設定] バーの色指定.
virtual void DrawEx(HDC dc, int x, int y, LPARAM lParam) const
[描画] 描画.
TNB Library
Definition: TnbDoxyTitle.txt:2
描画情報インターフェース
Definition: TnbDrawable.h:37
virtual bool Resize(const SIZE &size)=0
[設定] サイズ設定.
virtual bool GetSize(SIZE &_size) const =0
[取得] サイズ取得.
virtual IDrawable * Clone(void) const =0
[作成] クローン作成.
virtual void DrawEx(HDC dc, int x, int y, LPARAM lParam) const
[描画] 描画.
Definition: TnbDrawable.h:83