12345678910111213141516171819202122232425262728293031323334353637 |
- #include "Login.h"
- #include "Initialisierung.h"
- #include "Globals.h"
- LoginMenu::LoginMenu( Bildschirm* zScreen )
- : Menu( zScreen )
- {
- elements.add( initTextFeld( 10, 10, 90, 20, TextFeld::Style::Text, "Name: " ) );
- elements.add( initTextFeld( 10, 35, 90, 20, TextFeld::Style::Text, "Passwort: " ) );
- name = initTextFeld( 100, 10, 200, 20, TextFeld::Style::TextFeld, "Kolja" );
- password = initTextFeld( 100, 35, 200, 20, TextFeld::Style::TextFeld, "1rg3ndw13" );
- password->setSchowChar( '*' );
- elements.add( name );
- elements.add( password );
- Knopf* login = initKnopf( 200, 60, 100, 20, Knopf::Style::Normal, "Login" );
- login->setMausEreignis( [this, login]( void* p, void* o, MausEreignis me ) {
- if( me.id == ME_RLinks )
- {
- login->removeStyle( Knopf::Style::Erlaubt );
- name->removeStyle( TextFeld::Style::Erlaubt );
- password->removeStyle( TextFeld::Style::Erlaubt );
- if( network->login( name->zText()->getText(), password->zText()->getText() ) )
- {
- hide();
- menuRegister->get( "directConnect" )->show();
- }
- name->addStyle( TextFeld::Style::Erlaubt );
- password->addStyle( TextFeld::Style::Erlaubt );
- login->addStyle( Knopf::Style::Erlaubt );
- }
- return 1;
- } );
- elements.add( login );
- }
- void LoginMenu::onLoadingFinished()
- {}
|