SAGA2: Rename class variables in panel.h

This commit is contained in:
Eugene Sandulenko 2022-09-26 19:52:06 +02:00
parent 307bd92ea8
commit ea0d27d496
No known key found for this signature in database
GPG key ID: 014D387312D34F08
16 changed files with 557 additions and 558 deletions

View file

@ -235,7 +235,7 @@ void AutoMap::locateRegion() {
// deactivation // deactivation
void AutoMap::deactivate() { void AutoMap::deactivate() {
selected = 0; _selected = 0;
gPanel::deactivate(); gPanel::deactivate();
} }
@ -244,7 +244,7 @@ void AutoMap::deactivate() {
bool AutoMap::activate(gEventType why) { bool AutoMap::activate(gEventType why) {
if (why == gEventMouseDown) { // momentarily depress if (why == gEventMouseDown) { // momentarily depress
selected = 1; _selected = 1;
notify(why, 0); // notify App of successful hit notify(why, 0); // notify App of successful hit
return true; return true;
} }
@ -253,7 +253,7 @@ bool AutoMap::activate(gEventType why) {
bool AutoMap::keyStroke(gPanelMessage &msg) { bool AutoMap::keyStroke(gPanelMessage &msg) {
gEvent ev; gEvent ev;
switch (msg.key) { switch (msg._key) {
case Common::ASCII_ESCAPE: case Common::ASCII_ESCAPE:
cmdAutoMapEsc(ev); cmdAutoMapEsc(ev);
return true; return true;
@ -292,7 +292,7 @@ gPanel *AutoMap::keyTest(int16 key) {
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
// mouse movement event handler // mouse movement event handler
void AutoMap::pointerMove(gPanelMessage &msg) { void AutoMap::pointerMove(gPanelMessage &msg) {
Point16 pos = msg.pickAbsPos; Point16 pos = msg._pickAbsPos;
if (Rect16(_extent.x, _extent.y, _extent.width, _extent.height).ptInside(pos)) { if (Rect16(_extent.x, _extent.y, _extent.width, _extent.height).ptInside(pos)) {
// mouse hit inside autoMap // mouse hit inside autoMap
@ -315,7 +315,7 @@ void AutoMap::pointerMove(gPanelMessage &msg) {
// mouse click event handler // mouse click event handler
bool AutoMap::pointerHit(gPanelMessage &msg) { bool AutoMap::pointerHit(gPanelMessage &msg) {
Point16 pos = msg.pickAbsPos; Point16 pos = msg._pickAbsPos;
if (Rect16(0, 0, _extent.width, _extent.height).ptInside(pos)) { if (Rect16(0, 0, _extent.width, _extent.height).ptInside(pos)) {
// mouse hit inside autoMap // mouse hit inside autoMap
@ -346,13 +346,13 @@ bool AutoMap::pointerHit(gPanelMessage &msg) {
win = getWindow(); // get the window pointer win = getWindow(); // get the window pointer
if (win) if (win)
ri = (requestInfo *)win->userData; ri = (requestInfo *)win->_userData;
else else
ri = nullptr; ri = nullptr;
if (ri) { if (ri) {
ri->running = 0; ri->running = 0;
ri->result = id; ri->result = _id;
} }
} }
@ -364,7 +364,7 @@ bool AutoMap::pointerHit(gPanelMessage &msg) {
// mouse drag event handler // mouse drag event handler
void AutoMap::pointerDrag(gPanelMessage &) { void AutoMap::pointerDrag(gPanelMessage &) {
if (selected) { if (_selected) {
notify(gEventMouseDrag, 0); notify(gEventMouseDrag, 0);
} }
} }
@ -373,7 +373,7 @@ void AutoMap::pointerDrag(gPanelMessage &) {
// mouse click release event handler // mouse click release event handler
void AutoMap::pointerRelease(gPanelMessage &) { void AutoMap::pointerRelease(gPanelMessage &) {
if (selected) notify(gEventMouseUp, 0); // notify App of successful hit if (_selected) notify(gEventMouseUp, 0); // notify App of successful hit
deactivate(); deactivate();
} }
@ -568,7 +568,7 @@ int16 openAutoMap() {
decRes, 'M', 'A', 'P'); decRes, 'M', 'A', 'P');
// attach the structure to the book // attach the structure to the book
pAutoMap->userData = &rInfo; pAutoMap->_userData = &rInfo;
// locate where the center actor is, and open the map // locate where the center actor is, and open the map
pAutoMap->locateRegion(); pAutoMap->locateRegion();
@ -600,11 +600,11 @@ APPFUNC(cmdAutoMapQuit) {
if (ev.panel && ev.eventType == gEventNewValue && ev.value) { if (ev.panel && ev.eventType == gEventNewValue && ev.value) {
win = ev.panel->getWindow(); // get the window pointer win = ev.panel->getWindow(); // get the window pointer
ri = win ? (requestInfo *)win->userData : nullptr; ri = win ? (requestInfo *)win->_userData : nullptr;
if (ri) { if (ri) {
ri->running = 0; ri->running = 0;
ri->result = ev.panel->id; ri->result = ev.panel->_id;
} }
} }
} }
@ -647,7 +647,7 @@ APPFUNC(cmdAutoMapAppFunc) {
} }
APPFUNCV(AutoMap::cmdAutoMapEsc) { APPFUNCV(AutoMap::cmdAutoMapEsc) {
requestInfo *ri = (requestInfo *) userData; requestInfo *ri = (requestInfo *)_userData;
if (ri) { if (ri) {
ri->running = 0; ri->running = 0;
ri->result = 0; ri->result = 0;

View file

@ -110,7 +110,7 @@ GfxCompImage::GfxCompImage(gPanelList &list, const Rect16 &box, void *image, con
_compImages[0] = image; _compImages[0] = image;
_max = 0; _max = 0;
_numPtrAlloc = 1; _numPtrAlloc = 1;
title = text; _title = text;
_textFont = &Onyx10Font; // >>> this should be dynamic _textFont = &Onyx10Font; // >>> this should be dynamic
_textPal = pal; _textPal = pal;
} }
@ -143,7 +143,7 @@ GfxCompImage::GfxCompImage(gPanelList &list, const Rect16 &box, void **images,
_currentImage = clamp(_min, initial, _max); _currentImage = clamp(_min, initial, _max);
} }
title = text; _title = text;
_textFont = &Onyx10Font; // >>> this should be dynamic _textFont = &Onyx10Font; // >>> this should be dynamic
_textPal = pal; _textPal = pal;
} }
@ -161,7 +161,7 @@ GfxCompImage::GfxCompImage(gPanelList &list, const StaticRect &box, void **image
_currentImage = clamp(_min, initial, _max); _currentImage = clamp(_min, initial, _max);
} }
title = text; _title = text;
_textFont = &Onyx10Font; // >>> this should be dynamic _textFont = &Onyx10Font; // >>> this should be dynamic
_textPal = pal; _textPal = pal;
} }
@ -191,7 +191,7 @@ void GfxCompImage::pointerMove(gPanelMessage &msg) {
// call the superclass's pointerMove // call the superclass's pointerMove
gControl::pointerMove(msg); gControl::pointerMove(msg);
notify(gEventMouseMove, (msg.pointerEnter ? enter : 0) | (msg.pointerLeave ? leave : 0)); notify(gEventMouseMove, (msg._pointerEnter ? enter : 0) | (msg._pointerLeave ? leave : 0));
} }
void GfxCompImage::enable(bool abled) { void GfxCompImage::enable(bool abled) {
@ -199,12 +199,12 @@ void GfxCompImage::enable(bool abled) {
} }
void GfxCompImage::invalidate(Rect16 *) { void GfxCompImage::invalidate(Rect16 *) {
window.update(_extent); _window.update(_extent);
} }
void GfxCompImage::draw() { void GfxCompImage::draw() {
gPort &port = window.windowPort; gPort &port = _window._windowPort;
Rect16 rect = window.getExtent(); Rect16 rect = _window.getExtent();
SAVE_GPORT_STATE(port); // save pen color, etc. SAVE_GPORT_STATE(port); // save pen color, etc.
g_vm->_pointer->hide(port, _extent); // hide mouse pointer g_vm->_pointer->hide(port, _extent); // hide mouse pointer
@ -241,7 +241,7 @@ void GfxCompImage::select(uint16 val) {
setCurrent(val); setCurrent(val);
if (getEnabled()) { if (getEnabled()) {
window.update(_extent); _window.update(_extent);
} }
} }
@ -280,12 +280,12 @@ void GfxCompImage::drawClipped(gPort &port,
else drawCompressedImage(port, pos, dispImage); else drawCompressedImage(port, pos, dispImage);
// this could be modified to get the current text coloring // this could be modified to get the current text coloring
if (title) { if (_title) {
Rect16 textRect = _extent; Rect16 textRect = _extent;
textRect.x -= offset.x; textRect.x -= offset.x;
textRect.y -= offset.y; textRect.y -= offset.y;
writePlaqText(port, textRect, _textFont, 0, _textPal, selected, title); writePlaqText(port, textRect, _textFont, 0, _textPal, _selected, _title);
} }
} }
} }
@ -520,19 +520,19 @@ void GfxCompButton::dim(bool enableFlag) {
_dimmed = false; _dimmed = false;
} }
window.update(_extent); _window.update(_extent);
} }
void GfxCompButton::deactivate() { void GfxCompButton::deactivate() {
selected = 0; _selected = 0;
window.update(_extent); _window.update(_extent);
gPanel::deactivate(); gPanel::deactivate();
} }
bool GfxCompButton::activate(gEventType why) { bool GfxCompButton::activate(gEventType why) {
selected = 1; _selected = 1;
window.update(_extent); _window.update(_extent);
if (why == gEventKeyDown) { // momentarily depress if (why == gEventKeyDown) { // momentarily depress
deactivate(); deactivate();
@ -561,16 +561,16 @@ bool GfxCompButton::pointerHit(gPanelMessage &) {
void GfxCompButton::pointerRelease(gPanelMessage &) { void GfxCompButton::pointerRelease(gPanelMessage &) {
// We have to test selected first because deactivate clears it. // We have to test selected first because deactivate clears it.
if (selected) { if (_selected) {
deactivate(); // give back input focus deactivate(); // give back input focus
notify(gEventNewValue, 1); // notify App of successful hit notify(gEventNewValue, 1); // notify App of successful hit
} else deactivate(); } else deactivate();
} }
void GfxCompButton::pointerDrag(gPanelMessage &msg) { void GfxCompButton::pointerDrag(gPanelMessage &msg) {
if (selected != msg.inPanel) { if (_selected != msg._inPanel) {
selected = msg.inPanel; _selected = msg._inPanel;
window.update(_extent); _window.update(_extent);
} }
} }
@ -579,13 +579,13 @@ void GfxCompButton::enable(bool abled) {
} }
void GfxCompButton::invalidate(Rect16 *) { void GfxCompButton::invalidate(Rect16 *) {
window.update(_extent); _window.update(_extent);
} }
void GfxCompButton::draw() { void GfxCompButton::draw() {
gPort &port = window.windowPort; gPort &port = _window._windowPort;
Rect16 rect = window.getExtent(); Rect16 rect = _window.getExtent();
SAVE_GPORT_STATE(port); // save pen color, etc. SAVE_GPORT_STATE(port); // save pen color, etc.
g_vm->_pointer->hide(port, _extent); // hide mouse pointer g_vm->_pointer->hide(port, _extent); // hide mouse pointer
@ -596,7 +596,7 @@ void GfxCompButton::draw() {
void *GfxCompButton::getCurrentCompImage() { void *GfxCompButton::getCurrentCompImage() {
if (_dimmed) { if (_dimmed) {
return _dimImage; return _dimImage;
} else if (selected) { } else if (_selected) {
return _resImage; return _resImage;
} else { } else {
return _forImage; return _forImage;
@ -618,7 +618,7 @@ bool GfxOwnerSelCompButton::activate(gEventType why) {
// selected = !selected; // selected = !selected;
// window.update( extent ); // window.update( extent );
gPanel::deactivate(); gPanel::deactivate();
notify(gEventNewValue, selected); // notify App of successful hit notify(gEventNewValue, _selected); // notify App of successful hit
playMemSound(2); playMemSound(2);
} }
return false; return false;
@ -629,12 +629,12 @@ bool GfxOwnerSelCompButton::pointerHit(gPanelMessage &) {
} }
void GfxOwnerSelCompButton::select(uint16 val) { void GfxOwnerSelCompButton::select(uint16 val) {
selected = val; _selected = val;
setCurrent(val); setCurrent(val);
if (getEnabled()) { if (getEnabled()) {
window.update(_extent); _window.update(_extent);
} }
} }
@ -728,7 +728,7 @@ bool GfxMultCompButton::activate(gEventType why) {
if (++_current > _max) { if (++_current > _max) {
_current = 0; _current = 0;
} }
window.update(_extent); _window.update(_extent);
} }
gPanel::deactivate(); gPanel::deactivate();
@ -805,7 +805,7 @@ int16 GfxSlider::getSliderLenVal() {
} }
void GfxSlider::draw() { void GfxSlider::draw() {
gPort &port = window.windowPort; gPort &port = _window._windowPort;
Point16 offset = Point16(0, 0); Point16 offset = Point16(0, 0);
SAVE_GPORT_STATE(port); // save pen color, etc. SAVE_GPORT_STATE(port); // save pen color, etc.
@ -838,8 +838,8 @@ void GfxSlider::drawClipped(gPort &port,
bool GfxSlider::activate(gEventType why) { bool GfxSlider::activate(gEventType why) {
if (why == gEventKeyDown || why == gEventMouseDown) { if (why == gEventKeyDown || why == gEventMouseDown) {
selected = 1; _selected = 1;
window.update(_extent); _window.update(_extent);
gPanel::deactivate(); gPanel::deactivate();
notify(gEventNewValue, _slCurrent); // notify App of successful hit notify(gEventNewValue, _slCurrent); // notify App of successful hit
} }
@ -847,29 +847,29 @@ bool GfxSlider::activate(gEventType why) {
} }
void GfxSlider::deactivate() { void GfxSlider::deactivate() {
selected = 0; _selected = 0;
window.update(_extent); _window.update(_extent);
gPanel::deactivate(); gPanel::deactivate();
} }
bool GfxSlider::pointerHit(gPanelMessage &msg) { bool GfxSlider::pointerHit(gPanelMessage &msg) {
// update the image index // update the image index
updateSliderIndexes(msg.pickPos); updateSliderIndexes(msg._pickPos);
// redraw the control should any visual change hath occurred // redraw the control should any visual change hath occurred
window.update(_extent); _window.update(_extent);
activate(gEventMouseDown); activate(gEventMouseDown);
return true; return true;
} }
void GfxSlider::pointerMove(gPanelMessage &msg) { void GfxSlider::pointerMove(gPanelMessage &msg) {
if (selected) { if (_selected) {
// update the image index // update the image index
updateSliderIndexes(msg.pickPos); updateSliderIndexes(msg._pickPos);
// redraw the control should any visual change hath occurred // redraw the control should any visual change hath occurred
window.update(_extent); _window.update(_extent);
notify(gEventMouseMove, _slCurrent); notify(gEventMouseMove, _slCurrent);
} }
@ -877,7 +877,7 @@ void GfxSlider::pointerMove(gPanelMessage &msg) {
void GfxSlider::pointerRelease(gPanelMessage &) { void GfxSlider::pointerRelease(gPanelMessage &) {
// We have to test selected first because deactivate clears it. // We have to test selected first because deactivate clears it.
if (selected) { if (_selected) {
deactivate(); // give back input focus deactivate(); // give back input focus
notify(gEventNewValue, _slCurrent); // notify App of successful hit notify(gEventNewValue, _slCurrent); // notify App of successful hit
} else deactivate(); } else deactivate();
@ -885,11 +885,11 @@ void GfxSlider::pointerRelease(gPanelMessage &) {
void GfxSlider::pointerDrag(gPanelMessage &msg) { void GfxSlider::pointerDrag(gPanelMessage &msg) {
// update the image index // update the image index
updateSliderIndexes(msg.pickPos); updateSliderIndexes(msg._pickPos);
notify(gEventNewValue, _slCurrent); // notify App of successful hit notify(gEventNewValue, _slCurrent); // notify App of successful hit
// redraw the control should any visual change hath occurred // redraw the control should any visual change hath occurred
window.update(_extent); _window.update(_extent);
} }
void GfxSlider::updateSliderIndexes(Point16 &pos) { void GfxSlider::updateSliderIndexes(Point16 &pos) {

View file

@ -527,7 +527,7 @@ void ContainerView::deactivate() {
} }
void ContainerView::pointerMove(gPanelMessage &msg) { void ContainerView::pointerMove(gPanelMessage &msg) {
if (msg.pointerLeave) { if (msg._pointerLeave) {
g_vm->_cnm->_lastPickedObjectID = Nothing; g_vm->_cnm->_lastPickedObjectID = Nothing;
g_vm->_cnm->_lastPickedObjectQuantity = -1; g_vm->_cnm->_lastPickedObjectQuantity = -1;
g_vm->_mouseInfo->setText(nullptr); g_vm->_mouseInfo->setText(nullptr);
@ -557,7 +557,7 @@ void ContainerView::pointerMove(gPanelMessage &msg) {
} }
// Determine if mouse is pointing at a new object // Determine if mouse is pointing at a new object
updateMouseText(msg.pickPos); updateMouseText(msg._pickPos);
} }
} }
@ -566,13 +566,13 @@ bool ContainerView::pointerHit(gPanelMessage &msg) {
GameObject *slotObject; GameObject *slotObject;
uint16 mouseSet; uint16 mouseSet;
slotObject = pickObject(msg.pickPos); slotObject = pickObject(msg._pickPos);
mouseObject = g_vm->_mouseInfo->getObject(); mouseObject = g_vm->_mouseInfo->getObject();
mouseSet = mouseObject ? mouseObject->containmentSet() : 0; mouseSet = mouseObject ? mouseObject->containmentSet() : 0;
if (!g_vm->_mouseInfo->getDoable()) return false; if (!g_vm->_mouseInfo->getDoable()) return false;
if (msg.doubleClick && !g_vm->_cnm->_alreadyDone) { if (msg._doubleClick && !g_vm->_cnm->_alreadyDone) {
dblClick(mouseObject, slotObject, msg); dblClick(mouseObject, slotObject, msg);
} else { // single click } else { // single click
if (mouseObject != nullptr) { if (mouseObject != nullptr) {
@ -615,7 +615,7 @@ bool ContainerView::pointerHit(gPanelMessage &msg) {
// total the mass and bulk of all the objects in this container // total the mass and bulk of all the objects in this container
totalObjects(); totalObjects();
window.update(_extent); _window.update(_extent);
return activate(gEventMouseDown); return activate(gEventMouseDown);
} }
@ -638,7 +638,7 @@ void ContainerView::timerTick(gPanelMessage &msg) {
// validate objToGet and make sure that the number selected for move // validate objToGet and make sure that the number selected for move
// is less then or equal to the number of items present in the merged object // is less then or equal to the number of items present in the merged object
if (g_vm->_cnm->_objToGet && g_vm->_cnm->_amountIndY != -1) { if (g_vm->_cnm->_objToGet && g_vm->_cnm->_amountIndY != -1) {
int32 rate = (g_vm->_cnm->_amountIndY - msg.pickAbsPos.y); int32 rate = (g_vm->_cnm->_amountIndY - msg._pickAbsPos.y);
rate = rate * ((rate > 0) ? rate : -rate); rate = rate * ((rate > 0) ? rate : -rate);
@ -732,7 +732,7 @@ void ContainerView::dropPhysical(
// test to check if item is accepted by container // test to check if item is accepted by container
if (_containerObject->canContain(mObj->thisID())) { if (_containerObject->canContain(mObj->thisID())) {
Actor *centerActor = getCenterActor(); Actor *centerActor = getCenterActor();
Location loc(pickObjectSlot(msg.pickPos), Location loc(pickObjectSlot(msg._pickPos),
_containerObject->thisID()); _containerObject->thisID());
// check if no object in the current slot // check if no object in the current slot
@ -784,7 +784,7 @@ void ContainerView::useConcept(
// If there is no object already in this slot drop the // If there is no object already in this slot drop the
// mouse object here // mouse object here
Location loc(pickObjectSlot(msg.pickPos), Location loc(pickObjectSlot(msg._pickPos),
_containerObject->thisID()); _containerObject->thisID());
mObj->drop(centerActorID, loc); mObj->drop(centerActorID, loc);
@ -1147,7 +1147,7 @@ TangibleContainerWindow::TangibleContainerWindow(
// set the userdata such that we can extract the container object later // set the userdata such that we can extract the container object later
// through an appfunc. // through an appfunc.
this->userData = _view->_containerObject; this->_userData = _view->_containerObject;
_massWeightIndicator = new CMassWeightIndicator( _massWeightIndicator = new CMassWeightIndicator(
this, this,

View file

@ -223,13 +223,13 @@ CDocument::~CDocument() {
} }
void CDocument::deactivate() { void CDocument::deactivate() {
selected = 0; _selected = 0;
gPanel::deactivate(); gPanel::deactivate();
} }
bool CDocument::activate(gEventType why) { bool CDocument::activate(gEventType why) {
if (why == gEventMouseDown) { // momentarily depress if (why == gEventMouseDown) { // momentarily depress
selected = 1; _selected = 1;
notify(why, 0); // notify App of successful hit notify(why, 0); // notify App of successful hit
return true; return true;
} }
@ -238,7 +238,7 @@ bool CDocument::activate(gEventType why) {
bool CDocument::keyStroke(gPanelMessage &msg) { bool CDocument::keyStroke(gPanelMessage &msg) {
gEvent ev; gEvent ev;
switch (msg.key) { switch (msg._key) {
case Common::ASCII_ESCAPE: case Common::ASCII_ESCAPE:
cmdDocumentEsc(ev); cmdDocumentEsc(ev);
return true; return true;
@ -276,9 +276,9 @@ gPanel *CDocument::keyTest(int16 key) {
// Cursor images for turning book pages // Cursor images for turning book pages
void CDocument::pointerMove(gPanelMessage &msg) { void CDocument::pointerMove(gPanelMessage &msg) {
Point16 pos = msg.pickPos; Point16 pos = msg._pickPos;
if (msg.inPanel && Rect16(0, 0, _extent.width, _extent.height).ptInside(pos)) { if (msg._inPanel && Rect16(0, 0, _extent.width, _extent.height).ptInside(pos)) {
if (_app.orientation == pageOrientVertical) { if (_app.orientation == pageOrientVertical) {
// find out which end of the book we're on // find out which end of the book we're on
if (pos.y < _extent.height / 2) setMouseImage(kMousePgUpImage, -7, -7); if (pos.y < _extent.height / 2) setMouseImage(kMousePgUpImage, -7, -7);
@ -288,7 +288,7 @@ void CDocument::pointerMove(gPanelMessage &msg) {
if (pos.x < _extent.width / 2) setMouseImage(kMousePgLeftImage, -7, -7); if (pos.x < _extent.width / 2) setMouseImage(kMousePgLeftImage, -7, -7);
else setMouseImage(kMousePgRightImage, -7, -7); else setMouseImage(kMousePgRightImage, -7, -7);
} }
} else if (msg.pointerLeave) { } else if (msg._pointerLeave) {
setMouseImage(kMouseArrowImage, 0, 0); setMouseImage(kMouseArrowImage, 0, 0);
} }
@ -296,15 +296,15 @@ void CDocument::pointerMove(gPanelMessage &msg) {
} }
void CDocument::pointerDrag(gPanelMessage &) { void CDocument::pointerDrag(gPanelMessage &) {
if (selected) { if (_selected) {
notify(gEventMouseDrag, 0); notify(gEventMouseDrag, 0);
} }
} }
bool CDocument::pointerHit(gPanelMessage &msg) { bool CDocument::pointerHit(gPanelMessage &msg) {
Point16 pos = msg.pickPos; Point16 pos = msg._pickPos;
if (msg.inPanel && Rect16(0, 0, _extent.width, _extent.height).ptInside(pos)) { if (msg._inPanel && Rect16(0, 0, _extent.width, _extent.height).ptInside(pos)) {
gEvent ev; gEvent ev;
if (_app.orientation == pageOrientVertical) { if (_app.orientation == pageOrientVertical) {
// find out which end of the book we're on // find out which end of the book we're on
@ -321,11 +321,11 @@ bool CDocument::pointerHit(gPanelMessage &msg) {
requestInfo *ri; requestInfo *ri;
win = getWindow(); // get the window pointer win = getWindow(); // get the window pointer
ri = win ? (requestInfo *)win->userData : nullptr; ri = win ? (requestInfo *)win->_userData : nullptr;
if (ri) { if (ri) {
ri->running = 0; ri->running = 0;
ri->result = id; ri->result = _id;
setMouseImage(kMouseArrowImage, 0, 0); setMouseImage(kMouseArrowImage, 0, 0);
} }
@ -347,7 +347,7 @@ void CDocument::gotoPage(int8 page) {
} }
void CDocument::pointerRelease(gPanelMessage &) { void CDocument::pointerRelease(gPanelMessage &) {
if (selected) notify(gEventMouseUp, 0); // notify App of successful hit if (_selected) notify(gEventMouseUp, 0); // notify App of successful hit
deactivate(); deactivate();
} }
@ -548,7 +548,7 @@ void CDocument::makePages() {
// This function will draw the text onto the book. // This function will draw the text onto the book.
void CDocument::renderText() { void CDocument::renderText() {
gPort tPort; gPort tPort;
gPort &port = window.windowPort; gPort &port = _window._windowPort;
uint16 pageIndex; uint16 pageIndex;
uint16 lineIndex; uint16 lineIndex;
uint16 linesPerPage = _pageHeight / (_textHeight + 1); uint16 linesPerPage = _pageHeight / (_textHeight + 1);
@ -748,10 +748,10 @@ int16 openScroll(uint16 textScript) {
// make the quit button // make the quit button
closeScroll = new GfxCompButton(*win, scrollAppearance.closeRect, closeBtnImage, numBtnImages, 0, cmdDocumentQuit); closeScroll = new GfxCompButton(*win, scrollAppearance.closeRect, closeBtnImage, numBtnImages, 0, cmdDocumentQuit);
closeScroll->accelKey = 0x1B; closeScroll->_accelKey = 0x1B;
// attach the structure to the book, open the book // attach the structure to the book, open the book
win->userData = &rInfo; win->_userData = &rInfo;
win->open(); win->open();
// do stuff // do stuff
@ -799,10 +799,10 @@ int16 openBook(uint16 textScript) {
// make the quit button // make the quit button
closeBook = new GfxCompButton(*win, bookAppearance.closeRect, cmdDocumentQuit); closeBook = new GfxCompButton(*win, bookAppearance.closeRect, cmdDocumentQuit);
closeBook->accelKey = 0x1B; closeBook->_accelKey = 0x1B;
// attach the structure to the book, open the book // attach the structure to the book, open the book
win->userData = &rInfo; win->_userData = &rInfo;
win->open(); win->open();
// do stuff // do stuff
@ -844,10 +844,10 @@ int16 openParchment(uint16 textScript) {
win = new CDocument(parchAppearance, bookText, &Script10Font, 0, nullptr); win = new CDocument(parchAppearance, bookText, &Script10Font, 0, nullptr);
// make the quit button // make the quit button
closeParchment = new GfxCompButton(*win, parchAppearance.closeRect, cmdDocumentQuit); closeParchment = new GfxCompButton(*win, parchAppearance.closeRect, cmdDocumentQuit);
closeParchment->accelKey = 0x1B; closeParchment->_accelKey = 0x1B;
// attach the structure to the book, open the book // attach the structure to the book, open the book
win->userData = &rInfo; win->_userData = &rInfo;
win->open(); win->open();
// do stuff // do stuff
@ -869,17 +869,17 @@ APPFUNC(cmdDocumentQuit) {
if (ev.panel && ev.eventType == gEventNewValue && ev.value) { if (ev.panel && ev.eventType == gEventNewValue && ev.value) {
win = ev.panel->getWindow(); // get the window pointer win = ev.panel->getWindow(); // get the window pointer
ri = win ? (requestInfo *)win->userData : nullptr; ri = win ? (requestInfo *)win->_userData : nullptr;
if (ri) { if (ri) {
ri->running = 0; ri->running = 0;
ri->result = ev.panel->id; ri->result = ev.panel->_id;
} }
} }
} }
APPFUNCV(CDocument::cmdDocumentEsc) { APPFUNCV(CDocument::cmdDocumentEsc) {
requestInfo *ri = (requestInfo *) userData; requestInfo *ri = (requestInfo *)_userData;
if (ri) { if (ri) {
ri->running = 0; ri->running = 0;
ri->result = 0; ri->result = 0;

View file

@ -296,12 +296,12 @@ BackWindow::BackWindow(const Rect16 &r, uint16 ident, AppFunc *cmd)
void BackWindow::invalidate(Rect16 *area) { void BackWindow::invalidate(Rect16 *area) {
if (displayEnabled()) if (displayEnabled())
window.update(*area); _window.update(*area);
} }
void BackWindow::invalidate(const StaticRect *area) { void BackWindow::invalidate(const StaticRect *area) {
if (displayEnabled()) if (displayEnabled())
window.update(*area); _window.update(*area);
} }
// Return true if window floats above animated are // Return true if window floats above animated are
@ -336,11 +336,11 @@ void DragBar::deactivate() {
} }
bool DragBar::pointerHit(gPanelMessage &msg) { bool DragBar::pointerHit(gPanelMessage &msg) {
Rect16 wExtent = window.getExtent(); Rect16 wExtent = _window.getExtent();
_dragPos.x = wExtent.x; _dragPos.x = wExtent.x;
_dragPos.y = wExtent.y; _dragPos.y = wExtent.y;
_dragOffset.set(msg.pickAbsPos.x, msg.pickAbsPos.y); _dragOffset.set(msg._pickAbsPos.x, msg._pickAbsPos.y);
return true; return true;
} }
@ -349,20 +349,20 @@ bool DragBar::pointerHit(gPanelMessage &msg) {
// be dragged... // be dragged...
void DragBar::pointerDrag(gPanelMessage &msg) { void DragBar::pointerDrag(gPanelMessage &msg) {
Rect16 ext = window.getExtent(); Rect16 ext = _window.getExtent();
Point16 pos; Point16 pos;
// Calculate new window position // Calculate new window position
pos.x = msg.pickAbsPos.x + ext.x - _dragOffset.x; pos.x = msg._pickAbsPos.x + ext.x - _dragOffset.x;
pos.y = msg.pickAbsPos.y + ext.y - _dragOffset.y; pos.y = msg._pickAbsPos.y + ext.y - _dragOffset.y;
// If window position has changed, then signal the drawing loop // If window position has changed, then signal the drawing loop
if (pos != _dragPos) { if (pos != _dragPos) {
_dragPos.set(pos.x, pos.y); _dragPos.set(pos.x, pos.y);
_update = true; _update = true;
_dragWindow = (FloatingWindow *)&window; _dragWindow = (FloatingWindow *)&_window;
} }
} }
@ -378,13 +378,13 @@ void DragBar::pointerRelease(gPanelMessage &) {
* ===================================================================== */ * ===================================================================== */
void gButton::deactivate() { void gButton::deactivate() {
selected = 0; _selected = 0;
draw(); draw();
gPanel::deactivate(); gPanel::deactivate();
} }
bool gButton::activate(gEventType why) { bool gButton::activate(gEventType why) {
selected = 1; _selected = 1;
draw(); draw();
if (why == gEventKeyDown) { // momentarily depress if (why == gEventKeyDown) { // momentarily depress
@ -402,22 +402,22 @@ bool gButton::pointerHit(gPanelMessage &) {
void gButton::pointerRelease(gPanelMessage &) { void gButton::pointerRelease(gPanelMessage &) {
// We have to test selected first because deactivate clears it. // We have to test selected first because deactivate clears it.
if (selected) { if (_selected) {
deactivate(); // give back input focus deactivate(); // give back input focus
notify(gEventNewValue, 1); // notify App of successful hit notify(gEventNewValue, 1); // notify App of successful hit
} else deactivate(); } else deactivate();
} }
void gButton::pointerDrag(gPanelMessage &msg) { void gButton::pointerDrag(gPanelMessage &msg) {
if (selected != msg.inPanel) { if (_selected != msg._inPanel) {
selected = msg.inPanel; _selected = msg._inPanel;
draw(); draw();
} }
} }
void gButton::draw() { void gButton::draw() {
gPort &port = window.windowPort; gPort &port = _window._windowPort;
Rect16 rect = window.getExtent(); Rect16 rect = _window.getExtent();
g_vm->_pointer->hide(port, _extent); // hide mouse pointer g_vm->_pointer->hide(port, _extent); // hide mouse pointer
if (displayEnabled()) if (displayEnabled())
@ -431,7 +431,7 @@ void gButton::draw() {
* ===================================================================== */ * ===================================================================== */
void gImageButton::drawClipped(gPort &port, const Point16 &offset, const Rect16 &r) { void gImageButton::drawClipped(gPort &port, const Point16 &offset, const Rect16 &r) {
gPixelMap *currentImage = selected ? _selImage : _deselImage; gPixelMap *currentImage = _selected ? _selImage : _deselImage;
if (displayEnabled()) if (displayEnabled())
if (_extent.overlap(r)) if (_extent.overlap(r))
@ -450,10 +450,10 @@ void gImageButton::drawClipped(gPort &port, const Point16 &offset, const Rect16
bool gToggleButton::activate(gEventType why) { bool gToggleButton::activate(gEventType why) {
if (why == gEventKeyDown || why == gEventMouseDown) { if (why == gEventKeyDown || why == gEventMouseDown) {
selected = !selected; _selected = !_selected;
draw(); draw();
gPanel::deactivate(); gPanel::deactivate();
notify(gEventNewValue, selected); // notify App of successful hit notify(gEventNewValue, _selected); // notify App of successful hit
} }
return false; return false;
} }
@ -482,8 +482,8 @@ LabeledButton::LabeledButton(gPanelList &list,
cmd) { cmd) {
const char *underscore; const char *underscore;
if ((underscore = strchr(title, '_')) != nullptr) if ((underscore = strchr(_title, '_')) != nullptr)
accelKey = toupper(underscore[1]); _accelKey = toupper(underscore[1]);
} }
void LabeledButton::drawClipped( void LabeledButton::drawClipped(
@ -508,14 +508,14 @@ void LabeledButton::drawClipped(
gImageButton::drawClipped(port, offset, r); gImageButton::drawClipped(port, offset, r);
textOrigin.x = origin.x + ((_extent.width - textOrigin.x = origin.x + ((_extent.width -
TextWidth(textFont, title, -1, textStyleUnderBar)) >> 1); TextWidth(textFont, _title, -1, textStyleUnderBar)) >> 1);
textOrigin.y = origin.y + ((_extent.height - textFont->height) >> 1); textOrigin.y = origin.y + ((_extent.height - textFont->height) >> 1);
port.setColor(2); port.setColor(2);
port.moveTo(textOrigin); port.moveTo(textOrigin);
port.setFont(textFont); port.setFont(textFont);
port.setStyle(textStyleUnderBar); port.setStyle(textStyleUnderBar);
port.drawText(title, -1); port.drawText(_title, -1);
} }

View file

@ -65,11 +65,11 @@ static void handleRequestEvent(gEvent &ev) {
if (ev.panel && ev.eventType == gEventNewValue && ev.value) { if (ev.panel && ev.eventType == gEventNewValue && ev.value) {
win = ev.panel->getWindow(); // get the window pointer win = ev.panel->getWindow(); // get the window pointer
ri = win ? (requestInfo *)win->userData : nullptr; ri = win ? (requestInfo *)win->_userData : nullptr;
if (ri) { if (ri) {
ri->running = 0; ri->running = 0;
ri->result = ev.panel->id; ri->result = ev.panel->_id;
} }
} }
} }
@ -321,12 +321,12 @@ public:
}; };
void ModalDisplayWindow::pointerRelease(gPanelMessage &) { void ModalDisplayWindow::pointerRelease(gPanelMessage &) {
requestInfo *ri = (requestInfo *)userData; requestInfo *ri = (requestInfo *)_userData;
if (ri) ri->running = false; if (ri) ri->running = false;
} }
bool ModalDisplayWindow::keyStroke(gPanelMessage &) { bool ModalDisplayWindow::keyStroke(gPanelMessage &) {
requestInfo *ri = (requestInfo *)userData; requestInfo *ri = (requestInfo *)_userData;
if (ri) ri->running = false; if (ri) ri->running = false;
return true; return true;
} }
@ -363,7 +363,7 @@ int16 GameDialogA(
error("Unable to open requester window."); error("Unable to open requester window.");
} }
win->userData = &rInfo; win->_userData = &rInfo;
win->open(); win->open();
EventLoop(rInfo.running, false); EventLoop(rInfo.running, false);
@ -415,7 +415,7 @@ int16 GameDisplayA(
error("Unable to open requester window."); error("Unable to open requester window.");
} }
win->userData = &rInfo; win->_userData = &rInfo;
win->open(); win->open();
EventLoop(rInfo.running, false); EventLoop(rInfo.running, false);

View file

@ -199,7 +199,7 @@ gTextBox::gTextBox(
_onEnter = cmdEnter; _onEnter = cmdEnter;
_onEscape = cmdEscape; _onEscape = cmdEscape;
_isActiveCtl = false; _isActiveCtl = false;
selected = 0; _selected = 0;
_parent = &list; _parent = &list;
_blinkStart = 0; _blinkStart = 0;
@ -231,7 +231,7 @@ gTextBox::gTextBox(
gTextBox::~gTextBox() { gTextBox::~gTextBox() {
deSelect(); deSelect();
selected = 0; _selected = 0;
if (_undoBuffer) { if (_undoBuffer) {
delete[] _undoBuffer; delete[] _undoBuffer;
} }
@ -331,7 +331,7 @@ void gTextBox::setText(char *newText) {
insertText(newText, len); insertText(newText, len);
_cursorPos = _anchorPos = 0; _cursorPos = _anchorPos = 0;
if (window.isOpen()) drawContents(); if (_window.isOpen()) drawContents();
} }
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
@ -348,15 +348,15 @@ void gTextBox::setEditExtent(const Rect16 &r) {
bool gTextBox::activate(gEventType why) { bool gTextBox::activate(gEventType why) {
if (why == gEventAltValue) { // momentarily depress if (why == gEventAltValue) { // momentarily depress
selected = 1; _selected = 1;
notify(why, 0); // notify App of successful hit notify(why, 0); // notify App of successful hit
return true; return true;
} }
_isActiveCtl = true; _isActiveCtl = true;
if (!selected) { if (!_selected) {
enSelect(_index); enSelect(_index);
} }
selected = 1; _selected = 1;
_fullRedraw = true; _fullRedraw = true;
draw(); draw();
if (why == gEventNone) if (why == gEventNone)
@ -367,7 +367,7 @@ bool gTextBox::activate(gEventType why) {
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
void gTextBox::deactivate() { void gTextBox::deactivate() {
selected = 0; _selected = 0;
_isActiveCtl = false; _isActiveCtl = false;
draw(); draw();
_fullRedraw = true; _fullRedraw = true;
@ -563,7 +563,7 @@ void gTextBox::scrollDown() {
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
bool gTextBox::pointerHit(gPanelMessage &msg) { bool gTextBox::pointerHit(gPanelMessage &msg) {
Point16 pos = msg.pickPos; Point16 pos = msg._pickPos;
int16 newPos; int16 newPos;
@ -577,11 +577,11 @@ bool gTextBox::pointerHit(gPanelMessage &msg) {
reSelect(newIndex); reSelect(newIndex);
if (_editing) { if (_editing) {
if (_textFont) { if (_textFont) {
newPos = WhichIChar(_textFont, (uint8 *)_fieldStrings[_index], msg.pickPos.x - 3, _currentLen[_index]); newPos = WhichIChar(_textFont, (uint8 *)_fieldStrings[_index], msg._pickPos.x - 3, _currentLen[_index]);
} else { } else {
newPos = WhichIChar(mainFont, (uint8 *)_fieldStrings[_index], msg.pickPos.x - 3, _currentLen[_index]); newPos = WhichIChar(mainFont, (uint8 *)_fieldStrings[_index], msg._pickPos.x - 3, _currentLen[_index]);
} }
if (msg.leftButton) { if (msg._leftButton) {
if (_cursorPos != newPos || _anchorPos != newPos) { if (_cursorPos != newPos || _anchorPos != newPos) {
_anchorPos = newPos; _anchorPos = newPos;
_cursorPos = newPos; _cursorPos = newPos;
@ -605,11 +605,11 @@ bool gTextBox::pointerHit(gPanelMessage &msg) {
void gTextBox::pointerDrag(gPanelMessage &msg) { void gTextBox::pointerDrag(gPanelMessage &msg) {
int16 newPos; int16 newPos;
if (msg.leftButton) { if (msg._leftButton) {
if (_textFont) { if (_textFont) {
newPos = WhichIChar(_textFont, (uint8 *)_fieldStrings[_index], msg.pickPos.x - 3, _currentLen[_index]); newPos = WhichIChar(_textFont, (uint8 *)_fieldStrings[_index], msg._pickPos.x - 3, _currentLen[_index]);
} else { } else {
newPos = WhichIChar(mainFont, (uint8 *)_fieldStrings[_index], msg.pickPos.x - 3, _currentLen[_index]); newPos = WhichIChar(mainFont, (uint8 *)_fieldStrings[_index], msg._pickPos.x - 3, _currentLen[_index]);
} }
_inDrag = true; _inDrag = true;
if (_cursorPos != newPos) { if (_cursorPos != newPos) {
@ -628,7 +628,7 @@ void gTextBox::pointerDrag(gPanelMessage &msg) {
// Mouse release code // Mouse release code
void gTextBox::pointerRelease(gPanelMessage &msg) { void gTextBox::pointerRelease(gPanelMessage &msg) {
if (!msg.leftButton) { if (!msg._leftButton) {
_inDrag = false; _inDrag = false;
draw(); draw();
} }
@ -638,10 +638,10 @@ void gTextBox::pointerRelease(gPanelMessage &msg) {
bool gTextBox::keyStroke(gPanelMessage &msg) { bool gTextBox::keyStroke(gPanelMessage &msg) {
gPort &port = window.windowPort; gPort &port = _window._windowPort;
int16 selStart = MIN(_cursorPos, _anchorPos), int16 selStart = MIN(_cursorPos, _anchorPos),
selWidth = ABS(_cursorPos - _anchorPos); selWidth = ABS(_cursorPos - _anchorPos);
uint16 key = msg.key; uint16 key = msg._key;
// Process the various keystrokes... // Process the various keystrokes...
if (_editing && _cursorPos > _anchorPos) { if (_editing && _cursorPos > _anchorPos) {
@ -703,14 +703,14 @@ bool gTextBox::keyStroke(gPanelMessage &msg) {
case Common::KEYCODE_LEFT: case Common::KEYCODE_LEFT:
if (_anchorPos > 0) if (_anchorPos > 0)
_anchorPos--; _anchorPos--;
if (!(msg.qualifier & qualifierShift)) if (!(msg._qualifier & qualifierShift))
_cursorPos = _anchorPos; _cursorPos = _anchorPos;
break; break;
case Common::KEYCODE_RIGHT: case Common::KEYCODE_RIGHT:
if (_anchorPos < _currentLen[_index]) if (_anchorPos < _currentLen[_index])
_anchorPos++; _anchorPos++;
if (!(msg.qualifier & qualifierShift)) if (!(msg._qualifier & qualifierShift))
_cursorPos = _anchorPos; _cursorPos = _anchorPos;
break; break;
@ -725,7 +725,7 @@ bool gTextBox::keyStroke(gPanelMessage &msg) {
break; break;
case Common::KEYCODE_z: // Alt-Z case Common::KEYCODE_z: // Alt-Z
if (msg.qualifier & (qualifierControl | qualifierAlt)) { if (msg._qualifier & (qualifierControl | qualifierAlt)) {
if (_undoBuffer) { if (_undoBuffer) {
_cursorPos = _anchorPos = _currentLen[_index] = _undoLen; _cursorPos = _anchorPos = _currentLen[_index] = _undoLen;
memcpy(_fieldStrings[_index], _undoBuffer, _currentLen[_index] + 1); memcpy(_fieldStrings[_index], _undoBuffer, _currentLen[_index] + 1);
@ -844,14 +844,14 @@ void gTextBox::timerTick(gPanelMessage &msg) {
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
void gTextBox::handleTimerTick(int32 tick) { void gTextBox::handleTimerTick(int32 tick) {
if (selected && !_displayOnly && _editing && !_inDrag) { if (_selected && !_displayOnly && _editing && !_inDrag) {
if (_blinkStart == 0) { if (_blinkStart == 0) {
_blinkState = 0; _blinkState = 0;
_blinkStart = tick; _blinkStart = tick;
return; return;
} }
if (tick - _blinkStart > blinkTime) { if (tick - _blinkStart > blinkTime) {
gPort &port = window.windowPort; gPort &port = _window._windowPort;
SAVE_GPORT_STATE(port); // save pen color, etc. SAVE_GPORT_STATE(port); // save pen color, etc.
g_vm->_pointer->hide(port, _extent); // hide mouse pointer g_vm->_pointer->hide(port, _extent); // hide mouse pointer
@ -885,7 +885,7 @@ void gTextBox::drawContents() {
assert(_textFont); assert(_textFont);
assert(_fontColorBack != -1); assert(_fontColorBack != -1);
gPort &port = window.windowPort, gPort &port = _window._windowPort,
tPort; tPort;
@ -909,7 +909,7 @@ void gTextBox::drawContents() {
editRectFill(tPort, port._penMap); editRectFill(tPort, port._penMap);
} }
if (selected) { // if panel is selected if (_selected) { // if panel is selected
// Determine the pixel position of the cursor and // Determine the pixel position of the cursor and
// anchor positions. // anchor positions.
@ -987,8 +987,8 @@ void gTextBox::drawContents() {
//----------------------------------------------------------------------- //-----------------------------------------------------------------------
void gTextBox::drawClipped() { void gTextBox::drawClipped() {
gPort &port = window.windowPort; gPort &port = _window._windowPort;
Rect16 rect = window.getExtent(); Rect16 rect = _window.getExtent();
#if 0 #if 0
if (!_inDrag && _cursorPos > _anchorPos) { if (!_inDrag && _cursorPos > _anchorPos) {

View file

@ -416,12 +416,12 @@ void CPlaqText::enable(bool abled) {
} }
void CPlaqText::invalidate(Rect16 *) { void CPlaqText::invalidate(Rect16 *) {
window.update(_extent); _window.update(_extent);
} }
void CPlaqText::draw() { void CPlaqText::draw() {
gPort &port = window.windowPort; gPort &port = _window._windowPort;
Rect16 rect = window.getExtent(); Rect16 rect = _window.getExtent();
// save pen color, etc. // save pen color, etc.
@ -450,7 +450,7 @@ void CPlaqText::drawClipped(gPort &port,
_textRect.y -= offset.y; _textRect.y -= offset.y;
writePlaqText(port, _textRect, _buttonFont, _textPosition, _textFacePal, selected, _lineBuf); writePlaqText(port, _textRect, _buttonFont, _textPosition, _textFacePal, _selected, _lineBuf);
} }
} }
} }
@ -637,7 +637,7 @@ void CStatusLine::experationCheck() {
&& (_waitAlarm.check() && (_waitAlarm.check()
|| (_queueTail != _queueHead && _minWaitAlarm.check()))) { || (_queueTail != _queueHead && _minWaitAlarm.check()))) {
enable(false); enable(false);
window.update(_extent); _window.update(_extent);
_lineDisplayed = false; _lineDisplayed = false;
} }
@ -662,7 +662,7 @@ void CStatusLine::experationCheck() {
_queueTail = bump(_queueTail); _queueTail = bump(_queueTail);
// draw the new textline // draw the new textline
window.update(_extent); _window.update(_extent);
_lineDisplayed = true; _lineDisplayed = true;
} }
@ -670,7 +670,7 @@ void CStatusLine::experationCheck() {
void CStatusLine::clear() { void CStatusLine::clear() {
enable(false); enable(false);
window.update(_extent); _window.update(_extent);
_lineDisplayed = false; _lineDisplayed = false;
_queueHead = _queueTail = 0; _queueHead = _queueTail = 0;
@ -747,7 +747,7 @@ CMassWeightIndicator::CMassWeightIndicator(gPanelList *panel, const Point16 &pos
// if this is something other then the ready containers // if this is something other then the ready containers
if (type > 1) { if (type > 1) {
_containerObject = (GameObject *)panel->userData; _containerObject = (GameObject *)panel->_userData;
} else { } else {
_containerObject = nullptr; _containerObject = nullptr;
} }
@ -923,7 +923,7 @@ Rect16 CManaIndicator::getManaRegionRect(int8 nRegion) {
void CManaIndicator::draw() { void CManaIndicator::draw() {
gPort &port = window.windowPort; gPort &port = _window._windowPort;
// save pen color, etc. // save pen color, etc.
@ -2067,7 +2067,7 @@ APPFUNC(cmdPortrait) {
const int bufSize = 80; const int bufSize = 80;
const int stateBufSize = 60; const int stateBufSize = 60;
uint16 panID = ev.panel->id; uint16 panID = ev.panel->_id;
GameObject *mouseObject = g_vm->_mouseInfo->getObject(); // object being dragged GameObject *mouseObject = g_vm->_mouseInfo->getObject(); // object being dragged
switch (ev.eventType) { switch (ev.eventType) {
@ -2186,7 +2186,7 @@ void toggleAgression(PlayerActorID bro, bool all) {
} }
APPFUNC(cmdAggressive) { APPFUNC(cmdAggressive) {
uint16 transBroID = translatePanID(ev.panel->id); uint16 transBroID = translatePanID(ev.panel->_id);
// check for message update stuff // check for message update stuff
// and aggression update // and aggression update
@ -2258,7 +2258,7 @@ APPFUNC(cmdArmor) {
} }
APPFUNC(cmdCenter) { APPFUNC(cmdCenter) {
uint16 transBroID = translatePanID(ev.panel->id); uint16 transBroID = translatePanID(ev.panel->_id);
if (ev.eventType == gEventNewValue) { if (ev.eventType == gEventNewValue) {
if (rightButtonState()) if (rightButtonState())
@ -2287,7 +2287,7 @@ void toggleBanding(PlayerActorID bro, bool all) {
} }
APPFUNC(cmdBand) { APPFUNC(cmdBand) {
uint16 transBroID = translatePanID(ev.panel->id); uint16 transBroID = translatePanID(ev.panel->_id);
if (ev.eventType == gEventNewValue) { if (ev.eventType == gEventNewValue) {
toggleBanding(transBroID, rightButtonState()); toggleBanding(transBroID, rightButtonState());
@ -2323,18 +2323,18 @@ APPFUNC(cmdOptions) {
APPFUNC(cmdBroChange) { APPFUNC(cmdBroChange) {
if (ev.eventType == gEventNewValue) { if (ev.eventType == gEventNewValue) {
if (!isBrotherDead(ev.panel->id)) { if (!isBrotherDead(ev.panel->_id)) {
setCenterBrother(ev.panel->id); setCenterBrother(ev.panel->_id);
// this sets up the _buttons in trio mode to the correct // this sets up the _buttons in trio mode to the correct
// state ( must be called before indiv mode switchtes ) // state ( must be called before indiv mode switchtes )
setTrioBtns(); setTrioBtns();
setControlPanelsToIndividualMode(ev.panel->id); setControlPanelsToIndividualMode(ev.panel->_id);
} }
} else if (ev.eventType == gEventMouseMove) { } else if (ev.eventType == gEventMouseMove) {
const int bufSize = 80; const int bufSize = 80;
const int stateBufSize = 60; const int stateBufSize = 60;
uint16 panID = ev.panel->id; uint16 panID = ev.panel->_id;
if (ev.value == GfxCompImage::enter) { if (ev.value == GfxCompImage::enter) {
// working buffer // working buffer
@ -2364,7 +2364,7 @@ APPFUNC(cmdBroChange) {
} }
APPFUNC(cmdHealthStar) { APPFUNC(cmdHealthStar) {
uint16 transBroID = translatePanID(ev.panel->id); uint16 transBroID = translatePanID(ev.panel->_id);
if (ev.eventType == gEventMouseMove) { if (ev.eventType == gEventMouseMove) {
if (ev.value == GfxCompImage::leave) { if (ev.value == GfxCompImage::leave) {
@ -2403,8 +2403,8 @@ APPFUNC(cmdMassInd) {
assert(win); assert(win);
// is it something other than the brother's indicators? // is it something other than the brother's indicators?
if (ev.panel->id > 1) { if (ev.panel->_id > 1) {
_containerObject = (GameObject *)win->userData; _containerObject = (GameObject *)win->_userData;
} else { } else {
_containerObject = (GameObject *)g_vm->_playerList[getCenterActorPlayerID()]->getActor(); _containerObject = (GameObject *)g_vm->_playerList[getCenterActorPlayerID()]->getActor();
} }
@ -2441,8 +2441,8 @@ APPFUNC(cmdBulkInd) {
assert(win); assert(win);
// is it something other than the brother's indicators? // is it something other than the brother's indicators?
if (ev.panel->id > 1) { if (ev.panel->_id > 1) {
_containerObject = (GameObject *)win->userData; _containerObject = (GameObject *)win->_userData;
} else { } else {
_containerObject = (GameObject *)g_vm->_playerList[getCenterActorPlayerID()]->getActor(); _containerObject = (GameObject *)g_vm->_playerList[getCenterActorPlayerID()]->getActor();
} }
@ -2654,7 +2654,7 @@ void gEnchantmentDisplay::drawClipped(gPort &port, const Point16 &offset, con
} }
void gEnchantmentDisplay::pointerMove(gPanelMessage &msg) { void gEnchantmentDisplay::pointerMove(gPanelMessage &msg) {
if (msg.pointerLeave) { if (msg._pointerLeave) {
g_vm->_mouseInfo->setText(nullptr); g_vm->_mouseInfo->setText(nullptr);
} else { } else {
int16 x = _extent.width - 10; int16 x = _extent.width - 10;
@ -2667,7 +2667,7 @@ void gEnchantmentDisplay::pointerMove(gPanelMessage &msg) {
Sprite *sp = mentalSprites->sprite(i + 162); Sprite *sp = mentalSprites->sprite(i + 162);
x -= sp->size.x + 2; x -= sp->size.x + 2;
if (msg.pickPos.x >= x) { if (msg._pickPos.x >= x) {
// set the text in the cursor // set the text in the cursor
char buf[128]; char buf[128];

View file

@ -72,7 +72,7 @@ ModalWindow::~ModalWindow() {
} }
bool ModalWindow::isModal() { bool ModalWindow::isModal() {
return openFlag; return _openFlag;
} }
bool ModalWindow::open() { bool ModalWindow::open() {

View file

@ -354,7 +354,7 @@ void setMouseText(char *text) {
void setMouseTextF(char *format, ...) { void setMouseTextF(char *format, ...) {
if (format == nullptr) { if (format == nullptr) {
setMouseText(nullptr); setMouseText(nullptr);
g_vm->_toolBase->mouseHintSet = true; g_vm->_toolBase->_mouseHintSet = true;
} else { } else {
char lineBuf[128]; char lineBuf[128];
va_list argptr; va_list argptr;
@ -364,7 +364,7 @@ void setMouseTextF(char *format, ...) {
va_end(argptr); va_end(argptr);
setMouseText(lineBuf); setMouseText(lineBuf);
g_vm->_toolBase->mouseHintSet = true; g_vm->_toolBase->_mouseHintSet = true;
} }
} }

View file

@ -106,11 +106,11 @@ APPFUNC(ErrorWindow::cmdMessageWindow) {
if (ev.panel && ev.eventType == gEventNewValue && ev.value) { if (ev.panel && ev.eventType == gEventNewValue && ev.value) {
win = ev.panel->getWindow(); // get the window pointer win = ev.panel->getWindow(); // get the window pointer
ri = win ? (requestInfo *)win->userData : nullptr; ri = win ? (requestInfo *)win->_userData : nullptr;
if (ri) { if (ri) {
ri->running = 0; ri->running = 0;
ri->result = ev.panel->id; ri->result = ev.panel->_id;
} }
} }
} }
@ -151,7 +151,7 @@ ErrorWindow::ErrorWindow(const char *msg, const char *btnMsg1, const char *btnMs
} }
} }
userData = &_rInfo; _userData = &_rInfo;
} }
@ -212,7 +212,7 @@ SimpleWindow::SimpleWindow(const Rect16 &r,
GameMode *gameModes[] = {&PlayMode, &TileMode, &SimpleMode}; GameMode *gameModes[] = {&PlayMode, &TileMode, &SimpleMode};
GameMode::SetStack(gameModes, 3); GameMode::SetStack(gameModes, 3);
title = stitle; _title = stitle;
} }
SimpleWindow::~SimpleWindow() { SimpleWindow::~SimpleWindow() {
@ -251,7 +251,7 @@ void SimpleWindow::drawClipped(
g_vm->_pointer->hide(port, _extent); // hide mouse pointer g_vm->_pointer->hide(port, _extent); // hide mouse pointer
DrawOutlineFrame(port, _extent, windowColor); DrawOutlineFrame(port, _extent, windowColor);
writeWrappedPlaqText(port, box, mbButtonFont, textPos, pal, false, title); writeWrappedPlaqText(port, box, mbButtonFont, textPos, pal, false, _title);
gWindow::drawClipped(port, p, r); gWindow::drawClipped(port, p, r);
@ -344,13 +344,13 @@ SimpleButton::SimpleButton(gWindow &win, const Rect16 &box, const char *title_,
} }
void SimpleButton::deactivate() { void SimpleButton::deactivate() {
selected = 0; _selected = 0;
draw(); draw();
gPanel::deactivate(); gPanel::deactivate();
} }
bool SimpleButton::activate(gEventType why) { bool SimpleButton::activate(gEventType why) {
selected = 1; _selected = 1;
draw(); draw();
if (why == gEventKeyDown) { // momentarily depress if (why == gEventKeyDown) { // momentarily depress
@ -371,21 +371,21 @@ bool SimpleButton::pointerHit(gPanelMessage &) {
void SimpleButton::pointerRelease(gPanelMessage &) { void SimpleButton::pointerRelease(gPanelMessage &) {
// We have to test selected first because deactivate clears it. // We have to test selected first because deactivate clears it.
if (selected) { if (_selected) {
deactivate(); // give back input focus deactivate(); // give back input focus
notify(gEventNewValue, 1); // notify App of successful hit notify(gEventNewValue, 1); // notify App of successful hit
} else deactivate(); } else deactivate();
} }
void SimpleButton::pointerDrag(gPanelMessage &msg) { void SimpleButton::pointerDrag(gPanelMessage &msg) {
if (selected != msg.inPanel) { if (_selected != msg._inPanel) {
selected = msg.inPanel; _selected = msg._inPanel;
draw(); draw();
} }
} }
void SimpleButton::draw() { void SimpleButton::draw() {
gDisplayPort &port = _window->windowPort; gDisplayPort &port = _window->_windowPort;
Rect16 rect = _window->getExtent(); Rect16 rect = _window->getExtent();
SAVE_GPORT_STATE(port); // save pen color, etc. SAVE_GPORT_STATE(port); // save pen color, etc.

View file

@ -39,7 +39,7 @@ namespace Saga2 {
extern char iniFile[]; extern char iniFile[];
// Function to enable/disable user interface keys // Function to enable/disable user interface keys
extern bool enableUIKeys(bool enabled); extern bool enableUIKeys(bool _enabled);
/* ======================================================================= * /* ======================================================================= *
global dispatcher base global dispatcher base
@ -56,69 +56,69 @@ int lockUINest = 0;
* ======================================================================= */ * ======================================================================= */
gPanel::gPanel(gWindow &win, const Rect16 &box, AppFunc *cmd) gPanel::gPanel(gWindow &win, const Rect16 &box, AppFunc *cmd)
: window(win), _extent(box), command(cmd) { : _window(win), _extent(box), _command(cmd) {
enabled = 1; _enabled = 1;
ghosted = 0; _ghosted = 0;
selected = 0; _selected = 0;
imageLabel = 0; _imageLabel = 0;
title = nullptr; _title = nullptr;
id = 0; _id = 0;
wantMousePoll = 0; _wantMousePoll = 0;
userData = nullptr; _userData = nullptr;
} }
gPanel::gPanel(gPanelList &list, const Rect16 &box, gPanel::gPanel(gPanelList &list, const Rect16 &box,
const char *newTitle, uint16 ident, AppFunc *cmd) const char *newTitle, uint16 ident, AppFunc *cmd)
: window(list.window) { : _window(list._window) {
title = newTitle; _title = newTitle;
_extent = box; _extent = box;
enabled = 1; _enabled = 1;
ghosted = 0; _ghosted = 0;
selected = 0; _selected = 0;
imageLabel = 0; _imageLabel = 0;
command = cmd; _command = cmd;
id = ident; _id = ident;
wantMousePoll = 0; _wantMousePoll = 0;
userData = nullptr; _userData = nullptr;
} }
gPanel::gPanel(gPanelList &list, const Rect16 &box, gPanel::gPanel(gPanelList &list, const Rect16 &box,
gPixelMap &pic, uint16 ident, AppFunc *cmd) gPixelMap &pic, uint16 ident, AppFunc *cmd)
: window(list.window) { : _window(list._window) {
title = (char *)&pic; _title = (char *)&pic;
_extent = box; _extent = box;
enabled = 1; _enabled = 1;
ghosted = 0; _ghosted = 0;
selected = 0; _selected = 0;
imageLabel = 1; _imageLabel = 1;
command = cmd; _command = cmd;
id = ident; _id = ident;
wantMousePoll = 0; _wantMousePoll = 0;
userData = nullptr; _userData = nullptr;
} }
gPanel::gPanel(gPanelList &list, const StaticRect &box, gPanel::gPanel(gPanelList &list, const StaticRect &box,
const char *newTitle, uint16 ident, AppFunc *cmd) const char *newTitle, uint16 ident, AppFunc *cmd)
: window(list.window) { : _window(list._window) {
title = newTitle; _title = newTitle;
_extent = Rect16(box); _extent = Rect16(box);
enabled = 1; _enabled = 1;
ghosted = 0; _ghosted = 0;
selected = 0; _selected = 0;
imageLabel = 0; _imageLabel = 0;
command = cmd; _command = cmd;
id = ident; _id = ident;
wantMousePoll = 0; _wantMousePoll = 0;
userData = nullptr; _userData = nullptr;
} }
// Dummy virtual functions // Dummy virtual functions
gPanel::~gPanel() { gPanel::~gPanel() {
if (this == g_vm->_toolBase->mousePanel) if (this == g_vm->_toolBase->_mousePanel)
g_vm->_toolBase->mousePanel = nullptr; g_vm->_toolBase->_mousePanel = nullptr;
if (this == g_vm->_toolBase->activePanel) if (this == g_vm->_toolBase->_activePanel)
g_vm->_toolBase->activePanel = nullptr; g_vm->_toolBase->_activePanel = nullptr;
} }
void gPanel::draw() {} void gPanel::draw() {}
void gPanel::drawClipped(gPort &, const Point16 &, const Rect16 &) {} void gPanel::drawClipped(gPort &, const Point16 &, const Rect16 &) {}
@ -138,19 +138,19 @@ void gPanel::timerTick(gPanelMessage &) {}
void gPanel::onMouseHintDelay() {} void gPanel::onMouseHintDelay() {}
void gPanel::enable(bool abled) { void gPanel::enable(bool abled) {
enabled = abled ? 1 : 0; _enabled = abled ? 1 : 0;
} }
void gPanel::select(uint16 sel) { void gPanel::select(uint16 sel) {
selected = sel ? 1 : 0; _selected = sel ? 1 : 0;
} }
void gPanel::ghost(bool b) { void gPanel::ghost(bool b) {
ghosted = b ? 1 : 0; _ghosted = b ? 1 : 0;
} }
bool gPanel::isActive() { bool gPanel::isActive() {
return (this == g_vm->_toolBase->activePanel); return (this == g_vm->_toolBase->_activePanel);
} }
void gPanel::notify(enum gEventType type, int32 value) { void gPanel::notify(enum gEventType type, int32 value) {
@ -159,12 +159,12 @@ void gPanel::notify(enum gEventType type, int32 value) {
ev.panel = this; ev.panel = this;
ev.eventType = type; ev.eventType = type;
ev.value = value; ev.value = value;
ev.mouse.x = g_vm->_toolBase->pickPos.x - _extent.x; ev.mouse.x = g_vm->_toolBase->_pickPos.x - _extent.x;
ev.mouse.y = g_vm->_toolBase->pickPos.y - _extent.y; ev.mouse.y = g_vm->_toolBase->_pickPos.y - _extent.y;
ev.window = &window; ev.window = &_window;
if (command) command(ev); if (_command) _command(ev);
else if (this != &window) window.notify(ev); else if (this != &_window) _window.notify(ev);
} }
bool gPanel::activate(gEventType) { bool gPanel::activate(gEventType) {
@ -172,7 +172,7 @@ bool gPanel::activate(gEventType) {
} }
void gPanel::deactivate() { void gPanel::deactivate() {
if (isActive()) g_vm->_toolBase->activePanel = nullptr; if (isActive()) g_vm->_toolBase->_activePanel = nullptr;
} }
void gPanel::makeActive() { void gPanel::makeActive() {
@ -181,24 +181,24 @@ void gPanel::makeActive() {
void gPanel::invalidate(Rect16 *) { void gPanel::invalidate(Rect16 *) {
assert(displayEnabled()); assert(displayEnabled());
window.update(_extent); _window.update(_extent);
} }
void gPanel::drawTitle(enum text_positions placement) { void gPanel::drawTitle(enum text_positions placement) {
gPort &port = window.windowPort; gPort &port = _window._windowPort;
Rect16 r = _extent; Rect16 r = _extent;
const gPixelMap *img = nullptr; const gPixelMap *img = nullptr;
if (title == nullptr) if (_title == nullptr)
return; return;
if (imageLabel) { if (_imageLabel) {
img = (const gPixelMap *)title; img = (const gPixelMap *)_title;
r.width = img->_size.x; r.width = img->_size.x;
r.height = img->_size.y; r.height = img->_size.y;
} else { } else {
r.width = TextWidth(mainFont, title, -1, textStyleUnderBar); r.width = TextWidth(mainFont, _title, -1, textStyleUnderBar);
r.height = mainFont->height; r.height = mainFont->height;
} }
@ -231,7 +231,7 @@ void gPanel::drawTitle(enum text_positions placement) {
SAVE_GPORT_STATE(port); // save pen color, etc. SAVE_GPORT_STATE(port); // save pen color, etc.
if (imageLabel) { if (_imageLabel) {
port.setIndirectColor(blackPen); // pen color black port.setIndirectColor(blackPen); // pen color black
port.setMode(drawModeColor); // draw as glyph port.setMode(drawModeColor); // draw as glyph
port.bltPixels(*img, 0, 0, r.x, r.y, r.width, r.height); port.bltPixels(*img, 0, 0, r.x, r.y, r.width, r.height);
@ -242,13 +242,13 @@ void gPanel::drawTitle(enum text_positions placement) {
port.moveTo(r.x, r.y); // move to new text pos port.moveTo(r.x, r.y); // move to new text pos
g_vm->_pointer->hide(*globalPort, r); // hide the pointer g_vm->_pointer->hide(*globalPort, r); // hide the pointer
port.drawText(title, -1); // draw the text port.drawText(_title, -1); // draw the text
g_vm->_pointer->show(*globalPort, r); // hide the pointer g_vm->_pointer->show(*globalPort, r); // hide the pointer
} }
} }
gPanel *gPanel::hitTest(const Point16 &p) { gPanel *gPanel::hitTest(const Point16 &p) {
return enabled && !ghosted && _extent.ptInside(p) ? this : nullptr; return _enabled && !_ghosted && _extent.ptInside(p) ? this : nullptr;
} }
gPanel *gPanel::keyTest(int16) { gPanel *gPanel::keyTest(int16) {
@ -264,29 +264,29 @@ gPanel *gPanel::keyTest(int16) {
gPanelList::gPanelList(gWindow &win, const Rect16 &box, char *newTitle, gPanelList::gPanelList(gWindow &win, const Rect16 &box, char *newTitle,
uint16 ident, AppFunc *cmd) uint16 ident, AppFunc *cmd)
: gPanel(win, box, cmd) { : gPanel(win, box, cmd) {
title = newTitle; _title = newTitle;
id = ident; _id = ident;
} }
// Constructor for standalone panels.. // Constructor for standalone panels..
gPanelList::gPanelList(gPanelList &list) gPanelList::gPanelList(gPanelList &list)
: gPanel(list, list.window.getExtent(), nullptr, 0, nullptr) { : gPanel(list, list._window.getExtent(), nullptr, 0, nullptr) {
window.contents.push_back(this); _window._contents.push_back(this);
} }
gPanelList::~gPanelList() { gPanelList::~gPanelList() {
removeControls(); removeControls();
window.contents.remove(this); _window._contents.remove(this);
} }
void gPanelList::removeControls() { void gPanelList::removeControls() {
gPanel *ctl; gPanel *ctl;
// Delete all sub-panels. // Delete all sub-panels.
while (contents.size()) { while (_contents.size()) {
ctl = contents.front(); ctl = _contents.front();
contents.remove(ctl); _contents.remove(ctl);
delete ctl; delete ctl;
} }
} }
@ -303,15 +303,15 @@ void gPanelList::invalidate(Rect16 *) {
assert(displayEnabled()); assert(displayEnabled());
if (displayEnabled()) if (displayEnabled())
if (contents.size()) { if (_contents.size()) {
ctl = contents.back(); ctl = _contents.back();
invArea = ctl->getExtent(); invArea = ctl->getExtent();
for (Common::List<gPanel *>::iterator it = contents.reverse_begin(); it != contents.end(); --it) { for (Common::List<gPanel *>::iterator it = _contents.reverse_begin(); it != _contents.end(); --it) {
ctl = *it; ctl = *it;
invArea = bound(invArea, ctl->getExtent()); invArea = bound(invArea, ctl->getExtent());
} }
window.update(invArea); _window.update(invArea);
} }
} }
@ -319,8 +319,8 @@ void gPanelList::draw() {
gPanel *ctl; gPanel *ctl;
if (displayEnabled()) if (displayEnabled())
if (enabled) { if (_enabled) {
for (Common::List<gPanel *>::iterator it = contents.reverse_begin(); it != contents.end(); --it) { for (Common::List<gPanel *>::iterator it = _contents.reverse_begin(); it != _contents.end(); --it) {
ctl = *it; ctl = *it;
if (ctl->getEnabled()) if (ctl->getEnabled())
ctl->draw(); ctl->draw();
@ -337,8 +337,8 @@ void gPanelList::drawClipped(
Rect16 tmpR = r - Point16(_extent.x, _extent.y); Rect16 tmpR = r - Point16(_extent.x, _extent.y);
if (displayEnabled()) if (displayEnabled())
if (enabled) { if (_enabled) {
for (Common::List<gPanel *>::iterator it = contents.reverse_begin(); it != contents.end(); --it) { for (Common::List<gPanel *>::iterator it = _contents.reverse_begin(); it != _contents.end(); --it) {
ctl = *it; ctl = *it;
if (ctl->getEnabled()) if (ctl->getEnabled())
ctl->drawClipped(port, tmpOffset, tmpR); ctl->drawClipped(port, tmpOffset, tmpR);
@ -350,8 +350,8 @@ gPanel *gPanelList::hitTest(const Point16 &p) {
gPanel *ctl; gPanel *ctl;
gPanel *result; gPanel *result;
if (enabled && !ghosted) { if (_enabled && !_ghosted) {
for (Common::List<gPanel *>::iterator it = contents.begin(); it != contents.end(); ++it) { for (Common::List<gPanel *>::iterator it = _contents.begin(); it != _contents.end(); ++it) {
ctl = *it; ctl = *it;
if ((result = ctl->hitTest(p)) != nullptr) if ((result = ctl->hitTest(p)) != nullptr)
return result; return result;
@ -364,8 +364,8 @@ gPanel *gPanelList::keyTest(int16 key) {
gPanel *ctl; gPanel *ctl;
gPanel *result; gPanel *result;
if (enabled && !ghosted) { if (_enabled && !_ghosted) {
for (Common::List<gPanel *>::iterator it = contents.reverse_begin(); it != contents.end(); --it) { for (Common::List<gPanel *>::iterator it = _contents.reverse_begin(); it != _contents.end(); --it) {
ctl = *it; ctl = *it;
if ((result = ctl->keyTest(key)) != nullptr) if ((result = ctl->keyTest(key)) != nullptr)
return result; return result;
@ -381,15 +381,14 @@ gPanel *gPanelList::keyTest(int16 key) {
// gWindow static variables // gWindow static variables
int gWindow::dragMode = 0; // current dragging mode int gWindow::_dragMode = 0; // current dragging mode
StaticRect gWindow::dragExtent = {0, 0, 0, 0}; // dragging extent StaticRect gWindow::_dragExtent = {0, 0, 0, 0}; // dragging extent
StaticPoint16 gWindow::dragOffset = {0, 0}; // offset to window origin StaticPoint16 gWindow::_dragOffset = {0, 0}; // offset to window origin
gWindow::gWindow(const Rect16 &box, uint16 ident, const char saveName[], AppFunc *cmd) gWindow::gWindow(const Rect16 &box, uint16 ident, const char saveName[], AppFunc *cmd)
: gPanelList(*this, box, nullptr, ident, cmd) : gPanelList(*this, box, nullptr, ident, cmd) {
//, saver(WIIFF_POS|WIIFS_NORMAL|WIIFE_ONEXIT,iniFile,saveName,box,this) //, saver(WIIFF_POS|WIIFS_NORMAL|WIIFE_ONEXIT,iniFile,saveName,box,this)
{ _openFlag = false;
openFlag = false;
// pointerImage = &arrowPtr; // pointerImage = &arrowPtr;
// pointerOffset = Point16( 0, 0 ); // pointerOffset = Point16( 0, 0 );
@ -399,8 +398,8 @@ gWindow::gWindow(const Rect16 &box, uint16 ident, const char saveName[], AppFunc
// Set up the window's gPort // Set up the window's gPort
windowPort.setFont(mainFont); _windowPort.setFont(mainFont);
windowPort.setPenMap(globalPort->_penMap); _windowPort.setPenMap(globalPort->_penMap);
/* if (windowFeatures & windowBackSaved) // backsave data under window /* if (windowFeatures & windowBackSaved) // backsave data under window
{ {
@ -433,8 +432,8 @@ bool gWindow::open() {
// Send a "pointer-leave" message to mouse panel. // Send a "pointer-leave" message to mouse panel.
g_vm->_toolBase->leavePanel(); g_vm->_toolBase->leavePanel();
g_vm->_toolBase->windowList.push_front(this); g_vm->_toolBase->_windowList.push_front(this);
g_vm->_toolBase->activeWindow = this; g_vm->_toolBase->_activeWindow = this;
g_vm->_toolBase->setActive(nullptr); g_vm->_toolBase->setActive(nullptr);
// g_vm->_pointer->hide(); // g_vm->_pointer->hide();
@ -442,7 +441,7 @@ bool gWindow::open() {
// g_vm->_pointer->setImage( *pointerImage, pointerOffset.x, pointerOffset.y ); // g_vm->_pointer->setImage( *pointerImage, pointerOffset.x, pointerOffset.y );
// g_vm->_pointer->show(); // g_vm->_pointer->show();
openFlag = true; _openFlag = true;
draw(); draw();
return true; return true;
@ -453,22 +452,22 @@ void gWindow::close() {
if (!isOpen()) return; if (!isOpen()) return;
// If any panels on this window are active, then deactivate them. // If any panels on this window are active, then deactivate them.
if (g_vm->_toolBase->activePanel && g_vm->_toolBase->activePanel->getWindow() == this) if (g_vm->_toolBase->_activePanel && g_vm->_toolBase->_activePanel->getWindow() == this)
g_vm->_toolBase->activePanel->deactivate(); g_vm->_toolBase->_activePanel->deactivate();
// Don't close a window that is being dragged (should never happen, // Don't close a window that is being dragged (should never happen,
// but just in case). // but just in case).
if (DragBar::_dragWindow == (FloatingWindow *)this) if (DragBar::_dragWindow == (FloatingWindow *)this)
return; return;
openFlag = false; _openFlag = false;
// remove this window from the window list. // remove this window from the window list.
g_vm->_toolBase->windowList.remove(this); g_vm->_toolBase->_windowList.remove(this);
g_vm->_toolBase->mouseWindow = g_vm->_toolBase->activeWindow = g_vm->_toolBase->windowList.front(); g_vm->_toolBase->_mouseWindow = g_vm->_toolBase->_activeWindow = g_vm->_toolBase->_windowList.front();
g_vm->_toolBase->mousePanel = g_vm->_toolBase->activePanel = nullptr; g_vm->_toolBase->_mousePanel = g_vm->_toolBase->_activePanel = nullptr;
} }
// Move the window to the front... // Move the window to the front...
@ -476,11 +475,11 @@ void gWindow::close() {
void gWindow::toFront() { // re-order the windows void gWindow::toFront() { // re-order the windows
if (!isOpen()) return; if (!isOpen()) return;
g_vm->_toolBase->windowList.remove(this); g_vm->_toolBase->_windowList.remove(this);
g_vm->_toolBase->windowList.push_front(this); g_vm->_toolBase->_windowList.push_front(this);
g_vm->_toolBase->activePanel = nullptr; g_vm->_toolBase->_activePanel = nullptr;
g_vm->_toolBase->activeWindow = this; g_vm->_toolBase->_activeWindow = this;
// redraw the window // redraw the window
update(_extent); update(_extent);
@ -500,14 +499,14 @@ void gWindow::setPos(Point16 pos) {
// We also need to set up the window's port in a similar fashion. // We also need to set up the window's port in a similar fashion.
windowPort._origin.x = _extent.x; _windowPort._origin.x = _extent.x;
windowPort._origin.y = _extent.y; _windowPort._origin.y = _extent.y;
// set port's clip // set port's clip
newClip = intersect(_extent, g_vm->_mainPort._clip); newClip = intersect(_extent, g_vm->_mainPort._clip);
newClip.x -= _extent.x; newClip.x -= _extent.x;
newClip.y -= _extent.y; newClip.y -= _extent.y;
windowPort.setClip(newClip); _windowPort.setClip(newClip);
//saver.onMove(this); //saver.onMove(this);
// if (backSave) backSave->setPos( pos ); // if (backSave) backSave->setPos( pos );
@ -523,7 +522,7 @@ void gWindow::setExtent(const Rect16 &r) {
// insert window into window list // insert window into window list
void gWindow::insert() { void gWindow::insert() {
g_vm->_toolBase->windowList.push_front(this); g_vm->_toolBase->_windowList.push_front(this);
} }
@ -531,13 +530,13 @@ void gWindow::insert() {
// redefine the address of the pixel map. // redefine the address of the pixel map.
void gWindow::deactivate() { void gWindow::deactivate() {
selected = 0; _selected = 0;
gPanel::deactivate(); gPanel::deactivate();
} }
bool gWindow::activate(gEventType why) { bool gWindow::activate(gEventType why) {
if (why == gEventMouseDown) { // momentarily depress if (why == gEventMouseDown) { // momentarily depress
selected = 1; _selected = 1;
notify(why, 0); // notify App of successful hit notify(why, 0); // notify App of successful hit
return true; return true;
} }
@ -554,13 +553,13 @@ bool gWindow::pointerHit(gPanelMessage &) {
} }
void gWindow::pointerDrag(gPanelMessage &) { void gWindow::pointerDrag(gPanelMessage &) {
if (selected) { if (_selected) {
notify(gEventMouseDrag, 0); notify(gEventMouseDrag, 0);
} }
} }
void gWindow::pointerRelease(gPanelMessage &) { void gWindow::pointerRelease(gPanelMessage &) {
if (selected) notify(gEventMouseUp, 0); // notify App of successful hit if (_selected) notify(gEventMouseUp, 0); // notify App of successful hit
deactivate(); deactivate();
} }
@ -594,7 +593,7 @@ void gWindow::setPointer( gPixelMap &map, int x, int y )
pointerOffset.x = x; pointerOffset.x = x;
pointerOffset.y = y; pointerOffset.y = y;
if (this == g_vm->_toolBase->activeWindow) if (this == g_vm->_toolBase->_activeWindow)
{ {
g_vm->_pointer->hide(); g_vm->_pointer->hide();
g_vm->_pointer->setImage( *pointerImage, pointerOffset.x, pointerOffset.y ); g_vm->_pointer->setImage( *pointerImage, pointerOffset.x, pointerOffset.y );
@ -609,36 +608,36 @@ void gWindow::setPointer( gPixelMap &map, int x, int y )
gControl::gControl(gPanelList &list, const Rect16 &box, const char *title_, uint16 ident, gControl::gControl(gPanelList &list, const Rect16 &box, const char *title_, uint16 ident,
AppFunc *cmd) : gPanel(list, box, title_, ident, cmd) { AppFunc *cmd) : gPanel(list, box, title_, ident, cmd) {
accelKey = 0; _accelKey = 0;
// Add control to the window's control list. // Add control to the window's control list.
_list = &list; _list = &list;
list.contents.push_back(this); list._contents.push_back(this);
} }
gControl::gControl(gPanelList &list, const Rect16 &box, gPixelMap &img, uint16 ident, gControl::gControl(gPanelList &list, const Rect16 &box, gPixelMap &img, uint16 ident,
AppFunc *cmd) : gPanel(list, box, img, ident, cmd) { AppFunc *cmd) : gPanel(list, box, img, ident, cmd) {
accelKey = 0; _accelKey = 0;
// Add control to the window's control list. // Add control to the window's control list.
_list = &list; _list = &list;
list.contents.push_back(this); list._contents.push_back(this);
} }
gControl::~gControl() { gControl::~gControl() {
_list->contents.remove(this); _list->_contents.remove(this);
} }
gControl::gControl(gPanelList &list, const StaticRect &box, const char *title_, uint16 ident, gControl::gControl(gPanelList &list, const StaticRect &box, const char *title_, uint16 ident,
AppFunc *cmd) : gPanel(list, box, title_, ident, cmd) { AppFunc *cmd) : gPanel(list, box, title_, ident, cmd) {
accelKey = 0; _accelKey = 0;
// Add control to the window's control list. // Add control to the window's control list.
_list = &list; _list = &list;
list.contents.push_back(this); list._contents.push_back(this);
} }
void gControl::enable(bool abled) { void gControl::enable(bool abled) {
@ -663,7 +662,7 @@ void gControl::ghost(bool sel) {
} }
gPanel *gControl::keyTest(int16 key) { gPanel *gControl::keyTest(int16 key) {
return accelKey == key ? this : nullptr; return _accelKey == key ? this : nullptr;
} }
// For many controls, the only drawing routine we need is the // For many controls, the only drawing routine we need is the
@ -671,12 +670,12 @@ gPanel *gControl::keyTest(int16 key) {
// drawClipped with the main port. // drawClipped with the main port.
void gControl::draw() { void gControl::draw() {
g_vm->_pointer->hide(window.windowPort, _extent); g_vm->_pointer->hide(_window._windowPort, _extent);
if (displayEnabled()) if (displayEnabled())
drawClipped(*globalPort, drawClipped(*globalPort,
Point16(-window._extent.x, -window._extent.y), Point16(-_window._extent.x, -_window._extent.y),
window._extent); _window._extent);
g_vm->_pointer->show(window.windowPort, _extent); g_vm->_pointer->show(_window._windowPort, _extent);
} }
/* ===================================================================== * /* ===================================================================== *
@ -686,31 +685,31 @@ void gControl::draw() {
gGenericControl::gGenericControl(gPanelList &list, const Rect16 &box, gGenericControl::gGenericControl(gPanelList &list, const Rect16 &box,
uint16 ident, AppFunc *cmd) uint16 ident, AppFunc *cmd)
: gControl(list, box, nullptr, ident, cmd) { : gControl(list, box, nullptr, ident, cmd) {
dblClickFlag = false; _dblClickFlag = false;
} }
bool gGenericControl::activate(gEventType) { bool gGenericControl::activate(gEventType) {
selected = 1; _selected = 1;
return true; return true;
} }
void gGenericControl::deactivate() { void gGenericControl::deactivate() {
selected = 0; _selected = 0;
gPanel::deactivate(); gPanel::deactivate();
} }
void gGenericControl::pointerMove(gPanelMessage &msg) { void gGenericControl::pointerMove(gPanelMessage &msg) {
notify(gEventMouseMove, (msg.pointerEnter ? enter : 0) | (msg.pointerLeave ? leave : 0)); notify(gEventMouseMove, (msg._pointerEnter ? enter : 0) | (msg._pointerLeave ? leave : 0));
} }
bool gGenericControl::pointerHit(gPanelMessage &msg) { bool gGenericControl::pointerHit(gPanelMessage &msg) {
if (msg.rightButton) if (msg._rightButton)
notify(gEventRMouseDown, 0); notify(gEventRMouseDown, 0);
else if (msg.doubleClick && !dblClickFlag) { else if (msg._doubleClick && !_dblClickFlag) {
dblClickFlag = true; _dblClickFlag = true;
notify(gEventDoubleClick, 0); notify(gEventDoubleClick, 0);
} else { } else {
dblClickFlag = false; _dblClickFlag = false;
notify(gEventMouseDown, 0); notify(gEventMouseDown, 0);
} }
@ -735,13 +734,13 @@ void gGenericControl::draw() {
* ===================================================================== */ * ===================================================================== */
void gToolBase::setActive(gPanel *ctl) { void gToolBase::setActive(gPanel *ctl) {
if (activePanel && activePanel == ctl) return; if (_activePanel && _activePanel == ctl) return;
if (activePanel) activePanel->deactivate(); if (_activePanel) _activePanel->deactivate();
if (ctl == nullptr || ctl->activate(gEventNone)) activePanel = ctl; if (ctl == nullptr || ctl->activate(gEventNone)) _activePanel = ctl;
} }
void gToolBase::handleMouse(Common::Event &event, uint32 time) { void gToolBase::handleMouse(Common::Event &event, uint32 time) {
gWindow *w = activeWindow; gWindow *w = _activeWindow;
gPanel *ctl, gPanel *ctl,
*pickPanel = nullptr; *pickPanel = nullptr;
static gMouseState prevState; static gMouseState prevState;
@ -785,8 +784,8 @@ void gToolBase::handleMouse(Common::Event &event, uint32 time) {
if (prevState.pos != _curMouseState.pos if (prevState.pos != _curMouseState.pos
&& prevState.left != _curMouseState.left && prevState.left != _curMouseState.left
&& prevState.right != _curMouseState.right) { && prevState.right != _curMouseState.right) {
lastMouseMoveTime = msg.timeStamp; _lastMouseMoveTime = _msg._timeStamp;
if (mouseHintSet) if (_mouseHintSet)
setMouseTextF(nullptr); setMouseTextF(nullptr);
} }
@ -799,60 +798,60 @@ void gToolBase::handleMouse(Common::Event &event, uint32 time) {
// Set up the pick position relative to the window // Set up the pick position relative to the window
if (activePanel) { if (_activePanel) {
pickPos.x = _curMouseState.pos.x - activePanel->window._extent.x; _pickPos.x = _curMouseState.pos.x - _activePanel->_window._extent.x;
pickPos.y = _curMouseState.pos.y - activePanel->window._extent.y; _pickPos.y = _curMouseState.pos.y - _activePanel->_window._extent.y;
} else { } else {
pickPos.x = _curMouseState.pos.x - w->_extent.x; _pickPos.x = _curMouseState.pos.x - w->_extent.x;
pickPos.y = _curMouseState.pos.y - w->_extent.y; _pickPos.y = _curMouseState.pos.y - w->_extent.y;
} }
// Fill in the message to be sent to the various panels // Fill in the message to be sent to the various panels
msg.pickAbsPos = pickPos; _msg._pickAbsPos = _pickPos;
msg.leftButton = _curMouseState.left ? 1 : 0; _msg._leftButton = _curMouseState.left ? 1 : 0;
msg.rightButton = _curMouseState.right ? 1 : 0; _msg._rightButton = _curMouseState.right ? 1 : 0;
msg.pointerEnter = 0; _msg._pointerEnter = 0;
msg.pointerLeave = 0; _msg._pointerLeave = 0;
msg.doubleClick = 0; _msg._doubleClick = 0;
msg.timeStamp = time; _msg._timeStamp = time;
if (((_curMouseState.left && !leftDrag) // if left button hit if (((_curMouseState.left && !_leftDrag) // if left button hit
|| (_curMouseState.right && !rightDrag)) // or right button hit || (_curMouseState.right && !_rightDrag)) // or right button hit
&& activePanel != nullptr) { // and a panel is active && _activePanel != nullptr) { // and a panel is active
// Then we have a button hit event. If the button hit // Then we have a button hit event. If the button hit
// is occuring outside the panel, then it should be // is occuring outside the panel, then it should be
// deselected. // de_selected.
if (activePanel->_extent.ptInside(pickPos) == false) if (_activePanel->_extent.ptInside(_pickPos) == false)
activePanel->deactivate(); _activePanel->deactivate();
} }
if (prevState.pos == _curMouseState.pos) ; // don't do anything if same pos if (prevState.pos == _curMouseState.pos) ; // don't do anything if same pos
else if (activePanel) { // if control active else if (_activePanel) { // if control active
mousePanel = activePanel; // assume mouse over active panel _mousePanel = _activePanel; // assume mouse over active panel
if (leftDrag || rightDrag) { if (_leftDrag || _rightDrag) {
setMsg(msg, activePanel); // set up gPanelMessage setMsg(_msg, _activePanel); // set up gPanelMessage
activePanel->pointerDrag(msg); // send panel a mouse movement _activePanel->pointerDrag(_msg); // send panel a mouse movement
} else { } else {
setMsg(msg, activePanel); // set up gPanelMessage setMsg(_msg, _activePanel); // set up gPanelMessage
activePanel->pointerMove(msg); // send panel a mouse movement _activePanel->pointerMove(_msg); // send panel a mouse movement
} }
} }
if (!activePanel /* && !ms.right */) { if (!_activePanel /* && !ms.right */) {
// If the point is within the window // If the point is within the window
Common::List<gWindow *>::iterator it; Common::List<gWindow *>::iterator it;
for (it = windowList.begin(); it != windowList.end(); ++it) { for (it = _windowList.begin(); it != _windowList.end(); ++it) {
w = *it; w = *it;
if (w->_extent.ptInside(_curMouseState.pos) || w->isModal()) { if (w->_extent.ptInside(_curMouseState.pos) || w->isModal()) {
// Set up the pick position relative to the window // Set up the pick position relative to the window
pickPos.x = _curMouseState.pos.x - w->_extent.x; _pickPos.x = _curMouseState.pos.x - w->_extent.x;
pickPos.y = _curMouseState.pos.y - w->_extent.y; _pickPos.y = _curMouseState.pos.y - w->_extent.y;
if ((ctl = w->hitTest(pickPos)) != nullptr) if ((ctl = w->hitTest(_pickPos)) != nullptr)
pickPanel = ctl; pickPanel = ctl;
else else
pickPanel = w; pickPanel = w;
@ -861,36 +860,36 @@ void gToolBase::handleMouse(Common::Event &event, uint32 time) {
} }
} }
if (it == windowList.end()) { if (it == _windowList.end()) {
prevState = _curMouseState; prevState = _curMouseState;
return; return;
} }
mouseWindow = w; _mouseWindow = w;
// If the mouse is not over the control any more, tell it so. // If the mouse is not over the control any more, tell it so.
if (mousePanel && mousePanel != pickPanel) { if (_mousePanel && _mousePanel != pickPanel) {
if (&mousePanel->window != w) { if (&_mousePanel->_window != w) {
// Temporarily adjust pickPos to be relative to the old panel's window // Temporarily adjust _pickPos to be relative to the old panel's window
// instead of the new panel's window. // instead of the new panel's window.
pickPos.x = _curMouseState.pos.x - mousePanel->window._extent.x; _pickPos.x = _curMouseState.pos.x - _mousePanel->_window._extent.x;
pickPos.y = _curMouseState.pos.y - mousePanel->window._extent.y; _pickPos.y = _curMouseState.pos.y - _mousePanel->_window._extent.y;
setMsgQ(msg, mousePanel); // set up gPanelMessage setMsgQ(_msg, _mousePanel); // set up gPanelMessage
pickPos.x = _curMouseState.pos.x - w->_extent.x; _pickPos.x = _curMouseState.pos.x - w->_extent.x;
pickPos.y = _curMouseState.pos.y - w->_extent.y; _pickPos.y = _curMouseState.pos.y - w->_extent.y;
} else { } else {
setMsgQ(msg, mousePanel); // set up gPanelMessage setMsgQ(_msg, _mousePanel); // set up gPanelMessage
} }
// msg.pickPos.x = pickPos.x - mousePanel->extent.x; // _msg._pickPos.x = _pickPos.x - _mousePanel->extent.x;
// msg.pickPos.y = pickPos.y - mousePanel->extent.y; // _msg._pickPos.y = _pickPos.y - _mousePanel->extent.y;
msg.inPanel = 0; _msg._inPanel = 0;
msg.pointerEnter = 0; _msg._pointerEnter = 0;
msg.pointerLeave = 1; _msg._pointerLeave = 1;
mousePanel->pointerMove(msg); _mousePanel->pointerMove(_msg);
} }
@ -898,24 +897,24 @@ void gToolBase::handleMouse(Common::Event &event, uint32 time) {
// mouse control. // mouse control.
if (pickPanel) { if (pickPanel) {
setMsg(msg, pickPanel); // set up gPanelMessage setMsg(_msg, pickPanel); // set up gPanelMessage
// msg.pickPos.x = pickPos.x - pickPanel->extent.x; // _msg._pickPos.x = _pickPos.x - pickPanel->extent.x;
// msg.pickPos.y = pickPos.y - pickPanel->extent.y; // _msg._pickPos.y = _pickPos.y - pickPanel->extent.y;
msg.leftButton = _curMouseState.left ? 1 : 0; _msg._leftButton = _curMouseState.left ? 1 : 0;
// msg.inPanel = pickPanel->extent.ptInside(pickPos); // _msg._inPanel = pickPanel->extent.ptInside(_pickPos);
msg.pointerEnter = (mousePanel == pickPanel) ? 0 : 1; _msg._pointerEnter = (_mousePanel == pickPanel) ? 0 : 1;
msg.pointerLeave = 0; _msg._pointerLeave = 0;
mousePanel = pickPanel; _mousePanel = pickPanel;
mousePanel->pointerMove(msg); _mousePanel->pointerMove(_msg);
} else } else
mousePanel = nullptr; _mousePanel = nullptr;
} }
// Fix up flags because earlier code may have changed them // Fix up flags because earlier code may have changed them
msg.pointerEnter = 0; _msg._pointerEnter = 0;
msg.pointerLeave = 0; _msg._pointerLeave = 0;
// Send appropriate button-press messages to the panels // Send appropriate button-press messages to the panels
@ -932,54 +931,54 @@ void gToolBase::handleMouse(Common::Event &event, uint32 time) {
// 1/3 of a second, and that the mouse ptr hasn't moved // 1/3 of a second, and that the mouse ptr hasn't moved
// very much. // very much.
if (((uint32)(msg.timeStamp - lastClickTime) < 333) if (((uint32)(_msg._timeStamp - lastClickTime) < 333)
|| _curMouseState.left > 1 || _curMouseState.left > 1
|| _curMouseState.right > 1) { || _curMouseState.right > 1) {
Point16 diff = lastClickPos - _curMouseState.pos; Point16 diff = lastClickPos - _curMouseState.pos;
if (ABS(diff.x) + ABS(diff.y) < 6) if (ABS(diff.x) + ABS(diff.y) < 6)
msg.doubleClick = 1; _msg._doubleClick = 1;
} }
// Record the last mouse time and position for // Record the last mouse time and position for
// future double-click checks. // future double-click checks.
lastClickTime = msg.timeStamp; lastClickTime = _msg._timeStamp;
lastClickPos = _curMouseState.pos; lastClickPos = _curMouseState.pos;
if (mousePanel) { // if over a control if (_mousePanel) { // if over a control
setMsgQ(msg, mousePanel); // set up gPanelMessage setMsgQ(_msg, _mousePanel); // set up gPanelMessage
// msg.pickPos.x = pickPos.x - mousePanel->extent.x; // _msg._pickPos.x = _pickPos.x - _mousePanel->extent.x;
// msg.pickPos.y = pickPos.y - mousePanel->extent.y; // _msg._pickPos.y = _pickPos.y - _mousePanel->extent.y;
msg.inPanel = 1; _msg._inPanel = 1;
if (activeWindow && activeWindow->isModal()) { if (_activeWindow && _activeWindow->isModal()) {
mouseWindow = activeWindow; _mouseWindow = _activeWindow;
} else if (mouseWindow == nullptr) { } else if (_mouseWindow == nullptr) {
mouseWindow = &mousePanel->window; _mouseWindow = &_mousePanel->_window;
} }
if (mouseWindow && mouseWindow != activeWindow) { if (_mouseWindow && _mouseWindow != _activeWindow) {
msg.pickAbsPos = pickPos; _msg._pickAbsPos = _pickPos;
// Re-order the windows. // Re-order the windows.
mouseWindow->toFront(); _mouseWindow->toFront();
} }
// send it a hit message // send it a hit message
if (mousePanel->pointerHit(msg)) { if (_mousePanel->pointerHit(_msg)) {
activePanel = mousePanel; _activePanel = _mousePanel;
if (_curMouseState.left) if (_curMouseState.left)
leftDrag = true; _leftDrag = true;
else else
rightDrag = true; _rightDrag = true;
} }
} }
} else if ((leftDrag && _curMouseState.left == false) // check for release } else if ((_leftDrag && _curMouseState.left == false) // check for release
|| (rightDrag && _curMouseState.right == false)) { || (_rightDrag && _curMouseState.right == false)) {
if (activePanel && mousePanel) { // if a control is active if (_activePanel && _mousePanel) { // if a control is active
setMsg(msg, mousePanel); // send it a release message setMsg(_msg, _mousePanel); // send it a release message
mousePanel->pointerRelease(msg); _mousePanel->pointerRelease(_msg);
} }
leftDrag = rightDrag = false; _leftDrag = _rightDrag = false;
} }
} }
@ -987,22 +986,22 @@ void gToolBase::handleMouse(Common::Event &event, uint32 time) {
} }
void gToolBase::leavePanel() { void gToolBase::leavePanel() {
msg.timeStamp = g_system->getMillis(); _msg._timeStamp = g_system->getMillis();
if (mousePanel) { if (_mousePanel) {
msg.inPanel = 0; _msg._inPanel = 0;
msg.pointerEnter = 0; _msg._pointerEnter = 0;
msg.pointerLeave = 1; _msg._pointerLeave = 1;
mousePanel->pointerMove(msg); _mousePanel->pointerMove(_msg);
mousePanel = nullptr; _mousePanel = nullptr;
} }
if (activePanel) activePanel->deactivate(); if (_activePanel) _activePanel->deactivate();
} }
void gToolBase::handleKeyStroke(Common::Event &event) { void gToolBase::handleKeyStroke(Common::Event &event) {
gWindow *w = activeWindow; gWindow *w = _activeWindow;
gPanel *ctl; gPanel *ctl;
uint16 key = event.kbd.ascii; // FIXME uint16 key = event.kbd.ascii; // FIXME
@ -1017,16 +1016,16 @@ void gToolBase::handleKeyStroke(Common::Event &event) {
if (event.kbd.flags & Common::KBD_ALT) if (event.kbd.flags & Common::KBD_ALT)
qualifier |= qualifierAlt; qualifier |= qualifierAlt;
msg.pickAbsPos = pickPos; _msg._pickAbsPos = _pickPos;
msg.pointerEnter = 0; _msg._pointerEnter = 0;
msg.pointerLeave = 0; _msg._pointerLeave = 0;
msg.key = key; _msg._key = key;
msg.qualifier = qualifier; _msg._qualifier = qualifier;
msg.timeStamp = g_system->getMillis(); _msg._timeStamp = g_system->getMillis();
if (activePanel) { // send keystroke to active panel if (_activePanel) { // send keystroke to active panel
setMsg(msg, activePanel); // set up gPanelMessage setMsg(_msg, _activePanel); // set up gPanelMessage
if (activePanel->keyStroke(msg)) if (_activePanel->keyStroke(_msg))
return; return;
} }
@ -1041,10 +1040,10 @@ void gToolBase::handleKeyStroke(Common::Event &event) {
k = toupper(k); k = toupper(k);
if ((ctl = w->keyTest(k)) != nullptr) { if ((ctl = w->keyTest(k)) != nullptr) {
if (activePanel == ctl) return; if (_activePanel == ctl) return;
if (activePanel) activePanel->deactivate(); if (_activePanel) _activePanel->deactivate();
if (ctl->activate(gEventKeyDown)) { if (ctl->activate(gEventKeyDown)) {
activePanel = ctl; _activePanel = ctl;
return; return;
} }
} }
@ -1052,7 +1051,7 @@ void gToolBase::handleKeyStroke(Common::Event &event) {
// Try sending the message to the window // Try sending the message to the window
if (w->keyStroke(msg)) if (w->keyStroke(_msg))
return; return;
// else send the message to the app. // else send the message to the app.
@ -1062,21 +1061,21 @@ void gToolBase::handleKeyStroke(Common::Event &event) {
} }
void gToolBase::handleTimerTick(int32 tick) { void gToolBase::handleTimerTick(int32 tick) {
msg.pickAbsPos = pickPos; _msg._pickAbsPos = _pickPos;
msg.pointerEnter = 0; _msg._pointerEnter = 0;
msg.pointerLeave = 0; _msg._pointerLeave = 0;
msg.timeStamp = tick; _msg._timeStamp = tick;
if (activePanel) { // send keystroke to active panel if (_activePanel) { // send keystroke to active panel
setMsg(msg, activePanel); // set up gPanelMessage setMsg(_msg, _activePanel); // set up gPanelMessage
activePanel->timerTick(msg); _activePanel->timerTick(_msg);
} else if (mousePanel) { } else if (_mousePanel) {
if (mousePanel->wantMousePoll) { if (_mousePanel->_wantMousePoll) {
setMsg(msg, mousePanel); // set up gPanelMessage setMsg(_msg, _mousePanel); // set up gPanelMessage
mousePanel->pointerMove(msg); _mousePanel->pointerMove(_msg);
} else if (!mouseHintSet } else if (!_mouseHintSet
&& ((uint32)(tick - lastMouseMoveTime) > 500)) { && ((uint32)(tick - _lastMouseMoveTime) > 500)) {
mousePanel->onMouseHintDelay(); _mousePanel->onMouseHintDelay();
} }
} }
} }
@ -1103,11 +1102,11 @@ void cleanupPanels() {
} }
int16 leftButtonState() { int16 leftButtonState() {
return g_vm->_toolBase->msg.leftButton; return g_vm->_toolBase->_msg._leftButton;
} }
int16 rightButtonState() { int16 rightButtonState() {
return g_vm->_toolBase->msg.rightButton; return g_vm->_toolBase->_msg._rightButton;
} }
void LockUI(bool state) { void LockUI(bool state) {

View file

@ -119,23 +119,23 @@ class gPanel {
friend class gToolBase; friend class gToolBase;
friend class gWindow; friend class gWindow;
AppFunc *command; // application function AppFunc *_command; // application function
protected: protected:
gWindow &window; // window this belongs to gWindow &_window; // window this belongs to
Rect16 _extent; // rectangular bounds of the control Rect16 _extent; // rectangular bounds of the control
const char *title; // title of the panel const char *_title; // title of the panel
byte enabled, // allows disabling the panel byte _enabled, // allows disabling the panel
selected, // some panels have a selected state _selected, // some panels have a selected state
imageLabel, // button label is image, not text _imageLabel, // button label is image, not text
ghosted, // button is dimmed _ghosted, // button is dimmed
wantMousePoll; // send mousemoves even if mouse not moving! _wantMousePoll; // send mousemoves even if mouse not moving!
// window constructor // window constructor
gPanel(gWindow &, const Rect16 &, AppFunc *cmd); gPanel(gWindow &, const Rect16 &, AppFunc *cmd);
public: public:
uint32 id; // panel id number uint32 _id; // panel id number
void *userData; // data for this panel void *_userData; // data for this panel
// constructor // constructor
gPanel(gPanelList &, const Rect16 &, const char *, uint16, AppFunc *cmd = NULL); gPanel(gPanelList &, const Rect16 &, const char *, uint16, AppFunc *cmd = NULL);
@ -159,7 +159,7 @@ protected:
void notify(enum gEventType, int32 value); void notify(enum gEventType, int32 value);
void notify(gEvent &ev) { void notify(gEvent &ev) {
if (command) command(ev); if (_command) _command(ev);
} }
void drawTitle(enum text_positions placement); void drawTitle(enum text_positions placement);
@ -174,7 +174,7 @@ public:
virtual void ghost(bool ghosted); virtual void ghost(bool ghosted);
virtual void invalidate(Rect16 *area = nullptr); virtual void invalidate(Rect16 *area = nullptr);
virtual void setMousePoll(bool abled) { virtual void setMousePoll(bool abled) {
wantMousePoll = abled ? 1 : 0; _wantMousePoll = abled ? 1 : 0;
} }
// Redraw the panel, but only a small clipped section, // Redraw the panel, but only a small clipped section,
@ -186,20 +186,20 @@ public:
// void setCommand( AppFunc *func ) { command = func; } // void setCommand( AppFunc *func ) { command = func; }
gWindow *getWindow() { gWindow *getWindow() {
return &window; return &_window;
} }
void makeActive(); void makeActive();
Rect16 getExtent() { Rect16 getExtent() {
return _extent; return _extent;
} }
bool isSelected() { bool isSelected() {
return selected != 0; return _selected != 0;
} }
bool isGhosted() { bool isGhosted() {
return ghosted != 0; return _ghosted != 0;
} }
bool getEnabled() const { bool getEnabled() const {
return (bool) enabled; return (bool)_enabled;
} }
void show(bool shown = true, bool inval = true) { void show(bool shown = true, bool inval = true) {
enable(shown); enable(shown);
@ -217,32 +217,32 @@ public:
class gPanelMessage { class gPanelMessage {
public: public:
Point16 pickPos, // mouse position relative to panel Point16 _pickPos, // mouse position relative to panel
pickAbsPos; // mouse position relative to display _pickAbsPos; // mouse position relative to display
byte leftButton, // left button state byte _leftButton, // left button state
rightButton, // right button state _rightButton, // right button state
inPanel, // whether mouse is currently in panel _inPanel, // whether mouse is currently in panel
pointerEnter, // set when pointer enters panel _pointerEnter, // set when pointer enters panel
pointerLeave, // set when pointer leaves panel _pointerLeave, // set when pointer leaves panel
doubleClick; // set when double click detected _doubleClick; // set when double click detected
// For keyboard input // For keyboard input
uint16 key, // keystroke from keyboard uint16 _key, // keystroke from keyboard
qualifier; // qualifier from keyboard _qualifier; // qualifier from keyboard
uint32 timeStamp; // time of message uint32 _timeStamp; // time of message
gPanelMessage() { gPanelMessage() {
leftButton = 0; _leftButton = 0;
rightButton = 0; _rightButton = 0;
inPanel = 0; _inPanel = 0;
pointerEnter = 0; _pointerEnter = 0;
pointerLeave = 0; _pointerLeave = 0;
doubleClick = 0; _doubleClick = 0;
key = 0; _key = 0;
qualifier = 0; _qualifier = 0;
timeStamp = 0; _timeStamp = 0;
} }
}; };
@ -262,7 +262,7 @@ class gPanelList : public gPanel {
protected: protected:
Common::List<gPanel *> contents; // list of panels Common::List<gPanel *> _contents; // list of panels
gPanelList(gWindow &, const Rect16 &, char *, uint16, AppFunc *cmd = NULL); gPanelList(gWindow &, const Rect16 &, char *, uint16, AppFunc *cmd = NULL);
@ -288,13 +288,13 @@ public:
}; };
inline void gPanel::moveToFront(gPanelList &l) { inline void gPanel::moveToFront(gPanelList &l) {
l.contents.remove(this); l._contents.remove(this);
l.contents.push_front(this); l._contents.push_front(this);
} }
inline void gPanel::moveToBack(gPanelList &l) { inline void gPanel::moveToBack(gPanelList &l) {
l.contents.remove(this); l._contents.remove(this);
l.contents.push_back(this); l._contents.push_back(this);
} }
/* ===================================================================== * /* ===================================================================== *
@ -319,20 +319,20 @@ class gWindow : public gPanelList {
friend class gToolBase; friend class gToolBase;
public: public:
gDisplayPort windowPort; gDisplayPort _windowPort;
gWindow(const Rect16 &, uint16, const char saveName[], AppFunc *cmd = NULL); gWindow(const Rect16 &, uint16, const char saveName[], AppFunc *cmd = NULL);
~gWindow(); ~gWindow();
operator gPort() { operator gPort() {
return windowPort; return _windowPort;
} }
void postEvent(gEvent &ev) { void postEvent(gEvent &ev) {
gPanel::notify(ev); gPanel::notify(ev);
} }
protected: protected:
bool openFlag; // true if window open. bool _openFlag; // true if window open.
//gWindowWinInfoInINIFile saver; //gWindowWinInfoInINIFile saver;
@ -352,9 +352,9 @@ private:
dragPosition dragPosition
}; };
static int dragMode; // current dragging mode static int _dragMode; // current dragging mode
static StaticRect dragExtent; // dragging extent static StaticRect _dragExtent; // dragging extent
static StaticPoint16 dragOffset; // offset to window origin static StaticPoint16 _dragOffset; // offset to window origin
void shadow(); void shadow();
@ -370,7 +370,7 @@ protected:
public: public:
bool isOpen() { bool isOpen() {
return openFlag; // true if window is visible return _openFlag; // true if window is visible
} }
void draw(); // redraw the panel. void draw(); // redraw the panel.
void drawClipped( void drawClipped(
@ -405,7 +405,7 @@ public:
class gControl : public gPanel { class gControl : public gPanel {
public: public:
uint8 accelKey; uint8 _accelKey;
gPanelList *_list; gPanelList *_list;
gControl(gPanelList &, const Rect16 &, const char *, uint16, AppFunc *cmd = NULL); gControl(gPanelList &, const Rect16 &, const char *, uint16, AppFunc *cmd = NULL);
@ -429,14 +429,14 @@ public:
* ===================================================================== */ * ===================================================================== */
class gGenericControl : public gControl { class gGenericControl : public gControl {
bool dblClickFlag; bool _dblClickFlag;
public: public:
gGenericControl(gPanelList &, const Rect16 &, uint16, AppFunc *cmd = NULL); gGenericControl(gPanelList &, const Rect16 &, uint16, AppFunc *cmd = NULL);
// Disable double click for next mouse click // Disable double click for next mouse click
void disableDblClick() { void disableDblClick() {
dblClickFlag = true; _dblClickFlag = true;
} }
enum controlValue { enum controlValue {
@ -476,50 +476,50 @@ class gToolBase {
// windows // windows
Common::List<gWindow *> windowList; // list of windows Common::List<gWindow *> _windowList; // list of windows
gWindow *mouseWindow, // window mouse is in gWindow *_mouseWindow, // window mouse is in
*activeWindow; // current active window *_activeWindow; // current active window
gPanel *mousePanel, // panel that mouse is in gPanel *_mousePanel, // panel that mouse is in
*activePanel; // panel that has input focus *_activePanel; // panel that has input focus
Rect16 dragRect; // dragging rectangle for windows Rect16 _dragRect; // dragging rectangle for windows
Point16 pickPos; // mouse pos relative to panel Point16 _pickPos; // mouse pos relative to panel
uint8 leftDrag, // left-button dragging uint8 _leftDrag, // left-button dragging
rightDrag; // right button dragging _rightDrag; // right button dragging
gPanelMessage msg; // message that we send out gPanelMessage _msg; // message that we send out
int32 lastMouseMoveTime; // time of last mouse move int32 _lastMouseMoveTime; // time of last mouse move
gMouseState _curMouseState; gMouseState _curMouseState;
public: public:
bool mouseHintSet; // true if mouse hint is up. bool _mouseHintSet; // true if mouse hint is up.
gToolBase() { gToolBase() {
mouseWindow = nullptr; _mouseWindow = nullptr;
activeWindow = nullptr; _activeWindow = nullptr;
mousePanel = nullptr; _mousePanel = nullptr;
activePanel = nullptr; _activePanel = nullptr;
leftDrag = 0; _leftDrag = 0;
rightDrag = 0; _rightDrag = 0;
lastMouseMoveTime = 0; _lastMouseMoveTime = 0;
} }
private: private:
void setMsgQ(gPanelMessage &msg_, gPanel *panel) { void setMsgQ(gPanelMessage &msg_, gPanel *panel) {
if (panel == &panel->window) if (panel == &panel->_window)
msg_.pickPos = pickPos; msg_._pickPos = _pickPos;
else { else {
msg.pickPos.x = (int16)(pickPos.x - panel->_extent.x); _msg._pickPos.x = (int16)(_pickPos.x - panel->_extent.x);
msg.pickPos.y = (int16)(pickPos.y - panel->_extent.y); _msg._pickPos.y = (int16)(_pickPos.y - panel->_extent.y);
} }
} }
void setMsg(gPanelMessage &msg_, gPanel *panel) { void setMsg(gPanelMessage &msg_, gPanel *panel) {
setMsgQ(msg_, panel); setMsgQ(msg_, panel);
msg.inPanel = (msg_.pickPos.x >= 0 _msg._inPanel = (msg_._pickPos.x >= 0
&& msg_.pickPos.y >= 0 && msg_._pickPos.y >= 0
&& msg_.pickPos.x < panel->_extent.width && msg_._pickPos.x < panel->_extent.width
&& msg_.pickPos.y < panel->_extent.height); && msg_._pickPos.y < panel->_extent.height);
// panel->extent.ptInside( pickPos ); // panel->extent.ptInside( pickPos );
} }
@ -531,19 +531,19 @@ public:
void handleKeyStroke(Common::Event &event); void handleKeyStroke(Common::Event &event);
void handleTimerTick(int32 tick); void handleTimerTick(int32 tick);
Common::List<gWindow *>::iterator topWindowIterator() { Common::List<gWindow *>::iterator topWindowIterator() {
return windowList.end(); return _windowList.end();
} }
Common::List<gWindow *>::iterator bottomWindowIterator() { Common::List<gWindow *>::iterator bottomWindowIterator() {
return windowList.reverse_begin(); return _windowList.reverse_begin();
} }
gWindow *topWindow() { gWindow *topWindow() {
return windowList.front(); return _windowList.front();
} }
gWindow *bottomWindow() { gWindow *bottomWindow() {
return windowList.back(); return _windowList.back();
} }
bool isMousePanel(gPanel *p) { bool isMousePanel(gPanel *p) {
return (mousePanel != NULL) ? (p == mousePanel) : (p == topWindow()); return (_mousePanel != NULL) ? (p == _mousePanel) : (p == topWindow());
} }
}; };

View file

@ -676,7 +676,7 @@ void TileModeCleanup() {
delete tileMapControl; delete tileMapControl;
// This Fixes the mousePanel That's not set up // This Fixes the mousePanel That's not set up
g_vm->_toolBase->mousePanel = nullptr; g_vm->_toolBase->_mousePanel = nullptr;
mainWindow->removeDecorations(); mainWindow->removeDecorations();
} }

View file

@ -692,17 +692,17 @@ int16 FileDialog(int16 fileProcess) {
// make the quit button // make the quit button
new GfxCompButton(*win, *saveLoadButtonRects[0], pushBtnIm, numBtnImages, btnStrings[stringIndex][0], pal, 0, cmdDialogQuit); new GfxCompButton(*win, *saveLoadButtonRects[0], pushBtnIm, numBtnImages, btnStrings[stringIndex][0], pal, 0, cmdDialogQuit);
//t->accelKey=0x1B; //t->_accelKey=0x1B;
// make the Save/Load button // make the Save/Load button
new GfxCompButton(*win, *saveLoadButtonRects[1], pushBtnIm, numBtnImages, btnStrings[stringIndex][1], pal, fileProcess, fileCommands[fileProcess]); new GfxCompButton(*win, *saveLoadButtonRects[1], pushBtnIm, numBtnImages, btnStrings[stringIndex][1], pal, fileProcess, fileCommands[fileProcess]);
//t->accelKey=0x0D; //t->_accelKey=0x0D;
// make the up arrow // make the up arrow
new GfxCompButton(*win, *saveLoadButtonRects[2], arrowUpIm, numBtnImages, 0, cmdSaveDialogUp); new GfxCompButton(*win, *saveLoadButtonRects[2], arrowUpIm, numBtnImages, 0, cmdSaveDialogUp);
//t->accelKey=33+0x80; //t->_accelKey=33+0x80;
// make the down arrow // make the down arrow
new GfxCompButton(*win, *saveLoadButtonRects[3], arrowDnIm, numBtnImages, 0, cmdSaveDialogDown); new GfxCompButton(*win, *saveLoadButtonRects[3], arrowDnIm, numBtnImages, 0, cmdSaveDialogDown);
//t->accelKey=34+0x80; //t->_accelKey=34+0x80;
// attach the title // attach the title
new CPlaqText(*win, *saveLoadTextRects[0], textStrings[stringIndex][0], &Plate18Font, 0, pal, 0, nullptr); new CPlaqText(*win, *saveLoadTextRects[0], textStrings[stringIndex][0], &Plate18Font, 0, pal, 0, nullptr);
@ -719,7 +719,7 @@ int16 FileDialog(int16 fileProcess) {
ARRAYSIZE(saveWindowDecorations), ARRAYSIZE(saveWindowDecorations),
decRes, 'S', 'L', 'D'); decRes, 'S', 'L', 'D');
win->userData = &rInfo; win->_userData = &rInfo;
win->open(); win->open();
if (GameMode::_newmodeFlag) if (GameMode::_newmodeFlag)
@ -838,28 +838,28 @@ int16 OptionsDialog(bool disableSaveResume) {
if (!disableSaveResume) { if (!disableSaveResume) {
t = new GfxCompButton(*win, *optionsButtonRects[0], t = new GfxCompButton(*win, *optionsButtonRects[0],
dialogPushImag, numBtnImages, btnStrings[0], pal, 0, cmdDialogQuit); dialogPushImag, numBtnImages, btnStrings[0], pal, 0, cmdDialogQuit);
t->accelKey = 0x1B; t->_accelKey = 0x1B;
t = new GfxCompButton(*win, *optionsButtonRects[1], t = new GfxCompButton(*win, *optionsButtonRects[1],
dialogPushImag, numBtnImages, btnStrings[1], pal, 0, cmdOptionsSaveGame); // make the quit button dialogPushImag, numBtnImages, btnStrings[1], pal, 0, cmdOptionsSaveGame); // make the quit button
t->accelKey = 'S'; t->_accelKey = 'S';
} else { } else {
t = new GfxCompButton(*win, *optionsButtonRects[1], t = new GfxCompButton(*win, *optionsButtonRects[1],
dialogPushImag, numBtnImages, OPTN_DIALOG_BUTTON6, pal, 0, cmdOptionsNewGame); dialogPushImag, numBtnImages, OPTN_DIALOG_BUTTON6, pal, 0, cmdOptionsNewGame);
t->accelKey = 'N'; t->_accelKey = 'N';
} }
t = new GfxCompButton(*win, *optionsButtonRects[2], t = new GfxCompButton(*win, *optionsButtonRects[2],
dialogPushImag, numBtnImages, btnStrings[2], pal, 0, cmdOptionsLoadGame); // make the quit button dialogPushImag, numBtnImages, btnStrings[2], pal, 0, cmdOptionsLoadGame); // make the quit button
t->accelKey = 'L'; t->_accelKey = 'L';
t = new GfxCompButton(*win, *optionsButtonRects[3], t = new GfxCompButton(*win, *optionsButtonRects[3],
dialogPushImag, numBtnImages, btnStrings[3], pal, 0, cmdQuitGame); dialogPushImag, numBtnImages, btnStrings[3], pal, 0, cmdQuitGame);
t->accelKey = 'Q'; t->_accelKey = 'Q';
t = new GfxCompButton(*win, *optionsButtonRects[4], t = new GfxCompButton(*win, *optionsButtonRects[4],
dialogPushImag, numBtnImages, btnStrings[4], pal, 0, cmdCredits); dialogPushImag, numBtnImages, btnStrings[4], pal, 0, cmdCredits);
t->accelKey = 'C'; t->_accelKey = 'C';
autoAggressBtn = new GfxOwnerSelCompButton(*win, *optionsButtonRects[5], autoAggressBtn = new GfxOwnerSelCompButton(*win, *optionsButtonRects[5],
checkImag, numBtnImages, 0, cmdAutoAggression); checkImag, numBtnImages, 0, cmdAutoAggression);
@ -901,7 +901,7 @@ int16 OptionsDialog(bool disableSaveResume) {
decRes, 'O', 'P', 'T'); decRes, 'O', 'P', 'T');
win->userData = &rInfo; win->_userData = &rInfo;
win->open(); win->open();
EventLoop(rInfo.running, true); EventLoop(rInfo.running, true);
@ -1016,7 +1016,7 @@ bool initUserDialog() {
ARRAYSIZE(messageDecorations), ARRAYSIZE(messageDecorations),
udDecRes, 'M', 'E', 'S'); udDecRes, 'M', 'E', 'S');
udWin->userData = &udrInfo; udWin->_userData = &udrInfo;
if (udDecRes) resFile->disposeContext(udDecRes); if (udDecRes) resFile->disposeContext(udDecRes);
udDecRes = nullptr; udDecRes = nullptr;
@ -1191,21 +1191,21 @@ int16 userDialog(const char *title, const char *msg, const char *bMsg1,
if (numBtns >= 1) { if (numBtns >= 1) {
t = new GfxCompButton(*win, *messageButtonRects[0], t = new GfxCompButton(*win, *messageButtonRects[0],
dialogPushImag, numBtnImages, btnMsg1, pal, 10, cmdDialogQuit); dialogPushImag, numBtnImages, btnMsg1, pal, 10, cmdDialogQuit);
t->accelKey = k1; t->_accelKey = k1;
} }
// button two // button two
if (numBtns >= 2) { if (numBtns >= 2) {
t = new GfxCompButton(*win, *messageButtonRects[1], t = new GfxCompButton(*win, *messageButtonRects[1],
dialogPushImag, numBtnImages, btnMsg2, pal, 11, cmdDialogQuit); dialogPushImag, numBtnImages, btnMsg2, pal, 11, cmdDialogQuit);
t->accelKey = k2; t->_accelKey = k2;
} }
// button three // button three
if (numBtns >= 3) { if (numBtns >= 3) {
t = new GfxCompButton(*win, *messageButtonRects[2], t = new GfxCompButton(*win, *messageButtonRects[2],
dialogPushImag, numBtnImages, btnMsg3, pal, 12, cmdDialogQuit); dialogPushImag, numBtnImages, btnMsg3, pal, 12, cmdDialogQuit);
t->accelKey = k3; t->_accelKey = k3;
} }
// title for the box // title for the box
@ -1219,7 +1219,7 @@ int16 userDialog(const char *title, const char *msg, const char *bMsg1,
decRes, 'M', 'E', 'S'); decRes, 'M', 'E', 'S');
win->userData = &rInfo; win->_userData = &rInfo;
win->open(); win->open();
@ -1320,11 +1320,11 @@ bool CPlacardWindow::pointerHit(gPanelMessage &) {
requestInfo *ri; requestInfo *ri;
win = getWindow(); // get the window pointer win = getWindow(); // get the window pointer
ri = win ? (requestInfo *)win->userData : nullptr; ri = win ? (requestInfo *)win->_userData : nullptr;
if (ri) { if (ri) {
ri->running = 0; ri->running = 0;
ri->result = id; ri->result = _id;
} }
//activate( gEventMouseDown ); //activate( gEventMouseDown );
@ -1562,7 +1562,7 @@ void placardWindow(int8 type, char *text) {
} }
win->userData = &rInfo; win->_userData = &rInfo;
win->open(); win->open();
@ -1600,11 +1600,11 @@ APPFUNC(cmdDialogQuit) {
if (ev.panel && isUserAction(ev) && ev.value) { if (ev.panel && isUserAction(ev) && ev.value) {
win = ev.panel->getWindow(); // get the window pointer win = ev.panel->getWindow(); // get the window pointer
ri = win ? (requestInfo *)win->userData : nullptr; ri = win ? (requestInfo *)win->_userData : nullptr;
if (ri) { if (ri) {
ri->running = 0; ri->running = 0;
ri->result = ev.panel->id; ri->result = ev.panel->_id;
} }
} }
} }
@ -1616,7 +1616,7 @@ APPFUNC(cmdFileSave) {
if (ev.panel && isUserAction(ev) && ev.value) { if (ev.panel && isUserAction(ev) && ev.value) {
// now close the window // now close the window
win = ev.panel->getWindow(); // get the window pointer win = ev.panel->getWindow(); // get the window pointer
ri = win ? (requestInfo *)win->userData : nullptr; ri = win ? (requestInfo *)win->_userData : nullptr;
if (ri) { if (ri) {
ri->running = 0; ri->running = 0;
@ -1653,7 +1653,7 @@ APPFUNC(cmdFileLoad) {
// close window // close window
win = ev.panel->getWindow(); // get the window pointer win = ev.panel->getWindow(); // get the window pointer
ri = win ? (requestInfo *)win->userData : nullptr; ri = win ? (requestInfo *)win->_userData : nullptr;
if (ri) { if (ri) {
ri->running = 0; ri->running = 0;
@ -1696,11 +1696,11 @@ APPFUNC(cmdOptionsNewGame) {
gWindow *win; gWindow *win;
requestInfo *ri; requestInfo *ri;
win = ev.panel->getWindow(); // get the window pointer win = ev.panel->getWindow(); // get the window pointer
ri = win ? (requestInfo *)win->userData : nullptr; ri = win ? (requestInfo *)win->_userData : nullptr;
if (ri) { if (ri) {
ri->running = 0; ri->running = 0;
ri->result = ev.panel->id; ri->result = ev.panel->_id;
deferredLoadID = 999; deferredLoadID = 999;
deferredLoadFlag = true; deferredLoadFlag = true;
} }
@ -1716,11 +1716,11 @@ APPFUNC(cmdOptionsLoadGame) {
// if the fileDialog actually did loading // if the fileDialog actually did loading
if (FileDialog(typeLoad) == typeLoad) { if (FileDialog(typeLoad) == typeLoad) {
win = ev.panel->getWindow(); // get the window pointer win = ev.panel->getWindow(); // get the window pointer
ri = win ? (requestInfo *)win->userData : nullptr; ri = win ? (requestInfo *)win->_userData : nullptr;
if (ri) { if (ri) {
ri->running = 0; ri->running = 0;
ri->result = ev.panel->id; ri->result = ev.panel->_id;
} }
} }
} }
@ -1732,7 +1732,7 @@ APPFUNC(cmdQuitGame) {
if (ev.panel && isUserAction(ev) && ev.value) { if (ev.panel && isUserAction(ev) && ev.value) {
win = ev.panel->getWindow(); // get the window pointer win = ev.panel->getWindow(); // get the window pointer
ri = win ? (requestInfo *)win->userData : nullptr; ri = win ? (requestInfo *)win->_userData : nullptr;
if (ri if (ri
&& userDialog( && userDialog(
@ -1743,7 +1743,7 @@ APPFUNC(cmdQuitGame) {
endGame(); endGame();
ri->running = false; ri->running = false;
ri->result = ev.panel->id; ri->result = ev.panel->_id;
} }
} }

View file

@ -66,13 +66,13 @@ CVideoBox::~CVideoBox() {
} }
void CVideoBox::deactivate() { void CVideoBox::deactivate() {
selected = 0; _selected = 0;
gPanel::deactivate(); gPanel::deactivate();
} }
bool CVideoBox::activate(gEventType why) { bool CVideoBox::activate(gEventType why) {
if (why == gEventMouseDown) { // momentarily depress if (why == gEventMouseDown) { // momentarily depress
selected = 1; _selected = 1;
notify(why, 0); // notify App of successful hit notify(why, 0); // notify App of successful hit
return true; return true;
} }
@ -89,11 +89,11 @@ bool CVideoBox::pointerHit(gPanelMessage &) {
requestInfo *ri; requestInfo *ri;
win = getWindow(); // get the window pointer win = getWindow(); // get the window pointer
ri = win ? (requestInfo *)win->userData : nullptr; ri = win ? (requestInfo *)win->_userData : nullptr;
if (ri) { if (ri) {
ri->running = 0; ri->running = 0;
ri->result = id; ri->result = _id;
} }
activate(gEventMouseDown); activate(gEventMouseDown);
@ -101,13 +101,13 @@ bool CVideoBox::pointerHit(gPanelMessage &) {
} }
void CVideoBox::pointerDrag(gPanelMessage &) { void CVideoBox::pointerDrag(gPanelMessage &) {
if (selected) { if (_selected) {
notify(gEventMouseDrag, 0); notify(gEventMouseDrag, 0);
} }
} }
void CVideoBox::pointerRelease(gPanelMessage &) { void CVideoBox::pointerRelease(gPanelMessage &) {
if (selected) notify(gEventMouseUp, 0); // notify App of successful hit if (_selected) notify(gEventMouseUp, 0); // notify App of successful hit
deactivate(); deactivate();
} }
@ -145,7 +145,7 @@ void CVideoBox::init() {
'V', 'B', 'D'); 'V', 'B', 'D');
// attach the result info struct to this window // attach the result info struct to this window
userData = &rInfo; _userData = &rInfo;
} }
int16 CVideoBox::openVidBox(char *fileName) { int16 CVideoBox::openVidBox(char *fileName) {