本文整理汇总了C++中SubForm类的典型用法代码示例。如果您正苦于以下问题:C++ SubForm类的具体用法?C++ SubForm怎么用?C++ SubForm使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SubForm类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ShowFormControl
void
ShowFormControl(SubForm &form, const TCHAR *control_name, bool visible)
{
Window *window = form.FindByName(control_name);
assert(window != NULL);
window->SetVisible(visible);
}
示例2: SetFormControlEnabled
void
SetFormControlEnabled(SubForm &form, const TCHAR *control_name, bool enabled)
{
Window *window = form.FindByName(control_name);
assert(window != NULL);
window->SetEnabled(enabled);
}
示例3: ShowOptionalFormControl
void
ShowOptionalFormControl(SubForm &form, const TCHAR *control_name,
bool visible)
{
Window *window = form.FindByName(control_name);
if (window != NULL)
window->SetVisible(visible);
}
示例4: SetDataAccessCallback
static void
SetDataAccessCallback(SubForm &form, const TCHAR *name,
DataField::DataAccessCallback cb)
{
WndProperty *edit = (WndProperty *)form.FindByName(name);
assert(edit != nullptr);
DataField *df = edit->GetDataField();
assert(df != nullptr);
df->SetDataAccessCallback(cb);
}
示例5: SetFormValue
void
SetFormValue(SubForm &form, const TCHAR *control_name, const TCHAR *value)
{
assert(control_name != NULL);
assert(value != NULL);
WndProperty *ctl = (WndProperty *)form.FindByName(control_name);
assert(ctl != NULL);
ctl->SetText(value);
}
示例6: GetFormValueInteger
int
GetFormValueInteger(const SubForm &form, const TCHAR *control_name)
{
assert(control_name != NULL);
const WndProperty *control =
(const WndProperty *)form.FindByName(control_name);
assert(control != NULL);
return control->GetDataField()->GetAsInteger();
}
示例7: GetFormValueFixed
fixed
GetFormValueFixed(const SubForm &form, const TCHAR *control_name)
{
const WndProperty *control =
(const WndProperty *)form.FindByName(control_name);
assert(control != NULL);
const DataFieldFloat &df = *(const DataFieldFloat *)control->GetDataField();
assert(df.GetType() == DataField::Type::REAL);
return df.GetAsFixed();
}
示例8: LoadFormProperty
void
LoadFormProperty(SubForm &form, const TCHAR *control_name, unsigned int value)
{
assert(control_name != NULL);
WndProperty *ctl = (WndProperty *)form.FindByName(control_name);
if (ctl == NULL)
return;
ctl->GetDataField()->SetAsInteger(value);
ctl->RefreshDisplay();
}
示例9: LoadFormPropertyEnum
void
LoadFormPropertyEnum(SubForm &form, const TCHAR *control_name, int value)
{
assert(control_name != NULL);
WndProperty *ctl = (WndProperty *)form.FindByName(control_name);
assert(ctl != NULL);
DataFieldEnum &df = *(DataFieldEnum *)ctl->GetDataField();
assert(df.GetType() == DataField::Type::ENUM);
df.Set(value);
ctl->RefreshDisplay();
}
示例10: GetFormValueBoolean
bool
GetFormValueBoolean(const SubForm &form, const TCHAR *control_name)
{
assert(control_name != NULL);
const WndProperty *control =
(const WndProperty *)form.FindByName(control_name);
assert(control != NULL);
const DataFieldBoolean &df =
*(const DataFieldBoolean *)control->GetDataField();
assert(df.GetType() == DataField::Type::BOOLEAN);
return df.GetAsBoolean();
}
示例11: LoadOptionalFormProperty
void
LoadOptionalFormProperty(SubForm &form, const TCHAR *control_name,
UnitGroup unit_group, fixed value)
{
assert(control_name != NULL);
WndProperty *ctl = (WndProperty *)form.FindByName(control_name);
if (ctl == NULL)
return;
Unit unit = Units::GetUserUnitByGroup(unit_group);
DataFieldFloat &df = *(DataFieldFloat *)ctl->GetDataField();
assert(df.GetType() == DataField::Type::REAL);
df.SetUnits(Units::GetUnitName(unit));
df.Set(Units::ToUserUnit(value, unit));
ctl->RefreshDisplay();
}
示例12: Unprepare
/**
* Clears and deletes the windows created by LoadWindow
* during Prepare() associated with the WindowWidget
*/
virtual void Unprepare() override {
form.Clear();
}