1 // ============================================================================
3 // ============================================================================
5 #include "includes.hpp"
7 // ----------------------------------------------------------------------------
9 // ----------------------------------------------------------------------------
11 // ----------------------------------------------------------------------------
13 // ----------------------------------------------------------------------------
15 // IDs for the controls and the menu commands
22 // ----------------------------------------------------------------------------
23 // event tables and other macros for wxWindows
24 // ----------------------------------------------------------------------------
26 // the event tables connect the wxWindows events with the functions (event
27 // handlers) which process them. It can be also done at run-time, but for the
28 // simple menu events like this the static method is much simpler.
29 BEGIN_EVENT_TABLE( express_message, wxFrame)
30 EVT_BUTTON( BUTTON_OK, express_message::OnButtonPressed)
31 EVT_BUTTON( BUTTON_REPLY, express_message::OnButtonPressed)
34 // ============================================================================
36 // ============================================================================
39 // ----------------------------------------------------------------------------
40 // the application class
41 // ----------------------------------------------------------------------------
44 express_message::express_message(
55 wxDEFAULT_FRAME_STYLE | wxTAB_TRAVERSAL,
59 wxString more_informative_title;
65 /* SetIcon(wxICON(mondrian)); */
67 more_informative_title =
68 "Express message from " + sender + " @ " + sendsys + "..." ;
70 SetTitle(more_informative_title);
72 wxButton *ok_button = new wxButton(
83 wxButton *reply_button = new wxButton(
94 wxTextCtrl *msgbox = new wxTextCtrl(
100 wxTE_MULTILINE | wxTE_READONLY,
105 wxLayoutConstraints *c0 = new wxLayoutConstraints;
106 c0->bottom.SameAs(this, wxBottom, 10);
107 c0->left.SameAs(this, wxLeft, 10);
108 c0->height.AsIs(); c0->width.AsIs();
109 ok_button->SetConstraints(c0);
111 wxLayoutConstraints *c1 = new wxLayoutConstraints;
112 c1->bottom.SameAs(this, wxBottom, 10);
113 c1->right.SameAs(this, wxRight, 10);
114 c1->height.AsIs(); c1->width.AsIs();
115 reply_button->SetConstraints(c1);
117 wxLayoutConstraints *c2 = new wxLayoutConstraints;
118 c2->top.SameAs(this, wxTop, 10);
119 c2->left.SameAs(this, wxLeft, 10);
120 c2->right.SameAs(this, wxRight, 10);
121 c2->bottom.Above(ok_button, -10);
122 msgbox->SetConstraints(c2);
130 void express_message::OnButtonPressed(wxCommandEvent& whichbutton) {
131 if (whichbutton.GetId() == BUTTON_OK) {
134 if (whichbutton.GetId() == BUTTON_REPLY) {
135 new SendExpress(citsock, BigMDI, reply_to);