Source Code (Use browser search to find items of interest.)

Class Index

kpoker'CardWidget (./kdegames/kpoker/kpaint.h:10)

class CardWidget : public QPushButton
{
	Q_OBJECT
	    
signals:	    
	void pClicked(CardWidget *);
	
public:
	CardWidget( QWidget *parent=0, const char *name=0 );
	
	void        paintCard(int cardType, int xPos, int yPos);
	    int         queryHeld();
	void        setHeld(int newheld);
	int         toggleHeld(); /* returns the new value of held*/
	QLabel      *heldLabel;
	
protected:
	void        paintEvent( QPaintEvent *e );
	
protected slots:
	void ownClick();
	

private:
	QPixmap     *pm;                     // the loaded pixmap
	int         held;
};


kpoker'CardWidget::CardWidget() (./kdegames/kpoker/kpaint.cpp:38)

CardWidget::CardWidget( QWidget *parent, const char *name )
  : QPushButton( parent, name )
{
  held=0;
  move(1,1);
  resize(cardWidth,cardHeight);
}


kpoker'CardWidget::paintCard() (./kdegames/kpoker/kpaint.cpp:46)

void CardWidget::paintCard(int cardType, int xPos, int yPos)
{
  if (cardType==0)
    pm=&cardImage->deck;
  else
    pm=&cardImage->cardP[cardType-1];
  if ( pm->size() != QSize( 0, 0 ) ) {         // is an image loaded?
    bitBlt(this, xPos, yPos, pm, 0, 0, pm->size().width(), pm->size().height());
  }
}


kpoker'CardWidget::ownClick() (./kdegames/kpoker/kpaint.cpp:57)

void CardWidget::ownClick()
{
  emit pClicked(this);
}


kpoker'CardWidget::paintEvent() (./kdegames/kpoker/kpaint.cpp:62)

void CardWidget::paintEvent( QPaintEvent *)
{
  bitBlt(this, 0, 0, pm, 0, 0, pm->size().width(), pm->size().height());
}


kpoker'CardWidget::queryHeld() (./kdegames/kpoker/kpaint.cpp:67)

int CardWidget::queryHeld()
{
  return held;
}


kpoker'CardWidget::setHeld() (./kdegames/kpoker/kpaint.cpp:72)

void CardWidget::setHeld(int newheld)
{
  held=newheld;
}


kpoker'CardWidget::toggleHeld() (./kdegames/kpoker/kpaint.cpp:77)

int CardWidget::toggleHeld()
{
  if (held == 1)  
    held = 0;
  else            
    held = 1;
  return held;
}