| 68 | } |
| 69 | |
| 70 | void DsnConfigurationWindow::Create() { |
| 71 | // Finding out parent position. |
| 72 | RECT parent_rect; |
| 73 | GetWindowRect(parent_->GetHandle(), &parent_rect); |
| 74 | |
| 75 | // Positioning window to the center of parent window. |
| 76 | const int pos_x = |
| 77 | parent_rect.left + (parent_rect.right - parent_rect.left - width_) / 2; |
| 78 | const int pos_y = |
| 79 | parent_rect.top + (parent_rect.bottom - parent_rect.top - height_) / 2; |
| 80 | |
| 81 | RECT desired_rect = {pos_x, pos_y, pos_x + width_, pos_y + height_}; |
| 82 | AdjustWindowRect(&desired_rect, WS_BORDER | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME, |
| 83 | FALSE); |
| 84 | |
| 85 | Window::Create(WS_OVERLAPPED | WS_SYSMENU, desired_rect.left, desired_rect.top, |
| 86 | desired_rect.right - desired_rect.left, |
| 87 | desired_rect.bottom - desired_rect.top, 0); |
| 88 | |
| 89 | if (!handle_) { |
| 90 | std::stringstream buf; |
| 91 | buf << "Can not create window, error code: " << GetLastError(); |
| 92 | throw DriverException(buf.str()); |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | void DsnConfigurationWindow::OnCreate() { |
| 97 | tab_control_ = CreateTabControl(ChildId::TAB_CONTROL); |
no test coverage detected