本文整理汇总了C++中ContainerWindow::GetClientRect方法的典型用法代码示例。如果您正苦于以下问题:C++ ContainerWindow::GetClientRect方法的具体用法?C++ ContainerWindow::GetClientRect怎么用?C++ ContainerWindow::GetClientRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContainerWindow
的用法示例。
在下文中一共展示了ContainerWindow::GetClientRect方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: canvas
ProgressWindow::ProgressWindow(ContainerWindow &parent)
:background_color(COLOR_WHITE),
background_brush(background_color),
position(0)
{
PixelRect rc = parent.GetClientRect();
WindowStyle style;
style.Hide();
Create(parent, rc, style);
const unsigned width = rc.right - rc.left, height = rc.bottom - rc.top;
// Load progress bar background
bitmap_progress_border.Load(IDB_PROGRESSBORDER);
// Determine text height
#ifndef USE_GDI
font.Load(FontDescription(Layout::FontScale(10)));
text_height = font.GetHeight();
#else
VirtualCanvas canvas({1, 1});
text_height = canvas.GetFontHeight();
#endif
// Make progress bar height proportional to window height
const unsigned progress_height = height / 20;
const unsigned progress_horizontal_border = progress_height / 2;
progress_border_height = progress_height * 2;
// Initialize message text field
PixelRect message_rc = rc;
message_rc.bottom -= progress_border_height + height / 48;
message_rc.top = message_rc.bottom - text_height;
TextWindowStyle message_style;
message_style.center();
message.Create(*this, NULL, message_rc, message_style);
#ifndef USE_GDI
message.SetFont(font);
#endif
// Initialize progress bar
PixelRect pb_rc;
pb_rc.left = progress_horizontal_border;
pb_rc.right = pb_rc.left + width - progress_height;
pb_rc.top = height - progress_border_height + progress_horizontal_border;
pb_rc.bottom = pb_rc.top + progress_height;
ProgressBarStyle pb_style;
progress_bar.Create(*this, pb_rc, pb_style);
message.InstallWndProc(); // needed for OnChildColor()
// Set progress bar step size and range
SetRange(0, 1000);
SetStep(50);
// Show dialog
ShowOnTop();
}
示例2: Create
TabBarControl::TabBarControl(ContainerWindow &_parent, const DialogLook &look,
PixelRect tab_rc,
const WindowStyle style, bool vertical)
:tab_display(nullptr)
{
Create(_parent, _parent.GetClientRect(), style);
tab_display = new TabDisplay(*this, look, *this, tab_rc, vertical);
pager.Move(MakePagerRect(GetClientRect(), tab_rc, vertical));
}
示例3: GetButtonPosition
MenuBar::MenuBar(ContainerWindow &parent, const ButtonLook &look)
{
const PixelRect rc = parent.GetClientRect();
WindowStyle style;
style.Hide();
style.Border();
for (unsigned i = 0; i < MAX_BUTTONS; ++i) {
PixelRect button_rc = GetButtonPosition(i, rc);
buttons[i].Create(parent, look, _T(""), button_rc, style);
}
}