BAGEL: Fix showing system cursor in save/restore dialogs

This commit is contained in:
Paul Gilbert 2024-03-21 19:16:41 -07:00 committed by Eugene Sandulenko
parent 770d73e1e0
commit 721cee9a6e
4 changed files with 7 additions and 27 deletions

@ -179,9 +179,6 @@ ERROR_CODE CBagel::RunApp() {
ERROR_CODE CBagel::ShutDown() {
Assert(IsValidObject(this));
// Turn on System cursor
CBofCursor::Show();
LogInfo("Shutting down BAGEL");
// Just in case the child class forgot to delete the main window,

@ -1594,7 +1594,6 @@ ERROR_CODE PaintCursor(CBofBitmap *pBmp) {
pBmp->Paint(CBagStorageDev::m_pUnderCursorBmp, &cDstRect, &gRepaintRect, NOT_TRANSPARENT);
// CursorMan handles this now
CBofCursor::Show();
//errCode = pCursorBmp->Paint(pBmp, x, y, nullptr, DEFAULT_CHROMA_COLOR);
}
}

@ -45,13 +45,8 @@ static const byte ARROW_CURSOR[8 * 16] = {
static byte CURSOR_PALETTE[6] = { 0, 0, 0, 0xff, 0xff, 0xff };
void CBofCursor::initStatics() {
Graphics::PixelFormat format = Graphics::PixelFormat::createFormatCLUT8();
CursorMan.pushCursorPalette(CURSOR_PALETTE, 0, 2);
CursorMan.pushCursor(ARROW_CURSOR, 8, 16, 0, 0, 0xff, &format);
}
CBofCursor::CBofCursor(SHORT nResID) {
Load(nResID);
Show();
CursorMan.showMouse(true);
}
CBofCursor::~CBofCursor() {
@ -60,23 +55,12 @@ CBofCursor::~CBofCursor() {
UnLoad();
}
ERROR_CODE CBofCursor::Load(SHORT nResId) {
ERROR_CODE CBofCursor::Load() {
Assert(IsValidObject(this));
// kill any previous cursor
UnLoad();
warning("Load cursor %d", nResId);
if (nResId == 0) {
// Arrow cursor
Graphics::PixelFormat format = Graphics::PixelFormat::createFormatCLUT8();
CursorMan.replaceCursor(ARROW_CURSOR, 8, 16, 0, 0, 0xff, &format);
} else {
error("Unhandled resource %d", nResId);
}
return m_errCode;
}
@ -93,11 +77,12 @@ ERROR_CODE CBofCursor::Set() {
}
VOID CBofCursor::Hide() {
CursorMan.showMouse(false);
}
VOID CBofCursor::Show() {
CursorMan.showMouse(true);
Graphics::PixelFormat format = Graphics::PixelFormat::createFormatCLUT8();
CursorMan.replaceCursorPalette(CURSOR_PALETTE, 0, 2);
CursorMan.replaceCursor(ARROW_CURSOR, 8, 16, 0, 0, 0xff, &format);
}
} // namespace Bagel

@ -38,11 +38,10 @@ protected:
public:
CBofCursor() {}
CBofCursor(SHORT nResID);
~CBofCursor();
static void initStatics();
ERROR_CODE Load(SHORT nResId);
ERROR_CODE Load();
ERROR_CODE UnLoad();
ERROR_CODE Set();