示例#1
0
void MotionConfig::assignKeys()
{
  int id;

  id = IDC_EDIT_UP;
  assignKey(id, GetWindowLong(up, GWL_USERDATA));

  id = IDC_EDIT_DOWN;
  assignKey(id, GetWindowLong(down, GWL_USERDATA));

  id = IDC_EDIT_LEFT;
  assignKey(id, GetWindowLong(left, GWL_USERDATA));

  id = IDC_EDIT_RIGHT;
  assignKey(id, GetWindowLong(right, GWL_USERDATA));
}
示例#2
0
void InputSettingsWindow::setup() {
  panel = new QWidget;

  layout = new QVBoxLayout;
  layout->setMargin(0);
  layout->setSpacing(0);

  title = new QLabel("Input Configuration Editor");
  title->setProperty("class", "title");
  layout->addWidget(title);

  selection = new QHBoxLayout; {
    port = new QComboBox;
    port->addItem("Controller Port 1");
    port->addItem("Controller Port 2");
    port->addItem("User Interface");
    selection->addWidget(port);

    device = new QComboBox;
    selection->addWidget(device);
  }
  selection->setSpacing(Style::WidgetSpacing);
  layout->addLayout(selection);
  layout->addSpacing(Style::WidgetSpacing);

  list = new QTreeWidget;
  list->setColumnCount(3);
  list->setHeaderLabels(QStringList() << "Hidden" << "Name" << "Assignment");
  list->hideColumn(0);  //used for default sorting + hides child expansion box
  layout->addWidget(list);
  layout->addSpacing(Style::WidgetSpacing);

  controls = new QHBoxLayout; {
    assign = new QPushButton("Assign ...");
    controls->addWidget(assign);

    assignAll = new QPushButton("Assign All ...");
    controls->addWidget(assignAll);

    unassign = new QPushButton("Unassign");
    controls->addWidget(unassign);
  }
  controls->setSpacing(Style::WidgetSpacing);
  layout->addLayout(controls);

  panel->setLayout(layout);
  connect(port, SIGNAL(currentIndexChanged(int)), this, SLOT(portChanged()));
  connect(device, SIGNAL(currentIndexChanged(int)), this, SLOT(reloadList()));
  connect(list, SIGNAL(itemActivated(QTreeWidgetItem*, int)), this, SLOT(assignKey()));
  connect(list, SIGNAL(itemSelectionChanged()), this, SLOT(listChanged()));
  connect(assign, SIGNAL(released()), this, SLOT(assignKey()));
  connect(assignAll, SIGNAL(released()), this, SLOT(assignAllKeys()));
  connect(unassign, SIGNAL(released()), this, SLOT(unassignKey()));

  portChanged();
}
示例#3
0
BasicHashTable::TableEntry* BasicHashTable
::insertNewEntry(unsigned index, char const* key) {
  TableEntry* entry = new TableEntry();
  entry->fNext = fBuckets[index];
  fBuckets[index] = entry;

  ++fNumEntries;
  assignKey(entry, key);

  return entry;
}
示例#4
0
void JoypadConfig::assignKeys()
{
  int id;

  id = IDC_EDIT_UP;
  assignKey(id, GetWindowLong(up, GWL_USERDATA));

  id = IDC_EDIT_DOWN;
  assignKey(id, GetWindowLong(down, GWL_USERDATA));

  id = IDC_EDIT_LEFT;
  assignKey(id, GetWindowLong(left, GWL_USERDATA));

  id = IDC_EDIT_RIGHT;
  assignKey(id, GetWindowLong(right, GWL_USERDATA));

  id = IDC_EDIT_BUTTON_A;
  assignKey(id, GetWindowLong(buttonA, GWL_USERDATA));

  id = IDC_EDIT_BUTTON_B;
  assignKey(id, GetWindowLong(buttonB, GWL_USERDATA));

  id = IDC_EDIT_BUTTON_L;
  assignKey(id, GetWindowLong(buttonL, GWL_USERDATA));

  id = IDC_EDIT_BUTTON_R;
  assignKey(id, GetWindowLong(buttonR, GWL_USERDATA));
  
  id = IDC_EDIT_BUTTON_SELECT;
  assignKey(id, GetWindowLong(buttonSelect, GWL_USERDATA));

  id = IDC_EDIT_BUTTON_START;
  assignKey(id, GetWindowLong(buttonStart, GWL_USERDATA));

  id = IDC_EDIT_SPEED;
  assignKey(id, GetWindowLong(speed, GWL_USERDATA));

  id = IDC_EDIT_CAPTURE;
  assignKey(id, GetWindowLong(capture, GWL_USERDATA));

  id = IDC_EDIT_BUTTON_GS;
  assignKey(id, GetWindowLong(buttonGS, GWL_USERDATA));

  //  winSaveKeys();
}