137 lines
3.4 KiB
C++
137 lines
3.4 KiB
C++
#pragma once
|
|
|
|
#pragma once
|
|
|
|
//#include "KUIControl.h"
|
|
#include "KPrimitiveSprite.h"
|
|
|
|
class KMsgBoxCallbackObject;
|
|
class KUIControlTitleBar;
|
|
class KUIControlStatusBar;
|
|
class KUIControlButton;
|
|
|
|
// "UI_CALLBACK"
|
|
|
|
struct KCallbackMessage : public KArg
|
|
{
|
|
std::string sMsgID;
|
|
DWORD dwResult;
|
|
std::string strReqValue;
|
|
};
|
|
|
|
class KUIMsgControl;
|
|
|
|
/// 2012.04.26 KUIMsgControl를 컴스터마이징 하는 구조체 - prodongi
|
|
class cMsgControlCustomizer
|
|
{
|
|
public:
|
|
cMsgControlCustomizer() : m_msgControl(NULL) {}
|
|
virtual ~cMsgControlCustomizer() {}
|
|
virtual void setMsgControl(KUIMsgControl* control) { m_msgControl = control; }
|
|
virtual void process(DWORD /*dwTime*/) {}
|
|
/// 필요한 데이타들을 모두 받고 최종적으로 커스터마이징 할 때 호출 해야 된다.
|
|
virtual void customizing() = 0;
|
|
|
|
protected:
|
|
KUIMsgControl* m_msgControl;
|
|
};
|
|
|
|
class KUIMsgControl : public KUIControl
|
|
{
|
|
public:
|
|
KUIMsgControl();
|
|
virtual ~KUIMsgControl();
|
|
|
|
virtual void Create(KUIWND_CREATE_ARG& arg);
|
|
virtual void Render(KViewportObject* pViewport, bool isFront = false );
|
|
virtual void Process(DWORD dwTime);
|
|
virtual void PumpUpMessage( LPCSTR lpszControlID, DWORD nMessage, DWORD lparam, DWORD wparam );
|
|
virtual DWORD OnMouseMessage(DWORD dwMessage, int x, int y);
|
|
virtual DWORD OnKeyMessage( DWORD dwMessage, DWORD dwKeyCode);
|
|
|
|
void SetStartTime(DWORD dwStartTime);
|
|
void SetContinueTime(DWORD dwContinueTime);
|
|
|
|
void SetEndBtnIndex(int nIndex);
|
|
void MakeUpButton();
|
|
void SetReqValue( const char* lpValue ) { if(lpValue) m_strReqValue = lpValue; }
|
|
|
|
void RegisterCallback(KObject* pObj);
|
|
/// 2012.04.26 KUIMsgControl가 모두 설정된 후에 customizer를 호출해야 됩니다. - prodongi
|
|
void setCustomizing(cMsgControlCustomizer* customizer);
|
|
/// 2012.04.27 static control 추가
|
|
KUIWnd* addStatic(char const* id, char const* caption);
|
|
char const* getMsgControlId() const { return m_msgControlId.c_str(); }
|
|
void moveButtons(int offsetX, int offsetY);
|
|
/// 버튼 컨트롤이 있을 때, 버튼의 top위치를 구한다
|
|
bool getButtonTopPos(int& top) const;
|
|
|
|
void AddMsg( LPCSTR lpszID, LPCSTR lpszCaption );
|
|
void AddButton( LPCSTR lpszID, LPCSTR lpszCaption, bool bUseSprCaption, int nButtonCount );
|
|
|
|
void SetMsg( LPCSTR lpszID, LPCSTR lpszCaption );
|
|
|
|
enum MSGBOX_STATE
|
|
{
|
|
STATE_CREATED,
|
|
STATE_POPUP, ///< 떠오르는 상태 (0.f ~ 1.0f 로 alpha 변경)
|
|
STATE_NORMAL,
|
|
STATE_POPDOWN, ///< 사라지는 상태 (1.0f ~ 0.f 로 alpha 변경)
|
|
STATE_END,
|
|
};
|
|
|
|
MSGBOX_STATE GetMsgBoxState()
|
|
{
|
|
return m_State;
|
|
}
|
|
protected:
|
|
virtual void _initControl();
|
|
|
|
void _invokeFunc(DWORD dwEndMsg);
|
|
void _statePopUp();
|
|
void _statePopDown();
|
|
|
|
void _reArrangeBackground();
|
|
void _makeBackground();
|
|
void _makeTopFrame();
|
|
void _refreshStatusBar();
|
|
|
|
protected:
|
|
|
|
std::string m_sTitleText;
|
|
std::string m_strReqValue;
|
|
|
|
MSGBOX_STATE m_State;
|
|
|
|
DWORD m_dwTime;
|
|
DWORD m_dwPopEffectStartTime;
|
|
|
|
DWORD m_dwStartTime;
|
|
DWORD m_dwContinueTime;
|
|
|
|
DWORD m_dwDefaultEndMsg;
|
|
int m_nDefaultEndIndex;
|
|
|
|
KUIControlTitleBar* m_pTitleBar;
|
|
KUIControlStatusBar* m_pStatusBar;
|
|
|
|
/// Background 표시
|
|
KRect* m_pBackgroundArea;
|
|
int m_nBackgroundCount;
|
|
KSpritePrimitive* m_pBackgroundList;
|
|
|
|
/// Frame
|
|
KSpritePrimitive m_prTopFrame;
|
|
|
|
std::vector<KUIControlButton*> m_vtButtons;
|
|
|
|
KObject* m_pCallbackObj;
|
|
std::string m_msgControlId;
|
|
cMsgControlCustomizer* m_customizer; /// 2012.04.26 메세지 박스를 커스터마이징 하는 멤버 - prodongi
|
|
|
|
};
|
|
|
|
|
|
|
|
|