本文整理汇总了C++中Shuttle::TransferString方法的典型用法代码示例。如果您正苦于以下问题:C++ Shuttle::TransferString方法的具体用法?C++ Shuttle::TransferString怎么用?C++ Shuttle::TransferString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shuttle
的用法示例。
在下文中一共展示了Shuttle::TransferString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TransferParameters
bool EffectNyquist::TransferParameters( Shuttle & shuttle )
{
for (size_t i = 0; i < mControls.GetCount(); i++) {
NyqControl *ctrl = &mControls[i];
double d = ctrl->val;
bool good = false;
if (d == UNINITIALIZED_CONTROL) {
if (ctrl->type != NYQ_CTRL_STRING) {
if (!shuttle.mbStoreInClient) {
d = GetCtrlValue(ctrl->valStr);
}
}
}
if (ctrl->type == NYQ_CTRL_REAL) {
good = shuttle.TransferDouble(ctrl->var, d, 0.0);
}
else if (ctrl->type == NYQ_CTRL_INT) {
int val = (int) d;
good = shuttle.TransferInt(ctrl->var, val, 0);
d = (double) val;
}
else if (ctrl->type == NYQ_CTRL_CHOICE) {
//str is coma separated labels for each choice
wxString str = ctrl->label;
wxArrayString choices;
while (1) {
int ci = str.Find( ',' ); //coma index
if (ci == -1) {
choices.Add( str );
break;
}
else {
choices.Add(str.Left(ci));
}
str = str.Right(str.length() - ci - 1);
}
int cnt = choices.GetCount();
if (choices.GetCount() > 0) {
wxString *array = NULL;
array = new wxString[cnt];
for (int j = 0; j < cnt; j++ ) {
array[j] = choices[j];
}
int val = (int) d;
good = shuttle.TransferEnum(ctrl->var, val, cnt, array);
d = (double) val;
delete [] array;
}
}
else if (ctrl->type == NYQ_CTRL_STRING) {
good = shuttle.TransferString(ctrl->var, ctrl->valStr, wxEmptyString);
}
if (ctrl->type != NYQ_CTRL_STRING) {
if (shuttle.mbStoreInClient && good) {
ctrl->val = d;
}
}
}
return true;
}