[sword-svn] r151 - trunk/src/SwordReader_GUI
alsites at www.crosswire.org
alsites at www.crosswire.org
Sun Jul 20 13:14:57 MST 2008
Author: alsites
Date: 2008-07-20 13:14:56 -0700 (Sun, 20 Jul 2008)
New Revision: 151
Modified:
trunk/src/SwordReader_GUI/SRBookChooser.cpp
trunk/src/SwordReader_GUI/SRBookChooser.h
trunk/src/SwordReader_GUI/SwordReaderResource.h
Log:
Added color to differentiate between OT and NT. Adjusted button size a little more. Need to add a config screen for these settings.
Modified: trunk/src/SwordReader_GUI/SRBookChooser.cpp
===================================================================
--- trunk/src/SwordReader_GUI/SRBookChooser.cpp 2008-07-12 22:41:20 UTC (rev 150)
+++ trunk/src/SwordReader_GUI/SRBookChooser.cpp 2008-07-20 20:14:56 UTC (rev 151)
@@ -103,6 +103,7 @@
INT nCol;
INT nMaxCols = MaxCols();
INT nMaxRows = MaxRows();
+ UINT nTestament;
HDC hdc = BeginPaint(m_hWnd, &ps);
@@ -129,11 +130,16 @@
for(nCol = 0; nCol < nMaxCols; nCol++){
nCurrent = m_nStartAt + (nRow * nMaxCols) + nCol;
+ if (nCurrent <= BIBLE_OT_BOOKS) {
+ nTestament = SWORD_OLD_TESTAMENT;
+ } else {
+ nTestament = SWORD_NEW_TESTAMENT;
+ }
if(m_nSelectedBook == nCurrent) {
- DrawButton(hdc, buttonRect, m_wcsBookNames[nCurrent - 1].w_str(), TRUE);
+ DrawButton(hdc, buttonRect, m_wcsBookNames[nCurrent - 1].w_str(), nTestament, TRUE);
} else {
- DrawButton(hdc, buttonRect, m_wcsBookNames[nCurrent - 1].w_str(), FALSE);
+ DrawButton(hdc, buttonRect, m_wcsBookNames[nCurrent - 1].w_str(), nTestament, FALSE);
}
if(nCurrent == m_nEndBook)
@@ -160,7 +166,7 @@
buttonRect.top = clientRect.bottom - (BUTTON_HEIGHT + BUTTON_PADDING_HEIGHT);
buttonRect.bottom = clientRect.bottom - BUTTON_PADDING_HEIGHT;
- DrawButton(hdc, buttonRect, L"More >>", FALSE);
+ DrawButton(hdc, buttonRect, L"More >>", 0, FALSE);
}
// We are not on the first page of Books we need to draw a Prev button...
@@ -170,7 +176,7 @@
buttonRect.top = clientRect.bottom - (BUTTON_HEIGHT + BUTTON_PADDING_HEIGHT);
buttonRect.bottom = clientRect.bottom - BUTTON_PADDING_HEIGHT;
- DrawButton(hdc, buttonRect, L"<< Prev", FALSE);
+ DrawButton(hdc, buttonRect, L"<< Prev", 0, FALSE);
}
//Clean up.
@@ -178,10 +184,16 @@
return TRUE;
}
-void SRBookChooser::DrawButton(HDC hdc, RECT buttonRect, LPCWSTR caption, bool selected)
+void SRBookChooser::DrawButton(HDC hdc, RECT buttonRect, LPCWSTR caption, UINT nTestament, bool selected)
{
HBRUSH brushBG = CreateSolidBrush((COLORREF)BUTTON_BACKGROUND);
- SetTextColor(hdc, BUTTON_FOREGROUND);
+ if (nTestament == SWORD_OLD_TESTAMENT) {
+ SetTextColor(hdc, BUTTON_OT_FOREGROUND);
+ } else if (nTestament == SWORD_NEW_TESTAMENT){
+ SetTextColor(hdc, BUTTON_NT_FOREGROUND);
+ } else {
+ SetTextColor(hdc, BUTTON_FOREGROUND);
+ }
if (selected) {
SetBkColor(hdc, BUTTON_SEL_BACKGROUND);
Modified: trunk/src/SwordReader_GUI/SRBookChooser.h
===================================================================
--- trunk/src/SwordReader_GUI/SRBookChooser.h 2008-07-12 22:41:20 UTC (rev 150)
+++ trunk/src/SwordReader_GUI/SRBookChooser.h 2008-07-20 20:14:56 UTC (rev 151)
@@ -23,7 +23,7 @@
protected:
INT BookAt(int x, int y);
void DrawButtons();
- void DrawButton(HDC hdc, RECT buttonRect, LPCWSTR caption, bool selected);
+ void DrawButton(HDC hdc, RECT buttonRect, LPCWSTR caption, UINT nTestament, bool selected);
INT LeftEdge();
INT MaxRows();
INT MaxCols();
Modified: trunk/src/SwordReader_GUI/SwordReaderResource.h
===================================================================
--- trunk/src/SwordReader_GUI/SwordReaderResource.h 2008-07-12 22:41:20 UTC (rev 150)
+++ trunk/src/SwordReader_GUI/SwordReaderResource.h 2008-07-20 20:14:56 UTC (rev 151)
@@ -56,13 +56,15 @@
#define BUTTON_BACKGROUND 0x00b9ccd5
#define BUTTON_SEL_BACKGROUND 0x00ffffff
-#define BUTTON_WIDTH_BOOK 33
+#define BUTTON_WIDTH_BOOK 36
#define BUTTON_WIDTH_NUMBER 28
-#define BUTTON_WIDTH_MORE 60
-#define BUTTON_HEIGHT 23
+#define BUTTON_WIDTH_MORE 65
+#define BUTTON_HEIGHT 24
#define BUTTON_PADDING_WIDTH 1
#define BUTTON_PADDING_HEIGHT 1
#define BUTTON_FOREGROUND 0x00000000
+#define BUTTON_OT_FOREGROUND 0x00888800
+#define BUTTON_NT_FOREGROUND 0x00008888
More information about the sword-cvs
mailing list