[Scummvm-cvs-logs] CVS: scummex image.cpp,1.28,1.29 wxwindows.cpp,1.39,1.40 wxwindows.h,1.20,1.21
Eugene Sandulenko
sev at users.sourceforge.net
Thu Dec 16 15:45:01 CET 2004
Update of /cvsroot/scummvm/scummex
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7322
Modified Files:
image.cpp wxwindows.cpp wxwindows.h
Log Message:
Apply patch #1083268 Scummex UTF8
Index: image.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummex/image.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- image.cpp 19 Sep 2004 13:50:42 -0000 1.28
+++ image.cpp 16 Dec 2004 23:44:24 -0000 1.29
@@ -68,7 +68,7 @@
unsigned int h;
if (_blockTable[id].image == NULL)
- _image = _blockTable[id].image = new ImageWindow("Block Palette", wxSize(384, 384), id, FLAG_NONE, 1);
+ _image = _blockTable[id].image = new ImageWindow(wxT("Block Palette"), wxSize(384, 384), id, FLAG_NONE, 1);
else
_image = _blockTable[id].image;
@@ -166,7 +166,7 @@
}
if (_blockTable[id].image == NULL)
- _image = _blockTable[id].image = new ImageWindow("Boxes", wxSize(_width, _height), id, IMAGE_SCALE);
+ _image = _blockTable[id].image = new ImageWindow(wxT("Boxes"), wxSize(_width, _height), id, IMAGE_SCALE);
else
_image = _blockTable[id].image;
@@ -260,7 +260,7 @@
_height = _blockTable[id].height;
if (_blockTable[id].image == NULL)
- _image = _blockTable[id].image = new ImageWindow("SMUSH Frame", wxSize(_width, _height), id, IMAGE_SCALE);
+ _image = _blockTable[id].image = new ImageWindow(wxT("SMUSH Frame"), wxSize(_width, _height), id, IMAGE_SCALE);
else
_image = _blockTable[id].image;
@@ -331,7 +331,7 @@
_height = _blockTable[headerID].height;
if (_blockTable[id].image == NULL)
- _image = _blockTable[id].image = new ImageWindow("Room Image", wxSize(_width, _height), id, IMAGE_BOXES|IMAGE_SCALE);
+ _image = _blockTable[id].image = new ImageWindow(wxT("Room Image"), wxSize(_width, _height), id, IMAGE_BOXES|IMAGE_SCALE);
else
_image = _blockTable[id].image;
@@ -451,7 +451,7 @@
_height = _blockTable[headerID].height;
if (_blockTable[id].image == NULL)
- _image = _blockTable[id].image = new ImageWindow("Object", wxSize(_width, _height), id, IMAGE_SCALE);
+ _image = _blockTable[id].image = new ImageWindow(wxT("Object"), wxSize(_width, _height), id, IMAGE_SCALE);
else
_image = _blockTable[id].image;
Index: wxwindows.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummex/wxwindows.cpp,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- wxwindows.cpp 19 Sep 2004 13:50:42 -0000 1.39
+++ wxwindows.cpp 16 Dec 2004 23:44:24 -0000 1.40
@@ -35,7 +35,7 @@
: _mainWindow(0) {
g_scummex = new ScummEX();
_gui = this; // FIXME - ugly quick workaround for previously broken code
- config = new wxConfig("ScummEX");
+ config = new wxConfig(wxT("ScummEX"));
}
GUI_wxWindows::~GUI_wxWindows() {
@@ -45,7 +45,7 @@
bool GUI_wxWindows::OnInit()
{
- _mainWindow = new MainWindow("ScummEX", wxPoint(-1,-1),
+ _mainWindow = new MainWindow(wxT("ScummEX"), wxPoint(-1,-1),
wxSize(640,480));
_mainWindow->Show(TRUE);
@@ -54,37 +54,37 @@
}
void GUI_wxWindows::SetTitle(char *title) {
- _mainWindow->SetTitle(title);
+ _mainWindow->SetTitle(wxString(title, wxConvUTF8));
}
int GUI_wxWindows::getScummVersionDialog() {
int choice;
wxString games[22] = {
- "Maniac Mansion (C64)",
- "Maniac Mansion (PC)",
- "Zak McKracken",
- "Zak McKracken (FM Towns)",
- "Indiana Jones & The Last Crusade",
- "Sampler (Loom, Indy3, SOMI)",
- "The Secret of Monkey Island (Demo)",
- "The Secret of Monkey Island (EGA)",
- "The Secret of Monkey Island",
- "Loom",
- "Loom (CD)",
- "Monkey Island 2: LeChuck's Revenge",
- "Indiana Jones & The Fate of Atlantis",
- "Day of the Tentacle",
- "Sam & Max Hit The Road (Demo)",
- "Sam & Max Hit The Road (Mac demo)",
- "Sam & Max Hit The Road (Disk)",
- "Sam & Max Hit The Road (CD)",
- "Full Throttle",
- "The Dig",
- "The Dig (Win95)",
- "The Curse of Monkey Island"
+ wxT("Maniac Mansion (C64)"),
+ wxT("Maniac Mansion (PC)"),
+ wxT("Zak McKracken"),
+ wxT("Zak McKracken (FM Towns)"),
+ wxT("Indiana Jones & The Last Crusade"),
+ wxT("Sampler (Loom, Indy3, SOMI)"),
+ wxT("The Secret of Monkey Island (Demo)"),
+ wxT("The Secret of Monkey Island (EGA)"),
+ wxT("The Secret of Monkey Island"),
+ wxT("Loom"),
+ wxT("Loom (CD)"),
+ wxT("Monkey Island 2: LeChuck's Revenge"),
+ wxT("Indiana Jones & The Fate of Atlantis"),
+ wxT("Day of the Tentacle"),
+ wxT("Sam & Max Hit The Road (Demo)"),
+ wxT("Sam & Max Hit The Road (Mac demo)"),
+ wxT("Sam & Max Hit The Road (Disk)"),
+ wxT("Sam & Max Hit The Road (CD)"),
+ wxT("Full Throttle"),
+ wxT("The Dig"),
+ wxT("The Dig (Win95)"),
+ wxT("The Curse of Monkey Island")
};
- wxSingleChoiceDialog *dialog = new wxSingleChoiceDialog(_mainWindow, "Please select the correct game", "Scumm version selection", 22, games, NULL, wxOK|wxCANCEL|wxCENTRE, wxDefaultPosition);
+ wxSingleChoiceDialog *dialog = new wxSingleChoiceDialog(_mainWindow, wxT("Please select the correct game"), wxT("Scumm version selection"), 22, games, NULL, wxOK|wxCANCEL|wxCENTRE, wxDefaultPosition);
if (dialog->ShowModal() == wxID_OK) {
choice = dialog->GetSelection();
switch (choice) {
@@ -124,26 +124,26 @@
bool GUI_wxWindows::readConfigValue(const char* key, int* string) {
bool result;
- result = config->Read(key, string);
+ result = config->Read(wxString(key, wxConvUTF8), string);
return result;
}
bool GUI_wxWindows::readConfigValue(const char* key, wxString* string) {
bool result;
- result = config->Read(key, string);
+ result = config->Read(wxString(key, wxConvUTF8), string);
return result;
}
bool GUI_wxWindows::writeConfigValue(const char* key, int string) {
bool result;
- result = config->Write(key, string);
+ result = config->Write(wxString(key, wxConvUTF8), string);
config->Flush();
return result;
}
bool GUI_wxWindows::writeConfigValue(const char* key, wxString& string) {
bool result;
- result = config->Write(key, string);
+ result = config->Write(wxString(key, wxConvUTF8), string);
config->Flush();
return result;
}
@@ -180,14 +180,14 @@
_boxesDisplayed = 0;
_clientSize = size;
- wxMenuItem *BMPItem = new wxMenuItem(menuFile, ID_BMP, "Save to BMP...", "Save image to .BMP", wxITEM_NORMAL, NULL );
+ wxMenuItem *BMPItem = new wxMenuItem(menuFile, ID_BMP, wxT("Save to BMP..."), wxT("Save image to .BMP"), wxITEM_NORMAL, NULL );
wxBitmap SaveIcon = wxBitmap(save_icon);
BMPItem->SetBitmap(SaveIcon);
menuFile->Append(BMPItem);
- menuFile->Append(wxID_CLOSE,"Close");
+ menuFile->Append(wxID_CLOSE, wxT("Close"));
- menuBar->Append(menuFile,"&File");
+ menuBar->Append(menuFile, wxT("&File"));
wxMenu *menuView = new wxMenu;
@@ -199,15 +199,15 @@
}
if (flags & IMAGE_BOXES) {
- menuView->AppendCheckItem(ID_Boxes, "Display Boxes", "Display Boxes");
+ menuView->AppendCheckItem(ID_Boxes, wxT("Display Boxes"), wxT("Display Boxes"));
}
if (flags & IMAGE_SCALE) {
menuZoom = new wxMenu;
- menuZoom->AppendCheckItem(ID_Scale1x, "100%", "100%");
- menuZoom->AppendCheckItem(ID_Scale2x, "200%", "200%");
- menuZoom->AppendCheckItem(ID_Scale3x, "300%", "300%");
- menuView->Append(ID_Zoom, "Zoom", menuZoom, "Zoom");
+ menuZoom->AppendCheckItem(ID_Scale1x, wxT("100%"), wxT("100%"));
+ menuZoom->AppendCheckItem(ID_Scale2x, wxT("200%"), wxT("200%"));
+ menuZoom->AppendCheckItem(ID_Scale3x, wxT("300%"), wxT("300%"));
+ menuView->Append(ID_Zoom, wxT("Zoom"), menuZoom, wxT("Zoom"));
switch(_scaleFactor) {
case 1:
menuZoom->Check(ID_Scale1x, TRUE);
@@ -223,7 +223,7 @@
}
}
- menuBar->Append(menuView,"View");
+ menuBar->Append(menuView, wxT("View"));
SetMenuBar(menuBar);
SetClientSize(size.GetWidth() * _scaleFactor+20, size.GetHeight() * _scaleFactor+20);
@@ -328,11 +328,11 @@
}
void ImageWindow::SaveImage(wxCommandEvent& event) {
- wxFileDialog *dialog = new wxFileDialog(this, "Please select an output file.", "", "",
- "*",
+ wxFileDialog *dialog = new wxFileDialog(this, wxT("Please select an output file."), wxT(""), wxT(""),
+ wxT("*"),
wxSAVE);
if (dialog->ShowModal() == wxID_OK) {
- const char *filename = (const char*)dialog->GetPath();
+ wxString filename = dialog->GetPath();
_image->SaveFile(filename, wxBITMAP_TYPE_BMP);
}
}
@@ -352,7 +352,7 @@
}
ViewerWindow *GUI_wxWindows::DisplayViewer(char *title, int width, int height, char *text) {
- return new ViewerWindow(_mainWindow, title, text, wxPoint(50,50), wxSize(width, height));
+ return new ViewerWindow(_mainWindow, wxString(title, wxConvUTF8), wxString(text, wxConvUTF8), wxPoint(50,50), wxSize(width, height));
}
BEGIN_EVENT_TABLE(ViewerWindow, wxFrame)
@@ -362,10 +362,10 @@
: wxFrame(parent, ID_ViewerWindow, title, pos, size)
{
wxMenu *menuFile = new wxMenu;
- menuFile->Append(wxID_CLOSE,"Close");
+ menuFile->Append(wxID_CLOSE, wxT("Close"));
wxMenuBar *menuBar = new wxMenuBar;
- menuBar->Append(menuFile,"&File");
+ menuBar->Append(menuFile, wxT("&File"));
SetMenuBar(menuBar);
@@ -378,11 +378,11 @@
}
void ViewerWindow::AppendText(const char *text) {
- _textCtrl->AppendText(text);
+ _textCtrl->AppendText(wxString(text, wxConvUTF8));
}
void GUI_wxWindows::DisplayDialog(char *message, char *title) {
- wxMessageBox(message, title, wxOK, _mainWindow);
+ wxMessageBox(wxString(message, wxConvUTF8), wxString(title, wxConvUTF8), wxOK, _mainWindow);
}
void GUI_wxWindows::EnableToolbarTool(int tool) {
@@ -402,8 +402,8 @@
SpecButton2->Enable(TRUE);
switch(blocktype) {
case cus2: // iMUSE
- SpecButton1->SetLabel("Play");
- SpecButton2->SetLabel("Dump to WAV...");
+ SpecButton1->SetLabel(wxT("Play"));
+ SpecButton2->SetLabel(wxT("Dump to WAV..."));
SpecButton1->Show(TRUE);
SpecButton2->Show(TRUE);
Connect( ID_SpecButton1, wxEVT_COMMAND_BUTTON_CLICKED,
@@ -414,7 +414,7 @@
case OBIM:
if (g_scummex->getBlockTable(_blockId+3).blockTypeID == 35) {
- SpecButton1->SetLabel("View Object");
+ SpecButton1->SetLabel(wxT("View Object"));
SpecButton1->Show(TRUE);
Connect( ID_SpecButton1, wxEVT_COMMAND_BUTTON_CLICKED,
(wxObjectEventFunction) &MainWindow::objectDraw );
@@ -438,7 +438,7 @@
case IM0F:
case OI:
if (g_scummex->getBlockTable(_blockId).blockSize > 8) {
- SpecButton1->SetLabel("View Object");
+ SpecButton1->SetLabel(wxT("View Object"));
SpecButton1->Show(TRUE);
Connect( ID_SpecButton1, wxEVT_COMMAND_BUTTON_CLICKED,
(wxObjectEventFunction) &MainWindow::objectDraw );
@@ -447,8 +447,8 @@
case Crea:
case AUdt:
- SpecButton1->SetLabel("Play");
- SpecButton2->SetLabel("Dump to WAV...");
+ SpecButton1->SetLabel(wxT("Play"));
+ SpecButton2->SetLabel(wxT("Dump to WAV..."));
SpecButton1->Show(TRUE);
SpecButton2->Show(TRUE);
Connect( ID_SpecButton1, wxEVT_COMMAND_BUTTON_CLICKED,
@@ -464,7 +464,7 @@
case NPAL:
case AHDR:
case RGBS:
- SpecButton1->SetLabel("View Palette");
+ SpecButton1->SetLabel(wxT("View Palette"));
SpecButton1->Show(TRUE);
Connect( ID_SpecButton1, wxEVT_COMMAND_BUTTON_CLICKED,
(wxObjectEventFunction) &MainWindow::paletteDraw );
@@ -473,14 +473,14 @@
case BM:
case RMIM:
case IMAG:
- SpecButton1->SetLabel("View Image");
+ SpecButton1->SetLabel(wxT("View Image"));
SpecButton1->Show(TRUE);
Connect( ID_SpecButton1, wxEVT_COMMAND_BUTTON_CLICKED,
(wxObjectEventFunction) &MainWindow::bgDraw );
break;
case FOBJ:
- SpecButton1->SetLabel("View Frame");
+ SpecButton1->SetLabel(wxT("View Frame"));
SpecButton1->Show(TRUE);
Connect( ID_SpecButton1, wxEVT_COMMAND_BUTTON_CLICKED,
(wxObjectEventFunction) &MainWindow::SmushFrameDraw );
@@ -496,7 +496,7 @@
case EN:
case EX:
case OC:
- SpecButton1->SetLabel("Decompile Script");
+ SpecButton1->SetLabel(wxT("Decompile Script"));
SpecButton1->Show(TRUE);
Connect( ID_SpecButton1, wxEVT_COMMAND_BUTTON_CLICKED,
(wxObjectEventFunction) &MainWindow::Descumm );
@@ -504,14 +504,14 @@
case BOXD:
case BX:
- SpecButton1->SetLabel("View Boxes...");
+ SpecButton1->SetLabel(wxT("View Boxes..."));
SpecButton1->Show(TRUE);
Connect( ID_SpecButton1, wxEVT_COMMAND_BUTTON_CLICKED,
(wxObjectEventFunction) &MainWindow::boxesDraw );
break;
case AKSQ:
- SpecButton1->SetLabel("Decompile Script");
+ SpecButton1->SetLabel(wxT("Decompile Script"));
SpecButton1->Show(TRUE);
Connect( ID_SpecButton1, wxEVT_COMMAND_BUTTON_CLICKED,
(wxObjectEventFunction) &MainWindow::DecompileAKSQ );
@@ -525,7 +525,7 @@
wxTreeItemId itemid;
assert(level <= 10);
- itemid = iter[level] = tree->AppendItem(iter[level-1], itemName, -1, -1, new TreeItemData(blockid, type));
+ itemid = iter[level] = tree->AppendItem(iter[level-1], wxString(itemName, wxConvUTF8), -1, -1, new TreeItemData(blockid, type));
if (type < 200) {
tree->SetItemImage(itemid, blocksInfo[type].iconid);
@@ -543,8 +543,8 @@
void MainWindow::updateLabel(wxStaticText *label[2], const char *title, uint32 text) {
char buf[256];
sprintf(buf, "%d", text);
- label[0]->SetLabel(title);
- label[1]->SetLabel(buf);
+ label[0]->SetLabel(wxString(title, wxConvUTF8));
+ label[1]->SetLabel(wxString(buf, wxConvUTF8));
}
void MainWindow::updateLabels(int blockid) {
@@ -553,22 +553,22 @@
// Clear out all labels
for (int i = 0; i < 6; i++) {
- _SpecLabel[i][0]->SetLabel("");
- _SpecLabel[i][1]->SetLabel("");
+ _SpecLabel[i][0]->SetLabel(wxT(""));
+ _SpecLabel[i][1]->SetLabel(wxT(""));
}
- _GenLabel[0][1]->SetLabel(block.blockType);
+ _GenLabel[0][1]->SetLabel(wxString(block.blockType, wxConvUTF8));
sprintf(buf, "%d", block.number);
- _GenLabel[1][1]->SetLabel(buf);
+ _GenLabel[1][1]->SetLabel(wxString(buf, wxConvUTF8));
sprintf(buf, "%d (0x%08X)", block.offset, block.offset);
- _GenLabel[2][1]->SetLabel(buf);
+ _GenLabel[2][1]->SetLabel(wxString(buf, wxConvUTF8));
sprintf(buf, "%d (0x%08X)", block.blockSize, block.blockSize);
- _GenLabel[3][1]->SetLabel(buf);
+ _GenLabel[3][1]->SetLabel(wxString(buf, wxConvUTF8));
- _GenLabel[4][1]->SetLabel(block.blockDescription);
+ _GenLabel[4][1]->SetLabel(wxString(block.blockDescription, wxConvUTF8));
switch(block.blockTypeID) {
case MAXS:
@@ -673,7 +673,7 @@
MainWindow::MainWindow(const wxString& title, const wxPoint& pos, const wxSize& size)
: wxFrame((wxFrame*)NULL, wxID_ANY, title,pos,size),
- _filename(0), _blockId(0)
+ _filename(), _blockId(0)
{
htmlflag = 0;
@@ -692,12 +692,12 @@
//
wxMenu *fileMenu = new wxMenu();
- fileMenu->Append(wxID_OPEN, "&Open...\tCtrl-O", "Open resource file");
- fileMenu->Append(wxID_CLOSE, "&Close\tCtrl-W", "Close resource file");
+ fileMenu->Append(wxID_OPEN, wxT("&Open...\tCtrl-O"), wxT("Open resource file"));
+ fileMenu->Append(wxID_CLOSE, wxT("&Close\tCtrl-W"), wxT("Close resource file"));
fileMenu->AppendSeparator();
- fileMenu->Append(ID_FileInfo, "File &Info", "Show File Info");
+ fileMenu->Append(ID_FileInfo, wxT("File &Info"), wxT("Show File Info"));
fileMenu->AppendSeparator();
- fileMenu->Append(wxID_EXIT, "E&xit\tCtrl-X");
+ fileMenu->Append(wxID_EXIT, wxT("E&xit\tCtrl-X"));
// FIXME: On Mac you *always* say "Quit", but on Windows/Linux, "Exit" is more common, I think?
// So maybe we'll have to make this compile conditionally...
@@ -707,27 +707,27 @@
//
wxMenu *toolsMenu = new wxMenu();
- toolsMenu->Append(ID_Dump, "File Dump...", "Dump block to disk");
- toolsMenu->Append(ID_View, "Hex Viewer...", "View block as hex");
+ toolsMenu->Append(ID_Dump, wxT("File Dump..."), wxT("Dump block to disk"));
+ toolsMenu->Append(ID_View, wxT("Hex Viewer..."), wxT("View block as hex"));
toolsMenu->AppendSeparator();
- toolsMenu->Append(ID_SoundStop, "Stop Sounds");
+ toolsMenu->Append(ID_SoundStop, wxT("Stop Sounds"));
toolsMenu->AppendSeparator();
- toolsMenu->Append(Button_Options, "Options...", "ScummEX Options");
+ toolsMenu->Append(Button_Options, wxT("Options..."), wxT("ScummEX Options"));
//
// Help menu
//
wxMenu *helpMenu = new wxMenu();
- helpMenu->Append(wxID_HELP, "Contents");
- helpMenu->Append(wxID_ABOUT, "About...");
+ helpMenu->Append(wxID_HELP, wxT("Contents"));
+ helpMenu->Append(wxID_ABOUT, wxT("About..."));
//
// Add the menus to a menu bar
//
wxMenuBar *menuBar = new wxMenuBar();
- menuBar->Append(fileMenu, "&File");
- menuBar->Append(toolsMenu, "&Tools");
- menuBar->Append(helpMenu, "&Help");
+ menuBar->Append(fileMenu, wxT("&File"));
+ menuBar->Append(toolsMenu, wxT("&Tools"));
+ menuBar->Append(helpMenu, wxT("&Help"));
SetMenuBar(menuBar);
SetThemeEnabled(true);
@@ -736,24 +736,24 @@
ToolBar->SetToolBitmapSize(wxSize(16, 16));
- ToolBar->AddTool(wxID_OPEN, OpenIcon, "Open...", "Open resource file");
- ToolBar->AddTool(wxID_CLOSE, CloseIcon, "Close", "Close resource file");
+ ToolBar->AddTool(wxID_OPEN, OpenIcon, wxT("Open..."), wxT("Open resource file"));
+ ToolBar->AddTool(wxID_CLOSE, CloseIcon, wxT("Close"), wxT("Close resource file"));
ToolBar->EnableTool(wxID_CLOSE, FALSE);
- ToolBar->AddTool(ID_FileInfo, FileIcon, "File Info", "Show File Info");
+ ToolBar->AddTool(ID_FileInfo, FileIcon, wxT("File Info"), wxT("Show File Info"));
ToolBar->EnableTool(ID_FileInfo, FALSE);
- ToolBar->AddTool(wxID_EXIT, ExitIcon, "Exit", "Exit ScummEX");
+ ToolBar->AddTool(wxID_EXIT, ExitIcon, wxT("Exit"), wxT("Exit ScummEX"));
ToolBar->AddSeparator();
- ToolBar->AddTool(ID_Dump, SaveIcon, "File Dump...", "Dump block to disk");
+ ToolBar->AddTool(ID_Dump, SaveIcon, wxT("File Dump..."), wxT("Dump block to disk"));
ToolBar->EnableTool(ID_Dump, FALSE);
- ToolBar->AddTool(ID_View, HexIcon, "Hex Viewer...", "View block as hex");
+ ToolBar->AddTool(ID_View, HexIcon, wxT("Hex Viewer..."), wxT("View block as hex"));
ToolBar->EnableTool(ID_View, FALSE);
- ToolBar->AddTool(Button_Options, OptionsIcon, "Options...", "Options");
+ ToolBar->AddTool(Button_Options, OptionsIcon, wxT("Options..."), wxT("Options"));
ToolBar->EnableTool(Button_Options, FALSE);
ToolBar->AddSeparator();
- ToolBar->AddTool(wxID_HELP, HelpIcon, "Help", "View help");
+ ToolBar->AddTool(wxID_HELP, HelpIcon, wxT("Help"), wxT("View help"));
ToolBar->Realize();
- panel = new wxPanel(this, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, "panel");
+ panel = new wxPanel(this, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, wxT("panel"));
wxBoxSizer *RootSizer = new wxBoxSizer( wxVERTICAL );
@@ -767,13 +767,13 @@
tree = new wxTreeCtrl(panel, ID_Tree, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTR_HAS_BUTTONS|wxTR_HIDE_ROOT);
tree->AssignImageList(ImageList);
- iter[0] = tree->AddRoot("", -1, -1, NULL);
+ iter[0] = tree->AddRoot(wxT(""), -1, -1, NULL);
BlocksSizer->Add(tree, 1, wxALL|wxEXPAND, 4);
wxBoxSizer *InfosSizer = new wxBoxSizer( wxVERTICAL );
BlocksSizer->Add(InfosSizer, 1, wxALL|wxEXPAND, 5);
- notebook = new wxNotebook(panel, -1, wxPoint(-1, -1), wxSize(-1, -1), 0, "notebook");
+ notebook = new wxNotebook(panel, -1, wxPoint(-1, -1), wxSize(-1, -1), 0, wxT("notebook"));
wxNotebookSizer *nbs = new wxNotebookSizer( notebook );
InfosSizer->Add(nbs, 1, wxALL|wxEXPAND, 0);
@@ -782,14 +782,14 @@
// Explorer panel
//
infospanel = new wxPanel(notebook, -1);
- notebook->AddPage(infospanel, "Explorer", true, -1);
+ notebook->AddPage(infospanel, wxT("Explorer"), true, -1);
wxBoxSizer *panelsizer = new wxBoxSizer( wxVERTICAL );
//
// General Block Infos
//
- wxStaticBox *GenInfosBox = new wxStaticBox(infospanel, -1, "General Block Infos");
+ wxStaticBox *GenInfosBox = new wxStaticBox(infospanel, -1, wxT("General Block Infos"));
wxStaticBoxSizer *GenInfosHSizer = new wxStaticBoxSizer( GenInfosBox, wxHORIZONTAL );
panelsizer->Add(GenInfosHSizer, 1, wxALL|wxEXPAND, 0);
@@ -800,18 +800,18 @@
wxBoxSizer *GenInfosSizer2 = new wxBoxSizer( wxVERTICAL );
GenInfosHSizer->Add(GenInfosSizer2, 1, wxLEFT|wxEXPAND, 12);
- _GenLabel[0][0] = new wxStaticText(infospanel, -1, "Type:", wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE);
- _GenLabel[1][0] = new wxStaticText(infospanel, -1, "Number:", wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE);
- _GenLabel[2][0] = new wxStaticText(infospanel, -1, "Offset:", wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE);
- _GenLabel[3][0] = new wxStaticText(infospanel, -1, "Size:", wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE);
- _GenLabel[4][0] = new wxStaticText(infospanel, -1, "Description:", wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE);
+ _GenLabel[0][0] = new wxStaticText(infospanel, -1, wxT("Type:"), wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE);
+ _GenLabel[1][0] = new wxStaticText(infospanel, -1, wxT("Number:"), wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE);
+ _GenLabel[2][0] = new wxStaticText(infospanel, -1, wxT("Offset:"), wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE);
+ _GenLabel[3][0] = new wxStaticText(infospanel, -1, wxT("Size:"), wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE);
+ _GenLabel[4][0] = new wxStaticText(infospanel, -1, wxT("Description:"), wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE);
for (int i = 0; i < 5; i++) {
GenInfosSizer->Add(_GenLabel[i][0], 0, wxALL|wxEXPAND, 1);
}
for (int i = 0; i < 5; i++) {
- _GenLabel[i][1] = new wxStaticText(infospanel, -1, "n/a", wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE);
+ _GenLabel[i][1] = new wxStaticText(infospanel, -1, wxT("n/a"), wxDefaultPosition, wxDefaultSize, wxST_NO_AUTORESIZE);
GenInfosSizer2->Add(_GenLabel[i][1], 0, wxALL|wxEXPAND, 1);
}
@@ -825,7 +825,7 @@
//
// Specific Block Infos
//
- wxStaticBox *SpecInfosBox = new wxStaticBox(infospanel, -1, "Specific Block Infos");
+ wxStaticBox *SpecInfosBox = new wxStaticBox(infospanel, -1, wxT("Specific Block Infos"));
wxStaticBoxSizer *SpecInfosVSizer = new wxStaticBoxSizer( SpecInfosBox, wxVERTICAL );
panelsizer->Add(SpecInfosVSizer, 1, wxALL|wxEXPAND, 0);
@@ -842,22 +842,22 @@
for (int i = 0; i < 2; i++) {
for (int j = 0; j < 6; j++) {
- _SpecLabel[j][i] = new wxStaticText(infospanel, -1, "");
+ _SpecLabel[j][i] = new wxStaticText(infospanel, -1, wxT(""));
SpecInfosSizer[i]->Add(_SpecLabel[j][i], 1, wxALL|wxEXPAND, 1);
}
}
HtmlHelp = new wxHtmlHelpController(wxHF_DEFAULT_STYLE & wxHF_CONTENTS);
- HtmlHelp->AddBook(wxFileName("help/help.hhp"));
+ HtmlHelp->AddBook(wxFileName(wxT("help/help.hhp")));
wxBoxSizer *SpecButtonsSizer = new wxBoxSizer ( wxHORIZONTAL );
SpecInfosVSizer->Add(SpecButtonsSizer, 0, wxALL, 0);
- SpecButton1 = new wxButton( infospanel, ID_SpecButton1, "", wxPoint(-1, -1), wxSize(120, -1));
+ SpecButton1 = new wxButton( infospanel, ID_SpecButton1, wxT(""), wxPoint(-1, -1), wxSize(120, -1));
SpecButtonsSizer->Add( SpecButton1, 1, wxALL, 3);
SpecButton1->Show(FALSE);
- SpecButton2 = new wxButton( infospanel, ID_SpecButton2, "", wxPoint(-1, -1), wxSize(120, -1));
+ SpecButton2 = new wxButton( infospanel, ID_SpecButton2, wxT(""), wxPoint(-1, -1), wxSize(120, -1));
SpecButtonsSizer->Add( SpecButton2, 1, wxALL, 3);
SpecButton2->Show(FALSE);
@@ -871,7 +871,7 @@
wxBoxSizer *htmlpanelsizer = new wxBoxSizer( wxVERTICAL );
- HtmlWindow = new wxHtmlWindow(htmlpanel, -1, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO, "htmlWindow");
+ HtmlWindow = new wxHtmlWindow(htmlpanel, -1, wxDefaultPosition, wxDefaultSize, wxHW_SCROLLBAR_AUTO, wxT("htmlWindow"));
htmlpanelsizer->Add(HtmlWindow, 1, wxALL|wxEXPAND, 0);
htmlpanel->SetAutoLayout( true );
@@ -913,7 +913,7 @@
panel->SetSizer( RootSizer );
CreateStatusBar();
- SetStatusText("Ready.");
+ SetStatusText(wxT("Ready."));
SetIcon(wxICON(scummex_icon));
@@ -923,7 +923,7 @@
void MainWindow::OnAbout(wxCommandEvent& WXUNUSED(event))
{
- wxMessageDialog *dialog = new wxMessageDialog(this, "\nScummEX 0.1.0cvs (C) 2003 The ScummVM project\n","About", wxOK|wxCENTRE);
+ wxMessageDialog *dialog = new wxMessageDialog(this, wxT("\nScummEX 0.1.0cvs (C) 2003 The ScummVM project\n"),wxT("About"), wxOK|wxCENTRE);
dialog->ShowModal();
}
@@ -933,19 +933,19 @@
void MainWindow::OnOpen(wxCommandEvent& WXUNUSED(event))
{
- wxFileDialog *dialog = new wxFileDialog(this, "Please select an input file.", _filepath, "",
- "All Supported Files|*|"
+ wxFileDialog *dialog = new wxFileDialog(this, wxT("Please select an input file."), _filepath, wxT(""),
+ wxT("All Supported Files|*|"
"Main Resource Files|*.001;*.la1;*.la2;*.lab;*.lfl;*.lec;*.sm1|"
- "Directory Files|*.000;*.la0;*.lfl;*.sm0",
+ "Directory Files|*.000;*.la0;*.lfl;*.sm0"),
wxOPEN);
if (dialog->ShowModal() == wxID_OK) {
- _filename = (const char*)dialog->GetPath();
+ _filename = dialog->GetPath();
_file = wxFileName(_filename);
_filepath = _file.GetPath();
_gui->writeConfigValue("DataPath", _filepath);
tree->DeleteChildren(iter[0]);
- g_scummex->loadFile(_filename);
+ g_scummex->loadFile(_filename.mb_str(wxConvUTF8));
}
}
@@ -978,10 +978,10 @@
if (blocksInfo[itemtype].html == 1) {
if (htmlflag == 0) {
- notebook->AddPage(htmlpanel, "Block Specifications", false, -1);
+ notebook->AddPage(htmlpanel, wxT("Block Specifications"), false, -1);
notebook->Refresh();
}
- HtmlWindow->LoadPage(blocksInfo[itemtype].htmlfile);
+ HtmlWindow->LoadPage(wxString(blocksInfo[itemtype].htmlfile, wxConvUTF8));
htmlflag = 1;
} else if (htmlflag == 1) {
notebook->SetSelection(0);
@@ -1006,50 +1006,50 @@
void MainWindow::FileInfoDialog(int size, int encbyte) {
char buf[256];
char msg[512];
- const char *fname;
- const char *fpath;
+ wxString fname;
+ wxString fpath;
fname = _file.GetFullName();
fpath = _file.GetFullPath();
- sprintf(msg, "Filename: \t\t %s\n", fname);
- sprintf(buf, "Full Path: \t\t %s\n", fpath);
+ sprintf(msg, "Filename: \t\t %s\n", (const char*)fname.mb_str(wxConvUTF8));
+ sprintf(buf, "Full Path: \t\t %s\n", (const char*)fpath.mb_str(wxConvUTF8));
strcat(msg, buf);
sprintf(buf, "Size: \t\t %d\n", size);
strcat(msg, buf);
sprintf(buf, "XOR byte: \t %d (0x%02X)\n", encbyte, encbyte);
strcat(msg, buf);
- wxMessageBox(msg, "File Info", wxOK, this);
+ wxMessageBox(wxString(msg, wxConvUTF8), wxT("File Info"), wxOK, this);
}
void MainWindow::BlockDump(wxCommandEvent& event) {
- wxFileDialog *dialog = new wxFileDialog(this, "Please select an output file.", "", "",
- "*",
+ wxFileDialog *dialog = new wxFileDialog(this, wxT("Please select an output file."), wxT(""), wxT(""),
+ wxT("*"),
wxSAVE);
if (dialog->ShowModal() == wxID_OK) {
- const char *filename = (const char*)dialog->GetPath();
+ const char *filename = (const char*)dialog->GetPath().mb_str(wxConvUTF8);
g_scummex->FileDump(_blockId, filename);
}
}
void MainWindow::SaveSOU(wxEvent& event) {
- wxFileDialog *dialog = new wxFileDialog(this, "Please select an output file.", "", "",
- "*",
+ wxFileDialog *dialog = new wxFileDialog(this, wxT("Please select an output file."), wxT(""), wxT(""),
+ wxT("*"),
wxSAVE);
if (dialog->ShowModal() == wxID_OK) {
- const char *filename = (const char*)dialog->GetPath();
+ const char *filename = (const char*)dialog->GetPath().mb_str(wxConvUTF8);
g_scummex->iMUSEDump(_blockId, filename);
}
}
void MainWindow::SaveiMUSE(wxEvent& event) {
- wxFileDialog *dialog = new wxFileDialog(this, "Please select an output file.", "", "",
- "*",
+ wxFileDialog *dialog = new wxFileDialog(this, wxT("Please select an output file."), wxT(""), wxT(""),
+ wxT("*"),
wxSAVE);
if (dialog->ShowModal() == wxID_OK) {
- const char *filename = (const char*)dialog->GetPath();
+ const char *filename = (const char*)dialog->GetPath().mb_str(wxConvUTF8);
g_scummex->iMUSEDump(_blockId, filename);
}
Index: wxwindows.h
===================================================================
RCS file: /cvsroot/scummvm/scummex/wxwindows.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- wxwindows.h 19 Sep 2004 13:50:42 -0000 1.20
+++ wxwindows.h 16 Dec 2004 23:44:24 -0000 1.21
@@ -64,7 +64,7 @@
wxTreeCtrl *tree;
wxFileName _file;
- const char *_filename;
+ wxString _filename;
wxString _filepath;
uint32 _blockId;
More information about the Scummvm-git-logs
mailing list