/** * Move button to the specified left and top coordinates. * * The coordinates SHOULD BE in pixels of the screen (i.e. after scaling!) * * @param ch * @param left Number of pixels from the left (in screen pixels) * @param top Number of pixels from the top (in screen pixels) */ void KeyboardControl::move_button(TCHAR ch, int left, int top) { ButtonWindow *kb = get_button(ch); if (kb) kb->move(left, top); }
/** * Move button to the specified left and top coordinates. * * The coordinates SHOULD BE in pixels of the screen (i.e. after scaling!) * * @param ch * @param left Number of pixels from the left (in screen pixels) * @param top Number of pixels from the top (in screen pixels) */ void KeyboardControl::move_button(TCHAR ch, PixelScalar left, PixelScalar top) { ButtonWindow *kb = get_button(ch); if (kb) kb->Move(left, top); }
/** * Move button to the specified left and top coordinates. * * The coordinates SHOULD BE in pixels of the screen (i.e. after scaling!) * * @param ch * @param left Number of pixels from the left (in screen pixels) * @param top Number of pixels from the top (in screen pixels) */ void KeyboardWidget::MoveButton(unsigned ch, PixelScalar left, PixelScalar top) { ButtonWindow *kb = FindButton(ch); if (kb) kb->Move(left, top); }
/** * Resizes the button to specified width and height values according to display pixels! * * * @param ch * @param width Width measured in display pixels! * @param height Height measured in display pixels! */ void KeyboardWidget::ResizeButton(unsigned ch, UPixelScalar width, UPixelScalar height) { ButtonWindow *kb = FindButton(ch); if (kb) kb->Resize(width, height); }
/** * Resizes the button to specified width and height values according to display pixels! * * * @param ch * @param width Width measured in display pixels! * @param height Height measured in display pixels! */ void KeyboardControl::resize_button(TCHAR ch, UPixelScalar width, UPixelScalar height) { ButtonWindow *kb = get_button(ch); if (kb) kb->Resize(width, height); }
/** * Resizes the button to specified width and height values according to display pixels! * * * @param ch * @param width Width measured in display pixels! * @param height Height measured in display pixels! */ void KeyboardControl::resize_button(TCHAR ch, unsigned int width, unsigned int height) { ButtonWindow *kb = get_button(ch); if (kb) kb->resize(width, height); }
void OnResize(PixelSize size) override { SingleWindow::OnResize(size); const PixelRect rc = GetClientRect(); if (test_window.IsDefined()) test_window.Move(rc); if (close_button.IsDefined()) close_button.Move(GetButtonRect(rc)); }
int main(int argc, char **argv) { QApplication app(argc,argv); ButtonWindow *window = new ButtonWindow(); app.setMainWidget(window); window->show(); return app.exec(); }
void KeyboardControl::add_button(const TCHAR* caption) { assert(num_buttons < MAX_BUTTONS); button_values[num_buttons] = caption[0]; ButtonWindow *button = &buttons[num_buttons++]; button->set(*this, caption, (unsigned)caption[0], 0, 0, button_width, button_height); button->set_font(Fonts::MapBold); }
void KeyboardControl::move_buttons_to_row(const TCHAR* buttons, int row, int offset) { if (string_is_empty(buttons)) return; ButtonWindow *kb; for (unsigned i = 0; i < _tcslen(buttons); i++) { kb = get_button(buttons[i]); if (!kb) continue; kb->move(i * button_width + offset, row * button_height); } }
void set(const DialogLook &look, int left, int top, unsigned width, unsigned height) { SingleWindow::set(_T("RunRenderOZ"), _T("RunRenderOZ"), left, top, width, height); const PixelRect rc = get_client_rect(); WindowStyle with_border; with_border.border(); oz.set(*this, rc.right / 2, 0, rc.right - (rc.right / 2), rc.bottom, with_border); oz_window = &oz; type_list = new WndListFrame(*this, look, 0, 0, rc.right / 2, rc.bottom - 30, with_border, 25); type_list->SetPaintItemCallback(paint_oz_type_name); type_list->SetCursorCallback(oz_type_cursor_callback); type_list->SetLength(NUM_OZ_TYPES); close_button.set(*this, _T("Close"), ID_CLOSE, 0, rc.bottom - 30, rc.right / 2, 30); oz.set_shape(ObservationZonePoint::LINE); type_list->set_focus(); }
void set(const DialogLook &look, PixelRect _rc) { SingleWindow::set(_T("RunRenderOZ"), _T("RunRenderOZ"), _rc); const PixelRect rc = get_client_rect(); WindowStyle with_border; with_border.Border(); oz.set(*this, rc.right / 2, 0, rc.right - (rc.right / 2), rc.bottom, with_border); oz_window = &oz; const PixelRect list_rc = { 0, 0, PixelScalar(rc.right / 2), PixelScalar(rc.bottom - 30), }; type_list = new ListControl(*this, look, list_rc, with_border, 25); type_list->SetPaintItemCallback(paint_oz_type_name); type_list->SetCursorCallback(oz_type_cursor_callback); type_list->SetLength(NUM_OZ_TYPES); PixelRect button_rc = rc; button_rc.right = (rc.left + rc.right) / 2; button_rc.top = button_rc.bottom - 30; close_button.set(*this, _T("Close"), ID_CLOSE, button_rc); oz.set_shape(ObservationZonePoint::LINE); type_list->SetFocus(); }
void Create(const DialogLook &look, PixelSize size) { SingleWindow::Create(_T("RunRenderOZ"), size); const PixelRect rc = GetClientRect(); WindowStyle with_border; with_border.Border(); PixelRect oz_rc = rc; oz_rc.left = oz_rc.right / 2; oz.Create(*this, oz_rc, with_border); const PixelRect list_rc(0, 0, rc.right / 2, rc.bottom - 30); type_list = new ListControl(*this, look, list_rc, with_border, 25); type_list->SetItemRenderer(this); type_list->SetCursorHandler(this); type_list->SetLength(NUM_OZ_TYPES); PixelRect button_rc = rc; button_rc.right = (rc.left + rc.right) / 2; button_rc.top = button_rc.bottom - 30; close_button.Create(*this, _T("Close"), ID_CLOSE, button_rc); oz.set_shape(ObservationZone::Shape::LINE); type_list->SetFocus(); }
void KeyboardControl::move_buttons_to_row(const TCHAR* buttons, int row, PixelScalar offset) { if (StringIsEmpty(buttons)) return; ButtonWindow *kb; for (unsigned i = 0; buttons[i] != _T('\0'); i++) { kb = get_button(buttons[i]); if (!kb) continue; kb->Move(i * button_width + offset, row * button_height); } }
void KeyboardControl::add_button(const TCHAR* caption) { assert(num_buttons < MAX_BUTTONS); button_values[num_buttons] = caption[0]; PixelRect rc; rc.left = 0; rc.top = 0; rc.right = button_width; rc.bottom = button_height; ButtonWindow *button = &buttons[num_buttons++]; button->set(*this, caption, (unsigned)caption[0], rc); button->SetFont(*look.button.font); }
void Create(PixelSize size) { TopWindowStyle style; style.Resizable(); SingleWindow::Create(_T("RunFAITriangleSectorRenderer"), size, style); const PixelRect rc = GetClientRect(); WindowStyle with_border; with_border.Border(); PixelRect button_rc = rc; button_rc.top = button_rc.bottom - 30; close_button.Create(*this, _T("Close"), ID_CLOSE, button_rc); close_button.SetFont(normal_font); triangle_window.Create(*this, rc, with_border); }
void Create(PixelSize size) { SingleWindow::Create(_T("Test"), size); WindowStyle style; style.Disable(); const PixelRect rc = GetClientRect(); close_button.Create(*this, _T("Close"), CLOSE, GetButtonRect(rc)); test_window.Create(*this, rc, style); }
void set(PixelRect _rc) { SingleWindow::set(_T("RunCanvas"), _T("RunCanvas"), _rc); PixelRect rc = get_client_rect(); PixelRect button_rc = rc; button_rc.bottom -= 5; button_rc.top = button_rc.bottom - 25; #ifndef ENABLE_OPENGL button_rc.left += 5; button_rc.right = button_rc.left + 65; buffer_button.set(*this, _T("Buffer"), ID_BUFFER, button_rc); #endif button_rc.right = rc.right - 5; button_rc.left = button_rc.right - 65; close_button.set(*this, _T("Close"), ID_CLOSE, button_rc); }
void set(PixelScalar left, PixelScalar top, UPixelScalar width, UPixelScalar height) { SingleWindow::set(_T("RunMapWindow"), _T("RunMapWindow"), left, top, width, height); PixelRect rc = get_client_rect(); map.set(*this, rc); map.SetWaypoints(&way_points); map.SetAirspaces(&airspace_database); map.SetTopography(topography); map.SetTerrain(terrain); if (terrain != NULL) map.SetLocation(terrain->GetTerrainCenter()); rc.left = 5; rc.top = 5; rc.right = rc.left + 60; rc.bottom = rc.top + 20; close_button.set(*this, _T("Close"), ID_CLOSE, rc); close_button.set_font(Fonts::map); close_button.bring_to_top(); }
void Create(PixelSize size) { SingleWindow::Create(_T("RunCanvas"), size); PixelRect rc = GetClientRect(); PixelRect button_rc = rc; button_rc.bottom -= 5; button_rc.top = button_rc.bottom - 25; #ifndef ENABLE_OPENGL button_rc.left += 5; button_rc.right = button_rc.left + 65; buffer_button.Create(*this, _T("Buffer"), ID_BUFFER, button_rc); buffer_button.SetFont(normal_font); #endif button_rc.right = rc.right - 5; button_rc.left = button_rc.right - 65; close_button.Create(*this, _T("Close"), ID_CLOSE, button_rc); close_button.SetFont(normal_font); }
void Create(PixelSize size) { TopWindowStyle style; style.Resizable(); SingleWindow::Create(_T("RunMapWindow"), size, style); PixelRect rc = GetClientRect(); map.Create(*this, rc); map.SetWaypoints(&way_points); map.SetAirspaces(&airspace_database); map.SetTopography(topography); map.SetTerrain(terrain); if (terrain != NULL) map.SetLocation(terrain->GetTerrainCenter()); rc.left = 5; rc.top = 5; rc.right = rc.left + 60; rc.bottom = rc.top + 20; close_button.Create(*this, _T("Close"), ID_CLOSE, rc); close_button.SetFont(Fonts::map); close_button.BringToTop(); }
void Set(PixelRect _rc) { SingleWindow::set(_T("RunFinalGlideBarRenderer"), _T("RunFinalGlideBarRenderer"), _rc); const PixelRect rc = GetClientRect(); WindowStyle with_border; with_border.Border(); final_glide.set(*this, rc.left, rc.top, rc.right, rc.bottom, with_border); PixelRect button_rc = rc; button_rc.top = button_rc.bottom - 30; close_button.set(*this, _T("Close"), ID_CLOSE, button_rc); }
void Create(PixelSize size) { SingleWindow::Create(_T("RunFinalGlideBarRenderer"), size); const PixelRect rc = GetClientRect(); WindowStyle with_border; with_border.Border(); final_glide.Create(*this, rc, with_border); PixelRect button_rc = rc; button_rc.top = button_rc.bottom - 30; close_button.Create(*this, _T("Close"), ID_CLOSE, button_rc); }
void set(int left, int top, unsigned width, unsigned height) { SingleWindow::set(_T("KeyCodeDumper"), _T("KeyCodeDumper"), left, top, width, height); RECT rc = get_client_rect(); key_code_dumper.set(*this, rc.left, rc.top, rc.right - rc.left, (rc.bottom - rc.top + 1) / 2); close_button.set(*this, _T("Close"), ID_CLOSE, rc.left, (rc.top + rc.bottom + 1) / 2, rc.right - rc.left, (rc.top + rc.bottom) / 2); key_code_dumper.set_focus(); }
void set(PixelRect _rc) { SingleWindow::set(_T("KeyCodeDumper"), _T("KeyCodeDumper"), _rc); PixelRect rc = get_client_rect(); PixelRect d_rc = rc; d_rc.bottom = (rc.top + rc.bottom + 1) / 2; key_code_dumper.set(*this, d_rc); PixelRect button_rc = rc; button_rc.top = (rc.top + rc.bottom + 1) / 2; close_button.set(*this, _T("Close"), ID_CLOSE, button_rc); key_code_dumper.set_focus(); }
void Create(PixelSize size) { TopWindowStyle style; style.Resizable(); SingleWindow::Create(_T("RunHorizonRenderer"), size, style); const PixelRect rc = GetClientRect(); WindowStyle with_border; with_border.Border(); horizon.Create(*this, rc, with_border); PixelRect button_rc = rc; button_rc.top = button_rc.bottom - 30; close_button.Create(*this, _T("Close"), ID_CLOSE, button_rc); }
void Set(PixelRect _rc) { TopWindowStyle style; style.Resizable(); SingleWindow::set(_T("RunWindArrowRenderer"), _T("RunWindArrowRenderer"), _rc, style); const PixelRect rc = GetClientRect(); WindowStyle with_border; with_border.Border(); wind.set(*this, rc.left, rc.top, rc.right, rc.bottom, with_border); PixelRect button_rc = rc; button_rc.top = button_rc.bottom - 30; close_button.set(*this, _T("Close"), ID_CLOSE, button_rc); }
virtual void OnResize(UPixelScalar width, UPixelScalar height) { SingleWindow::OnResize(width, height); key_code_dumper.move(0, 0, width, (height + 1) / 2); close_button.move(0, (height + 1) / 2, width, height / 2); }
virtual bool on_resize(unsigned width, unsigned height) { SingleWindow::on_resize(width, height); key_code_dumper.move(0, 0, width, (height + 1) / 2); close_button.move(0, (height + 1) / 2, width, height / 2); return true; }