]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/wx-console/main.cpp
added win32 unicode support for wx-console (compile with _UNICODE)
[bacula/bacula] / bacula / src / wx-console / main.cpp
index 2dce15d7789a56ecf6ad7462b2c0acbff1303ecb..443720c58ec9b6779d5a14e9944d17c3fef5a2df 100644 (file)
@@ -7,7 +7,7 @@
  *    Version $Id$
  */
 /*
-   Copyright (C) 2004 Kern Sibbald and John Walker
+   Copyright (C) 2004-2005 Kern Sibbald
 
    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
@@ -39,6 +39,8 @@
 
 #include "csprint.h"
 
+void InitWinAPIWrapper();
+
 /* Dummy functions */
 int generate_daemon_event(JCR *jcr, const char *event) { return 1; }
 int generate_job_event(JCR *jcr, const char *event) { return 1; }
@@ -69,10 +71,11 @@ bool MyApp::OnInit()
 {
    long posx, posy, sizex, sizey;
    int displayx, displayy;
-   wxConfig::Get()->Read("/Position/X", &posx, 50);
-   wxConfig::Get()->Read("/Position/Y", &posy, 50);
-   wxConfig::Get()->Read("/Size/Width", &sizex, 780);
-   wxConfig::Get()->Read("/Size/Height", &sizey, 500);
+   InitWinAPIWrapper();
+   wxConfig::Get()->Read(wxT("/Position/X"), &posx, 50);
+   wxConfig::Get()->Read(wxT("/Position/Y"), &posy, 50);
+   wxConfig::Get()->Read(wxT("/Size/Width"), &sizex, 780);
+   wxConfig::Get()->Read(wxT("/Size/Height"), &sizey, 500);
    
    wxDisplaySize(&displayx, &displayy);
    
@@ -89,14 +92,14 @@ bool MyApp::OnInit()
       }
    }
 
-   wxbMainFrame *frame = wxbMainFrame::CreateInstance(_T("Bacula wx-console"),
+   wxbMainFrame *frame = wxbMainFrame::CreateInstance(wxT("Bacula wx-console"),
                          wxPoint(posx, posy), wxSize(sizex, sizey));
 
    frame->Show(TRUE);
 
-   frame->Print(wxString("Welcome to bacula wx-console ") << VERSION << " (" << BDATE << ")!\n", CS_DEBUG);
+   frame->Print(wxString(wxT("Welcome to bacula wx-console ")) << wxT(VERSION) << wxT(" (") << wxT(BDATE) << wxT(")!\n"), CS_DEBUG);
 
-   frame->StartConsoleThread("");
+   frame->StartConsoleThread(wxT(""));
    
    return TRUE;
 }