RedWhite::RedWhite(PaintStruct* paintStruct,QWidget *parent,Window* bloodX): CardAndSkill(paintStruct,parent) { lifeLinkCha = -1; bloodAsk = false; bloodCount = 0; curseCount = 0; curseLine = 0; lifeLink = false; intervalSet = false; int info[3] = {2,0,0}; blood = new AskDialog(info,bloodX,paintStructX,false); blood->ensure->canBeClicked = false; blood->cancel->canBeClicked = false; blood->ensure->isClicked = false; blood->cancel->isClicked = false; for(int i = 0;i < 5;i++) { blood->number[i]->isClicked = false; blood->number[i]->canBeClicked = false; } connect(blood->ensure,SIGNAL(changeClicked()),this,SLOT(sendMessageCardAndSkill())); connect(blood->cancel,SIGNAL(changeClicked()),this,SLOT(sendMessageCardAndSkill())); disconnect(blood->ensure,SIGNAL(changeClicked()),blood,SLOT(destroyLabel())); disconnect(blood->cancel,SIGNAL(changeClicked()),blood,SLOT(destroyLabel())); connect(blood->ensure,SIGNAL(changeClicked()),this,SLOT(intervalReset())); connect(blood->cancel,SIGNAL(changeClicked()),this,SLOT(intervalReset())); connect(blood->ensure,SIGNAL(changeClicked()),this,SLOT(reset())); connect(blood->cancel,SIGNAL(changeClicked()),this,SLOT(reset())); magicGroup[0] = new PicButton(151,362,559,100,42,false); magicGroup[1] = new PicButton(154,465,559,100,42,false); magicGroup[2] = new PicButton(155,568,559,100,42,false); magicGroup[3] = new PicButton(156,671,559,100,42,false); for(int i = 0;i < 4;i++) { connect(this,SIGNAL(mouseClick(int,int)),magicGroup[i],SLOT(isThisClicked(int,int))); } for(int i = 0;i < 4;i++) { for(int j = 0;j < 4;j++) { if(i != j) { connect(magicGroup[i],SIGNAL(changeClicked()),magicGroup[j],SLOT(cancelX())); } } } //system("pause"); connect(magicGroup[0],SIGNAL(changeClicked()),this,SLOT(magicSetZero())); connect(magicGroup[1],SIGNAL(changeClicked()),this,SLOT(magicSetOne())); connect(magicGroup[2],SIGNAL(changeClicked()),this,SLOT(magicSetTwo())); connect(magicGroup[3],SIGNAL(changeClicked()),this,SLOT(magicSetThree())); for(int i = 0;i < 4;i++) { connect(magicGroup[i],SIGNAL(notClicked()),this,SLOT(skillClear())); } }
void destroyDialog(AppInfo *app) { DialogInfo *d = app->dialog; freeIf(d->title); freeIf(d->indicators); destroyLabel(app, &(d->label)); destroyLabel(app, &(d->okButton.label)); destroyLabel(app, &(d->cancelButton.label)); XFree(d->sizeHints); XFree(d->wmHints); XFree(d->classHints); XFree(d->windowName.value); freeIf(d); }
void Button::createLabel() { destroyLabel(); label__.reset( new Label( cdk_screen__ ) ); label__->move( x__ , y__ ); label__->resize( width_str__.size() , 1 ); label__->setText( text__ ); }
//--------------------------------------------------------------------- //! @brief Set how the Button is being displayed. This is //! usually determined by the model's Validity. //! @param[in] _visibility How the Button should be //! displayed. //--------------------------------------------------------------------- void Button::setVisibility( Visibility const& _visibility ) { visibility__ = _visibility; switch( _visibility ) { case Visibility::INVISIBLE: destroy(); destroyLabel(); break; case Visibility::SHADED: destroy(); if( ! label__ ) createLabel(); break; case Visibility::VISIBLE: destroyLabel(); if( ! button__ ) create(); break; default: break; } }
static void handleEvents(XEvent * event, void *data) { Label *lPtr = (Label *) data; CHECK_CLASS(data, WC_Label); switch (event->type) { case Expose: if (event->xexpose.count != 0) break; paintLabel(lPtr); break; case DestroyNotify: destroyLabel(lPtr); break; } }