]> code.citadel.org Git - citadel.git/commitdiff
got a cool scrollbar thingi working
authorArt Cancro <ajc@citadel.org>
Mon, 5 Apr 1999 03:36:15 +0000 (03:36 +0000)
committerArt Cancro <ajc@citadel.org>
Mon, 5 Apr 1999 03:36:15 +0000 (03:36 +0000)
daphne/includes.hpp
daphne/roomview.cpp

index 809d0f364ba6b93151d277204ee11c13e4b78042..7e1d9a080334659a85090161a26b2e75472f5379 100644 (file)
@@ -222,6 +222,7 @@ private:
        wxHtmlWindow *message_window;
         wxPanel *banner;
         wxButton *close_button;
+       wxGauge *progress;
        wxString ThisRoom;
 };
 
index e340caabe7bbd2fd4bb3b3db0fb59329dfdf8e03..852cd562f4ab0e0ccc5d35ab85a050eeabf8d7b1 100644 (file)
@@ -97,11 +97,23 @@ RoomView::RoomView(
                wxDefaultPosition);
 
        wxLayoutConstraints *c3 = new wxLayoutConstraints;
-       c3->top.SameAs(close_button, wxTop);
+       c3->top.SameAs(readnew_button, wxTop);
        c3->bottom.SameAs(readnew_button, wxBottom);
        c3->width.AsIs();
        c3->right.LeftOf(readnew_button, 5);
        readall_button->SetConstraints(c3);
+
+
+       // Progress bar -- consumes *remainder* of space
+       progress = new wxGauge(this, -1, 1);
+
+       wxLayoutConstraints *c9 = new wxLayoutConstraints;
+       c9->top.SameAs(readall_button, wxTop);
+       c9->bottom.SameAs(readall_button, wxBottom);
+       c9->left.SameAs(this, wxLeft, 5);
+       c9->right.LeftOf(readall_button, 5);
+       progress->SetConstraints(c9);
+
 }
 
 
@@ -152,9 +164,11 @@ void RoomView::do_readloop(wxString readcmd) {
 
 
        // Read the messages into the window, one at a time
-       message_window->SetPage("<html><body>Loading...</body></html>");
+       progress->SetRange(xferbuf.Number());
        allmsgs = "<HTML><BODY><CENTER><H1>List of Messages</H1></CENTER><HR>";
         for (i=0; i<xferbuf.Number(); ++i) {
+               progress->SetValue(i);
+               progress->Refresh();
                 buf.Printf("%s", (wxString *)xferbuf.Nth(i)->GetData());
 
                sendcmd = "MSG0 " + buf;
@@ -174,6 +188,7 @@ void RoomView::do_readloop(wxString readcmd) {
 
                allmsgs += "<HR>";
         }
+       progress->SetValue(i);
        allmsgs += "</BODY></HTML>";
        message_window->SetPage(allmsgs);
 }