X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fgui%2Fmenu.cpp;h=7401837dd6e9c611e700158883f82ab8c58a99c4;hb=f36d026c7b8b398b88765ec5b67a3c767fe5fbad;hp=f5c273edc8f7e45b9d8bb253331181e760207479;hpb=2a82c98a2619cce7e9b0634a351331ea6cc6dc06;p=apple2 diff --git a/src/gui/menu.cpp b/src/gui/menu.cpp old mode 100755 new mode 100644 index f5c273e..7401837 --- a/src/gui/menu.cpp +++ b/src/gui/menu.cpp @@ -2,9 +2,9 @@ // MENU.CPP // // Graphical User Interface menu support -// by James L. Hammons +// by James Hammons // -// JLH = James L. Hammons +// JLH = James Hammons // // WHO WHEN WHAT // --- ---------- ------------------------------------------------------------ @@ -41,21 +41,21 @@ MenuItems::MenuItems(): charLength(0), popupBackstore(NULL) { } -bool MenuItems::Inside(uint32 x, uint32 y) +bool MenuItems::Inside(uint32_t x, uint32_t y) { - return (x >= (uint32)extents.x && x < (uint32)(extents.x + extents.w) - && y >= (uint32)extents.y && y < (uint32)(extents.y + extents.h) ? true : false); + return (x >= (uint32_t)extents.x && x < (uint32_t)(extents.x + extents.w) + && y >= (uint32_t)extents.y && y < (uint32_t)(extents.y + extents.h) ? true : false); } // // Menu class implementation // -Menu::Menu(uint32 x/*= 0*/, uint32 y/*= 0*/, uint32 w/*= 0*/, uint32 h/*= 0*/, - uint8 fgcR/*= 0x00*/, uint8 fgcG/*= 0x00*/, uint8 fgcB/*= 0x7F*/, uint8 fgcA/*= 0xFF*/, - uint8 bgcR/*= 0x3F*/, uint8 bgcG/*= 0x3F*/, uint8 bgcB/*= 0xFF*/, uint8 bgcA/*= 0xFF*/, - uint8 fgchR/*= 0x3F*/, uint8 fgchG/*= 0x3F*/, uint8 fgchB/*= 0xFF*/, uint8 fgchA/*= 0xFF*/, - uint8 bgchR/*= 0x87*/, uint8 bgchG/*= 0x87*/, uint8 bgchB/*= 0xFF*/, uint8 bgchA/*= 0xFF*/): +Menu::Menu(uint32_t x/*= 0*/, uint32_t y/*= 0*/, uint32_t w/*= 0*/, uint32_t h/*= 0*/, + uint8_t fgcR/*= 0x00*/, uint8_t fgcG/*= 0x00*/, uint8_t fgcB/*= 0x7F*/, uint8_t fgcA/*= 0xFF*/, + uint8_t bgcR/*= 0x3F*/, uint8_t bgcG/*= 0x3F*/, uint8_t bgcB/*= 0xFF*/, uint8_t bgcA/*= 0xFF*/, + uint8_t fgchR/*= 0x3F*/, uint8_t fgchG/*= 0x3F*/, uint8_t fgchB/*= 0xFF*/, uint8_t fgchA/*= 0xFF*/, + uint8_t bgchR/*= 0x87*/, uint8_t bgchG/*= 0x87*/, uint8_t bgchB/*= 0xFF*/, uint8_t bgchA/*= 0xFF*/): Element(x, y, w, GetFontHeight(), fgcR, fgcG, fgcB, fgcA, bgcR, bgcG, bgcB, bgcA), activated(false), clicked(false), inside(0), insidePopup(0), menuChosen(-1), menuItemChosen(-1), @@ -65,9 +65,9 @@ Menu::Menu(uint32 x/*= 0*/, uint32 y/*= 0*/, uint32 w/*= 0*/, uint32 h/*= 0*/, #if 0 // This *should* allow us to store our colors in an endian safe way... :-/ // Nope. Only on SW surfaces. With HW, all bets are off. :-( - uint8 * c = (uint8 *)&fgColorHL; + uint8_t * c = (uint8_t *)&fgColorHL; c[0] = fgchR, c[1] = fgchG, c[2] = fgchB, c[3] = fgchA; - c = (uint8 *)&bgColorHL; + c = (uint8_t *)&bgColorHL; c[0] = bgchR, c[1] = bgchG, c[2] = bgchB, c[3] = bgchA; #else fgColorHL = SDL_MapRGBA(screen->format, fgchR, fgchG, fgchB, fgchA); @@ -77,20 +77,20 @@ Menu::Menu(uint32 x/*= 0*/, uint32 y/*= 0*/, uint32 w/*= 0*/, uint32 h/*= 0*/, Menu::~Menu() { - for(uint32 i=0; i Inside Menu::HandleMouseMove()...\n"); @@ -121,11 +121,11 @@ WriteLog("--> Inside Menu::HandleMouseMove()...\n"); if (Inside(x, y)) { // Find out *where* we are inside the menu bar - uint32 xpos = extents.x; + uint32_t xpos = extents.x; - for(uint32 i=0; i= xpos && x < xpos + width) { @@ -152,7 +152,7 @@ WriteLog("--> Inside Menu::HandleMouseMove()...\n"); CheckStateAndRedrawIfNeeded(); } -void Menu::HandleMouseButton(uint32 x, uint32 y, bool mouseDown) +void Menu::HandleMouseButton(uint32_t x, uint32_t y, bool mouseDown) { #ifdef DEBUG_MENU WriteLog("--> Inside Menu::HandleMouseButton()...\n"); @@ -201,13 +201,13 @@ WriteLog("--> Inside Menu::Draw()...\n"); #endif char separator[] = "--------------------------------------------------------"; - uint32 xpos = extents.x; + uint32_t xpos = extents.x; - for(uint32 i=0; i Attempting to prime pubs...\n pubs x/y/w/h = %u/%u/%u/%u\n s // Draw sub menu (but only if active) if (clicked) { - uint32 ypos = extents.y + GetFontHeight() + 1; + uint32_t ypos = extents.y + GetFontHeight() + 1; - for(uint32 i=0; i mi.charLength) mi.charLength = mi.item[i].name.length();