}
-void DrawMessageSummarySelector(StrBuf *BBViewToolBar, long maxmsgs, long startmsg)
+void DrawMessageDropdown(StrBuf *Selector, long maxmsgs, long startmsg)
{
+ StrBuf *TmpBuf;
struct wcsession *WCC = WC;
message_summary* Msg;
int lo, hi, n;
int nItems;
HashPos *At;
long vector[16];
- StrBuf *Selector = NewStrBuf();
+ int nMessages = DEFAULT_MAXMSGS;
- At = GetNewHashPos(WCC->summ, (lbstr("SortOrder") == 1)? -maxmsgs : maxmsgs);
+ TmpBuf = NewStrBuf();
+ At = GetNewHashPos(WCC->summ, (lbstr("SortOrder") == 1)? -nMessages : nMessages);
nItems = GetCount(WCC->summ);
vector[0] = 7;
while (!done) {
lo = GetHashPosCounter(At);
- if (lo + maxmsgs > nItems) {
+ if (lo + nMessages > nItems) {
hi = nItems;
}
else {
- hi = lo + maxmsgs;
+ hi = lo + nMessages;
}
done = !GetNextHashPos(WCC->summ, At, &hklen, &key, &vMsg);
Msg = (message_summary*) vMsg;
vector[4] = lo;
vector[5] = hi;
vector[6] = n;
- FlushStrBuf(BBViewToolBar); /** abuse our target buffer to contstruct one item in it */
- DoTemplate(HKEY("select_messageindex"), BBViewToolBar, &vector, CTX_LONGVECTOR);
- StrBufAppendBuf(Selector, BBViewToolBar, 0);
+ FlushStrBuf(TmpBuf);
+ DoTemplate(HKEY("select_messageindex"), TmpBuf, &vector, CTX_LONGVECTOR);
+ StrBufAppendBuf(Selector, TmpBuf, 0);
i++;
}
vector[6] = StartMsg;
- FlushStrBuf(BBViewToolBar);
- DoTemplate(HKEY("select_messageindex_all"), BBViewToolBar, &vector, CTX_LONGVECTOR);
- StrBufAppendBuf(Selector, BBViewToolBar, 0);
-
- FlushStrBuf(BBViewToolBar);
- DoTemplate(HKEY("msg_listselector"), BBViewToolBar, Selector, CTX_STRBUF);
- FreeStrBuf(&Selector);
+ FlushStrBuf(TmpBuf);
+ DoTemplate(HKEY("select_messageindex_all"), TmpBuf, &vector, CTX_LONGVECTOR);
+ StrBufAppendBuf(Selector, TmpBuf, 0);
+ FreeStrBuf(&TmpBuf);
DeleteHashPos(&At);
}
*/
void readloop(long oper)
{
+ StrBuf *MessageDropdown = NULL;
StrBuf *BBViewToolBar = NULL;
void *vMsg;
message_summary *Msg;
bbs_reverse = is_bbview && (lbstr("SortOrder") == 2);
- if (startmsg == 0L) {
+ if (is_bbview && (startmsg == 0L)) {
if (bbs_reverse) {
Msg = GetMessagePtrAt((nummsgs >= maxmsgs) ? (nummsgs - maxmsgs) : 0, WCC->summ);
startmsg = (Msg==NULL)? 0 : Msg->msgnum;
*/
if (is_bbview) {
BBViewToolBar = NewStrBuf();
- maxmsgs = 20; //// todo?
+ MessageDropdown = NewStrBuf();
- DrawMessageSummarySelector(BBViewToolBar, maxmsgs, startmsg);
+ DrawMessageDropdown(MessageDropdown, maxmsgs, startmsg);
+
+ DoTemplate(HKEY("msg_listselector_top"), BBViewToolBar, MessageDropdown, CTX_STRBUF);
StrBufAppendBuf(WCC->WBuf, BBViewToolBar, 0);
+ FlushStrBuf(BBViewToolBar);
}
at = GetNewHashPos(WCC->summ, 0);
*/
if (is_bbview) {
/** begin bbview scroller */
+
+ DoTemplate(HKEY("msg_listselector_bottom"), BBViewToolBar, MessageDropdown, CTX_STRBUF);
StrBufAppendBuf(WCC->WBuf, BBViewToolBar, 0);
+
+ FreeStrBuf(&BBViewToolBar);
+ FreeStrBuf(&MessageDropdown);
}
DONE:
+++ /dev/null
-<form name="msgomatictop" class="selector_top" >
-<p><?_("Reading #")>
-<select name="whichones" size="1"
- OnChange="location.href=msgomatictop.whichones.options[selectedIndex].value">
-<?CONTEXTSTR>
-</select>
-
-<input type="radio" name="direction" value=""
- OnChange="location.href='<?URLPART(1)>?SortBy=date&SortOrder=2'"
- <?%("COND:BSTR", 1, "SortOrder", 1, "checked", "")>
->
-<?_("oldest to newest")>
-
-
-
-<input type="radio" name="direction" value=""
- OnChange="location.href='<?URLPART(1)>?SortBy=date&SortOrder=1'"
- <?%("COND:BSTR", 1, "SortOrder", 1, "", "checked")>
->
-<?_("newest to oldest")>
-</p>
-</form>
-
--- /dev/null
+<form name="msgomaticbottom" class="selector_bottom" >
+<p><?_("Reading #")>
+<select name="whichones" size="1"
+ OnChange="location.href=msgomaticbottom.whichones.options[selectedIndex].value">
+<?CONTEXTSTR>
+</select>
+
+<input type="radio" name="direction" value=""
+ OnChange="location.href='<?URLPART(1)>?SortBy=date&SortOrder=2'"
+ <?%("COND:BSTR", 1, "SortOrder", 1, "checked", "")>
+>
+<?_("oldest to newest")>
+
+
+
+<input type="radio" name="direction" value=""
+ OnChange="location.href='<?URLPART(1)>?SortBy=date&SortOrder=1'"
+ <?%("COND:BSTR", 1, "SortOrder", 1, "", "checked")>
+>
+<?_("newest to oldest")>
+</p>
+</form>
+
--- /dev/null
+<form name="msgomatictop" class="selector_top" >
+<p><?_("Reading #")>
+<select name="whichones" size="1"
+ OnChange="location.href=msgomatictop.whichones.options[selectedIndex].value">
+<?CONTEXTSTR>
+</select>
+
+<input type="radio" name="direction" value=""
+ OnChange="location.href='<?URLPART(1)>?SortBy=date&SortOrder=2'"
+ <?%("COND:BSTR", 1, "SortOrder", 1, "checked", "")>
+>
+<?_("oldest to newest")>
+
+
+
+<input type="radio" name="direction" value=""
+ OnChange="location.href='<?URLPART(1)>?SortBy=date&SortOrder=1'"
+ <?%("COND:BSTR", 1, "SortOrder", 1, "", "checked")>
+>
+<?_("newest to oldest")>
+</p>
+</form>
+