#include "ApplicationInterface.h" #include "NavRenderText.h" #include "SimpleNavigator.h" #include #include #include #include #include #include #include "utils.h" //#define getMenu(window) (HMENU)SendMessage(window, SHCMBM_GETMENU, (WPARAM)0, (LPARAM)0) NavRenderText::NavRenderText(SimpleNavigator* navigator):NavPage(navigator) { textControl = new VerseTextControl(RECT_SCREEN.left, RECT_SCREEN.top, RECT_SCREEN.right, RECT_SCREEN.bottom); } NavRenderText::~NavRenderText() { delete textControl; } void NavRenderText::show() { textControl->show(); showText(); } void NavRenderText::showText() { int verse=navigator->getVerse(); if (!(navigator->chapterCache)) { textControl->clearText(); textControl->hide(); load(); textControl->show(); if (verse!=1) textControl->gotoAnchor(verse); } else textControl->gotoAnchor(verse); navigator->chapterCache=true; } void NavRenderText::load() { SendMessage(g_hwndCB, TB_ENABLEBUTTON, MENU_BOOK, false); SendMessage(g_hwndCB, TB_ENABLEBUTTON, MENU_CHAP, false); SendMessage(g_hwndCB, TB_ENABLEBUTTON, MENU_VERSE, false); SendMessage(g_hwndCB, TB_ENABLEBUTTON, MENU_TEXT, false); SendMessage(g_hwndCB, TB_ENABLEBUTTON, MENU_FIND, false); SendMessage(g_hwndCB, TB_ENABLEBUTTON, MENU_MENU, false); // Suspend user interaction until this page is fully loaded. PostThreadMessage(g_tMain, WM_TXT_START, NULL, NULL); navigator->position.setMark(); navigator->position.setVerse(1); textControl->addText(""); // a