ScreenTextEntry::TextEntry
This commit is contained in:
@@ -37,6 +37,34 @@ float GetButtonY( KeyboardRow r )
|
||||
}
|
||||
|
||||
CString ScreenTextEntry::s_sLastAnswer = "";
|
||||
|
||||
void ScreenTextEntry::TextEntry(
|
||||
ScreenMessage smSendOnPop,
|
||||
CString sQuestion,
|
||||
CString sInitialAnswer,
|
||||
int iMaxInputLength,
|
||||
bool(*Validate)(CString sAnswer,CString &sErrorOut),
|
||||
void(*OnOK)(CString sAnswer),
|
||||
void(*OnCancel)(),
|
||||
bool bPassword
|
||||
)
|
||||
{
|
||||
// add the new state onto the back of the array
|
||||
ScreenTextEntry *pNewScreen = new ScreenTextEntry(
|
||||
"ScreenTextEntry",
|
||||
smSendOnPop,
|
||||
sQuestion,
|
||||
sInitialAnswer,
|
||||
iMaxInputLength,
|
||||
Validate,
|
||||
OnOK,
|
||||
OnCancel,
|
||||
bPassword );
|
||||
pNewScreen->Init();
|
||||
SCREENMAN->ZeroNextUpdate();
|
||||
SCREENMAN->SetFromNewScreen( pNewScreen );
|
||||
}
|
||||
|
||||
bool ScreenTextEntry::s_bCancelledLast = false;
|
||||
|
||||
/* XXX: Don't let the user use internal-use codepoints (those
|
||||
|
||||
@@ -27,6 +27,21 @@ enum KeyboardRowSpecialKey
|
||||
class ScreenTextEntry : public Screen
|
||||
{
|
||||
public:
|
||||
static void TextEntry(
|
||||
ScreenMessage smSendOnPop,
|
||||
CString sQuestion,
|
||||
CString sInitialAnswer,
|
||||
int iMaxInputLength,
|
||||
bool(*Validate)(CString sAnswer,CString &sErrorOut) = NULL,
|
||||
void(*OnOK)(CString sAnswer) = NULL,
|
||||
void(*OnCanel)() = NULL,
|
||||
bool bPassword = false
|
||||
);
|
||||
static void Password( ScreenMessage smSendOnPop, const CString &sQuestion, void(*OnOK)(CString sPassword) = NULL, void(*OnCanel)() = NULL )
|
||||
{
|
||||
TextEntry( smSendOnPop, sQuestion, "", 255, NULL, OnOK, OnCanel, true );
|
||||
}
|
||||
|
||||
ScreenTextEntry(
|
||||
CString sName,
|
||||
ScreenMessage smSendOnPop,
|
||||
|
||||
Reference in New Issue
Block a user