94 pNew->m_appendPos = m_appendPos;
100 pNew->m_drawers[i] = m_drawers[i];
119 _size.cy = rc.bottom;
138 TParam& A = m_drawers[i];
140 if ( sz.cx + A.pos.x > size.cx )
142 sz.cx = size.cx - A.pos.x;
148 if ( sz.cy + A.pos.y > size.cy )
150 sz.cy = size.cy - A.pos.y;
156 A.pDrawer->Resize(sz);
169 TParam& A = m_drawers[i];
170 A.pDrawer->Resize(A.orgSize);
193 virtual void Draw(HDC dc,
int x = 0,
int y = 0)
const
206 virtual void DrawEx(HDC dc,
int x,
int y, LPARAM lParam)
const
212 const TParam& A = m_drawers.
At(i);
213 A.pDrawer->DrawEx(dc, x + A.pos.x, y + A.pos.y, lParam);
220 const TParam& A = m_drawers.
At(i);
222 if ( A.pDrawer->GetSize(size) )
224 RECT rc = { x + A.pos.x, y + A.pos.y, x + A.pos.x + size.cx, y + A.pos.y + size.cy };
225 if ( ::RectVisible(dc, &rc) )
227 A.pDrawer->DrawEx(dc, rc.left, rc.top, lParam);
254 return m_drawers.
At(index).pDrawer;
267 return m_drawers.
Remove(index);
308 if ( ! m_drawers.
IsInRange(index) ) {
return false; }
309 const TParam& A = m_drawers.
At(index);
311 bool r = A.pDrawer->GetSize(size);
314 ::SetRect(&_rect, A.pos.x, A.pos.y, A.pos.x + size.cx, A.pos.y + size.cy);
318 ::SetRectEmpty(&_rect);
333 ::SetRectEmpty(&_rect);
338 ::UnionRect(&_rect, &_rect, &rc);
351 if (
GetCount() == 0 ) {
return NULL; }
352 HRGN rgn = ::CreateRectRgn(0, 0, 0, 0);
358 HRGN rgnTemp = ::CreateRectRgnIndirect(&r);
359 ::CombineRgn(rgn, rgn, rgnTemp, RGN_OR);
360 _DeleteObject(rgnTemp);
374 void DrawAt(INDEX index, HDC dc,
int x = 0,
int y = 0)
const
378 const TParam& A = m_drawers.
At(index);
379 A.pDrawer->Draw(dc, x, y);
443 const TParam& A = m_drawers.
At(index);
445 if ( A.pDrawer->GetSize(size) )
447 m_appendPos.x = A.pos.x + x;
448 m_appendPos.y = A.pos.y + y;
449 m_Offset(dire, size.cx, size.cy);
483 if ( pDraw != NULL && pDraw->
GetSize(p.orgSize) )
487 INDEX r = m_drawers.
Add(p);
488 if ( r != INVALID_INDEX )
490 m_Offset(dire, p.orgSize.cx, p.orgSize.cy);
495 return INVALID_INDEX;
514 if ( ! m_Locate(index, locate, pDraw) ) {
return INVALID_INDEX; }
612 SIZE nullSize = { 0, 0 };
614 INDEX lastValidIndex = INVALID_INDEX;
616 loop( i, maxIndex + 1 )
623 HANDLE hFind = ::FindFirstFile(str, &wfd);
624 if ( hFind != INVALID_HANDLE_VALUE )
644 ASSERTLIB( idx == i );
646 if ( lastValidIndex != INVALID_INDEX )
648 while (
RemoveAt(lastValidIndex + 1 ));
675 else if ( dire ==
RIGHT )
679 else if ( dire ==
RETURN )
697 if ( ! m_drawers.
IsInRange(index) ) {
return false; }
698 const TParam& A = m_drawers.
At(index);
700 if ( ! A.pDrawer->GetSize(baseSize) ) {
return false; }
702 if ( ! pDraw->
GetSize(mySize) ) {
return false; }
703 m_appendPos.x = A.pos.x;
704 m_appendPos.y = A.pos.y;
708 m_appendPos.y += (baseSize.cy - mySize.cy) / 2;
712 m_appendPos.y += baseSize.cy - mySize.cy;
716 m_appendPos.y += baseSize.cy;
721 m_appendPos.x += (baseSize.cx - mySize.cx) / 2;
725 m_appendPos.x += baseSize.cx - mySize.cx;
729 m_appendPos.x += baseSize.cx;
#define loop(VAR, CNT)
loop構文.
static CBitmapHandle ToBitmap(const IDrawable &draw, COLORREF color=CLR_INVALID)
[作成] ビットマップ作成.
@ RIGHTCENTER
中央あわせで、右に追加。
void SetAppendPosition(int x, int y)
[操作] 追加相対座標設定.
bool GetAllRect(RECT &_rect) const
[取得] 矩形範囲取得.
void RemoveAll(void)
[削除] すべて削除.
virtual void Draw(HDC dc, int x=0, int y=0) const
[描画] 描画.
INDEX AddBitmap(CBitmapHandle bmp, EDirection dire=DOWN)
[追加] ビットマップ描画情報追加.
CDrawingContainer(void)
コンストラクタ
const IDrawable * At(INDEX index) const
[参照] 指定INDEXの参照.
INDEX Add(const IDrawable &draw, EDirection dire=DOWN)
[追加] 描画情報追加.
INDEX AddNewPointer(INDEX index, ELocation locate, IDrawable *pDraw, EDirection dire=DOWN)
[追加] 描画情報追加.
bool RemoveAt(INDEX index)
[削除] 指定INDEXの削除.
void OffsetAppendPosition(int x, int y)
[操作] 追加相対座標移動.
virtual ~CDrawingContainer(void)
デストラクタ
virtual bool Resize(const SIZE &size)
[設定] サイズ設定.
bool MoveAppendPosition(INDEX index, EDirection dire=DOWN, int x=0, int y=0)
[移動] 追加相対座標設定.
INDEX Add(INDEX index, ELocation locate, const IDrawable &draw, EDirection dire=DOWN)
[追加] 描画情報追加.
INDEX AddNewPointer(IDrawable *pDraw, EDirection dire=DOWN)
[追加] 描画情報追加.
INDEX AddBitmap(INDEX index, ELocation locate, CBitmapHandle bmp, EDirection dire=DOWN)
[追加] ビットマップ描画情報追加.
CBitmapHandle CreateBitmap(COLORREF color=CLR_INVALID) const
[作成] ビットマップ作成.
HRGN GetAllRgn(void) const
[取得] 領域範囲取得.
void DrawAt(INDEX index, HDC dc, int x=0, int y=0) const
[描画] 描画.
bool GetAtRect(INDEX index, RECT &_rect) const
[取得] ビットマップ取得.
virtual bool GetSize(SIZE &_size) const
[取得] サイズ取得.
const POINT & GetAppendPosition(void) const
[取得] 追加相対座標取得.
virtual IDrawable * Clone(void) const
[作成] クローン作成.
void DefaultSize(void)
[設定] サイズリセット.
size_t GetCount(void) const
[取得] 格納数取得.
int AppendBitmaps(LPCTSTR lpszPath, INDEX maxIndex, EDirection dire=DOWN)
[追加] 一括ビットマップファイル読込み.
virtual void DrawEx(HDC dc, int x, int y, LPARAM lParam) const
[描画] 描画.
bool IsNull(void) const
[確認] NULLチェック
void RemoveAll(void)
[削除] 空化
size_t GetSize(void) const
[取得] サイズ取得
bool Remove(INDEX index)
[削除] 要素一つ削除.
void SetSize(size_t s)
[設定] サイズ設定
bool IsInRange(INDEX index) const
[確認] INDEXの有効確認.
const TYP & At(INDEX index) const
[取得] 要素の参照取得.
INDEX Add(const TYP &t)
[追加] 要素一つ追加.
INT_PTR PathIndexOf(LPCSTR lpszText)
[検索] パス区切り検索(ASCII/SJIS用)
void Copy(LPSTR _dst, LPCSTR src)
[複製] 文字列コピー(ASCII/SJIS用)
bool PrintF(LPSTR _pWork, size_t iLen, LPCSTR lpFmt,...)
[作成] 書式付き文字列作成(ASCII/SJIS用)
virtual bool GetSize(SIZE &_size) const =0
[取得] サイズ取得.
virtual IDrawable * Clone(void) const =0
[作成] クローン作成.