mirror of https://github.com/stella-emu/stella.git
Added up/down buttons to the ContextMenu dialog when scrolling
should occur. Removed some dead code (Surface class that hasn't been used for quite some time). git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1955 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
67f53ceb6b
commit
fc737cde14
|
@ -29,7 +29,6 @@
|
|||
#include "Font.hxx"
|
||||
#include "OSystem.hxx"
|
||||
#include "Settings.hxx"
|
||||
#include "Surface.hxx"
|
||||
#include "TIA.hxx"
|
||||
#include "GLShaderProgs.hxx"
|
||||
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#include "OSystem.hxx"
|
||||
#include "RectList.hxx"
|
||||
#include "Settings.hxx"
|
||||
#include "Surface.hxx"
|
||||
#include "TIA.hxx"
|
||||
|
||||
#include "FrameBufferSoft.hxx"
|
||||
|
|
|
@ -365,6 +365,27 @@ void ContextMenu::scrollDown()
|
|||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void ContextMenu::drawDialog()
|
||||
{
|
||||
static uInt32 up_arrow[8] = {
|
||||
0x00011000,
|
||||
0x00011000,
|
||||
0x00111100,
|
||||
0x00111100,
|
||||
0x01111110,
|
||||
0x01111110,
|
||||
0x11111111,
|
||||
0x11111111
|
||||
};
|
||||
static uInt32 down_arrow[8] = {
|
||||
0x11111111,
|
||||
0x11111111,
|
||||
0x01111110,
|
||||
0x01111110,
|
||||
0x00111100,
|
||||
0x00111100,
|
||||
0x00011000,
|
||||
0x00011000
|
||||
};
|
||||
|
||||
// Normally we add widgets and let Dialog::draw() take care of this
|
||||
// logic. But for some reason, this Dialog was written differently
|
||||
// by the ScummVM guys, so I'm not going to mess with it.
|
||||
|
@ -383,7 +404,8 @@ void ContextMenu::drawDialog()
|
|||
int offset = _selectedOffset;
|
||||
if(_showScroll)
|
||||
{
|
||||
s.drawString(_font, " ^^^^^", x + 1, y + 2, w, kTextColor);
|
||||
s.hLine(x, y+_rowHeight-1, w+2, kShadowColor);
|
||||
s.drawBitmap(up_arrow, ((_w-_x)>>1)-4, (_rowHeight>>1)+y-4, kScrollColor, 8);
|
||||
y += _rowHeight;
|
||||
offset--;
|
||||
}
|
||||
|
@ -400,7 +422,8 @@ void ContextMenu::drawDialog()
|
|||
// Show bottom scroll area
|
||||
if(_showScroll)
|
||||
{
|
||||
s.drawString(_font, " vvvvv", x + 1, y + 2, w, kTextColor);
|
||||
s.hLine(x, y, w+2, kShadowColor);
|
||||
s.drawBitmap(down_arrow, ((_w-_x)>>1)-4, (_rowHeight>>1)+y-4, kScrollColor, 8);
|
||||
}
|
||||
|
||||
s.addDirtyRect(_x, _y, _w, _h);
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
#include "FrameBuffer.hxx"
|
||||
#include "OSystem.hxx"
|
||||
#include "Settings.hxx"
|
||||
#include "Surface.hxx"
|
||||
#include "Widget.hxx"
|
||||
|
||||
#include "RomInfoWidget.hxx"
|
||||
|
|
|
@ -1,46 +0,0 @@
|
|||
//============================================================================
|
||||
//
|
||||
// SSSS tt lll lll
|
||||
// SS SS tt ll ll
|
||||
// SS tttttt eeee ll ll aaaa
|
||||
// SSSS tt ee ee ll ll aa
|
||||
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
|
||||
// SS SS tt ee ll ll aa aa
|
||||
// SSSS ttt eeeee llll llll aaaaa
|
||||
//
|
||||
// Copyright (c) 1995-2010 by Bradford W. Mott and the Stella Team
|
||||
//
|
||||
// See the file "License.txt" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
//============================================================================
|
||||
|
||||
#include <SDL.h>
|
||||
|
||||
#include "Surface.hxx"
|
||||
|
||||
namespace GUI {
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
Surface::Surface(int width, int height, SDL_Surface* data)
|
||||
: myBaseWidth(width),
|
||||
myBaseHeight(height),
|
||||
myClipWidth(width),
|
||||
myClipHeight(height),
|
||||
myData(data)
|
||||
{
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
Surface::~Surface()
|
||||
{
|
||||
if(myData)
|
||||
SDL_FreeSurface(myData);
|
||||
myData = NULL;
|
||||
}
|
||||
|
||||
} // namespace GUI
|
|
@ -1,64 +0,0 @@
|
|||
//============================================================================
|
||||
//
|
||||
// SSSS tt lll lll
|
||||
// SS SS tt ll ll
|
||||
// SS tttttt eeee ll ll aaaa
|
||||
// SSSS tt ee ee ll ll aa
|
||||
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
|
||||
// SS SS tt ee ll ll aa aa
|
||||
// SSSS ttt eeeee llll llll aaaaa
|
||||
//
|
||||
// Copyright (c) 1995-2010 by Bradford W. Mott and the Stella Team
|
||||
//
|
||||
// See the file "License.txt" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id$
|
||||
//============================================================================
|
||||
|
||||
#ifndef GUI_SURFACE_HXX
|
||||
#define GUI_SURFACE_HXX
|
||||
|
||||
#include <SDL.h>
|
||||
|
||||
namespace GUI {
|
||||
|
||||
/**
|
||||
This class is basically a thin wrapper around an SDL_Surface structure.
|
||||
We do it this way so the SDL stuff won't be dragged into the depths of
|
||||
the codebase. Although everything is public and SDL structures can be
|
||||
used directly, it's recommended to only access the variables from the
|
||||
advertised interface, or from FrameBuffer-derived classes.
|
||||
|
||||
@author Stephen Anthony
|
||||
@version $Id$
|
||||
*/
|
||||
class Surface
|
||||
{
|
||||
public:
|
||||
Surface(int width, int height, SDL_Surface* surface);
|
||||
virtual ~Surface();
|
||||
|
||||
/** Actual width and height of the SDL surface */
|
||||
inline int getWidth() const { return myBaseWidth; }
|
||||
inline int getHeight() const { return myBaseHeight; }
|
||||
|
||||
/** Clipped/drawn width and height of the SDL surface */
|
||||
inline int getClipWidth() const { return myClipWidth; }
|
||||
inline int getClipHeight() const { return myClipHeight; }
|
||||
inline void setClipWidth(int w) { myClipWidth = w; }
|
||||
inline void setClipHeight(int h) { myClipHeight = h; }
|
||||
|
||||
public:
|
||||
int myBaseWidth;
|
||||
int myBaseHeight;
|
||||
|
||||
int myClipWidth;
|
||||
int myClipHeight;
|
||||
|
||||
SDL_Surface* myData;
|
||||
};
|
||||
|
||||
} // namespace GUI
|
||||
|
||||
#endif
|
|
@ -31,7 +31,6 @@ MODULE_OBJS := \
|
|||
src/gui/RomAuditDialog.o \
|
||||
src/gui/RomInfoWidget.o \
|
||||
src/gui/ScrollBarWidget.o \
|
||||
src/gui/Surface.o \
|
||||
src/gui/CheckListWidget.o \
|
||||
src/gui/StringListWidget.o \
|
||||
src/gui/TabWidget.o \
|
||||
|
|
|
@ -316,8 +316,6 @@
|
|||
DCD56D3D0B247DB40092F9F8 /* RectList.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DCD56D3B0B247DB40092F9F8 /* RectList.hxx */; };
|
||||
DCE3BBF90C95CEDC00A671DF /* RomInfoWidget.cxx in Sources */ = {isa = PBXBuildFile; fileRef = DCE3BBF50C95CEDC00A671DF /* RomInfoWidget.cxx */; };
|
||||
DCE3BBFA0C95CEDC00A671DF /* RomInfoWidget.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DCE3BBF60C95CEDC00A671DF /* RomInfoWidget.hxx */; };
|
||||
DCE3BBFB0C95CEDC00A671DF /* Surface.cxx in Sources */ = {isa = PBXBuildFile; fileRef = DCE3BBF70C95CEDC00A671DF /* Surface.cxx */; };
|
||||
DCE3BBFC0C95CEDC00A671DF /* Surface.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DCE3BBF80C95CEDC00A671DF /* Surface.hxx */; };
|
||||
DCE6EB220DD9ADA00047AC28 /* TrackBall.cxx in Sources */ = {isa = PBXBuildFile; fileRef = DCE6EB200DD9ADA00047AC28 /* TrackBall.cxx */; };
|
||||
DCE6EB230DD9ADA00047AC28 /* TrackBall.hxx in Headers */ = {isa = PBXBuildFile; fileRef = DCE6EB210DD9ADA00047AC28 /* TrackBall.hxx */; };
|
||||
DCEECE560B5E5E540021D754 /* Cart0840.cxx in Sources */ = {isa = PBXBuildFile; fileRef = DCEECE540B5E5E540021D754 /* Cart0840.cxx */; };
|
||||
|
@ -697,8 +695,6 @@
|
|||
DCD56D3B0B247DB40092F9F8 /* RectList.hxx */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; name = RectList.hxx; path = ../common/RectList.hxx; sourceTree = SOURCE_ROOT; };
|
||||
DCE3BBF50C95CEDC00A671DF /* RomInfoWidget.cxx */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = RomInfoWidget.cxx; path = ../gui/RomInfoWidget.cxx; sourceTree = SOURCE_ROOT; };
|
||||
DCE3BBF60C95CEDC00A671DF /* RomInfoWidget.hxx */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; name = RomInfoWidget.hxx; path = ../gui/RomInfoWidget.hxx; sourceTree = SOURCE_ROOT; };
|
||||
DCE3BBF70C95CEDC00A671DF /* Surface.cxx */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Surface.cxx; path = ../gui/Surface.cxx; sourceTree = SOURCE_ROOT; };
|
||||
DCE3BBF80C95CEDC00A671DF /* Surface.hxx */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; name = Surface.hxx; path = "..//gui/Surface.hxx"; sourceTree = SOURCE_ROOT; };
|
||||
DCE6EB200DD9ADA00047AC28 /* TrackBall.cxx */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = TrackBall.cxx; path = ../emucore/TrackBall.cxx; sourceTree = SOURCE_ROOT; };
|
||||
DCE6EB210DD9ADA00047AC28 /* TrackBall.hxx */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.h; name = TrackBall.hxx; path = ../emucore/TrackBall.hxx; sourceTree = SOURCE_ROOT; };
|
||||
DCEECE540B5E5E540021D754 /* Cart0840.cxx */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = Cart0840.cxx; path = ../emucore/Cart0840.cxx; sourceTree = SOURCE_ROOT; };
|
||||
|
@ -1072,8 +1068,6 @@
|
|||
DC4613660D92C03600D8DAB9 /* RomAuditDialog.hxx */,
|
||||
DCE3BBF50C95CEDC00A671DF /* RomInfoWidget.cxx */,
|
||||
DCE3BBF60C95CEDC00A671DF /* RomInfoWidget.hxx */,
|
||||
DCE3BBF70C95CEDC00A671DF /* Surface.cxx */,
|
||||
DCE3BBF80C95CEDC00A671DF /* Surface.hxx */,
|
||||
DC8078E40B4BD697005E9305 /* FileSnapDialog.cxx */,
|
||||
DC8078E50B4BD697005E9305 /* FileSnapDialog.hxx */,
|
||||
DC8078E60B4BD697005E9305 /* UIDialog.cxx */,
|
||||
|
@ -1333,7 +1327,6 @@
|
|||
DC8078EB0B4BD697005E9305 /* UIDialog.hxx in Headers */,
|
||||
DCEECE570B5E5E540021D754 /* Cart0840.hxx in Headers */,
|
||||
DCE3BBFA0C95CEDC00A671DF /* RomInfoWidget.hxx in Headers */,
|
||||
DCE3BBFC0C95CEDC00A671DF /* Surface.hxx in Headers */,
|
||||
DC07A3C90CAD738A009B4BC9 /* StateManager.hxx in Headers */,
|
||||
DC0984860D3985160073C852 /* CartSB.hxx in Headers */,
|
||||
DCA23AEA0D75B22500F77B33 /* CartX07.hxx in Headers */,
|
||||
|
@ -1583,7 +1576,6 @@
|
|||
DC8078EA0B4BD697005E9305 /* UIDialog.cxx in Sources */,
|
||||
DCEECE560B5E5E540021D754 /* Cart0840.cxx in Sources */,
|
||||
DCE3BBF90C95CEDC00A671DF /* RomInfoWidget.cxx in Sources */,
|
||||
DCE3BBFB0C95CEDC00A671DF /* Surface.cxx in Sources */,
|
||||
DC07A3C80CAD738A009B4BC9 /* StateManager.cxx in Sources */,
|
||||
DC0984850D3985160073C852 /* CartSB.cxx in Sources */,
|
||||
DCA23AE90D75B22500F77B33 /* CartX07.cxx in Sources */,
|
||||
|
|
|
@ -925,10 +925,6 @@
|
|||
RelativePath="..\gui\StringListWidget.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\gui\Surface.cxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\gui\TabWidget.cxx"
|
||||
>
|
||||
|
@ -1651,10 +1647,6 @@
|
|||
RelativePath="..\gui\StringListWidget.hxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\gui\Surface.hxx"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\gui\TabWidget.hxx"
|
||||
>
|
||||
|
|
Loading…
Reference in New Issue