[sword-svn] r234 - in trunk/src/SlideBible: . bin ui
kalemas at crosswire.org
kalemas at crosswire.org
Mon Apr 19 13:23:37 MST 2010
Author: kalemas
Date: 2010-04-19 13:23:37 -0700 (Mon, 19 Apr 2010)
New Revision: 234
Removed:
trunk/src/SlideBible/ui/ui.cdr
Modified:
trunk/src/SlideBible/bin/SlideBible.exe
trunk/src/SlideBible/bin/SlideBible_Win32.exe
trunk/src/SlideBible/main.cpp
trunk/src/SlideBible/sbControl.cpp
trunk/src/SlideBible/sbCore.cpp
trunk/src/SlideBible/sbItem.cpp
trunk/src/SlideBible/sbItem.h
trunk/src/SlideBible/sbList.cpp
trunk/src/SlideBible/sbList.h
trunk/src/SlideBible/sbTheme.cpp
trunk/src/SlideBible/sbTheme.h
trunk/src/SlideBible/todo.txt
Log:
+ fix sbList::rect
+ 2. ?\208?\159?\208?\176?\209?\128?\208?\176?\208?\187?\208?\184?\208?\191?\208?\190?\208?\188?\208?\181\n?\208?\189?\208?\190?\208?\189\n4 in chapter title
+ text retriveing stopped on empty verses
+ close menus on fail-click
new look
Modified: trunk/src/SlideBible/bin/SlideBible.exe
===================================================================
(Binary files differ)
Modified: trunk/src/SlideBible/bin/SlideBible_Win32.exe
===================================================================
(Binary files differ)
Modified: trunk/src/SlideBible/main.cpp
===================================================================
--- trunk/src/SlideBible/main.cpp 2010-04-09 18:06:28 UTC (rev 233)
+++ trunk/src/SlideBible/main.cpp 2010-04-19 20:23:37 UTC (rev 234)
@@ -43,7 +43,7 @@
static FileDesc * file = NULL;
- file = FileMgr::getSystemFileMgr()->open("log.txt", file == NULL ? FileMgr::WRONLY|FileMgr::CREAT|FileMgr::TRUNC : FileMgr::WRONLY|FileMgr::APPEND );
+ file = FileMgr::getSystemFileMgr()->open(".\\log.txt", file == NULL ? FileMgr::WRONLY|FileMgr::CREAT|FileMgr::TRUNC : FileMgr::WRONLY|FileMgr::APPEND );
if (file->getFd() <= 0) return;
Modified: trunk/src/SlideBible/sbControl.cpp
===================================================================
--- trunk/src/SlideBible/sbControl.cpp 2010-04-09 18:06:28 UTC (rev 233)
+++ trunk/src/SlideBible/sbControl.cpp 2010-04-19 20:23:37 UTC (rev 234)
@@ -87,13 +87,13 @@
switch (type)
{
// navigation
- case TYPE_OPEN_BOOK_SELECTION: rect = layout(1,16,0,6); setText(L"Book"); break;
- case TYPE_OPEN_MODULE_SELECTION: rect = layout(1,16,6,13); setText(L"Module"); break;
- case TYPE_CLOSE: rect = layout(1,16,13,16); setText(L"X"); break;
+ case TYPE_OPEN_BOOK_SELECTION: rect = layout(1,16,0,5); setText(L"Book"); break;
+ case TYPE_OPEN_MODULE_SELECTION: rect = layout(1,16,5,11); setText(L"Module"); break;
+ case TYPE_CLOSE: rect = layout(1,16,11,16); setText(L"Back"); break;
// list
- case TYPE_OPEN_NAVIGATION_LIST: rect = layout(1,16,0,6); setText(L"Goto"); break;
- case TYPE_LIST_SPACE: rect = layout(1,16,6,10); setText(L" "); break;
- case TYPE_OPEN_HOME: rect = layout(1,16,10,16); setText(L"Home"); break;
+ case TYPE_OPEN_NAVIGATION_LIST: rect = layout(1,16,0,5); setText(L"Goto"); break;
+ case TYPE_LIST_SPACE: rect = layout(1,16,5,11); setText(L"Options"); break;
+ case TYPE_OPEN_HOME: rect = layout(1,16,11,16); setText(L"Home"); break;
// home
case TYPE_OPEN_NAVIGATION: rect = layout(1,16,0,6); setText(L"Goto"); break;
case TYPE_OPEN_HISTORY: rect = layout(1,16,6,11); setText(L"History"); break;
@@ -190,7 +190,6 @@
void sbControl::onPaint ( sbSurface hdc ) const
{
sbFont font = sbSelectFont(hdc, Core->getTheme()->styles[style].font);
- sbColor color = sbSelectColor(hdc, Core->getTheme()->fadeColor(Core->getTheme()->ControlsColor,textPos.x,textPos.y));
switch (type)
{
@@ -207,6 +206,7 @@
case TYPE_MENU_CANCEL:
{
Core->getTheme()->drawElement(hdc, &rect, sbTheme::ELEMENT::PANEL);
+ sbSelectColor(hdc, Core->getTheme()->fadeColor(Core->getTheme()->elements[sbTheme::ELEMENT::PANEL].textColor,textPos.x,textPos.y));
sbDrawText(hdc, textPos.x, textPos.y, text, _tcslen(text));
}
break;
@@ -236,12 +236,12 @@
else
{
Core->getTheme()->drawElement(hdc, &rect, sbTheme::ELEMENT::MENU);
+ sbSelectColor(hdc, Core->getTheme()->fadeColor(Core->getTheme()->elements[sbTheme::ELEMENT::MENU].textColor,textPos.x,textPos.y));
sbDrawText(hdc, textPos.x, textPos.y, text, _tcslen(text));
}
}
sbSelectFont(hdc, font);
- sbSelectColor(hdc, color);
}
void sbControl::onPressed()
@@ -273,7 +273,10 @@
if (childrens[i]->hit(Core->getInput()->last.x, Core->getInput()->last.y))
{
childrens[i]->onPressed();
+ break;
}
+
+ if (i == childrens.size()-1) Core->controlPressed(type);
}
}
else
Modified: trunk/src/SlideBible/sbCore.cpp
===================================================================
--- trunk/src/SlideBible/sbCore.cpp 2010-04-09 18:06:28 UTC (rev 233)
+++ trunk/src/SlideBible/sbCore.cpp 2010-04-19 20:23:37 UTC (rev 234)
@@ -114,12 +114,15 @@
defaultModule = swordMgr->getModule((*options)["General"].getWithDefault("DefaultModule", "KJV"));
- if (defaultModule == NULL ) for (int i=0; i<swordMgr->Modules.size(); i++)
+ if (defaultModule == NULL )
{
- if (!strcmp(swordMgr->Modules[i]->Type(), "Biblical Texts"))
+ for (sword::ModMap::iterator it = swordMgr->Modules.begin(); it != swordMgr->Modules.end(); it++)
{
- defaultModule = swordMgr->Modules.begin()->second;
- break;
+ if (!strcmp((*it).second->Type(), "Biblical Texts"))
+ {
+ defaultModule = swordMgr->Modules.begin()->second;
+ break;
+ }
}
}
@@ -241,7 +244,7 @@
_sntprintf(text,16,L"%i fps",1000/lastDelta);
sbSelectFont(drawSurface,theme.styles[sbTheme::STYLE::BUTTON_SMALL].font);
- sbSelectColor(drawSurface,sbColor(255,255,255));
+ sbSelectColor(drawSurface,theme.ItemSubTextColor);
sbDrawText(drawSurface, 4, 3, text, _tcslen(text));
}
Modified: trunk/src/SlideBible/sbItem.cpp
===================================================================
--- trunk/src/SlideBible/sbItem.cpp 2010-04-09 18:06:28 UTC (rev 233)
+++ trunk/src/SlideBible/sbItem.cpp 2010-04-19 20:23:37 UTC (rev 234)
@@ -83,6 +83,8 @@
left = NULL;
right = NULL;
+ processed = false;
+
if ( _text_ != NULL ) setText ( _text_ );
}
@@ -311,6 +313,8 @@
}
text = _text_; // need to be set last
+
+ // processed = true; // maybe i do not need it ?
}
void sbItem::render ( sbSurface surface, const sbRect & rect, sbTheme::ELEMENT::TYPE element ) const
@@ -322,7 +326,7 @@
sbAssert (lines.size() != 3);
sbSelectFont (surface, Core->getTheme()->styles[lines[0].style].font);
- sbSelectColor(surface, Core->getTheme()->fadeColor(Core->getTheme()->ItemTextColor,rect.left,rect.top));
+ sbSelectColor(surface, Core->getTheme()->fadeColor(Core->getTheme()->elements[sbTheme::ELEMENT::ITEM].textColor,rect.left,rect.top));
sbDrawText (surface, rect.left + Core->getTheme()->itemMargins.left, rect.top + Core->getTheme()->itemMargins.top, text.c_str() + lines[0].pos, lines[0].count);
sbSelectFont (surface, Core->getTheme()->styles[lines[1].style].font);
@@ -377,7 +381,7 @@
if (y >= rect.bottom) break; // clip bottom
sbSelectFont(surface, Core->getTheme()->styles[lines[i].style].font);
- sbSelectColor(surface, Core->getTheme()->fadeColor(Core->getTheme()->ItemTextColor,x,y));
+ sbSelectColor(surface, Core->getTheme()->fadeColor(Core->getTheme()->elements[element].textColor,x,y));
sbDrawText (surface, x, y, text.c_str() + lines[i].pos, lines[i].count);
}
Modified: trunk/src/SlideBible/sbItem.h
===================================================================
--- trunk/src/SlideBible/sbItem.h 2010-04-09 18:06:28 UTC (rev 233)
+++ trunk/src/SlideBible/sbItem.h 2010-04-19 20:23:37 UTC (rev 234)
@@ -101,6 +101,8 @@
std::wstring text;
std::wstring subtext;
+ bool processed;
+
bool center;
bool highlighted;
Modified: trunk/src/SlideBible/sbList.cpp
===================================================================
--- trunk/src/SlideBible/sbList.cpp 2010-04-09 18:06:28 UTC (rev 233)
+++ trunk/src/SlideBible/sbList.cpp 2010-04-19 20:23:37 UTC (rev 234)
@@ -32,8 +32,6 @@
attachedReading = attachedHistory = -1;
- rect = &Core->getRect();
-
verseFirst = verseLast = NULL;
versesForward = versesBackward = 0;
@@ -41,6 +39,9 @@
controlSelected = -1;
+ rect = Core->getRect();
+ rect.bottom -= Core->getTheme()->PanelSize;
+
switch(type)
{
case TYPE_SELECT_BOOK:
@@ -170,7 +171,7 @@
void sbList::render ( sbSurface hdc , bool showPlace , int sideDisplacement )
{
sbItem *oldItem , *workItem = itemCurrent;
- sbRect workRect = *rect, selectedRect;
+ sbRect workRect = rect, selectedRect;
int screenHeight = (int)displace;
workRect.left += sideDisplacement;
@@ -182,11 +183,11 @@
{
if (workItem == NULL) break;
- if (screenHeight > rect->bottom) break;
+ if (screenHeight > rect.bottom) break;
oldItem = workItem;
- workRect = *rect;
+ workRect = rect;
workRect.right = sideDisplacement;
// horizontal parse
@@ -199,9 +200,14 @@
workRect.left = workRect.right;
workRect.right = workRect.left + workItem->width;
- if ( workItem == itemHover ) element = sbTheme::ELEMENT::ITEM_PRESSED;
- else if ( workItem->highlighted ) element = sbTheme::ELEMENT::ITEM_HIGHLIGHTED;
+ if (type == TYPE_HISTORY && workItem->type == sbItem::TYPE_DESCRIPTION)
+ element = sbTheme::ELEMENT::ITEM_SEPARATOR;
+ if ( workItem == itemHover )
+ element = sbTheme::ELEMENT::ITEM_PRESSED;
+ else if ( workItem->highlighted )
+ element = sbTheme::ELEMENT::ITEM_HIGHLIGHTED;
+
workItem->render(hdc,workRect,element);
if ( workItem == itemSelected ) selectedRect = workRect;
@@ -216,7 +222,7 @@
workRect.top = workRect.bottom;
workRect.bottom = workRect.top + Core->getTheme()->ListSeparatorHeight;
workRect.left = sideDisplacement;
- workRect.right = sideDisplacement+rect->width();
+ workRect.right = sideDisplacement+rect.width();
Core->getTheme()->drawElement(hdc, &workRect, sbTheme::ELEMENT::SEPARATOR);
@@ -234,11 +240,11 @@
if (displace >= 0)
{
needScroll = (int)-displace;
- needFill = displace != 0 || screenHeight < rect->height();
+ needFill = displace != 0 || screenHeight < rect.height();
}
- else if (screenHeight < rect->height())
+ else if (screenHeight < rect.height())
{
- needScroll = rect->height() - screenHeight;
+ needScroll = rect.height() - screenHeight;
needFill = true;
}
else
@@ -255,7 +261,7 @@
if (selectedRect.width() > 0)
{
Core->getTheme()->drawFrame(hdc,&selectedRect);
- needScroll = ((rect->height()/2)-((selectedRect.height()/2)+selectedRect.top));
+ needScroll = ((rect.height()/2)-((selectedRect.height()/2)+selectedRect.top));
}
}
@@ -277,7 +283,7 @@
sbSelectFont (hdc, Core->getTheme()->styles[sbTheme::STYLE::CAPTION].font );
ks = sbGetTextExtent (Core->getTheme()->styles[sbTheme::STYLE::CAPTION].font, kw, kl);
- sbRect tempRect ((rect->right-ks.x)/2+sideDisplacement, (Core->getTheme()->size/6)-(ks.y/2), (rect->right-ks.x)/2+ks.x+sideDisplacement, (Core->getTheme()->size/6)-(ks.y/2)+ks.y);
+ sbRect tempRect ((rect.right-ks.x)/2+sideDisplacement, (Core->getTheme()->size/6)-(ks.y/2), (rect.right-ks.x)/2+ks.x+sideDisplacement, (Core->getTheme()->size/6)-(ks.y/2)+ks.y);
sbSelectFont ( hdc, Core->getTheme()->styles[sbTheme::STYLE::DESCRIPTION].font );
@@ -301,7 +307,7 @@
workRect = tempRect;
- sbSelectColor ( hdc, Core->getTheme()->ItemMenuTextColor );
+ sbSelectColor ( hdc, Core->getTheme()->elements[sbTheme::ELEMENT::BANNER].textColor );
sbSelectFont ( hdc, Core->getTheme()->styles[sbTheme::STYLE::CAPTION].font );
sbDrawText ( hdc, workRect.left, workRect.top, kw, kl );
@@ -334,13 +340,13 @@
}
if (amount > 0 && itemCurrent->prev == NULL)
{
- amount = min(amount, rect->height()-displace);
+ amount = min(amount, rect.height()-displace);
sbAssert(amount < 0);
}
- if ( fabs(amount) > rect->height()/3 )
+ if ( fabs(amount) > rect.height()/3 )
{
- amount = amount > 0.0f ? rect->height()/3.0f : -rect->height()/3.0f;
+ amount = amount > 0.0f ? rect.height()/3.0f : -rect.height()/3.0f;
}
displace += amount;
@@ -360,7 +366,7 @@
sbItem* i = itemCurrent;
int top = (int)displace;
- while (i != NULL && top < rect->height())
+ while (i != NULL && top < rect.height())
{
if (y > top && y < top + i->height)
{
@@ -512,7 +518,7 @@
TCHAR text[8];
_itot(workKey.getChapter(), text, 10);
- sbItem *item = new sbItem (sbItem::TYPE_BUTTON_SELECTION_CHAPTER, text, rect->width()/3, workKey.Index());
+ sbItem *item = new sbItem (sbItem::TYPE_BUTTON_SELECTION_CHAPTER, text, rect.width()/3, workKey.Index());
item->center = true;
@@ -534,9 +540,9 @@
if (tmpItem->type == sbItem::TYPE_BUTTON_SELECTION_CHAPTER)
{
if (tmpItem->right == NULL)
- tmpItem->attach(new sbItem (sbItem::TYPE_SPACE, L"", rect->width()/3*2), sbItem::RIGHT);
+ tmpItem->attach(new sbItem (sbItem::TYPE_SPACE, L"", rect.width()/3*2), sbItem::RIGHT);
else if (tmpItem->right->right == NULL)
- tmpItem->right->attach(new sbItem (sbItem::TYPE_SPACE, L"", rect->width()/3), sbItem::RIGHT);
+ tmpItem->right->attach(new sbItem (sbItem::TYPE_SPACE, L"", rect.width()/3), sbItem::RIGHT);
}
}
}
@@ -648,7 +654,7 @@
}
// find center screen item
- while (item->next != NULL && displace+item->height < (rect->height())/2)
+ while (item->next != NULL && displace+item->height < (rect.height())/2)
{
displace += item->height;
item = item->next;
@@ -659,7 +665,7 @@
while ( ! * abort )
{
- if ( item->type == sbItem::TYPE_VERSE && item->text.size() == 0 )
+ if ( item->type == sbItem::TYPE_VERSE && item->processed == false )
{
workKey.Index ( item->index );
@@ -667,6 +673,8 @@
TCHAR * text = (TCHAR*) module->RenderText();
+ item->processed = true;
+
if ( _tcslen ( text ) == 0 ) break;
int oldHeight = item->height;
@@ -744,6 +752,11 @@
addControl ( sbControl::TYPE_MENU_EXIT );
break;
+ case sbControl::TYPE_MENU_EXIT:
+ case sbControl::TYPE_MENU_VERSE:
+ removeControl ( type );
+ break;
+
default:
if (type >= sbControl::TYPE_SET_VERSE && type < sbControl::TYPE_SET_VERSE_MAX)
{
@@ -758,8 +771,14 @@
removeControl ( sbControl::TYPE_MENU_CURRENT );
Core->switchList ( sbList::TYPE_MODULE_VIEW );
}
+ else if (type >= sbControl::TYPE_MENU_SET_VERSE && type < sbControl::TYPE_MENU_SET_VERSE_MAX)
+ {
+ removeControl ( type );
+ }
else
+ {
return false;
+ }
}
return true;
}
@@ -810,7 +829,7 @@
// Expand items heights
if ( itemCurrent != NULL && type == sbList::TYPE_MODULE_VIEW )
{
- const int halfscreen = rect->height()/2;
+ const int halfscreen = rect.height()/2;
for ( int direction = 0; direction < 2; direction++ )
{
@@ -822,7 +841,7 @@
if ( item->expanding != 0 && !( direction == 1 && item == itemCurrent ) )
{
// out of screen
- if ( y < -(item->height+Core->getTheme()->ListSeparatorHeight) || y > rect->height() )
+ if ( y < -(item->height+Core->getTheme()->ListSeparatorHeight) || y > rect.height() )
{
item->height = item->expanding;
item->expanding = 0;
@@ -887,28 +906,18 @@
if (itemCurrent == NULL)
{
- itemCurrent = new sbItem (sbItem::TYPE_VERSE, NULL, rect->width(), workKey.Index(), workKey.getVerse());
+ itemCurrent = new sbItem (sbItem::TYPE_VERSE, NULL, rect.width(), workKey.Index(), workKey.getVerse());
verseFirst = itemCurrent;
verseLast = itemCurrent;
if (workKey.getVerse() == 1)
{
- TCHAR headerText [16];
+ TCHAR headerText [32];
- const char* book = workKey.getBookName();
- int s = strlen ( book );
- mbstowcs ( headerText , book ,s );
+ _sntprintf(headerText,32,L"%S %i",workKey.getBookName(),workKey.getChapter());
- char chap [ 8 ];
- _itoa ( workKey.getChapter() , chap , 10 );
-
- headerText[s++] = s > 9 ? L'\n' : L' ';
-
- for(int i=0;i<strlen(chap)+1;i++)
- headerText[s++] = chap[i];
-
- itemCurrent->attach(new sbItem (sbItem::TYPE_HEADER, headerText, rect->width(), workKey.Index()), sbItem::PREV);
+ itemCurrent->attach(new sbItem (sbItem::TYPE_HEADER, headerText, rect.width(), workKey.Index()), sbItem::PREV);
}
added++;
@@ -919,10 +928,9 @@
{
bool atEnd;
- if (versesForward+versesBackward > Core->versesMax)
- { sbSleep(25); break; } // need for memory reason
+ if (versesForward+versesBackward > Core->versesMax) { sbSleep(25); break; } // need for memory reason
- if (versesForward+versesBackward > Core->versesOptimal*2) sbSleep(5);
+ if (versesForward+versesBackward > Core->versesOptimal * 2) sbSleep(5);
if (versesForward < 15 && !listEndConstructed) atEnd = true;
else if (versesBackward < 5 && !listStartConstructed) atEnd = false;
@@ -955,7 +963,7 @@
if (workKey.Index() != index)
{
- item->attach(new sbItem (sbItem::TYPE_VERSE, NULL, rect->width(), workKey.Index(), workKey.getVerse()), atEnd ? sbItem::NEXT : sbItem::PREV);
+ item->attach(new sbItem (sbItem::TYPE_VERSE, NULL, rect.width(), workKey.Index(), workKey.getVerse()), atEnd ? sbItem::NEXT : sbItem::PREV);
if (atEnd)
{
@@ -986,12 +994,12 @@
if (atEnd)
{
- verseLast->attach(new sbItem (sbItem::TYPE_HEADER, headerText, rect->width(), workKey.Index()), sbItem::PREV);
+ verseLast->attach(new sbItem (sbItem::TYPE_HEADER, headerText, rect.width(), workKey.Index()), sbItem::PREV);
verseLast->prev->center = true;
}
else
{
- verseFirst->attach(new sbItem (sbItem::TYPE_HEADER, headerText, rect->width(), workKey.Index()), sbItem::PREV);
+ verseFirst->attach(new sbItem (sbItem::TYPE_HEADER, headerText, rect.width(), workKey.Index()), sbItem::PREV);
verseFirst->prev->center = true;
}
}
@@ -1055,7 +1063,7 @@
_sntprintf(tempText,128,L"%S %i",Core->currentVerse.getBookName(),Core->currentVerse.getChapter());
- itemCurrent = new sbItem (sbItem::TYPE_HEADER, tempText, rect->width(), Core->currentVerse.Index());
+ itemCurrent = new sbItem (sbItem::TYPE_HEADER, tempText, rect.width(), Core->currentVerse.Index());
// add verses
sbItem * tempItem = itemCurrent;
@@ -1068,7 +1076,7 @@
TCHAR text[8];
_itot(workKey.getVerse(), text, 10);
- sbItem * item = new sbItem (sbItem::TYPE_BUTTON_BOOKMARK_SMALL, text, rect->width()/4, workKey.Index());
+ sbItem * item = new sbItem (sbItem::TYPE_BUTTON_BOOKMARK_SMALL, text, rect.width()/4, workKey.Index());
item->center = true;
@@ -1090,11 +1098,11 @@
if (tempItem->type == sbItem::TYPE_BUTTON_BOOKMARK_SMALL)
{
if (tempItem->right == NULL)
- tempItem->attach(new sbItem (sbItem::TYPE_SPACE, L"", rect->width()/4*3), sbItem::RIGHT);
+ tempItem->attach(new sbItem (sbItem::TYPE_SPACE, L"", rect.width()/4*3), sbItem::RIGHT);
else if (tempItem->right->right == NULL)
- tempItem->right->attach(new sbItem (sbItem::TYPE_SPACE, L"", rect->width()/4*2), sbItem::RIGHT);
+ tempItem->right->attach(new sbItem (sbItem::TYPE_SPACE, L"", rect.width()/4*2), sbItem::RIGHT);
else if (tempItem->right->right->right == NULL)
- tempItem->right->right->attach(new sbItem (sbItem::TYPE_SPACE, L"", rect->width()/4), sbItem::RIGHT);
+ tempItem->right->right->attach(new sbItem (sbItem::TYPE_SPACE, L"", rect.width()/4), sbItem::RIGHT);
}
}
break;
@@ -1117,7 +1125,7 @@
displace = saveDisplacement;
- itemCurrent = new sbItem (sbItem::TYPE_HEADER, L"Welcome to\nSlideBible!", rect->width());
+ itemCurrent = new sbItem (sbItem::TYPE_HEADER, L"Welcome to\nSlideBible!", rect.width());
if ( Core->defaultModule != NULL )
{
@@ -1137,7 +1145,7 @@
text[_tcslen(text)+1] = L' ';
text[_tcslen(text)] = L'\n';
- itemCurrent->attach(new sbItem (sbItem::TYPE_GOTO_MODULES, text, rect->width()), sbItem::NEXT);
+ itemCurrent->attach(new sbItem (sbItem::TYPE_GOTO_MODULES, text, rect.width()), sbItem::NEXT);
itemCurrent = itemCurrent->next;
itemCurrent->center = true;
@@ -1160,7 +1168,7 @@
text[_tcslen(text)+1] = L' ';
text[_tcslen(text)] = L'\n';
- itemCurrent->attach(new sbItem (sbItem::TYPE_GO_HISTORY, text, rect->width(), Core->features.history.size()-1), sbItem::NEXT);
+ itemCurrent->attach(new sbItem (sbItem::TYPE_GO_HISTORY, text, rect.width(), Core->features.history.size()-1), sbItem::NEXT);
itemCurrent = itemCurrent->next;
itemCurrent->center = true;
@@ -1169,19 +1177,19 @@
else
{
workKey.setText ( "John 1:1" );
- itemCurrent->attach(new sbItem (sbItem::TYPE_BUTTON_BOOKMARK, L" \nRead Bible ...\n ", rect->width(), workKey.Index()), sbItem::NEXT);
+ itemCurrent->attach(new sbItem (sbItem::TYPE_BUTTON_BOOKMARK, L" \nRead Bible ...\n ", rect.width(), workKey.Index()), sbItem::NEXT);
itemCurrent = itemCurrent->next;
itemCurrent->center = true;
}
}
else
{
- itemCurrent->attach(new sbItem (sbItem::TYPE_TEXT, L"No modules Found!\n\nPlease download any Bible module from www.crosswire.org and put \"mods.d\" and \"modules\" folders into application folder.", rect->width()), sbItem::NEXT);
+ itemCurrent->attach(new sbItem (sbItem::TYPE_TEXT, L"No modules Found!\n\nPlease download any Bible module from www.crosswire.org and put \"mods.d\" and \"modules\" folders into application folder.", rect.width()), sbItem::NEXT);
itemCurrent = itemCurrent->next;
}
_sntprintf(tempText,128,L"About :\nVersion built on %S\n Using SWORD version %S",__DATE__,sword::SWVersion::currentVersion.getText());
- itemCurrent->attach(new sbItem (sbItem::TYPE_DESCRIPTION, tempText, rect->width()), sbItem::NEXT);
+ itemCurrent->attach(new sbItem (sbItem::TYPE_DESCRIPTION, tempText, rect.width()), sbItem::NEXT);
itemCurrent = itemCurrent->next;
itemCurrent->center = true;
@@ -1203,7 +1211,7 @@
place.copyFrom ( Core->currentVerse );
- displace = rect->height()*2.0f/5.0f;
+ displace = rect.height()*2.0f/5.0f;
// adding blank verses starts automatically in sbList::onTimer(sbCore::TIMER_BEFORE_REDRAW)
// filling with text occurs in sbList::process in another thread
@@ -1251,7 +1259,7 @@
mbstowcs(text,book,strlen(book)+1);
- sbItem *item = new sbItem (sbItem::TYPE_BUTTON_SELECTION_BOOK, text, rect->width(), workKey.Index());
+ sbItem *item = new sbItem (sbItem::TYPE_BUTTON_SELECTION_BOOK, text, rect.width(), workKey.Index());
item->center = true;
delete [] text;
@@ -1299,7 +1307,7 @@
for(int i=0; i<=strlen(mod->Description()); i++)
text[i] = mod->Description()[i];
- sbItem *item = new sbItem (sbItem::TYPE_BUTTON_SELECTION_MODULE, text, rect->width(), (long)mod);
+ sbItem *item = new sbItem (sbItem::TYPE_BUTTON_SELECTION_MODULE, text, rect.width(), (long)mod);
item->center = true;
delete [] text;
@@ -1332,7 +1340,7 @@
for(int i=0;i<=strlen(mod->Description()); i++)
text[i] = mod->Description()[i];
- sbItem *item = new sbItem (sbItem::TYPE_BUTTON_SELECTION_MODULE, text, rect->width(), (long)mod);
+ sbItem *item = new sbItem (sbItem::TYPE_BUTTON_SELECTION_MODULE, text, rect.width(), (long)mod);
item->center = true;
delete [] text;
@@ -1406,7 +1414,7 @@
{
if(!createdNow)
{
- timeHeader = new sbItem (sbItem::TYPE_DESCRIPTION, L"Now", rect->width());
+ timeHeader = new sbItem (sbItem::TYPE_DESCRIPTION, L"Now", rect.width());
createdNow = true;
}
}
@@ -1414,7 +1422,7 @@
{
if(!createdToday)
{
- timeHeader = new sbItem (sbItem::TYPE_DESCRIPTION, L"Today", rect->width());
+ timeHeader = new sbItem (sbItem::TYPE_DESCRIPTION, L"Today", rect.width());
createdToday = true;
}
}
@@ -1422,7 +1430,7 @@
{
if(!createdYesterday)
{
- timeHeader = new sbItem (sbItem::TYPE_DESCRIPTION, L"Yesterday", rect->width());
+ timeHeader = new sbItem (sbItem::TYPE_DESCRIPTION, L"Yesterday", rect.width());
createdYesterday = true;
}
}
@@ -1430,13 +1438,13 @@
{
if(!createdWeek)
{
- timeHeader = new sbItem (sbItem::TYPE_DESCRIPTION, L"Last Week", rect->width());
+ timeHeader = new sbItem (sbItem::TYPE_DESCRIPTION, L"Last Week", rect.width());
createdWeek = true;
}
}
else if (!createdOlder)
{
- timeHeader = new sbItem (sbItem::TYPE_DESCRIPTION, L"Older", rect->width());
+ timeHeader = new sbItem (sbItem::TYPE_DESCRIPTION, L"Older", rect.width());
createdOlder = true;
}
@@ -1455,7 +1463,7 @@
}
}
- sbItem * item = new sbItem (sbItem::TYPE_HISTORY, tempText, rect->width(), h);
+ sbItem * item = new sbItem (sbItem::TYPE_HISTORY, tempText, rect.width(), h);
if ( itemCurrent == NULL )
{
Modified: trunk/src/SlideBible/sbList.h
===================================================================
--- trunk/src/SlideBible/sbList.h 2010-04-09 18:06:28 UTC (rev 233)
+++ trunk/src/SlideBible/sbList.h 2010-04-19 20:23:37 UTC (rev 234)
@@ -128,7 +128,7 @@
std::vector<sbControl*> controls;
- const sbRect *rect;
+ sbRect rect;
public:
int controlSelected;
Modified: trunk/src/SlideBible/sbTheme.cpp
===================================================================
--- trunk/src/SlideBible/sbTheme.cpp 2010-04-09 18:06:28 UTC (rev 233)
+++ trunk/src/SlideBible/sbTheme.cpp 2010-04-19 20:23:37 UTC (rev 234)
@@ -28,20 +28,18 @@
//const sbRect * screenRect = &Core->Surface(sbCore::SURFACE::TYPE_WHOLE)->rect;
size = min(Core->getRect().height(), Core->getRect().width());
- ItemTextColor = sbColor(xml.getChildNodeByPath("List/Item/Text" ).getAttribute("color","141414FF"));
- ItemSubTextColor = sbColor(xml.getChildNodeByPath("List/Item/SubText").getAttribute("color","AAAAAAFF"));
- ControlsColor = sbColor(xml.getChildNodeByPath("Panel/Text" ).getAttribute("color","F4F4F4FF"));
- ItemMenuTextColor = sbColor(xml.getChildNodeByPath("Menu/Text" ).getAttribute("color","E0E0E0FF"));
+ ItemSubTextColor = sbColor(xml.getChildNodeByPath("List/Item/SubText").getAttribute("color","909090FF"));
+ ItemMenuTextColor = sbColor(xml.getChildNodeByPath("Menu/Text" ).getAttribute("color","FFFFFFFF"));
SelectionFrameColor = sbColor(xml.getChildNodeByPath("Selection" ).getAttribute("color","FFE020FF"));
- FadingColor = sbColor(xml.getChildNodeByPath("Background/Fade" ).getAttribute("color","00000050"));
+ FadingColor = sbColor(xml.getChildNodeByPath("Background/Fade" ).getAttribute("color","00000060"));
itemMargins.top = size*atof(xml.getChildNodeByPath("List/Item/Margins").getAttribute("top", "0.01"));
itemMargins.left = size*atof(xml.getChildNodeByPath("List/Item/Margins").getAttribute("left", "0.1"));
itemMargins.bottom = size*atof(xml.getChildNodeByPath("List/Item/Margins").getAttribute("bottom","0.02"));
itemMargins.right = size*atof(xml.getChildNodeByPath("List/Item/Margins").getAttribute("right", "0.08"));
- ListSeparatorHeight = size*atof(xml.getChildNodeByPath("List/Separator").getAttribute("height","0.01"));
- BannerBorderSize = size*atof(xml.getChildNodeByPath("List/Banner" ).getAttribute("border","0.04"));
+ ListSeparatorHeight = size*atof(xml.getChildNodeByPath("List/Separator").getAttribute("height","0.008"));
+ BannerBorderSize = size*atof(xml.getChildNodeByPath("List/Banner" ).getAttribute("border","0.03"));
PanelSize = size*atof(xml.getChildNodeByPath("Panel" ).getAttribute("size","0.15"));
SelectionFrameWidth = size*atof(xml.getChildNodeByPath("Selection" ).getAttribute("width","0.012"));
@@ -50,32 +48,35 @@
XMLNode e;
if (i == ELEMENT::ITEM)
- e = xml.getChildNodeByPath("List/Item/e", "<e><s c=\"FFFFFF00\"/></e>");
+ e = xml.getChildNodeByPath("List/Item/e", "<e textColor=\"505050FF\"><s c=\"FFFFFF00\"/></e>");
+ else if (i == ELEMENT::ITEM_SEPARATOR)
+ e = xml.getChildNodeByPath("List/ItemSeparator/e", "<e textColor=\"FFFFFFFF\" gradient=\"1\" vertical=\"1\"><s c=\"66808AFF\"/><s c=\"90B0B8FF\"/></e>");
else if (i == ELEMENT::ITEM_HIGHLIGHTED)
- e = xml.getChildNodeByPath("List/ItemHighlighted/e","<e gradient=\"1\" vertical=\"1\"><s c=\"FF55AA30\"/><s c=\"FF55AA60\"/><s c=\"FF55AA30\"/></e>");
+ e = xml.getChildNodeByPath("List/ItemHighlighted/e","<e textColor=\"141414FF\" gradient=\"1\" vertical=\"1\"><s c=\"FF55AA00\"/><s c=\"FF55AA60\"/><s c=\"FF55AA00\"/></e>");
else if (i == ELEMENT::ITEM_PRESSED)
- e = xml.getChildNodeByPath("List/ItemHover/e", "<e gradient=\"1\" vertical=\"1\"><s c=\"FFFF0030\"/><s c=\"FFFF0060\"/><s c=\"FFFF0030\"/></e>");
+ e = xml.getChildNodeByPath("List/ItemHover/e", "<e textColor=\"141414FF\" gradient=\"1\" vertical=\"1\"><s c=\"FFFF0000\"/><s c=\"FFFF0060\"/><s c=\"FFFF0000\"/></e>");
else if (i == ELEMENT::SEPARATOR)
- e = xml.getChildNodeByPath("List/Separator/e", "<e gradient=\"1\" vertical=\"0\"><s c=\"D8D8D880\"/><s c=\"FFFFFF80\"/><s c=\"D8D8D880\"/></e>");
+ e = xml.getChildNodeByPath("List/Separator/e", "<e textColor=\"FFFFFFFF\" gradient=\"1\" vertical=\"0\"><s c=\"FFFFFF00\"/><s c=\"E0E0E080\"/><s c=\"FFFFFF00\"/></e>");
else if (i == ELEMENT::BACKGROUND)
- e = xml.getChildNodeByPath("Background/e", "<e gradient=\"1\" vertical=\"1\"><s c=\"CFCFCFFF\"/><s c=\"FFFFFFFF\"/></e>");
+ e = xml.getChildNodeByPath("Background/e", "<e textColor=\"141414FF\"><s c=\"F8F8F8FF\"/></e>");
else if (i == ELEMENT::MENU)
- e = xml.getChildNodeByPath("Menu/Button/e", "<e gradient=\"1\" vertical=\"1\"><s c=\"D0D0D0FF\"/><s c=\"969696FF\"/></e>");
+ e = xml.getChildNodeByPath("Menu/Button/e", "<e textColor=\"FFFFFFFF\" gradient=\"1\" vertical=\"1\"><s c=\"A0C0D0FF\"/><s c=\"9098A0FF\"/></e>");
else if (i == ELEMENT::MENU_PRESSED)
- e = xml.getChildNodeByPath("Menu/ButtonPressed/e", "<e gradient=\"1\" vertical=\"1\"><s c=\"CBDADDFF\"/><s c=\"FFFFFFFF\"/></e>");
+ e = xml.getChildNodeByPath("Menu/ButtonPressed/e", "<e textColor=\"141414FF\" gradient=\"1\" vertical=\"1\"><s c=\"CBDADDFF\"/><s c=\"FFFFFFFF\"/></e>");
else if (i == ELEMENT::PANEL)
- e = xml.getChildNodeByPath("Panel/e", "<e gradient=\"1\" vertical=\"1\"><s c=\"A9A9A9FF\"/><s c=\"A9A9A9FF\" p=\"16\"/><s c=\"D0D0D0FF\" p=\"50\"/><s c=\"969696FF\"/></e>");
+ e = xml.getChildNodeByPath("Panel/e", "<e textColor=\"F4F4F4FF\" gradient=\"1\" vertical=\"1\"><s c=\"808080FF\"/><s c=\"808080FF\" p=\"50\"/><s c=\"90B0B8FF\" p=\"50\"/><s c=\"36404AFF\"/></e>");
else if (i == ELEMENT::PANEL_PRESSED)
- e = xml.getChildNodeByPath("Panel/Pressed/e", "<e gradient=\"1\" vertical=\"1\"><s c=\"A9A9A9FF\"/><s c=\"A9A9A9FF\" p=\"16\"/><s c=\"969696FF\" p=\"50\"/><s c=\"D0D0D0FF\"/></e>");
+ e = xml.getChildNodeByPath("Panel/Pressed/e", "<e textColor=\"141414FF\" gradient=\"1\" vertical=\"1\"><s c=\"A9A9A9FF\"/><s c=\"A9A9A9FF\" p=\"16\"/><s c=\"969696FF\" p=\"50\"/><s c=\"D0D0D0FF\"/></e>");
else if (i == ELEMENT::TAPPED)
- e = xml.getChildNodeByPath("Mouse/LongPress/e", "<e><s c=\"FF6600FF\"/></e>");
+ e = xml.getChildNodeByPath("Mouse/LongPress/e", "<e textColor=\"141414FF\"><s c=\"FF6600FF\"/></e>");
else if (i == ELEMENT::BANNER)
- e = xml.getChildNodeByPath("List/Banner/e", "<e><s c=\"B6B6B6FF\"/></e>");
+ e = xml.getChildNodeByPath("List/Banner/e", "<e textColor=\"FFFFFFFF\" gradient=\"1\" vertical=\"1\"><s c=\"84909CFF\"/><s c=\"84909CFF\" p=\"600\"/><s c=\"B0D0D8FF\"/></e>");
else
sbAssert ( true );
if (e.getAttribute("gradient") != NULL && !strcmp(e.getAttribute("gradient"),"1")) elements[i].gradient = true; else elements[i].gradient = false;
if (e.getAttribute("vertical") != NULL && !strcmp(e.getAttribute("vertical"),"1")) elements[i].vertical = true; else elements[i].vertical = false;
+ if (e.getAttribute("textColor") != NULL) elements[i].textColor = sbColor (e.getAttribute("textColor","FF0000FF"));
for (int p = 0; p < e.nChildNode("s"); p++)
{
@@ -198,15 +199,17 @@
}
else
{
- newColor = elements[sbTheme::ELEMENT::BACKGROUND].fill[0].first;
+ newColor.red = color.red + (elements[sbTheme::ELEMENT::BACKGROUND].fill[0].first.red - color.red) * (255-color.alpha) / 255;
+ newColor.green = color.green + (elements[sbTheme::ELEMENT::BACKGROUND].fill[0].first.green - color.green) * (255-color.alpha) / 255;
+ newColor.blue = color.blue + (elements[sbTheme::ELEMENT::BACKGROUND].fill[0].first.blue - color.blue) * (255-color.alpha) / 255;
}
}
if (Core->fadeSurface)
{
- newColor.red = newColor.red + ((FadingColor.red - newColor.red) * FadingColor.alpha / 255);
- newColor.green = newColor.green + ((FadingColor.green - newColor.green) * FadingColor.alpha / 255);
- newColor.blue = newColor.blue + ((FadingColor.blue - newColor.blue) * FadingColor.alpha / 255);
+ newColor.red = FadingColor.red + ((newColor.red - FadingColor.red) * FadingColor.alpha / 255);
+ newColor.green = FadingColor.green + ((newColor.green - FadingColor.green) * FadingColor.alpha / 255);
+ newColor.blue = FadingColor.blue + ((newColor.blue - FadingColor.blue) * FadingColor.alpha / 255);
}
return newColor;
Modified: trunk/src/SlideBible/sbTheme.h
===================================================================
--- trunk/src/SlideBible/sbTheme.h 2010-04-09 18:06:28 UTC (rev 233)
+++ trunk/src/SlideBible/sbTheme.h 2010-04-19 20:23:37 UTC (rev 234)
@@ -29,8 +29,6 @@
void init ();
sbColor fadeColor ( const sbColor & color, int x, int y ) const;
- sbColor ItemTextColor;
- sbColor ControlsColor;
sbColor ItemSubTextColor;
sbColor ItemMenuTextColor;
sbColor SelectionFrameColor;
@@ -64,6 +62,7 @@
//ITEM_SELECTED,
ITEM_PRESSED,
ITEM_HIGHLIGHTED,
+ ITEM_SEPARATOR,
SEPARATOR,
BACKGROUND,
TAPPED,
@@ -79,12 +78,15 @@
std::vector<std::pair<sbColor,short>> fill; // short - gradients vertical/horizontal sparation in range 0-1000
- sbBitmap bitmap;
+ //sbBitmap bitmap;
- bool haveBitmap; // have bitmap
+ //bool haveBitmap; // have bitmap
+
bool vertical;
bool gradient;
bool stretch;
+
+ sbColor textColor;
};
ELEMENT elements [ELEMENT::COUNT];
Modified: trunk/src/SlideBible/todo.txt
===================================================================
--- trunk/src/SlideBible/todo.txt 2010-04-09 18:06:28 UTC (rev 233)
+++ trunk/src/SlideBible/todo.txt 2010-04-19 20:23:37 UTC (rev 234)
@@ -1,12 +1,4 @@
ALPHA
-+ make list scrolling more smooth
-+ make verse expantion without jerks
-+ text fade
-+ history view with dates
-+ module name in history
-+ render item
-+ interface description format, xml
-+ fopen in application dir for wince
+ render tasks
+ stretch mode - render performed on surface with custom size, then StretchBlt on screen
+ cache background on first render
@@ -18,6 +10,18 @@
+ control / list mode
+ method to smooth-delayed-scroll list
+ lists instead menus
++ combining unicode accents, like accute, should be in platform-dependent part [I don't know how it's fixed]
+- move to msvs 2010 express
++ fix sbList::rect
++ 2. Ïàðàëèïîìå\níîí\n4 in chapter title
++ text retriveing stopped on empty verses
++ close menus on fail-click
+ module features
+ words of Christ in red
+ strongs and morphs
+ headings
+ options dialog
+ testament persitence check
loading all locales takes too long
@@ -25,24 +29,35 @@
also look into xiphos dirent.cpp
maybe deploy packages for only language
warning war - clean build log from warnings
- combining unicode accents, like accute, should be in platform-dependent part
- 2. Ïàðàëèïîìå\níîí\n4 in chapter title
- bool sbList::showPlace
perfomance optimization
sbItem::LINE caching
+ can work only if background is solid
controls, pressed/released
volume +/- scroll half of screen, long press linvolve cinetic scroll with increasing speed, zoom-/+ scroll as mouse scroll
+ built-in theme
+ version tag in theme xml
+ export theme on start if not exist
+ in chapter selection dialog on book expanding , move book item up
+ make chapter selection dialog with large buttons and scrolling
+ menu on long tap will be small with only text, as in opera mini
+ contents
+ add | remove bookmark
+? add | edit annotation
+ internationalization
+ gettext support
+ scrollbar
+ count list height, if listStartConstructed and listEndConstructed
+ proper method to scroll list
-
BETA
to test
other locales, utf encoding
locale paths
- user theme creation
+ other language modules:
+ Hebrew
+ Greek
-
-
1.1 RELEASE
search
clucence
@@ -55,16 +70,20 @@
cross-references, footnotes
will be shown in verse context menu, or by multitouch expand
daily devotionals
- genbooks - ?
- side scrolling - switches lists
- design improvements: like wp7 metro style
+ genbooks
+ dictionaries
+? side scrolling - switches lists
+ design improvements:
+ like wp7 metro style
+ remove Home Screen , start from last place
new place select dialog
three scrollers: book/chapter/verse
verse features
bookmarks
nested bookmarks folders
date created (for sorting)
- place in uri sword:
+ place in uri format (sword://Module/Key)
+ static / dynamic
@@ -72,9 +91,14 @@
icons and graphics
graphics theme uses large png file
remove built-in theme, application will not run if theme not found
+ module manager
+ unlock locked modules
+1.3 RELEASE
+ re-concept interface
+
FEATURE RELEASES
Link, like Opera Link to synchronize bookmarks and all Per Verse Data among all user devices
need Sword change that every verse in Bibile at every v11n has unique id
@@ -101,3 +125,13 @@
? sliding, animated backgrounds
? read html / txt / rtf / doc formats
+
+MODULE MAKING
+ Ðàäîñòíàÿ Âåñòü
+ Ïîâòîðèòü çàïðîñ â ÐÁÎ 15 àïðåëÿ 2011
+ Ëîïóõèí
+ Áàðêëè
+ Æåíåâñêàÿ
+
+OTHER WORK
+ Ðóñêîÿçû÷íûé ôîðóì î SWORD
Deleted: trunk/src/SlideBible/ui/ui.cdr
===================================================================
(Binary files differ)
More information about the sword-cvs
mailing list