mirror of https://github.com/stella-emu/stella.git
More work on the remapping of menu/UI events infrastructure.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1101 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
e49e1f17e4
commit
ebf39cb52d
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: EventHandler.cxx,v 1.161 2006-05-04 17:45:24 stephena Exp $
|
// $Id: EventHandler.cxx,v 1.162 2006-05-05 18:00:50 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
@ -1848,6 +1848,28 @@ inline bool EventHandler::eventIsAnalog(Event::Type event)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
StringList EventHandler::getEmulationActions()
|
||||||
|
{
|
||||||
|
StringList l;
|
||||||
|
|
||||||
|
for(int i = 0; i < kActionListSize; ++i)
|
||||||
|
l.push_back(EventHandler::ourActionList[i].action);
|
||||||
|
|
||||||
|
return l;
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
StringList EventHandler::getMenuActions()
|
||||||
|
{
|
||||||
|
StringList l; // FIXME
|
||||||
|
|
||||||
|
// for(int i = 0; i < kActionListSize; ++i)
|
||||||
|
// l.push_back(EventHandler::ourActionList[i].action);
|
||||||
|
|
||||||
|
return l;
|
||||||
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
Event::Type EventHandler::eventForKey(int key, EventMode mode)
|
Event::Type EventHandler::eventForKey(int key, EventMode mode)
|
||||||
{
|
{
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: EventHandler.hxx,v 1.86 2006-05-04 17:45:24 stephena Exp $
|
// $Id: EventHandler.hxx,v 1.87 2006-05-05 18:00:51 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#ifndef EVENTHANDLER_HXX
|
#ifndef EVENTHANDLER_HXX
|
||||||
|
@ -65,8 +65,8 @@ enum {
|
||||||
};
|
};
|
||||||
|
|
||||||
enum EventMode {
|
enum EventMode {
|
||||||
kEmulation,
|
kEmulationMode,
|
||||||
kMenuOverlay
|
kMenuMode
|
||||||
};
|
};
|
||||||
|
|
||||||
// Joystick related items
|
// Joystick related items
|
||||||
|
@ -112,7 +112,7 @@ struct JoyMouse {
|
||||||
mapping can take place.
|
mapping can take place.
|
||||||
|
|
||||||
@author Stephen Anthony
|
@author Stephen Anthony
|
||||||
@version $Id: EventHandler.hxx,v 1.86 2006-05-04 17:45:24 stephena Exp $
|
@version $Id: EventHandler.hxx,v 1.87 2006-05-05 18:00:51 stephena Exp $
|
||||||
*/
|
*/
|
||||||
class EventHandler
|
class EventHandler
|
||||||
{
|
{
|
||||||
|
@ -333,6 +333,9 @@ class EventHandler
|
||||||
|
|
||||||
inline SDL_Joystick* getJoystick(int i) { return ourJoysticks[i].stick; }
|
inline SDL_Joystick* getJoystick(int i) { return ourJoysticks[i].stick; }
|
||||||
|
|
||||||
|
StringList getEmulationActions();
|
||||||
|
StringList getMenuActions();
|
||||||
|
|
||||||
Event::Type eventForKey(int key, EventMode mode);
|
Event::Type eventForKey(int key, EventMode mode);
|
||||||
Event::Type eventForJoyButton(int stick, int button, EventMode mode);
|
Event::Type eventForJoyButton(int stick, int button, EventMode mode);
|
||||||
Event::Type eventForJoyAxis(int stick, int axis, int value, EventMode mode);
|
Event::Type eventForJoyAxis(int stick, int axis, int value, EventMode mode);
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: Dialog.cxx,v 1.44 2006-05-04 17:45:25 stephena Exp $
|
// $Id: Dialog.cxx,v 1.45 2006-05-05 18:00:51 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -313,7 +313,7 @@ void Dialog::handleKeyDown(int ascii, int keycode, int modifiers)
|
||||||
// which must always be processed before any widget sees it.
|
// which must always be processed before any widget sees it.
|
||||||
bool handled = false;
|
bool handled = false;
|
||||||
if(e == Event::NoType)
|
if(e == Event::NoType)
|
||||||
e = instance()->eventHandler().eventForKey(ascii, kMenuOverlay);
|
e = instance()->eventHandler().eventForKey(ascii, kMenuMode);
|
||||||
|
|
||||||
switch(e)
|
switch(e)
|
||||||
{
|
{
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: EventMappingWidget.cxx,v 1.15 2006-05-04 17:45:25 stephena Exp $
|
// $Id: EventMappingWidget.cxx,v 1.16 2006-05-05 18:00:51 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -33,9 +33,11 @@
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
EventMappingWidget::EventMappingWidget(GuiObject* boss, const GUI::Font& font,
|
EventMappingWidget::EventMappingWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
int x, int y, int w, int h)
|
int x, int y, int w, int h,
|
||||||
|
const StringList& actions, EventMode mode)
|
||||||
: Widget(boss, font, x, y, w, h),
|
: Widget(boss, font, x, y, w, h),
|
||||||
CommandSender(boss),
|
CommandSender(boss),
|
||||||
|
myEventMode(mode),
|
||||||
myActionSelected(-1),
|
myActionSelected(-1),
|
||||||
myRemapStatus(false),
|
myRemapStatus(false),
|
||||||
myFirstTime(true)
|
myFirstTime(true)
|
||||||
|
@ -50,6 +52,7 @@ EventMappingWidget::EventMappingWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
myActionsList->setTarget(this);
|
myActionsList->setTarget(this);
|
||||||
myActionsList->setNumberingMode(kListNumberingOff);
|
myActionsList->setNumberingMode(kListNumberingOff);
|
||||||
myActionsList->setEditable(false);
|
myActionsList->setEditable(false);
|
||||||
|
myActionsList->setList(actions);
|
||||||
addFocusWidget(myActionsList);
|
addFocusWidget(myActionsList);
|
||||||
|
|
||||||
// Add remap, erase, cancel and default buttons
|
// Add remap, erase, cancel and default buttons
|
||||||
|
@ -80,14 +83,6 @@ EventMappingWidget::EventMappingWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
myKeyMapping = new StaticTextWidget(boss, font, xpos, ypos, _w - 20, fontHeight,
|
myKeyMapping = new StaticTextWidget(boss, font, xpos, ypos, _w - 20, fontHeight,
|
||||||
"Action: ", kTextAlignLeft);
|
"Action: ", kTextAlignLeft);
|
||||||
myKeyMapping->setFlags(WIDGET_CLEARBG);
|
myKeyMapping->setFlags(WIDGET_CLEARBG);
|
||||||
|
|
||||||
// Get actions names
|
|
||||||
StringList l;
|
|
||||||
|
|
||||||
for(int i = 0; i < kActionListSize; ++i)
|
|
||||||
l.push_back(EventHandler::ourActionList[i].action);
|
|
||||||
|
|
||||||
myActionsList->setList(l);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
@ -98,7 +93,7 @@ EventMappingWidget::~EventMappingWidget()
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void EventMappingWidget::loadConfig()
|
void EventMappingWidget::loadConfig()
|
||||||
{
|
{
|
||||||
//cerr << "EventMappingWidget::loadConfig()\n";
|
cerr << "EventMappingWidget::loadConfig() for " << myEventMode << endl;
|
||||||
if(myFirstTime)
|
if(myFirstTime)
|
||||||
{
|
{
|
||||||
myActionsList->setSelected(0);
|
myActionsList->setSelected(0);
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: EventMappingWidget.hxx,v 1.9 2006-05-04 17:45:25 stephena Exp $
|
// $Id: EventMappingWidget.hxx,v 1.10 2006-05-05 18:00:51 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -42,7 +42,8 @@ class EventMappingWidget : public Widget, public CommandSender
|
||||||
|
|
||||||
public:
|
public:
|
||||||
EventMappingWidget(GuiObject* boss, const GUI::Font& font,
|
EventMappingWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
int x, int y, int w, int h);
|
int x, int y, int w, int h,
|
||||||
|
const StringList& actions, EventMode mode);
|
||||||
~EventMappingWidget();
|
~EventMappingWidget();
|
||||||
|
|
||||||
bool handleKeyDown(int ascii, int keycode, int modifiers);
|
bool handleKeyDown(int ascii, int keycode, int modifiers);
|
||||||
|
@ -78,6 +79,10 @@ class EventMappingWidget : public Widget, public CommandSender
|
||||||
void drawKeyMapping();
|
void drawKeyMapping();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
// Since this widget can be used for different collections of events,
|
||||||
|
// we need to specify exactly which group of events we are remapping
|
||||||
|
EventMode myEventMode;
|
||||||
|
|
||||||
// Indicates the event that is currently selected
|
// Indicates the event that is currently selected
|
||||||
int myActionSelected;
|
int myActionSelected;
|
||||||
|
|
||||||
|
|
|
@ -13,9 +13,12 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: InputDialog.cxx,v 1.14 2006-05-04 17:45:25 stephena Exp $
|
// $Id: InputDialog.cxx,v 1.15 2006-05-05 18:00:51 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
|
// FIXME - this whole dialog should be a dialog of buttons instead of
|
||||||
|
// a tabwidget. It would make things sooo much easier.
|
||||||
|
|
||||||
#include "OSystem.hxx"
|
#include "OSystem.hxx"
|
||||||
#include "Widget.hxx"
|
#include "Widget.hxx"
|
||||||
#include "Array.hxx"
|
#include "Array.hxx"
|
||||||
|
@ -49,15 +52,27 @@ InputDialog::InputDialog(OSystem* osystem, DialogContainer* parent,
|
||||||
myTab = new TabWidget(this, font, xpos, ypos, _w - 2*xpos, _h - 24 - 2*ypos);
|
myTab = new TabWidget(this, font, xpos, ypos, _w - 2*xpos, _h - 24 - 2*ypos);
|
||||||
addTabWidget(myTab);
|
addTabWidget(myTab);
|
||||||
|
|
||||||
// 1) Event mapper
|
// 1) Event mapper for emulation actions
|
||||||
tabID = myTab->addTab("Event Mapping");
|
tabID = myTab->addTab("Emul. Events");
|
||||||
myEventMapper = new EventMappingWidget(myTab, font, 2, 2,
|
const StringList& eactions = instance()->eventHandler().getEmulationActions();
|
||||||
myTab->getWidth(),
|
myEmulEventMapper = new EventMappingWidget(myTab, font, 2, 2,
|
||||||
myTab->getHeight() - ypos);
|
myTab->getWidth(),
|
||||||
myTab->setParentWidget(tabID, myEventMapper);
|
myTab->getHeight() - ypos,
|
||||||
addToFocusList(myEventMapper->getFocusList(), tabID);
|
eactions, kEmulationMode);
|
||||||
|
myTab->setParentWidget(tabID, myEmulEventMapper);
|
||||||
|
addToFocusList(myEmulEventMapper->getFocusList(), tabID);
|
||||||
|
|
||||||
// 2) Virtual device support
|
// 2) Event mapper for menu actions
|
||||||
|
tabID = myTab->addTab("Menu Events");
|
||||||
|
const StringList& mactions = instance()->eventHandler().getMenuActions();
|
||||||
|
myMenuEventMapper = new EventMappingWidget(myTab, font, 2, 2,
|
||||||
|
myTab->getWidth(),
|
||||||
|
myTab->getHeight() - ypos,
|
||||||
|
mactions, kMenuMode);
|
||||||
|
myTab->setParentWidget(tabID, myMenuEventMapper);
|
||||||
|
addToFocusList(myMenuEventMapper->getFocusList(), tabID);
|
||||||
|
|
||||||
|
// 3) Virtual device support
|
||||||
addVDeviceTab(font);
|
addVDeviceTab(font);
|
||||||
|
|
||||||
// Finalize the tabs, and activate the first tab
|
// Finalize the tabs, and activate the first tab
|
||||||
|
@ -93,7 +108,7 @@ void InputDialog::addVDeviceTab(const GUI::Font& font)
|
||||||
WidgetArray wid;
|
WidgetArray wid;
|
||||||
|
|
||||||
// Virtual device/ports
|
// Virtual device/ports
|
||||||
tabID = myTab->addTab("Virtual Devices");
|
tabID = myTab->addTab("Virtual Devs");
|
||||||
|
|
||||||
// Stelladaptor mappings
|
// Stelladaptor mappings
|
||||||
xpos = 5; ypos = 5;
|
xpos = 5; ypos = 5;
|
||||||
|
@ -194,7 +209,8 @@ void InputDialog::addVDeviceTab(const GUI::Font& font)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void InputDialog::loadConfig()
|
void InputDialog::loadConfig()
|
||||||
{
|
{
|
||||||
myEventMapper->loadConfig();
|
myEmulEventMapper->loadConfig();
|
||||||
|
myMenuEventMapper->loadConfig();
|
||||||
|
|
||||||
// Left & right ports
|
// Left & right ports
|
||||||
const string& sa1 = instance()->settings().getString("sa1");
|
const string& sa1 = instance()->settings().getString("sa1");
|
||||||
|
@ -247,9 +263,11 @@ void InputDialog::saveConfig()
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void InputDialog::handleKeyDown(int ascii, int keycode, int modifiers)
|
void InputDialog::handleKeyDown(int ascii, int keycode, int modifiers)
|
||||||
{
|
{
|
||||||
// Remap key events in remap mode, otherwise pass to listwidget
|
// Remap key events in remap mode, otherwise pass to parent dialog
|
||||||
if(myEventMapper->remapMode())
|
if(myEmulEventMapper->remapMode())
|
||||||
myEventMapper->handleKeyDown(ascii, keycode, modifiers);
|
myEmulEventMapper->handleKeyDown(ascii, keycode, modifiers);
|
||||||
|
else if(myMenuEventMapper->remapMode())
|
||||||
|
myMenuEventMapper->handleKeyDown(ascii, keycode, modifiers);
|
||||||
else
|
else
|
||||||
Dialog::handleKeyDown(ascii, keycode, modifiers);
|
Dialog::handleKeyDown(ascii, keycode, modifiers);
|
||||||
}
|
}
|
||||||
|
@ -257,9 +275,11 @@ void InputDialog::handleKeyDown(int ascii, int keycode, int modifiers)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void InputDialog::handleJoyDown(int stick, int button)
|
void InputDialog::handleJoyDown(int stick, int button)
|
||||||
{
|
{
|
||||||
// Remap joystick buttons in remap mode, otherwise pass to listwidget
|
// Remap joystick buttons in remap mode, otherwise pass to parent dialog
|
||||||
if(myEventMapper->remapMode())
|
if(myEmulEventMapper->remapMode())
|
||||||
myEventMapper->handleJoyDown(stick, button);
|
myEmulEventMapper->handleJoyDown(stick, button);
|
||||||
|
else if(myMenuEventMapper->remapMode())
|
||||||
|
myMenuEventMapper->handleJoyDown(stick, button);
|
||||||
else
|
else
|
||||||
Dialog::handleJoyDown(stick, button);
|
Dialog::handleJoyDown(stick, button);
|
||||||
}
|
}
|
||||||
|
@ -267,9 +287,11 @@ void InputDialog::handleJoyDown(int stick, int button)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void InputDialog::handleJoyAxis(int stick, int axis, int value)
|
void InputDialog::handleJoyAxis(int stick, int axis, int value)
|
||||||
{
|
{
|
||||||
// Remap joystick axis in remap mode, otherwise pass to listwidget
|
// Remap joystick axis in remap mode, otherwise pass to parent dialog
|
||||||
if(myEventMapper->remapMode())
|
if(myEmulEventMapper->remapMode())
|
||||||
myEventMapper->handleJoyAxis(stick, axis, value);
|
myEmulEventMapper->handleJoyAxis(stick, axis, value);
|
||||||
|
else if(myMenuEventMapper->remapMode())
|
||||||
|
myMenuEventMapper->handleJoyAxis(stick, axis, value);
|
||||||
else
|
else
|
||||||
Dialog::handleJoyAxis(stick, axis, value);
|
Dialog::handleJoyAxis(stick, axis, value);
|
||||||
}
|
}
|
||||||
|
@ -277,9 +299,11 @@ void InputDialog::handleJoyAxis(int stick, int axis, int value)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
bool InputDialog::handleJoyHat(int stick, int hat, int value)
|
bool InputDialog::handleJoyHat(int stick, int hat, int value)
|
||||||
{
|
{
|
||||||
// Remap joystick hat in remap mode, otherwise pass to listwidget
|
// Remap joystick hat in remap mode, otherwise pass to parent dialog
|
||||||
if(myEventMapper->remapMode())
|
if(myEmulEventMapper->remapMode())
|
||||||
return myEventMapper->handleJoyHat(stick, hat, value);
|
return myEmulEventMapper->handleJoyHat(stick, hat, value);
|
||||||
|
else if(myMenuEventMapper->remapMode())
|
||||||
|
return myMenuEventMapper->handleJoyHat(stick, hat, value);
|
||||||
else
|
else
|
||||||
return Dialog::handleJoyHat(stick, hat, value);
|
return Dialog::handleJoyHat(stick, hat, value);
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: InputDialog.hxx,v 1.8 2006-04-05 12:28:39 stephena Exp $
|
// $Id: InputDialog.hxx,v 1.9 2006-05-05 18:00:51 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#ifndef INPUT_DIALOG_HXX
|
#ifndef INPUT_DIALOG_HXX
|
||||||
|
@ -54,7 +54,8 @@ class InputDialog : public Dialog
|
||||||
private:
|
private:
|
||||||
TabWidget* myTab;
|
TabWidget* myTab;
|
||||||
|
|
||||||
EventMappingWidget* myEventMapper;
|
EventMappingWidget* myEmulEventMapper;
|
||||||
|
EventMappingWidget* myMenuEventMapper;
|
||||||
|
|
||||||
PopUpWidget* myLeftPort;
|
PopUpWidget* myLeftPort;
|
||||||
PopUpWidget* myRightPort;
|
PopUpWidget* myRightPort;
|
||||||
|
@ -65,8 +66,6 @@ class InputDialog : public Dialog
|
||||||
StaticTextWidget* myPaddleThresholdLabel;
|
StaticTextWidget* myPaddleThresholdLabel;
|
||||||
SliderWidget* myPaddleSpeed[4];
|
SliderWidget* myPaddleSpeed[4];
|
||||||
StaticTextWidget* myPaddleLabel[4];
|
StaticTextWidget* myPaddleLabel[4];
|
||||||
|
|
||||||
CheckBoxWidget* myJoyMouse;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: ListWidget.cxx,v 1.42 2006-05-04 17:45:25 stephena Exp $
|
// $Id: ListWidget.cxx,v 1.43 2006-05-05 18:00:51 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -67,7 +67,8 @@ ListWidget::~ListWidget()
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void ListWidget::setSelected(int item)
|
void ListWidget::setSelected(int item)
|
||||||
{
|
{
|
||||||
assert(item >= -2 && item < (int)_list.size());
|
if(item < -1 || item >= (int)_list.size())
|
||||||
|
return;
|
||||||
|
|
||||||
if(isEnabled())
|
if(isEnabled())
|
||||||
{
|
{
|
||||||
|
@ -85,7 +86,8 @@ void ListWidget::setSelected(int item)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void ListWidget::setHighlighted(int item)
|
void ListWidget::setHighlighted(int item)
|
||||||
{
|
{
|
||||||
assert(item >= -1 && item < (int)_list.size());
|
if(item < -1 || item >= (int)_list.size())
|
||||||
|
return;
|
||||||
|
|
||||||
if(isEnabled())
|
if(isEnabled())
|
||||||
{
|
{
|
||||||
|
@ -463,7 +465,6 @@ void ListWidget::endEditMode()
|
||||||
void ListWidget::abortEditMode()
|
void ListWidget::abortEditMode()
|
||||||
{
|
{
|
||||||
// Undo any changes made
|
// Undo any changes made
|
||||||
assert(_selectedItem >= 0);
|
|
||||||
_editMode = false;
|
_editMode = false;
|
||||||
|
|
||||||
// Reset to normal data entry
|
// Reset to normal data entry
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: PopUpWidget.cxx,v 1.25 2006-05-04 17:45:25 stephena Exp $
|
// $Id: PopUpWidget.cxx,v 1.26 2006-05-05 18:00:51 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -141,12 +141,8 @@ void PopUpDialog::handleKeyDown(int ascii, int keycode, int modifiers)
|
||||||
cancelSelection();
|
cancelSelection();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
{
|
handleEvent(instance()->eventHandler().eventForKey(ascii, kMenuMode));
|
||||||
Event::Type e = instance()->eventHandler().eventForKey(ascii,
|
|
||||||
kMenuOverlay);
|
|
||||||
handleEvent(e);
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue