#include "Initialisierung.h" #include #include #include Knopf *initKnopf( int x, int y, int br, int hö, UIInit &uiFactory, int style, const char *titel ) { Knopf *ret = uiFactory.createKnopf( uiFactory.initParam ); ret->addStyle( style ); ret->setPosition( x, y ); ret->setSize( br, hö ); if( titel ) ret->setText( titel ); return ret; } KontrollKnopf *initKontrollKnopf( int x, int y, int br, int hö, UIInit &uiFactory, int style, const char *txt ) { KontrollKnopf *ret = uiFactory.createKontrollKnopf( uiFactory.initParam ); ret->addStyle( style ); if( txt ) { ret->setText( txt ); ret->setSText( txt ); } ret->setPosition( x, y ); ret->setSize( br, hö ); return ret; } Fenster *initFenster( int x, int y, int br, int hö, UIInit &uiFactory, int style, const char *titel ) { Fenster *ret = uiFactory.createFenster( uiFactory.initParam ); ret->addStyle( style ); ret->setPosition( x, y ); ret->setSize( br, hö ); if( ret->hatStyle( Fenster::Style::Titel ) ) { if( titel ) ret->setTitel( titel ); } return ret; } TextFeld *initTextFeld( int x, int y, int br, int hö, UIInit &uiFactory, int style, const char *txt ) { TextFeld *ret = uiFactory.createTextFeld( uiFactory.initParam ); ret->setStyle( style ); if( txt ) ret->setText( txt ); ret->setPosition( x, y ); ret->setSize( br, hö ); return ret; } BildZ *initBildZ( int x, int y, int br, int hö, UIInit &uiFactory, int style, Bild *b ) { BildZ *ret = uiFactory.createBildZ( uiFactory.initParam ); ret->addStyle( style ); ret->setPosition( x, y ); ret->setSize( br, hö ); if( b ) ret->setBildZ( b ); return ret; } AuswahlBox *initAuswahlBox( int x, int y, int br, int hö, UIInit &uiFactory, __int64 style, std::initializer_list< const char * > values ) { AuswahlBox *ret = uiFactory.createAuswahlBox( uiFactory.initParam ); ret->addStyle( style ); ret->setPosition( x, y ); ret->setSize( br, hö ); for( auto i = values.begin(); i != values.end(); i++ ) { ret->addEintrag( *i ); } return ret; } ObjTabelle *initObjTabelle( int x, int y, int br, int hö, UIInit &uiFactory, int style, std::initializer_list< OBJTabelleSpalteIni > spalten, int überschriftHöhe ) { ObjTabelle *ret = uiFactory.createObjTabelle( uiFactory.initParam ); ret->addStyle( style ); ret->setPosition( x, y ); ret->setSize( br, hö ); for( auto i = spalten.begin(); i != spalten.end(); i++ ) { ret->addSpalte( i->name ); ret->setSpaltenBreite( i->name, i->breite ); if( ( style | ObjTabelle::Style::SpaltenBreiteMin ) == style ) ret->setMinSpaltenBreite( i->name, i->minBreite ); if( ( style | ObjTabelle::Style::SpaltenBreiteMax ) == style ) ret->setMaxSpaltenBreite( i->name, i->maxBreite ); if( überschriftHöhe ) { if( ret->getZeilenNummer( "Überschrift" ) < 0 ) { ret->addZeile( 0, "Überschrift" ); ret->setZeilenHeight( 0, 20 ); } ret->setZeichnungZ( i->name, "Überschrift", initTextFeld( 0, 0, i->breite, 20, uiFactory, TextFeld::Style::Text, i->name ) ); } } return ret; }