- if (tb != NULL)
- {
- // Create buttons
-
- wxBitmap tool1(tool1_xpm);
- wxBitmap tool2(tool2_xpm);
- wxBitmap tool3(tool3_xpm);
-
- tb->AddTool(ID_TBLEFT, _("Prev char"), tool1, _("Go to prev char"), wxITEM_NORMAL);
- tb->AddTool(ID_TBRIGHT, _("Next char"), tool2, _("Go to next char"), wxITEM_NORMAL);
- tb->AddTool(ID_TBCHARWIN, _("Char Wnd"), tool3, _("Toggle char window"), wxITEM_CHECK);
- tb->Realize();
- }
-
- // Create a menu bar for the frame
- menuBar = new wxMenuBar;
- wxMenu * menu1 = new wxMenu;
- menu1->Append(IDM_NEW, _("&New\tCtrl+N"), _("Create a new font."));
- menu1->Append(IDM_OPEN, _("&Open...\tCtrl+O"), _("Opens an existing font."));
- menu1->Append(IDM_SAVE, _("&Save\tCtrl+S"), _("Save the current font."));
- menu1->Append(IDM_SAVEAS, _("Save &As..."), _("Save the current font under a different name."));
- menu1->AppendSeparator();
- menu1->Append(IDM_EXIT, _("E&xit\tAlt+X"), _("Quits the TTEdit program."));
- menuBar->Append(menu1, _("&File"));
- wxMenu * menu2 = new wxMenu;
- menu2->Append(IDM_HELPTOPICS, _("&Help Topics"), _("Displays the Help contents and index."));
- menu2->AppendSeparator();
- menu2->Append(IDM_ABOUT, _("&About TTEdit"), _("Displays information about TTEdit."));
- menuBar->Append(menu2, _("&Help"));
- SetMenuBar(menuBar);
-
- // Create child subwindows
- mainWindow = new TTEditWindow(this);
-
- Centre(wxBOTH); // Centre frame on the screen
- Show(true); // Show the frame
-}
-
-TTEditFrame::~TTEditFrame()
-{
-}
-
-void TTEditFrame::OnOpen(wxCommandEvent &e)
-{
- wxFileDialog fd(this, _("Choose a font to load"), _(""), _(""), _("TTF files (*.ttf)|*.ttf|All files (*.*)|*.*"), wxOPEN);
-
- if (fd.ShowModal() != wxID_OK)
- return;
-
-// Hmm. The font object is causing a massive crash... (gdb says it's in "Load")
- if (app.font.Load((char *)fd.GetPath().c_str()) != true)
- {
- wxMessageDialog dlg(NULL, _("Load font failed!"), _("Houston, we have a problem..."), wxOK | wxICON_ERROR);
- dlg.ShowModal();
- }
-
-//Huzzah! It works! Now just need scaling, scrolling, etc...
-// pts = app.font.GetGlyphPoints(45);
-}
-
-void TTEditFrame::OnAbout(wxCommandEvent &e)
-{
- wxMessageDialog dlg(NULL, _("TrueType Edit v1.0.1\n\nA handy tool for editing TrueType fonts!\nby James \"Shamus\" Hammons\n(C) 2006 Underground Software"), _("About TrueType Edit"), wxOK | wxICON_INFORMATION);
- dlg.ShowModal();
-}
-
-void TTEditFrame::OnExit(wxCommandEvent &e)
-{
- app.toolPalette->Destroy();
- this->Destroy();
-}
-
-void TTEditFrame::OnCharWindow(wxCommandEvent &e)
-{
- app.charWin->Show(e.IsChecked() ? true : false);
-
- if (e.IsChecked())
- Raise();
-}
-
-void TTEditFrame::OnCloseWindow(wxCloseEvent &e)
-{
- app.toolPalette->Destroy();
- this->Destroy();