Fixed assdraw3 to compile on MSVC with Unicode on. Thanks to TheFluff for the perl script to do the conversion.

Originally committed to SVN as r1839.
This commit is contained in:
Rodrigo Braz Monteiro 2008-01-25 23:16:29 +00:00
parent f0e617634c
commit 94c7fcd101
14 changed files with 320 additions and 245 deletions

View file

@ -78,7 +78,7 @@ struct VersionInfoStruct {
wxString SCMStr, VersionStr;
// Update this whenever a new version is released
VersionNumber = _T("v2.00");
VersionNumber = _T("v2.0.0");
#ifdef _DEBUG
IsDebug = true;
#else

View file

@ -43,6 +43,19 @@
#include <wx/dynlib.h>
#include <wx/stdpaths.h>
/////////////
// Libraries
#ifdef __VISUALC__
#pragma comment(lib, "comctl32.lib")
#ifdef __WXDEBUG__
#pragma comment(lib, "wxmsw28ud_propgrid.lib")
#else
#pragma comment(lib, "wxmsw28u_propgrid.lib")
#endif
#endif
//DEFINE_EVENT_TYPE(wxEVT_SETTINGS_CHANGED)
// initialize wxWidget to accept our App class
@ -84,7 +97,7 @@ END_EVENT_TABLE()
// the application class: ASSDrawApp
// ----------------------------------------------------------------------------
// 'Main program' equivalent: the program execution "starts" here
// 'Main program' equivalent: the program execution _T("starts") here
bool ASSDrawApp::OnInit()
{
// create the main application window
@ -152,12 +165,12 @@ ASSDrawFrame::ASSDrawFrame( wxApp *app, const wxString& title, const wxPoint& po
// settings
/*
settingsdlg = NULL;
wxString settingsdllfile = wxFileName(::wxGetCwd(), "settings.dll").GetFullPath();
wxString settingsdllfile = wxFileName(::wxGetCwd(), _T("settings.dll")).GetFullPath();
if (::wxFileExists(settingsdllfile))
{
wxDynamicLibrary settingsdll(settingsdllfile);
wxString symbol("CreateASSDrawSettingsDialogInstance");
wxString symbol(_T("CreateASSDrawSettingsDialogInstance"));
if (settingsdll.IsLoaded() && settingsdll.HasSymbol(symbol))
{
typedef ASSDrawSettingsDialog* (*FuncType)(wxWindow*,ASSDrawFrame*,int);
@ -169,7 +182,7 @@ ASSDrawFrame::ASSDrawFrame( wxApp *app, const wxString& title, const wxPoint& po
//SetTitle(settingsdllfile);
//settingsdlg = func(NULL,this, 809131);
//settingsdlg->Init();
//m_mgr.AddPane(settingsdlg, wxAuiPaneInfo().Name(wxT("settings")).Caption(wxT("Settings")).Right().Layer(3).Position(0).CloseButton(true).BestSize(wxSize(240, 480)).MinSize(wxSize(200, 200)));
//m_mgr.AddPane(settingsdlg, wxAuiPaneInfo().Name(_T("settings")).Caption(_T("Settings")).Right().Layer(3).Position(0).CloseButton(true).BestSize(wxSize(240, 480)).MinSize(wxSize(200, 200)));
}
}
*/
@ -185,25 +198,25 @@ ASSDrawFrame::ASSDrawFrame( wxApp *app, const wxString& title, const wxPoint& po
config->SetPath(_T("info"));
wxString version;
config->Read("version", &version);
config->SetPath("..");
config->Read(_T("version"), &version);
config->SetPath(_T(".."));
default_perspective = m_mgr.SavePerspective(); // back up default perspective
config->SetPath("perspective");
config->SetPath(_T("perspective"));
wxString perspective;
if (config->Read("perspective", &perspective) && version == VERSION) m_mgr.LoadPerspective(perspective, false);
config->SetPath("..");
if (config->Read(_T("perspective"), &perspective) && version == VERSION) m_mgr.LoadPerspective(perspective, false);
config->SetPath(_T(".."));
config->SetPath("library");
config->SetPath(_T("library"));
int n = 0;
config->Read("n", &n);
config->Read(_T("n"), &n);
for (int i = 0; i < n; i++)
{
wxString libcmds;
config->Read(wxString::Format("%d",i), &libcmds);
config->Read(wxString::Format(_T("%d"),i), &libcmds);
shapelib->AddShapePreview(libcmds);
}
config->SetPath("..");
config->SetPath(_T(".."));
m_mgr.Update();
m_canvas->SetFocus();
@ -222,12 +235,12 @@ ASSDrawFrame::ASSDrawFrame( wxApp *app, const wxString& title, const wxPoint& po
wxDateTime now = wxDateTime::Now();
if (now.IsLaterThan(expire))
{
wxMessageDialog expired(this, "Thank you for trying ASSDraw3. This beta version has expired. Please visit http://malakith.net/aegisub/index.php?topic=912.0 to get the latest release. Visit now?", wxT("Beta version"), wxYES_NO | wxICON_INFORMATION);
wxMessageDialog expired(this, _T("Thank you for trying ASSDraw3. This beta version has expired. Please visit http://malakith.net/aegisub/index.php?topic=912.0 to get the latest release. Visit now?"), _T("Beta version"), wxYES_NO | wxICON_INFORMATION);
if (expired.ShowModal() == wxID_YES)
::wxLaunchDefaultBrowser(wxString("http://malakith.net/aegisub/index.php?topic=912.0"));
::wxLaunchDefaultBrowser(wxString(_T("http://malakith.net/aegisub/index.php?topic=912.0")));
Close();
}
SetTitle(wxString::Format("%s beta %d (expires %s)", TITLE, BETAVERSION, expire.FormatDate().c_str()));
SetTitle(wxString::Format(_T("%s beta %d (expires %s)"), TITLE, BETAVERSION, expire.FormatDate().c_str()));
#endif
if (firsttime)
@ -236,16 +249,16 @@ ASSDrawFrame::ASSDrawFrame( wxApp *app, const wxString& title, const wxPoint& po
_About(3);
helpcontroller.SetParentWindow(this);
helpcontroller.Initialize(wxFileName(::wxGetCwd(), "ASSDraw3.chm").GetFullPath());
helpcontroller.Initialize(wxFileName(::wxGetCwd(), _T("ASSDraw3.chm")).GetFullPath());
}
void ASSDrawFrame::SetToolBars()
{
drawtbar = new wxToolBar(this, wxID_ANY, __DPDS__ , wxTB_FLAT | wxTB_TEXT | wxTB_NODIVIDER | wxTB_HORIZONTAL);
drawtbar->AddTool(TB_CLEAR, _T("Clear"), wxBITMAP(new_), wxNullBitmap, wxITEM_NORMAL, "", TIPS_CLEAR);
//tbar->AddTool(TB_EDITSRC, _T("Source"), wxBITMAP(src_), wxNullBitmap, wxITEM_NORMAL, "", TIPS_EDITSRC);
drawtbar->AddCheckTool(TB_PREVIEW, _T("Preview"), wxBITMAP(preview_), wxNullBitmap, "", TIPS_PREVIEW);
//drawtbar->AddTool(TB_TRANSFORM, _T("Transform"), wxBITMAP(rot_), wxNullBitmap, wxITEM_NORMAL, "", TIPS_TRANSFORM);
drawtbar->AddTool(TB_CLEAR, _T("Clear"), wxBITMAP(new_), wxNullBitmap, wxITEM_NORMAL, _T(""), TIPS_CLEAR);
//tbar->AddTool(TB_EDITSRC, _T("Source"), wxBITMAP(src_), wxNullBitmap, wxITEM_NORMAL, _T(""), TIPS_EDITSRC);
drawtbar->AddCheckTool(TB_PREVIEW, _T("Preview"), wxBITMAP(preview_), wxNullBitmap, _T(""), TIPS_PREVIEW);
//drawtbar->AddTool(TB_TRANSFORM, _T("Transform"), wxBITMAP(rot_), wxNullBitmap, wxITEM_NORMAL, _T(""), TIPS_TRANSFORM);
zoomslider = new wxSlider(drawtbar, TB_ZOOMSLIDER, 1000, 100, 5000, __DPDS__ );
//zoomslider->SetSize(280, zoomslider->GetSize().y);
zoomslider->Connect(wxEVT_SCROLL_LINEUP, wxScrollEventHandler(ASSDrawFrame::OnZoomSliderChanged), NULL, this);
@ -257,35 +270,35 @@ void ASSDrawFrame::SetToolBars()
drawtbar->AddControl(zoomslider);
drawtbar->Realize();
m_mgr.AddPane(drawtbar, wxAuiPaneInfo().Name(wxT("drawtbar")).Caption(TBNAME_DRAW).
m_mgr.AddPane(drawtbar, wxAuiPaneInfo().Name(_T("drawtbar")).Caption(TBNAME_DRAW).
ToolbarPane().Top().Position(0).Dockable(true).LeftDockable(false).RightDockable(false));
modetbar = new wxToolBar(this, wxID_ANY, __DPDS__ , wxTB_FLAT | wxTB_TEXT | wxTB_NODIVIDER | wxTB_HORIZONTAL);
modetbar->AddRadioTool(MODE_ARR, _T("Drag"), wxBITMAP(arr_), wxNullBitmap, "", TIPS_ARR);
modetbar->AddRadioTool(MODE_M, _T("Move"), wxBITMAP(m_), wxNullBitmap, "", TIPS_M);
//modetbar->AddRadioTool(MODE_N, _T("Move*"), wxBITMAP(n_), wxNullBitmap, "", TIPS_N);
modetbar->AddRadioTool(MODE_L, _T("Line"), wxBITMAP(l_), wxNullBitmap, "", TIPS_L);
modetbar->AddRadioTool(MODE_B, _T("Bezier"), wxBITMAP(b_), wxNullBitmap, "", TIPS_B);
//modetbar->AddRadioTool(MODE_S, _T("Spline"), wxBITMAP(s_), wxNullBitmap, "", TIPS_S);
//modetbar->AddRadioTool(MODE_P, _T("Extend"), wxBITMAP(p_), wxNullBitmap, "", TIPS_P);
//modetbar->AddRadioTool(MODE_C, _T("Close"), wxBITMAP(c_), wxNullBitmap, "", TIPS_C);
modetbar->AddRadioTool(MODE_DEL, _T("Delete"), wxBITMAP(del_), wxNullBitmap, "", TIPS_DEL);
modetbar->AddRadioTool(MODE_SCALEROTATE, _T("Scale/Rotate"), wxBITMAP(sc_rot_), wxNullBitmap, "", TIPS_SCALEROTATE);
modetbar->AddRadioTool(MODE_NUT_BILINEAR, _T("Bilinear"), wxBITMAP(nut_), wxNullBitmap, "", TIPS_NUTB);
//modetbar->AddRadioTool(MODE_NUT_PERSPECTIVE, _T("NUT:P"), wxBITMAP(arr_), wxNullBitmap, "", "");
modetbar->AddRadioTool(MODE_ARR, _T("Drag"), wxBITMAP(arr_), wxNullBitmap, _T(""), TIPS_ARR);
modetbar->AddRadioTool(MODE_M, _T("Move"), wxBITMAP(m_), wxNullBitmap, _T(""), TIPS_M);
//modetbar->AddRadioTool(MODE_N, _T("Move*"), wxBITMAP(n_), wxNullBitmap, _T(""), TIPS_N);
modetbar->AddRadioTool(MODE_L, _T("Line"), wxBITMAP(l_), wxNullBitmap, _T(""), TIPS_L);
modetbar->AddRadioTool(MODE_B, _T("Bezier"), wxBITMAP(b_), wxNullBitmap, _T(""), TIPS_B);
//modetbar->AddRadioTool(MODE_S, _T("Spline"), wxBITMAP(s_), wxNullBitmap, _T(""), TIPS_S);
//modetbar->AddRadioTool(MODE_P, _T("Extend"), wxBITMAP(p_), wxNullBitmap, _T(""), TIPS_P);
//modetbar->AddRadioTool(MODE_C, _T("Close"), wxBITMAP(c_), wxNullBitmap, _T(""), TIPS_C);
modetbar->AddRadioTool(MODE_DEL, _T("Delete"), wxBITMAP(del_), wxNullBitmap, _T(""), TIPS_DEL);
modetbar->AddRadioTool(MODE_SCALEROTATE, _T("Scale/Rotate"), wxBITMAP(sc_rot_), wxNullBitmap, _T(""), TIPS_SCALEROTATE);
modetbar->AddRadioTool(MODE_NUT_BILINEAR, _T("Bilinear"), wxBITMAP(nut_), wxNullBitmap, _T(""), TIPS_NUTB);
//modetbar->AddRadioTool(MODE_NUT_PERSPECTIVE, _T("NUT:P"), wxBITMAP(arr_), wxNullBitmap, _T(""), _T(""));
modetbar->Realize();
m_mgr.AddPane(modetbar, wxAuiPaneInfo().Name(wxT("modetbar")).Caption(TBNAME_MODE).
m_mgr.AddPane(modetbar, wxAuiPaneInfo().Name(_T("modetbar")).Caption(TBNAME_MODE).
ToolbarPane().Top().Position(1).Dockable(true).LeftDockable(false).RightDockable(false));
bgimgtbar = new wxToolBar(this, wxID_ANY, __DPDS__ , wxTB_FLAT | wxTB_TEXT | wxTB_NODIVIDER | wxTB_HORIZONTAL);
bgimgtbar->SetToolBitmapSize(wxSize(24,15));
bgimgtbar->AddCheckTool(DRAG_DWG, _T("Pan drawing"), wxBITMAP(pan_shp), wxNullBitmap, "", TIPS_DWG);
bgimgtbar->AddCheckTool(DRAG_BGIMG, _T("Pan background"), wxBITMAP(pan_bg), wxNullBitmap, "", TIPS_BGIMG);
//bgimgtbar->AddRadioTool(DRAG_BOTH, _T("Pan both"), wxBITMAP(pan_both), wxNullBitmap, "", TIPS_BOTH);
bgimgtbar->AddCheckTool(DRAG_DWG, _T("Pan drawing"), wxBITMAP(pan_shp), wxNullBitmap, _T(""), TIPS_DWG);
bgimgtbar->AddCheckTool(DRAG_BGIMG, _T("Pan background"), wxBITMAP(pan_bg), wxNullBitmap, _T(""), TIPS_BGIMG);
//bgimgtbar->AddRadioTool(DRAG_BOTH, _T("Pan both"), wxBITMAP(pan_both), wxNullBitmap, _T(""), TIPS_BOTH);
bgimgtbar->Realize();
m_mgr.AddPane(bgimgtbar, wxAuiPaneInfo().Name(wxT("bgimgtbar")).Caption(TBNAME_BGIMG).
m_mgr.AddPane(bgimgtbar, wxAuiPaneInfo().Name(_T("bgimgtbar")).Caption(TBNAME_BGIMG).
ToolbarPane().Top().Position(2).Dockable(true).LeftDockable(false).RightDockable(false));
}
@ -318,37 +331,37 @@ void ASSDrawFrame::SetMenus()
bgimgMenu->Append(DRAG_DWG, _T("Pan/Zoom &Drawing\tShift+F1"), TIPS_DWG, wxITEM_CHECK);
bgimgMenu->Append(DRAG_BGIMG, _T("Pan/Zoom Back&ground\tShift+F2"), TIPS_BGIMG, wxITEM_CHECK);
bgimgMenu->AppendSeparator();
bgimgMenu->Append(MENU_BGIMG_ALPHA, _T("Set background image opacity"), "");
bgimgMenu->Append(MENU_BGIMG_ALPHA, _T("Set background image opacity"), _T(""));
wxMenu* reposbgMenu = new wxMenu;
reposbgMenu->Append( MENU_REPOS_BGTOPLEFT, "Top left\tCtrl+Shift+7" );
reposbgMenu->Append( MENU_REPOS_BGTOPRIGHT, "Top right\tCtrl+Shift+9" );
reposbgMenu->Append( MENU_REPOS_BGCENTER, "&Center\tCtrl+Shift+5" );
reposbgMenu->Append( MENU_REPOS_BGBOTLEFT, "Bottom left\tCtrl+Shift+1" );
reposbgMenu->Append( MENU_REPOS_BGBOTRIGHT, "Bottom right\tCtrl+Shift+3" );
reposbgMenu->Append( MENU_REPOS_BGTOPLEFT, _T("Top left\tCtrl+Shift+7") );
reposbgMenu->Append( MENU_REPOS_BGTOPRIGHT, _T("Top right\tCtrl+Shift+9") );
reposbgMenu->Append( MENU_REPOS_BGCENTER, _T("&Center\tCtrl+Shift+5") );
reposbgMenu->Append( MENU_REPOS_BGBOTLEFT, _T("Bottom left\tCtrl+Shift+1") );
reposbgMenu->Append( MENU_REPOS_BGBOTRIGHT, _T("Bottom right\tCtrl+Shift+3") );
bgimgMenu->Append(MENU_BGIMG_RECENTER, _T("Reposition [&0, 0]"), reposbgMenu);
bgimgMenu->Append(MENU_BGIMG_REMOVE, _T("Remove background\tShift+Del"), "");
bgimgMenu->Append(MENU_BGIMG_REMOVE, _T("Remove background\tShift+Del"), _T(""));
wxMenu* reposMenu = new wxMenu;
reposMenu->Append( MENU_REPOS_TOPLEFT, "Top left\tCtrl+7" );
reposMenu->Append( MENU_REPOS_TOPRIGHT, "Top right\tCtrl+9" );
reposMenu->Append( MENU_REPOS_CENTER, "&Center\tCtrl+5" );
reposMenu->Append( MENU_REPOS_BOTLEFT, "Bottom left\tCtrl+1" );
reposMenu->Append( MENU_REPOS_BOTRIGHT, "Bottom right\tCtrl+3" );
reposMenu->Append( MENU_REPOS_TOPLEFT, _T("Top left\tCtrl+7") );
reposMenu->Append( MENU_REPOS_TOPRIGHT, _T("Top right\tCtrl+9") );
reposMenu->Append( MENU_REPOS_CENTER, _T("&Center\tCtrl+5") );
reposMenu->Append( MENU_REPOS_BOTLEFT, _T("Bottom left\tCtrl+1") );
reposMenu->Append( MENU_REPOS_BOTRIGHT, _T("Bottom right\tCtrl+3") );
tbarMenu = new wxMenu;
tbarMenu->AppendCheckItem(MENU_TB_DRAW, TBNAME_DRAW);
tbarMenu->AppendCheckItem(MENU_TB_MODE, TBNAME_MODE);
tbarMenu->AppendCheckItem(MENU_TB_BGIMG, TBNAME_BGIMG);
tbarMenu->AppendSeparator();
tbarMenu->Append(MENU_TB_ALL, "Show all");
tbarMenu->Append(MENU_TB_NONE, "Hide all");
tbarMenu->Append(MENU_TB_DOCK, "Dock all");
tbarMenu->Append(MENU_TB_UNDOCK, "Undock all");
tbarMenu->Append(MENU_TB_ALL, _T("Show all"));
tbarMenu->Append(MENU_TB_NONE, _T("Hide all"));
tbarMenu->Append(MENU_TB_DOCK, _T("Dock all"));
tbarMenu->Append(MENU_TB_UNDOCK, _T("Undock all"));
viewMenu = new wxMenu;
viewMenu->Append(MENU_LIBRARY, _T("&Library"), TIPS_LIBRARY, wxITEM_CHECK);
if (settingsdlg)
viewMenu->Append(MENU_SETTINGS, _T("&Settings"), "", wxITEM_CHECK);
viewMenu->Append(MENU_SETTINGS, _T("&Settings"), _T(""), wxITEM_CHECK);
viewMenu->Append(MENU_TBAR, _T("&Toolbars"), tbarMenu);
viewMenu->Append(MENU_RECENTER, _T("Reposition [&0, 0]"), reposMenu);
viewMenu->AppendSeparator();
@ -372,41 +385,41 @@ void ASSDrawFrame::SetMenus()
void ASSDrawFrame::SetPanes()
{
m_mgr.AddPane(shapelib, wxAuiPaneInfo().Name(wxT("library")).Caption(wxT("Shapes Library")).
m_mgr.AddPane(shapelib, wxAuiPaneInfo().Name(_T("library")).Caption(_T("Shapes Library")).
Right().Layer(2).Position(0).CloseButton(true).BestSize(wxSize(120, 480)).MinSize(wxSize(100, 200)));
m_mgr.AddPane(m_canvas, wxAuiPaneInfo().Name(wxT("canvas")).CenterPane());
m_mgr.AddPane(m_canvas, wxAuiPaneInfo().Name(_T("canvas")).CenterPane());
m_mgr.AddPane(srctxtctrl, wxAuiPaneInfo().Name(wxT("commands")).Caption(wxT("Drawing commands")).
m_mgr.AddPane(srctxtctrl, wxAuiPaneInfo().Name(_T("commands")).Caption(_T("Drawing commands")).
Bottom().Layer(1).CloseButton(false).BestSize(wxSize(320, 48)));
if (settingsdlg)
m_mgr.AddPane(settingsdlg, wxAuiPaneInfo().Name(wxT("settings")).Caption(wxT("Settings")).
m_mgr.AddPane(settingsdlg, wxAuiPaneInfo().Name(_T("settings")).Caption(_T("Settings")).
Right().Layer(3).Position(0).CloseButton(true).BestSize(wxSize(240, 480)).MinSize(wxSize(200, 200)).Show(false));
}
ASSDrawFrame::~ASSDrawFrame()
{
config->SetPath("info");
config->Write("assdraw3.exe", wxStandardPaths::Get().GetExecutablePath());
config->Write("version", VERSION);
config->SetPath("..");
config->SetPath(_T("info"));
config->Write(_T("assdraw3.exe"), wxStandardPaths::Get().GetExecutablePath());
config->Write(_T("version"), VERSION);
config->SetPath(_T(".."));
SaveSettings();
config->SetPath("perspective");
config->Write("perspective", m_mgr.SavePerspective());
config->SetPath("..");
config->SetPath(_T("perspective"));
config->Write(_T("perspective"), m_mgr.SavePerspective());
config->SetPath(_T(".."));
config->DeleteGroup("library");
config->SetPath("library");
config->DeleteGroup(_T("library"));
config->SetPath(_T("library"));
typedef std::vector< ASSDrawShapePreview *> PrevVec;
PrevVec shapes = shapelib->GetShapePreviews();
int n = shapes.size();
config->Write("n", n);
config->Write(_T("n"), n);
for (int i = 0; i < n; i++)
config->Write(wxString::Format("%d",i), shapes[i]->GenerateASS());
config->SetPath("..");
config->Write(wxString::Format(_T("%d"),i), shapes[i]->GenerateASS());
config->SetPath(_T(".."));
wxFileOutputStream cfgf(configfile);
config->Save(cfgf);
@ -424,7 +437,7 @@ void ASSDrawFrame::_Clear()
if (msgb.ShowModal() == wxID_OK)
{
m_canvas->RefreshUndocmds();
m_canvas->AddUndo("Clear canvas");
m_canvas->AddUndo(_T("Clear canvas"));
m_canvas->ResetEngine(true);
wxSize siz = m_canvas->GetClientSize();
m_canvas->ChangeZoomLevelTo(DEFAULT_SCALE, wxPoint(siz.x / 2, siz.y / 2));
@ -486,7 +499,7 @@ void ASSDrawFrame::_Transform()
transformdlg->xformvals.f6,
transformdlg->xformvals.f7,
transformdlg->xformvals.f8 );
m_canvas->AddUndo("Transform");
m_canvas->AddUndo(_T("Transform"));
m_canvas->RefreshDisplay();
UpdateUndoRedoMenu();
}
@ -688,25 +701,25 @@ void ASSDrawFrame::UndoOrRedo(bool isundo)
void ASSDrawFrame::UpdateUndoRedoMenu()
{
wxString nextUndo = m_canvas->GetTopUndo();
if (nextUndo.IsSameAs(""))
if (nextUndo.IsSameAs(_T("")))
{
drawMenu->SetLabel(MENU_UNDO, "Undo\tCtrl+Z");
drawMenu->SetLabel(MENU_UNDO, _T("Undo\tCtrl+Z"));
drawMenu->Enable(MENU_UNDO, false);
}
else
{
drawMenu->SetLabel(MENU_UNDO, wxString::Format("Undo: %s\tCtrl+Z", nextUndo.c_str()));
drawMenu->SetLabel(MENU_UNDO, wxString::Format(_T("Undo: %s\tCtrl+Z"), nextUndo.c_str()));
drawMenu->Enable(MENU_UNDO, true);
}
wxString nextRedo = m_canvas->GetTopRedo();
if (nextRedo.IsSameAs(""))
if (nextRedo.IsSameAs(_T("")))
{
drawMenu->SetLabel(MENU_REDO, "Redo\tCtrl+Y");
drawMenu->SetLabel(MENU_REDO, _T("Redo\tCtrl+Y"));
drawMenu->Enable(MENU_REDO, false);
}
else
{
drawMenu->SetLabel(MENU_REDO, wxString::Format("Redo: %s\tCtrl+Y", nextRedo.c_str()));
drawMenu->SetLabel(MENU_REDO, wxString::Format(_T("Redo: %s\tCtrl+Y"), nextRedo.c_str()));
drawMenu->Enable(MENU_REDO, true);
}
}
@ -714,7 +727,7 @@ void ASSDrawFrame::UpdateUndoRedoMenu()
void ASSDrawFrame::UpdateFrameUI(unsigned level)
{
bool hasbg = m_canvas->HasBackgroundImage();
int zoom = (int) round(m_canvas->GetScale() * 100.0);
int zoom = (int) ((m_canvas->GetScale() * 100.0)+0.5);
switch (level)
{
case 0: // all
@ -749,7 +762,7 @@ void ASSDrawFrame::UpdateFrameUI(unsigned level)
#endif
case 3: // zoom slider
zoomslider->SetValue(zoom);
SetStatusText( wxString::Format("%d%%", zoom), 2 );
SetStatusText( wxString::Format(_T("%d%%"), zoom), 2 );
zoomslider->Enable(m_canvas->GetDragMode().drawing && m_canvas->CanZoom());
}
}
@ -758,7 +771,7 @@ void ASSDrawFrame::OnClose(wxCloseEvent &event)
{
if (event.CanVeto() && behaviors.confirmquit)
{
if (wxMessageDialog(this, wxT("Do you want to close ASSDraw3 now?"), wxT("Confirmation"), wxOK | wxCANCEL).ShowModal() == wxID_OK)
if (wxMessageDialog(this, _T("Do you want to close ASSDraw3 now?"), _T("Confirmation"), wxOK | wxCANCEL).ShowModal() == wxID_OK)
Destroy();
else
event.Veto();

View file

@ -40,6 +40,7 @@
#include "_common.hpp"
#include <vector>
#include <wx/wxprec.h>
#include <wx/aui/aui.h>
#include <wx/fileconf.h>
#include <wx/help.h>
@ -50,7 +51,7 @@
#include "library.hpp" // shape library
//#define BETAVERSION 2
#define VERSION "3.0 final"
#define VERSION _T("3.0 final")
// this header file declares the following classes
class ASSDrawApp;

View file

@ -28,38 +28,38 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
APPICO ICON "../tsukasa.ico"
APPICO ICON "tsukasa.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//
ASSDRAW3_ BITMAP "../bitmaps/assdraw3.bmp"
NEW_ BITMAP "../bitmaps/new_.bmp"
SRC_ BITMAP "../bitmaps/src_.bmp"
PREVIEW_ BITMAP "../bitmaps/preview_.bmp"
ARR_ BITMAP "../bitmaps/arr_.bmp"
M_ BITMAP "../bitmaps/m_.bmp"
N_ BITMAP "../bitmaps/n_.bmp"
L_ BITMAP "../bitmaps/l_.bmp"
B_ BITMAP "../bitmaps/b_.bmp"
S_ BITMAP "../bitmaps/s_.bmp"
P_ BITMAP "../bitmaps/p_.bmp"
C_ BITMAP "../bitmaps/c_.bmp"
DEL_ BITMAP "../bitmaps/del_.bmp"
NUT_ BITMAP "../bitmaps/nut_.bmp"
SC_ROT_ BITMAP "../bitmaps/sc_rot_.bmp"
ROT_ BITMAP "../bitmaps/rot_.bmp"
HELP_ BITMAP "../bitmaps/help_.bmp"
TRANSFORM BITMAP "../bitmaps/transform.bmp"
PAN_SHP BITMAP "../bitmaps/pan_shp.bmp"
PAN_BG BITMAP "../bitmaps/pan_bg.bmp"
//PAN_BOTH BITMAP "../bitmaps/pan_both.bmp"
ADD BITMAP "../bitmaps/add_.bmp"
CHECK BITMAP "../bitmaps/check_.bmp"
UNCHECK BITMAP "../bitmaps/uncheck_.bmp"
DELCROSS BITMAP "../bitmaps/del_cross.bmp"
ASSDRAW3_ BITMAP "bitmaps/assdraw3.bmp"
NEW_ BITMAP "bitmaps/new_.bmp"
SRC_ BITMAP "bitmaps/src_.bmp"
PREVIEW_ BITMAP "bitmaps/preview_.bmp"
ARR_ BITMAP "bitmaps/arr_.bmp"
M_ BITMAP "bitmaps/m_.bmp"
N_ BITMAP "bitmaps/n_.bmp"
L_ BITMAP "bitmaps/l_.bmp"
B_ BITMAP "bitmaps/b_.bmp"
S_ BITMAP "bitmaps/s_.bmp"
P_ BITMAP "bitmaps/p_.bmp"
C_ BITMAP "bitmaps/c_.bmp"
DEL_ BITMAP "bitmaps/del_.bmp"
NUT_ BITMAP "bitmaps/nut_.bmp"
SC_ROT_ BITMAP "bitmaps/sc_rot_.bmp"
ROT_ BITMAP "bitmaps/rot_.bmp"
HELP_ BITMAP "bitmaps/help_.bmp"
TRANSFORM BITMAP "bitmaps/transform.bmp"
PAN_SHP BITMAP "bitmaps/pan_shp.bmp"
PAN_BG BITMAP "bitmaps/pan_bg.bmp"
//PAN_BOTH BITMAP "bitmaps/pan_both.bmp"
ADD BITMAP "bitmaps/add_.bmp"
CHECK BITMAP "bitmaps/check_.bmp"
UNCHECK BITMAP "bitmaps/uncheck_.bmp"
DELCROSS BITMAP "bitmaps/del_cross.bmp"
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////

View file

@ -97,7 +97,7 @@ void ASSDrawFrame::ApplySettings()
wxColourToAggRGBA(colors.library_shape, shapes[i]->rgba_shape);
shapelib->libarea->Refresh();
m_canvas->SetDrawCmdSet(wxT(behaviors.parse_spc? "m n l b s p c _":"m n l b _"));
m_canvas->SetDrawCmdSet(behaviors.parse_spc? _T("m n l b s p c _"):_T("m n l b _"));
UpdateASSCommandStringToSrcTxtCtrl(m_canvas->GenerateASS());
}
@ -122,9 +122,9 @@ void ASSDrawFrame::OnSettingsChanged(wxCommandEvent& event)
void ASSDrawFrame::LoadSettings()
{
#define CFGREADCOLOR(color) if (config->Read(#color, &tmpstr)) color.Set(tmpstr);
#define CFGREAD(var) config->Read(#var, &var);
config->SetPath("settings");
#define CFGREADCOLOR(color) if (config->Read(wxString(#color,wxConvUTF8), &tmpstr)) color.Set(tmpstr);
#define CFGREAD(var) config->Read(wxString(#var,wxConvUTF8), &var);
config->SetPath(_T("settings"));
wxString tmpstr;
CFGREADCOLOR(colors.canvas_bg)
CFGREADCOLOR(colors.canvas_shape_normal)
@ -152,14 +152,14 @@ void ASSDrawFrame::LoadSettings()
CFGREAD(behaviors.parse_spc)
CFGREAD(behaviors.nosplashscreen)
CFGREAD(behaviors.confirmquit)
config->SetPath("..");
config->SetPath(_T(".."));
}
void ASSDrawFrame::SaveSettings()
{
#define CFGWRITE(var) config->Write(#var, var);
#define CFGWRITECOLOR(color) config->Write(#color, color.GetAsString(wxC2S_HTML_SYNTAX));
config->SetPath("settings");
#define CFGWRITE(var) config->Write(wxString(#var,wxConvUTF8), var);
#define CFGWRITECOLOR(color) config->Write(wxString(#color,wxConvUTF8), color.GetAsString(wxC2S_HTML_SYNTAX));
config->SetPath(_T("settings"));
CFGWRITECOLOR(colors.canvas_bg)
CFGWRITECOLOR(colors.canvas_shape_normal)
CFGWRITECOLOR(colors.canvas_shape_preview)
@ -186,5 +186,5 @@ void ASSDrawFrame::SaveSettings()
CFGWRITE(behaviors.parse_spc)
CFGWRITE(behaviors.nosplashscreen)
CFGWRITE(behaviors.confirmquit)
config->SetPath("..");
config->SetPath(_T(".."));
}

View file

@ -121,7 +121,7 @@ ASSDrawCanvas::ASSDrawCanvas(wxWindow *parent, ASSDrawFrame *frame, int extrafla
// cursor = crosshair
SetCursor( *wxCROSS_CURSOR );
bgimg.alpha_dlg = new wxDialog(this, wxID_ANY, wxString("Background image opacity"));
bgimg.alpha_dlg = new wxDialog(this, wxID_ANY, wxString(_T("Background image opacity")));
bgimg.alpha_slider = new wxSlider(bgimg.alpha_dlg, TB_BGALPHA_SLIDER, 50, 0, 100, __DPDS__ , wxSL_LABELS);
bgimg.alpha_slider->SetSize(280, bgimg.alpha_slider->GetSize().y);
bgimg.alpha_dlg->Fit();
@ -149,7 +149,7 @@ ASSDrawCanvas::~ASSDrawCanvas()
void ASSDrawCanvas::ParseASS(wxString str, bool addundo)
{
if (addundo)
AddUndo(wxT("Modify drawing commands"));
AddUndo(_T("Modify drawing commands"));
ASSDrawEngine::ParseASS(str);
@ -309,7 +309,7 @@ void ASSDrawCanvas::OnMouseMove(wxMouseEvent &event)
rectbound2[rectbound2upd].x += diff.x, rectbound2[rectbound2upd].y += diff.y;
rectbound2[rectbound2upd2].x += diff.x, rectbound2[rectbound2upd2].y += diff.y;
}
undodesc = "Bilinear transform";
undodesc = _T("Bilinear transform");
*dragAnchor_left = mouse_point;
break;
case MODE_SCALEROTATE:
@ -400,7 +400,7 @@ void ASSDrawCanvas::OnMouseMove(wxMouseEvent &event)
}
UpdateTranformModeRectCenter();
//*dragAnchor_left = mouse_point;
undodesc = "Scale";
undodesc = _T("Scale");
break;
}
@ -429,12 +429,12 @@ void ASSDrawCanvas::OnMouseMove(wxMouseEvent &event)
EnforceC1Continuity (mousedownAt_point->cmd_main, mousedownAt_point);
RefreshDisplay();
if (undodesc == "")
if (undodesc == _T(""))
{
if (mousedownAt_point->type == MP)
undodesc = wxT("Drag point");
undodesc = _T("Drag point");
else
undodesc = wxT("Drag control point");
undodesc = _T("Drag control point");
}
}
}
@ -448,7 +448,7 @@ void ASSDrawCanvas::OnMouseMove(wxMouseEvent &event)
pointsys->originx = wxp.x;
pointsys->originy = wxp.y;
RefreshDisplay();
undodesc = wxT("Move origin");
undodesc = _T("Move origin");
}
}
else if (dragAnchor_left != NULL)
@ -494,7 +494,7 @@ void ASSDrawCanvas::OnMouseMove(wxMouseEvent &event)
}
UpdateNonUniformTransformation();
RefreshDisplay();
undodesc = "Rotate";
undodesc = _T("Rotate");
}
}
else if (CanMove())
@ -598,12 +598,12 @@ void ASSDrawCanvas::OnMouseMove(wxMouseEvent &event)
if (hasStatusBar)
{
m_frame->SetStatusText(
wxString::Format( wxT("%5d %5d"), (int)wx, (int)wy ), 0 );
wxString::Format( _T("%5d %5d"), (int)wx, (int)wy ), 0 );
if (pointedAt_point == NULL ||
(newcommand != NULL && !newcommand->initialized) )
m_frame->SetStatusText( wxT(""), 1 );
m_frame->SetStatusText( _T(""), 1 );
else
m_frame->SetStatusText( wxT(" ") + pointedAt_point->cmd_main->ToString().Upper(), 1 );
m_frame->SetStatusText( _T(" ") + pointedAt_point->cmd_main->ToString().Upper(), 1 );
}
}
@ -626,11 +626,11 @@ void ASSDrawCanvas::ProcessOnMouseLeftUp()
switch (newcommand->type)
{
case M:
undodesc = wxT("Add a new M"); break;
undodesc = _T("Add a new M"); break;
case L:
undodesc = wxT("Add a new L"); break;
undodesc = _T("Add a new L"); break;
case B:
undodesc = wxT("Add a new B"); break;
undodesc = _T("Add a new B"); break;
}
newcommand = NULL;
// we need to manually refresh the GUI to draw the new control points
@ -655,11 +655,11 @@ void ASSDrawCanvas::ProcessOnMouseLeftUp()
switch (t)
{
case M:
undodesc = wxT("Delete a M"); break;
undodesc = _T("Delete a M"); break;
case L:
undodesc = wxT("Delete a L"); break;
undodesc = _T("Delete a L"); break;
case B:
undodesc = wxT("Delete a B"); break;
undodesc = _T("Delete a B"); break;
}
}
else
@ -690,10 +690,10 @@ void ASSDrawCanvas::ProcessOnMouseLeftUp()
rectbound2upd2 = -1;
backupowner = NONE;
if (!undodesc.IsSameAs(""))
if (!undodesc.IsSameAs(_T("")))
{
AddUndo( undodesc );
undodesc = "";
undodesc = _T("");
RefreshUndocmds();
}
@ -834,10 +834,10 @@ void ASSDrawCanvas::ProcessOnMouseRightUp()
rectbound2upd2 = -1;
backupowner = NONE;
if (!undodesc.IsSameAs(""))
if (!undodesc.IsSameAs(_T("")))
{
AddUndo( undodesc );
undodesc = "";
undodesc = _T("");
RefreshUndocmds();
}
@ -882,14 +882,14 @@ void ASSDrawCanvas::OnMouseRightDClick(wxMouseEvent& event)
switch (dblclicked_point_right->cmd_main->type)
{
case L:
menu->Append(MENU_DRC_LNTOBEZ, "Convert to Bezier curve (B command)");
menu->Append(MENU_DRC_LNTOBEZ, _T("Convert to Bezier curve (B command)"));
break;
case B:
if (dblclicked_point_right->type != MP) break;
menu->AppendCheckItem(MENU_DRC_BEZTOLN, "Convert to line (L command)");
menu->AppendCheckItem(MENU_DRC_BEZTOLN, _T("Convert to line (L command)"));
if (dblclicked_point_right->cmd_next && dblclicked_point_right->cmd_next->type == B)
{
menu->AppendCheckItem(MENU_DRC_C1CONTBEZ, "Smooth connection");
menu->AppendCheckItem(MENU_DRC_C1CONTBEZ, _T("Smooth connection"));
if (static_cast<DrawCmd_B*>(dblclicked_point_right->cmd_main)->C1Cont)
menu->Check(MENU_DRC_C1CONTBEZ, true);
}
@ -899,7 +899,7 @@ void ASSDrawCanvas::OnMouseRightDClick(wxMouseEvent& event)
}
else
{
menu->Append(MENU_DRC_MOVE00, "Move [0,0] here");
menu->Append(MENU_DRC_MOVE00, _T("Move [0,0] here"));
menu->AppendSeparator();
menu->AppendRadioItem(MODE_ARR, _T("Mode: D&rag"));
menu->AppendRadioItem(MODE_M, _T("Mode: Draw &M"));
@ -1083,7 +1083,7 @@ void ASSDrawCanvas::MoveCanvasBackground(double xamount, double yamount)
void ASSDrawCanvas::OnSelect_ConvertLineToBezier(wxCommandEvent& WXUNUSED(event))
{
if (!dblclicked_point_right) return;
AddUndo( wxT("Convert Line to Bezier") );
AddUndo( _T("Convert Line to Bezier") );
DrawCmd_B *newB = new DrawCmd_B(dblclicked_point_right->x(), dblclicked_point_right->y(),
pointsys, dblclicked_point_right->cmd_main);
InsertCmd ( newB, dblclicked_point_right->cmd_main );
@ -1099,7 +1099,7 @@ void ASSDrawCanvas::OnSelect_ConvertLineToBezier(wxCommandEvent& WXUNUSED(event)
void ASSDrawCanvas::OnSelect_ConvertBezierToLine(wxCommandEvent& WXUNUSED(event))
{
if (!dblclicked_point_right) return;
AddUndo( wxT("Convert Bezier to Line") );
AddUndo( _T("Convert Bezier to Line") );
DrawCmd_L *newL = new DrawCmd_L(dblclicked_point_right->x(), dblclicked_point_right->y(), pointsys, dblclicked_point_right->cmd_main);
InsertCmd ( newL, dblclicked_point_right->cmd_main );
ClearPointsSelection();
@ -1115,14 +1115,14 @@ void ASSDrawCanvas::OnSelect_C1ContinuityBezier(wxCommandEvent& WXUNUSED(event))
{
if (!dblclicked_point_right) return;
DrawCmd_B *cmdb = static_cast<DrawCmd_B*>(dblclicked_point_right->cmd_main);
AddUndo( wxT(cmdb->C1Cont? "Unset continuous":"Set continuous") );
AddUndo( cmdb->C1Cont? _T("Unset continuous"):_T("Set continuous") );
cmdb->C1Cont = !cmdb->C1Cont;
RefreshUndocmds();
}
void ASSDrawCanvas::OnSelect_Move00Here(wxCommandEvent& WXUNUSED(event))
{
AddUndo( wxT("Move origin") );
AddUndo( _T("Move origin") );
int wx, wy;
pointsys->FromWxPoint(mouse_point, wx, wy);
wxPoint wxp = pointsys->ToWxPoint(wx, wy);
@ -1175,7 +1175,7 @@ void ASSDrawCanvas::EnforceC1Continuity (DrawCmd* cmd, Point* pnt)
// Undo/Redo system
void ASSDrawCanvas::AddUndo( wxString desc )
{
PrepareUndoRedo(_undo, false, "", desc);
PrepareUndoRedo(_undo, false, _T(""), desc);
undos.push_back( _undo );
// also empty redos
redos.clear();
@ -1194,7 +1194,7 @@ bool ASSDrawCanvas::UndoOrRedo(bool isundo)
// push into sub
UndoRedo nr(r);
PrepareUndoRedo(nr, true, GenerateASS(), r.desc);
//PrepareUndoRedo(nr, false, "", r.desc);
//PrepareUndoRedo(nr, false, _T(""), r.desc);
sub->push_back( nr );
// parse
r.Export(this);
@ -1226,7 +1226,7 @@ bool ASSDrawCanvas::Redo()
wxString ASSDrawCanvas::GetTopUndo()
{
if (undos.empty())
return "";
return _T("");
else
return undos.back().desc;
}
@ -1234,7 +1234,7 @@ wxString ASSDrawCanvas::GetTopUndo()
wxString ASSDrawCanvas::GetTopRedo()
{
if (redos.empty())
return "";
return _T("");
else
return redos.back().desc;
}
@ -1500,7 +1500,7 @@ void ASSDrawCanvas::DoDraw( RendererBase& rbase, RendererPrimitives& rprim, Rend
t.size(8.0);
wxPoint pxy = hilite_point->ToWxPoint(true);
t.start_point(pxy.x + 5, pxy.y -5 );
t.text(wxString::Format("%d,%d", hilite_point->x(), hilite_point->y()));
t.text(wxString::Format(_T("%d,%d"), hilite_point->x(), hilite_point->y()).mb_str(wxConvUTF8));
agg::conv_stroke< agg::gsv_text > pt(t);
pt.line_cap(agg::round_cap);
pt.line_join(agg::round_join);
@ -1575,7 +1575,7 @@ void ASSDrawCanvas::DoDraw( RendererBase& rbase, RendererPrimitives& rprim, Rend
txt.flip(true);
txt.size(6.0);
txt.start_point(s, 20);
txt.text(wxString::Format("%d", t));
txt.text(wxString::Format(_T("%d"), t).mb_str(wxConvUTF8));
agg::conv_stroke< agg::gsv_text > pt(txt);
rasterizer.add_path(pt);
}
@ -1615,7 +1615,7 @@ void ASSDrawCanvas::DoDraw( RendererBase& rbase, RendererPrimitives& rprim, Rend
txt.flip(true);
txt.size(6.0);
txt.start_point(12, s);
txt.text(wxString::Format("%d", t));
txt.text(wxString::Format(_T("%d"), t).mb_str(wxConvUTF8));
agg::conv_stroke< agg::gsv_text > pt(txt);
rasterizer.add_path(pt);
}
@ -1641,14 +1641,14 @@ void ASSDrawCanvas::DoDraw( RendererBase& rbase, RendererPrimitives& rprim, Rend
void ASSDrawCanvas::ReceiveBackgroundImageFileDropEvent(const wxString& filename)
{
const wxChar *shortfname = wxFileName::FileName(filename).GetFullName().c_str();
m_frame->SetStatusText(wxString::Format("Loading '%s' as canvas background ...", shortfname), 1);
m_frame->SetStatusText(wxString::Format(_T("Loading '%s' as canvas background ..."), shortfname), 1);
wxImage img;
img.LoadFile(filename);
if (img.IsOk())
{
SetBackgroundImage(img, filename);
}
m_frame->SetStatusText(wxT("Canvas background loaded"), 1);
m_frame->SetStatusText(_T("Canvas background loaded"), 1);
}
void ASSDrawCanvas::RemoveBackgroundImage()
@ -1657,7 +1657,7 @@ void ASSDrawCanvas::RemoveBackgroundImage()
bgimg.bgimg = NULL;
if (bgimg.bgbmp) delete bgimg.bgbmp;
bgimg.bgbmp = NULL;
bgimg.bgimgfile = "";
bgimg.bgimgfile = _T("");
RefreshDisplay();
drag_mode = DRAGMODE();
bgimg.alpha_dlg->Show(false);
@ -1834,7 +1834,7 @@ void ASSDrawCanvas::UpdateNonUniformTransformation()
void ASSDrawCanvas::CustomOnKeyDown(wxKeyEvent &event)
{
int keycode = event.GetKeyCode();
//m_frame->SetStatusText(wxString::Format("Key: %d", keycode));
//m_frame->SetStatusText(wxString::Format(_T("Key: %d"), keycode));
double scrollamount = (event.GetModifiers() == wxMOD_CMD? 10.0:1.0);
if (event.GetModifiers() == wxMOD_SHIFT)
{
@ -1885,7 +1885,7 @@ void ASSDrawCanvas::CustomOnKeyDown(wxKeyEvent &event)
while(it != cmds.end())
{
wxPoint point = (*it)->m_point->ToWxPoint();
double distance = sqrt(pow(point.x - mouse_point.x, 2) + pow(point.y - mouse_point.y, 2));
double distance = sqrt(pow(double(point.x - mouse_point.x), 2) + pow(double(point.y - mouse_point.y), 2));
if (nearest == NULL || distance < dist)
{
nearest = (*it)->m_point;
@ -1895,7 +1895,7 @@ void ASSDrawCanvas::CustomOnKeyDown(wxKeyEvent &event)
while (it2 != (*it)->controlpoints.end())
{
wxPoint point = (*it2)->ToWxPoint();
double distance = sqrt(pow(point.x - mouse_point.x, 2) + pow(point.y - mouse_point.y, 2));
double distance = sqrt(pow((double)point.x - mouse_point.x, 2) + pow((double)point.y - mouse_point.y, 2));
if (nearest == NULL || distance < dist)
{
nearest = (*it2);
@ -2020,7 +2020,7 @@ void UndoRedo::Export(ASSDrawCanvas *canvas)
if (canvas->bgimg.bgimgfile != this->bgimgfile)
{
canvas->RemoveBackgroundImage();
if (!this->bgimgfile.IsSameAs("<clipboard>") && ::wxFileExists(this->bgimgfile))
if (!this->bgimgfile.IsSameAs(_T("<clipboard>")) && ::wxFileExists(this->bgimgfile))
{
canvas->bgimg.alpha = this->bgalpha;
canvas->ReceiveBackgroundImageFileDropEvent(this->bgimgfile);

View file

@ -279,7 +279,7 @@ protected:
// after the bounding quadrangle has changed, update the shape to fill up inside it
virtual void UpdateNonUniformTransformation();
friend class UndoRedo;
friend struct UndoRedo;
DECLARE_EVENT_TABLE()
};
@ -295,6 +295,7 @@ public:
virtual bool OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filenames)
{
m_canvas->ReceiveBackgroundImageFileDropEvent(filenames.Item(0));
return true;
}
protected:

View file

@ -68,7 +68,7 @@ DrawCmd_L::DrawCmd_L ( int x, int y, PointSystem *ps, DrawCmd *prev )
// to ASS drawing command
wxString DrawCmd_L::ToString()
{
return wxString::Format(wxT("l %d %d"), m_point->x(), m_point->y());
return wxString::Format(_T("l %d %d"), m_point->x(), m_point->y());
}
@ -129,9 +129,9 @@ wxString DrawCmd_B::ToString()
Point* c1 = (*iterate++);
Point* c2 = (*iterate);
if (initialized)
return wxString::Format(wxT("b %d %d %d %d %d %d"), c1->x(), c1->y(), c2->x(), c2->y(), m_point->x(), m_point->y());
return wxString::Format(_T("b %d %d %d %d %d %d"), c1->x(), c1->y(), c2->x(), c2->y(), m_point->x(), m_point->y());
else
return wxString::Format(wxT("b ? ? ? ? %d %d"), m_point->x(), m_point->y());
return wxString::Format(_T("b ? ? ? ? %d %d"), m_point->x(), m_point->y());
}
@ -162,7 +162,7 @@ DrawCmd_S::DrawCmd_S
int ix = *it; it++;
int iy = *it; it++;
n++;
//::wxLogMessage("%d %d\n", ix, iy);
//::wxLogMessage(_T("%d %d\n"), ix, iy);
controlpoints.push_back( new Point( ix, iy, ps, CP, this, n ) );
}
@ -202,11 +202,11 @@ wxString DrawCmd_S::ToString()
for (; iterate != controlpoints.end(); iterate++)
{
if (initialized)
assout = wxString::Format(wxT("%s %d %d"), assout.c_str(), (*iterate)->x(), (*iterate)->y());
assout = wxString::Format(_T("%s %d %d"), assout.c_str(), (*iterate)->x(), (*iterate)->y());
else
assout = wxString::Format(wxT("%s ? ?"), assout.c_str());
assout = wxString::Format(_T("%s ? ?"), assout.c_str());
}
assout = wxString::Format(wxT("%s %d %d"), assout.c_str(), m_point->x(), m_point->y());
if (closed) assout = wxString::Format(wxT("%s c"), assout.c_str());
assout = wxString::Format(_T("%s %d %d"), assout.c_str(), m_point->x(), m_point->y());
if (closed) assout = wxString::Format(_T("%s c"), assout.c_str());
return assout;
}

2
assdraw/src/convert.bat Normal file
View file

@ -0,0 +1,2 @@
perl t-stringifier.pl agg_bcspline.h agg_conv_bcspline.h agg_vcgen_bcspline.h resource.h agg_bcspline.cpp agg_vcgen_bcspline.cpp assdraw.cpp assdraw_settings.cpp canvas.cpp canvas_mouse.cpp cmd.cpp dlgctrl.cpp engine.cpp library.cpp settings.cpp
pause

View file

@ -52,7 +52,7 @@ END_EVENT_TABLE()
// ----------------------------------------------------------------------------
ASSDrawSrcTxtCtrl::ASSDrawSrcTxtCtrl(wxWindow *parent, ASSDrawFrame *frame)
: wxTextCtrl(parent, wxID_ANY, "", __DPDS__ , wxTE_MULTILINE )
: wxTextCtrl(parent, wxID_ANY, _T(""), __DPDS__ , wxTE_MULTILINE )
{
m_frame = frame;
}
@ -67,7 +67,7 @@ void ASSDrawSrcTxtCtrl::CustomOnChar(wxKeyEvent &event)
case WXK_TAB:
break; //do nothing
default:
//m_frame->SetTitle(wxString::Format("Key: %d", event.GetKeyCode()));
//m_frame->SetTitle(wxString::Format(_T("Key: %d"), event.GetKeyCode()));
event.Skip(true);
}
@ -185,14 +185,14 @@ void ASSDrawTransformDlg::OnTemplatesCombo(wxCommandEvent &event)
if (pos == -1)
return;
txtctrl_m11->SetValue( wxString::Format("%.1f", combo_templatesValues[pos].f1) );
txtctrl_m12->SetValue( wxString::Format("%.1f", combo_templatesValues[pos].f2) );
txtctrl_m21->SetValue( wxString::Format("%.1f", combo_templatesValues[pos].f3) );
txtctrl_m22->SetValue( wxString::Format("%.1f", combo_templatesValues[pos].f4) );
txtctrl_mx->SetValue( wxString::Format("%.1f", combo_templatesValues[pos].f5) );
txtctrl_my->SetValue( wxString::Format("%.1f", combo_templatesValues[pos].f6) );
txtctrl_nx->SetValue( wxString::Format("%.1f", combo_templatesValues[pos].f7) );
txtctrl_ny->SetValue( wxString::Format("%.1f", combo_templatesValues[pos].f8) );
txtctrl_m11->SetValue( wxString::Format(_T("%.1f"), combo_templatesValues[pos].f1) );
txtctrl_m12->SetValue( wxString::Format(_T("%.1f"), combo_templatesValues[pos].f2) );
txtctrl_m21->SetValue( wxString::Format(_T("%.1f"), combo_templatesValues[pos].f3) );
txtctrl_m22->SetValue( wxString::Format(_T("%.1f"), combo_templatesValues[pos].f4) );
txtctrl_mx->SetValue( wxString::Format(_T("%.1f"), combo_templatesValues[pos].f5) );
txtctrl_my->SetValue( wxString::Format(_T("%.1f"), combo_templatesValues[pos].f6) );
txtctrl_nx->SetValue( wxString::Format(_T("%.1f"), combo_templatesValues[pos].f7) );
txtctrl_ny->SetValue( wxString::Format(_T("%.1f"), combo_templatesValues[pos].f8) );
}
void ASSDrawTransformDlg::EndModal(int retCode)
@ -217,7 +217,7 @@ void ASSDrawTransformDlg::EndModal(int retCode)
if (ok)
wxDialog::EndModal(wxID_OK);
else
wxMessageBox("One or more values entered are not real numbers.\nPlease fix.", _T("Value error"), wxOK | wxICON_INFORMATION, m_frame);
wxMessageBox(_T("One or more values entered are not real numbers.\nPlease fix."), _T("Value error"), wxOK | wxICON_INFORMATION, m_frame);
}
@ -228,7 +228,7 @@ ASSDrawAboutDlg::ASSDrawAboutDlg(ASSDrawFrame *parent, unsigned timeout)
SetBackgroundColour(*wxWHITE);
htmlwin = new wxHtmlWindow(this, wxID_ANY, wxDefaultPosition, wxSize(396, 200), wxHW_DEFAULT_STYLE | wxSIMPLE_BORDER);
htmlwin->SetPage(
"<html><body> \
_T("<html><body> \
<p>ASSDraw3 is a tool for designing shapes to be used in ASS subtitle file. \
<p>To add lines or curves, initiate the draw mode by clicking on the drawing tools. \
Then, either click on empty space or drag from an existing point to add the new lines/curves. \
@ -253,7 +253,7 @@ Control points for Bezier curves are generated once you release the mouse button
<li> jfs, ArchMageZeratul, RoRo and everyone at Aegisub's forum <a href=\"http://malakith.net/aegisub\">http://malakith.net/aegisub</a> for all suggestions and supports. \
</ul> \
<p>ai-chan recommends Aegisub for all your subtitle and typesetting needs! \
</body></html>"
</body></html>")
);
htmlwin->Connect(wxEVT_COMMAND_HTML_LINK_CLICKED, wxHtmlLinkEventHandler(ASSDrawAboutDlg::OnURL), NULL, this);
@ -263,7 +263,7 @@ Control points for Bezier curves are generated once you release the mouse button
sizer->Add(new BigStaticBitmapCtrl(this, wxBITMAP(assdraw3_), *wxWHITE, this), 1, wxEXPAND);
sizer->Add(htmlwin, 1, wxLEFT | wxRIGHT, 2);
sizer->Add(new wxStaticText(this, wxID_ANY, wxString::Format("Version: %s", VERSION)), 1, wxEXPAND | wxALL, 2);
sizer->Add(new wxStaticText(this, wxID_ANY, wxString::Format(_T("Version: %s"), VERSION)), 1, wxEXPAND | wxALL, 2);
sizer->Add(new wxButton(this, wxID_OK), 0, wxALIGN_CENTER | wxBOTTOM, 10);
SetSizer(sizer);
sizer->Layout();
@ -286,13 +286,13 @@ int ASSDrawAboutDlg::ShowModal()
{
if (time_out > 0)
timer.Start(time_out * 1000, true);
wxDialog::ShowModal();
return wxDialog::ShowModal();
}
void ASSDrawAboutDlg::OnURL(wxHtmlLinkEvent &event)
{
wxString URL(event.GetLinkInfo().GetHref());
if (URL.StartsWith("http://"))
if (URL.StartsWith(_T("http://")))
::wxLaunchDefaultBrowser(URL);
else
event.Skip(true);

View file

@ -139,7 +139,7 @@ ASSDrawEngine::ASSDrawEngine( wxWindow *parent, int extraflags )
setfitviewpoint = false;
rgba_shape = agg::rgba(0,0,1);
color_bg = PixelFormat::AGGType::color_type(255, 255, 255);
drawcmdset = wxT("m n l b s p c _"); //the spaces and underscore are in there for a reason, guess?
drawcmdset = _T("m n l b s p c _"); //the spaces and underscore are in there for a reason, guess?
ResetEngine();
}
@ -156,10 +156,10 @@ int ASSDrawEngine::ParseASS ( wxString str )
str.Replace(_T("\t"), _T(""));
str.Replace(_T("\r"), _T(""));
str.Replace(_T("\n"), _T(""));
str = str.Lower() + wxT(" _ _");
str = str.Lower() + _T(" _ _");
// we don't use regex because the pattern is too simple
wxStringTokenizer tkz( str, wxT(" ") );
wxString currcmd(wxT(""));
wxStringTokenizer tkz( str, _T(" ") );
wxString currcmd(_T(""));
std::vector<int> val;
wxString token;
long tmp_int;
@ -180,7 +180,7 @@ int ASSDrawEngine::ParseASS ( wxString str )
done = true;
// N
if (currcmd.IsSameAs(wxT("n")) && val.size() >= 2)
if (currcmd.IsSameAs(_T("n")) && val.size() >= 2)
{
tmp_n_pnt.x = val[0], tmp_n_pnt.y = val[1];
n_collected = true;
@ -194,7 +194,7 @@ int ASSDrawEngine::ParseASS ( wxString str )
if (s_command != NULL)
{
bool ends = true;
if (currcmd.IsSameAs(wxT("p"))&& val.size() >= 2)
if (currcmd.IsSameAs(_T("p"))&& val.size() >= 2)
{
s_command->m_point->type = CP;
s_command->m_point->num = s_command->controlpoints.size() + 1;
@ -202,7 +202,7 @@ int ASSDrawEngine::ParseASS ( wxString str )
s_command->m_point = new Point(val[0], val[1], pointsys, MP, s_command);
ends = false;
}
else if (currcmd.IsSameAs(wxT("c")))
else if (currcmd.IsSameAs(_T("c")))
s_command->closed = true;
if (ends)
@ -213,11 +213,11 @@ int ASSDrawEngine::ParseASS ( wxString str )
}
// M
if (currcmd.IsSameAs(wxT("m")) && val.size() >= 2)
if (currcmd.IsSameAs(_T("m")) && val.size() >= 2)
AppendCmd ( M, val[0], val[1] );
// L
if (currcmd.IsSameAs(wxT("l")) && val.size() >= 2)
if (currcmd.IsSameAs(_T("l")) && val.size() >= 2)
{
AppendCmd ( L, val[0], val[1] );
val.erase(val.begin(), val.begin()+2);
@ -227,7 +227,7 @@ int ASSDrawEngine::ParseASS ( wxString str )
}
// B
if (currcmd.IsSameAs(wxT("b")) && val.size() >= 6)
if (currcmd.IsSameAs(_T("b")) && val.size() >= 6)
{
AppendCmd ( new DrawCmd_B(val[4], val[5], val[0], val[1],
val[2], val[3], pointsys, LastCmd()) );
@ -238,7 +238,7 @@ int ASSDrawEngine::ParseASS ( wxString str )
}
// S
if (currcmd.IsSameAs(wxT("s")) && val.size() >= 6)
if (currcmd.IsSameAs(_T("s")) && val.size() >= 6)
{
int num = (val.size() / 2) * 2;
std::vector<int> val2;

View file

@ -40,7 +40,7 @@ ASSDrawShapePreview::ASSDrawShapePreview( wxWindow *parent, ASSDrawShapeLibrary
shapelib = _shapelib;
if (ParseASS(initialcmds) > 0)
SetFitToViewPointOnNextPaint(5, 5);
cb = new wxCheckBox(this, wxID_ANY, "");
cb = new wxCheckBox(this, wxID_ANY, _T(""));
}
void ASSDrawShapePreview::OnSize(wxSizeEvent& event)
@ -72,11 +72,11 @@ ASSDrawShapeLibrary::ASSDrawShapeLibrary( wxWindow *parent, ASSDrawFrame *frame
wxToolBar *tbar = new wxToolBar(this, wxID_ANY, __DPDS__ , wxTB_HORIZONTAL | wxNO_BORDER | wxTB_FLAT | wxTB_NODIVIDER);
tbar->SetMargins(0, 3);
tbar->AddTool(TOOL_SAVE, wxBITMAP(add), "Save canvas");
tbar->AddTool(TOOL_SAVE, wxBITMAP(add), _T("Save canvas"));
tbar->AddSeparator();
tbar->AddTool(TOOL_CHECK, wxBITMAP(check), "Select all");
tbar->AddTool(TOOL_UNCHECK, wxBITMAP(uncheck), "Select none");
tbar->AddTool(TOOL_DELETE, wxBITMAP(delcross), "Delete selected");
tbar->AddTool(TOOL_CHECK, wxBITMAP(check), _T("Select all"));
tbar->AddTool(TOOL_UNCHECK, wxBITMAP(uncheck), _T("Select none"));
tbar->AddTool(TOOL_DELETE, wxBITMAP(delcross), _T("Delete selected"));
libarea = new wxScrolledWindow(this, wxID_ANY, __DPDS__ , wxScrolledWindowStyle | wxSIMPLE_BORDER);
libarea->SetBackgroundColour(wxColour(0xFF, 0xFF, 0x99));
@ -152,17 +152,17 @@ void ASSDrawShapeLibrary::OnMouseRightClick(wxMouseEvent &event)
{
activepreview = prev;
wxMenu *menu = new wxMenu;
wxMenuItem *menuload = new wxMenuItem(menu, MENU_LOAD, wxT("Load to canvas"));
wxMenuItem *menuload = new wxMenuItem(menu, MENU_LOAD, _T("Load to canvas"));
wxFont f = menuload->GetFont();
f.SetWeight(wxFONTWEIGHT_BOLD);
menuload->SetFont(f);
menu->Append(menuload);
//menu->Append(MENU_LOAD, wxT("Load to canvas"))->GetFont().SetWeight(wxFONTWEIGHT_BOLD);
menu->Append(MENU_COPYCLIPBOARD, wxT("Copy commands to clipboard"));
menu->Append(MENU_SAVECANVAS, wxT("Save canvas here"));
//menu->Append(MENU_LOAD, _T("Load to canvas"))->GetFont().SetWeight(wxFONTWEIGHT_BOLD);
menu->Append(MENU_COPYCLIPBOARD, _T("Copy commands to clipboard"));
menu->Append(MENU_SAVECANVAS, _T("Save canvas here"));
wxMenu *submenu = new wxMenu;
submenu->Append(MENU_DELETE, wxT("Confirm delete?"));
menu->Append(MENU_DUMMY, wxT("Delete from library"), submenu);
submenu->Append(MENU_DELETE, _T("Confirm delete?"));
menu->Append(MENU_DUMMY, _T("Delete from library"), submenu);
PopupMenu(menu);
delete menu;
}
@ -251,7 +251,7 @@ std::vector< ASSDrawShapePreview *> ASSDrawShapeLibrary::GetShapePreviews()
void ASSDrawShapeLibrary::LoadToCanvas(ASSDrawShapePreview *preview)
{
m_frame->m_canvas->AddUndo("Load shape from library");
m_frame->m_canvas->AddUndo(_T("Load shape from library"));
m_frame->m_canvas->ParseASS(preview->GenerateASS());
m_frame->m_canvas->RefreshDisplay();
m_frame->m_canvas->RefreshUndocmds();

View file

@ -65,44 +65,44 @@ void ASSDrawSettingsDialog::Init()
//wxSUNKEN_BORDER
);
#define APPENDCOLOURPROP(pgid, label, color) pgid = propgrid->Append( wxColourProperty(wxT(label), wxPG_LABEL, color) );
#define APPENDCOLOURPROP(pgid, label, color) pgid = propgrid->Append( wxColourProperty(label, wxPG_LABEL, color) );
#define APPENDUINTPROP(pgid, label, uint) \
pgid = propgrid->Append( wxUIntProperty(wxT(label), wxPG_LABEL, uint) ); \
pgid = propgrid->Append( wxUIntProperty(label, wxPG_LABEL, uint) ); \
propgrid->SetPropertyValidator( pgid, validator );
#define APPENDBOOLPROP(pgid, label, boolvar) \
pgid = propgrid->Append( wxBoolProperty ( wxT(label), wxPG_LABEL, boolvar ) ); \
pgid = propgrid->Append( wxBoolProperty (label, wxPG_LABEL, boolvar ) ); \
propgrid->SetPropertyAttribute( pgid, wxPG_BOOL_USE_CHECKBOX, (long)1 );
wxLongPropertyValidator validator(0x0,0xFF);
propgrid->Append( wxPropertyCategory(wxT("Appearance"),wxPG_LABEL) );
APPENDCOLOURPROP(colors_canvas_bg_pgid, "Canvas", m_frame->colors.canvas_bg)
APPENDCOLOURPROP(colors_canvas_shape_normal_pgid, "Drawing", m_frame->colors.canvas_shape_normal)
APPENDUINTPROP(alphas_canvas_shape_normal_pgid, "Drawing @", m_frame->alphas.canvas_shape_normal)
APPENDCOLOURPROP(colors_canvas_shape_preview_pgid, "Preview", m_frame->colors.canvas_shape_preview)
APPENDUINTPROP(alphas_canvas_shape_preview_pgid, "Preview @", m_frame->alphas.canvas_shape_preview)
APPENDCOLOURPROP(colors_canvas_shape_outline_pgid, "Outline", m_frame->colors.canvas_shape_outline)
APPENDUINTPROP(alphas_canvas_shape_outline_pgid, "Outline @", m_frame->alphas.canvas_shape_outline)
APPENDCOLOURPROP(colors_canvas_shape_guideline_pgid, "Control lines", m_frame->colors.canvas_shape_guideline)
APPENDUINTPROP(alphas_canvas_shape_guideline_pgid, "Control lines @", m_frame->alphas.canvas_shape_guideline)
APPENDCOLOURPROP(colors_canvas_shape_mainpoint_pgid, "Points", m_frame->colors.canvas_shape_mainpoint)
APPENDUINTPROP(alphas_canvas_shape_mainpoint_pgid, "Points @", m_frame->alphas.canvas_shape_mainpoint)
APPENDCOLOURPROP(colors_canvas_shape_controlpoint_pgid, "Control points", m_frame->colors.canvas_shape_controlpoint)
APPENDUINTPROP(alphas_canvas_shape_controlpoint_pgid, "Control points @", m_frame->alphas.canvas_shape_controlpoint)
APPENDCOLOURPROP(colors_canvas_shape_selectpoint_pgid, "Selected points", m_frame->colors.canvas_shape_selectpoint)
APPENDUINTPROP(alphas_canvas_shape_selectpoint_pgid, "Selected points @", m_frame->alphas.canvas_shape_selectpoint)
APPENDCOLOURPROP(colors_library_libarea_pgid, "Library", m_frame->colors.library_libarea)
APPENDCOLOURPROP(colors_library_shape_pgid, "Library shapes", m_frame->colors.library_shape)
APPENDCOLOURPROP(colors_origin_pgid, "Origin", m_frame->colors.origin)
APPENDUINTPROP(sizes_origincross_pgid, "Origin cross size", m_frame->sizes.origincross)
APPENDCOLOURPROP(colors_ruler_h_pgid, "H ruler", m_frame->colors.ruler_h)
APPENDCOLOURPROP(colors_ruler_v_pgid, "V ruler", m_frame->colors.ruler_v)
propgrid->Append( wxPropertyCategory(_T("Appearance"),wxPG_LABEL) );
APPENDCOLOURPROP(colors_canvas_bg_pgid, _T("Canvas"), m_frame->colors.canvas_bg)
APPENDCOLOURPROP(colors_canvas_shape_normal_pgid, _T("Drawing"), m_frame->colors.canvas_shape_normal)
APPENDUINTPROP(alphas_canvas_shape_normal_pgid, _T("Drawing @"), m_frame->alphas.canvas_shape_normal)
APPENDCOLOURPROP(colors_canvas_shape_preview_pgid, _T("Preview"), m_frame->colors.canvas_shape_preview)
APPENDUINTPROP(alphas_canvas_shape_preview_pgid, _T("Preview @"), m_frame->alphas.canvas_shape_preview)
APPENDCOLOURPROP(colors_canvas_shape_outline_pgid, _T("Outline"), m_frame->colors.canvas_shape_outline)
APPENDUINTPROP(alphas_canvas_shape_outline_pgid, _T("Outline @"), m_frame->alphas.canvas_shape_outline)
APPENDCOLOURPROP(colors_canvas_shape_guideline_pgid, _T("Control lines"), m_frame->colors.canvas_shape_guideline)
APPENDUINTPROP(alphas_canvas_shape_guideline_pgid, _T("Control lines @"), m_frame->alphas.canvas_shape_guideline)
APPENDCOLOURPROP(colors_canvas_shape_mainpoint_pgid, _T("Points"), m_frame->colors.canvas_shape_mainpoint)
APPENDUINTPROP(alphas_canvas_shape_mainpoint_pgid, _T("Points @"), m_frame->alphas.canvas_shape_mainpoint)
APPENDCOLOURPROP(colors_canvas_shape_controlpoint_pgid, _T("Control points"), m_frame->colors.canvas_shape_controlpoint)
APPENDUINTPROP(alphas_canvas_shape_controlpoint_pgid, _T("Control points @"), m_frame->alphas.canvas_shape_controlpoint)
APPENDCOLOURPROP(colors_canvas_shape_selectpoint_pgid, _T("Selected points"), m_frame->colors.canvas_shape_selectpoint)
APPENDUINTPROP(alphas_canvas_shape_selectpoint_pgid, _T("Selected points @"), m_frame->alphas.canvas_shape_selectpoint)
APPENDCOLOURPROP(colors_library_libarea_pgid, _T("Library"), m_frame->colors.library_libarea)
APPENDCOLOURPROP(colors_library_shape_pgid, _T("Library shapes"), m_frame->colors.library_shape)
APPENDCOLOURPROP(colors_origin_pgid, _T("Origin"), m_frame->colors.origin)
APPENDUINTPROP(sizes_origincross_pgid, _T("Origin cross size"), m_frame->sizes.origincross)
APPENDCOLOURPROP(colors_ruler_h_pgid, _T("H ruler"), m_frame->colors.ruler_h)
APPENDCOLOURPROP(colors_ruler_v_pgid, _T("V ruler"), m_frame->colors.ruler_v)
propgrid->Append( wxPropertyCategory(wxT("Behaviors"),wxPG_LABEL) );
APPENDBOOLPROP(behaviors_capitalizecmds_pgid, "Capitalize commands", m_frame->behaviors.capitalizecmds);
APPENDBOOLPROP(behaviors_autoaskimgopac_pgid, "Ask for image opacity", m_frame->behaviors.autoaskimgopac);
APPENDBOOLPROP(behaviors_parse_spc_pgid, "Parse S/P/C", m_frame->behaviors.parse_spc);
APPENDBOOLPROP(behaviors_nosplashscreen_pgid, "No splash screen", m_frame->behaviors.nosplashscreen);
APPENDBOOLPROP(behaviors_confirmquit_pgid, "Confirm quit", m_frame->behaviors.confirmquit);
propgrid->Append( wxPropertyCategory(_T("Behaviors"),wxPG_LABEL) );
APPENDBOOLPROP(behaviors_capitalizecmds_pgid, _T("Capitalize commands"), m_frame->behaviors.capitalizecmds);
APPENDBOOLPROP(behaviors_autoaskimgopac_pgid, _T("Ask for image opacity"), m_frame->behaviors.autoaskimgopac);
APPENDBOOLPROP(behaviors_parse_spc_pgid, _T("Parse S/P/C"), m_frame->behaviors.parse_spc);
APPENDBOOLPROP(behaviors_nosplashscreen_pgid, _T("No splash screen"), m_frame->behaviors.nosplashscreen);
APPENDBOOLPROP(behaviors_confirmquit_pgid, _T("Confirm quit"), m_frame->behaviors.confirmquit);
wxFlexGridSizer *sizer = new wxFlexGridSizer(2, 1, 0, 0);
sizer->AddGrowableCol(0);
@ -110,10 +110,10 @@ void ASSDrawSettingsDialog::Init()
sizer->Add(propgrid, 1, wxEXPAND);
wxBoxSizer *bsizer = new wxBoxSizer(wxHORIZONTAL);
wxButton *abutton = new wxButton(this, wxID_ANY, "Apply");
wxButton *abutton = new wxButton(this, wxID_ANY, _T("Apply"));
abutton->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ASSDrawSettingsDialog::OnSettingsApplyButtonClicked), NULL, this);
bsizer->Add(abutton, 2, wxEXPAND);
wxButton *rbutton = new wxButton(this, wxID_ANY, "Revert");
wxButton *rbutton = new wxButton(this, wxID_ANY, _T("Revert"));
rbutton->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ASSDrawSettingsDialog::OnSettingsRevertButtonClicked), NULL, this);
bsizer->Add(rbutton, 1, wxEXPAND);
bsizer->Layout();

View file

@ -0,0 +1,58 @@
#!/usr/bin/perl
###########################
# t-stringifier.pl - replaces "strings" with _T("strings")
#
# Usage: t-stringifier.pl file1 [file2 [file...]]
# NOTE: changes existing files in place so backup stuff or rewrite the script
# (more specifically comment out the rename() call at the end of the main loop)
# if you're paranoid.
#
# Written by Karl Blomster 2008
# This script is in the public domain.
###########################
use warnings;
use strict;
my @infiles = @ARGV;
foreach my $infile (@infiles) {
my $outfile = $infile . ".out";
open(INFILE, "<", $infile) or die("Couldn't open $infile for reading: $!");
open(OUTFILE, ">", $outfile) or die("Couldn't open $outfile for writing: $!");
print("Processing: $infile \n");
while (<INFILE>) {
print OUTFILE $_ and next() if (m!^#\s*include!);
my $line = $_;
$line =~ s/(_T\(|_\(|wxT\()?"(.*?)(?<!\\)"(\))?/replacementstring($1,$2,$3)/eg;
print OUTFILE $line;
}
close(OUTFILE);
close(INFILE);
rename($outfile,$infile) or die("Couldn't overwrite ${infile}: $!");
}
sub replacementstring {
my ($pre, $string, $post) = @_;
if ($pre) {
if ($pre eq "_(") { return( qq!_("${string}")! ); }
else { return( qq!_T("${string}")! ); }
}
elsif ($post) {
return( qq!_T("${string}"))! );
}
else {
return( qq!_T("${string}")! );
}
}