void OnQuit(wxCommandEvent& event);
void OnAbout(wxCommandEvent& event);
void OnDoCmd(wxCommandEvent& event);
- void OnConnect(wxCommandEvent& event);
private:
+ void OnConnect(wxCommandEvent& event);
+ void OnTestWin(wxCommandEvent& event);
void OnUsersMenu(wxCommandEvent& cmd);
void OnWindowMenu(wxCommandEvent& cmd);
wxButton *do_cmd;
IG_About,
IG_Text,
MENU_CONNECT,
+ MENU_TESTWIN,
UMENU_WHO,
UMENU_SEND_EXPRESS,
WMENU_CASCADE,
EVT_MENU( IG_Quit, MyFrame::OnQuit)
EVT_MENU( IG_About, MyFrame::OnAbout)
EVT_MENU( MENU_CONNECT, MyFrame::OnConnect)
+ EVT_MENU( MENU_TESTWIN, MyFrame::OnTestWin)
EVT_MENU( UMENU_WHO, MyFrame::OnUsersMenu)
EVT_MENU( UMENU_SEND_EXPRESS, MyFrame::OnUsersMenu)
EVT_MENU( WMENU_CASCADE, MyFrame::OnWindowMenu)
wxMenu *menuFile = new wxMenu;
menuFile->Append(MENU_CONNECT, "&Connect");
+ menuFile->Append(MENU_TESTWIN, "Add &Test window");
menuFile->AppendSeparator();
menuFile->Append(IG_Quit, "E&xit");
DefaultPort = "citadel";
if (citadel->IsConnected()) {
- wxMessageBox("You are already connected to a Citadel server.",
- "Oops!");
+ wxMessageBox("You are currently connected to "
+ + citadel->HumanNode
+ + ". If you wish to connect to a different Citadel "
+ + "server, you must log out first.",
+ "Already connected");
} else {
retval = citadel->attach(DefaultHost, DefaultPort);
if (retval == 0) {
SetStatusText("Connected to " + citadel->HumanNode, 0);
- new TestWindow(citadel, this);
new UserLogin(citadel, this);
} else {
wxMessageBox("Could not connect to server.", "Error");
}
}
+void MyFrame::OnTestWin(wxCommandEvent& unused) {
+ new TestWindow(citadel, this);
+}
#include <wx/wx.h>
#include "includes.hpp"
+#include "bitmaps/root.xpm"
+#include "bitmaps/floor.xpm"
+#include "bitmaps/newroom.xpm"
+#include "bitmaps/oldroom.xpm"
+#include "bitmaps/mailroom.xpm"
+
wxTreeItemId floorboards[128];
+wxImageList *TreeIcons = NULL;
// The following two functions convert between the wxStringList class used for
// text transfers to and from the Citadel server, and the wxString class used
}
+void InitTreeIcons(void) {
+ TreeIcons = new wxImageList(16, 16);
+ cout << TreeIcons->Add(wxICON(root));
+ cout << TreeIcons->Add(wxICON(floor));
+ cout << TreeIcons->Add(wxICON(newroom));
+ cout << TreeIcons->Add(wxICON(oldroom));
+ cout << TreeIcons->Add(wxICON(mailroom));
+}
+
// Load a tree with a room list
//
wxStringList transbuf;
int i, floornum;
+ if (TreeIcons == NULL) InitTreeIcons();
+
// First, clear it out.
tree->DeleteAllItems();
+ tree->SetImageList(TreeIcons);
// Set the root with the name of the Citadel server.
tree->AddRoot(
citsock->HumanNode,
- -1, // FIX use an "earth" pixmap here
+ 0,
-1,
NULL);
floorboards[floornum] = tree->AppendItem(
tree->GetRootItem(),
floorname,
- -1, // FIX use a floor pixmap here
+ 1,
-1,
NULL);
}
tree->AppendItem(
floorboards[floornum],
roomname,
- -1, // FIX use a room pixmap here
+ 3,
-1,
NULL);
}