Mercurial > mercurial > hgweb_searcher03.cgi
view src/about.cpp @ 22:92188f60323d default tip
Implement Masking function on Preview Dialog.
author | pyon@macmini |
---|---|
date | Sat, 04 Apr 2015 17:23:46 +0900 |
parents | a2ad87cad48b |
children |
line wrap: on
line source
// Filename : about.cpp // Last Change: 15-Dec-2014. // #include "common.h" #include "about.h" AboutDialog::AboutDialog( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) { this->SetSizeHints( wxDefaultSize, wxDefaultSize ); wxBoxSizer* bSizer = new wxBoxSizer( wxVERTICAL ); wxBoxSizer* bSizerOK = new wxBoxSizer( wxHORIZONTAL ); wxString iamge = wxGetCwd() + wxFILE_SEP_PATH + wxT("image") + wxFILE_SEP_PATH + wxT("takashi.png"); wxBitmap bmp = wxBitmap( iamge, wxBITMAP_TYPE_PNG ); m_bitmap = new wxStaticBitmap( this, wxID_ANY, bmp, wxDefaultPosition, wxDefaultSize, 0 ); bSizerOK->Add( m_bitmap, 0, wxALL, 5 ); m_staticTextDesc = new wxStaticText( this, wxID_ANY, wxT("我に自由を!\rLet me free !"), wxDefaultPosition, wxSize( -1, 50 ), 0 ); bSizerOK->Add( m_staticTextDesc, 0, wxALL|wxALIGN_CENTRE, 5 ); m_buttonOK = new wxButton( this, wxID_OK, wxT("OK"), wxDefaultPosition, wxDefaultSize, 0 ); m_buttonOK->SetDefault(); bSizerOK->Add( m_buttonOK, 0, wxALL|wxALIGN_BOTTOM, 5 ); bSizer->Add( bSizerOK, 0, wxEXPAND, 5 ); wxString build; m_staticTextBuild = new wxStaticText( this, wxID_ANY, build.Format( wxT("Build with %s\n") wxT("running under %s."), wxVERSION_STRING, wxGetOsDescription().c_str() ), wxDefaultPosition, wxDefaultSize, 0 ); bSizer->Add( m_staticTextBuild, 0, wxALL, 5 ); m_richText = new wxRichTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxVSCROLL|wxBORDER_NONE|wxWANTS_CHARS ); bSizer->Add( m_richText, 1, wxEXPAND|wxALL, 5 ); this->SetSizer( bSizer ); this->Layout(); this->Centre( wxBOTH ); LoadChangeLog(); } AboutDialog::~AboutDialog() { } void AboutDialog::LoadChangeLog( void ) { wxTextFile textfile; textfile.Open( wxGetCwd() + wxFILE_SEP_PATH + wxT("Changes") ); for ( int i = 0; i < textfile.GetLineCount(); i++ ) { if ( textfile[i].StartsWith( wxT("version")) ) { m_richText->BeginBold(); m_richText->BeginFontSize(16); m_richText->BeginTextColour( wxColour( 0, 200, 0 ) ); m_richText->WriteText( textfile[i] ); m_richText->EndTextColour(); m_richText->EndFontSize(); m_richText->EndBold(); } else if ( textfile[i].StartsWith( wxT("20")) ) { // year m_richText->WriteText( wxT("\t\t") ); m_richText->BeginItalic(); m_richText->WriteText( textfile[i] ); m_richText->EndItalic(); m_richText->Newline(); } else if ( textfile[i].StartsWith( wxT("----")) ) { m_richText->WriteText( textfile[i] ); m_richText->Newline(); } else if ( textfile[i].IsEmpty() ) { m_richText->Newline(); } else { m_richText->BeginSymbolBullet( '*', 60, 0, wxTEXT_ATTR_BULLET_STYLE_SYMBOL ); m_richText->WriteText( textfile[i] ); m_richText->EndSymbolBullet(); m_richText->Newline(); } } textfile.Close(); m_richText->SetEditable( false ); }