///////////////////////////////////////////////////////////////////////////// // Name: blurbwin.cpp // tag: a window showing the current blurb // Author: David Roundy // Modified by: // Created: 9/2001 // Copyright: (c) 2001 David Roundy // Licence: GPL /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ ///////////////////////////////////////////////////////////////////////////// // For compilers that support precompilation, includes . #include #ifndef WX_PRECOMP #include #include #endif #include "blurbwin.h" #include "prefmacros.h" #include "debug.h" BEGIN_EVENT_TABLE(BlurbWin, wxFrame) EVT_CLOSE(BlurbWin::OnCloseWindow) END_EVENT_TABLE() wxPoint BlurbWin::defpos = wxDefaultPosition; BlurbWin::BlurbWin(wxWindow* parent, const wxString &player, const wxString &the_blurb) : wxFrame(parent, -1, "Blurb about " + player, defpos, wxSize(400, 250), wxDEFAULT_FRAME_STYLE) { m_blurb = new wxTextCtrl(this, -1, the_blurb, wxDefaultPosition, wxSize(150,150), wxTE_MULTILINE | wxTE_READONLY); wxStaticText *name_str = new wxStaticText(this, -1, player); wxStaticBitmap *playerpic_bitmap = new wxStaticBitmap(this, -1, GetPlayerBitmap(player)); wxLayoutConstraints *c; c = new wxLayoutConstraints; c->right.SameAs(this, wxRight, 5); c->left.RightOf(playerpic_bitmap, 5); c->bottom.Above(m_blurb, -15); c->height.AsIs(); name_str->SetConstraints(c); c = new wxLayoutConstraints; c->left.SameAs(this, wxLeft, 5); c->top.SameAs(this, wxTop, 5); c->width.AsIs(); c->height.AsIs(); playerpic_bitmap->SetConstraints(c); c = new wxLayoutConstraints; c->left.SameAs(this, wxLeft, 5); c->right.SameAs(this, wxRight, 5); c->top.Below(playerpic_bitmap, 5); c->height.AsIs(); m_blurb->SetConstraints(c); Layout(); SetAutoLayout( TRUE ); } BlurbWin::~BlurbWin() { defpos = GetPosition(); } void BlurbWin::OnCloseWindow(wxCloseEvent& event) { defpos = GetPosition(); this->Destroy(); }