bool UserInterface::OnAppInitializing(AppRegistry& appRegistry) { // TODO: // Initialize UI resources and application specific data. // The application's permanent data and context can be obtained from the appRegistry. // // If this method is successful, return true; otherwise, return false. // If this method returns false, the application will be terminated. // Uncomment the following statement to listen to the screen on/off events. //PowerManager::SetScreenEventListener(*this); // Create a form MainForm *pMainForm = new MainForm(); pMainForm->Initialize(); // Add the form to the frame Frame *pFrame = GetAppFrame()->GetFrame(); pFrame->AddControl(*pMainForm); // Set the current form pFrame->SetCurrentForm(*pMainForm); // Draw and Show the form pMainForm->Draw(); pMainForm->Show(); return true; }
virtual bool OnInit(void) override { Application::InitializeBase(); Url::Ptr pUrl; if (argc < 2) { wxConfig config("IcingaStudio"); wxString wUrl; if (!config.Read("url", &wUrl)) wUrl = "https://localhost:5665/"; std::string url = wUrl.ToStdString(); ConnectForm f(NULL, new Url(url)); if (f.ShowModal() != wxID_OK) return false; pUrl = f.GetUrl(); url = pUrl->Format(true); wUrl = url; config.Write("url", wUrl); } else { pUrl = new Url(argv[1].ToStdString()); } MainForm *m = new MainForm(NULL, pUrl); m->Show(); return true; }
bool DrStrangecodeRssReader::OnAppInitializing(AppRegistry& appRegistry) { // Create a form MainForm *pMainForm = new MainForm(); pMainForm->Initialize(); pMainForm->SetName(kMainFormNameString); ItemForm * pItemForm = new ItemForm(); pItemForm->Initialize(); pItemForm->SetName(kItemFormNameString); // Add the form to the frame Frame *pFrame = GetAppFrame()->GetFrame(); pFrame->AddControl(*pMainForm); pFrame->AddControl(*pItemForm); // Set the current form pFrame->SetCurrentForm(*pMainForm); // Draw and Show the form pMainForm->Draw(); pMainForm->Show(); return true; }
int main() { MainForm mainForm; mainForm.Init(); mainForm.CreateGUI(); mainForm.Show(); }