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();
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);
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();
+
}
}
// =========================================================================
#include "includes.hpp"
-#include <wx/tab.h>
+#include <wx/notebook.h>
// ----------------------------------------------------------------------------
// constants
);
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);
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;
c8->width.AsIs(); c8->height.AsIs();
server_autoconnect->SetConstraints(c8);
+
+
+
+
+
+
+
ini->Read("/Citadel Server/Host", &buf, DEFAULT_HOST);
server_host->SetValue(buf);
Layout();
wxYield();
do_readloop("MSGS NEW"); // FIX make this configurable
-
}
// 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)) {
sendcmd = "MSG0 " + buf;
message = new CitMessage(citsock, sendcmd, ThisRoom);
- allmsgs += " <em><font size=+1>";
+ allmsgs += " <H3>";
allmsgs += asctime(localtime(&message->timestamp));
allmsgs += " from " + message->author;
if (message->room.CmpNoCase(ThisRoom))
allmsgs += " @ " + message->nodename;
if (message->recipient.Length() > 0)
allmsgs += " to " + message->recipient;
- allmsgs += "</font></em><br>";
+ allmsgs += "</h3><br>";
allmsgs += message->msgtext;
delete message;