]> code.citadel.org Git - citadel.git/commitdiff
Got a basic "send express message" dialog working.
authorArt Cancro <ajc@citadel.org>
Sat, 13 Mar 1999 02:21:18 +0000 (02:21 +0000)
committerArt Cancro <ajc@citadel.org>
Sat, 13 Mar 1999 02:21:18 +0000 (02:21 +0000)
daphne/includes.hpp
daphne/send_express.cpp
daphne/utils.h

index 84a2d1da8220afb8e20f7a64965c91514337b3c7..270fe58922a8c681a91659beca9d645ce72cdb4c 100644 (file)
@@ -105,6 +105,8 @@ private:
        void OnButtonPressed(wxCommandEvent& whichbutton);
        CitClient *citsock;
        wxMDIParentFrame *citMyMDI;
+       wxListBox *ToWhom;
+       wxTextCtrl *TheMessage;
        DECLARE_EVENT_TABLE()
 };
 
index a26b7ce9f1de8b5a0e908660e9696d2e4da10d7d..ebf4e86588f770ddd353dc895ca2c71e71d50886 100644 (file)
@@ -90,12 +90,12 @@ SendExpress::SendExpress(   CitClient *sock,
                "ToWhomFrame"
                );
 
-       wxListBox *ToWhom = new wxListBox(
+       ToWhom = new wxListBox(
                this,
                -1,
                wxDefaultPosition, wxDefaultSize,
                0, NULL,
-               wxLB_MULTIPLE | wxLB_SORT,
+               wxLB_SORT,
                wxDefaultValidator,
                "ToWhom"
                );
@@ -108,7 +108,7 @@ SendExpress::SendExpress(   CitClient *sock,
                "TheMessageFrame"
                );
 
-       wxTextCtrl *TheMessage = new wxTextCtrl(
+       TheMessage = new wxTextCtrl(
                this,
                -1,
                "",
@@ -175,9 +175,20 @@ SendExpress::SendExpress(  CitClient *sock,
 
 
 void SendExpress::OnButtonPressed(wxCommandEvent& whichbutton) {
+       wxString target_user, sendcmd, recvcmd;
+       wxStringList msg;
+
        if (whichbutton.GetId() == BUTTON_CANCEL) {
                delete this;
        } else if (whichbutton.GetId() == BUTTON_SEND) {
-               // FIX ... perform the server command!
+               target_user = ToWhom->GetStringSelection();
+               MultilineToList(msg, TheMessage->GetValue());
+               sendcmd = "SEXP " + target_user + "|-" ;
+               if (citsock->serv_trans(sendcmd, recvcmd, msg) != 4) {
+                       wxMessageBox(recvcmd.Mid(4, 32767),
+                                       "Error",
+                                       wxOK | wxICON_EXCLAMATION,
+                                       NULL, -1, -1);
+               }
        }
 }
index ad3608189143ca780c4d917e4bc9aa3a1d6a9560..2b613da118d7f88fd830799527bd23fff6df4a27 100644 (file)
@@ -1,2 +1,3 @@
 void ListToMultiline(wxString& outputbuf, wxStringList inputlist);
+void MultilineToList(wxStringList& outputlist, wxString inputbuf);
 void extract(wxString& outputbuf, wxString inputbuf, int parmnum);