本文整理汇总了C++中WindowStyle::hide方法的典型用法代码示例。如果您正苦于以下问题:C++ WindowStyle::hide方法的具体用法?C++ WindowStyle::hide怎么用?C++ WindowStyle::hide使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WindowStyle
的用法示例。
在下文中一共展示了WindowStyle::hide方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LogStartUp
void
MainWindow::InitialiseConfigured()
{
PixelRect rc = get_client_rect();
LogStartUp(_T("InfoBox geometry"));
InfoBoxLayout::Init(rc);
const InfoBoxLayout::Layout ib_layout =
InfoBoxLayout::Calculate(rc, InfoBoxLayout::InfoBoxGeometry);
Fonts::SizeInfoboxFont(ib_layout.control_width);
if (Appearance.UseCustomFonts) {
LogStartUp(_T("Load fonts"));
Fonts::LoadCustom();
}
LogStartUp(_T("Create info boxes"));
InfoBoxManager::Create(rc, ib_layout);
map_rect = ib_layout.remaining;
LogStartUp(_T("Create button labels"));
ButtonLabel::CreateButtonLabels(*this);
ButtonLabel::SetLabelText(0,_T("MODE"));
ButtonLabel::SetFont(Fonts::MapBold);
WindowStyle hidden;
hidden.hide();
vario = new GlueGaugeVario(*this,
rc.right - ib_layout.control_width, 0,
ib_layout.control_width,
ib_layout.control_height * 3,
hidden);
WindowStyle hidden_border;
hidden_border.hide();
hidden_border.border();
flarm = new GaugeFLARM(*this,
rc.right - ib_layout.control_width * 2 + 1,
rc.bottom - ib_layout.control_height * 2 + 1,
ib_layout.control_width * 2 - 1,
ib_layout.control_height * 2 - 1,
hidden_border);
flarm->bring_to_top();
unsigned sz = std::min(ib_layout.control_height,
ib_layout.control_width) * 2;
ta = new GaugeThermalAssistant(*this, 0, rc.bottom - sz, sz, sz,
hidden_border);
ta->bring_to_top();
map.set(*this, map_rect);
map.set_font(Fonts::Map);
LogStartUp(_T("Initialise message system"));
popup.set(rc);
}
示例2: GetInfoBoxBorder
void
InfoBoxManager::Create(PixelRect rc, const InfoBoxLayout::Layout &_layout,
const InfoBoxLook &look)
{
first = true;
layout = _layout;
WindowStyle style;
style.hide();
full_window.set(XCSoarInterface::main_window, rc.left, rc.top,
rc.right - rc.left, rc.bottom - rc.top, style);
// create infobox windows
for (unsigned i = 0; i < layout.count; i++) {
const PixelRect &rc = layout.positions[i];
int Border = GetInfoBoxBorder(i);
InfoBoxes[i] = new InfoBoxWindow(XCSoarInterface::main_window,
rc.left, rc.top,
rc.right - rc.left, rc.bottom - rc.top,
Border, look);
}
SetDirty();
}
示例3: canvas
ProgressWindow::ProgressWindow(ContainerWindow &parent)
:background_color(COLOR_WHITE),
background_brush(background_color),
position(0)
{
PixelRect rc = parent.get_client_rect();
WindowStyle style;
style.hide();
set(parent, rc.left, rc.top, rc.right, rc.bottom, style);
unsigned width = rc.right - rc.left, height = rc.bottom - rc.top;
// Load progress bar background
bitmap_progress_border.load(IDB_PROGRESSBORDER);
// Determine text height
#ifdef ENABLE_SDL
font.set("Droid Sans", 12);
text_height = font.get_height();
#else
VirtualCanvas canvas(1, 1);
text_height = canvas.text_height(_T("W"));
#endif
// Make progress bar height proportional to window height
unsigned progress_height = height / 20;
unsigned progress_horizontal_border = progress_height / 2;
progress_border_height = progress_height * 2;
// Initialize message text field
TextWindowStyle message_style;
message_style.center();
message.set(*this, NULL, 0,
height - progress_border_height - text_height - (height/48),
width, text_height, message_style);
#ifdef ENABLE_SDL
message.set_font(font);
#endif
// Initialize progress bar
ProgressBarStyle pb_style;
progress_bar.set(*this, progress_horizontal_border,
height - progress_border_height + progress_horizontal_border,
width - progress_height,
progress_height, pb_style);
message.install_wndproc(); // needed for on_color()
// Set progress bar step size and range
set_range(0, 1000);
set_step(50);
// Show dialog
show_on_top();
update();
}
示例4: Color
void
InfoBoxManager::Create(RECT rc)
{
info_box_look.value.fg_color
= info_box_look.title.fg_color
= info_box_look.comment.fg_color
= Appearance.InverseInfoBox ? Color::WHITE : Color::BLACK;
info_box_look.background_brush.set(Appearance.InverseInfoBox
? Color::BLACK : Color::WHITE);
Color border_color = Color(80, 80, 80);
info_box_look.border_pen.set(InfoBoxWindow::BORDER_WIDTH, border_color);
info_box_look.selector_pen.set(IBLSCALE(1) + 2,
info_box_look.value.fg_color);
info_box_look.value.font = &Fonts::InfoBox;
info_box_look.title.font = &Fonts::Title;
info_box_look.comment.font = &Fonts::Title;
info_box_look.small_font = &Fonts::InfoBoxSmall;
info_box_look.colors[0] = border_color;
info_box_look.colors[1] = Appearance.InverseInfoBox
? Graphics::inv_redColor : Color::RED;
info_box_look.colors[2] = Appearance.InverseInfoBox
? Graphics::inv_blueColor : Color::BLUE;
info_box_look.colors[3] = Appearance.InverseInfoBox
? Graphics::inv_greenColor : Color::GREEN;
info_box_look.colors[4] = Appearance.InverseInfoBox
? Graphics::inv_yellowColor : Color::YELLOW;
info_box_look.colors[5] = Appearance.InverseInfoBox
? Graphics::inv_magentaColor : Color::MAGENTA;
WindowStyle style;
style.hide();
full_window.set(XCSoarInterface::main_window, rc.left, rc.top,
rc.right - rc.left, rc.bottom - rc.top);
// create infobox windows
for (unsigned i = 0; i < InfoBoxLayout::numInfoWindows; i++) {
int xoff, yoff, sizex, sizey;
InfoBoxLayout::GetInfoBoxPosition(i, rc, &xoff, &yoff, &sizex, &sizey);
int Border = GetInfoBoxBorder(i);
InfoBoxes[i] = new InfoBoxWindow(XCSoarInterface::main_window,
xoff, yoff, sizex, sizey,
Border, info_box_look);
}
}
示例5: 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);
//.........这里部分代码省略.........
示例6: xmlOpenResourceHelper
/**
* This function returns a WndForm created either from the ressources or
* from the XML file in XCSoarData(if found)
* @param LookUpTable The CallBackTable
* @param FileName The XML filename to search for in XCSoarData
* @param Parent The parent window (e.g. XCSoarInterface::main_window)
* @param resource The resource to look for
* @return The WndForm object
*/
WndForm *
LoadDialog(CallBackTableEntry *LookUpTable, SingleWindow &Parent,
const TCHAR* resource)
{
WndForm *form = NULL;
// Find XML file or resource and load XML data out of it
XMLNode node = xmlOpenResourceHelper(resource);
// TODO code: put in error checking here and get rid of exits in xmlParser
// If XML error occurred -> Error messagebox + cancel
if (node.isEmpty()) {
ShowXMLError();
return NULL;
}
// If the main XMLNode is of type "Form"
if (_tcsicmp(node.getName(), _T("Form")) != 0)
// Get the first child node of the type "Form"
// and save it as the dialog node
node = node.getChildNode(_T("Form"));
// If Node does not exists -> Error messagebox + cancel
if (node.isEmpty()) {
ShowXMLError();
return NULL;
}
// Determine the dialog style of the dialog
DialogStyle dialog_style = GetDialogStyle(node);
// Determine the dialog size
const TCHAR* Caption = GetCaption(node);
const RECT rc = Parent.get_client_rect();
ControlPosition pos = GetPosition(node, rc);
ControlSize size = GetSize(node, rc, pos);
InitScaleWidth(size, rc, dialog_style);
// Correct dialog size and position for dialog style
switch (dialog_style) {
case dsFullWidth:
pos.x = rc.left;
pos.y = rc.top;
size.cx = rc.right - rc.left; // stretch form to full width of screen
size.cy = rc.bottom - rc.top;
break;
case dsScaledCentered:
pos = SetPositionCentered(pos, rc, size);
break;
case dsScaled:
case dsFixed:
break;
}
// Create the dialog
WindowStyle style;
style.hide();
style.control_parent();
form = new WndForm(Parent, pos.x, pos.y, size.cx, size.cy, Caption, style);
// Set fore- and background colors
Color color;
if (StringToColor(node.getAttribute(_T("BackColor")), color))
form->SetBackColor(color);
// Load the children controls
LoadChildrenFromXML(*form, form->GetClientAreaWindow(), form->GetBackColor(),
LookUpTable, &node, dialog_style);
// If XML error occurred -> Error messagebox + cancel
if (XMLNode::GlobalError) {
ShowXMLError();
delete form;
return NULL;
}
// Return the created form
return form;
}