本文整理汇总了C++中WindowStyle::border方法的典型用法代码示例。如果您正苦于以下问题:C++ WindowStyle::border方法的具体用法?C++ WindowStyle::border怎么用?C++ WindowStyle::border使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WindowStyle
的用法示例。
在下文中一共展示了WindowStyle::border方法的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:
static WindowStyle
add_border(WindowStyle style)
{
style.border();
return style;
}