本文整理汇总了C++中WndProperty::SetOnHelpCallback方法的典型用法代码示例。如果您正苦于以下问题:C++ WndProperty::SetOnHelpCallback方法的具体用法?C++ WndProperty::SetOnHelpCallback怎么用?C++ WndProperty::SetOnHelpCallback使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WndProperty
的用法示例。
在下文中一共展示了WndProperty::SetOnHelpCallback方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: bstyle
/**
* Creates a control from the given XMLNode as a child of the given
* parent.
*
* @param form the WndForm object
* @param LookUpTable The parent CallBackTable
* @param node The XMLNode that represents the control
* @param eDialogStyle The parent's dialog style
*/
static Window *
LoadChild(WndForm &form, ContainerWindow &parent, Color background_color,
CallBackTableEntry *LookUpTable,
XMLNode node, const DialogStyle eDialogStyle,
int bottom_most=0)
{
Window *window = NULL;
// Determine name, coordinates, width, height
// and caption of the control
const TCHAR* Name = GetName(node);
const TCHAR* Caption = GetCaption(node);
RECT rc = parent.get_client_rect();
ControlPosition pos = GetPosition(node, rc, bottom_most);
if (!pos.no_scaling)
pos.x = ScaleWidth(pos.x, eDialogStyle);
ControlSize size = GetSize(node, rc, pos);
if (!size.no_scaling)
size.cx = ScaleWidth(size.cx, eDialogStyle);
WindowStyle style;
if (!StringToIntDflt(node.getAttribute(_T("Visible")), 1))
style.hide();
if (StringToIntDflt(node.getAttribute(_T("Border")), 0))
style.border();
bool advanced = _tcschr(Caption, _T('*')) != NULL;
// PropertyControl (WndProperty)
if (_tcscmp(node.getName(), _T("Edit")) == 0) {
WndProperty *W;
int CaptionWidth;
bool ReadOnly;
bool MultiLine;
// Determine the width of the caption field
CaptionWidth = StringToIntDflt(node.getAttribute(_T("CaptionWidth")), 0);
if (Layout::ScaleSupported())
CaptionWidth = Layout::Scale(CaptionWidth);
CaptionWidth = ScaleWidth(CaptionWidth, eDialogStyle);
// Determine whether the control is multiline or readonly
MultiLine = StringToIntDflt(node.getAttribute(_T("MultiLine")), 0);
ReadOnly = StringToIntDflt(node.getAttribute(_T("ReadOnly")), 0);
// Load the event callback properties
WndProperty::DataChangeCallback_t DataNotifyCallback =
(WndProperty::DataChangeCallback_t)
GetCallBack(LookUpTable, node, _T("OnDataNotify"));
WindowControl::OnHelpCallback_t OnHelpCallback =
(WindowControl::OnHelpCallback_t)
GetCallBack(LookUpTable, node, _T("OnHelp"));
// Create the Property Control
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);
//.........这里部分代码省略.........
示例2: 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
//.........这里部分代码省略.........