void GfxControls16::kernelDrawText(Common::Rect rect, reg_t obj, const char *text, int16 fontId, TextAlignment alignment, int16 style, bool hilite) { if (!hilite) { rect.grow(1); _paint16->eraseRect(rect); rect.grow(-1); //20140521 std::map<std::string, std::string>::iterator iter; if(g_sci->_ScriptData) { _ShouterInfo* pInfo = g_sci->_ScriptData->GetShouterInfo(); iter = pInfo->SentenceList.find(text); if(iter == pInfo->SentenceList.end()) _text16->Box(text, false, rect, alignment, fontId); else _text16->Box(iter->second.c_str(), false, rect, alignment, fontId); } else { _text16->Box(text, false, rect, alignment, fontId); } if (style & SCI_CONTROLS_STYLE_SELECTED) { _paint16->frameRect(rect); } if (!getPicNotValid()) _paint16->bitsShow(rect); } else { _paint16->invertRect(rect); _paint16->bitsShow(rect); } }
void GfxControls16::kernelDrawButton(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 style, bool hilite) { int16 sci0EarlyPen = 0, sci0EarlyBack = 0; if (!hilite) { if (getSciVersion() == SCI_VERSION_0_EARLY) { // SCI0early actually used hardcoded green/black buttons instead of using the port colors sci0EarlyPen = _ports->_curPort->penClr; sci0EarlyBack = _ports->_curPort->backClr; _ports->penColor(0); _ports->backColor(2); } rect.grow(1); _paint16->eraseRect(rect); _paint16->frameRect(rect); rect.grow(-2); _ports->textGreyedOutput(!(style & SCI_CONTROLS_STYLE_ENABLED)); //20140521 //_text16->Box(text, false, rect, SCI_TEXT16_ALIGNMENT_CENTER, fontId); std::map<std::string, std::string>::iterator iter; if(g_sci->_ScriptData) { _ShouterInfo* pInfo = g_sci->_ScriptData->GetShouterInfo(); iter = pInfo->SentenceList.find(text); if(iter == pInfo->SentenceList.end()) _text16->Box(text, false, rect, SCI_TEXT16_ALIGNMENT_CENTER, fontId, true); else _text16->Box(iter->second.c_str(), false, rect, SCI_TEXT16_ALIGNMENT_CENTER, fontId, true); } else { _text16->Box(text, false, rect, SCI_TEXT16_ALIGNMENT_CENTER, fontId); } //End _ports->textGreyedOutput(false); rect.grow(1); if (style & SCI_CONTROLS_STYLE_SELECTED) _paint16->frameRect(rect); if (!getPicNotValid()) { rect.grow(1); _paint16->bitsShow(rect); } if (getSciVersion() == SCI_VERSION_0_EARLY) { _ports->penColor(sci0EarlyPen); _ports->backColor(sci0EarlyBack); } } else { // SCI0early used xor to invert button rectangles resulting in pink/white buttons if (getSciVersion() == SCI_VERSION_0_EARLY) _paint16->invertRectViaXOR(rect); else _paint16->invertRect(rect); _paint16->bitsShow(rect); } }
void GfxControls16::kernelDrawList(Common::Rect rect, reg_t obj, int16 maxChars, int16 count, const char **entries, GuiResourceId fontId, int16 style, int16 upperPos, int16 cursorPos, bool isAlias, bool hilite) { if (!hilite) { drawListControl(rect, obj, maxChars, count, entries, fontId, upperPos, cursorPos, isAlias); rect.grow(1); if (isAlias && (style & SCI_CONTROLS_STYLE_SELECTED)) { _paint16->frameRect(rect); } if (!getPicNotValid()) _paint16->bitsShow(rect); } }
void GfxControls16::kernelDrawIcon(Common::Rect rect, reg_t obj, GuiResourceId viewId, int16 loopNo, int16 celNo, int16 priority, int16 style, bool hilite) { if (!hilite) { _paint16->drawCelAndShow(viewId, loopNo, celNo, rect.left, rect.top, priority, 0); if (style & 0x20) { _paint16->frameRect(rect); } if (!getPicNotValid()) _paint16->bitsShow(rect); } else { _paint16->invertRect(rect); _paint16->bitsShow(rect); } }
void GfxControls16::kernelDrawText(Common::Rect rect, reg_t obj, const char *text, uint16 languageSplitter, int16 fontId, TextAlignment alignment, int16 style, bool hilite) { if (!hilite) { rect.grow(1); _paint16->eraseRect(rect); rect.grow(-1); _text16->Box(text, languageSplitter, false, rect, alignment, fontId); if (style & SCI_CONTROLS_STYLE_SELECTED) { _paint16->frameRect(rect); } if (!getPicNotValid()) _paint16->bitsShow(rect); } else { _paint16->invertRect(rect); _paint16->bitsShow(rect); } }
void GfxControls16::kernelDrawTextEdit(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 mode, int16 style, int16 cursorPos, int16 maxChars, bool hilite) { Common::Rect textRect = rect; uint16 oldFontId = _text16->GetFontId(); rect.grow(1); _texteditCursorVisible = false; texteditCursorErase(); _paint16->eraseRect(rect); _text16->Box(text, false, textRect, SCI_TEXT16_ALIGNMENT_LEFT, fontId); _paint16->frameRect(rect); if (style & SCI_CONTROLS_STYLE_SELECTED) { _text16->SetFont(fontId); rect.grow(-1); texteditCursorDraw(rect, text, cursorPos); _text16->SetFont(oldFontId); rect.grow(1); } if (!getPicNotValid()) _paint16->bitsShow(rect); }
void GfxControls16::kernelDrawButton(Common::Rect rect, reg_t obj, const char *text, uint16 languageSplitter, int16 fontId, int16 style, bool hilite) { int16 sci0EarlyPen = 0, sci0EarlyBack = 0; if (!hilite) { if (getSciVersion() == SCI_VERSION_0_EARLY) { // SCI0early actually used hardcoded green/black buttons instead of using the port colors sci0EarlyPen = _ports->_curPort->penClr; sci0EarlyBack = _ports->_curPort->backClr; _ports->penColor(0); _ports->backColor(2); } rect.grow(1); _paint16->eraseRect(rect); _paint16->frameRect(rect); rect.grow(-2); _ports->textGreyedOutput(!(style & SCI_CONTROLS_STYLE_ENABLED)); _text16->Box(text, languageSplitter, false, rect, SCI_TEXT16_ALIGNMENT_CENTER, fontId); _ports->textGreyedOutput(false); rect.grow(1); if (style & SCI_CONTROLS_STYLE_SELECTED) _paint16->frameRect(rect); if (!getPicNotValid()) { rect.grow(1); _paint16->bitsShow(rect); } if (getSciVersion() == SCI_VERSION_0_EARLY) { _ports->penColor(sci0EarlyPen); _ports->backColor(sci0EarlyBack); } } else { // SCI0early used xor to invert button rectangles resulting in pink/white buttons if (getSciVersion() == SCI_VERSION_0_EARLY) _paint16->invertRectViaXOR(rect); else _paint16->invertRect(rect); _paint16->bitsShow(rect); } }