void Main_win::build_matrix(const Dim d) { for(int i = 0; i < d.first; ++i) for(int j = 0; j < d.second; ++j) ui_->mat_layout->addWidget(new Field(this), i, j, Qt::AlignHCenter | Qt::AlignBottom); resize_main_win(d); }
void Main_win::build_matrix(const int rows, const int cols) { for(int i = 0; i < rows; ++i) for(int j = 0; j < cols; ++j) ui_->mat_layout->addWidget(new Field(this), i, j, Qt::AlignHCenter | Qt::AlignBottom); resize_main_win(std::make_pair(rows, cols)); }
void resize_geometry (int new_width, int new_height) { if (display.winW == new_width && display.winH == new_height) { /* Not a resize event. */ return; } /* Update display info */ display.winW = new_width; display.winH = new_height; /* Expand pixmap if necessary */ new_width = new_width - 2*borderx; new_height = new_height - 2*bordery; resize_pixmap (new_width, new_height); /* Adjust items that need adjusting */ initialize_geometry (&scr); scr.select_message.y = SELECT_BUTTON_MESSAGE_Y + (new_height - 480); scr.date.y = DATE_Y + (new_height - 480); scr.time_for_year.y = TIME_FOR_YEAR_Y + (new_height - 480); resize_main_win (new_width, new_height); scr.pbar_area.x = 56 + scr.main_win.w + 16 + 2; scr.pbar_pop.x = scr.pbar_area.x + 4; scr.pbar_tech.x = scr.pbar_area.x + 4; scr.pbar_food.x = scr.pbar_area.x + 4; scr.pbar_jobs.x = scr.pbar_area.x + 4; scr.pbar_money.x = scr.pbar_area.x + 4; scr.pbar_coal.x = scr.pbar_area.x + 4; scr.pbar_goods.x = scr.pbar_area.x + 4; scr.pbar_ore.x = scr.pbar_area.x + 4; scr.pbar_steel.x = scr.pbar_area.x + 4; scr.monthgraph.x = scr.pbar_area.x + 4; scr.mappoint_stats.x = scr.pbar_area.x + 4; scr.market_cb.x = scr.pbar_area.x; scr.mini_map_aux.x = scr.pbar_area.x + 4; scr.mini_map_area.x = scr.pbar_area.x + 4; scr.mini_map.x = scr.mini_map_aux.x + ((scr.mini_map_aux.w - scr.mini_map.w) / 2); /* Complete refresh of the screen required here */ screen_full_refresh (); }