kblackbox
#include <kbbscalablegraphicwidget.h>
Public Types | |
enum | itemType { background =0, informationBackground =1, blackbox =2, blackboxGrid =3, tutorialMarker =4, markerNothing =5, solutionRay =6, playerRay =7, resultBackground =8, resultBackgroundHighlight =9, resultReflection =10, resultHit =11, resultText =12, solutionBall =13, playerBall =14, unsureBall =15, wrongPlayerBall =16, rightPlayerBall =17, interactionInfoDeflection =18, interactionInfoHit =19, interactionInfoNothing =20, interactionInfoReflection =21, interactionInfoReflectionSym =22, laser0 =23, laser90 =24, laser180 =25, laser270 =26, cursor =27 } |
Public Slots | |
void | cursorAtNewPosition (int borderPosition) |
void | keyboardEnter () |
void | keyboardMoveDown () |
void | keyboardMoveLeft () |
void | keyboardMoveRight () |
void | keyboardMoveUp () |
void | keyboardSpace () |
Public Member Functions | |
KBBScalableGraphicWidget (KBBGameDoc *gameDoc, KBBThemeManager *themeManager, QAction *done) | |
~KBBScalableGraphicWidget () | |
void | addBall (int boxPosition) |
void | addBall (int boxPosition, int outsidePosition) |
void | addBallUnsure (const int boxPosition) |
void | addMarkerNothing (const int boxPosition) |
void | drawRay (const int borderPosition) |
void | mouseBorderClick (const int borderPosition) |
void | mouseBoxClick (const Qt::MouseButton button, int boxPosition) |
int | moveBall (const int boxPositionFrom, const int boxPositionTo) |
int | moveMarkerNothing (const int boxPositionFrom, const int boxPositionTo) |
void | newGame (int columns, int rows, int ballNumber) |
void | popupText (const QString &text, int time=5000) |
int | positionAfterMovingBall (const int boxPositionFrom, const int boxPositionTo) const |
void | removeAllBalls () |
void | removeBall (const int boxPosition) |
void | removeRay () |
void | resizeEvent (QResizeEvent *) |
QGraphicsScene * | scene () |
void | setPause (bool state) |
void | setScore (int score) |
void | solve (const bool continueGame) |
Static Public Attributes | |
static int const | BORDER_SIZE = 50 |
static int const | RATIO = 25 |
Protected Member Functions | |
void | drawBackground (QPainter *painter, const QRectF &) |
Detailed Description
Scalable graphic central widget for KBlackBox.
Definition at line 62 of file kbbscalablegraphicwidget.h.
Member Enumeration Documentation
Every graphic items.
Values are used to define the relative heigths between the displayed graphic items.
Definition at line 89 of file kbbscalablegraphicwidget.h.
Constructor & Destructor Documentation
|
explicit |
Constructor.
Definition at line 67 of file kbbscalablegraphicwidget.cpp.
KBBScalableGraphicWidget::~KBBScalableGraphicWidget | ( | ) |
Definition at line 130 of file kbbscalablegraphicwidget.cpp.
Member Function Documentation
void KBBScalableGraphicWidget::addBall | ( | int | boxPosition | ) |
Definition at line 150 of file kbbscalablegraphicwidget.cpp.
void KBBScalableGraphicWidget::addBall | ( | int | boxPosition, |
int | outsidePosition | ||
) |
Definition at line 156 of file kbbscalablegraphicwidget.cpp.
void KBBScalableGraphicWidget::addBallUnsure | ( | const int | boxPosition | ) |
Definition at line 173 of file kbbscalablegraphicwidget.cpp.
void KBBScalableGraphicWidget::addMarkerNothing | ( | const int | boxPosition | ) |
Definition at line 180 of file kbbscalablegraphicwidget.cpp.
|
slot |
Definition at line 417 of file kbbscalablegraphicwidget.cpp.
|
protected |
Definition at line 493 of file kbbscalablegraphicwidget.cpp.
void KBBScalableGraphicWidget::drawRay | ( | const int | borderPosition | ) |
Definition at line 191 of file kbbscalablegraphicwidget.cpp.
|
slot |
Definition at line 434 of file kbbscalablegraphicwidget.cpp.
|
slot |
Definition at line 446 of file kbbscalablegraphicwidget.cpp.
|
slot |
Definition at line 454 of file kbbscalablegraphicwidget.cpp.
|
slot |
Definition at line 462 of file kbbscalablegraphicwidget.cpp.
|
slot |
Definition at line 470 of file kbbscalablegraphicwidget.cpp.
|
slot |
Definition at line 478 of file kbbscalablegraphicwidget.cpp.
void KBBScalableGraphicWidget::mouseBorderClick | ( | const int | borderPosition | ) |
Definition at line 202 of file kbbscalablegraphicwidget.cpp.
void KBBScalableGraphicWidget::mouseBoxClick | ( | const Qt::MouseButton | button, |
int | boxPosition | ||
) |
Definition at line 210 of file kbbscalablegraphicwidget.cpp.
int KBBScalableGraphicWidget::moveBall | ( | const int | boxPositionFrom, |
const int | boxPositionTo | ||
) |
Definition at line 221 of file kbbscalablegraphicwidget.cpp.
int KBBScalableGraphicWidget::moveMarkerNothing | ( | const int | boxPositionFrom, |
const int | boxPositionTo | ||
) |
Definition at line 241 of file kbbscalablegraphicwidget.cpp.
void KBBScalableGraphicWidget::newGame | ( | int | columns, |
int | rows, | ||
int | ballNumber | ||
) |
Definition at line 251 of file kbbscalablegraphicwidget.cpp.
void KBBScalableGraphicWidget::popupText | ( | const QString & | text, |
int | time = 5000 |
||
) |
Message to display.
- Parameters
-
text Message. Attention: Message should not be too wide. time Time (in ms) the message remains displayed. 0 = forever.
Definition at line 292 of file kbbscalablegraphicwidget.cpp.
int KBBScalableGraphicWidget::positionAfterMovingBall | ( | const int | boxPositionFrom, |
const int | boxPositionTo | ||
) | const |
Definition at line 303 of file kbbscalablegraphicwidget.cpp.
void KBBScalableGraphicWidget::removeAllBalls | ( | ) |
Definition at line 351 of file kbbscalablegraphicwidget.cpp.
void KBBScalableGraphicWidget::removeBall | ( | const int | boxPosition | ) |
Definition at line 359 of file kbbscalablegraphicwidget.cpp.
void KBBScalableGraphicWidget::removeRay | ( | ) |
Definition at line 372 of file kbbscalablegraphicwidget.cpp.
void KBBScalableGraphicWidget::resizeEvent | ( | QResizeEvent * | ) |
Definition at line 324 of file kbbscalablegraphicwidget.cpp.
QGraphicsScene * KBBScalableGraphicWidget::scene | ( | ) |
Definition at line 379 of file kbbscalablegraphicwidget.cpp.
void KBBScalableGraphicWidget::setPause | ( | bool | state | ) |
Definition at line 312 of file kbbscalablegraphicwidget.cpp.
void KBBScalableGraphicWidget::setScore | ( | int | score | ) |
Definition at line 385 of file kbbscalablegraphicwidget.cpp.
void KBBScalableGraphicWidget::solve | ( | const bool | continueGame | ) |
display the solution
Used at the end of the game and for the sandbox mode.
- Parameters
-
continueGame Sould the game continue after displaying the solution? (Yes for sandbox mode, no for normal game end).
Definition at line 391 of file kbbscalablegraphicwidget.cpp.
Member Data Documentation
|
static |
Distance between the black box and the widget border.
Note: The widget is scalable, so it's just an arbitrary default compared with other ranges. It's the minimal distance as the width/height ratio is constant and the widget may have another width/height ratio.
- See also
- RATIO
Definition at line 74 of file kbbscalablegraphicwidget.h.
|
static |
Width and height of a single square on the black box.
Note: The widget is scalable, so it's just an arbitrary default compared with other ranges.
Definition at line 81 of file kbbscalablegraphicwidget.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:44:09 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.