- wxbMainFrame *frame = wxbMainFrame::CreateInstance(_T("Minimal wxWindows App"),
- wxPoint(50, 50), wxSize(780, 500));
+ /* wxWidgets internationalisation */
+ wxLocale m_locale;
+ m_locale.Init();
+ m_locale.AddCatalog(wxT("bacula"));
+ wxLocale::AddCatalogLookupPathPrefix(wxT(LOCALEDIR));
+
+ long posx, posy, sizex, sizey;
+ int displayx, displayy;
+ OSDependentInit();
+ 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);
+
+ /* Check if we are on the screen... */
+ if ((posx+sizex > displayx) || (posy+sizey > displayy)) {
+ /* Try to move the top-left corner first */
+ posx = 50;
+ posy = 50;
+ if ((posx+sizex > displayx) || (posy+sizey > displayy)) {
+ posx = 25;
+ posy = 25;
+ sizex = displayx - 50;
+ sizey = displayy - 50;
+ }
+ }
+
+ wxbMainFrame *frame = wxbMainFrame::CreateInstance(_("Bacula wx-console"),
+ wxPoint(posx, posy), wxSize(sizex, sizey));