TNB Library
TnbBankDrawer.h
[詳解]
1#pragma once
11#include "TnbDrawable.h"
12#include "TnbSimpleVector.h"
13
14
15
16//TNB Library
17namespace TNB
18{
19
20
21
34class CBankDrawer : public IDrawable
35{
36 DEFSUPER(IDrawable);
37public:
38
41 {
42 }
43
49 {
50 m_phDraws.Add(draw.Clone());
51 }
52
59 {
60 m_phDraws.Add(draw.Clone());
61 return *this;
62 }
63
69 virtual IDrawable* Clone(void) const
70 {
71 CBankDrawer* P = new CBankDrawer(*this);
72 return P;
73 }
74
82 virtual bool GetSize(SIZE& _size) const
83 {
84 if ( m_phDraws.GetSize() > 0 )
85 {
86 return m_phDraws[0]->GetSize(_size);
87 }
88 return false;
89 }
90
99 virtual bool Resize(const SIZE& size)
100 {
101 size_t num = m_phDraws.GetSize();
102 if ( num > 0 )
103 {
104 bool r = true;
105 loop ( i, num )
106 {
107 r &= m_phDraws[i]->Resize(size);
108 }
109 return r;
110 }
111 return false;
112 }
113
121 virtual void Draw(HDC dc, int x = 0, int y = 0) const
122 {
123 DrawEx(dc, x, y, 0);
124 }
125
134 virtual void DrawEx(HDC dc, int x, int y, LPARAM lParam) const
135 {
136 if ( m_phDraws.GetSize() <= static_cast<size_t>(lParam) )
137 {
138 lParam = 0;
139 }
140 m_phDraws[lParam]->DrawEx(dc, x, y, lParam);
141 }
142protected:
144};
145
146
147
148};
149
#define loop(VAR, CNT)
loop構文.
Definition: TnbDef.h:343
描画情報関係のヘッダ
簡易配列型情報管理関係のヘッダ
バンク描画情報クラス
Definition: TnbBankDrawer.h:35
CBankDrawer(void)
コンストラクタ
Definition: TnbBankDrawer.h:40
virtual void Draw(HDC dc, int x=0, int y=0) const
[描画] 描画.
CBankDrawer(const IDrawable &draw)
コンストラクタ
Definition: TnbBankDrawer.h:48
virtual bool Resize(const SIZE &size)
[設定] サイズ設定.
Definition: TnbBankDrawer.h:99
CBankDrawer & Add(const IDrawable &draw)
[追加] 追加
Definition: TnbBankDrawer.h:58
virtual bool GetSize(SIZE &_size) const
[取得] サイズ取得.
Definition: TnbBankDrawer.h:82
CSimpleVectorT< IDrawable::Ptr > m_phDraws
バンク管理
virtual IDrawable * Clone(void) const
[作成] クローン作成.
Definition: TnbBankDrawer.h:69
virtual void DrawEx(HDC dc, int x, int y, LPARAM lParam) const
[描画] 描画.
簡易配列型情報管理テンプレート
TNB Library
Definition: TnbDoxyTitle.txt:2
描画情報インターフェース
Definition: TnbDrawable.h:37
virtual IDrawable * Clone(void) const =0
[作成] クローン作成.