예제 #1
0
파일: fightResult.cpp 프로젝트: q4a/attal
CasualtiesList::CasualtiesList( QWidget * parent, const char * name )
    : QWidget( parent, name )
{
    _present = new QFrame( this );
    _present->setFrameStyle( QFrame::Box | QFrame::Raised );
    _present->setLineWidth( 1 );
    _present->setMidLineWidth( 1 );
    _present->setFixedHeight( 44 );

    _none = new QLabel( _present );
    _none->setText( "None" );
    _none->setFixedSize( _none->sizeHint() );

    _layPresent = new QHBoxLayout( _present );
    _layPresent->addStretch( 1 );
    _layPresent->addWidget( _none );
    _layPresent->addStretch( 1 );
    _layPresent->activate();

    _numbers = new QFrame( this );
    _numbers->setFixedHeight( 10 );

    _layNumbers = new QHBoxLayout( _numbers );
    _layNumbers->addStretch( 1 );
    _layNumbers->activate();

    QVBoxLayout * layout = new QVBoxLayout( this );
    layout->addWidget( _present, 1 );
    layout->addWidget( _numbers, 1 );
    layout->activate();

    setFixedHeight( 54 );
}
예제 #2
0
파일: sectionLord.cpp 프로젝트: q4a/attal
EditTroop::EditTroop( int num, QWidget * parent, const char * /* name*/ )
	: QFrame( parent )
{
	_unit = 0;
	setFrameStyle( QFrame::Panel | QFrame::Raised );
	
	QVBoxLayout * layout = new QVBoxLayout( this );
	layout->setMargin( 5 );
	layout->setSpacing( 5 );
	
	QLabel * label = new QLabel( this );
	label->setText(  "Unit " + QString::number( num )  );
	FIXEDSIZE( label );
	layout->addWidget( label );

	_race = new AskCombo( tr( "Race : " ), this );
	_race->setCurrentItem( 0 );
	layout->addWidget( _race );

	_name = new AskCombo( tr( "Name : " ), this );
	layout->addWidget( _name );

	_number = new AskInt( tr( "Number : " ), this );
	layout->addWidget( _number );
	
	layout->addStretch( 1 );
	layout->activate();
	
	updateData();
	
	connect( _race, SIGNAL( sig_activated( int ) ), SLOT( slot_raceChanged( int ) ) );
}
예제 #3
0
파일: gameControl.cpp 프로젝트: q4a/attal
CentralControl::CentralControl( QWidget * parent, const char * name )
	:QWidget( parent, name )
{
	_player = 0;
	
	QVBoxLayout * layout = new QVBoxLayout( this );
	
	layout->addStretch( 1 );
	
	QWidget * w1 = new QWidget( this );
	w1->setFixedSize( 100, 40 );
	QPushButton * pb11 = new QPushButton( w1 );
	pb11->setFixedSize( 50, 40 );
	QPushButton * pb12 = new QPushButton( w1 );
	pb12->setFixedSize( 50, 40 );
	pb12->move( 50, 0 );
	layout->addWidget( w1 );
	
	QWidget * w2 = new QWidget( this );
	w2->setFixedSize( 100, 40 );
	QPushButton * pb21 = new QPushButton( w2 );
	pb21->setFixedSize( 50, 40 );
	QPushButton * pb22 = new QPushButton( w2 );
	pb22->setFixedSize( 50, 40 );
	pb22->move( 50, 0 );
	layout->addWidget( w2 );
	
	QWidget * w3 = new QWidget( this );
	w3->setFixedSize( 100, 40 );
	_pbQuit = new QPushButton( w3 );
	_pbQuit->setFixedSize( 50, 40 );
	_pbQuit->setText( "Quit" );
	_pbQuit->move( 50, 0 );
	layout->addWidget( w3 );
	
	QWidget * w4 = new QWidget( this );
	w4->setFixedSize( 100, 40 );
	_pbNext = new QPushButton( w4 );
	_pbNext->setFixedSize( 100, 40 );	
	_pbNext->setText( "Next Lord" );
	layout->addWidget( w4 );
	
	QWidget * w5 = new QWidget( this );
	w5->setFixedSize( 100, 40 );
	_pbTurn = new QPushButton( w5 );
	_pbTurn->setFixedSize( 100, 40 );	
	_pbTurn->setText( "End Turn" );
	layout->addWidget( w5 );	
		
	layout->addStretch( 1 );
	
	layout->activate();
	setFixedSize( 100, 210 );

	connect( _pbQuit, SIGNAL( clicked() ), qApp, SLOT( quit() ) );
	connect( _pbNext, SIGNAL( clicked() ), SLOT( slot_nextLord() ) );
	connect( _pbTurn, SIGNAL( clicked() ), SIGNAL( sig_endTurn() ) );
	
	disableGame();
}
예제 #4
0
PDB_UserInfo::PDB_UserInfo(QWidget *parent) : QWidget(parent) {
  QVBoxLayout *tl = new QVBoxLayout(this, 10, 10);
  QLabel *l = new QLabel(i18n("To log on to your ISP, kppp needs the username\n"
			    "and the password you got from your ISP. Type\n"
			    "in this information in the fields below.\n\n"
			    "Word case is important here."),
		       this);
  tl->addWidget(l);

  QGridLayout *l1 = new QGridLayout(2, 2);
  tl->addLayout(l1);
  l = new QLabel(i18n("Username:"******"Password:"), this);
  l1->addWidget(l, 1, 0);
  _username = newLineEdit(24, this);
  connect(_username, SIGNAL(textChanged(const QString &)),
	  this, SLOT(textChanged(const QString &)));
  l1->addWidget(_username, 0, 1);
  _password = newLineEdit(24, this);
  _password->setEchoMode(QLineEdit::Password);
  connect(_password, SIGNAL(textChanged(const QString &)),
	  this, SLOT(textChanged(const QString &)));
  l1->addWidget(_password, 1, 1);
  tl->activate();
}
예제 #5
0
파일: market.cpp 프로젝트: q4a/attal
Market::Market( int nb, QWidget * parent, const char * name )
	: QDialog( parent, name, true )
{
	_prices = new PriceMarket();
	
	setCaption( "Marketplace" );
	
	QVBoxLayout * layout = new QVBoxLayout( this );
		     
	QHBoxLayout * layH1 = new QHBoxLayout();
	_own = new DisplayRessources( nb, this );
	_own->setTitle( "Kingdom ressources" );
	layH1->addWidget( _own, 1 );
	
	_other = new DisplayRessources( nb, this );
	_other->setTitle( "Available for trade" );
	layH1->addWidget( _other, 1 );
	
	layout->addLayout( layH1, 1 );
	
	_exchange = new ExchangeRessources( this );
	layout->addWidget( _exchange );
	
	layout->setMargin( 2 );
	layout->activate();
	
	connect( _exchange, SIGNAL( sig_quit() ), SLOT( accept() ) );
	connect( _own, SIGNAL( sig_ressource( int ) ), SLOT( slot_ownRessource( int ) ) );
	connect( _other, SIGNAL( sig_ressource( int ) ), SLOT( slot_otherRessource( int ) ) );
}
예제 #6
0
파일: questEditor.cpp 프로젝트: q4a/attal
QuestEditor::QuestEditor( QWidget * parent, const char * name )
: QDialog( parent )
{
	setWindowTitle( QString ( name ));
	_quest = 0;

	_name = new AskString( tr( "Name: " ), this );
	_description = new AskString( tr( "Description: " ), this );
	_type = new AskCombo( tr( "Type: " ), this );
	_type->insertItem( Quest::getTypeName( Quest::ONLY_ONE ) );
	_type->insertItem( Quest::getTypeName( Quest::ONE_PERPLAYER ) );
	_type->insertItem( Quest::getTypeName( Quest::ONE_PERLORD ) );
	_type->insertItem( Quest::getTypeName( Quest::ANYONE ) );
	_needConfirmation = new AskBool( tr( "Ask player confirmation of quest" ), this );
	_confirmationQuestion = new AskString( tr( "Confirmation question: " ), this );

	QPushButton * pbOk = new QPushButton( this );
	pbOk->setText( tr( "Ok" ) );
	FIXEDSIZE( pbOk );

	QPushButton * pbCancel = new QPushButton( this );
	pbCancel->setText( tr( "Cancel" ) );
	FIXEDSIZE( pbCancel );

	QHBoxLayout * layH = new QHBoxLayout();
	layH->addStretch( 1 );
	layH->addWidget( pbOk );
	layH->addStretch( 1 );
	layH->addWidget( pbCancel );
	layH->addStretch( 1 );

	_editStartCondition = new QuestConditionEditor( this );
	_editStartCondition->setTitle( tr( "Start condition: " ) );

	_editFailCondition = new QuestConditionEditor( this );
	_editFailCondition->setTitle( tr( "Fail condition: " ) );

	_editSuccessCondition = new QuestConditionEditor( this );
	_editSuccessCondition->setTitle( tr( "Success condition: " ) );

	QVBoxLayout * layout = new QVBoxLayout( this );
	layout->setMargin( 5 );
	layout->setSpacing( 5 );
	layout->addWidget( _name );
	layout->addWidget( _description );
	layout->addWidget( _type );
	layout->addWidget( _needConfirmation );
	layout->addWidget( _confirmationQuestion );
	layout->addWidget( _editStartCondition );
	layout->addWidget( _editFailCondition );
	layout->addWidget( _editSuccessCondition );
	layout->addStretch( 1 );
	layout->addLayout( layH );
	layout->activate();

	connect( pbOk, SIGNAL( clicked() ), SLOT( accept() ) );
	connect( pbCancel, SIGNAL( clicked() ), SLOT( reject() ) );
	connect( _needConfirmation, SIGNAL( sig_changed() ), SLOT( slot_confirmation() ) );
	slot_confirmation();
}
예제 #7
0
파일: dlgopt.cpp 프로젝트: nrj123/pvb
DlgOpt::DlgOpt(QWidget *parent) : QDialog(parent)
{
  initDialog();

  filename = "";

  QObject::connect(QPushButton_ok,    SIGNAL(clicked()),this,SLOT(okClicked()));
  QObject::connect(QPushButton_cancel,SIGNAL(clicked()),this,SLOT(reject()));
  edit1->setLineWrapMode(QTextEdit::NoWrap);

  /* add layout begin */
  QVBoxLayout *vlayout = new QVBoxLayout(this);
  QHBoxLayout *hlayout = new QHBoxLayout();

  vlayout->addWidget(edit1);
  vlayout->addLayout(hlayout);
  hlayout->addSpacing(10);
  hlayout->addSpacing(200);
  hlayout->addWidget(QPushButton_cancel);
  hlayout->addSpacing(10);
  hlayout->addWidget(QPushButton_ok);
  hlayout->addSpacing(200);
  vlayout->activate();
  /* add layout end */
}
예제 #8
0
파일: sectionLord.cpp 프로젝트: q4a/attal
DisplayTroops::DisplayTroops( QWidget * parent, const char * /* name */ )
	: QWidget( parent )
{
	int i;

	QVBoxLayout * layout = new QVBoxLayout( this );
	layout->setMargin( 5 );
	layout->setSpacing( 5 );

	QHBoxLayout * lay2 = new QHBoxLayout();
	lay2->setMargin( 5 );
	lay2->setSpacing( 5 );

	for( i = 0; i < 4; i++ ) {
		_troop[i] = new EditTroop( i, this );
		lay2->addWidget( _troop[i] );
	}
	lay2->addStretch( 1 );
	layout->addLayout( lay2 );
	
	QHBoxLayout * lay3 = new QHBoxLayout();
	lay3->setMargin( 5 );
	lay3->setSpacing( 5 );
	
	for( i = 4; i < MAX_UNIT; i++ ) {
		_troop[i] = new EditTroop( i, this );
		lay3->addWidget( _troop[i] );
	}
	lay3->addStretch( 1 );
	layout->addLayout( lay3 );
		
	layout->addStretch( 1 );
	layout->activate();
}
예제 #9
0
파일: market.cpp 프로젝트: q4a/attal
ExchangeRessources::ExchangeRessources( QWidget * parent, const char * name )
	: QWidget( parent, name )
{
	_prices = new PriceMarket();
	setFixedHeight( 200 );
	
	QVBoxLayout * layout = new QVBoxLayout( this );
	
	QHBoxLayout * layH1 = new QHBoxLayout();
	
	layH1->addStretch( 2 );
	_icoLeft = new RessourceIcon( this );
	layH1->addWidget( _icoLeft );
	layH1->addSpacing( 25 );
	
	_scroll = new QScrollBar( QScrollBar::Horizontal, this );
	layH1->addWidget( _scroll, 1 );
	layH1->addSpacing( 25 );
	
	_icoRight = new RessourceIcon( this );
	layH1->addWidget( _icoRight );
	layH1->addStretch( 2 );
	
	layout->addLayout( layH1 );
	
	QHBoxLayout * layH2 = new QHBoxLayout();
	
	layH2->addStretch( 1 );
	
	_butAll = new QPushButton( this );
	_butAll->setText( "All" );
	_butAll->setFixedSize( 50, 40 );
	layH2->addWidget( _butAll );
	layH2->addSpacing( 50 );
	
	_butBuy = new QPushButton( this );
	_butBuy->setText( "Buy" );
	_butBuy->setFixedSize( 50, 40 );
	layH2->addWidget( _butBuy );
	
	layH2->addStretch( 1 );

	QPushButton * butOk = createButtonOk( this );
	layH2->addWidget( butOk );
	
	layout->addLayout( layH2 );
	
	layout->activate();
	
	connect( butOk, SIGNAL( clicked() ), SIGNAL( sig_quit() ) );
	connect( _butAll, SIGNAL( clicked() ), SLOT( slot_all() ) );
	connect( _butBuy, SIGNAL( clicked() ), SLOT( slot_buy() ) );
	connect( _scroll, SIGNAL( valueChanged( int ) ), SLOT( slot_value( int ) ) );
	
	clear();
}
예제 #10
0
DisplayArtefacts::DisplayArtefacts( Player * player, QWidget * parent, const char * /* name */ )
	: QFrame( parent )
{
	_player = player;
	_index = 0;
	uint i;

	QPalette palette;
	palette.setBrush(backgroundRole(), QBrush(QPixmap(IMAGE_PATH + "misc/artefactLord.png")));
	setPalette(palette);

	QVBoxLayout * layout = new QVBoxLayout( this );
	layout->setMargin( 5 );
	layout->addStretch( 1 );

	QHBoxLayout * layH1 = new QHBoxLayout();

	QPushButton * pb1 = new QPushButton( this );
	pb1->setText( "<" );
	FIXEDSIZE( pb1 );
	layH1->addWidget( pb1 );

/// XXX : to remove cause use the old api for artefacts (no more used), leave it as example for a new
	/// function that match new api...
/*
	/// WIN: was "_used = new (IconArtefact *) [DataTheme.specifications.getArtefactNumber()];"
	_used = new IconArtefact * [DataTheme.specifications.getArtefactNumber()];
	SpecificationArtefact * temp;

	for( i = 0; i < DataTheme.specifications.getArtefactNumber(); i++ ) {
		temp = DataTheme.specifications.getArtefact( i );
		//_used[i] = new IconArtefact( this );
		//_used[i]->move( temp->getX(), temp->getY() );
	}
*/
	layH1->addStretch( 1 );

	for( i = 0; i < 3; i++ ) {
		_ico[i] = new IconArtefact( this );
		_ico[i]->clear();
		layH1->addWidget( _ico[i] );
	}

	layH1->addStretch( 1 );
	QPushButton * pb2 = new QPushButton( this );
	pb2->setText( ">" );
	FIXEDSIZE( pb2 );
	layH1->addWidget( pb2 );

	layout->addLayout( layH1 );

	layout->activate();

	connect( pb1, SIGNAL( clicked() ), SLOT( slot_prevArtefact() ) );
	connect( pb2, SIGNAL( clicked() ), SLOT( slot_nextArtefact() ) );
}
예제 #11
0
Editor::Editor
(
	QWidget* parent,
	const char* name
)
    :
    QDialog( parent, name, true, 0 ), tiles(false)
{

    clean= true;
    numTiles=0;
    mode = insert;

    int sWidth = (BoardLayout::width+2)*(tiles.qWidth());
    int sHeight =( BoardLayout::height+2)*tiles.qHeight();

    sWidth += 4*tiles.shadowSize();

    drawFrame = new FrameImage( this, "drawFrame" );
    drawFrame->setGeometry( 10, 40 ,sWidth ,sHeight);
    drawFrame->setMinimumSize( 0, 0 );
    drawFrame->setMaximumSize( 32767, 32767 );
    drawFrame->setFocusPolicy( QWidget::NoFocus );
    drawFrame->setBackgroundMode( QWidget::PaletteBackground );
    drawFrame->setFrameStyle( 49 );
    drawFrame->setMouseTracking(true);

   // setup the tool bar
   setupToolbar();

   QVBoxLayout *layout = new QVBoxLayout(this, 1);
   layout->addWidget(topToolbar,0);
   layout->addWidget(drawFrame,1);
   layout->activate();

    resize( sWidth+60, sHeight+60);
    setMinimumSize( sWidth+60, sHeight+60);
    setMaximumSize( sWidth+60, sHeight+60);

   QString tile = Prefs::tileSet();
   tiles.loadTileset(tile);

   // tell the user what we do
   setCaption(kapp->makeStdCaption(i18n("Edit Board Layout")));


   connect( drawFrame, SIGNAL(mousePressed(QMouseEvent *) ),
		SLOT(drawFrameMousePressEvent(QMouseEvent *)));
   connect( drawFrame, SIGNAL(mouseMoved(QMouseEvent *) ),
		SLOT(drawFrameMouseMovedEvent(QMouseEvent *)));

   statusChanged();

   update();
}
예제 #12
0
파일: unitExchange.cpp 프로젝트: q4a/attal
UnitExchange::UnitExchange( QWidget * parent, const char * /* name */)
	: QDialog( parent, Qt::Dialog )
{
	QVBoxLayout * layout = new QVBoxLayout( this );
	layout->addStretch( 1 );
	
	QHBoxLayout * layH1 = new QHBoxLayout();
	layH1->addStretch( 1 );
	_icoLeft = new Icon( this );
	layH1->addWidget( _icoLeft );
	layH1->addStretch( 2 );
	_icoRight = new Icon( this );
	layH1->addWidget( _icoRight );
	layH1->addStretch( 1 );
	layout->addLayout( layH1 );
	
	QHBoxLayout * layH2 = new QHBoxLayout();
	layH2->addStretch( 1 );
	_leftLCD = new QLCDNumber( this );
	layH2->addWidget( _leftLCD );
	layH2->addStretch( 2 );
	_rightLCD = new QLCDNumber( this );
	layH2->addWidget( _rightLCD );
	layH2->addStretch( 1 );
	layout->addLayout( layH2 );
	
	QHBoxLayout * layH3 = new QHBoxLayout();
	layH3->addStretch( 1 );
	_scroll = new QScrollBar( Qt::Horizontal, this );
	layH3->addWidget( _scroll, 2 );
	layH3->addStretch( 1 );
	layout->addLayout( layH3 );

	layout->addSpacing( 5 );
	layout->addStretch( 1 );

	QHBoxLayout * layH4 = new QHBoxLayout();
	layH4->addStretch( 1 );
	AttalButton * pbCancel = new AttalButton( this, AttalButton::BT_CANCEL );	
	layH4->addWidget( pbCancel );
	layH4->addStretch( 1 );
	AttalButton * pbOk = new AttalButton( this, AttalButton::BT_OK );
	layH4->addWidget( pbOk );
	layH4->addStretch( 1 );
	layout->addLayout( layH4 );

	layout->addSpacing( 5 );

	layout->activate();
	connect( _scroll, SIGNAL( valueChanged( int ) ), SLOT( slot_barScrolled( int ) ) );
	connect( pbOk, SIGNAL( clicked() ), SLOT( slot_ok() ) );
	connect( pbCancel, SIGNAL( clicked() ), SLOT( slot_cancel() ) );
	
	setFixedSize( 190, 220 );
}
예제 #13
0
KFindTextDialog::KFindTextDialog( QWidget *parent, const char *name )
    : QDialog( parent, name )
{
    // mimimise initial size of dialog
    resize( 0, 0 );

    QVBoxLayout *vl = new QVBoxLayout( this, 15 );

    QHBoxLayout *hl = new QHBoxLayout( 15 );
    vl->addLayout( hl );

    QLabel *label = new QLabel( i18n( "Find:" ), this );
    label->setFixedSize( label->sizeHint() );

    QLineEdit *edit = new QLineEdit( this );
    edit->setFixedHeight( edit->sizeHint().height() );
    edit->setFocus();
    connect( edit, SIGNAL( textChanged( const char * ) ),
		    SLOT( slotTextChanged( const char * ) ) );

    hl->addWidget( label );
    hl->addWidget( edit );

    hl = new QHBoxLayout;
    vl->addLayout( hl );

    QCheckBox *cb = new QCheckBox( i18n( "Case &sensitive" ), this );
    connect( cb, SIGNAL( toggled( bool ) ), this, SLOT( slotCase( bool ) ) );
    cb->setFixedSize( cb->sizeHint() );
    hl->addWidget( cb );

    hl->addStretch();

    hl = new QHBoxLayout( 15 );
    vl->addLayout( hl );

    QPushButton *btn = new QPushButton( i18n( "&Find" ), this );
    btn->setFixedSize( btn->sizeHint() );
    btn->setDefault( true );
    connect( btn, SIGNAL( clicked() ), this, SLOT( slotFind() ) );
    hl->addWidget( btn );

    hl->addStretch();

    btn = new QPushButton( i18n( "&Close" ), this );
    btn->setFixedSize( btn->sizeHint() );
    connect( btn, SIGNAL( clicked() ), this, SLOT( slotClose() ) );
    hl->addWidget( btn );

    vl->activate();

    rExp.setCaseSensitive( false );
}
예제 #14
0
KLocaleConfig::KLocaleConfig(QWidget *parent, const char *name)
  : KConfigWidget (parent, name)
{
  QVBoxLayout *tl = new QVBoxLayout(this, 10, 10);
  QGridLayout *tl1 = new QGridLayout(5, 4, 5);
  tl->addLayout(tl1);
  tl->addStretch(1);

  gbox = new QGroupBox(klocale->translate("Language"), this);
  tl1->addMultiCellWidget(gbox, 0, 4, 0, 3);
  tl1->addRowSpacing(0, 10);
  tl1->addRowSpacing(4, 15);
  tl1->addColSpacing(0, 10);
  tl1->addColSpacing(3, 10);
  tl1->setColStretch(2, 1);

  changedFlag = FALSE;
 
  QLabel *label = new QLabel(klocale->translate("First"), gbox);
  label->setMinimumSize(label->sizeHint());
  combo1 = new KLanguageCombo(gbox);
  combo1->setMinimumWidth(combo1->sizeHint().width());
  combo1->setFixedHeight(combo1->sizeHint().height());
  label->setBuddy(combo1);
  connect(combo1,SIGNAL(highlighted(int)),this,SLOT(changed(int)));
  tl1->addWidget(label, 1, 1);
  tl1->addWidget(combo1, 1, 2);

  label = new QLabel(klocale->translate("Second"), gbox);
  label->setMinimumSize(label->sizeHint());
  combo2 = new KLanguageCombo(gbox);
  combo2->setMinimumWidth(combo2->sizeHint().width());
  combo2->setFixedHeight(combo2->sizeHint().height());
  label->setBuddy(combo2);
  connect(combo2,SIGNAL(highlighted(int)),this,SLOT(changed(int)));
  tl1->addWidget(label, 2, 1);
  tl1->addWidget(combo2, 2, 2);

  label = new QLabel(klocale->translate("Third"), gbox);
  label->setMinimumSize(label->sizeHint());
  combo3 = new KLanguageCombo(gbox);
  combo3->setMinimumWidth(combo3->sizeHint().width());
  combo3->setFixedHeight(combo3->sizeHint().height());
  label->setBuddy(combo3);
  connect(combo3,SIGNAL(highlighted(int)),this,SLOT(changed(int)));
  tl1->addWidget(label, 3, 1);
  tl1->addWidget(combo3, 3, 2);

  tl->activate();

  loadSettings();
}
예제 #15
0
PDB_Intro::PDB_Intro(QWidget *parent) : QWidget(parent) {
  QLabel *l = new QLabel(i18n("You will be asked a few questions on information\n"
			    "which is needed to establish an Internet connection\n"
			    "with your Internet Service Provider (ISP).\n\n"
			    "Make sure you have the registration form from your\n"
			    "ISP handy. If you have any problems, try the online\n"
			    "help first. If any information is missing, contact\n"
			    "your ISP."),
		       this);
  QVBoxLayout *tl = new QVBoxLayout(this, 10, 10);
  tl->addWidget(l);
  tl->activate();
}
예제 #16
0
void PropertiesBonus::displaySpell()
{
	QLabel * lab = new QLabel( this );
	lab->setText( tr( "Bonus for spells are not yet implemented" ) );
	FIXEDSIZE( lab );

	QVBoxLayout * layout = new QVBoxLayout( this );
	layout->setMargin( 5 );
	layout->setSpacing( 5 );
	layout->addWidget( lab );
	layout->addStretch( 1 );
	layout->activate();
}
예제 #17
0
PropertiesBuilding::PropertiesBuilding( QList<GenericPlayer *> * players, QWidget * parent, const char * /* name */ )
	: QDialog( parent, Qt::Dialog )
{
        setWindowTitle( tr( "building properties" ) );
	_building = 0;

	QLabel * ownerLabel = new QLabel( this );
	ownerLabel->setText( tr( "Owner:" ) );

	_name = new QLabel( this );
	
	_resBuil = new AskCost( tr( "Res Buil: " ), this );
	
	_ownerList = new QComboBox( this );
	refresh( players );

	_listBuilding = new QListWidget( this );

	QPushButton * pb = new QPushButton( this );
	pb->setText( tr( "Ok" ) );
	FIXEDSIZE( pb );

	QHBoxLayout * layH1 = new QHBoxLayout();
	layH1->setSpacing( 5 );
	layH1->addWidget( ownerLabel );
	layH1->addWidget( _ownerList, 1 );

	QHBoxLayout * layH2 = new QHBoxLayout();
	layH2->setSpacing( 5 );
	layH2->addWidget( _listBuilding, 1 );

	QHBoxLayout * layH = new QHBoxLayout();
	layH->setMargin( 5 );
	layH->addStretch( 1 );
	layH->addWidget( pb );

	QVBoxLayout * layout = new QVBoxLayout( this );
	layout->setMargin( 5 );
	layout->setSpacing( 5 );
	layout->addLayout( layH1 );
	layout->addStretch( 1 );
	layout->addWidget( _name );
	layout->addWidget( _resBuil );
	layout->addWidget( _listBuilding );
	layout->addLayout( layH );
	layout->activate();

	connect( pb, SIGNAL( clicked() ), SLOT( slot_accept() ) );
	connect( _ownerList, SIGNAL( activated( int ) ), SLOT( slot_owner( int ) ) );
}
예제 #18
0
파일: fight.cpp 프로젝트: q4a/attal
/** add comments here */
Fight::Fight( QWidget * parent , const char * name )
	: QWidget( parent, name )
{
	_socket = 0;
	_game = 0;
	_popup = 0;
	_isAttack = true;
	_isActive = false;
	_isCreature = false;
	_activeUnit = 0;
	_lostAttack = new QList<GenericFightUnit>;
	_lostAttack->setAutoDelete( true );
	_lostDefense = new QList<GenericFightUnit>;
	_lostDefense->setAutoDelete( true );

	for( int i = 0; i < MAX_UNIT; i ++ ) {
		_unitsAtt[i] = 0;
		_unitsDef[i] = 0;
	}

	//setBackgroundPixmap( IMAGE_PATH + "fight/background_0.png" );

	QVBoxLayout * layout = new QVBoxLayout( this );
	//layout->addSpacing( 120 );

	_map = new FightMap( this );
	_map->setBackgroundPixmap( QPixmap( IMAGE_PATH + "fight/background_0.png" ) );


	_view = new FightMapView( _map, this );
	layout->addWidget( _view, 1 );

	_control = new FightControl( this );
	layout->addWidget( _control );

	_map->resize( 800, 500 );


	layout->activate();

	connect( _control, SIGNAL( sig_wait( ) ), SLOT( slot_wait( ) ) );
	connect( _control, SIGNAL( sig_retreat( ) ), SLOT( slot_flee( ) ) );
	connect( _control, SIGNAL( sig_defend() ), SLOT( slot_defend() ) );

	connect( _view, SIGNAL( sig_mouseMoved( FightCell * ) ), SLOT( slot_mouseMoved( FightCell * ) ) );
	connect( _view, SIGNAL( sig_mouseRightPressed( FightCell * ) ), SLOT( slot_mouseRightPressed( FightCell * ) ) );
	connect( _view, SIGNAL( sig_mouseLeftPressed( FightCell * ) ), SLOT( slot_mouseLeftPressed( FightCell * ) ) );
	connect( _view, SIGNAL( sig_mouseReleased() ), SLOT( slot_mouseReleased() ) );
}
예제 #19
0
ServerWidget::ServerWidget( QWidget * parent, const char * name )
	: QWidget( parent, name )
{
	_group = new QVButtonGroup( this );

	QRadioButton * radio1 = new QRadioButton( _group );
	radio1->setText( "Demo 1 player" );
	radio1->setChecked( true );

	QRadioButton * radio2 = new QRadioButton( _group );
	radio2->setText( "Demo 2 players" );

	_radio3 = new ChooseFileRadioButton( _group );
	_radio3->slot_toggle( false );

	_playerList = new QListView( this );
	_playerList->addColumn( "Name" );
	_playerList->addColumn( "Address" );
	_playerList->setMinimumHeight( 50 );

	_groupBottom = new QHButtonGroup( this );

	QPushButton * butStart = new QPushButton( _groupBottom );
	butStart->setText( "Start" );
	FIXEDSIZE( butStart );

	QPushButton * butStop = new QPushButton( _groupBottom );
	butStop->setText( "Save" );
	FIXEDSIZE( butStop );

	QPushButton * butSave = new QPushButton( _groupBottom );
	butSave->setText( "End" );
	FIXEDSIZE( butSave );

	_groupBottom->find( 0 )->setEnabled( true );
	_groupBottom->find( 1 )->setEnabled( false );
	_groupBottom->find( 2 )->setEnabled( false );

	QVBoxLayout * layout = new QVBoxLayout( this );
	layout->addWidget( _group );
	layout->addSpacing( 5 );
	layout->addWidget( _playerList, 1 );
	layout->addSpacing( 5 );
	layout->addWidget( _groupBottom );
	layout->activate();

	connect( _groupBottom, SIGNAL( clicked( int ) ), SLOT( slot_choice( int ) ) );
}
예제 #20
0
SectionCreature::SectionCreature( QWidget * parent, const char * name )
	: Section( parent, name )
{
	_race = 0;
	_creature = 0;
	
	QVBoxLayout * layout = new QVBoxLayout( this );
	layout->setMargin( 5 );
	layout->setSpacing( 5 );

	_selectRace = new SelectionWidget( this );
	_selectRace->setTitle( tr( "Race" ) );
	layout->addWidget( _selectRace );

	_nameRace = new AskString( tr( "Name: " ), this );
	layout->addWidget( _nameRace );
	
	_selectCreature = new SelectionWidget( this );
	_selectCreature->setTitle( tr( " Creature " ) );
	layout->addWidget( _selectCreature );
	
	_editCreature = new EditCreature( this );
	layout->addWidget( _editCreature );
		
	layout->addStretch( 1 );
	
	layout->activate();
	
	connect( _selectRace, SIGNAL( sig_first() ), SLOT( slot_firstRace() ) );
	connect( _selectRace, SIGNAL( sig_previous() ), SLOT( slot_previousRace() ) );
	connect( _selectRace, SIGNAL( sig_next() ), SLOT( slot_nextRace() ) );
	connect( _selectRace, SIGNAL( sig_last() ), SLOT( slot_lastRace() ) );
	connect( _selectRace, SIGNAL( sig_new() ), SLOT( slot_newRace() ) );
	connect( _selectRace, SIGNAL( sig_del() ), SLOT( slot_delRace() ) );
	
	connect( _selectCreature, SIGNAL( sig_first() ), SLOT( slot_firstCreature() ) );
	connect( _selectCreature, SIGNAL( sig_previous() ), SLOT( slot_previousCreature() ) );
	connect( _selectCreature, SIGNAL( sig_next() ), SLOT( slot_nextCreature() ) );
	connect( _selectCreature, SIGNAL( sig_last() ), SLOT( slot_lastCreature() ) );
	connect( _selectCreature, SIGNAL( sig_new() ), SLOT( slot_newCreature() ) );
	connect( _selectCreature, SIGNAL( sig_del() ), SLOT( slot_delCreature() ) );
	
	init();
}
예제 #21
0
PDB_DialPrefix::PDB_DialPrefix(QWidget *parent) : QWidget(parent) {
  QVBoxLayout *tl = new QVBoxLayout(this, 10, 10);
  QLabel *l = new QLabel(i18n("If you need a special dial prefix (e.g. if you\n"
			    "are using a telephone switch) you can specify\n"
			    "it here. This prefix is dialed just before the\n"
			    "phone number.\n\n"
			    "If you have a telephone switch, you probably need\n"
			    "to write \"0\" or \"0,\" here."),
		       this);
  tl->addWidget(l);

  QGridLayout *l1 = new QGridLayout(1, 2);
  tl->addLayout(l1);
  l = new QLabel(i18n("Dial prefix:"), this);
  l1->addWidget(l, 0, 0);
  _prefix = newLineEdit(24, this);
  l1->addWidget(_prefix, 0, 1);
  tl->activate();
}
예제 #22
0
SectionDecoration::SectionDecoration( QWidget * parent , const char * name )
	: GenericSection( parent, name )
{
	_num = 1;
	_numItem = 0;
	
	setTitle( tr( "Decoration group" ) );

	QVBoxLayout * layout = new QVBoxLayout( _mainWidget );
	layout->setMargin( 5 );
	layout->setSpacing( 5 );

	_name = new AskString( tr( "Name: " ), _mainWidget );
	layout->addWidget( _name );

	_info = new AskString( tr( "Info: " ), _mainWidget );
	layout->addWidget( _info );
	
	_decorationEffect = new DecorationEffect( _mainWidget );
	layout->addWidget( _decorationEffect );

	_selectItem = new SelectionWidget( _mainWidget );
	_selectItem->setTitle( tr( "Decoration item" ) );
	layout->addWidget( _selectItem );
	
	_image = new AskPixmap( true, "", tr( "Image: " ), _mainWidget );
	layout->addWidget( _image );
	
	_dispo = new MapDispositionEditor( _mainWidget );
	layout->addWidget( _dispo );

	layout->addStretch( 1 );
	layout->activate();
	
	connect( _selectItem, SIGNAL( sig_first() ), SLOT( slot_firstItem() ) );
	connect( _selectItem, SIGNAL( sig_previous() ), SLOT( slot_previousItem() ) );
	connect( _selectItem, SIGNAL( sig_next() ), SLOT( slot_nextItem() ) );
	connect( _selectItem, SIGNAL( sig_last() ), SLOT( slot_lastItem() ) );
	connect( _selectItem, SIGNAL( sig_new() ), SLOT( slot_newItem() ) );
	connect( _selectItem, SIGNAL( sig_del() ), SLOT( slot_delItem() ) );
	
	init();
}
예제 #23
0
PropertiesEvent::PropertiesEvent( GenericEvent * event, QWidget * parent, const char * /* name */ )
: QDialog( parent, Qt::Dialog )
{
	_event = event;

	createContentView();

	QPushButton * pbCondition = new QPushButton( this );
	pbCondition->setText( tr( "Condition" ) );
	FIXEDSIZE( pbCondition );

	QHBoxLayout * layH1 = new QHBoxLayout();
	layH1->addStretch( 1 );
	layH1->addWidget( pbCondition );
	layH1->addStretch( 1 );

	QPushButton * pbCan = new QPushButton( this );
	pbCan->setText( tr( "Cancel" ) );
	FIXEDSIZE( pbCan );

	QPushButton * pbOk = new QPushButton( this );
	pbOk->setText( tr( "Ok" ) );
	FIXEDSIZE( pbOk );

	QHBoxLayout * layH2 = new QHBoxLayout();
	layH2->addStretch( 1 );
	layH2->addWidget( pbCan );
	layH2->addStretch( 1 );
	layH2->addWidget( pbOk );
	layH2->addStretch( 1 );

	QVBoxLayout * layout = new QVBoxLayout( this );
	layout->setSpacing( 5 );
	layout->setMargin( 5 );
	layout->addWidget( _content, 1 );
	layout->addLayout( layH1 );
	layout->addLayout( layH2 );
	layout->activate();

	connect( pbOk, SIGNAL( clicked() ), SLOT( slot_accept() ) );
	connect( pbCan, SIGNAL( clicked() ), SLOT( reject() ) );
}
예제 #24
0
void PropertiesBonus::displayResource()
{
	QLabel * labResource = new QLabel( this );
	labResource->setText( tr( "Resource: " ) + DataTheme.resources.getRessource( _bonus->getParam( 0 ) ) );
	FIXEDSIZE( labResource );

	_fixed = new AskInt( tr( "Fixed value: " ), this );
	_fixed->setMinValue( 0 );
	_fixed->setMaxValue( 10000 );
	_fixed->setValue( _bonus->getParam( 2 ) );
	FIXEDSIZE( _fixed );

	QVBoxLayout * layout = new QVBoxLayout( this );
	layout->setMargin( 5 );
	layout->setSpacing( 5 );
	layout->addWidget( labResource );
	layout->addWidget( _fixed );
	layout->addStretch( 1 );
	layout->activate();
}
예제 #25
0
파일: lordExchange.cpp 프로젝트: q4a/attal
DisplayBothGeneralities::DisplayBothGeneralities( QWidget * parent, const char * name )
	:QWidget( parent, name )
{
	_listLeft = new QListBox( this );
	_listRight = new QListBox( this );

	QHBoxLayout * layH1 = new QHBoxLayout();
	layH1->addSpacing( 5 );
	layH1->addWidget( _listLeft, 1 );
	layH1->addSpacing( 10 );
	layH1->addWidget( _listRight, 1 );
	layH1->addSpacing( 5 );

	QVBoxLayout * layout = new QVBoxLayout( this );
	layout->addSpacing( 5 );
	layout->addLayout( layH1, 1 );
	layout->addSpacing( 5 );

	layout->activate();
}
예제 #26
0
파일: chatWidget.cpp 프로젝트: q4a/attal
ChatWidget::ChatWidget( QWidget * parent, const char * name )
	: QWidget( parent, name )
{
	QVBoxLayout * layout = new QVBoxLayout( this );

	_chat = new QMultiLineEdit( this );
	_chat->setReadOnly( true );
	layout->addWidget( _chat, 1 );

	layout->addSpacing( 1 );

	_edit = new QLineEdit( this );
	_edit->setMinimumHeight( _edit->sizeHint().height() );
	layout->addWidget( _edit );

	layout->activate();

	connect( _edit, SIGNAL( returnPressed() ), SLOT( slot_message() ) );

	setMinimumHeight( 130 );
}
예제 #27
0
FillDialog::FillDialog( QWidget * parent, const char * name )
	:QDialog( parent, name, true )
{
	setCaption( "Choose tile" );
	QVBoxLayout * layout = new QVBoxLayout( this );
	layout->setMargin( 5 );
	
	_combo = new QComboBox( this );
	for( uint i = 0; i < DataTheme.tiles.count(); i++ ) {
		QString name = QString::number( i ) + " - " + DataTheme.tiles.at( i )->getName();
		_combo->insertItem( name, i );
	}
	FIXEDSIZE( _combo );
	layout->addWidget( _combo );
	
	QHBoxLayout * layH1 = new QHBoxLayout();
	layH1->setMargin( 5 );
	layH1->addStretch( 1 );
	
	QPushButton * pb1 = new QPushButton( this );
	pb1->setText( "Ok" );
	FIXEDSIZE( pb1 );
	layH1->addWidget( pb1 );
	layH1->addStretch( 1 );
	
	QPushButton * pb2 = new QPushButton( this );
	pb2->setText( "Cancel" );
	FIXEDSIZE( pb2 );
	layH1->addWidget( pb2 );
	layH1->addStretch( 1 );
	
	layout->addStretch( 1 );
	layout->addLayout( layH1 );
	
	layout->activate();
	
	//setFixedSize();
	connect( pb1, SIGNAL( clicked() ), SLOT( accept() ) );
	connect( pb2, SIGNAL( clicked() ), SLOT( reject() ) );
}
예제 #28
0
OptionsPrinting::OptionsPrinting(KSharedConfigPtr &conf, QWidget *parent)
	: OptionsPage(conf, parent)
{
	// Create option widgets

	QVBoxLayout *box = new QVBoxLayout;
	styleButtons = new QButtonGroup(this);

	QRadioButton* button = new QRadioButton(i18n("Tabulature"));
	styleButtons->addButton(button, 0);
	box->addWidget(button);

	button = new QRadioButton(i18n("Notes"));
	styleButtons->addButton(button, 1);
	box->addWidget(button);

	button = new QRadioButton(i18n("Tabulature (full) and notes"));
	styleButtons->addButton(button, 2);
	box->addWidget(button);

	button = new QRadioButton(i18n("Tabulature (minimum) and notes (not implemented)"));
	styleButtons->addButton(button, 3);
	box->addWidget(button);

	box->addStretch();
	box->activate();

	styleGroup = new QGroupBox(i18n("Style"), this);
	styleGroup->setLayout(box);

	// Set widget layout
	box = new QVBoxLayout;
	box->addWidget(styleGroup);
	setLayout(box);

	// Fill in current config
	styleButtons->button(Settings::printingStyle())->setChecked(true);
}
예제 #29
0
DisplayLordTabArtefacts::DisplayLordTabArtefacts( GenericPlayer * player, QWidget * parent, const char * /* name */)
: QWidget( parent )
{
	_player = player;
	_index = 0;
	uint i;

	QPushButton * pb1 = new QPushButton( this );
	pb1->setText( "<" );
	FIXEDSIZE( pb1 );

	QPushButton * pb2 = new QPushButton( this );
	pb2->setText( ">" );
	FIXEDSIZE( pb2 );

	QHBoxLayout * layH1 = new QHBoxLayout();
	layH1->addStretch( 1 );
	layH1->addWidget( pb1 );
	
	for( i = 0; i < 4; i++ ) {
		_ico[i] = new IconArtefact( this );
		_ico[i]->clear();
		layH1->addWidget( _ico[i] );
	}

	layH1->addWidget( pb2 );
	layH1->addStretch( 1 );
	
	QVBoxLayout * layout = new QVBoxLayout( this );
	layout->setMargin( 5 );
	layout->setSpacing( 5 );
	layout->addLayout( layH1 );
	layout->addStretch( 1 );
	layout->activate();

	connect( pb1, SIGNAL( clicked() ), SLOT( slot_prevArtefact() ) );
	connect( pb2, SIGNAL( clicked() ), SLOT( slot_nextArtefact() ) );
}
예제 #30
0
KBiffStatus::KBiffStatus(const QString& profile, KBiffStatusList& list)
	: QFrame(0, 0, WStyle_Customize | WStyle_NoBorder),
	  _listView(new QListView(this))
{
TRACEINIT("KBiffStatus::KBiffStatus()");
	setFrameStyle(WinPanel|Raised);
	resize(0, 0);
	QLabel *profile_label = new QLabel(profile, this);
	profile_label->setFrameStyle(QFrame::Box | QFrame::Raised);
	profile_label->setMinimumSize(profile_label->sizeHint());
	profile_label->setAlignment(AlignCenter);

	_listView->addColumn(i18n("Mailbox"));
	_listView->addColumn(i18n("New"));
	_listView->setColumnAlignment(1, AlignRight);
	_listView->setSorting(1, FALSE);
	_listView->setFrameStyle(QFrame::WinPanel | QFrame::Raised);
	_listView->setVScrollBarMode(QScrollView::AlwaysOff);
	_listView->setHScrollBarMode(QScrollView::AlwaysOff);
	_listView->header()->hide();

	KBiffStatusList *ptr = &list;
	for(unsigned int i = 0; i < ptr->count(); i++)
	{
		const KBiffStatusItem *item = ptr->at(i);
		new QListViewItem(_listView, item->mailbox(), item->newMessages());
	}

	_listView->setMinimumSize(_listView->sizeHint());
	int list_height = (_listView->firstChild()->height() * ptr->count()) + 10;
	TRACEF("list_height = %d", list_height);
	_listView->setMinimumSize(_listView->sizeHint().width() + 5, list_height);

	QVBoxLayout *layout = new QVBoxLayout(this, 0, 0);
	layout->addWidget(profile_label);
	layout->addWidget(_listView);
	layout->activate();
}