[uni GSoC] Some initial GUI code
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/uni@12876 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
f863609de8
commit
609c908101
29
data/gui/login_dialog.stkgui
Normal file
29
data/gui/login_dialog.stkgui
Normal file
@ -0,0 +1,29 @@
|
||||
<stkgui>
|
||||
|
||||
<div x="2%" y="10%" width="96%" height="80%" layout="vertical-row" >
|
||||
|
||||
|
||||
<label id="title" width="100%" text_align="center" word_wrap="true"
|
||||
I18N="In the 'add new player' dialog" text="Sign in" proportion="1" />
|
||||
|
||||
<spacer height="25" width="10" />
|
||||
|
||||
|
||||
<div width="75%" height="fit" layout="horizontal-row" >
|
||||
<label proportion="1" height="100%" text_align="center" I18N="In the login form" text="Username"/>
|
||||
<div proportion="1" height="fit" layout="horizontal-row" >
|
||||
<textbox id="username" width="100%" I18N="In the 'login' dialog" align="center"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<spacer height="20" width="20" />
|
||||
|
||||
<!-- TODO: ok button? -->
|
||||
|
||||
<button id="cancel" I18N="When configuring input" text="Press ESC to cancel" align="center"/>
|
||||
|
||||
<spacer height="15" width="20" />
|
||||
|
||||
</div>
|
||||
|
||||
</stkgui>
|
@ -50,6 +50,12 @@ LoginDialog::LoginDialog(const float w, const float h) :
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
LoginDialog::~LoginDialog()
|
||||
{
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
GUIEngine::EventPropagation LoginDialog::processEvent(const std::string& eventSource)
|
||||
{
|
||||
if (eventSource == "cancel")
|
||||
@ -89,10 +95,9 @@ void LoginDialog::onEnterPressedInternal()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (size > 0 && nonEmptyChars > 0)
|
||||
{
|
||||
Log::info("Login Dialog","Username : '%s'",username.c_str());
|
||||
Log::info("Login Dialog","Username : %ls", username.c_str());
|
||||
// It's unsafe to delete from inside the event handler so we do it
|
||||
// in onUpdate (which checks for m_self_destroy)
|
||||
m_self_destroy = true;
|
||||
|
Loading…
Reference in New Issue
Block a user