/*
 * wxBC.cpp
 * written by Brian Derr
 * 2003/02/17
 *
 * definitions of wxGTK GUI for braincurses game
 */

#include "wxBC.h"

BEGIN_EVENT_TABLE( bcFrame, wxFrame )
    EVT_MENU( ID_Quit,  bcFrame::OnQuit )
    EVT_MENU( ID_About, bcFrame::OnAbout )
END_EVENT_TABLE()

IMPLEMENT_APP( braincurses );

bool braincurses::OnInit()
{
    bcFrame *frame = new bcFrame( "BrainCurses", wxPoint(50,50),
                                   wxSize(550,600));
    frame->Show( TRUE );
    SetTopWindow( frame );
    return TRUE;
}

bcFrame::bcFrame(const wxString &title, const wxPoint &pos, const wxSize &size)
       : wxFrame((wxFrame *)NULL, -1, title, pos, size)
{

   wxMenu *menuAbout = new wxMenu;
   menuAbout->Append( ID_About, "&About...");
   
   wxMenu *menuFile = new wxMenu;
   menuFile->Append( ID_Quit, "E&xit" );

   wxMenuBar *menuBar = new wxMenuBar;
   menuBar->Append( menuFile, "&File" );
   menuBar->Append( menuAbout, "&About" );

   SetMenuBar( menuBar );

   CreateStatusBar();
   SetStatusText( "Welcome to BrainCurses.  Good Luck!" );

   m_splitter = new bcSplitterWindow(this);
   m_left = new bcCanvas(m_splitter);
   m_left->SetBackgroundColour(*wxRED);
   m_left->SetScrollbars(20, 20, 50, 50);
   m_left->SetCursor(wxCursor(wxCURSOR_MAGNIFIER));

   m_right = new bcCanvas(m_splitter);
   m_right->SetBackgroundColour(*wxCYAN);
   m_right->SetScrollbars(20, 20, 50, 50);
}

void bcFrame::OnQuit( wxCommandEvent &WXUNUSED(event) )
{
    Close( TRUE );
}

void bcFrame::OnAbout( wxCommandEvent &WXUNUSED(event) )
{
    wxMessageBox( "BrainCurses.  Written by Brian Derr.",
                  "About BrainCurses", wxOK | wxICON_INFORMATION );
}
