Updated for Ukrainian i18n

This commit is contained in:
Gerald Schmidt 2007-08-29 22:48:08 +00:00
parent 8721e773aa
commit 5c11b2e63a
2 changed files with 545 additions and 542 deletions

View File

@ -1,428 +1,430 @@
#include <wx/bookctrl.h> #include <wx/bookctrl.h>
#include <wx/fontenum.h> #include <wx/fontenum.h>
#include "mypropertysheet.h" #include "mypropertysheet.h"
BEGIN_EVENT_TABLE(MyPropertySheet, wxPropertySheetDialog) BEGIN_EVENT_TABLE(MyPropertySheet, wxPropertySheetDialog)
EVT_BUTTON(wxID_OK, MyPropertySheet::OnOk) EVT_BUTTON(wxID_OK, MyPropertySheet::OnOk)
EVT_BUTTON( EVT_BUTTON(
APPLICATION_DIR_BROWSE, APPLICATION_DIR_BROWSE,
MyPropertySheet::OnApplicationDirBrowse) MyPropertySheet::OnApplicationDirBrowse)
EVT_BUTTON( EVT_BUTTON(
BROWSER_COMMAND_BROWSE, BROWSER_COMMAND_BROWSE,
MyPropertySheet::OnBrowserCommandBrowse) MyPropertySheet::OnBrowserCommandBrowse)
END_EVENT_TABLE() END_EVENT_TABLE()
MyPropertySheet::MyPropertySheet( MyPropertySheet::MyPropertySheet(
wxWindow *parent, wxWindow *parent,
XmlCtrlProperties& propertiesParameter, XmlCtrlProperties& propertiesParameter,
wxString& applicationDirParameter, wxString& applicationDirParameter,
wxString& browserCommandParameter, wxString& browserCommandParameter,
bool rememberOpenTabsParameter, bool rememberOpenTabsParameter,
bool libxmlNetAccessParameter, bool libxmlNetAccessParameter,
bool singleInstanceCheckParameter, bool singleInstanceCheckParameter,
bool saveBomParameter, bool saveBomParameter,
bool unlimitedUndoParameter, bool unlimitedUndoParameter,
bool restoreLayoutParameter, bool restoreLayoutParameter,
bool expandInternalEntitiesParameter, bool expandInternalEntitiesParameter,
bool showFullPathOnFrameParameter, bool showFullPathOnFrameParameter,
int lang, int lang,
#ifdef __WXMSW__ #ifdef __WXMSW__
bool useCoolBarParameter, bool useCoolBarParameter,
#endif #endif
wxWindowID id, wxWindowID id,
wxString title, wxString title,
const wxPoint& position, const wxPoint& position,
const wxSize& size, const wxSize& size,
long style) : wxPropertySheetDialog( long style) : wxPropertySheetDialog(
parent, id, title, position, size, style), parent, id, title, position, size, style),
properties(propertiesParameter), properties(propertiesParameter),
applicationDir(applicationDirParameter), applicationDir(applicationDirParameter),
browserCommand(browserCommandParameter) browserCommand(browserCommandParameter)
{ {
CreateButtons(wxOK | wxCANCEL); CreateButtons(wxOK | wxCANCEL);
// editor // editor
wxPanel *editorPanel = new wxPanel(GetBookCtrl()); wxPanel *editorPanel = new wxPanel(GetBookCtrl());
wxBoxSizer *editorSizer = new wxBoxSizer(wxVERTICAL); wxBoxSizer *editorSizer = new wxBoxSizer(wxVERTICAL);
wxBoxSizer *col1sizer = new wxBoxSizer(wxVERTICAL); wxBoxSizer *col1sizer = new wxBoxSizer(wxVERTICAL);
wxBoxSizer *col2sizer = new wxBoxSizer(wxVERTICAL); wxBoxSizer *col2sizer = new wxBoxSizer(wxVERTICAL);
wxBoxSizer *tablesizer = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer *tablesizer = new wxBoxSizer(wxHORIZONTAL);
wxStaticText *labelFont = new wxStaticText( wxStaticText *labelFont = new wxStaticText(
editorPanel, editorPanel,
wxID_ANY, wxID_ANY,
_("Font")); _("Font"));
fontBox = new wxChoice( fontBox = new wxChoice(
editorPanel, editorPanel,
wxID_ANY); wxID_ANY);
wxArrayString fontArray; wxArrayString fontArray;
fontArray = wxFontEnumerator::GetFacenames(); fontArray = wxFontEnumerator::GetFacenames();
fontArray.Sort(); fontArray.Sort();
for (size_t i = 0; i < fontArray.GetCount(); i++) for (size_t i = 0; i < fontArray.GetCount(); i++)
{ {
fontBox->Insert(fontArray.Item(i), i); fontBox->Insert(fontArray.Item(i), i);
} }
fontBox->SetStringSelection(properties.font); fontBox->SetStringSelection(properties.font);
deleteWholeTagBox = deleteWholeTagBox =
new wxCheckBox(editorPanel, wxID_ANY, _("I&ntelligent backspace/delete")); new wxCheckBox(editorPanel, wxID_ANY, _("I&ntelligent backspace/delete"));
deleteWholeTagBox->SetValue(properties.deleteWholeTag); deleteWholeTagBox->SetValue(properties.deleteWholeTag);
completionBox = completionBox =
new wxCheckBox(editorPanel, wxID_ANY, _("&Tag completion")); new wxCheckBox(editorPanel, wxID_ANY, _("&Tag completion"));
completionBox->SetValue(properties.completion); completionBox->SetValue(properties.completion);
foldBox = foldBox =
new wxCheckBox(editorPanel, wxID_ANY, _("&Folding")); new wxCheckBox(editorPanel, wxID_ANY, _("&Folding"));
foldBox->SetValue(properties.fold); foldBox->SetValue(properties.fold);
currentLineBox = currentLineBox =
new wxCheckBox(editorPanel, wxID_ANY, _("&Highlight current line")); new wxCheckBox(editorPanel, wxID_ANY, _("&Highlight current line"));
currentLineBox->SetValue(properties.currentLine); currentLineBox->SetValue(properties.currentLine);
indentLinesBox = indentLinesBox =
new wxCheckBox(editorPanel, wxID_ANY, _("&Indentation guides")); new wxCheckBox(editorPanel, wxID_ANY, _("&Indentation guides"));
indentLinesBox->SetValue(properties.indentLines); indentLinesBox->SetValue(properties.indentLines);
insertCloseTagBox = insertCloseTagBox =
new wxCheckBox(editorPanel, wxID_ANY, _("&Always insert closing tag")); new wxCheckBox(editorPanel, wxID_ANY, _("&Always insert closing tag"));
insertCloseTagBox->SetValue(properties.insertCloseTag); insertCloseTagBox->SetValue(properties.insertCloseTag);
highlightSyntaxBox = highlightSyntaxBox =
new wxCheckBox(editorPanel, wxID_ANY, _("Hi&ghlight syntax")); new wxCheckBox(editorPanel, wxID_ANY, _("Hi&ghlight syntax"));
highlightSyntaxBox->SetValue(properties.highlightSyntax); highlightSyntaxBox->SetValue(properties.highlightSyntax);
numberBox = numberBox =
new wxCheckBox(editorPanel, wxID_ANY, _("&Line numbers")); new wxCheckBox(editorPanel, wxID_ANY, _("&Line numbers"));
numberBox->SetValue(properties.number); numberBox->SetValue(properties.number);
protectHiddenElementsBox = protectHiddenElementsBox =
new wxCheckBox(editorPanel, wxID_ANY, _("L&ock hidden tags")); new wxCheckBox(editorPanel, wxID_ANY, _("L&ock hidden tags"));
protectHiddenElementsBox->SetValue(properties.protectHiddenElements); protectHiddenElementsBox->SetValue(properties.protectHiddenElements);
whitespaceVisibleBox = whitespaceVisibleBox =
new wxCheckBox(editorPanel, wxID_ANY, _("&White space visible")); new wxCheckBox(editorPanel, wxID_ANY, _("&White space visible"));
whitespaceVisibleBox->SetValue(properties.whitespaceVisible); whitespaceVisibleBox->SetValue(properties.whitespaceVisible);
validateAsYouTypeBox = validateAsYouTypeBox =
new wxCheckBox(editorPanel, wxID_ANY, _("&Validate as you type")); new wxCheckBox(editorPanel, wxID_ANY, _("&Validate as you type"));
validateAsYouTypeBox->SetValue(properties.validateAsYouType); validateAsYouTypeBox->SetValue(properties.validateAsYouType);
toggleLineBackgroundBox = toggleLineBackgroundBox =
new wxCheckBox(editorPanel, wxID_ANY, _("Va&riable highlight in tag free view")); new wxCheckBox(editorPanel, wxID_ANY, _("Va&riable highlight in tag free view"));
toggleLineBackgroundBox->SetValue(properties.toggleLineBackground); toggleLineBackgroundBox->SetValue(properties.toggleLineBackground);
/* col1sizer->Add(insertCloseTagBox, 0, wxALL | wxALIGN_LEFT, 5);
wrapBox = col1sizer->Add(foldBox, 0, wxALL | wxALIGN_LEFT, 5);
new wxCheckBox(editorPanel, wxID_ANY, _("Wra&p lines")); col1sizer->Add(currentLineBox, 0, wxALL | wxALIGN_LEFT, 5);
wrapBox->SetValue(properties.wrap); col1sizer->Add(highlightSyntaxBox, 0, wxALL | wxALIGN_LEFT, 5);
*/ col1sizer->Add(indentLinesBox, 0, wxALL | wxALIGN_LEFT, 5);
col1sizer->Add(deleteWholeTagBox, 0, wxALL | wxALIGN_LEFT, 5);
col1sizer->Add(insertCloseTagBox, 0, wxALL | wxALIGN_LEFT, 5); col2sizer->Add(numberBox, 0, wxALL | wxALIGN_LEFT, 5);
col1sizer->Add(foldBox, 0, wxALL | wxALIGN_LEFT, 5); col2sizer->Add(protectHiddenElementsBox, 0, wxALL | wxALIGN_LEFT, 5);
col1sizer->Add(currentLineBox, 0, wxALL | wxALIGN_LEFT, 5); col2sizer->Add(completionBox, 0, wxALL | wxALIGN_LEFT, 5);
col1sizer->Add(highlightSyntaxBox, 0, wxALL | wxALIGN_LEFT, 5); col2sizer->Add(validateAsYouTypeBox, 0, wxALL | wxALIGN_LEFT, 5);
col1sizer->Add(indentLinesBox, 0, wxALL | wxALIGN_LEFT, 5); col2sizer->Add(toggleLineBackgroundBox, 0, wxALL | wxALIGN_LEFT, 5);
col1sizer->Add(deleteWholeTagBox, 0, wxALL | wxALIGN_LEFT, 5); col2sizer->Add(whitespaceVisibleBox, 0, wxALL | wxALIGN_LEFT, 5);
col2sizer->Add(numberBox, 0, wxALL | wxALIGN_LEFT, 5); tablesizer->Add(col1sizer, 0, wxALL | wxALIGN_LEFT, 0);
col2sizer->Add(protectHiddenElementsBox, 0, wxALL | wxALIGN_LEFT, 5); tablesizer->Add(col2sizer, 0, wxALL | wxALIGN_LEFT, 0);
col2sizer->Add(completionBox, 0, wxALL | wxALIGN_LEFT, 5); editorSizer->Add(tablesizer, 0, wxALL | wxALIGN_LEFT, 0);
col2sizer->Add(validateAsYouTypeBox, 0, wxALL | wxALIGN_LEFT, 5); editorSizer->Add(labelFont, 0, wxLEFT | wxTOP | wxALIGN_LEFT, 5);
col2sizer->Add(toggleLineBackgroundBox, 0, wxALL | wxALIGN_LEFT, 5); editorSizer->Add(fontBox, 0, wxALL | wxALIGN_LEFT, 5);
col2sizer->Add(whitespaceVisibleBox, 0, wxALL | wxALIGN_LEFT, 5); editorPanel->SetSizer(editorSizer);
tablesizer->Add(col1sizer, 0, wxALL | wxALIGN_LEFT, 0);
tablesizer->Add(col2sizer, 0, wxALL | wxALIGN_LEFT, 0); // general
editorSizer->Add(tablesizer, 0, wxALL | wxALIGN_LEFT, 0); wxPanel *generalPanel = new wxPanel(GetBookCtrl());
editorSizer->Add(labelFont, 0, wxLEFT | wxTOP | wxALIGN_LEFT, 5); wxBoxSizer *vsizer = new wxBoxSizer(wxVERTICAL);
editorSizer->Add(fontBox, 0, wxALL | wxALIGN_LEFT, 5); wxBoxSizer *hsizer = new wxBoxSizer(wxHORIZONTAL);
editorPanel->SetSizer(editorSizer); wxBoxSizer *hsizerBrowser = new wxBoxSizer(wxHORIZONTAL);
wxBoxSizer *hsizerCheckboxes = new wxBoxSizer(wxHORIZONTAL);
// general wxBoxSizer *vsizerCheckbox1 = new wxBoxSizer(wxVERTICAL);
wxPanel *generalPanel = new wxPanel(GetBookCtrl()); wxBoxSizer *vsizerCheckbox2 = new wxBoxSizer(wxVERTICAL);
wxBoxSizer *vsizer = new wxBoxSizer(wxVERTICAL);
wxBoxSizer *hsizer = new wxBoxSizer(wxHORIZONTAL); wxStaticText *label = new wxStaticText(
wxBoxSizer *hsizerBrowser = new wxBoxSizer(wxHORIZONTAL); generalPanel,
wxBoxSizer *hsizerCheckboxes = new wxBoxSizer(wxHORIZONTAL); wxID_ANY,
wxBoxSizer *vsizerCheckbox1 = new wxBoxSizer(wxVERTICAL); _("Application directory"));
wxBoxSizer *vsizerCheckbox2 = new wxBoxSizer(wxVERTICAL); applicationDirEdit = new wxTextCtrl(
generalPanel,
wxStaticText *label = new wxStaticText( wxID_ANY,
generalPanel, applicationDir,
wxID_ANY, wxDefaultPosition,
_("Application directory")); wxSize(240, -1));
applicationDirEdit = new wxTextCtrl( wxButton *browse = new wxButton(
generalPanel, generalPanel,
wxID_ANY, APPLICATION_DIR_BROWSE,
applicationDir, _("Browse"),
wxDefaultPosition, wxDefaultPosition,
wxSize(240, -1)); wxSize(-1, applicationDirEdit->GetSize().GetHeight()));
wxButton *browse = new wxButton( wxStaticText *labelBrowser = new wxStaticText(
generalPanel, generalPanel,
APPLICATION_DIR_BROWSE, wxID_ANY,
_("Browse"), _("Browser"));
wxDefaultPosition, browserCommandEdit = new wxTextCtrl(
wxSize(-1, applicationDirEdit->GetSize().GetHeight())); generalPanel,
wxStaticText *labelBrowser = new wxStaticText( wxID_ANY,
generalPanel, browserCommand,
wxID_ANY, wxDefaultPosition,
_("Browser")); wxSize(240, -1));
browserCommandEdit = new wxTextCtrl( wxButton *browseCommand = new wxButton(
generalPanel, generalPanel,
wxID_ANY, BROWSER_COMMAND_BROWSE,
browserCommand, _("Browse"),
wxDefaultPosition, wxDefaultPosition,
wxSize(240, -1)); wxSize(-1, browserCommandEdit->GetSize().GetHeight()));
wxButton *browseCommand = new wxButton(
generalPanel, wxStaticText *labelLanguage = new wxStaticText(
BROWSER_COMMAND_BROWSE, generalPanel,
_("Browse"), wxID_ANY,
wxDefaultPosition, _("Language (restart required)"));
wxSize(-1, browserCommandEdit->GetSize().GetHeight())); languageBox = new wxChoice(
generalPanel,
wxStaticText *labelLanguage = new wxStaticText( wxID_ANY);
generalPanel,
wxID_ANY, languageBox->Insert(_T("Chinese Simplified"), INDEX_CHINESE_SIMPLIFIED);
_("Language (restart required)")); languageBox->Insert(_T("Chinese Traditional"), INDEX_CHINESE_TRADITIONAL);
languageBox = new wxChoice( languageBox->Insert(_T("English (US)"), INDEX_ENGLISH_US);
generalPanel, languageBox->Insert(_T("French"), INDEX_FRENCH);
wxID_ANY); languageBox->Insert(_T("German"), INDEX_GERMAN);
languageBox->Insert(_T("Slovak"), INDEX_SLOVAK);
languageBox->Insert(_T("Chinese Simplified"), INDEX_CHINESE_SIMPLIFIED); languageBox->Insert(_T("Swedish"), INDEX_SWEDISH);
languageBox->Insert(_T("Chinese Traditional"), INDEX_CHINESE_TRADITIONAL); languageBox->Insert(_T("Ukrainian"), INDEX_UKRAINIAN);
languageBox->Insert(_T("English (US)"), INDEX_ENGLISH_US);
languageBox->Insert(_T("French"), INDEX_FRENCH); switch (lang)
languageBox->Insert(_T("German"), INDEX_GERMAN); {
languageBox->Insert(_T("Slovak"), INDEX_SLOVAK); case wxLANGUAGE_GERMAN:
languageBox->Insert(_T("Swedish"), INDEX_SWEDISH); languageBox->SetSelection(INDEX_GERMAN);
break;
switch (lang) case wxLANGUAGE_FRENCH:
{ languageBox->SetSelection(INDEX_FRENCH);
case wxLANGUAGE_GERMAN: break;
languageBox->SetSelection(INDEX_GERMAN); case wxLANGUAGE_SLOVAK:
break; languageBox->SetSelection(INDEX_SLOVAK);
case wxLANGUAGE_FRENCH: break;
languageBox->SetSelection(INDEX_FRENCH); case wxLANGUAGE_SWEDISH:
break; languageBox->SetSelection(INDEX_SWEDISH);
case wxLANGUAGE_SLOVAK: break;
languageBox->SetSelection(INDEX_SLOVAK); case wxLANGUAGE_CHINESE_SIMPLIFIED:
break; languageBox->SetSelection(INDEX_CHINESE_SIMPLIFIED);
case wxLANGUAGE_SWEDISH: break;
languageBox->SetSelection(INDEX_SWEDISH); case wxLANGUAGE_CHINESE_TRADITIONAL:
break; languageBox->SetSelection(INDEX_CHINESE_TRADITIONAL);
case wxLANGUAGE_CHINESE_SIMPLIFIED: break;
languageBox->SetSelection(INDEX_CHINESE_SIMPLIFIED); case wxLANGUAGE_UKRAINIAN:
break; languageBox->SetSelection(INDEX_UKRAINIAN);
case wxLANGUAGE_CHINESE_TRADITIONAL: break;
languageBox->SetSelection(INDEX_CHINESE_TRADITIONAL); default:
break; languageBox->SetSelection(INDEX_ENGLISH_US);
default: break;
languageBox->SetSelection(INDEX_ENGLISH_US); }
}
libxmlNetAccessBox = new wxCheckBox(
libxmlNetAccessBox = new wxCheckBox( generalPanel, wxID_ANY, _("&Enable network access for DTD validation"));
generalPanel, wxID_ANY, _("&Enable network access for DTD validation")); libxmlNetAccessBox->SetValue(libxmlNetAccessParameter);
libxmlNetAccessBox->SetValue(libxmlNetAccessParameter); expandInternalEntitiesBox = new wxCheckBox(
expandInternalEntitiesBox = new wxCheckBox( generalPanel, wxID_ANY, _("E&xpand internal entities on open"));
generalPanel, wxID_ANY, _("E&xpand internal entities on open")); expandInternalEntitiesBox->SetValue(expandInternalEntitiesParameter);
expandInternalEntitiesBox->SetValue(expandInternalEntitiesParameter); singleInstanceCheckBox = new wxCheckBox(
singleInstanceCheckBox = new wxCheckBox( generalPanel, wxID_ANY, _("&One application instance only"));
generalPanel, wxID_ANY, _("&One application instance only")); singleInstanceCheckBox->SetValue(singleInstanceCheckParameter);
singleInstanceCheckBox->SetValue(singleInstanceCheckParameter); restoreLayoutBox = new wxCheckBox(
restoreLayoutBox = new wxCheckBox( generalPanel, wxID_ANY, _("Re&member layout on close"));
generalPanel, wxID_ANY, _("Re&member layout on close")); restoreLayoutBox->SetValue(restoreLayoutParameter);
restoreLayoutBox->SetValue(restoreLayoutParameter); rememberOpenTabsBox = new wxCheckBox(
rememberOpenTabsBox = new wxCheckBox( generalPanel, wxID_ANY, _("&Remember open tabs on close"));
generalPanel, wxID_ANY, _("&Remember open tabs on close")); rememberOpenTabsBox->SetValue(rememberOpenTabsParameter);
rememberOpenTabsBox->SetValue(rememberOpenTabsParameter); unlimitedUndoBox = new wxCheckBox(
unlimitedUndoBox = new wxCheckBox( generalPanel, wxID_ANY, _("Re&tain undo history on save"));
generalPanel, wxID_ANY, _("Re&tain undo history on save")); unlimitedUndoBox->SetValue(unlimitedUndoParameter);
unlimitedUndoBox->SetValue(unlimitedUndoParameter);
saveBomBox = new wxCheckBox(
saveBomBox = new wxCheckBox( generalPanel, wxID_ANY, _("&Save UTF-8 byte order mark"));
generalPanel, wxID_ANY, _("&Save UTF-8 byte order mark")); saveBomBox->SetValue(saveBomParameter);
saveBomBox->SetValue(saveBomParameter);
fullPathBox = new wxCheckBox(
fullPathBox = new wxCheckBox( generalPanel, wxID_ANY, _("S&how full path on frame"));
generalPanel, wxID_ANY, _("S&how full path on frame")); fullPathBox->SetValue(showFullPathOnFrameParameter);
fullPathBox->SetValue(showFullPathOnFrameParameter);
#ifdef __WXMSW__
#ifdef __WXMSW__ useCoolBarBox = new wxCheckBox(
useCoolBarBox = new wxCheckBox( generalPanel, wxID_ANY, _("&Use Microsoft rebar control (restart required)"));
generalPanel, wxID_ANY, _("&Use Microsoft rebar control (restart required)")); useCoolBarBox->SetValue(useCoolBarParameter);
useCoolBarBox->SetValue(useCoolBarParameter); #endif
#endif
hsizer->Add(applicationDirEdit, 0, wxALL | wxALIGN_LEFT, 0);
hsizer->Add(applicationDirEdit, 0, wxALL | wxALIGN_LEFT, 0); hsizer->Add(browse, 0, wxLEFT | wxALIGN_LEFT, 5);
hsizer->Add(browse, 0, wxLEFT | wxALIGN_LEFT, 5); hsizerBrowser->Add(browserCommandEdit, 0, wxALL | wxALIGN_LEFT, 0);
hsizerBrowser->Add(browserCommandEdit, 0, wxALL | wxALIGN_LEFT, 0); hsizerBrowser->Add(browseCommand, 0, wxLEFT | wxALIGN_LEFT, 5);
hsizerBrowser->Add(browseCommand, 0, wxLEFT | wxALIGN_LEFT, 5); vsizer->Add(label, 0, wxLEFT | wxTOP | wxALIGN_LEFT, 5);
vsizer->Add(label, 0, wxLEFT | wxTOP | wxALIGN_LEFT, 5); vsizer->Add(hsizer, 0, wxALL | wxALIGN_LEFT, 5);
vsizer->Add(hsizer, 0, wxALL | wxALIGN_LEFT, 5); vsizer->Add(labelBrowser, 0, wxLEFT | wxTOP | wxALIGN_LEFT, 5);
vsizer->Add(labelBrowser, 0, wxLEFT | wxTOP | wxALIGN_LEFT, 5); vsizer->Add(hsizerBrowser, 0, wxALL | wxALIGN_LEFT, 5);
vsizer->Add(hsizerBrowser, 0, wxALL | wxALIGN_LEFT, 5);
vsizer->Add(labelLanguage, 0, wxLEFT | wxTOP | wxALIGN_LEFT, 5);
vsizer->Add(labelLanguage, 0, wxLEFT | wxTOP | wxALIGN_LEFT, 5); vsizer->Add(languageBox, 0, wxALL | wxALIGN_LEFT, 5);
vsizer->Add(languageBox, 0, wxALL | wxALIGN_LEFT, 5);
vsizerCheckbox1->Add(libxmlNetAccessBox, 0, wxALL | wxALIGN_LEFT, 5);
vsizerCheckbox1->Add(libxmlNetAccessBox, 0, wxALL | wxALIGN_LEFT, 5); vsizerCheckbox1->Add(expandInternalEntitiesBox, 0, wxALL | wxALIGN_LEFT, 5);
vsizerCheckbox1->Add(expandInternalEntitiesBox, 0, wxALL | wxALIGN_LEFT, 5); vsizerCheckbox1->Add(singleInstanceCheckBox, 0, wxALL | wxALIGN_LEFT, 5);
vsizerCheckbox1->Add(singleInstanceCheckBox, 0, wxALL | wxALIGN_LEFT, 5); vsizerCheckbox1->Add(restoreLayoutBox, 0, wxALL | wxALIGN_LEFT, 5);
vsizerCheckbox1->Add(restoreLayoutBox, 0, wxALL | wxALIGN_LEFT, 5); vsizerCheckbox1->Add(rememberOpenTabsBox, 0, wxALL | wxALIGN_LEFT, 5);
vsizerCheckbox1->Add(rememberOpenTabsBox, 0, wxALL | wxALIGN_LEFT, 5); vsizerCheckbox2->Add(unlimitedUndoBox, 0, wxALL | wxALIGN_LEFT, 5);
vsizerCheckbox2->Add(unlimitedUndoBox, 0, wxALL | wxALIGN_LEFT, 5); vsizerCheckbox2->Add(saveBomBox, 0, wxALL | wxALIGN_LEFT, 5);
vsizerCheckbox2->Add(saveBomBox, 0, wxALL | wxALIGN_LEFT, 5); vsizerCheckbox2->Add(fullPathBox, 0, wxALL | wxALIGN_LEFT, 5);
vsizerCheckbox2->Add(fullPathBox, 0, wxALL | wxALIGN_LEFT, 5); #ifdef __WXMSW__
#ifdef __WXMSW__ vsizerCheckbox2->Add(useCoolBarBox, 0, wxALL | wxALIGN_LEFT, 5);
vsizerCheckbox2->Add(useCoolBarBox, 0, wxALL | wxALIGN_LEFT, 5); #endif
#endif hsizerCheckboxes->Add(vsizerCheckbox1, 0, wxALL | wxALIGN_LEFT, 0);
hsizerCheckboxes->Add(vsizerCheckbox1, 0, wxALL | wxALIGN_LEFT, 0); hsizerCheckboxes->Add(vsizerCheckbox2, 0, wxALL | wxALIGN_LEFT, 0);
hsizerCheckboxes->Add(vsizerCheckbox2, 0, wxALL | wxALIGN_LEFT, 0); vsizer->Add(hsizerCheckboxes, 0, wxALL | wxALIGN_LEFT, 5);
vsizer->Add(hsizerCheckboxes, 0, wxALL | wxALIGN_LEFT, 5); generalPanel->SetSizer(vsizer);
generalPanel->SetSizer(vsizer);
editorSizer->Layout();
editorSizer->Layout(); vsizer->Layout();
vsizer->Layout(); GetBookCtrl()->AddPage(generalPanel, _("General"));
GetBookCtrl()->AddPage(generalPanel, _("General")); GetBookCtrl()->AddPage(editorPanel, _("Editor"));
GetBookCtrl()->AddPage(editorPanel, _("Editor"));
LayoutDialog();
LayoutDialog(); }
}
MyPropertySheet::~MyPropertySheet() {}
MyPropertySheet::~MyPropertySheet() {}
void MyPropertySheet::OnOk(wxCommandEvent& e)
void MyPropertySheet::OnOk(wxCommandEvent& e) {
{ properties.completion = completionBox->GetValue();
properties.completion = completionBox->GetValue(); properties.fold = foldBox->GetValue();
properties.fold = foldBox->GetValue(); properties.number = numberBox->GetValue();
properties.number = numberBox->GetValue(); properties.currentLine = currentLineBox->GetValue();
properties.currentLine = currentLineBox->GetValue(); properties.whitespaceVisible = whitespaceVisibleBox->GetValue();
properties.whitespaceVisible = whitespaceVisibleBox->GetValue(); properties.indentLines = indentLinesBox->GetValue();
properties.indentLines = indentLinesBox->GetValue(); properties.protectHiddenElements = protectHiddenElementsBox->GetValue();
properties.protectHiddenElements = protectHiddenElementsBox->GetValue(); properties.toggleLineBackground = toggleLineBackgroundBox->GetValue();
properties.toggleLineBackground = toggleLineBackgroundBox->GetValue(); properties.insertCloseTag = insertCloseTagBox->GetValue();
properties.insertCloseTag = insertCloseTagBox->GetValue(); properties.deleteWholeTag = deleteWholeTagBox->GetValue();
properties.deleteWholeTag = deleteWholeTagBox->GetValue(); properties.validateAsYouType = validateAsYouTypeBox->GetValue();
properties.validateAsYouType = validateAsYouTypeBox->GetValue(); properties.font = fontBox->GetStringSelection();
properties.font = fontBox->GetStringSelection(); properties.highlightSyntax = highlightSyntaxBox->GetValue();
properties.highlightSyntax = highlightSyntaxBox->GetValue();
wxString testDir = applicationDirEdit->GetValue();
wxString testDir = applicationDirEdit->GetValue(); if (!wxFileName::DirExists(testDir))
if (!wxFileName::DirExists(testDir)) {
{ wxMessageBox(_("Cannot access application directory"), _("Options"));
wxMessageBox(_("Cannot access application directory"), _("Options")); // tbd: show general tab
// tbd: show general tab return;
return; }
} else
else applicationDir = testDir;
applicationDir = testDir;
browserCommand = browserCommandEdit->GetValue(); // permit incorrect value
browserCommand = browserCommandEdit->GetValue(); // permit incorrect value singleInstanceCheck = singleInstanceCheckBox->GetValue();
singleInstanceCheck = singleInstanceCheckBox->GetValue(); restoreLayout = restoreLayoutBox->GetValue();
restoreLayout = restoreLayoutBox->GetValue(); rememberOpenTabs = rememberOpenTabsBox->GetValue();
rememberOpenTabs = rememberOpenTabsBox->GetValue(); libxmlNetAccess = libxmlNetAccessBox->GetValue();
libxmlNetAccess = libxmlNetAccessBox->GetValue(); saveBom = saveBomBox->GetValue();
saveBom = saveBomBox->GetValue(); unlimitedUndo = unlimitedUndoBox->GetValue();
unlimitedUndo = unlimitedUndoBox->GetValue(); expandInternalEntities = expandInternalEntitiesBox->GetValue();
expandInternalEntities = expandInternalEntitiesBox->GetValue(); showFullPathOnFrame = fullPathBox->GetValue();
showFullPathOnFrame = fullPathBox->GetValue(); #ifdef __WXMSW__
#ifdef __WXMSW__ useCoolBar = useCoolBarBox->GetValue();
useCoolBar = useCoolBarBox->GetValue(); #endif
#endif
int languageChoice = languageBox->GetSelection();
int languageChoice = languageBox->GetSelection(); switch (languageChoice)
switch (languageChoice) {
{ case INDEX_GERMAN:
case INDEX_GERMAN: lang = wxLANGUAGE_GERMAN;
lang = wxLANGUAGE_GERMAN; break;
break; case INDEX_CHINESE_SIMPLIFIED:
case INDEX_CHINESE_SIMPLIFIED: lang = wxLANGUAGE_CHINESE_SIMPLIFIED;
lang = wxLANGUAGE_CHINESE_SIMPLIFIED; break;
break; case INDEX_CHINESE_TRADITIONAL:
case INDEX_CHINESE_TRADITIONAL: lang = wxLANGUAGE_CHINESE_TRADITIONAL;
lang = wxLANGUAGE_CHINESE_TRADITIONAL; break;
break; case INDEX_FRENCH:
case INDEX_FRENCH: lang = wxLANGUAGE_FRENCH;
lang = wxLANGUAGE_FRENCH; break;
break; case INDEX_SLOVAK:
case INDEX_SLOVAK: lang = wxLANGUAGE_SLOVAK;
lang = wxLANGUAGE_SLOVAK; break;
break; case INDEX_SWEDISH:
case INDEX_SWEDISH: lang = wxLANGUAGE_SWEDISH;
lang = wxLANGUAGE_SWEDISH; break;
break; case INDEX_UKRAINIAN:
default: lang = wxLANGUAGE_UKRAINIAN;
lang = wxLANGUAGE_ENGLISH_US; break;
break; default:
} lang = wxLANGUAGE_ENGLISH_US;
e.Skip(); break;
} }
e.Skip();
void MyPropertySheet::OnApplicationDirBrowse(wxCommandEvent& e) }
{
wxDirDialog *browseDialog = new wxDirDialog(this); void MyPropertySheet::OnApplicationDirBrowse(wxCommandEvent& e)
if (browseDialog->ShowModal() == wxID_OK) {
applicationDirEdit->SetValue(browseDialog->GetPath()); wxDirDialog *browseDialog = new wxDirDialog(this);
} if (browseDialog->ShowModal() == wxID_OK)
applicationDirEdit->SetValue(browseDialog->GetPath());
void MyPropertySheet::OnBrowserCommandBrowse(wxCommandEvent& e) }
{
wxFileDialog *browseDialog = new wxFileDialog(this); void MyPropertySheet::OnBrowserCommandBrowse(wxCommandEvent& e)
if (browseDialog->ShowModal() == wxID_OK) {
browserCommandEdit->SetValue(browseDialog->GetPath()); wxFileDialog *browseDialog = new wxFileDialog(this);
} if (browseDialog->ShowModal() == wxID_OK)
browserCommandEdit->SetValue(browseDialog->GetPath());
XmlCtrlProperties MyPropertySheet::getProperties() }
{
return properties; XmlCtrlProperties MyPropertySheet::getProperties()
} {
return properties;
wxString MyPropertySheet::getApplicationDir() }
{
return applicationDir; wxString MyPropertySheet::getApplicationDir()
} {
return applicationDir;
wxString MyPropertySheet::getBrowserCommand() }
{
return browserCommand; wxString MyPropertySheet::getBrowserCommand()
} {
return browserCommand;
bool MyPropertySheet::getSingleInstanceCheck() }
{
return singleInstanceCheck; bool MyPropertySheet::getSingleInstanceCheck()
} {
return singleInstanceCheck;
bool MyPropertySheet::getRememberOpenTabs() }
{
return rememberOpenTabs; bool MyPropertySheet::getRememberOpenTabs()
} {
return rememberOpenTabs;
bool MyPropertySheet::getLibxmlNetAccess() }
{
return libxmlNetAccess; bool MyPropertySheet::getLibxmlNetAccess()
} {
return libxmlNetAccess;
bool MyPropertySheet::getSaveBom() }
{
return saveBom; bool MyPropertySheet::getSaveBom()
} {
return saveBom;
bool MyPropertySheet::getUnlimitedUndo() }
{
return unlimitedUndo; bool MyPropertySheet::getUnlimitedUndo()
} {
return unlimitedUndo;
#ifdef __WXMSW__ }
bool MyPropertySheet::getUseCoolBar()
{ #ifdef __WXMSW__
return useCoolBar; bool MyPropertySheet::getUseCoolBar()
} {
#endif return useCoolBar;
}
int MyPropertySheet::getLang() #endif
{
return lang; int MyPropertySheet::getLang()
} {
return lang;
bool MyPropertySheet::getRestoreLayout() }
{
return restoreLayout; bool MyPropertySheet::getRestoreLayout()
} {
return restoreLayout;
bool MyPropertySheet::getExpandInternalEntities() }
{
return expandInternalEntities; bool MyPropertySheet::getExpandInternalEntities()
} {
return expandInternalEntities;
bool MyPropertySheet::getShowFullPathOnFrame() }
{
return showFullPathOnFrame; bool MyPropertySheet::getShowFullPathOnFrame()
} {
return showFullPathOnFrame;
}

View File

@ -1,114 +1,115 @@
#ifndef MYPROPERTYSHEET_H #ifndef MYPROPERTYSHEET_H
#define MYPROPERTYSHEET_H #define MYPROPERTYSHEET_H
#include <wx/wx.h> #include <wx/wx.h>
#include <wx/generic/propdlg.h> #include <wx/generic/propdlg.h>
#include <wx/filename.h> #include <wx/filename.h>
#include "xmlctrl.h" #include "xmlctrl.h"
enum { enum {
APPLICATION_DIR_BROWSE, APPLICATION_DIR_BROWSE,
BROWSER_COMMAND_BROWSE, BROWSER_COMMAND_BROWSE,
FONT_BROWSE FONT_BROWSE
}; };
enum langIndex { enum langIndex {
INDEX_CHINESE_SIMPLIFIED = 0, INDEX_CHINESE_SIMPLIFIED = 0,
INDEX_CHINESE_TRADITIONAL, INDEX_CHINESE_TRADITIONAL,
INDEX_ENGLISH_US, INDEX_ENGLISH_US,
INDEX_FRENCH, INDEX_FRENCH,
INDEX_GERMAN, INDEX_GERMAN,
INDEX_SLOVAK, INDEX_SLOVAK,
INDEX_SWEDISH, INDEX_SWEDISH,
}; INDEX_UKRAINIAN
};
class MyPropertySheet : public wxPropertySheetDialog
{ class MyPropertySheet : public wxPropertySheetDialog
public: {
MyPropertySheet( public:
wxWindow *parent, MyPropertySheet(
XmlCtrlProperties& propertiesParameter, wxWindow *parent,
wxString& applicationDirParameter, XmlCtrlProperties& propertiesParameter,
wxString& browserCommandParameter, wxString& applicationDirParameter,
bool rememberOpenTabsParameter, wxString& browserCommandParameter,
bool libxmlNetAccess, bool rememberOpenTabsParameter,
bool singleInstanceCheck, bool libxmlNetAccess,
bool saveBom, bool singleInstanceCheck,
bool unlimitedUndo, bool saveBom,
bool restoreLayout, bool unlimitedUndo,
bool expandInternalEntities, bool restoreLayout,
bool showFullPathOnFrame, bool expandInternalEntities,
int lang, bool showFullPathOnFrame,
#ifdef __WXMSW__ int lang,
bool useCoolBar, #ifdef __WXMSW__
#endif bool useCoolBar,
wxWindowID id = wxID_ANY, #endif
wxString title = _T(""), wxWindowID id = wxID_ANY,
const wxPoint& position = wxDefaultPosition, wxString title = _T(""),
const wxSize& size = wxDefaultSize, const wxPoint& position = wxDefaultPosition,
long style = wxDEFAULT_DIALOG_STYLE); const wxSize& size = wxDefaultSize,
~MyPropertySheet(); long style = wxDEFAULT_DIALOG_STYLE);
void OnOk(wxCommandEvent& e); ~MyPropertySheet();
void OnBrowserCommandBrowse(wxCommandEvent& e); void OnOk(wxCommandEvent& e);
void OnApplicationDirBrowse(wxCommandEvent& e); void OnBrowserCommandBrowse(wxCommandEvent& e);
XmlCtrlProperties getProperties(); void OnApplicationDirBrowse(wxCommandEvent& e);
wxString getApplicationDir(); XmlCtrlProperties getProperties();
wxString getBrowserCommand(); wxString getApplicationDir();
bool getSingleInstanceCheck(); wxString getBrowserCommand();
bool getRememberOpenTabs(); bool getSingleInstanceCheck();
bool getLibxmlNetAccess(); bool getRememberOpenTabs();
bool getSaveBom(); bool getLibxmlNetAccess();
bool getUnlimitedUndo(); bool getSaveBom();
bool getRestoreLayout(); bool getUnlimitedUndo();
bool getExpandInternalEntities(); bool getRestoreLayout();
bool getShowFullPathOnFrame(); bool getExpandInternalEntities();
#ifdef __WXMSW__ bool getShowFullPathOnFrame();
bool getUseCoolBar(); #ifdef __WXMSW__
#endif bool getUseCoolBar();
int getLang(); #endif
private: int getLang();
int lang; private:
wxCheckBox *completionBox, int lang;
*currentLineBox, wxCheckBox *completionBox,
*foldBox, *currentLineBox,
*numberBox, *foldBox,
*whitespaceVisibleBox, *numberBox,
//*wrapBox, *whitespaceVisibleBox,
*indentLinesBox, //*wrapBox,
*deleteWholeTagBox, *indentLinesBox,
*rememberOpenTabsBox, *deleteWholeTagBox,
*libxmlNetAccessBox, *rememberOpenTabsBox,
*singleInstanceCheckBox, *libxmlNetAccessBox,
*saveBomBox, *singleInstanceCheckBox,
*protectHiddenElementsBox, *saveBomBox,
*toggleLineBackgroundBox, *protectHiddenElementsBox,
*validateAsYouTypeBox, *toggleLineBackgroundBox,
*fullPathBox, *validateAsYouTypeBox,
*highlightSyntaxBox, *fullPathBox,
#ifdef __WXMSW__ *highlightSyntaxBox,
*useCoolBarBox, #ifdef __WXMSW__
#endif *useCoolBarBox,
*unlimitedUndoBox, #endif
*restoreLayoutBox, *unlimitedUndoBox,
*expandInternalEntitiesBox, *restoreLayoutBox,
*insertCloseTagBox; *expandInternalEntitiesBox,
wxChoice *languageBox, *fontBox; *insertCloseTagBox;
wxTextCtrl *applicationDirEdit, *browserCommandEdit; wxChoice *languageBox, *fontBox;
XmlCtrlProperties properties; wxTextCtrl *applicationDirEdit, *browserCommandEdit;
wxString applicationDir, browserCommand; XmlCtrlProperties properties;
bool singleInstanceCheck, wxString applicationDir, browserCommand;
rememberOpenTabs, bool singleInstanceCheck,
libxmlNetAccess, rememberOpenTabs,
saveBom, libxmlNetAccess,
#ifdef __WXMSW__ saveBom,
useCoolBar, #ifdef __WXMSW__
#endif useCoolBar,
unlimitedUndo, #endif
restoreLayout, unlimitedUndo,
expandInternalEntities, restoreLayout,
showFullPathOnFrame, expandInternalEntities,
insertCloseTag; showFullPathOnFrame,
DECLARE_EVENT_TABLE() insertCloseTag;
}; DECLARE_EVENT_TABLE()
};
#endif
#endif