本文整理汇总了C++中ContainerWindow::get_client_rect方法的典型用法代码示例。如果您正苦于以下问题:C++ ContainerWindow::get_client_rect方法的具体用法?C++ ContainerWindow::get_client_rect怎么用?C++ ContainerWindow::get_client_rect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContainerWindow
的用法示例。
在下文中一共展示了ContainerWindow::get_client_rect方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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();
}
示例2: GetButtonPosition
MenuBar::MenuBar(ContainerWindow &parent)
{
const PixelRect rc = parent.get_client_rect();
ButtonWindowStyle style;
style.Hide();
style.Border();
style.multiline();
for (unsigned i = 0; i < MAX_BUTTONS; ++i) {
PixelRect button_rc = GetButtonPosition(i, rc);
buttons[i].set(parent, _T(""), button_rc, style);
}
}
示例3: GetButtonPosition
MenuBar::MenuBar(ContainerWindow &parent)
{
const RECT rc = parent.get_client_rect();
int x, y, xsize, ysize;
ButtonWindowStyle style;
style.hide();
style.border();
style.multiline();
for (unsigned i = 0; i < MAX_BUTTONS; ++i) {
GetButtonPosition(i, rc, &x, &y, &xsize, &ysize);
buttons[i].set(parent, _T(""), i, x, y, xsize, ysize,
style);
}
}