mirror of https://github.com/stella-emu/stella.git
More work on mapping of multiple events to combo events. The UI is now
present, and it properly loads and presents events from settings. Still TODO is implement saveConfig(), to send the new events to EventHandler. Modified ContextMenu/PopUpWidget to honour the 'mwheel' setting when scrolling with the mouse wheel (previously, it always scrolled at 1 line at a time). Updated OSX project files for recent ComboDialog addition. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2090 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
497cce6079
commit
8199dddb6f
|
@ -1845,11 +1845,11 @@ StringList EventHandler::getActionList(EventMode mode) const
|
|||
switch(mode)
|
||||
{
|
||||
case kEmulationMode:
|
||||
for(int i = 0; i < kEmulActionListSize; ++i)
|
||||
for(uInt32 i = 0; i < kEmulActionListSize; ++i)
|
||||
l.push_back(EventHandler::ourEmulActionList[i].action);
|
||||
break;
|
||||
case kMenuMode:
|
||||
for(int i = 0; i < kMenuActionListSize; ++i)
|
||||
for(uInt32 i = 0; i < kMenuActionListSize; ++i)
|
||||
l.push_back(EventHandler::ourMenuActionList[i].action);
|
||||
break;
|
||||
default:
|
||||
|
@ -1860,29 +1860,59 @@ StringList EventHandler::getActionList(EventMode mode) const
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
StringMap EventHandler::getComboList(EventMode mode) const
|
||||
StringMap EventHandler::getComboList(EventMode) const
|
||||
{
|
||||
// For now, this only works in emulation mode
|
||||
|
||||
StringMap l;
|
||||
ostringstream buf;
|
||||
|
||||
switch(mode)
|
||||
{
|
||||
case kEmulationMode:
|
||||
for(int i = 0; i < kEmulActionListSize; ++i)
|
||||
if(EventHandler::ourEmulActionList[i].allow_combo)
|
||||
{
|
||||
buf << i;
|
||||
l.push_back(EventHandler::ourEmulActionList[i].action, buf.str());
|
||||
buf.str("");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
l.push_back("None", "0");
|
||||
for(uInt32 i = 0; i < kEmulActionListSize; ++i)
|
||||
if(EventHandler::ourEmulActionList[i].allow_combo)
|
||||
{
|
||||
buf << i;
|
||||
l.push_back(EventHandler::ourEmulActionList[i].action, buf.str());
|
||||
buf.str("");
|
||||
}
|
||||
|
||||
return l;
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
StringList EventHandler::getComboListForEvent(Event::Type event) const
|
||||
{
|
||||
StringList l;
|
||||
ostringstream buf;
|
||||
if(event >= Event::Combo1 && event <= Event::Combo16)
|
||||
{
|
||||
int combo = event - Event::Combo1;
|
||||
for(uInt32 i = 0; i < kEventsPerCombo; ++i)
|
||||
{
|
||||
Event::Type e = myComboTable[combo][i];
|
||||
for(uInt32 j = 0; j < kEmulActionListSize; ++j)
|
||||
{
|
||||
if(EventHandler::ourEmulActionList[j].event == e &&
|
||||
EventHandler::ourEmulActionList[j].allow_combo)
|
||||
{
|
||||
buf << j;
|
||||
l.push_back(buf.str());
|
||||
buf.str("");
|
||||
}
|
||||
}
|
||||
// Make sure entries are 1-to-1, using Event::NoType when necessary
|
||||
if(i == l.size())
|
||||
l.push_back("0");
|
||||
}
|
||||
}
|
||||
return l;
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void EventHandler::setComboListForEvent(Event::Type event, const StringList& events)
|
||||
{
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
Event::Type EventHandler::eventAtIndex(int idx, EventMode mode) const
|
||||
{
|
||||
|
|
|
@ -243,6 +243,10 @@ class EventHandler
|
|||
StringList getActionList(EventMode mode) const;
|
||||
StringMap getComboList(EventMode mode) const;
|
||||
|
||||
/** Used to access the list of events assigned to a specific combo event. */
|
||||
StringList getComboListForEvent(Event::Type event) const;
|
||||
void setComboListForEvent(Event::Type event, const StringList& events);
|
||||
|
||||
inline Event::Type eventForKey(int key, EventMode mode) const
|
||||
{ return myKeyTable[key][mode]; }
|
||||
inline Event::Type eventForJoyButton(int stick, int button, EventMode mode) const
|
||||
|
|
|
@ -35,87 +35,48 @@
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
ComboDialog::ComboDialog(GuiObject* boss, const GUI::Font& font,
|
||||
const StringMap& combolist)
|
||||
: Dialog(&boss->instance(), &boss->parent(), 0, 0, 0, 0)
|
||||
: Dialog(&boss->instance(), &boss->parent(), 0, 0, 0, 0),
|
||||
myComboEvent(Event::NoType)
|
||||
{
|
||||
#define ADD_EVENT_POPUP(IDX, LABEL) \
|
||||
myEvents[IDX] = new PopUpWidget(this, font, xpos, ypos, \
|
||||
pwidth, lineHeight, combolist, LABEL); \
|
||||
wid.push_back(myEvents[IDX]); \
|
||||
ypos += lineHeight + 4;
|
||||
|
||||
const int lineHeight = font.getLineHeight(),
|
||||
fontWidth = font.getMaxCharWidth(),
|
||||
fontHeight = font.getFontHeight(),
|
||||
buttonWidth = font.getStringWidth("Defaults") + 20,
|
||||
buttonHeight = font.getLineHeight() + 4;
|
||||
int xpos, ypos;
|
||||
int lwidth = font.getStringWidth("Fragment Size: "),
|
||||
pwidth = font.getStringWidth("512 bytes");
|
||||
WidgetArray wid;
|
||||
|
||||
// Set real dimensions
|
||||
_w = 35 * fontWidth + 10;
|
||||
_h = 8 * (lineHeight + 4) + 10;
|
||||
_h = 11 * (lineHeight + 4) + 10;
|
||||
xpos = ypos = 5;
|
||||
|
||||
//for(uInt32 i = 0; i < combolist.size(); ++i)
|
||||
//cerr << combolist[i].first << " -> " << combolist[i].second << endl;
|
||||
// Get maximum width of popupwidget
|
||||
int pwidth = 0;
|
||||
for(uInt32 i = 0; i < combolist.size(); ++i)
|
||||
pwidth = BSPF_max(font.getStringWidth(combolist[i].first), pwidth);
|
||||
|
||||
/*
|
||||
// Volume
|
||||
xpos = 3 * fontWidth; ypos = 10;
|
||||
// Label for dialog, indicating which combo is being changed
|
||||
myComboName = new StaticTextWidget(this, font, xpos, ypos, _w - xpos - 10,
|
||||
fontHeight, "", kTextAlignCenter);
|
||||
ypos += (lineHeight + 4) + 5;
|
||||
|
||||
myVolumeSlider = new SliderWidget(this, font, xpos, ypos, 6*fontWidth, lineHeight,
|
||||
"Volume: ", lwidth, kVolumeChanged);
|
||||
myVolumeSlider->setMinValue(1); myVolumeSlider->setMaxValue(100);
|
||||
wid.push_back(myVolumeSlider);
|
||||
myVolumeLabel = new StaticTextWidget(this, font,
|
||||
xpos + myVolumeSlider->getWidth() + 4,
|
||||
ypos + 1,
|
||||
3*fontWidth, fontHeight, "", kTextAlignLeft);
|
||||
|
||||
myVolumeLabel->setFlags(WIDGET_CLEARBG);
|
||||
ypos += lineHeight + 4;
|
||||
|
||||
// Fragment size
|
||||
items.clear();
|
||||
items.push_back("", "128");
|
||||
items.push_back("256 bytes", "256");
|
||||
items.push_back("512 bytes", "512");
|
||||
items.push_back("1 KB", "1024");
|
||||
items.push_back("2 KB", "2048");
|
||||
items.push_back("4 KB", "4096");
|
||||
myFragsizePopup = new PopUpWidget(this, font, xpos, ypos,
|
||||
pwidth + myVolumeLabel->getWidth() - 4, lineHeight,
|
||||
items, "Fragment size: ", lwidth);
|
||||
wid.push_back(myFragsizePopup);
|
||||
ypos += lineHeight + 4;
|
||||
|
||||
// Output frequency
|
||||
items.clear();
|
||||
items.push_back("11025 Hz", "11025");
|
||||
items.push_back("22050 Hz", "22050");
|
||||
items.push_back("31400 Hz", "31400");
|
||||
items.push_back("44100 Hz", "44100");
|
||||
items.push_back("48000 Hz", "48000");
|
||||
myFreqPopup = new PopUpWidget(this, font, xpos, ypos,
|
||||
pwidth + myVolumeLabel->getWidth() - 4, lineHeight,
|
||||
items, "Output freq: ", lwidth);
|
||||
wid.push_back(myFreqPopup);
|
||||
ypos += lineHeight + 4;
|
||||
|
||||
// TIA frequency
|
||||
// ... use same items as above
|
||||
myTiaFreqPopup = new PopUpWidget(this, font, xpos, ypos,
|
||||
pwidth + myVolumeLabel->getWidth() - 4, lineHeight,
|
||||
items, "TIA freq: ", lwidth);
|
||||
wid.push_back(myTiaFreqPopup);
|
||||
ypos += lineHeight + 4;
|
||||
|
||||
// Clip volume
|
||||
myClipVolumeCheckbox = new CheckboxWidget(this, font, xpos+50, ypos,
|
||||
"Clip volume", 0);
|
||||
wid.push_back(myClipVolumeCheckbox);
|
||||
ypos += lineHeight + 4;
|
||||
|
||||
// Enable sound
|
||||
mySoundEnableCheckbox = new CheckboxWidget(this, font, xpos+50, ypos,
|
||||
"Enable sound", kSoundEnableChanged);
|
||||
wid.push_back(mySoundEnableCheckbox);
|
||||
ypos += lineHeight + 12;
|
||||
// Add event popup for 8 events
|
||||
xpos = 10;
|
||||
ADD_EVENT_POPUP(0, "Event 1: ");
|
||||
ADD_EVENT_POPUP(1, "Event 2: ");
|
||||
ADD_EVENT_POPUP(2, "Event 3: ");
|
||||
ADD_EVENT_POPUP(3, "Event 4: ");
|
||||
ADD_EVENT_POPUP(4, "Event 5: ");
|
||||
ADD_EVENT_POPUP(5, "Event 6: ");
|
||||
ADD_EVENT_POPUP(6, "Event 7: ");
|
||||
ADD_EVENT_POPUP(7, "Event 8: ");
|
||||
|
||||
// Add Defaults, OK and Cancel buttons
|
||||
ButtonWidget* b;
|
||||
|
@ -125,7 +86,6 @@ ComboDialog::ComboDialog(GuiObject* boss, const GUI::Font& font,
|
|||
addOKCancelBGroup(wid, font);
|
||||
|
||||
addToFocusList(wid);
|
||||
*/
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
@ -133,83 +93,49 @@ ComboDialog::~ComboDialog()
|
|||
{
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void ComboDialog::show(Event::Type event, const string& name)
|
||||
{
|
||||
// Make sure the event is allowed
|
||||
if(event >= Event::Combo1 && event <= Event::Combo16)
|
||||
{
|
||||
myComboEvent = event;
|
||||
myComboName->setLabel("Add events for " + name);
|
||||
parent().addDialog(this);
|
||||
}
|
||||
else
|
||||
myComboEvent = Event::NoType;
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void ComboDialog::loadConfig()
|
||||
{
|
||||
/*
|
||||
// Volume
|
||||
myVolumeSlider->setValue(instance().settings().getInt("volume"));
|
||||
myVolumeLabel->setLabel(instance().settings().getString("volume"));
|
||||
const StringList& events =
|
||||
instance().eventHandler().getComboListForEvent(myComboEvent);
|
||||
|
||||
// Fragsize
|
||||
myFragsizePopup->setSelected(instance().settings().getString("fragsize"), "512");
|
||||
int size = BSPF_min(events.size(), 8u);
|
||||
for(int i = 0; i < size; ++i)
|
||||
myEvents[i]->setSelected("", events[i]);
|
||||
|
||||
// Output frequency
|
||||
myFreqPopup->setSelected(instance().settings().getString("freq"), "31400");
|
||||
|
||||
// TIA frequency
|
||||
myTiaFreqPopup->setSelected(instance().settings().getString("tiafreq"), "31400");
|
||||
|
||||
// Clip volume
|
||||
myClipVolumeCheckbox->setState(instance().settings().getBool("clipvol"));
|
||||
|
||||
// Enable sound
|
||||
bool b = instance().settings().getBool("sound");
|
||||
mySoundEnableCheckbox->setState(b);
|
||||
*/
|
||||
// Fill any remaining items to 'None'
|
||||
if(size < 8)
|
||||
for(int i = size; i < 8; ++i)
|
||||
myEvents[i]->setSelected("None", "0");
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void ComboDialog::saveConfig()
|
||||
{
|
||||
/*
|
||||
Settings& settings = instance().settings();
|
||||
|
||||
// Volume
|
||||
settings.setInt("volume", myVolumeSlider->getValue());
|
||||
instance().sound().setVolume(myVolumeSlider->getValue());
|
||||
|
||||
// Fragsize
|
||||
settings.setString("fragsize", myFragsizePopup->getSelectedTag());
|
||||
|
||||
// Output frequency
|
||||
settings.setString("freq", myFreqPopup->getSelectedTag());
|
||||
|
||||
// TIA frequency
|
||||
settings.setString("tiafreq", myTiaFreqPopup->getSelectedTag());
|
||||
|
||||
// Enable/disable volume clipping (requires a restart to take effect)
|
||||
settings.setBool("clipvol", myClipVolumeCheckbox->getState());
|
||||
|
||||
// Enable/disable sound (requires a restart to take effect)
|
||||
instance().sound().setEnabled(mySoundEnableCheckbox->getState());
|
||||
|
||||
// Only force a re-initialization when necessary, since it can
|
||||
// be a time-consuming operation
|
||||
if(&instance().console())
|
||||
instance().console().initializeAudio();
|
||||
*/
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void ComboDialog::setDefaults()
|
||||
{
|
||||
/*
|
||||
myVolumeSlider->setValue(100);
|
||||
myVolumeLabel->setLabel("100");
|
||||
|
||||
myFragsizePopup->setSelected("512", "");
|
||||
myFreqPopup->setSelected("31400", "");
|
||||
myTiaFreqPopup->setSelected("31400", "");
|
||||
|
||||
myClipVolumeCheckbox->setState(true);
|
||||
mySoundEnableCheckbox->setState(true);
|
||||
|
||||
// Make sure that mutually-exclusive items are not enabled at the same time
|
||||
handleSoundEnableChange(true);
|
||||
for(int i = 0; i < 8; ++i)
|
||||
myEvents[i]->setSelected("None", "0");
|
||||
|
||||
_dirty = true;
|
||||
*/
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
|
|
@ -36,7 +36,7 @@ class ComboDialog : public Dialog
|
|||
~ComboDialog();
|
||||
|
||||
/** Place the dialog onscreen and center it */
|
||||
void show() { parent().addDialog(this); }
|
||||
void show(Event::Type event, const string& name);
|
||||
|
||||
private:
|
||||
void loadConfig();
|
||||
|
@ -46,8 +46,9 @@ class ComboDialog : public Dialog
|
|||
virtual void handleCommand(CommandSender* sender, int cmd, int data, int id);
|
||||
|
||||
private:
|
||||
Event::Type myComboEvent;
|
||||
|
||||
StaticTextWidget* myComboName;
|
||||
EditTextWidget* myComboMapping;
|
||||
PopUpWidget* myEvents[8];
|
||||
};
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include "FrameBuffer.hxx"
|
||||
#include "Dialog.hxx"
|
||||
#include "DialogContainer.hxx"
|
||||
#include "ScrollBarWidget.hxx"
|
||||
#include "ContextMenu.hxx"
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
@ -140,12 +141,15 @@ void ContextMenu::setSelected(int item)
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void ContextMenu::setSelected(const string& tag, const string& defaultTag)
|
||||
{
|
||||
for(unsigned int item = 0; item < _entries.size(); ++item)
|
||||
if(tag != "") // indicates that the defaultTag should be used instead
|
||||
{
|
||||
if(BSPF_equalsIgnoreCase(_entries[item].second, tag))
|
||||
{
|
||||
setSelected(item);
|
||||
return;
|
||||
for(unsigned int item = 0; item < _entries.size(); ++item)
|
||||
{
|
||||
if(BSPF_equalsIgnoreCase(_entries[item].second, tag))
|
||||
{
|
||||
setSelected(item);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -235,9 +239,9 @@ void ContextMenu::handleMouseWheel(int x, int y, int direction)
|
|||
if(_showScroll)
|
||||
{
|
||||
if(direction < 0)
|
||||
return scrollUp();
|
||||
scrollUp(ScrollBarWidget::getWheelLines());
|
||||
else if(direction > 0)
|
||||
return scrollDown();
|
||||
scrollDown(ScrollBarWidget::getWheelLines());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -379,28 +383,30 @@ void ContextMenu::moveDown()
|
|||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void ContextMenu::scrollUp()
|
||||
void ContextMenu::scrollUp(int distance)
|
||||
{
|
||||
if(_firstEntry > 0)
|
||||
{
|
||||
_firstEntry--;
|
||||
_scrollUpColor = _firstEntry > 0 ? kScrollColor : kColor;
|
||||
_scrollDnColor = kScrollColor;
|
||||
setDirty();
|
||||
}
|
||||
if(_firstEntry == 0)
|
||||
return;
|
||||
|
||||
_firstEntry = BSPF_max(_firstEntry - distance, 0);
|
||||
_scrollUpColor = _firstEntry > 0 ? kScrollColor : kColor;
|
||||
_scrollDnColor = kScrollColor;
|
||||
|
||||
setDirty();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void ContextMenu::scrollDown()
|
||||
void ContextMenu::scrollDown(int distance)
|
||||
{
|
||||
if(_firstEntry + _numEntries < (int)_entries.size())
|
||||
{
|
||||
_firstEntry++;
|
||||
_scrollUpColor = kScrollColor;
|
||||
_scrollDnColor = (_firstEntry + _numEntries < (int)_entries.size()) ?
|
||||
kScrollColor : kColor;
|
||||
setDirty();
|
||||
}
|
||||
int max_offset = _entries.size() - _numEntries;
|
||||
if(_firstEntry == max_offset)
|
||||
return;
|
||||
|
||||
_firstEntry = BSPF_min(_firstEntry + distance, max_offset);
|
||||
_scrollUpColor = kScrollColor;
|
||||
_scrollDnColor = (_firstEntry < max_offset) ? kScrollColor : kColor;
|
||||
|
||||
setDirty();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
|
|
@ -94,8 +94,8 @@ class ContextMenu : public Dialog, public CommandSender
|
|||
|
||||
void moveUp();
|
||||
void moveDown();
|
||||
void scrollUp();
|
||||
void scrollDown();
|
||||
void scrollUp(int distance = 1);
|
||||
void scrollDown(int distance = 1);
|
||||
void sendSelection();
|
||||
|
||||
private:
|
||||
|
|
|
@ -162,12 +162,7 @@ void EventMappingWidget::startRemapping()
|
|||
myLastStick = myLastAxis = myLastHat = myLastValue = -1;
|
||||
|
||||
// Disable all other widgets while in remap mode, except enable 'Cancel'
|
||||
myActionsList->setEnabled(!myRemapStatus);
|
||||
myMapButton->setEnabled(!myRemapStatus);
|
||||
myCancelMapButton->setEnabled(myRemapStatus);
|
||||
myEraseButton->setEnabled(!myRemapStatus);
|
||||
myResetButton->setEnabled(!myRemapStatus);
|
||||
if(myComboButton) myComboButton->setEnabled(!myRemapStatus);
|
||||
enableButtons(false);
|
||||
|
||||
// And show a message indicating which key is being remapped
|
||||
ostringstream buf;
|
||||
|
@ -218,12 +213,7 @@ void EventMappingWidget::stopRemapping()
|
|||
myLastStick = myLastAxis = myLastHat = myLastValue = -1;
|
||||
|
||||
// And re-enable all the widgets
|
||||
myActionsList->setEnabled(!myRemapStatus);
|
||||
myMapButton->setEnabled(!myRemapStatus);
|
||||
myCancelMapButton->setEnabled(myRemapStatus);
|
||||
myEraseButton->setEnabled(!myRemapStatus);
|
||||
myResetButton->setEnabled(!myRemapStatus);
|
||||
if(myComboButton) myComboButton->setEnabled(!myRemapStatus);
|
||||
enableButtons(true);
|
||||
|
||||
// Make sure the list widget is in a known state
|
||||
drawKeyMapping();
|
||||
|
@ -242,6 +232,23 @@ void EventMappingWidget::drawKeyMapping()
|
|||
}
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void EventMappingWidget::enableButtons(bool state)
|
||||
{
|
||||
myActionsList->setEnabled(state);
|
||||
myMapButton->setEnabled(state);
|
||||
myCancelMapButton->setEnabled(!state);
|
||||
myEraseButton->setEnabled(state);
|
||||
myResetButton->setEnabled(state);
|
||||
if(myComboButton)
|
||||
{
|
||||
Event::Type e =
|
||||
instance().eventHandler().eventAtIndex(myActionSelected, myEventMode);
|
||||
|
||||
myComboButton->setEnabled(state && e >= Event::Combo1 && e <= Event::Combo16);
|
||||
}
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
bool EventMappingWidget::handleKeyDown(int ascii, int keycode, int modifiers)
|
||||
{
|
||||
|
@ -349,10 +356,7 @@ void EventMappingWidget::handleCommand(CommandSender* sender, int cmd,
|
|||
{
|
||||
myActionSelected = myActionsList->getSelected();
|
||||
drawKeyMapping();
|
||||
myMapButton->setEnabled(true);
|
||||
myEraseButton->setEnabled(true);
|
||||
myCancelMapButton->setEnabled(false);
|
||||
myResetButton->setEnabled(true);
|
||||
enableButtons(true);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -384,7 +388,9 @@ void EventMappingWidget::handleCommand(CommandSender* sender, int cmd,
|
|||
|
||||
case kComboCmd:
|
||||
if(myComboDialog)
|
||||
myComboDialog->show();
|
||||
myComboDialog->show(
|
||||
instance().eventHandler().eventAtIndex(myActionSelected, myEventMode),
|
||||
instance().eventHandler().actionAtIndex(myActionSelected, myEventMode));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -77,6 +77,7 @@ class EventMappingWidget : public Widget, public CommandSender
|
|||
void saveConfig();
|
||||
|
||||
void drawKeyMapping();
|
||||
void enableButtons(bool state);
|
||||
|
||||
private:
|
||||
ButtonWidget* myMapButton;
|
||||
|
|
|
@ -51,6 +51,7 @@ class ScrollBarWidget : public Widget, public CommandSender
|
|||
void recalc();
|
||||
|
||||
static void setWheelLines(int lines) { _WHEEL_LINES = lines; }
|
||||
static int getWheelLines() { return _WHEEL_LINES; }
|
||||
|
||||
private:
|
||||
void drawWidget(bool hilite);
|
||||
|
|
|
@ -319,6 +319,8 @@
|
|||
DCB5CEE711F5B78C00C68D09 /* MessageBox.cxx in Sources */ = {isa = PBXBuildFile; fileRef = DCB5CEE511F5B78C00C68D09 /* MessageBox.cxx */; };
|
||||
DCB5CEE811F5B78C00C68D09 /* MessageBox.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DCB5CEE611F5B78C00C68D09 /* MessageBox.hxx */; };
|
||||
DCB9DA5F0FCD527000B192F6 /* GLShaderProgs.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DCB9DA5E0FCD527000B192F6 /* GLShaderProgs.hxx */; };
|
||||
DCBD96891210314C0087CEFD /* ComboDialog.cxx in Sources */ = {isa = PBXBuildFile; fileRef = DCBD96871210314C0087CEFD /* ComboDialog.cxx */; };
|
||||
DCBD968A1210314C0087CEFD /* ComboDialog.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DCBD96881210314C0087CEFD /* ComboDialog.hxx */; };
|
||||
DCD56D380B247D920092F9F8 /* Cart4A50.cxx in Sources */ = {isa = PBXBuildFile; fileRef = DCD56D360B247D920092F9F8 /* Cart4A50.cxx */; };
|
||||
DCD56D390B247D920092F9F8 /* Cart4A50.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DCD56D370B247D920092F9F8 /* Cart4A50.hxx */; };
|
||||
DCD56D3C0B247DB40092F9F8 /* RectList.cxx in Sources */ = {isa = PBXBuildFile; fileRef = DCD56D3A0B247DB40092F9F8 /* RectList.cxx */; };
|
||||
|
@ -722,6 +724,8 @@
|
|||
DCB5CEE511F5B78C00C68D09 /* MessageBox.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MessageBox.cxx; path = ../gui/MessageBox.cxx; sourceTree = SOURCE_ROOT; };
|
||||
DCB5CEE611F5B78C00C68D09 /* MessageBox.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = MessageBox.hxx; path = ../gui/MessageBox.hxx; sourceTree = SOURCE_ROOT; };
|
||||
DCB9DA5E0FCD527000B192F6 /* GLShaderProgs.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = GLShaderProgs.hxx; path = ../common/GLShaderProgs.hxx; sourceTree = SOURCE_ROOT; };
|
||||
DCBD96871210314C0087CEFD /* ComboDialog.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ComboDialog.cxx; path = ../gui/ComboDialog.cxx; sourceTree = SOURCE_ROOT; };
|
||||
DCBD96881210314C0087CEFD /* ComboDialog.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ComboDialog.hxx; path = ../gui/ComboDialog.hxx; sourceTree = SOURCE_ROOT; };
|
||||
DCD56D360B247D920092F9F8 /* Cart4A50.cxx */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Cart4A50.cxx; path = ../emucore/Cart4A50.cxx; sourceTree = SOURCE_ROOT; };
|
||||
DCD56D370B247D920092F9F8 /* Cart4A50.hxx */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; name = Cart4A50.hxx; path = ../emucore/Cart4A50.hxx; sourceTree = SOURCE_ROOT; };
|
||||
DCD56D3A0B247DB40092F9F8 /* RectList.cxx */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = RectList.cxx; path = ../common/RectList.cxx; sourceTree = SOURCE_ROOT; };
|
||||
|
@ -1115,6 +1119,8 @@
|
|||
2DDBEAA9084578BF00812C11 /* BrowserDialog.hxx */,
|
||||
2DEF21F808BC033500B246B4 /* CheckListWidget.cxx */,
|
||||
2DEF21F908BC033500B246B4 /* CheckListWidget.hxx */,
|
||||
DCBD96871210314C0087CEFD /* ComboDialog.cxx */,
|
||||
DCBD96881210314C0087CEFD /* ComboDialog.hxx */,
|
||||
2DDBEAAA084578BF00812C11 /* Command.hxx */,
|
||||
2D73959308C3EB4E0060BB99 /* CommandDialog.cxx */,
|
||||
2D73959408C3EB4E0060BB99 /* CommandDialog.hxx */,
|
||||
|
@ -1455,6 +1461,7 @@
|
|||
DC3FE48311C7D35600C91C72 /* pngpriv.h in Headers */,
|
||||
DC3FE4A011C7D3FE00C91C72 /* PNGLibrary.hxx in Headers */,
|
||||
DCB5CEE811F5B78C00C68D09 /* MessageBox.hxx in Headers */,
|
||||
DCBD968A1210314C0087CEFD /* ComboDialog.hxx in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -1706,6 +1713,7 @@
|
|||
DC3FE48D11C7D35600C91C72 /* pngwutil.c in Sources */,
|
||||
DC3FE49F11C7D3FE00C91C72 /* PNGLibrary.cxx in Sources */,
|
||||
DCB5CEE711F5B78C00C68D09 /* MessageBox.cxx in Sources */,
|
||||
DCBD96891210314C0087CEFD /* ComboDialog.cxx in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
|
|
@ -357,6 +357,8 @@
|
|||
DCF7B0DE10A762FC007A2870 /* CartF0.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DCF7B0DA10A762FC007A2870 /* CartF0.hxx */; };
|
||||
DCF7B0DF10A762FC007A2870 /* CartFA.cxx in Sources */ = {isa = PBXBuildFile; fileRef = DCF7B0DB10A762FC007A2870 /* CartFA.cxx */; };
|
||||
DCF7B0E010A762FC007A2870 /* CartFA.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DCF7B0DC10A762FC007A2870 /* CartFA.hxx */; };
|
||||
DCFFE59D12100E1400DFA000 /* ComboDialog.cxx in Sources */ = {isa = PBXBuildFile; fileRef = DCFFE59B12100E1400DFA000 /* ComboDialog.cxx */; };
|
||||
DCFFE59E12100E1400DFA000 /* ComboDialog.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DCFFE59C12100E1400DFA000 /* ComboDialog.hxx */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXBuildRule section */
|
||||
|
@ -760,6 +762,8 @@
|
|||
DCF7B0DA10A762FC007A2870 /* CartF0.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = CartF0.hxx; path = ../emucore/CartF0.hxx; sourceTree = SOURCE_ROOT; };
|
||||
DCF7B0DB10A762FC007A2870 /* CartFA.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CartFA.cxx; path = ../emucore/CartFA.cxx; sourceTree = SOURCE_ROOT; };
|
||||
DCF7B0DC10A762FC007A2870 /* CartFA.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = CartFA.hxx; path = ../emucore/CartFA.hxx; sourceTree = SOURCE_ROOT; };
|
||||
DCFFE59B12100E1400DFA000 /* ComboDialog.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ComboDialog.cxx; path = ../gui/ComboDialog.cxx; sourceTree = SOURCE_ROOT; };
|
||||
DCFFE59C12100E1400DFA000 /* ComboDialog.hxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; name = ComboDialog.hxx; path = ../gui/ComboDialog.hxx; sourceTree = SOURCE_ROOT; };
|
||||
F5A47A9D01A0482F01D3D55B /* SDLMain.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SDLMain.h; sourceTree = SOURCE_ROOT; };
|
||||
F5A47A9E01A0483001D3D55B /* SDLMain.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = SDLMain.m; sourceTree = SOURCE_ROOT; };
|
||||
/* End PBXFileReference section */
|
||||
|
@ -1115,6 +1119,8 @@
|
|||
2DDBEAA9084578BF00812C11 /* BrowserDialog.hxx */,
|
||||
2DEF21F808BC033500B246B4 /* CheckListWidget.cxx */,
|
||||
2DEF21F908BC033500B246B4 /* CheckListWidget.hxx */,
|
||||
DCFFE59B12100E1400DFA000 /* ComboDialog.cxx */,
|
||||
DCFFE59C12100E1400DFA000 /* ComboDialog.hxx */,
|
||||
2DDBEAAA084578BF00812C11 /* Command.hxx */,
|
||||
2D73959308C3EB4E0060BB99 /* CommandDialog.cxx */,
|
||||
2D73959408C3EB4E0060BB99 /* CommandDialog.hxx */,
|
||||
|
@ -1455,6 +1461,7 @@
|
|||
DCD6FC7711C281ED005DA767 /* pngpriv.h in Headers */,
|
||||
DCD6FC9411C28C6F005DA767 /* PNGLibrary.hxx in Headers */,
|
||||
DC98F35711F5B56200AA520F /* MessageBox.hxx in Headers */,
|
||||
DCFFE59E12100E1400DFA000 /* ComboDialog.hxx in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -1709,6 +1716,7 @@
|
|||
DCD6FC8211C281ED005DA767 /* pngwutil.c in Sources */,
|
||||
DCD6FC9311C28C6F005DA767 /* PNGLibrary.cxx in Sources */,
|
||||
DC98F35611F5B56200AA520F /* MessageBox.cxx in Sources */,
|
||||
DCFFE59D12100E1400DFA000 /* ComboDialog.cxx in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue