示例#1
0
文件: Hotkeys.cpp 项目: malensek/3RVX
bool Hotkeys::OnArgComboChange() {
    int selectionIdx = _keyList->Selection();
    HotkeyInfo *current = &_keyInfo[selectionIdx];

    HotkeyInfo::HotkeyActions action
        = (HotkeyInfo::HotkeyActions) _action->SelectionIndex();

    switch (action) {
    case HotkeyInfo::IncreaseVolume:
    case HotkeyInfo::DecreaseVolume:
    case HotkeyInfo::SetVolume:
        current->AllocateArg(1);
        current->args[1] = std::to_wstring(_argCombo->SelectionIndex());
        break;

    case HotkeyInfo::EjectDrive:
        current->AllocateArg(0);
        /* We can place the selected string directly into the args */
        current->args[0] = _argCombo->Selection();
        break;

    case HotkeyInfo::MediaKey:
        current->AllocateArg(0);
        current->args[0]
            = HotkeyInfo::MediaKeyNames[_argCombo->SelectionIndex()];
        break;
    }

    LoadSelection(selectionIdx);
    return true;
}
示例#2
0
文件: Hotkeys.cpp 项目: malensek/3RVX
bool Hotkeys::OnArgEditTextChange() {
    if (_argEdit->Enabled() == false || _argEdit->Visible() == false) {
        return FALSE;
    }

    int currentIndex = _keyList->Selection();
    HotkeyInfo *current = CurrentHotkeyInfo();
    if (current == NULL) {
        return FALSE;
    }

    switch ((HotkeyInfo::HotkeyActions) current->action) {
    case HotkeyInfo::IncreaseVolume:
    case HotkeyInfo::DecreaseVolume:
    case HotkeyInfo::SetVolume:
    case HotkeyInfo::Run:
        current->AllocateArg(0);
        current->args[0] = _argEdit->Text();
        _keyList->ItemText(currentIndex, 1, ActionString(*current));
        break;
    }

    return TRUE;
}