---------------------------------------------------------------------------- Key Mapping Window
| 1441 | //****** Key Mapping Window |
| 1442 | //********************************************************************************* |
| 1443 | FKBKeyMapDialog::FKBKeyMapDialog( int idx, QWidget *parent ) |
| 1444 | : QDialog( parent ) |
| 1445 | { |
| 1446 | QVBoxLayout *mainLayout; |
| 1447 | QHBoxLayout *hbox; |
| 1448 | QPushButton *cancelButton; |
| 1449 | QLabel *lbl; |
| 1450 | char keyMapName[64]; |
| 1451 | char stmp[128]; |
| 1452 | |
| 1453 | setWindowTitle( tr("Family Keyboard Key Mapping") ); |
| 1454 | setModal(true); |
| 1455 | |
| 1456 | keyIdx = idx; |
| 1457 | buttonConfigStatus = 0; |
| 1458 | waitingForButton = false; |
| 1459 | |
| 1460 | mainLayout = new QVBoxLayout(); |
| 1461 | hbox = new QHBoxLayout(); |
| 1462 | |
| 1463 | setLayout( mainLayout ); |
| 1464 | |
| 1465 | sprintf( stmp, "Press a key to set new physical mapping for the '%s' Key", keyNames[idx*2] ); |
| 1466 | |
| 1467 | msgLbl = new QLabel( tr(stmp) ); |
| 1468 | |
| 1469 | if (fkbmap[ keyIdx ].ButtType == BUTTC_KEYBOARD) |
| 1470 | { |
| 1471 | snprintf(keyMapName, sizeof(keyMapName), "%s", |
| 1472 | SDL_GetKeyName(fkbmap[ keyIdx ].ButtonNum)); |
| 1473 | } |
| 1474 | else |
| 1475 | { |
| 1476 | strcpy(keyMapName, ButtonName(&fkbmap[ keyIdx ])); |
| 1477 | } |
| 1478 | |
| 1479 | lbl = new QLabel( tr("Current Mapping is:") ); |
| 1480 | curMapLbl = new QLabel( tr(keyMapName) ); |
| 1481 | |
| 1482 | hbox->addWidget( lbl ); |
| 1483 | hbox->addWidget( curMapLbl ); |
| 1484 | |
| 1485 | cancelButton = new QPushButton( tr("Cancel") ); |
| 1486 | cancelButton->setIcon(style()->standardIcon(QStyle::SP_DialogCancelButton)); |
| 1487 | cancelButton->setAutoDefault(false); |
| 1488 | |
| 1489 | mainLayout->addWidget( msgLbl ); |
| 1490 | mainLayout->addLayout( hbox ); |
| 1491 | |
| 1492 | hbox = new QHBoxLayout(); |
| 1493 | mainLayout->addLayout( hbox ); |
| 1494 | hbox->addWidget( cancelButton, 1 ); |
| 1495 | hbox->addStretch( 4 ); |
| 1496 | |
| 1497 | connect( cancelButton, SIGNAL(clicked(void)), this, SLOT(closeWindow(void)) ); |
| 1498 | } |
| 1499 | //********************************************************************************* |
| 1500 | FKBKeyMapDialog::~FKBKeyMapDialog(void) |
nothing calls this directly
no test coverage detected