ProgressWindow::ProgressWindow(ContainerWindow &parent) { set(parent, InfoBoxLayout::landscape ? (LPCTSTR)IDD_PROGRESS_LANDSCAPE : (LPCTSTR)IDD_PROGRESS); TCHAR Temp[1024]; _stprintf(Temp, _T("%s %s"), gettext(_T("Version")), XCSoar_Version); set_item_text(IDC_VERSION, Temp); #ifdef WINDOWSPC RECT rc = parent.get_client_rect(); RECT rcp = get_client_rect(); move(rc.left, rc.top, rcp.right - rcp.left, rcp.bottom - rcp.top); #else #ifndef GNAV SHFullScreen(hWnd, SHFS_HIDETASKBAR|SHFS_HIDESIPBUTTON|SHFS_HIDESTARTICON); #endif #endif insert_after(HWND_TOP, true); set_range(0, 100); set_step(5); #ifndef ENABLE_SDL ::SetForegroundWindow(hWnd); #endif /* !ENABLE_SDL */ update(); }
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(); }
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); } }
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); } }