201 lines
5.0 KiB
C++
201 lines
5.0 KiB
C++
#pragma once
|
|
|
|
//#include "SUIWnd.h"
|
|
#include <toolkit/khash.h>
|
|
|
|
class SGameManager;
|
|
class KUIControlStatic;
|
|
class KUIControlEdit;
|
|
|
|
namespace UIControl
|
|
{
|
|
enum CONTROL_ID
|
|
{
|
|
CONTROL_ID_NONE = 0,
|
|
CONTROL_ID_STATIC,
|
|
CONTROL_ID_EDIT,
|
|
CONTROL_ID_BUTTON,
|
|
CONTROL_ID_MAX,
|
|
};
|
|
|
|
class ControlInfo
|
|
{
|
|
public:
|
|
CONTROL_ID controlID;
|
|
const char* controlName;
|
|
|
|
ControlInfo( const char* controlname ) : controlName( controlname )
|
|
{}
|
|
};
|
|
|
|
class ControlStatic : public ControlInfo
|
|
{
|
|
public:
|
|
const char* caption_name;
|
|
|
|
ControlStatic( const char* controlname, const char* _caption_name ) : ControlInfo( controlname )
|
|
, caption_name( _caption_name )
|
|
{
|
|
controlID = CONTROL_ID_STATIC;
|
|
}
|
|
~ControlStatic()
|
|
{}
|
|
};
|
|
|
|
class ControlEdit : public ControlInfo
|
|
{
|
|
public:
|
|
int limit_text;
|
|
bool buffer_limit;
|
|
bool password;
|
|
bool bFirstFocus;
|
|
|
|
ControlEdit( const char* controlname, int _limit_text,
|
|
bool _buffer_limit, bool _password, bool _bFirstFocus ) : ControlInfo( controlname )
|
|
, limit_text( _limit_text )
|
|
, buffer_limit( _buffer_limit )
|
|
, password( _password )
|
|
, bFirstFocus( _bFirstFocus )
|
|
{
|
|
controlID = CONTROL_ID_EDIT;
|
|
}
|
|
~ControlEdit()
|
|
{}
|
|
};
|
|
|
|
class ControlButton : public ControlInfo
|
|
{
|
|
public:
|
|
const char* caption_name;
|
|
bool bEnable;
|
|
|
|
ControlButton( const char* controlname, const char* _caption_name, bool _bEnable ) : ControlInfo( controlname )
|
|
, caption_name( _caption_name )
|
|
, bEnable( _bEnable )
|
|
{
|
|
controlID = CONTROL_ID_BUTTON;
|
|
}
|
|
~ControlButton()
|
|
{}
|
|
};
|
|
|
|
struct ControlInfoMgr
|
|
{
|
|
std::vector< ControlInfo* > vControlInfo;
|
|
|
|
ControlInfoMgr()
|
|
{}
|
|
~ControlInfoMgr()
|
|
{
|
|
std::vector< ControlInfo* >::iterator it_control = vControlInfo.begin();
|
|
while( it_control != vControlInfo.end() )
|
|
{
|
|
SAFE_DELETE( (*it_control) );
|
|
it_control = vControlInfo.erase( it_control );
|
|
}
|
|
|
|
vControlInfo.clear();
|
|
}
|
|
};
|
|
};
|
|
|
|
typedef KHash< UIControl::ControlInfoMgr*, hashPr_mod_basic<UIControl::CONTROL_ID> > hash_control;
|
|
typedef KHash< UIControl::ControlInfoMgr*, hashPr_mod_basic<UIControl::CONTROL_ID> >::node* node_control;
|
|
typedef std::vector< UIControl::ControlInfo* >::iterator iter_controlinfo;
|
|
|
|
class SUISecurityWnd : public SUIWnd
|
|
{
|
|
protected:
|
|
hash_control m_vControlInfo;
|
|
public:
|
|
virtual bool InitControls( KPoint kPos );
|
|
virtual void ProcMsgAtStatic( SGameMessage* pMsg );
|
|
virtual void PumpUpMessage( LPCSTR lpszControlID, DWORD nMessage, DWORD lparam, DWORD wparam );
|
|
virtual bool InitData( bool bReload = false );
|
|
virtual void Process(DWORD dwTime);
|
|
virtual void OnNotifyUIWindowOpen( bool bOpen, bool bLimitWnd = true );
|
|
virtual DWORD OnMouseMessage(DWORD dwMessage, int x, int y);
|
|
public:
|
|
virtual void OnBnClickedButtonOk() { assert( false ); }
|
|
virtual void OnBnClickedButtonCancel() { assert( false ); }
|
|
virtual void OnBnClickedButtonHelp() { }
|
|
virtual void OnEditChange( LPCSTR lpszControlID ) { assert( false ); }
|
|
|
|
void AddControlInfo( UIControl::ControlInfo* pControlInfo );
|
|
void InitializeControl( UIControl::ControlInfo* pControl );
|
|
|
|
UIControl::ControlInfoMgr* GetControlMgr( UIControl::CONTROL_ID controlid );
|
|
|
|
|
|
bool FindSpecialChar( const char* string );
|
|
public:
|
|
SUISecurityWnd( SGameManager* pGameManager );
|
|
virtual ~SUISecurityWnd();
|
|
};
|
|
|
|
/// 보안 설정
|
|
class SUISecuritySettingWnd : public SUISecurityWnd
|
|
{
|
|
public:
|
|
virtual void OnBnClickedButtonOk();
|
|
virtual void OnBnClickedButtonCancel();
|
|
public:
|
|
SUISecuritySettingWnd( SGameManager* pGameManager );
|
|
virtual ~SUISecuritySettingWnd();
|
|
};
|
|
|
|
/// 보안 설정 변경
|
|
class SUISecuritySettingModifyWnd : public SUISecurityWnd
|
|
{
|
|
public:
|
|
virtual void OnBnClickedButtonOk();
|
|
virtual void OnBnClickedButtonCancel();
|
|
public:
|
|
SUISecuritySettingModifyWnd( SGameManager* pGameManager );
|
|
virtual ~SUISecuritySettingModifyWnd();
|
|
};
|
|
|
|
/// 보안 삭제
|
|
class SUISecurityClearWnd : public SUISecurityWnd
|
|
{
|
|
public:
|
|
virtual void OnBnClickedButtonOk();
|
|
virtual void OnBnClickedButtonCancel();
|
|
public:
|
|
SUISecurityClearWnd( SGameManager* pGameManager );
|
|
virtual ~SUISecurityClearWnd();
|
|
};
|
|
|
|
/// 캐릭터 보안
|
|
class SUISecurityCharacterWnd : public SUISecurityWnd
|
|
{
|
|
private:
|
|
int m_nMode;
|
|
public:
|
|
void SetMode( int mode ) { m_nMode = mode; }
|
|
int GetMode() { return m_nMode; }
|
|
public:
|
|
virtual void OnBnClickedButtonOk();
|
|
virtual void OnBnClickedButtonCancel();
|
|
virtual void OnBnClickedButtonHelp();
|
|
public:
|
|
SUISecurityCharacterWnd( SGameManager* pGameManager );
|
|
virtual ~SUISecurityCharacterWnd();
|
|
};
|
|
|
|
/// 창고 보안
|
|
class SUISecurityStorageWnd : public SUISecurityWnd
|
|
{
|
|
private:
|
|
int m_nMode;
|
|
public:
|
|
void SetMode( int mode ) { m_nMode = mode; }
|
|
int GetMode() { return m_nMode; }
|
|
public:
|
|
virtual void OnBnClickedButtonOk();
|
|
virtual void OnBnClickedButtonCancel();
|
|
virtual void OnBnClickedButtonHelp();
|
|
public:
|
|
SUISecurityStorageWnd( SGameManager* pGameManager );
|
|
virtual ~SUISecurityStorageWnd();
|
|
}; |