当前位置: 首页>>代码示例>>C++>>正文


C++ ProjectBuildTarget::SetCreateHex方法代码示例

本文整理汇总了C++中ProjectBuildTarget::SetCreateHex方法的典型用法代码示例。如果您正苦于以下问题:C++ ProjectBuildTarget::SetCreateHex方法的具体用法?C++ ProjectBuildTarget::SetCreateHex怎么用?C++ ProjectBuildTarget::SetCreateHex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ProjectBuildTarget的用法示例。


在下文中一共展示了ProjectBuildTarget::SetCreateHex方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnProjectTypeChanged

void ProjectOptionsDlg::OnProjectTypeChanged(wxCommandEvent& /*event*/)
{
    ProjectBuildTarget* target = m_Project->GetBuildTarget(m_Current_Sel);
    if (!target)
        return;

    wxComboBox* cmb = XRCCTRL(*this, "cmbProjectType", wxComboBox);
    wxCheckBox* chkCH = XRCCTRL(*this, "chkCreateHex", wxCheckBox);
    wxTextCtrl* txt = XRCCTRL(*this, "txtOutputFilename", wxTextCtrl);

    if (!cmb || !txt || !chkCH)
        return;

    // Default no hex file
    target->SetCreateHex(false);
    chkCH->SetValue(false);

    switch((TargetType)cmb->GetSelection()) {
        case ttExecutable :
            chkCH->Enable(true);
            break;

        case ttLibrary :
            chkCH->Enable(false);
            break;

    }

    Compiler* compiler = CompilerFactory::GetCompiler(target->GetCompilerID());

    wxFileName fname = target->GetOutputFilename();
    wxString name = fname.GetName();
    wxString ext = fname.GetExt();
    wxString extI = fname.GetExt();
    wxString extD = fname.GetExt();
    wxString libext = compiler ? compiler->GetSwitches().libExtension : FileFilters::LIBRARY_EXT;                                                // TODO: add specialized compiler option for this
    wxString execext = compiler ? compiler->GetSwitches().execExtension : FileFilters::EXECUTABLE_EXT;

    switch ((TargetType)cmb->GetSelection())
    {
        case ttExecutable:
            fname.SetExt(execext);
            txt->SetValue(fname.GetFullPath());
            break;

        case ttLibrary:
            fname.SetExt(libext);
            txt->SetValue(fname.GetFullPath());
            break;
    }
}
开发者ID:stahta01,项目名称:EmBlocks,代码行数:51,代码来源:projectoptionsdlg.cpp

示例2: DoBeforeTargetChange

void ProjectOptionsDlg::DoBeforeTargetChange(bool force)
{
    wxListBox* lstTargets = XRCCTRL(*this, "lstBuildTarget", wxListBox);

    // if no previously selected target, exit
    if (m_Current_Sel == -1)
        return;

    if (force || lstTargets->GetSelection() != m_Current_Sel)
    {
        // selected another build target
        // save changes to the previously selected target
        wxArrayString array;
        ProjectBuildTarget* target = m_Project->GetBuildTarget(m_Current_Sel);
        if (!target)
            return;

        target->SetTargetType(TargetType(XRCCTRL(*this, "cmbProjectType", wxComboBox)->GetSelection()));
        wxFileName fname(XRCCTRL(*this, "txtOutputFilename", wxTextCtrl)->GetValue());
//        fname.Normalize(wxPATH_NORM_ALL & ~wxPATH_NORM_CASE, m_Project->GetBasePath());
//        fname.MakeRelativeTo(m_Project->GetBasePath());
        target->SetOutputFilename(fname.GetFullPath());

        fname.Assign(XRCCTRL(*this, "txtObjectDir", wxTextCtrl)->GetValue());
//        fname.Normalize(wxPATH_NORM_ALL & ~wxPATH_NORM_CASE, m_Project->GetBasePath());
//        fname.MakeRelativeTo(m_Project->GetBasePath());
        target->SetObjectOutput(fname.GetFullPath());

        target->SetCreateHex(XRCCTRL(*this, "chkCreateHex", wxCheckBox)->GetValue());

        // files options
        wxCheckListBox* list = XRCCTRL(*this, "lstFiles", wxCheckListBox);
        int count = list->GetCount();
        for (int i = 0; i < count; ++i)
        {
            ProjectFile* pf = m_Project->GetFile(i);
            if (!pf)
                break;

            if (list->IsChecked(i))
                pf->AddBuildTarget(target->GetTitle());
            else
                pf->RemoveBuildTarget(target->GetTitle());
        }
    }
}
开发者ID:stahta01,项目名称:EmBlocks,代码行数:46,代码来源:projectoptionsdlg.cpp


注:本文中的ProjectBuildTarget::SetCreateHex方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。