added russian translations and an additional cmd line parameter to set the
encoding to use git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@8016 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -28,6 +28,7 @@
|
||||
#include "wx/intl.h"
|
||||
#include "wx/file.h"
|
||||
#include "wx/log.h"
|
||||
#include "wx/fontmap.h"
|
||||
|
||||
#if defined(__WXGTK__) || defined(__WXMOTIF__)
|
||||
#include "mondrian.xpm"
|
||||
@@ -49,12 +50,14 @@ class MyFrame: public wxFrame
|
||||
public:
|
||||
MyFrame(wxFrame *frame, const char *title, int x, int y, int w, int h);
|
||||
|
||||
public:
|
||||
protected:
|
||||
void OnQuit(wxCommandEvent& event);
|
||||
void OnAbout(wxCommandEvent& event);
|
||||
void OnPlay(wxCommandEvent& event);
|
||||
void OnOpen(wxCommandEvent& event);
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
|
||||
private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
@@ -73,6 +76,8 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
||||
EVT_MENU(MINIMAL_ABOUT, MyFrame::OnAbout)
|
||||
EVT_MENU(MINIMAL_TEST, MyFrame::OnPlay)
|
||||
EVT_MENU(MINIMAL_OPEN, MyFrame::OnOpen)
|
||||
|
||||
EVT_PAINT(MyFrame::OnPaint)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
IMPLEMENT_APP(MyApp)
|
||||
@@ -86,8 +91,14 @@ bool MyApp::OnInit()
|
||||
const char *langid = NULL;
|
||||
switch ( argc )
|
||||
{
|
||||
default:
|
||||
// ignore the other args, fall through
|
||||
case 4:
|
||||
{
|
||||
wxFontEncoding enc = wxTheFontMapper->CharsetToEncoding(argv[3]);
|
||||
if ( enc != wxFONTENCODING_SYSTEM )
|
||||
wxFont::SetDefaultEncoding(enc);
|
||||
}
|
||||
|
||||
// fall through
|
||||
|
||||
case 3:
|
||||
language = argv[1];
|
||||
@@ -203,3 +214,11 @@ void MyFrame::OnOpen(wxCommandEvent&)
|
||||
// got wxstd.mo somewhere in the search path
|
||||
wxFile file("NOTEXIST.ING");
|
||||
}
|
||||
|
||||
void MyFrame::OnPaint(wxPaintEvent&)
|
||||
{
|
||||
wxPaintDC dc(this);
|
||||
wxFont font(12, wxDEFAULT, wxNORMAL, wxNORMAL);
|
||||
dc.SetFont(font);
|
||||
dc.DrawText(_("International wxWindows App"), 10, 10);
|
||||
}
|
||||
|
Reference in New Issue
Block a user