本文整理汇总了C++中wxVariant::MakeString方法的典型用法代码示例。如果您正苦于以下问题:C++ wxVariant::MakeString方法的具体用法?C++ wxVariant::MakeString怎么用?C++ wxVariant::MakeString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类wxVariant
的用法示例。
在下文中一共展示了wxVariant::MakeString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LogVariant
void LogVariant(const wxString& prefix, const wxVariant& v)
{
const wxString type = v.GetType();
wxString info;
const wxString& name = v.GetName();
if (type == wxS("arrstring")) {
wxArrayString as = v.GetArrayString();
info.Printf(wxS("%svariant type: \"%s\", element count: %zu, name: \"%s\"."),
prefix, type, as.size(), name);
wxLogTrace(wxTRACE_AutoExcel, wxS("%s"), info);
for (size_t i = 0; i < as.size(); i++)
{
info.Printf(wxS(" string #%zu value: \"%s\""), i, as[i]);
if ( i == LogVariantMaxItemsInList )
{
wxLogTrace(wxTRACE_AutoExcel, wxS("And %zu more strings"), as.size() - i);
break;
}
else
wxLogTrace(wxTRACE_AutoExcel, wxS("%s"), info);
}
return;
}
if (type == wxS("list")) {
info.Printf(wxS("%sVariant type: \"%s\", element count: %zu, name: \"%s\"."),
prefix, type, v.GetCount(), name);
wxLogTrace(wxTRACE_AutoExcel, wxS("%s"), info);
for (size_t i = 0; i < v.GetCount(); i++)
{
if ( i == LogVariantMaxItemsInList )
{
wxLogTrace(wxTRACE_AutoExcel, wxS("And %zu more variants"), v.GetCount() - i);
break;
} else
{
const wxVariant& vTmp = v[i];
info.Printf(wxS(" variant #%zu type: \"%s\", value: \"%s\", name: \"%s\"."),
i, vTmp.GetType(), vTmp.MakeString(), vTmp.GetName());
wxLogTrace(wxTRACE_AutoExcel, wxS("%s"), info);
}
}
return;
}
if (type == wxS("void*") && v.GetVoidPtr() != NULL) {
wxString automationName;
wxExcelObject object;
IDispatch* dispatch = (IDispatch*)v.GetVoidPtr();
dispatch->AddRef();
object.GetAutomationObject_()->SetDispatchPtr(dispatch);
info.Printf(wxS("%svariant type: \"IDispatch - %s\", value: \"%s\", name: \"%s\"."),
prefix, object.GetAutomationObjectName_(false), v.MakeString(), name);
} else {
info.Printf(wxS("%svariant type: \"%s\", value: \"%s\", name: \"%s\"."),
prefix, type, v.MakeString(), name);
}
wxLogTrace(wxTRACE_AutoExcel, wxS("%s"), info);
}
示例2: AddParameter
void CommandSignature::AddParameter(const wxString &name,
const wxVariant &dft,
std::unique_ptr<Validator> &&valid)
{
wxASSERT_MSG(valid->Validate(dft),
wxT("Invalid command signature: the default value of '")
+ dft.MakeString()
+ wxT("' for the '")
+ name
+ wxT("' parameter doesn't satisfy the provided validator.")
+ wxT(" It should be ")
+ valid->GetDescription()
+ wxT("."));
mDefaults.insert(std::pair<wxString, wxVariant>(name, dft));
mValidators.insert(ValidatorMap::value_type(name, std::move(valid)));
}
示例3: SetValueByRow
// set value, call ValueChanged() afterwards!
bool wxDBase::SetValueByRow(const wxVariant& var, unsigned int row, unsigned int col)
{
bool ok = true;
if (ok) ok = SetPosition(row);
if (var.IsType(wxT("datetime")))
{
ok = Write(col, var.GetDateTime());
}
else
{
ok = Write(col, var.MakeString());
}
if (ok)
{
ok = PutRecord(row);
}
return ok;
}
示例4: convert
static std::string convert(const wxVariant& v)
{
return v.MakeString().ToStdString(wxConvUTF8);
}