Ejemplo n.º 1
0
void NewClassDlg::OnButtonOK(wxCommandEvent& e)
{
    wxUnusedVar(e);
    if(!ValidateInput()) {
        return;
    }

    // Save the check boxes ticked
    size_t flags(0);

    if(m_checkBoxCopyable->IsChecked()) flags |= NewClassDlgData::NonCopyable;

    if(m_checkBoxImplPureVirtual->IsChecked()) flags |= NewClassDlgData::ImplAllPureVirtualFuncs;

    if(m_checkBoxImplVirtual->IsChecked()) flags |= NewClassDlgData::ImplAllVirtualFuncs;

    if(m_checkBoxInline->IsChecked()) flags |= NewClassDlgData::FileIniline;

    if(m_checkBoxHpp->IsChecked()) flags |= NewClassDlgData::HppHeader;

    if(m_checkBoxSingleton->IsChecked()) flags |= NewClassDlgData::Singleton;

    if(m_checkBoxVirtualDtor->IsChecked()) flags |= NewClassDlgData::VirtualDtor;

    NewClassDlgData data;
    data.SetFlags(flags);
    EditorConfigST::Get()->WriteObject(wxT("NewClassDlgData"), &data);

    EndModal(wxID_OK);
}
void NewClassDlg::DoSaveOptions()
{
    // Save the check boxes ticked
    size_t flags(0);

    if(m_checkBoxCopyable->IsChecked()) flags |= NewClassDlgData::NonCopyable;
    if(m_checkBoxImplPureVirtual->IsChecked()) flags |= NewClassDlgData::ImplAllPureVirtualFuncs;
    if(m_checkBoxImplVirtual->IsChecked()) flags |= NewClassDlgData::ImplAllVirtualFuncs;
    if(m_checkBoxInline->IsChecked()) flags |= NewClassDlgData::FileIniline;
    if(m_checkBoxHpp->IsChecked()) flags |= NewClassDlgData::HppHeader;
    if(m_checkBoxSingleton->IsChecked()) flags |= NewClassDlgData::Singleton;
    if(m_checkBoxVirtualDtor->IsChecked()) flags |= NewClassDlgData::VirtualDtor;
    if(m_checkBoxPragmaOnce->IsChecked()) flags |= NewClassDlgData::UsePragma;

    NewClassDlgData data;
    data.SetFlags(flags);
    EditorConfigST::Get()->WriteObject(wxT("NewClassDlgData"), &data);
}