This commit was manufactured by cvs2svn to create tag 'WX_2_2_9'.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/tags/WX_2_2_9@13364 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Bryan Petty
2002-01-04 16:15:08 +00:00
parent dc3d889d0b
commit f7f6abe24d
2324 changed files with 375095 additions and 121526 deletions

View File

@@ -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];
@@ -104,7 +115,14 @@ bool MyApp::OnInit()
};
// there are very few systems right now which support locales other than "C"
m_locale.Init(language, langid, "C");
m_locale.Init(NULL, "de", "");
// m_locale.Init(language, langid, "C");
// note that under GTK starting from version 1.2.8 if
// you set locale to "C" and then use ASCII characters above
// #128 in GUI elements, they will be truncated (it seems GTK
// replaces them by \0). You should use either "" (checks
// the value of LC_ALL etc. environment variables) or the form
// accepted by glibc, e.g cs_CZ.
// Initialize the catalogs we'll be using
/* not needed any more, done in wxLocale ctor
@@ -197,3 +215,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);
}