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


C++ wxVariant::MakeString方法代码示例

本文整理汇总了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);
}
开发者ID:pbfordev,项目名称:wxAutoExcel,代码行数:58,代码来源:wxAutoExcel_private.cpp

示例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)));
}
开发者ID:SteveDaulton,项目名称:audacity,代码行数:16,代码来源:CommandSignature.cpp

示例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;
}
开发者ID:4Step,项目名称:crossPlatform_methods,代码行数:20,代码来源:dbf_wx.cpp

示例4: convert

 static std::string convert(const wxVariant& v)
 {
     return v.MakeString().ToStdString(wxConvUTF8);
 }
开发者ID:CodeSmithyIDE,项目名称:wxWidgets,代码行数:4,代码来源:anytest.cpp


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