#include "stdafx.h" #include "SkinResource.h" cSkinComboBoxResource::cSkinComboBoxResource() { } cSkinComboBoxResource::~cSkinComboBoxResource() { } bool cSkinComboBoxResource::Load( cParser& parser ) { if( parser.ExpectTokenString( "{" ) == false ) { return false; } cString keyword; while( true ) { if( parser.ParseString( &keyword ) == false ) { return false; } if( keyword == "image" ) { /// À̹ÌÁö ·Îµù cString fileName; parser.ParseString( &fileName ); if( LoadImage( &mBitmap, &mWidth, &mHeight, fileName ) == false ) { return false; } } else if( keyword == "imageScroll" ) { cString fileName; parser.ParseString( &fileName ); if( LoadImage( &mScrollBitmap, &mScrollImageWidth, &mScrollImageHeight, fileName ) == false ) return false; } else if( keyword == "left" ) { int x = parser.ParseInt(); int y = parser.ParseInt(); int w = parser.ParseInt(); int h = parser.ParseInt(); mRectLeft.left = x; mRectLeft.top = y; mRectLeft.right = w; mRectLeft.bottom = h; } else if( keyword == "center" ) { int x = parser.ParseInt(); int y = parser.ParseInt(); int w = parser.ParseInt(); int h = parser.ParseInt(); mRectCenter.left = x; mRectCenter.top = y; mRectCenter.right = w; mRectCenter.bottom = h; } else if( keyword == "right" ) { int x = parser.ParseInt(); int y = parser.ParseInt(); int w = parser.ParseInt(); int h = parser.ParseInt(); mRectRight.left = x; mRectRight.top = y; mRectRight.right = w; mRectRight.bottom = h; } else if( keyword == "pos" ) { /// À§Ä¡ ÆÄ½Ì int x = parser.ParseInt(); int y = parser.ParseInt(); mRect.left = x; mRect.top = y; mRect.right = x + mWidth; mRect.bottom = y + mHeight; } else if( keyword == "size" ) { /// Å©±â ÆÄ½Ì mWidth = parser.ParseInt(); mHeight = parser.ParseInt(); mRect.right = mRect.left + mWidth; mRect.bottom = mRect.top + mHeight; } else if( keyword == "}" ) { /// ºí·Ï Å»Ãâ ^^ break; } else { return false; } } return true; }