本文整理汇总了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;
}
}
示例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());
}
}
}