本文整理汇总了C++中BButton::GetString方法的典型用法代码示例。如果您正苦于以下问题:C++ BButton::GetString方法的具体用法?C++ BButton::GetString怎么用?C++ BButton::GetString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BButton
的用法示例。
在下文中一共展示了BButton::GetString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetConnectorStr
bool BContainer::GetConnectorStr(int* i,CString* connector)
{
BItem* element;
DWORD parentOffset;
BButton* conName;
CString temp;
element = GetElement(*i);
if(element == NULL)
return false;
if(element->elementType != TYPE_ELEMENT_HEADER)
{
return false;
}
conName = (BButton*)element;
conName->GetString(&temp);
parentOffset = element->offset;
connector->Format("%s{",temp);
*i+=1;
element = GetElement(*i);
while(*i<vElements.GetSize() && element != NULL && element->offset >parentOffset)
{
if(!GetElementStr(element,&temp))
{
*i+=1;
element = GetElement(*i);
continue;
}
connector->Append(temp);
*i+=1;
element = GetElement(*i);
}
connector->AppendChar('}');
return true;
}
示例2: GetElementStr
bool BContainer::GetElementStr(BItem* element,CString* str)
{
BCheckBox* boolItem;
BEdit* editItem;
BCombo* comboItem;
BFile* fileItem;
BButton* buttonItem;
CString temp;
GML::Utils::GString gStrTemp;
UINT someUIntValue;
int someIntValue;
double someDoubleValue;
switch(element->elementType)
{
case GML::Utils::AttributeList::BOOLEAN:
boolItem = (BCheckBox*)element;
if(boolItem->IsChecked())
str->Format("%s=True;",boolItem->label);
else
str->Format("%s=False;",boolItem->label);
return true;
case GML::Utils::AttributeList::UINT32:
editItem = (BEdit*)element;
editItem->GetText(temp);
gStrTemp.Set(temp.GetBuffer());
if(!gStrTemp.ConvertToUInt32(&someUIntValue))
return false;
str->Format("%s=%u;",editItem->label,someUIntValue);
return true;
case GML::Utils::AttributeList::INT32:
editItem = (BEdit*)element;
editItem->GetText(temp);
gStrTemp.Set(temp.GetBuffer());
if(!gStrTemp.ConvertToInt32(&someIntValue))
return false;
str->Format("%s=%d;",editItem->label,someIntValue);
return true;
case GML::Utils::AttributeList::DOUBLE:
editItem = (BEdit*)element;
editItem->GetText(temp);
gStrTemp.Set(temp.GetBuffer());
if(!gStrTemp.ConvertToDouble(&someDoubleValue))
return false;
str->Format("%s=%lf;",editItem->label,someDoubleValue);
return true;
case GML::Utils::AttributeList::STRING:
editItem = (BEdit*)element;
editItem->GetText(temp);
if(temp.Compare("")==0)
{
return false;
}
str->Format("%s=%s;",editItem->label,temp);
return true;
case TYPE_COMBO:
comboItem = (BCombo*)element;
comboItem->GetSelectedItem(temp);
str->Format("%s=%s;",comboItem->label,temp);
return true;
case TYPE_FILE:
fileItem = (BFile*)element;
fileItem->GetText(temp);
str->Format("%s=%s;",fileItem->label,temp);
return true;
case TYPE_ELEMENT_HEADER:
buttonItem = (BButton*)element;
buttonItem->GetString(&temp);
str->Format("%s",temp);
return true;
}
return false;
}