daphne: main.o citclient.o userlogin.o testwindow.o who.o \
- utils.o express_message.o send_express.o \
+ utils.o express_message.o send_express.o prefs.o \
roomtree.o roomview.o tcp_sockets.o message.o enter.o
c++ main.o citclient.o userlogin.o testwindow.o who.o \
- utils.o express_message.o send_express.o \
+ utils.o express_message.o send_express.o prefs.o \
roomtree.o roomview.o tcp_sockets.o message.o enter.o \
$(LFLAGS) -o daphne
};
+// Preferences for the application.
+
+class Preferences : public wxMDIChildFrame {
+public:
+ Preferences( CitClient *sock,
+ wxMDIParentFrame *MyMDI);
+private:
+ void OnButtonPressed(wxCommandEvent& whichbutton);
+ CitClient *citsock;
+ wxMDIParentFrame *citMyMDI;
+ DECLARE_EVENT_TABLE()
+};
+
+
// Just testing...
class TestWindow : public wxMDIChildFrame {
void OnConnect(wxCommandEvent& event);
void OnGotoMail(wxCommandEvent& event);
void OnTestWin(wxCommandEvent& event);
+ void OnEditMenu(wxCommandEvent& cmd);
void OnUsersMenu(wxCommandEvent& cmd);
void OnRoomsMenu(wxCommandEvent& cmd);
void MyFrame::OnSize(wxSizeEvent& event);
IG_Text,
MENU_CONNECT,
MENU_TESTWIN,
+ EMENU_PREFS,
UMENU_WHO,
UMENU_SEND_EXPRESS,
RMENU_GOTO,
EVT_MENU( IG_Quit, MyFrame::OnQuit)
EVT_MENU( IG_About, MyFrame::OnAbout)
EVT_MENU( MENU_CONNECT, MyFrame::OnConnect)
+ EVT_MENU( EMENU_PREFS, MyFrame::OnEditMenu)
EVT_MENU( GOTO_MAIL, MyFrame::OnGotoMail)
EVT_MENU( MENU_TESTWIN, MyFrame::OnTestWin)
EVT_MENU( UMENU_WHO, MyFrame::OnUsersMenu)
: wxMDIParentFrame(
(wxMDIParentFrame *)NULL,
-1,
- title, pos, size, wxDEFAULT_FRAME_STYLE
+ title, pos, size, wxDEFAULT_FRAME_STYLE | wxTAB_TRAVERSAL
) {
TheWholist = NULL;
menuFile->Append(IG_Quit, "E&xit");
wxMenu *menuEdit = new wxMenu;
+ menuEdit->Append(EMENU_PREFS, "&Preferences...");
wxMenu *menuUsers = new wxMenu;
menuUsers->Append(UMENU_WHO, "&Who is online?");
cleanup(0);
}
+
+// Edit menu handler
+void MyFrame::OnEditMenu(wxCommandEvent& cmd) {
+ int id;
+ id = cmd.GetId();
+ if (id == EMENU_PREFS) {
+ new Preferences(citadel, this);
+ }
+}
+
+
+
// User menu handler
void MyFrame::OnUsersMenu(wxCommandEvent& cmd) {
int id;