Exemple #1
0
void MainFrame::OnExit(wxCommandEvent &event)
{
	if (!SaveWarning())
		return;

	Close();
}
//=============================================================================
// Project
//=============================================================================
void wxGD::MainFrame::OnNewProject( wxCommandEvent & )
{
    if( !SaveWarning() )
        return;

    wxGUIDesigner::Get()->NewProject();
}
Exemple #3
0
void MainFrame::OnNewProject(wxCommandEvent &event)
{
	if (!SaveWarning())
		return;

	GetData()->NewProject();
}
Exemple #4
0
void MainFrame::OnClose(wxCloseEvent &event)
{
	if (!SaveWarning())
		return;

	SavePosition(wxT("mainframe"));
	event.Skip();
}
void wxGD::MainFrame::OnClose( wxCloseEvent &event )
{
    if( !SaveWarning() )
        return;

    SaveLayout();

    event.Skip();
}
Exemple #6
0
void MainFrame::OnOpenRecent(wxCommandEvent &event)
{
	if (!SaveWarning())
		return;

	int i = event.GetId() - ID_RECENT_0;
	assert (i >= 0 && i < 4);

	wxFileName filename( m_recentProjects[i] );
	if (GetData()->LoadProject(filename.GetFullPath()))
	{
		m_currentDir = filename.GetPath();
		InsertRecentProject(filename.GetFullPath());
	}
}
void wxGD::MainFrame::OnOpenRecent( wxCommandEvent &event )
{
    if( !SaveWarning() )
        return;

    wxMenuItem *menuItm = NULL;
    wxMenuBar  *menuBar = GetMenuBar();

    if( menuBar )
        menuItm = menuBar->FindItem( event.GetId() );

    if( !menuItm )
        return;
    
    wxString    filePath( menuItm->GetItemLabelText().AfterLast(' ') );
    wxFileName  fileName( filePath );

    if( fileName.FileExists() )
    {
        if( wxGUIDesigner::Get()->LoadProject( fileName.GetFullPath() ) )
            m_lastDir = fileName.GetPath();
    }
    else
    {
        wxString message =
            _("The project file") + " " + fileName.GetName() + " " +
            _("doesn't exist.") +
            _("Would you like to remove it from the recent files list?");

        int answer =
            wxMessageBox( message, _("Open recent project"),
                                wxICON_WARNING | wxYES_NO );
        if( answer == wxYES )
        {
            for( size_t i = 0; i < m_history.GetCount(); i++ )
            {
                if( filePath == m_history.GetHistoryFile(i) )
                {
                    m_history.RemoveFileFromHistory(i);
                    break;
                }
            }
        }
    }
}
Exemple #8
0
void MainFrame::OnOpenProject(wxCommandEvent &event)
{
	if (!SaveWarning())
		return;

	wxFileDialog *dialog = new wxFileDialog(this,wxT("Open Project"),m_currentDir,
    wxT(""),wxT("wxFormBuilder Project File (*.fbp)|*.fbp|All files (*.*)|*.*"),wxOPEN | wxHIDE_READONLY);

	if (dialog->ShowModal() == wxID_OK)
	{
		m_currentDir = dialog->GetDirectory();
		wxString filename = dialog->GetPath();
		if (GetData()->LoadProject(filename))
			InsertRecentProject(filename);
	};

	dialog->Destroy();
}
void wxGD::MainFrame::OnOpenProject( wxCommandEvent & )
{
    if( !SaveWarning() )
        return;

    wxString wildCard = _("XRC Files");
    wildCard.append(" (*.xrc)|*.xrc|");
    wildCard.append(_("All files") );
    wildCard.append(" (*.*)|*.*");

    wxFileDialog dlg( this, _("Open Project"), m_lastDir, wxEmptyString,
                        wildCard, wxFD_OPEN );

    if( dlg.ShowModal() == wxID_OK )
    {
        m_lastDir = dlg.GetDirectory();
        wxString filePath = dlg.GetPath();

        if( wxGUIDesigner::Get()->LoadProject( filePath ) )
            m_history.AddFileToHistory( filePath );
    }
}