Browse Subversion Repository
Contents of /trunk/CGroupBox.cpp
Parent Directory
| Revision Log
Revision 1 -
( show annotations)
( download)
( as text)
Sun Aug 15 01:53:13 2010 UTC
(13 years, 9 months ago)
by okadu
File MIME type: text/x-c++src
File size: 1753 byte(s)
| 1 |
#include "stdafx.h" |
| 2 |
#include "CGroupBox.h" |
| 3 |
#include "CSkinPlugin.h" |
| 4 |
|
| 5 |
// 内部定数 |
| 6 |
const int GB_FONT_MARGIN = 4; // 枠と文字の余白 |
| 7 |
|
| 8 |
/* |
| 9 |
* 入力チェック |
| 10 |
*/ |
| 11 |
bool CGroupBox::ScanInput(){ |
| 12 |
if(!m_Visible) return ScanInputBrother(); |
| 13 |
return CInterface::ScanInput(); |
| 14 |
} |
| 15 |
|
| 16 |
/* |
| 17 |
* レンダリング |
| 18 |
*/ |
| 19 |
void CGroupBox::Render(){ |
| 20 |
CInterface::RenderBrother(); |
| 21 |
if(!m_Visible) return; |
| 22 |
int px, py; |
| 23 |
GetAbsPos(&px, &py); |
| 24 |
CStringDrawer *sd = g_StrTex->DrawString(m_Text.c_str(), 0); |
| 25 |
int sw = sd->GetWidth(), shift = sw ? GB_FONT_MARGIN*2 : 0; |
| 26 |
g_Skin->SetInterfaceTexture(); |
| 27 |
SetUVMap(0.625f, 0.0f, 0.75f, 0.125f); |
| 28 |
TexMap2DRect(px, py, px+TILE_UNIT, py+TILE_UNIT, 0xffffffff); |
| 29 |
SetUVMap(0.75f, 0.0f, 0.875f, 0.125f); |
| 30 |
TexMap2DRect(px+TILE_UNIT+sw+shift, py, px+m_Width-TILE_UNIT, py+TILE_UNIT, 0xffffffff); |
| 31 |
SetUVMap(0.875f, 0.0f, 1.0f, 0.125f); |
| 32 |
TexMap2DRect(px+m_Width-TILE_UNIT, py, px+m_Width, py+TILE_UNIT, 0xffffffff); |
| 33 |
SetUVMap(0.625f, 0.125f, 0.75f, 0.25f); |
| 34 |
TexMap2DRect(px, py+TILE_UNIT, px+TILE_UNIT, py+m_Height-TILE_UNIT, 0xffffffff); |
| 35 |
SetUVMap(0.875f, 0.125f, 1.0f, 0.25f); |
| 36 |
TexMap2DRect(px+m_Width-TILE_UNIT, py+TILE_UNIT, px+m_Width, py+m_Height-TILE_UNIT, 0xffffffff); |
| 37 |
SetUVMap(0.625f, 0.25f, 0.75f, 0.375f); |
| 38 |
TexMap2DRect(px, py+m_Height-TILE_UNIT, px+TILE_UNIT, py+m_Height, 0xffffffff); |
| 39 |
SetUVMap(0.75f, 0.25f, 0.875f, 0.375f); |
| 40 |
TexMap2DRect(px+TILE_UNIT, py+m_Height-TILE_UNIT, px+m_Width-TILE_UNIT, py+m_Height, 0xffffffff); |
| 41 |
SetUVMap(0.875f, 0.25f, 1.0f, 0.375f); |
| 42 |
TexMap2DRect(px+m_Width-TILE_UNIT, py+m_Height-TILE_UNIT, px+m_Width, py+m_Height, 0xffffffff); |
| 43 |
sd->RenderLeft(px+TILE_UNIT+GB_FONT_MARGIN, py+FontY(TILE_UNIT), |
| 44 |
g_Skin->m_InterfaceData.m_StaticFontColor); |
| 45 |
CInterface::RenderChild(); |
| 46 |
} |
| |