ScreenTextEntry::TextEntry

This commit is contained in:
Glenn Maynard
2005-07-03 04:42:47 +00:00
parent 1e894d05bb
commit ea97ec6095
2 changed files with 43 additions and 0 deletions
+28
View File
@@ -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
+15
View File
@@ -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,