📄 cinputdlg.cpp
字号:
/*
Crazy Eggs Remade By Kevin Lynx
File : CInputDlg.cpp
Desc : create an input dialog, to get the player's name
Aurhor : Kevin Lynx
Date : 2007.1.25
*/
#include "CInputDlg.h"
#include "../CGame.h"
#include "../resourceGen/res.h"
#include "../memleak.h"
CInputDlg::CInputDlg( int id ) :
Dialog( DIALOG_SMALL, DIALOG_BTN, id, true, "Congratulation", "", "OK", Dialog::BUTTONS_FOOTER )
{
mTextAlign = 2;
SetHeaderFont( NORMAL_FONT );
SetLinesFont( NORMAL_FONT );
SetButtonFont( NORMAL_FONT );
SetColor( Dialog::COLOR_HEADER, Color( 0, 0, 255 ) );
SetColor( Dialog::COLOR_BUTTON_TEXT, Color( 255, 237, 120 ) );
SetColor( Dialog::COLOR_LINES, Color( 255, 250, 50 ) );
mContentInsets = Insets( 45, 60, 45, 50 );
mSpaceAfterHeader = 20;
mDialogLines = "You have entered in the HIGH SCORES!\nPlease input your name :";
Resize( ( G_WINDOW_WIDTH - 380 ) / 2, ( G_WINDOW_HEIGHT - 300 ) / 2, 380, 300 );
//create the edit widget
m_editor = new EditWidget( EDIT_ID, this );
m_editor->SetFont( NORMAL_FONT );
m_editor->mMaxChars = 15;
m_editor->SetColor( EditWidget::COLOR_BKG, Color( 211, 180, 100 ) );
m_editor->SetColor( EditWidget::COLOR_TEXT, Color( 154, 84, 24 ) );
m_editor->Resize( mX + mContentInsets.mLeft + 10, mY + 170,
150, 25 );
}
CInputDlg::~CInputDlg()
{
delete m_editor;
}
void CInputDlg::Draw( Graphics *g )
{
Dialog::Draw( g );
}
void CInputDlg::AddedToManager( WidgetManager *theWidgetManager )
{
Dialog::AddedToManager( theWidgetManager );
theWidgetManager->AddWidget( m_editor );
}
void CInputDlg::RemovedFromManager( WidgetManager *theWidgetManager )
{
Dialog::RemovedFromManager( theWidgetManager );
theWidgetManager->RemoveWidget( m_editor );
}
void CInputDlg::ButtonDepress( int theId )
{
Dialog::ButtonDepress( theId );
if( mId == DLG_ID && //if outworld donot specify it's id,
theId == ID_FOOTER )
{
gSexyAppBase->KillDialog( this );
}
}
//*/
void CInputDlg::MouseDrag( int x, int y )
{
//to make it canot be moved
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -