]> code.citadel.org Git - citadel.git/commitdiff
Temporarily stuff
authorArt Cancro <ajc@citadel.org>
Sun, 25 Apr 1999 23:52:28 +0000 (23:52 +0000)
committerArt Cancro <ajc@citadel.org>
Sun, 25 Apr 1999 23:52:28 +0000 (23:52 +0000)
daphne/enter.cpp
daphne/includes.hpp
daphne/prefs.cpp
daphne/roomview.cpp
daphne/userlogin.cpp

index 00751e72bbbf5e830b88fee2b2ee50618e6b52d7..879a37e6f82eaa33b92ada3c70fc1dd5bfc2fccd 100644 (file)
@@ -61,7 +61,7 @@ EnterMessage::EnterMessage(
        wxStaticText *fromlabel = new wxStaticText(this, -1, "From: ");
 
        wxLayoutConstraints *c6 = new wxLayoutConstraints;
-       c6->top.SameAs(this, wxTop, 12);
+       c6->top.SameAs(this, wxTop, 10);
        c6->left.SameAs(this, wxLeft, 2);
        c6->width.AsIs();
        c6->height.AsIs();
@@ -74,22 +74,52 @@ EnterMessage::EnterMessage(
                wxDefaultPosition, wxSize(150,25), 1, posting_name_choices);
 
        wxLayoutConstraints *c7 = new wxLayoutConstraints;
-       c7->bottom.SameAs(fromlabel, wxBottom);
+       c7->centreY.SameAs(fromlabel, wxCentreY);
        c7->left.RightOf(fromlabel, 3);
        c7->width.AsIs();
        c7->height.AsIs();
        fromname->SetConstraints(c7);
 
+       wxStaticText *tolabel = new wxStaticText(this, -1, "To: ");
+
+       wxLayoutConstraints *c8 = new wxLayoutConstraints;
+       c8->centreY.SameAs(fromname, wxCentreY);
+       c8->left.RightOf(fromname, 5);
+       c8->width.AsIs();
+       c8->height.AsIs();
+       tolabel->SetConstraints(c8);
+
+       toname = new wxTextCtrl(this, -1, "",
+               wxDefaultPosition, wxSize(150,25));
+       
+       wxLayoutConstraints *c9 = new wxLayoutConstraints;
+       c9->centreY.SameAs(tolabel, wxCentreY);
+       c9->left.RightOf(tolabel, 3);
+       c9->width.AsIs();
+       c9->height.AsIs();
+       toname->SetConstraints(c9);
+
+       wxButton *findrecp = new wxButton(this, -1, " Find ");
+
+       wxLayoutConstraints *d1 = new wxLayoutConstraints;
+       d1->centreY.SameAs(toname, wxCentreY);
+       d1->left.RightOf(toname, 3);
+       d1->width.AsIs();
+       d1->height.AsIs();
+       findrecp->SetConstraints(d1);
+
+
+
        TheMessage = new wxTextCtrl(this, -1, "",
                wxDefaultPosition, wxDefaultSize,
                wxTE_MULTILINE);
 
-       wxLayoutConstraints *c9 = new wxLayoutConstraints;
-       c9->top.SameAs(fromlabel, wxBottom, 2);
-       c9->bottom.Above(cancel_button, -5);
-       c9->left.SameAs(this, wxLeft, 2);
-       c9->right.SameAs(this, wxRight, 2);
-       TheMessage->SetConstraints(c9);
+       wxLayoutConstraints *d9 = new wxLayoutConstraints;
+       d9->top.Below(fromname, 2);
+       d9->bottom.Above(cancel_button, -5);
+       d9->left.SameAs(this, wxLeft, 2);
+       d9->right.SameAs(this, wxRight, 2);
+       TheMessage->SetConstraints(d9);
 
        SetAutoLayout(TRUE);
        Show(TRUE);
@@ -106,10 +136,19 @@ void EnterMessage::OnCancel(wxCommandEvent& whichbutton) {
 void EnterMessage::OnSave(wxCommandEvent& whichbutton) {
        wxString sendcmd, recvcmd, xferbuf;
 
-       sendcmd = "ENT0 1";
+       sendcmd = "ENT0 1|" + toname->GetValue();
        xferbuf = TheMessage->GetValue();
        if (citsock->serv_trans(sendcmd, recvcmd,
                                xferbuf, ThisRoom) == 4) {
                delete this;
+       } else {
+               // Display the error message
+                wxMessageDialog save_error(this,
+                        recvcmd.Mid(4),
+                        "Error",
+                        wxOK | wxCENTRE | wxICON_INFORMATION,
+                        wxDefaultPosition);
+                        save_error.ShowModal();
+
        }
 }
index 02fc9caf7b8f6ff463d894bb5fb0fce6744bc5e4..b3c1c75d27c83d3ff1be0f3b75062ca1b5f3fedb 100644 (file)
@@ -263,6 +263,7 @@ private:
        wxMDIParentFrame *citMyMDI;
        wxString ThisRoom;
        wxChoice *fromname;
+       wxTextCtrl *toname;
        wxTextCtrl *TheMessage;
        DECLARE_EVENT_TABLE()
 };
index 8cbbb69592e4b3127d1fb3c957980aad08320f03..f1e60ad76430fdfd3bc349ce807c23413ea68af6 100644 (file)
@@ -3,7 +3,7 @@
 // =========================================================================
 
 #include "includes.hpp"
-#include <wx/tab.h>
+#include <wx/notebook.h>
 
 // ----------------------------------------------------------------------------
 // constants
@@ -82,7 +82,7 @@ Preferences::Preferences(     CitClient *sock,
                );
 
        wxLayoutConstraints *c1 = new wxLayoutConstraints;
-       c1->bottom.SameAs(this, wxBottom, 10);
+       c1->bottom.SameAs(this, wxBottom, 5);
        c1->left.SameAs(this, wxLeft, 10);
        c1->height.AsIs(); c1->width.AsIs();
        save_button->SetConstraints(c1);
@@ -93,43 +93,63 @@ Preferences::Preferences(   CitClient *sock,
        c3->height.AsIs(); c3->width.AsIs();
        cancel_button->SetConstraints(c3);
 
+       wxNotebook *MyNotebook = new wxNotebook(this, -1);
+
+       wxLayoutConstraints *n1 = new wxLayoutConstraints;
+       n1->top.SameAs(this, wxTop, 50); // FIX we're here
+       n1->left.SameAs(this, wxLeft);
+       n1->right.SameAs(this, wxRight);
+       n1->bottom.Above(cancel_button, -3);
+       MyNotebook->SetConstraints(n1);
+
+       wxPanel *HostPanel = new wxPanel(this);
+
+       wxLayoutConstraints *n2 = new wxLayoutConstraints;
+       n2->width.PercentOf(MyNotebook, wxWidth, 50);
+       n2->height.PercentOf(MyNotebook, wxHeight, 50);
+       n2->centreX.SameAs(MyNotebook, wxCentreX);
+       n2->centreY.SameAs(MyNotebook, wxCentreY);
+       HostPanel->SetConstraints(n2);
+
+       MyNotebook->AddPage(HostPanel, "Citadel server");
+
        wxStaticText *server_host_label = new wxStaticText(
-               this, -1, "Server host");
+               HostPanel, -1, "Server host");
 
-       server_host = new wxTextCtrl(this, -1);
+       server_host = new wxTextCtrl(HostPanel, -1);
        
        wxStaticText *server_port_label = new wxStaticText(
-               this, -1, "Server port");
+               HostPanel, -1, "Server port");
        
-       server_port = new wxTextCtrl(this, -1);
+       server_port = new wxTextCtrl(HostPanel, -1);
 
        wxLayoutConstraints *c4 = new wxLayoutConstraints;
-       c4->top.SameAs(this, wxTop, 10);
-       c4->left.SameAs(this, wxLeft, 10);
+       c4->top.SameAs(HostPanel, wxTop, 10);
+       c4->left.SameAs(HostPanel, wxLeft, 10);
        c4->height.AsIs(); c4->width.AsIs();
        server_host_label->SetConstraints(c4);
 
        wxLayoutConstraints *c5 = new wxLayoutConstraints;
        c5->centreY.SameAs(server_host_label, wxCentreY);
        c5->left.RightOf(server_host_label, 10);
-       c5->right.SameAs(this, wxRight, 10);
+       c5->right.SameAs(HostPanel, wxRight, 10);
        c5->height.AsIs();
        server_host->SetConstraints(c5);
 
        wxLayoutConstraints *c6 = new wxLayoutConstraints;
        c6->top.Below(server_host_label, 15);
-       c6->left.SameAs(this, wxLeft, 10);
+       c6->left.SameAs(HostPanel, wxLeft, 10);
        c6->height.AsIs(); c6->width.AsIs();
        server_port_label->SetConstraints(c6);
 
        wxLayoutConstraints *c7 = new wxLayoutConstraints;
        c7->centreY.SameAs(server_port_label, wxCentreY);
        c7->left.SameAs(server_host, wxLeft);
-       c7->right.PercentOf(this, wxWidth, 50);
+       c7->right.PercentOf(HostPanel, wxWidth, 50);
        c7->height.AsIs();
        server_port->SetConstraints(c7);
 
-       server_autoconnect = new wxCheckBox(this, -1,
+       server_autoconnect = new wxCheckBox(HostPanel, -1,
                "Automatically connect at startup");
 
        wxLayoutConstraints *c8 = new wxLayoutConstraints;
@@ -138,6 +158,13 @@ Preferences::Preferences(  CitClient *sock,
        c8->width.AsIs(); c8->height.AsIs();
        server_autoconnect->SetConstraints(c8);
 
+
+
+
+
+
+
+
        ini->Read("/Citadel Server/Host", &buf, DEFAULT_HOST);
        server_host->SetValue(buf);
 
index 680153a8c1c7c1a0588def289d45b618595465a5..6ae41ca09fd63d79e93448ecbb9e121f8688384f 100644 (file)
@@ -152,7 +152,6 @@ RoomView::RoomView(
         Layout();
        wxYield();
        do_readloop("MSGS NEW");        // FIX make this configurable
-
 }
 
 
@@ -206,7 +205,7 @@ void RoomView::do_readloop(wxString readcmd) {
 
 
        // Read the messages into the window, one at a time
-       allmsgs = "<HTML><BODY><CENTER><H1>List of Messages</H1></CENTER><HR>";
+       allmsgs = "<HTML><BODY>";
        i = 0;
        while (pos = xferbuf.Find('\n', FALSE), (pos >= 0)) {
 
@@ -220,7 +219,7 @@ void RoomView::do_readloop(wxString readcmd) {
                sendcmd = "MSG0 " + buf;
                message = new CitMessage(citsock, sendcmd, ThisRoom);
 
-               allmsgs += "&nbsp;&nbsp;&nbsp;<em><font size=+1>";
+               allmsgs += "&nbsp;&nbsp;&nbsp;<H3>";
                allmsgs += asctime(localtime(&message->timestamp));
                allmsgs += " from " + message->author;
                if (message->room.CmpNoCase(ThisRoom))
@@ -229,7 +228,7 @@ void RoomView::do_readloop(wxString readcmd) {
                        allmsgs += " @ " + message->nodename;
                if (message->recipient.Length() > 0)
                        allmsgs += " to " + message->recipient;
-               allmsgs += "</font></em><br>";
+               allmsgs += "</h3><br>";
                allmsgs += message->msgtext;
 
                delete message;
index e3a89600c8da6b3a31f3256688db568f0834875f..ca424068df295e4ab5d8873111095888561f517c 100644 (file)
@@ -222,6 +222,8 @@ UserLogin::UserLogin(CitClient *sock, wxMDIParentFrame *MyMDI)
                        + buf + "</CENTER></BODY></HTML>\n";
                hello->SetPage(buf);
        }
+
+       username->SetFocus();
 }