本文整理汇总了C++中WndProperty::SetHelpText方法的典型用法代码示例。如果您正苦于以下问题:C++ WndProperty::SetHelpText方法的具体用法?C++ WndProperty::SetHelpText怎么用?C++ WndProperty::SetHelpText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WndProperty
的用法示例。
在下文中一共展示了WndProperty::SetHelpText方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WndProperty
WndProperty *
RowFormWidget::CreateEdit(const TCHAR *label, const TCHAR *help,
bool read_only)
{
assert(IsDefined());
const PixelRect edit_rc =
InitialControlRect(Layout::GetMinimumControlHeight());
WindowStyle style;
if (!read_only)
style.TabStop();
PanelControl &panel = *(PanelControl *)GetWindow();
WndProperty *edit =
new WndProperty(panel, look, label,
edit_rc, (*label == '\0') ? 0 : 100,
style);
edit->SetReadOnly(read_only);
if (help != NULL)
edit->SetHelpText(help);
return edit;
}
示例2: WndProperty
WndProperty *
RowFormWidget::CreateEdit(const TCHAR *label, const TCHAR *help,
bool read_only)
{
assert(IsDefined());
const PixelRect edit_rc =
InitialControlRect(Layout::GetMinimumControlHeight());
WindowStyle style;
if (!read_only)
style.ControlParent();
EditWindowStyle edit_style;
edit_style.SetVerticalCenter();
if (read_only)
edit_style.SetReadOnly();
else
edit_style.TabStop();
if (IsEmbedded() || Layout::scale_1024 < 2048)
/* sunken edge doesn't fit well on the tiny screen of an embedded
device */
edit_style.Border();
else
edit_style.SunkenEdge();
PanelControl &panel = *(PanelControl *)GetWindow();
WndProperty *edit =
new WndProperty(panel, look, label,
edit_rc, (*label == '\0') ? 0 : 100,
style, edit_style, NULL);
if (help != NULL)
edit->SetHelpText(help);
return edit;
}
示例3: bstyle
//.........这里部分代码省略.........
style.control_parent();
EditWindowStyle edit_style;
if (ReadOnly)
edit_style.read_only();
else
edit_style.tab_stop();
if (is_embedded() || Layout::scale_1024 < 2048)
/* sunken edge doesn't fit well on the tiny screen of an
embedded device */
edit_style.border();
else
edit_style.sunken_edge();
if (MultiLine) {
edit_style.multiline();
edit_style.vscroll();
}
window = W = new WndProperty(parent, Caption,
pos.x, pos.y, size.cx, size.cy,
CaptionWidth, background_color,
style, edit_style,
DataNotifyCallback);
// Set the fore- and background color
LoadColors(*W, node);
// Set the help function event callback
W->SetOnHelpCallback(OnHelpCallback);
// Load the help text
W->SetHelpText(StringToStringDflt(node.getAttribute(_T("Help")), _T("")));
// If the control has (at least) one DataField child control
if (node.nChildNode(_T("DataField")) > 0){
// -> Load the first DataField control
DataField *data_field =
LoadDataField(node.getChildNode(_T("DataField"), 0),
LookUpTable, eDialogStyle);
if (data_field != NULL)
// Tell the Property control about the DataField control
W->SetDataField(data_field);
}
// ButtonControl (WndButton)
} else if (_tcscmp(node.getName(), _T("Button")) == 0) {
// Determine ClickCallback function
WndButton::ClickNotifyCallback_t ClickCallback =
(WndButton::ClickNotifyCallback_t)
GetCallBack(LookUpTable, node, _T("OnClick"));
// Create the ButtonControl
ButtonWindowStyle bstyle(style);
bstyle.tab_stop();
bstyle.multiline();
window = new WndButton(parent, Caption,
pos.x, pos.y, size.cx, size.cy,
bstyle, ClickCallback);
} else if (_tcscmp(node.getName(), _T("CheckBox")) == 0) {
// Determine ClickCallback function
示例4: edit_style
/**
* Creates a control from the given XMLNode as a child of the given
* parent.
*
* @param form the SubForm object
* @param LookUpTable The parent CallBackTable
* @param node The XMLNode that represents the control
*/
static Window *
LoadChild(SubForm &form, ContainerWindow &parent,
const CallBackTableEntry *lookup_table, XMLNode node,
int bottom_most,
WindowStyle style)
{
Window *window = NULL;
// Determine name, coordinates, width, height
// and caption of the control
const TCHAR* name = GetName(node);
const TCHAR* caption = GetCaption(node);
PixelRect rc = parent.get_client_rect();
ControlPosition pos = GetPosition(node, rc, bottom_most);
if (!pos.no_scaling)
pos.x = ScaleWidth(pos.x);
ControlSize size = GetSize(node, rc, pos);
if (!size.no_scaling)
size.cx = ScaleWidth(size.cx);
if (!StringToIntDflt(node.getAttribute(_T("Visible")), 1))
style.Hide();
if (StringToIntDflt(node.getAttribute(_T("Border")), 0))
style.Border();
rc.left = pos.x;
rc.top = pos.y;
rc.right = rc.left + size.cx;
rc.bottom = rc.top + size.cy;
bool expert = (StringToIntDflt(node.getAttribute(_T("Expert")), 0) == 1);
// PropertyControl (WndProperty)
if (StringIsEqual(node.getName(), _T("Edit"))) {
// Determine the width of the caption field
int caption_width = StringToIntDflt(node.getAttribute(_T("CaptionWidth")), 0);
if (Layout::ScaleSupported())
caption_width = Layout::Scale(caption_width);
caption_width = ScaleWidth(caption_width);
// Determine whether the control is multiline or readonly
bool multi_line = StringToIntDflt(node.getAttribute(_T("MultiLine")), 0);
bool read_only = StringToIntDflt(node.getAttribute(_T("ReadOnly")), 0);
// Load the event callback properties
WndProperty::DataChangeCallback_t data_notify_callback =
(WndProperty::DataChangeCallback_t)
GetCallBack(lookup_table, node, _T("OnDataNotify"));
WindowControl::HelpCallback help_callback =
(WindowControl::HelpCallback)
GetCallBack(lookup_table, node, _T("OnHelp"));
// Create the Property Control
style.ControlParent();
EditWindowStyle edit_style;
edit_style.vertical_center();
if (read_only)
edit_style.read_only();
else
edit_style.TabStop();
if (IsEmbedded() || Layout::scale_1024 < 2048)
/* sunken edge doesn't fit well on the tiny screen of an
embedded device */
edit_style.Border();
else
edit_style.SunkenEdge();
if (multi_line) {
edit_style.multiline();
edit_style.VerticalScroll();
}
WndProperty *property;
window = property = new WndProperty(parent, *xml_dialog_look, caption, rc,
caption_width, style, edit_style,
data_notify_callback);
// Set the help function event callback
property->SetOnHelpCallback(help_callback);
// Load the help text
property->SetHelpText(StringToStringDflt(node.getAttribute(_T("Help")),
NULL));
// If the control has (at least) one DataField child control
//.........这里部分代码省略.........