Project

Profile

Help

HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. *Read more...*

Feature #904053 ยป 0008-sdl2-Rename-struct-Theme-and-members-to-adhere-codin.patch

Marko Lindqvist, 2020-12-07 08:21 PM

View differences:

client/gui-sdl2/action_dialog.c
/* ------------------ */
/* exit button */
buf = create_themeicon(current_theme->Small_CANCEL_Icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"),
adj_font(12));
adj_font(12));
area.w += buf->size.w + adj_size(10);
buf->action = exit_spy_tgt_dlg_callback;
set_wstate(buf, FC_WS_NORMAL);
......
/* ---------- */
/* exit button */
buf = create_themeicon(current_theme->Small_CANCEL_Icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"),
adj_font(12));
adj_font(12));
area.w += buf->size.w + adj_size(10);
buf->action = exit_spy_tgt_dlg_callback;
set_wstate(buf, FC_WS_NORMAL);
......
if (INCITE_IMPOSSIBLE_COST == cost) {
/* exit button */
buf = create_themeicon(current_theme->Small_CANCEL_Icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL
| WF_RESTORE_BACKGROUND);
buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL
| WF_RESTORE_BACKGROUND);
buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"),
adj_font(12));
adj_font(12));
area.w += buf->size.w + adj_size(10);
buf->action = exit_incite_dlg_callback;
set_wstate(buf, FC_WS_NORMAL);
......
} else {
/* exit button */
buf = create_themeicon(current_theme->Small_CANCEL_Icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL
| WF_RESTORE_BACKGROUND);
buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL
| WF_RESTORE_BACKGROUND);
buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"),
adj_font(12));
adj_font(12));
area.w += buf->size.w + adj_size(10);
buf->action = exit_incite_dlg_callback;
set_wstate(buf, FC_WS_NORMAL);
......
} else {
/* exit button */
buf = create_themeicon(current_theme->Small_CANCEL_Icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL
| WF_RESTORE_BACKGROUND);
buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL
| WF_RESTORE_BACKGROUND);
buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"),
adj_font(12));
adj_font(12));
area.w += buf->size.w + adj_size(10);
buf->action = exit_bribe_dlg_callback;
set_wstate(buf, FC_WS_NORMAL);
client/gui-sdl2/chatline.c
area = pwindow->area;
/* close button */
close_button = create_themeicon(current_theme->Small_CANCEL_Icon, pwindow->dst,
close_button = create_themeicon(current_theme->small_cancel_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL
| WF_RESTORE_BACKGROUND);
close_button->info_label = create_utf8_from_char(_("Close Dialog (Esc)"),
......
/* buttons */
buf = create_themeicon_button_from_chars(current_theme->BACK_Icon, pwindow->dst,
buf = create_themeicon_button_from_chars(current_theme->back_icon, pwindow->dst,
_("Back"), adj_font(12), 0);
buf->size.x = adj_size(10);
buf->size.y = pwindow->size.h - adj_size(10) - buf->size.h;
......
add_to_gui_list(ID_BUTTON, buf);
back_button = buf;
buf = create_themeicon_button_from_chars(current_theme->OK_Icon, pwindow->dst,
buf = create_themeicon_button_from_chars(current_theme->ok_icon, pwindow->dst,
_("Start"), adj_font(12), 0);
buf->size.x = pwindow->size.w - adj_size(10) - buf->size.w;
buf->size.y = back_button->size.y;
client/gui-sdl2/citydlg.c
area.w = MAX(area.w , text->w);
area.h += text->h + adj_size(5);
buf = create_themeicon_button_from_chars(current_theme->CANCEL_Icon,
pwindow->dst, _("No"), adj_font(12), 0);
buf = create_themeicon_button_from_chars(current_theme->cancel_icon,
pwindow->dst, _("No"), adj_font(12), 0);
buf->action = cancel_buy_prod_city_dlg_callback;
set_wstate(buf, FC_WS_NORMAL);
......
add_to_gui_list(ID_BUTTON, buf);
if (city_can_buy(pcity) && (value <= client.conn.playing->economic.gold)) {
buf = create_themeicon_button_from_chars(current_theme->OK_Icon, pwindow->dst,
_("Yes"), adj_font(12), 0);
buf = create_themeicon_button_from_chars(current_theme->ok_icon, pwindow->dst,
_("Yes"), adj_font(12), 0);
buf->action = ok_buy_prod_city_dlg_callback;
set_wstate(buf, FC_WS_NORMAL);
......
/* create cancel button */
cancel_button =
create_themeicon_button_from_chars(current_theme->Small_CANCEL_Icon,
create_themeicon_button_from_chars(current_theme->small_cancel_icon,
pwindow->dst, _("Cancel"), adj_font(10), 0);
cancel_button->action = sell_imprvm_dlg_cancel_callback;
cancel_button->key = SDLK_ESCAPE;
......
add_to_gui_list(ID_BUTTON, cancel_button);
/* create ok button */
ok_button = create_themeicon_button_from_chars(current_theme->Small_OK_Icon,
pwindow->dst, _("Sell"),
adj_font(10), 0);
ok_button = create_themeicon_button_from_chars(current_theme->small_ok_icon,
pwindow->dst, _("Sell"),
adj_font(10), 0);
ok_button->data.ptr = (void *)impr;
ok_button->size.w = cancel_button->size.w;
ok_button->action = sell_imprvm_dlg_ok_callback;
......
surf = create_text_surf_from_utf8(pstr);
dest.x = city_window->area.x + adj_size(2) + (adj_size(192) - surf->w) / 2;
dest.y = city_window->area.y + adj_size(4) + current_theme->INFO_Icon->h;
dest.y = city_window->area.y + adj_size(4) + current_theme->info_icon->h;
alphablit(surf, NULL, city_window->dst->surface, &dest, 255);
......
surf = create_text_surf_from_utf8(pstr);
dest.x = city_window->area.x + adj_size(2) + (adj_size(192) - surf->w) / 2;
dest.y = city_window->area.y + + adj_size(4) + current_theme->INFO_Icon->h;
dest.y = city_window->area.y + + adj_size(4) + current_theme->info_icon->h;
alphablit(surf, NULL, city_window->dst->surface, &dest, 255);
......
surf = create_text_surf_from_utf8(pstr);
dest.x = city_window->area.x + adj_size(2) + (adj_size(192) - surf->w) / 2;
dest.y = city_window->area.y + adj_size(4) + current_theme->INFO_Icon->h;
dest.y = city_window->area.y + adj_size(4) + current_theme->info_icon->h;
alphablit(surf, NULL, city_window->dst->surface, &dest, 255);
......
surf = create_text_surf_from_utf8(pstr);
dest.x = city_window->area.x + adj_size(2) + (adj_size(192) - surf->w) / 2;
dest.y = city_window->area.y + adj_size(4) + current_theme->INFO_Icon->h;
dest.y = city_window->area.y + adj_size(4) + current_theme->info_icon->h;
alphablit(surf, NULL, city_window->dst->surface, &dest, 255);
......
surf = create_text_surf_from_utf8(pstr);
dest.x = city_window->area.x + adj_size(2) + (adj_size(192) - surf->w) / 2;
dest.y = city_window->area.y + adj_size(4) + current_theme->INFO_Icon->h;
dest.y = city_window->area.y + adj_size(4) + current_theme->info_icon->h;
alphablit(surf, NULL, city_window->dst->surface, &dest, 255);
dest.x = city_window->size.x + adj_size(10);
......
/* ============================================================= */
/* close dialog button */
buf = create_themeicon(current_theme->Small_CANCEL_Icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"),
adj_font(12));
adj_font(12));
buf->action = exit_city_dlg_callback;
buf->size.x = area.x + area.w - buf->size.w;
buf->size.y = pwindow->size.y + adj_size(2);
......
/* -------- */
buf = create_themeicon(current_theme->Army_Icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf = create_themeicon(current_theme->army_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf->info_label = create_utf8_from_char(_("Present units"),
adj_font(12));
adj_font(12));
buf->action = army_city_dlg_callback;
buf->size.x = area.x + adj_size(2) + ((adj_size(183) - 5 * buf->size.w) / 6);
buf->size.y = area.y + adj_size(2);
......
add_to_gui_list(ID_CITY_DLG_ARMY_BUTTON, buf);
/* -------- */
buf = create_themeicon(current_theme->Support_Icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf = create_themeicon(current_theme->support_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf->info_label = create_utf8_from_char(_("Supported units"),
adj_font(12));
adj_font(12));
buf->action = supported_unit_city_dlg_callback;
buf->size.x =
area.x + adj_size(2) + 2 * ((adj_size(183) - 5 * buf->size.w) / 6) + buf->size.w;
......
add_to_gui_list(ID_CITY_DLG_SUPPORT_BUTTON, buf);
/* -------- */
buf = create_themeicon(current_theme->Happy_Icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf = create_themeicon(current_theme->happy_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf->info_label = create_utf8_from_char(_("Happiness"), adj_font(12));
buf->action = happy_city_dlg_callback;
buf->size.x =
......
add_to_gui_list(ID_CITY_DLG_HAPPY_BUTTON, buf);
/* -------- */
buf = create_themeicon(current_theme->INFO_Icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf = create_themeicon(current_theme->info_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf->info_label = create_utf8_from_char(_("City info"), adj_font(12));
buf->action = info_city_dlg_callback;
buf->size.x =
......
add_to_gui_list(ID_CITY_DLG_RESOURCE_MAP, buf);
/* -------- */
buf = create_themeicon(current_theme->Options_Icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf = create_themeicon(current_theme->options_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf->info_label = create_utf8_from_char(_("City options"), adj_font(12));
buf->action = options_city_dlg_callback;
buf->size.x =
......
add_to_gui_list(ID_CITY_DLG_OPTIONS_BUTTON, buf);
/* -------- */
buf = create_themeicon(current_theme->PROD_Icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf = create_themeicon(current_theme->prod_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf->info_label = create_utf8_from_char(_("Change production"),
adj_font(12));
adj_font(12));
buf->action = change_prod_dlg_callback;
buf->size.x = area.x + adj_size(7);
buf->size.y = area.y + area.h - buf->size.h - adj_size(5);
......
add_to_gui_list(ID_CITY_DLG_CHANGE_PROD_BUTTON, buf);
/* -------- */
buf = create_themeicon(current_theme->Buy_PROD_Icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf = create_themeicon(current_theme->buy_prod_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf->info_label = create_utf8_from_char(_("Hurry production"),
adj_font(12));
adj_font(12));
buf->action = buy_prod_city_dlg_callback;
buf->size.x = area.x + adj_size(7) + (buf->size.w + adj_size(2));
buf->size.y = area.y + area.h - buf->size.h - adj_size(5);
......
add_to_gui_list(ID_CITY_DLG_PROD_BUY_BUTTON, buf);
/* -------- */
buf = create_themeicon(current_theme->CMA_Icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf = create_themeicon(current_theme->cma_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf->info_label = create_utf8_from_char(_("Citizen Governor"),
adj_font(12));
adj_font(12));
buf->action = cma_city_dlg_callback;
buf->key = SDLK_a;
buf->size.x = area.x + adj_size(7) + (buf->size.w + adj_size(2)) * 2;
......
/* -------- */
buf = create_themeicon(current_theme->L_ARROW_Icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf = create_themeicon(current_theme->l_arrow_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf->info_label = create_utf8_from_char(_("Previous city"),
adj_font(12));
adj_font(12));
buf->action = next_prev_city_dlg_callback;
buf->size.x = area.x + adj_size(220) - buf->size.w - adj_size(8);
buf->size.y = area.y + area.h - buf->size.h;
......
add_to_gui_list(ID_CITY_DLG_PREV_BUTTON, buf);
/* -------- */
buf = create_themeicon(current_theme->R_ARROW_Icon, pwindow->dst,
buf = create_themeicon(current_theme->r_arrow_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf->info_label = create_utf8_from_char(_("Next city"), adj_font(12));
buf->action = next_prev_city_dlg_callback;
client/gui-sdl2/cityrep.c
struct widget *pbuf = NULL;
struct widget *pwindow, *last;
utf8_str *pstr;
SDL_Surface *text1, *text2, *text3, *units_icon, *pCMA_Icon, *text4;
SDL_Surface *text1, *text2, *text3, *units_icon, *cma_icon, *text4;
SDL_Surface *logo;
int togrow, w = 0 , count, ww = 0, hh = 0, name_w = 0, prod_w = 0, H;
char cbuf[128];
......
prod_w = text4->w;
FREEUTF8STR(pstr);
units_icon = create_icon_from_theme(current_theme->UNITS_Icon, 0);
pCMA_Icon = create_icon_from_theme(current_theme->CMA_Icon, 0);
units_icon = create_icon_from_theme(current_theme->units_icon, 0);
cma_icon = create_icon_from_theme(current_theme->cma_icon, 0);
/* --------------- */
pstr = create_utf8_from_char(_("Cities Report"), adj_font(12));
......
/* ------------------------- */
/* exit button */
pbuf = create_themeicon(current_theme->Small_CANCEL_Icon, pwindow->dst,
pbuf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
pbuf->info_label = create_utf8_from_char(_("Close Dialog"), adj_font(12));
pbuf->action = exit_city_report_callback;
......
/* FIXME: not implemented yet */
#if 0
/* ------------------------- */
pbuf = create_themeicon(current_theme->INFO_Icon, pwindow->dst,
pbuf = create_themeicon(current_theme->info_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
pbuf->info_label = create_str16_from_char(_("Information Report"),
adj_font(12));
......
*/
add_to_gui_list(ID_BUTTON, pbuf);
/* -------- */
pbuf = create_themeicon(current_theme->Happy_Icon, pwindow->dst,
pbuf = create_themeicon(current_theme->happy_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
pbuf->info_label = create_str16_from_char(_("Happiness Report"), adj_font(12));
/*
......
*/
add_to_gui_list(ID_BUTTON, pbuf);
/* -------- */
pbuf = create_themeicon(current_theme->Army_Icon, pwindow->dst,
pbuf = create_themeicon(current_theme->army_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
pbuf->info_label = create_str16_from_char(_("Garrison Report"),
......
*/
add_to_gui_list(ID_BUTTON, pbuf);
/* -------- */
pbuf = create_themeicon(current_theme->Support_Icon, pwindow->dst,
pbuf = create_themeicon(current_theme->support_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
pbuf->info_label = create_str16_from_char(_("Maintenance Report"),
adj_font(12));
......
H = hh;
city_rep->begin_widget_list = pbuf;
/* setup window width */
area.w = name_w + adj_size(6) + text1->w + adj_size(8) + pCMA_Icon->w
area.w = name_w + adj_size(6) + text1->w + adj_size(8) + cma_icon->w
+ (icons->pBIG_Food->w + adj_size(6)) * 10 + text2->w + adj_size(6)
+ units_icon->w + adj_size(6) + prod_w + adj_size(170);
......
/* cma icon */
dst.x += (ww + adj_size(9));
dst.y = area.y + 1 + (text2->h - pCMA_Icon->h) / 2;
alphablit(pCMA_Icon, NULL, pwindow->theme, &dst, 255);
ww = pCMA_Icon->w;
FREESURFACE(pCMA_Icon);
dst.y = area.y + 1 + (text2->h - cma_icon->h) / 2;
alphablit(cma_icon, NULL, pwindow->theme, &dst, 255);
ww = cma_icon->w;
FREESURFACE(cma_icon);
/* -------------- */
/* populations food unkeep background and label */
client/gui-sdl2/cma_fe.c
add_to_gui_list(ID_EDIT, buf);
/* ============================================================= */
buf = create_themeicon_button_from_chars(current_theme->OK_Icon, pwindow->dst,
_("Yes"), adj_font(12), 0);
buf = create_themeicon_button_from_chars(current_theme->ok_icon, pwindow->dst,
_("Yes"), adj_font(12), 0);
buf->action = ok_save_cma_callback;
set_wstate(buf, FC_WS_NORMAL);
......
add_to_gui_list(ID_BUTTON, buf);
buf->data.ptr = (void *)buf->next;
buf = create_themeicon_button_from_chars(current_theme->CANCEL_Icon,
pwindow->dst, _("No"),
adj_font(12), 0);
buf = create_themeicon_button_from_chars(current_theme->cancel_icon,
pwindow->dst, _("No"),
adj_font(12), 0);
buf->action = cancel_SLD_cma_callback;
set_wstate(buf, FC_WS_NORMAL);
buf->key = SDLK_ESCAPE;
......
/* ---------- */
/* create exit button */
buf = create_themeicon(current_theme->Small_CANCEL_Icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"),
adj_font(12));
adj_font(12));
buf->action = cancel_SLD_cma_callback;
set_wstate(buf, FC_WS_NORMAL);
buf->key = SDLK_ESCAPE;
......
/* ---------- */
/* create exit button */
buf = create_themeicon(current_theme->Small_CANCEL_Icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"),
adj_font(12));
adj_font(12));
buf->action = exit_cma_dialog_callback;
set_wstate(buf, FC_WS_NORMAL);
buf->key = SDLK_ESCAPE;
......
/* minimal label */
buf = create_iconlabel(NULL, pwindow->dst,
create_utf8_from_char("999", adj_font(10)),
(WF_FREE_STRING | WF_RESTORE_BACKGROUND));
create_utf8_from_char("999", adj_font(10)),
(WF_FREE_STRING | WF_RESTORE_BACKGROUND));
add_to_gui_list(ID_LABEL, buf);
/* minimal scrollbar */
buf = create_horizontal(current_theme->Horiz, pwindow->dst, adj_size(30),
(WF_RESTORE_BACKGROUND));
buf = create_horizontal(current_theme->horiz, pwindow->dst, adj_size(30),
(WF_RESTORE_BACKGROUND));
buf->action = min_horiz_cma_callback;
buf->data.ptr = &pCma->edited_cm_parm.minimal_surplus[i];
......
/* factor label */
buf = create_iconlabel(NULL, pwindow->dst,
create_utf8_from_char("999", adj_font(10)),
(WF_FREE_STRING | WF_RESTORE_BACKGROUND));
create_utf8_from_char("999", adj_font(10)),
(WF_FREE_STRING | WF_RESTORE_BACKGROUND));
add_to_gui_list(ID_LABEL, buf);
/* factor scrollbar */
buf = create_horizontal(current_theme->Horiz, pwindow->dst, adj_size(30),
(WF_RESTORE_BACKGROUND));
buf = create_horizontal(current_theme->horiz, pwindow->dst, adj_size(30),
(WF_RESTORE_BACKGROUND));
buf->action = factor_horiz_cma_callback;
buf->data.ptr = &pCma->edited_cm_parm.factor[i];
......
/* happy factor label */
buf = create_iconlabel(NULL, pwindow->dst,
create_utf8_from_char("999", adj_font(10)),
(WF_FREE_STRING | WF_RESTORE_BACKGROUND));
create_utf8_from_char("999", adj_font(10)),
(WF_FREE_STRING | WF_RESTORE_BACKGROUND));
add_to_gui_list(ID_LABEL, buf);
/* happy factor scrollbar */
buf = create_horizontal(current_theme->Horiz, pwindow->dst, adj_size(30),
(WF_RESTORE_BACKGROUND));
buf = create_horizontal(current_theme->horiz, pwindow->dst, adj_size(30),
(WF_RESTORE_BACKGROUND));
buf->action = factor_horiz_cma_callback;
buf->data.ptr = &pCma->edited_cm_parm.happy_factor;
......
/* celebrating */
buf = create_checkbox(pwindow->dst,
pCma->edited_cm_parm.require_happy, WF_RESTORE_BACKGROUND);
pCma->edited_cm_parm.require_happy, WF_RESTORE_BACKGROUND);
set_wstate(buf, FC_WS_NORMAL);
buf->action = toggle_cma_celebrating_callback;
add_to_gui_list(ID_CHECKBOX, buf);
/* save as ... */
buf = create_themeicon(current_theme->SAVE_Icon, pwindow->dst,
WF_RESTORE_BACKGROUND |WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->save_icon, pwindow->dst,
WF_RESTORE_BACKGROUND |WF_WIDGET_HAS_INFO_LABEL);
buf->action = save_cma_callback;
buf->info_label = create_utf8_from_char(_("Save settings as..."),
adj_font(10));
adj_font(10));
add_to_gui_list(ID_ICON, buf);
/* load settings */
buf = create_themeicon(current_theme->LOAD_Icon, pwindow->dst,
WF_RESTORE_BACKGROUND | WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->load_icon, pwindow->dst,
WF_RESTORE_BACKGROUND | WF_WIDGET_HAS_INFO_LABEL);
buf->action = load_cma_callback;
buf->info_label = create_utf8_from_char(_("Load settings"),
adj_font(10));
adj_font(10));
add_to_gui_list(ID_ICON, buf);
/* del settings */
buf = create_themeicon(current_theme->DELETE_Icon, pwindow->dst,
WF_RESTORE_BACKGROUND | WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->delete_icon, pwindow->dst,
WF_RESTORE_BACKGROUND | WF_WIDGET_HAS_INFO_LABEL);
buf->action = del_cma_callback;
buf->info_label = create_utf8_from_char(_("Delete settings"),
adj_font(10));
adj_font(10));
add_to_gui_list(ID_ICON, buf);
/* run cma */
buf = create_themeicon(current_theme->QPROD_Icon, pwindow->dst,
WF_RESTORE_BACKGROUND | WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->qprod_icon, pwindow->dst,
WF_RESTORE_BACKGROUND | WF_WIDGET_HAS_INFO_LABEL);
buf->action = run_cma_callback;
buf->info_label = create_utf8_from_char(_("Control city"), adj_font(10));
add_to_gui_list(ID_ICON, buf);
/* run cma onece */
buf = create_themeicon(current_theme->FindCity_Icon, pwindow->dst,
WF_RESTORE_BACKGROUND | WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->find_city_icon, pwindow->dst,
WF_RESTORE_BACKGROUND | WF_WIDGET_HAS_INFO_LABEL);
buf->action = run_cma_once_callback;
buf->info_label = create_utf8_from_char(_("Apply once"), adj_font(10));
add_to_gui_list(ID_ICON, buf);
/* del settings */
buf = create_themeicon(current_theme->Support_Icon, pwindow->dst,
WF_RESTORE_BACKGROUND | WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->support_icon, pwindow->dst,
WF_RESTORE_BACKGROUND | WF_WIDGET_HAS_INFO_LABEL);
buf->action = stop_cma_callback;
buf->info_label = create_utf8_from_char(_("Release city"), adj_font(10));
client/gui-sdl2/connectdlg.c
area = pwindow->area;
/* Cancel button */
pNewWidget = create_themeicon_button_from_chars(current_theme->CANCEL_Icon,
pNewWidget = create_themeicon_button_from_chars(current_theme->cancel_icon,
pwindow->dst, _("Cancel"),
adj_font(14), 0);
pNewWidget->action = exit_meta_server_dlg_callback;
......
area.h += buf->size.h + adj_size(20);
/* Connect button */
buf = create_themeicon_button_from_chars(current_theme->OK_Icon, pwindow->dst,
_("Connect"), adj_font(14), 0);
buf = create_themeicon_button_from_chars(current_theme->ok_icon, pwindow->dst,
_("Connect"), adj_font(14), 0);
buf->action = connect_callback;
set_wstate(buf, FC_WS_NORMAL);
buf->key = SDLK_RETURN;
add_to_gui_list(ID_CONNECT_BUTTON, buf);
/* Cancel button */
buf = create_themeicon_button_from_chars(current_theme->CANCEL_Icon, pwindow->dst,
_("Cancel"), adj_font(14), 0);
buf = create_themeicon_button_from_chars(current_theme->cancel_icon, pwindow->dst,
_("Cancel"), adj_font(14), 0);
buf->action = cancel_connect_dlg_callback;
set_wstate(buf, FC_WS_NORMAL);
buf->key = SDLK_ESCAPE;
......
area.h += buf->size.h + adj_size(10);
/* Next button */
buf = create_themeicon_button_from_chars(current_theme->OK_Icon, pwindow->dst,
_("Next"), adj_font(14), 0);
buf = create_themeicon_button_from_chars(current_theme->ok_icon, pwindow->dst,
_("Next"), adj_font(14), 0);
buf->action = send_passwd_callback;
set_wstate(buf, FC_WS_NORMAL);
buf->key = SDLK_RETURN;
add_to_gui_list(ID_BUTTON, buf);
/* Cancel button */
buf = create_themeicon_button_from_chars(current_theme->CANCEL_Icon, pwindow->dst,
_("Cancel"), adj_font(14), 0);
buf = create_themeicon_button_from_chars(current_theme->cancel_icon, pwindow->dst,
_("Cancel"), adj_font(14), 0);
buf->action = cancel_passwd_callback;
set_wstate(buf, FC_WS_NORMAL);
buf->key = SDLK_ESCAPE;
......
area.h += buf->size.h + adj_size(10);
/* Next button */
buf = create_themeicon_button_from_chars(current_theme->OK_Icon, pwindow->dst,
_("Next"), adj_font(14), 0);
buf = create_themeicon_button_from_chars(current_theme->ok_icon, pwindow->dst,
_("Next"), adj_font(14), 0);
buf->action = send_passwd_callback;
buf->key = SDLK_RETURN;
add_to_gui_list(ID_BUTTON, buf);
/* Cancel button */
buf = create_themeicon_button_from_chars(current_theme->CANCEL_Icon, pwindow->dst,
_("Cancel"), adj_font(14), 0);
buf = create_themeicon_button_from_chars(current_theme->cancel_icon, pwindow->dst,
_("Cancel"), adj_font(14), 0);
buf->action = cancel_passwd_callback;
set_wstate(buf, FC_WS_NORMAL);
buf->key = SDLK_ESCAPE;
client/gui-sdl2/dialogs.c
add_to_gui_list(ID_WINDOW, pdialog->window);
/* Close button. */
pdialog->close_button = create_themeicon(current_theme->Small_CANCEL_Icon,
pdialog->close_button = create_themeicon(current_theme->small_cancel_icon,
pdialog->window->dst,
WF_WIDGET_HAS_INFO_LABEL
| WF_RESTORE_BACKGROUND);
......
/* ---------- */
/* create exit button */
buf = create_themeicon(current_theme->Small_CANCEL_Icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"),
adj_font(12));
adj_font(12));
buf->action = exit_notify_dialog_callback;
set_wstate(buf, FC_WS_NORMAL);
buf->key = SDLK_ESCAPE;
......
area.h += (text->h + adj_size(10));
/* cancel button */
buf = create_themeicon_button_from_chars(current_theme->CANCEL_Icon,
pwindow->dst, _("Cancel"),
adj_font(12), 0);
buf = create_themeicon_button_from_chars(current_theme->cancel_icon,
pwindow->dst, _("Cancel"),
adj_font(12), 0);
buf->action = cancel_upgrade_unit_callback;
set_wstate(buf, FC_WS_NORMAL);
......
add_to_gui_list(ID_BUTTON, buf);
if (UU_OK == unit_upgrade_result) {
buf = create_themeicon_button_from_chars(current_theme->OK_Icon, pwindow->dst,
_("Upgrade"), adj_font(12), 0);
buf = create_themeicon_button_from_chars(current_theme->ok_icon, pwindow->dst,
_("Upgrade"), adj_font(12), 0);
buf->action = ok_upgrade_unit_window_callback;
set_wstate(buf, FC_WS_NORMAL);
......
area.h += (text->h + adj_size(10));
/* cancel button */
buf = create_themeicon_button_from_chars(current_theme->CANCEL_Icon,
pwindow->dst, _("Cancel"),
adj_font(12), 0);
buf = create_themeicon_button_from_chars(current_theme->cancel_icon,
pwindow->dst, _("Cancel"),
adj_font(12), 0);
buf->action = cancel_disband_unit_callback;
set_wstate(buf, FC_WS_NORMAL);
......
add_to_gui_list(ID_BUTTON, buf);
if (unit_disband_result) {
buf = create_themeicon_button_from_chars(current_theme->OK_Icon, pwindow->dst,
_("Disband"), adj_font(12), 0);
buf = create_themeicon_button_from_chars(current_theme->ok_icon, pwindow->dst,
_("Disband"), adj_font(12), 0);
buf->action = ok_disband_unit_window_callback;
set_wstate(buf, FC_WS_NORMAL);
......
/* ---------- */
/* create exit button */
buf = create_themeicon(current_theme->Small_CANCEL_Icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"),
adj_font(12));
adj_font(12));
buf->action = exit_unit_select_callback;
set_wstate(buf, FC_WS_NORMAL);
buf->key = SDLK_ESCAPE;
......
buf->size.y = area.y;
/* exit icon */
buf = create_themeicon(current_theme->Small_CANCEL_Icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"),
adj_font(12));
adj_font(12));
buf->size.x = area.x + area.w - buf->size.w - 1;
buf->size.y = pwindow->size.y + adj_size(2);
buf->action = exit_terrain_info_dialog_callback;
......
/* ---------- */
/* exit button */
buf = create_themeicon(current_theme->Small_CANCEL_Icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"),
adj_font(12));
adj_font(12));
area.w += buf->size.w + adj_size(10);
buf->action = exit_advanced_terrain_dlg_callback;
set_wstate(buf, FC_WS_NORMAL);
......
/* ---------- */
/* exit button */
buf = create_themeicon(current_theme->Small_CANCEL_Icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"),
adj_font(12));
adj_font(12));
area.w += buf->size.w + adj_size(10);
buf->action = exit_pillage_dlg_callback;
set_wstate(buf, FC_WS_NORMAL);
......
help_dlg->end_widget_list = pwindow;
add_to_gui_list(ID_WINDOW, pwindow);
ok_button = create_themeicon_button_from_chars(current_theme->OK_Icon,
ok_button = create_themeicon_button_from_chars(current_theme->ok_icon,
pwindow->dst, _("OK"), adj_font(14), 0);
ok_button->action = cancel_help_dlg_callback;
set_wstate(ok_button, FC_WS_NORMAL);
......
setup->pset_name = pwidget;
/* create next nationset button */
pwidget = create_themeicon_button(current_theme->R_ARROW_Icon,
pwidget = create_themeicon_button(current_theme->r_arrow_icon,
pwindow->dst, NULL, 0);
pwidget->action = next_set_callback;
if (nation_set_index(setup->set) < nation_set_count() - 1) {
......
setup->pset_next = pwidget;
/* create prev nationset button */
pwidget = create_themeicon_button(current_theme->L_ARROW_Icon,
pwidget = create_themeicon_button(current_theme->l_arrow_icon,
pwindow->dst, NULL, 0);
pwidget->action = prev_set_callback;
if (nation_set_index(setup->set) > 0) {
......
setup->name_edit = pwidget;
/* create next leader name button */
pwidget = create_themeicon_button(current_theme->R_ARROW_Icon,
pwidget = create_themeicon_button(current_theme->r_arrow_icon,
pwindow->dst, NULL, 0);
pwidget->action = next_name_callback;
add_to_gui_list(ID_NATION_WIZARD_NEXT_LEADER_NAME_BUTTON, pwidget);
......
setup->pName_Next = pwidget;
/* create prev leader name button */
pwidget = create_themeicon_button(current_theme->L_ARROW_Icon,
pwidget = create_themeicon_button(current_theme->l_arrow_icon,
pwindow->dst, NULL, 0);
pwidget->action = prev_name_callback;
add_to_gui_list(ID_NATION_WIZARD_PREV_LEADER_NAME_BUTTON, pwidget);
......
/* ---------------------------------------------------------- */
/* create Cancel button */
pwidget = create_themeicon_button_from_chars(current_theme->CANCEL_Icon,
pwidget = create_themeicon_button_from_chars(current_theme->cancel_icon,
pwindow->dst, _("Cancel"),
adj_font(12), 0);
pwidget->action = races_dialog_cancel_callback;
......
/* create OK button */
pwidget =
create_themeicon_button_from_chars(current_theme->OK_Icon, pwindow->dst,
create_themeicon_button_from_chars(current_theme->ok_icon, pwindow->dst,
_("OK"), adj_font(12), 0);
pwidget->action = races_dialog_ok_callback;
client/gui-sdl2/diplodlg.c
pstr->style |= (TTF_STYLE_BOLD|SF_CENTER);
pstr->fgcol = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT);
buf = create_iconlabel(create_icon_from_theme(current_theme->CANCEL_PACT_Icon, 0),
pwindow->dst, pstr,
(WF_ICON_ABOVE_TEXT|WF_FREE_PRIVATE_DATA|WF_FREE_THEME|
WF_RESTORE_BACKGROUND));
buf = create_iconlabel(create_icon_from_theme(current_theme->cancel_pact_icon, 0),
pwindow->dst, pstr,
(WF_ICON_ABOVE_TEXT|WF_FREE_PRIVATE_DATA|WF_FREE_THEME|
WF_RESTORE_BACKGROUND));
buf->private_data.cbox = fc_calloc(1, sizeof(struct checkbox));
buf->private_data.cbox->state = FALSE;
buf->private_data.cbox->pTRUE_Theme = current_theme->OK_PACT_Icon;
buf->private_data.cbox->pFALSE_Theme = current_theme->CANCEL_PACT_Icon;
buf->private_data.cbox->pTRUE_Theme = current_theme->ok_pact_icon;
buf->private_data.cbox->pFALSE_Theme = current_theme->cancel_pact_icon;
add_to_gui_list(ID_ICON, buf);
......
pstr->style |= (TTF_STYLE_BOLD|SF_CENTER);
pstr->fgcol = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT);
buf = create_iconlabel(create_icon_from_theme(current_theme->CANCEL_PACT_Icon, 0),
pwindow->dst, pstr,
(WF_ICON_ABOVE_TEXT|WF_FREE_PRIVATE_DATA|WF_FREE_THEME|
WF_RESTORE_BACKGROUND));
buf = create_iconlabel(create_icon_from_theme(current_theme->cancel_pact_icon, 0),
pwindow->dst, pstr,
(WF_ICON_ABOVE_TEXT|WF_FREE_PRIVATE_DATA|WF_FREE_THEME|
WF_RESTORE_BACKGROUND));
buf->private_data.cbox = fc_calloc(1, sizeof(struct checkbox));
buf->private_data.cbox->state = FALSE;
buf->private_data.cbox->pTRUE_Theme = current_theme->OK_PACT_Icon;
buf->private_data.cbox->pFALSE_Theme = current_theme->CANCEL_PACT_Icon;
buf->private_data.cbox->pTRUE_Theme = current_theme->ok_pact_icon;
buf->private_data.cbox->pFALSE_Theme = current_theme->cancel_pact_icon;
add_to_gui_list(ID_ICON, buf);
/* ============================================================= */
buf = create_themeicon(current_theme->CANCEL_PACT_Icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL
| WF_RESTORE_BACKGROUND);
buf = create_themeicon(current_theme->cancel_pact_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL
| WF_RESTORE_BACKGROUND);
buf->info_label = create_utf8_from_char(_("Cancel meeting"),
adj_font(12));
buf->action = cancel_meeting_callback;
......
add_to_gui_list(ID_ICON, buf);
buf = create_themeicon(current_theme->OK_PACT_Icon, pwindow->dst,
WF_FREE_DATA | WF_WIDGET_HAS_INFO_LABEL
|WF_RESTORE_BACKGROUND);
buf = create_themeicon(current_theme->ok_pact_icon, pwindow->dst,
WF_FREE_DATA | WF_WIDGET_HAS_INFO_LABEL
|WF_RESTORE_BACKGROUND);
buf->info_label = create_utf8_from_char(_("Accept treaty"),
adj_font(12));
adj_font(12));
buf->action = accept_treaty_callback;
buf->data.cont = cont;
set_wstate(buf, FC_WS_NORMAL);
......
area.w = MAX(area.w, text->w);
area.h += text->h + adj_size(10);
buf = create_themeicon_button_from_chars(current_theme->CANCEL_Icon,
pwindow->dst, _("No"),
adj_font(12), 0);
buf = create_themeicon_button_from_chars(current_theme->cancel_icon,
pwindow->dst, _("No"),
adj_font(12), 0);
buf->action = cancel_sdip_dlg_callback;
set_wstate(buf, FC_WS_NORMAL);
......
add_to_gui_list(ID_BUTTON, buf);
buf = create_themeicon_button_from_chars(current_theme->OK_Icon, pwindow->dst,
_("Yes"), adj_font(12), 0);
buf = create_themeicon_button_from_chars(current_theme->ok_icon, pwindow->dst,
_("Yes"), adj_font(12), 0);
buf->action = cancel_pact_dlg_callback;
set_wstate(buf, FC_WS_NORMAL);
......
}
/* cancel treaty */
buf = create_themeicon_button_from_chars(current_theme->UNITS2_Icon,
pwindow->dst, cbuf,
adj_font(12), 0);
buf = create_themeicon_button_from_chars(current_theme->units2_icon,
pwindow->dst, cbuf,
adj_font(12), 0);
buf->action = cancel_pact_dlg_callback;
set_wstate(buf, FC_WS_NORMAL);
......
if (shared) {
/* shared vision */
buf = create_themeicon_button_from_chars(current_theme->UNITS2_Icon,
pwindow->dst, _("Withdraw vision"),
adj_font(12), 0);
buf = create_themeicon_button_from_chars(current_theme->units2_icon,
pwindow->dst, _("Withdraw vision"),
adj_font(12), 0);
buf->action = withdraw_vision_dlg_callback;
set_wstate(buf, FC_WS_NORMAL);
......
}
/* meet */
buf = create_themeicon_button_from_chars(current_theme->PLAYERS_Icon,
pwindow->dst,
_("Call Diplomatic Meeting"),
adj_font(12), 0);
buf = create_themeicon_button_from_chars(current_theme->players_icon,
pwindow->dst,
_("Call Diplomatic Meeting"),
adj_font(12), 0);
buf->action = call_meeting_dlg_callback;
set_wstate(buf, FC_WS_NORMAL);
......
button_h = MAX(button_h , buf->size.h);
buttons++;
buf = create_themeicon_button_from_chars(current_theme->CANCEL_Icon,
pwindow->dst, _("Send him back"),
adj_font(12), 0);
buf = create_themeicon_button_from_chars(current_theme->cancel_icon,
pwindow->dst, _("Send him back"),
adj_font(12), 0);
buf->action = cancel_sdip_dlg_callback;
set_wstate(buf, FC_WS_NORMAL);
client/gui-sdl2/finddlg.c
/* ---------- */
/* exit button */
buf = create_themeicon(current_theme->Small_CANCEL_Icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND
| WF_FREE_DATA);
buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND
| WF_FREE_DATA);
buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"),
adj_font(12));
adj_font(12));
area.w = MAX(area.w, buf->size.w + adj_size(10));
buf->action = exit_find_city_dlg_callback;
set_wstate(buf, FC_WS_NORMAL);
client/gui-sdl2/gotodlg.c
/* ---------- */
/* create exit button */
buf = create_themeicon(current_theme->Small_CANCEL_Icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"),
adj_font(12));
adj_font(12));
buf->action = exit_goto_dialog_callback;
set_wstate(buf, FC_WS_NORMAL);
buf->key = SDLK_ESCAPE;
......
/* background */
col = (col + 15) / 16; /* number of flag columns */
pFlag = ResizeSurface(current_theme->Block,
pFlag = ResizeSurface(current_theme->block,
(col * buf->size.w + (col - 1) * adj_size(5) + adj_size(10)),
area.h, 1);
client/gui-sdl2/gui_tilespec.c
#include "gui_tilespec.h"
struct Theme *current_theme = NULL;
struct theme_icons *current_theme = NULL;
struct city_icon *icons;
static SDL_Surface *city_surf;
......
static SDL_Surface *pNone_Tech_Icon;
static SDL_Surface *pFuture_Tech_Icon;
#define load_GUI_surface(pSpr, pStruct, surf, tag) \
#define load_GUI_surface(_spr_, _struct_, _surf_, _tag_) \
do { \
pSpr = theme_lookup_sprite_tag_alt(theme, LOG_FATAL, tag, "", "", ""); \
fc_assert_action(pSpr != NULL, break); \
pStruct->surf = GET_SURF_REAL(pSpr); \
_spr_ = theme_lookup_sprite_tag_alt(theme, LOG_FATAL, _tag_, "", "", ""); \
fc_assert_action(_spr_ != NULL, break); \
_struct_->_surf_ = GET_SURF_REAL(_spr_); \
} while (FALSE)
#define load_theme_surface(pSpr, surf, tag) \
load_GUI_surface(pSpr, current_theme, surf, tag)
#define load_theme_surface(spr, surf, tag) \
load_GUI_surface(spr, current_theme, surf, tag)
#define load_city_icon_surface(pSpr, surf, tag) \
load_GUI_surface(pSpr, icons, surf, tag)
#define load_city_icon_surface(spr, surf, tag) \
load_GUI_surface(spr, icons, surf, tag)
#define load_order_theme_surface(pSpr, surf, tag) \
load_GUI_surface(pSpr, current_theme, surf, tag);
#define load_order_theme_surface(spr, surf, tag) \
load_GUI_surface(spr, current_theme, surf, tag);
/***************************************************************************//**
Reload small citizens "style" icons.
......
{
struct sprite *buf = NULL;
current_theme = fc_calloc(1, sizeof(struct Theme));
current_theme = fc_calloc(1, sizeof(struct theme_icons));
load_theme_surface(buf, FR_Left, "theme.left_frame");
load_theme_surface(buf, FR_Right, "theme.right_frame");
load_theme_surface(buf, FR_Top, "theme.top_frame");
load_theme_surface(buf, FR_Bottom, "theme.bottom_frame");
load_theme_surface(buf, fr_left, "theme.left_frame");
load_theme_surface(buf, fr_right, "theme.right_frame");
load_theme_surface(buf, fr_top, "theme.top_frame");
load_theme_surface(buf, fr_bottom, "theme.bottom_frame");
load_theme_surface(buf, button, "theme.button");
load_theme_surface(buf, Edit, "theme.edit");
load_theme_surface(buf, CBOX_Sell_Icon, "theme.sbox");
load_theme_surface(buf, CBOX_Unsell_Icon, "theme.ubox");
load_theme_surface(buf, UP_Icon, "theme.UP_scroll");
load_theme_surface(buf, DOWN_Icon, "theme.DOWN_scroll");
load_theme_surface(buf, edit, "theme.edit");
load_theme_surface(buf, cbox_sell_icon, "theme.sbox");
load_theme_surface(buf, cbox_unsell_icon, "theme.ubox");
load_theme_surface(buf, up_icon, "theme.UP_scroll");
load_theme_surface(buf, down_icon, "theme.DOWN_scroll");
#if 0
load_theme_surface(buf, LEFT_Icon, "theme.LEFT_scroll");
load_theme_surface(buf, RIGHT_Icon, "theme.RIGHT_scroll");
load_theme_surface(buf, left_icon, "theme.LEFT_scroll");
load_theme_surface(buf, right_icon, "theme.RIGHT_scroll");
#endif
load_theme_surface(buf, Vertic, "theme.vertic_scrollbar");
load_theme_surface(buf, Horiz, "theme.horiz_scrollbar");
load_theme_surface(buf, vertic, "theme.vertic_scrollbar");
load_theme_surface(buf, horiz, "theme.horiz_scrollbar");
/* ------------------- */
load_theme_surface(buf, OK_PACT_Icon, "theme.pact_ok");
load_theme_surface(buf, CANCEL_PACT_Icon, "theme.pact_cancel");
load_theme_surface(buf, ok_pact_icon, "theme.pact_ok");
load_theme_surface(buf, cancel_pact_icon, "theme.pact_cancel");
/* ------------------- */
load_theme_surface(buf, Small_OK_Icon, "theme.SMALL_OK_button");
load_theme_surface(buf, Small_CANCEL_Icon, "theme.SMALL_FAIL_button");
load_theme_surface(buf, small_ok_icon, "theme.SMALL_OK_button");
load_theme_surface(buf, small_cancel_icon, "theme.SMALL_FAIL_button");
/* ------------------- */
load_theme_surface(buf, OK_Icon, "theme.OK_button");
load_theme_surface(buf, CANCEL_Icon, "theme.FAIL_button");
load_theme_surface(buf, ok_icon, "theme.OK_button");
load_theme_surface(buf, cancel_icon, "theme.FAIL_button");
load_theme_surface(buf, FORWARD_Icon, "theme.NEXT_button");
load_theme_surface(buf, BACK_Icon, "theme.BACK_button");
load_theme_surface(buf, L_ARROW_Icon, "theme.LEFT_ARROW_button");
load_theme_surface(buf, R_ARROW_Icon, "theme.RIGHT_ARROW_button");
load_theme_surface(buf, MAP_Icon, "theme.MAP_button");
load_theme_surface(buf, FindCity_Icon, "theme.FIND_CITY_button");
load_theme_surface(buf, NEW_TURN_Icon, "theme.NEW_TURN_button");
load_theme_surface(buf, LOG_Icon, "theme.LOG_button");
load_theme_surface(buf, UNITS_Icon, "theme.UNITS_INFO_button");
load_theme_surface(buf, Options_Icon, "theme.OPTIONS_button");
load_theme_surface(buf, Block, "theme.block");
load_theme_surface(buf, INFO_Icon, "theme.INFO_button");
load_theme_surface(buf, Army_Icon, "theme.ARMY_button");
load_theme_surface(buf, Happy_Icon, "theme.HAPPY_button");
load_theme_surface(buf, Support_Icon, "theme.HOME_button");
load_theme_surface(buf, Buy_PROD_Icon, "theme.BUY_button");
load_theme_surface(buf, PROD_Icon, "theme.PROD_button");
load_theme_surface(buf, QPROD_Icon, "theme.WORK_LIST_button");
load_theme_surface(buf, CMA_Icon, "theme.CMA_button");
load_theme_surface(buf, LOCK_Icon, "theme.LOCK_button");
load_theme_surface(buf, UNLOCK_Icon, "theme.UNLOCK_button");
load_theme_surface(buf, PLAYERS_Icon, "theme.PLAYERS_button");
load_theme_surface(buf, UNITS2_Icon, "theme.UNITS_button");
load_theme_surface(buf, SAVE_Icon, "theme.SAVE_button");
load_theme_surface(buf, LOAD_Icon, "theme.LOAD_button");
load_theme_surface(buf, DELETE_Icon, "theme.DELETE_button");
load_theme_surface(buf, BORDERS_Icon, "theme.BORDERS_button");
load_theme_surface(buf, back_icon, "theme.BACK_button");
load_theme_surface(buf, l_arrow_icon, "theme.LEFT_ARROW_button");
load_theme_surface(buf, r_arrow_icon, "theme.RIGHT_ARROW_button");
load_theme_surface(buf, map_icon, "theme.MAP_button");
load_theme_surface(buf, find_city_icon, "theme.FIND_CITY_button");
load_theme_surface(buf, new_turn_icon, "theme.NEW_TURN_button");
load_theme_surface(buf, log_icon, "theme.LOG_button");
load_theme_surface(buf, units_icon, "theme.UNITS_INFO_button");
load_theme_surface(buf, options_icon, "theme.OPTIONS_button");
load_theme_surface(buf, block, "theme.block");
load_theme_surface(buf, info_icon, "theme.INFO_button");
load_theme_surface(buf, army_icon, "theme.ARMY_button");
load_theme_surface(buf, happy_icon, "theme.HAPPY_button");
load_theme_surface(buf, support_icon, "theme.HOME_button");
load_theme_surface(buf, buy_prod_icon, "theme.BUY_button");
load_theme_surface(buf, prod_icon, "theme.PROD_button");
load_theme_surface(buf, qprod_icon, "theme.WORK_LIST_button");
load_theme_surface(buf, cma_icon, "theme.CMA_button");
load_theme_surface(buf, lock_icon, "theme.LOCK_button");
load_theme_surface(buf, unlock_icon, "theme.UNLOCK_button");
load_theme_surface(buf, players_icon, "theme.PLAYERS_button");
load_theme_surface(buf, units2_icon, "theme.UNITS_button");
load_theme_surface(buf, save_icon, "theme.SAVE_button");
load_theme_surface(buf, load_icon, "theme.LOAD_button");
load_theme_surface(buf, delete_icon, "theme.DELETE_button");
load_theme_surface(buf, borders_icon, "theme.BORDERS_button");
/* ------------------------------ */
load_theme_surface(buf, Tech_Tree_Icon, "theme.tech_tree");
load_theme_surface(buf, tech_tree_icon, "theme.tech_tree");
/* ------------------------------ */
load_order_theme_surface(buf, Order_Icon, "theme.order_empty");
load_order_theme_surface(buf, order_icon, "theme.order_empty");
load_order_theme_surface(buf, OAutoAtt_Icon, "theme.order_auto_attack");
load_order_theme_surface(buf, OAutoConnect_Icon, "theme.order_auto_connect");
load_order_theme_surface(buf, OAutoExp_Icon, "theme.order_auto_explorer");
load_order_theme_surface(buf, OAutoSett_Icon, "theme.order_auto_settler");
load_order_theme_surface(buf, OBuildCity_Icon, "theme.order_build_city");
load_order_theme_surface(buf, o_autoconnect_icon, "theme.order_auto_connect");
load_order_theme_surface(buf, o_autoexp_icon, "theme.order_auto_explorer");
load_order_theme_surface(buf, o_autosett_icon, "theme.order_auto_settler");
load_order_theme_surface(buf, o_build_city_icon, "theme.order_build_city");
load_order_theme_surface(buf, OCutDownForest_Icon, "theme.order_cutdown_forest");
load_order_theme_surface(buf, OPlantForest_Icon, "theme.order_plant_forest");
load_order_theme_surface(buf, OMine_Icon, "theme.order_build_mining");
load_order_theme_surface(buf, OIrrigation_Icon, "theme.order_irrigation");
load_order_theme_surface(buf, OCultivate_Icon, "theme.order_cutdown_forest");
load_order_theme_surface(buf, OPlant_Icon, "theme.order_plant_forest");
load_order_theme_surface(buf, ODone_Icon, "theme.order_done");
load_order_theme_surface(buf, ODisband_Icon, "theme.order_disband");
load_order_theme_surface(buf, OFortify_Icon, "theme.order_fortify");
load_order_theme_surface(buf, OGoto_Icon, "theme.order_goto");
load_order_theme_surface(buf, OGotoCity_Icon, "theme.order_goto_city");
load_order_theme_surface(buf, OHomeCity_Icon, "theme.order_home");
load_order_theme_surface(buf, ONuke_Icon, "theme.order_nuke");
load_order_theme_surface(buf, OParaDrop_Icon, "theme.order_paradrop");
load_order_theme_surface(buf, OPatrol_Icon, "theme.order_patrol");
load_order_theme_surface(buf, OPillage_Icon, "theme.order_pillage");
load_order_theme_surface(buf, ORailRoad_Icon, "theme.order_build_railroad");
load_order_theme_surface(buf, ORoad_Icon, "theme.order_build_road");
load_order_theme_surface(buf, OSentry_Icon, "theme.order_sentry");
load_order_theme_surface(buf, OUnload_Icon, "theme.order_unload");
load_order_theme_surface(buf, OWait_Icon, "theme.order_wait");
load_order_theme_surface(buf, OFortress_Icon, "theme.order_build_fortress");
load_order_theme_surface(buf, OFallout_Icon, "theme.order_clean_fallout");
load_order_theme_surface(buf, OPollution_Icon, "theme.order_clean_pollution");
load_order_theme_surface(buf, OAirBase_Icon, "theme.order_build_airbase");
load_order_theme_surface(buf, OTransform_Icon, "theme.order_transform");
load_order_theme_surface(buf, o_mine_icon, "theme.order_build_mining");
load_order_theme_surface(buf, o_irrigation_icon, "theme.order_irrigation");
load_order_theme_surface(buf, o_cultivate_icon, "theme.order_cutdown_forest");
load_order_theme_surface(buf, o_plant_icon, "theme.order_plant_forest");
load_order_theme_surface(buf, o_done_icon, "theme.order_done");
load_order_theme_surface(buf, o_disband_icon, "theme.order_disband");
load_order_theme_surface(buf, o_fortify_icon, "theme.order_fortify");
load_order_theme_surface(buf, o_goto_icon, "theme.order_goto");
load_order_theme_surface(buf, o_goto_city_icon, "theme.order_goto_city");
load_order_theme_surface(buf, o_homecity_icon, "theme.order_home");
load_order_theme_surface(buf, o_nuke_icon, "theme.order_nuke");
load_order_theme_surface(buf, o_paradrop_icon, "theme.order_paradrop");
load_order_theme_surface(buf, o_patrol_icon, "theme.order_patrol");
load_order_theme_surface(buf, o_pillage_icon, "theme.order_pillage");
load_order_theme_surface(buf, o_railroad_icon, "theme.order_build_railroad");
load_order_theme_surface(buf, o_road_icon, "theme.order_build_road");
load_order_theme_surface(buf, o_sentry_icon, "theme.order_sentry");
load_order_theme_surface(buf, o_unload_icon, "theme.order_unload");
load_order_theme_surface(buf, o_wait_icon, "theme.order_wait");
load_order_theme_surface(buf, o_fortress_icon, "theme.order_build_fortress");
load_order_theme_surface(buf, o_fallout_icon, "theme.order_clean_fallout");
load_order_theme_surface(buf, o_pollution_icon, "theme.order_clean_pollution");
load_order_theme_surface(buf, o_airbase_icon, "theme.order_build_airbase");
load_order_theme_surface(buf, o_transform_icon, "theme.order_transform");
load_order_theme_surface(buf, OAddCity_Icon, "theme.order_add_to_city");
load_order_theme_surface(buf, OWonder_Icon, "theme.order_carravan_wonder");
load_order_theme_surface(buf, OTrade_Icon, "theme.order_carravan_trade_route");
load_order_theme_surface(buf, OSpy_Icon, "theme.order_spying");
load_order_theme_surface(buf, OWakeUp_Icon, "theme.order_wakeup");
load_order_theme_surface(buf, OReturn_Icon, "theme.order_return");
load_order_theme_surface(buf, o_wonder_icon, "theme.order_carravan_wonder");
load_order_theme_surface(buf, o_trade_icon, "theme.order_carravan_trade_route");
load_order_theme_surface(buf, o_spy_icon, "theme.order_spying");
load_order_theme_surface(buf, o_wakeup_icon, "theme.order_wakeup");
load_order_theme_surface(buf, o_return_icon, "theme.order_return");
load_order_theme_surface(buf, OAirLift_Icon, "theme.order_airlift");
load_order_theme_surface(buf, OLoad_Icon, "theme.order_load");
load_order_theme_surface(buf, o_load_icon, "theme.order_load");
}
/***************************************************************************//**
client/gui-sdl2/gui_tilespec.h
#include "graphics.h"
#include "sprite.h"
struct Theme {
struct theme_icons {
/* Frame */
SDL_Surface *FR_Left;
SDL_Surface *FR_Right;
SDL_Surface *FR_Top;
SDL_Surface *FR_Bottom;
SDL_Surface *fr_left;
SDL_Surface *fr_right;
SDL_Surface *fr_top;
SDL_Surface *fr_bottom;
/* Button */
SDL_Surface *button;
/* Edit */
SDL_Surface *Edit;
SDL_Surface *edit;
/* Checkbox */
SDL_Surface *CBOX_Sell_Icon;
SDL_Surface *CBOX_Unsell_Icon;
SDL_Surface *cbox_sell_icon;
SDL_Surface *cbox_unsell_icon;
/* Scrollbar */
SDL_Surface *UP_Icon;
SDL_Surface *DOWN_Icon;
SDL_Surface *LEFT_Icon;
SDL_Surface *RIGHT_Icon;
SDL_Surface *Vertic;
SDL_Surface *Horiz;
SDL_Surface *up_icon;
SDL_Surface *down_icon;
SDL_Surface *left_icon;
SDL_Surface *right_icon;
SDL_Surface *vertic;
SDL_Surface *horiz;
/* Game */
SDL_Surface *OK_Icon;
SDL_Surface *CANCEL_Icon;
SDL_Surface *Small_OK_Icon;
SDL_Surface *Small_CANCEL_Icon;
SDL_Surface *ok_icon;
SDL_Surface *cancel_icon;
SDL_Surface *small_ok_icon;
SDL_Surface *small_cancel_icon;
SDL_Surface *FORWARD_Icon;
SDL_Surface *BACK_Icon;
SDL_Surface *INFO_Icon;
SDL_Surface *R_ARROW_Icon;
SDL_Surface *L_ARROW_Icon;
SDL_Surface *LOCK_Icon;
SDL_Surface *UNLOCK_Icon;
SDL_Surface *Options_Icon;
SDL_Surface *Block;
SDL_Surface *UNITS_Icon;
SDL_Surface *MAP_Icon;
SDL_Surface *LOG_Icon;
SDL_Surface *PLAYERS_Icon;
SDL_Surface *UNITS2_Icon;
SDL_Surface *FindCity_Icon;
SDL_Surface *NEW_TURN_Icon;
SDL_Surface *SAVE_Icon;
SDL_Surface *LOAD_Icon;
SDL_Surface *DELETE_Icon;
SDL_Surface *BORDERS_Icon;
SDL_Surface *back_icon;
SDL_Surface *info_icon;
SDL_Surface *r_arrow_icon;
SDL_Surface *l_arrow_icon;
SDL_Surface *lock_icon;
SDL_Surface *unlock_icon;
SDL_Surface *options_icon;
SDL_Surface *block;
SDL_Surface *units_icon;
SDL_Surface *map_icon;
SDL_Surface *log_icon;
SDL_Surface *players_icon;
SDL_Surface *units2_icon;
SDL_Surface *find_city_icon;
SDL_Surface *new_turn_icon;
SDL_Surface *save_icon;
SDL_Surface *load_icon;
SDL_Surface *delete_icon;
SDL_Surface *borders_icon;
/* help icons */
SDL_Surface *Tech_Tree_Icon;
SDL_Surface *tech_tree_icon;
/* city icons */
SDL_Surface *Army_Icon;
SDL_Surface *Support_Icon;
SDL_Surface *Happy_Icon;
SDL_Surface *CMA_Icon;
SDL_Surface *PROD_Icon;
SDL_Surface *QPROD_Icon;
SDL_Surface *Buy_PROD_Icon;
SDL_Surface *army_icon;
SDL_Surface *support_icon;
SDL_Surface *happy_icon;
SDL_Surface *cma_icon;
SDL_Surface *prod_icon;
SDL_Surface *qprod_icon;
SDL_Surface *buy_prod_icon;
/* diplomacy */
SDL_Surface *OK_PACT_Icon;
SDL_Surface *CANCEL_PACT_Icon;
SDL_Surface *ok_pact_icon;
SDL_Surface *cancel_pact_icon;
/* orders icons */
SDL_Surface *Order_Icon;
SDL_Surface *ODisband_Icon;
SDL_Surface *OWait_Icon;
SDL_Surface *ODone_Icon;
SDL_Surface *order_icon;
SDL_Surface *o_disband_icon;
SDL_Surface *o_wait_icon;
SDL_Surface *o_done_icon;
SDL_Surface *OAutoAtt_Icon; /* currently unused */
SDL_Surface *OAutoExp_Icon;
SDL_Surface *OAutoSett_Icon;
SDL_Surface *OAutoConnect_Icon;
SDL_Surface *OUnload_Icon;
SDL_Surface *OBuildCity_Icon;
SDL_Surface *OGotoCity_Icon;
SDL_Surface *OGoto_Icon;
SDL_Surface *OHomeCity_Icon;
SDL_Surface *OPatrol_Icon;
SDL_Surface *OMine_Icon;
SDL_Surface *o_autoexp_icon;
SDL_Surface *o_autosett_icon;
SDL_Surface *o_autoconnect_icon;
SDL_Surface *o_unload_icon;
SDL_Surface *o_build_city_icon;
SDL_Surface *o_goto_city_icon;
SDL_Surface *o_goto_icon;
SDL_Surface *o_homecity_icon;
SDL_Surface *o_patrol_icon;
SDL_Surface *o_mine_icon;
SDL_Surface *OPlantForest_Icon;
SDL_Surface *OCutDownForest_Icon;
SDL_Surface *OFortify_Icon;
SDL_Surface *OSentry_Icon;
SDL_Surface *OIrrigation_Icon;
SDL_Surface *OCultivate_Icon;
SDL_Surface *OPlant_Icon;
SDL_Surface *ORoad_Icon;
SDL_Surface *ORailRoad_Icon;
SDL_Surface *OPillage_Icon;
SDL_Surface *OParaDrop_Icon;
SDL_Surface *ONuke_Icon;
SDL_Surface *OFortress_Icon;
SDL_Surface *OFallout_Icon;
SDL_Surface *OPollution_Icon;
SDL_Surface *OAirBase_Icon;
SDL_Surface *OTransform_Icon;
SDL_Surface *o_fortify_icon;
SDL_Surface *o_sentry_icon;
SDL_Surface *o_irrigation_icon;
SDL_Surface *o_cultivate_icon;
SDL_Surface *o_plant_icon;
SDL_Surface *o_road_icon;
SDL_Surface *o_railroad_icon;
SDL_Surface *o_pillage_icon;
SDL_Surface *o_paradrop_icon;
SDL_Surface *o_nuke_icon;
SDL_Surface *o_fortress_icon;
SDL_Surface *o_fallout_icon;
SDL_Surface *o_pollution_icon;
SDL_Surface *o_airbase_icon;
SDL_Surface *o_transform_icon;
SDL_Surface *OAddCity_Icon;
SDL_Surface *OWonder_Icon;
SDL_Surface *OTrade_Icon;
SDL_Surface *OSpy_Icon;
SDL_Surface *OWakeUp_Icon;
SDL_Surface *OReturn_Icon;
SDL_Surface *o_wonder_icon;
SDL_Surface *o_trade_icon;
SDL_Surface *o_spy_icon;
SDL_Surface *o_wakeup_icon;
SDL_Surface *o_return_icon;
SDL_Surface *OAirLift_Icon;
SDL_Surface *OLoad_Icon;
SDL_Surface *o_load_icon;
};
struct city_icon {
......
SDL_Surface *specialists[SP_MAX];
};
extern struct Theme *current_theme;
extern struct theme_icons *current_theme;
extern struct city_icon *icons;
void tilespec_setup_theme(void);
client/gui-sdl2/helpdlg.c
/* ------------------ */
/* close button */
close_button = create_themeicon(current_theme->Small_CANCEL_Icon, pwindow->dst,
close_button = create_themeicon(current_theme->small_cancel_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL
| WF_RESTORE_BACKGROUND);
close_button->info_label =
......
}
/* toggle techs list button */
list_toggle_button = create_themeicon_button_from_chars(current_theme->UP_Icon,
list_toggle_button = create_themeicon_button_from_chars(current_theme->up_icon,
pwindow->dst,
_("Improvements"),
adj_font(10), 0);
......
/* ------------------ */
/* close button */
close_button = create_themeicon(current_theme->Small_CANCEL_Icon, pwindow->dst,
close_button = create_themeicon(current_theme->small_cancel_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL
| WF_RESTORE_BACKGROUND);
close_button->info_label =
......
}
/* toggle techs list button */
list_toggle_button = create_themeicon_button_from_chars(current_theme->UP_Icon,
list_toggle_button = create_themeicon_button_from_chars(current_theme->up_icon,
pwindow->dst, _("Units"), adj_font(10), 0);
#if 0
list_toggle_button->action = toggle_full_tree_mode_in_help_dlg_callback;
......
store->show_tree = !store->show_tree;
if (!store->show_tree) {
store->show_full_tree = FALSE;
store->dock->theme2 = current_theme->UP_Icon;
store->dock->theme2 = current_theme->up_icon;
}
popup_tech_info(MAX_ID - store->dock->prev->id);
}
......
start_x = (pwindow->area.x + adj_size(1) + width + help_dlg->active_widget_list->size.w + adj_size(20));
/* tech tree icon */
pwidget = create_icon2(current_theme->Tech_Tree_Icon, pwindow->dst,
pwidget = create_icon2(current_theme->tech_tree_icon, pwindow->dst,
WF_RESTORE_BACKGROUND);
set_wstate(pwidget, FC_WS_NORMAL);
......
struct techs_buttons *store = (struct techs_buttons *)help_dlg->end_widget_list->data.ptr;
if (store->show_full_tree) {
pwidget->theme2 = current_theme->UP_Icon;
pwidget->theme2 = current_theme->up_icon;
} else {
pwidget->theme2 = current_theme->DOWN_Icon;
pwidget->theme2 = current_theme->down_icon;
}
store->show_full_tree = !store->show_full_tree;
popup_tech_info(MAX_ID - store->dock->prev->id);
......
/* ------------------ */
/* close button */
close_button = create_themeicon(current_theme->Small_CANCEL_Icon, pwindow->dst,
close_button = create_themeicon(current_theme->small_cancel_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL
| WF_RESTORE_BACKGROUND);
close_button->info_label =
......
}
/* toggle techs list button */
list_toggle_button = create_themeicon_button_from_chars(current_theme->UP_Icon,
pwindow->dst,
_("Advances"),
adj_font(10), 0);
list_toggle_button = create_themeicon_button_from_chars(current_theme->up_icon,
pwindow->dst,
_("Advances"),
adj_font(10), 0);
list_toggle_button->action = toggle_full_tree_mode_in_help_dlg_callback;
if (store->show_tree) {
set_wstate(list_toggle_button, FC_WS_NORMAL);
client/gui-sdl2/inteldlg.c
/* ---------- */
/* exit button */
buf = create_themeicon(current_theme->Small_CANCEL_Icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL
| WF_RESTORE_BACKGROUND);
buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL
| WF_RESTORE_BACKGROUND);
buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"),
adj_font(12));
adj_font(12));
area.w = MAX(area.w, buf->size.w + adj_size(10));
buf->action = exit_intel_dlg_callback;
set_wstate(buf, FC_WS_NORMAL);
client/gui-sdl2/mapctrl.c
struct widget *buf = NULL;
clear_surface(icon_widget->theme, NULL);
alphablit(current_theme->MAP_Icon, NULL, icon_widget->theme, NULL, 255);
alphablit(current_theme->map_icon, NULL, icon_widget->theme, NULL, 255);
if (get_num_units_in_focus() > 0) {
undraw_order_widgets();
......
widget_mark_dirty(units_info_window);
/* new button direction */
alphablit(current_theme->L_ARROW_Icon, NULL, icon_widget->theme, NULL, 255);
alphablit(current_theme->l_arrow_icon, NULL, icon_widget->theme, NULL, 255);
copy_chars_to_utf8_str(icon_widget->info_label,
_("Show Unit Info Window"));
......
units_info_window->dst->surface, &window_area, 255);
/* blit right vertical frame */
buf_surf = ResizeSurface(current_theme->FR_Right, current_theme->FR_Right->w,
buf_surf = ResizeSurface(current_theme->fr_right, current_theme->fr_right->w,
units_info_window->area.h, 1);
window_area.y = units_info_window->area.y;
......
copy_chars_to_utf8_str(icon_widget->info_label,
_("Hide Unit Info Window"));
alphablit(current_theme->R_ARROW_Icon, NULL, icon_widget->theme, NULL, 255);
alphablit(current_theme->r_arrow_icon, NULL, icon_widget->theme, NULL, 255);
sdl2_client_flags |= CF_UNITINFO_SHOWN;
......
redraw_unit_info_label(get_units_in_focus());
} else {
alphablit(current_theme->L_ARROW_Icon, NULL, icon_widget->theme, NULL, 255);
alphablit(current_theme->l_arrow_icon, NULL, icon_widget->theme, NULL, 255);
widget_redraw(icon_widget);
widget_mark_dirty(icon_widget);
}
......
/* make new map icon */
clear_surface(map_button->theme, NULL);
alphablit(current_theme->MAP_Icon, NULL, map_button->theme, NULL, 255);
alphablit(current_theme->map_icon, NULL, map_button->theme, NULL, 255);
set_wstate(minimap_window, FC_WS_NORMAL);
......
copy_chars_to_utf8_str(map_button->info_label, _("Show Mini Map"));
/* make new map icon */
alphablit(current_theme->R_ARROW_Icon, NULL, map_button->theme, NULL, 255);
alphablit(current_theme->r_arrow_icon, NULL, map_button->theme, NULL, 255);
sdl2_client_flags &= ~CF_OVERVIEW_SHOWN;
......
set_new_minimap_window_pos();
/* blit part of map window */
src.x = minimap_window->theme->w - BLOCKM_W - current_theme->FR_Right->w;
src.x = minimap_window->theme->w - BLOCKM_W - current_theme->fr_right->w;
src.y = 0;
src.w = BLOCKM_W + current_theme->FR_Right->w;
src.w = BLOCKM_W + current_theme->fr_right->w;
src.h = minimap_window->theme->h;
alphablit(minimap_window->theme, &src,
minimap_window->dst->surface, &map_area, 255);
/* blit left vertical frame theme */
buf_surf = ResizeSurface(current_theme->FR_Left, current_theme->FR_Left->w,
buf_surf = ResizeSurface(current_theme->fr_left, current_theme->fr_left->w,
minimap_window->area.h, 1);
map_area.y += adj_size(2);
......
/* show MiniMap */
copy_chars_to_utf8_str(map_button->info_label, _("Hide Mini Map"));
alphablit(current_theme->L_ARROW_Icon, NULL, map_button->theme, NULL, 255);
alphablit(current_theme->l_arrow_icon, NULL, map_button->theme, NULL, 255);
sdl2_client_flags |= CF_OVERVIEW_SHOWN;
minimap_window->size.w =
......
redraw_minimap_window_buttons();
refresh_overview();
} else {
alphablit(current_theme->R_ARROW_Icon, NULL, map_button->theme, NULL, 255);
alphablit(current_theme->r_arrow_icon, NULL, map_button->theme, NULL, 255);
widget_redraw(map_button);
widget_mark_dirty(map_button);
}
......
widget_redraw(pwidget);
widget_mark_dirty(pwidget);
if (main_data.screen->h -
((OVERVIEW_TILE_HEIGHT + 1) * map.ysize + (current_theme->FR_Bottom->h * 2)) >= 40) {
((OVERVIEW_TILE_HEIGHT + 1) * map.ysize
+ (current_theme->fr_bottom->h * 2)) >= 40) {
char cbuf[4];
OVERVIEW_TILE_HEIGHT++;
......
area.w = MAX(area.w, text2->w + adj_size(30));
FREEUTF8_STR(pstr);
buf = create_themeicon_button(current_theme->L_ARROW_Icon, pwindow->dst, NULL, 0);
buf = create_themeicon_button(current_theme->l_arrow_icon, pwindow->dst, NULL, 0);
buf->action = down_width_callback;
set_wstate(buf, FC_WS_NORMAL);
add_to_gui_list(ID_BUTTON, buf);
......
area.h += buf->size.h + adj_size(5);
add_to_gui_list(ID_LABEL, buf);
buf = create_themeicon_button(current_theme->R_ARROW_Icon, pwindow->dst, NULL, 0);
buf = create_themeicon_button(current_theme->r_arrow_icon, pwindow->dst, NULL, 0);
buf->action = up_width_callback;
set_wstate(buf, FC_WS_NORMAL);
add_to_gui_list(ID_BUTTON, buf);
/* ------------ */
buf = create_themeicon_button(current_theme->L_ARROW_Icon, pwindow->dst, NULL, 0);
buf = create_themeicon_button(current_theme->l_arrow_icon, pwindow->dst, NULL, 0);
buf->action = down_height_callback;
set_wstate(buf, FC_WS_NORMAL);
add_to_gui_list(ID_BUTTON, buf);
......
area.h += buf->size.h + adj_size(20);
add_to_gui_list(ID_LABEL, buf);
buf = create_themeicon_button(current_theme->R_ARROW_Icon, pwindow->dst, NULL, 0);
buf = create_themeicon_button(current_theme->r_arrow_icon, pwindow->dst, NULL, 0);
buf->action = up_height_callback;
set_wstate(buf, FC_WS_NORMAL);
add_to_gui_list(ID_BUTTON, buf);
......
/* ------------ */
pstr = create_utf8_from_char(_("Exit"), adj_font(12));
buf = create_themeicon_button(current_theme->CANCEL_Icon, pwindow->dst, pstr, 0);
buf = create_themeicon_button(current_theme->cancel_icon, pwindow->dst, pstr, 0);
buf->action = popdown_scale_minimap_dlg_callback;
set_wstate(buf, FC_WS_NORMAL);
scale_minimap_dlg->begin_widget_list = buf;
......
FREEUTF8STR(pstr);
/* ----------------- */
buf = create_themeicon_button(current_theme->L_ARROW_Icon, pwindow->dst, NULL, 0);
buf = create_themeicon_button(current_theme->l_arrow_icon, pwindow->dst, NULL, 0);
buf->action = down_info_width_callback;
set_wstate(buf, FC_WS_NORMAL);
add_to_gui_list(ID_BUTTON, buf);
area.h += buf->size.h;
buf = create_themeicon_button(current_theme->R_ARROW_Icon, pwindow->dst, NULL, 0);
buf = create_themeicon_button(current_theme->r_arrow_icon, pwindow->dst, NULL, 0);
buf->action = up_info_width_callback;
set_wstate(buf, FC_WS_NORMAL);
add_to_gui_list(ID_BUTTON, buf);
/* ------------ */
buf = create_themeicon_button(current_theme->L_ARROW_Icon, pwindow->dst, NULL, 0);
buf = create_themeicon_button(current_theme->l_arrow_icon, pwindow->dst, NULL, 0);
buf->action = down_info_height_callback;
set_wstate(buf, FC_WS_NORMAL);
add_to_gui_list(ID_BUTTON, buf);
area.h += buf->size.h + adj_size(10);
buf = create_themeicon_button(current_theme->R_ARROW_Icon, pwindow->dst, NULL, 0);
buf = create_themeicon_button(current_theme->r_arrow_icon, pwindow->dst, NULL, 0);
buf->action = up_info_height_callback;
set_wstate(buf, FC_WS_NORMAL);
add_to_gui_list(ID_BUTTON, buf);
......
/* ------------ */
pstr = create_utf8_from_char(_("Exit"), adj_font(12));
buf = create_themeicon_button(current_theme->CANCEL_Icon,
pwindow->dst, pstr, 0);
buf = create_themeicon_button(current_theme->cancel_icon,
pwindow->dst, pstr, 0);
buf->action = popdown_scale_unitinfo_dlg_callback;
set_wstate(buf, FC_WS_NORMAL);
scale_unit_info_dlg->begin_widget_list = buf;
......
main_window_height() - units_info_window->size.h);
} else {
widget_set_position(unit_window,
main_window_width() - BLOCKU_W - current_theme->FR_Right->w,
main_window_width() - BLOCKU_W - current_theme->fr_right->w,
main_window_height() - units_info_window->size.h);
}
......
widget_set_position(minimap_window, 0,
main_window_height() - minimap_window->size.h);
area.x = minimap_window->size.w - current_theme->FR_Right->w - BLOCKM_W;
area.x = minimap_window->size.w - current_theme->fr_right->w - BLOCKM_W;
area.y = minimap_window->area.y;
area.w = BLOCKM_W;
area.h = minimap_window->area.h;
......
unitinfo_w = pwindow->size.w;
unitinfo_h = pwindow->size.h;
icon_theme = ResizeSurface(current_theme->Block, pwindow->area.w,
pwindow->area.h, 1);
icon_theme = ResizeSurface(current_theme->block, pwindow->area.w,
pwindow->area.h, 1);
blit_entire_src(icon_theme, pwindow->theme, pwindow->area.x, pwindow->area.y);
FREESURFACE(icon_theme);
......
/* show/hide unit's window button */
/* make UNITS Icon */
icon_theme = create_surf(current_theme->MAP_Icon->w,
current_theme->MAP_Icon->h, SDL_SWSURFACE);
alphablit(current_theme->MAP_Icon, NULL, icon_theme, NULL, 255);
alphablit(current_theme->R_ARROW_Icon, NULL, icon_theme, NULL, 255);
icon_theme = create_surf(current_theme->map_icon->w,
current_theme->map_icon->h, SDL_SWSURFACE);
alphablit(current_theme->map_icon, NULL, icon_theme, NULL, 255);
alphablit(current_theme->r_arrow_icon, NULL, icon_theme, NULL, 255);
pwidget = create_themeicon(icon_theme, units_info_window->dst,
WF_FREE_GFX | WF_FREE_THEME
......
draw_frame(pwindow->theme, 0, 0, pwindow->size.w, pwindow->size.h);
icon_theme = ResizeSurface(current_theme->Block, BLOCKM_W, pwindow->area.h, 1);
icon_theme = ResizeSurface(current_theme->block, BLOCKM_W, pwindow->area.h, 1);
blit_entire_src(icon_theme, pwindow->theme,
pwindow->area.x + pwindow->area.w - icon_theme->w, pwindow->area.y);
pwindow->area.x + pwindow->area.w - icon_theme->w,
pwindow->area.y);
FREESURFACE(icon_theme);
pwindow->action = minimap_window_callback;
......
minimap_dlg->end_widget_list = minimap_window;
/* new turn button */
pwidget = create_themeicon(current_theme->NEW_TURN_Icon, minimap_window->dst,
pwidget = create_themeicon(current_theme->new_turn_icon, minimap_window->dst,
WF_WIDGET_HAS_INFO_LABEL
| WF_RESTORE_BACKGROUND);
fc_snprintf(buf, sizeof(buf), "%s (%s)", _("Turn Done"), _("Shift+Return"));
......
new_turn_button = pwidget;
/* players button */
pwidget = create_themeicon(current_theme->PLAYERS_Icon, minimap_window->dst,
pwidget = create_themeicon(current_theme->players_icon, minimap_window->dst,
WF_WIDGET_HAS_INFO_LABEL
| WF_RESTORE_BACKGROUND);
/* TRANS: Nations report action */
......
add_to_gui_list(ID_PLAYERS, pwidget);
/* find city button */
pwidget = create_themeicon(current_theme->FindCity_Icon, minimap_window->dst,
pwidget = create_themeicon(current_theme->find_city_icon, minimap_window->dst,
WF_WIDGET_HAS_INFO_LABEL
| WF_RESTORE_BACKGROUND);
fc_snprintf(buf, sizeof(buf), "%s (%s)\n%s\n%s (%s)", _("Cities Report"),
......
find_city_button = pwidget;
/* units button */
pwidget = create_themeicon(current_theme->UNITS2_Icon, minimap_window->dst,
pwidget = create_themeicon(current_theme->units2_icon, minimap_window->dst,
WF_WIDGET_HAS_INFO_LABEL
| WF_RESTORE_BACKGROUND);
fc_snprintf(buf, sizeof(buf), "%s (%s)", _("Units"), "F2");
......
add_to_gui_list(ID_UNITS, pwidget);
/* show/hide log window button */
pwidget = create_themeicon(current_theme->LOG_Icon, minimap_window->dst,
pwidget = create_themeicon(current_theme->log_icon, minimap_window->dst,
WF_WIDGET_HAS_INFO_LABEL
| WF_RESTORE_BACKGROUND);
fc_snprintf(buf, sizeof(buf), "%s (%s)", _("Hide Messages"), "F9");
......
add_to_gui_list(ID_CHATLINE_TOGGLE_LOG_WINDOW_BUTTON, pwidget);
/* toggle minimap mode button */
pwidget = create_themeicon(current_theme->BORDERS_Icon, minimap_window->dst,
pwidget = create_themeicon(current_theme->borders_icon, minimap_window->dst,
WF_WIDGET_HAS_INFO_LABEL
| WF_RESTORE_BACKGROUND);
fc_snprintf(buf, sizeof(buf), "%s (%s)", _("Toggle Mini Map Mode"), "Shift+\\");
......
#ifdef SMALL_SCREEN
/* options button */
options_button = create_themeicon(current_theme->Options_Icon,
minimap_window->dst,
WF_WIDGET_HAS_INFO_LABEL
| WF_RESTORE_BACKGROUND);
options_button = create_themeicon(current_theme->options_icon,
minimap_window->dst,
WF_WIDGET_HAS_INFO_LABEL
| WF_RESTORE_BACKGROUND);
fc_snprintf(buf, sizeof(buf), "%s (%s)", _("Options"), "Esc");
options_button->info_label = create_str16_from_char(buf, adj_font(12));
......
/* show/hide minimap button */
/* make Map Icon */
icon_theme = create_surf(current_theme->MAP_Icon->w, current_theme->MAP_Icon->h,
SDL_SWSURFACE);
alphablit(current_theme->MAP_Icon, NULL, icon_theme, NULL, 255);
alphablit(current_theme->L_ARROW_Icon, NULL, icon_theme, NULL, 255);
icon_theme = create_surf(current_theme->map_icon->w, current_theme->map_icon->h,
SDL_SWSURFACE);
alphablit(current_theme->map_icon, NULL, icon_theme, NULL, 255);
alphablit(current_theme->l_arrow_icon, NULL, icon_theme, NULL, 255);
pwidget = create_themeicon(icon_theme, minimap_window->dst,
WF_FREE_GFX | WF_FREE_THEME |
......
/* create ok button */
ok_button =
create_themeicon_button_from_chars(current_theme->Small_OK_Icon, pwindow->dst,
create_themeicon_button_from_chars(current_theme->small_ok_icon, pwindow->dst,
_("OK"), adj_font(10), 0);
ok_button->action = newcity_ok_callback;
ok_button->key = SDLK_RETURN;
......
/* create cancel button */
cancel_button =
create_themeicon_button_from_chars(current_theme->Small_CANCEL_Icon,
create_themeicon_button_from_chars(current_theme->small_cancel_icon,
pwindow->dst, _("Cancel"), adj_font(10), 0);
cancel_button->action = newcity_cancel_callback;
cancel_button->key = SDLK_ESCAPE;
client/gui-sdl2/menu.c
fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)", _("No Orders"),
/* TRANS: "Space" refers to the space bar on a keyboard. */
_("Space"));
buf = create_themeicon(current_theme->ODone_Icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->o_done_icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
set_wstate(buf, FC_WS_NORMAL);
buf->action = unit_order_callback;
buf->info_label = create_utf8_from_char(cbuf, adj_font(10));
......
/* Wait */
fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)", _("Wait"), "W");
buf = create_themeicon(current_theme->OWait_Icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->o_wait_icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
set_wstate(buf, FC_WS_NORMAL);
buf->action = unit_order_callback;
buf->info_label = create_utf8_from_char(cbuf, adj_font(10));
......
/* Explode Nuclear */
fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)",
action_id_name_translation(ACTION_NUKE), "Shift+N");
buf = create_themeicon(current_theme->ONuke_Icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->o_nuke_icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
set_wstate(buf, FC_WS_NORMAL);
buf->action = unit_order_callback;
buf->info_label = create_utf8_from_char(cbuf, adj_font(10));
......
/* Act against the specified tile. */
/* TRANS: Button to bring up the action selection dialog. */
fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)", _("Do..."), "D");
buf = create_themeicon(current_theme->OSpy_Icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->o_spy_icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
set_wstate(buf, FC_WS_NORMAL);
buf->action = unit_order_callback;
buf->info_label = create_utf8_from_char(cbuf, adj_font(10));
......
/* Disband */
fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)", _("Disband Unit"), "Shift+D");
buf = create_themeicon(current_theme->ODisband_Icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->o_disband_icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
set_wstate(buf, FC_WS_NORMAL);
buf->action = unit_order_callback;
buf->info_label = create_utf8_from_char(cbuf, adj_font(10));
......
/* Upgrade */
fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)", _("Upgrade Unit"), "Shift+U");
buf = create_themeicon(current_theme->Order_Icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->order_icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
set_wstate(buf, FC_WS_NORMAL);
buf->action = unit_order_callback;
buf->info_label = create_utf8_from_char(cbuf, adj_font(10));
......
/* Convert */
fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)", _("Convert Unit"), "Shift+O");
buf = create_themeicon(current_theme->Order_Icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->order_icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
set_wstate(buf, FC_WS_NORMAL);
buf->action = unit_order_callback;
buf->info_label = create_utf8_from_char(cbuf, adj_font(10));
......
/* Return to nearest city */
fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)",
_("Return to Nearest City"), "Shift+G");
buf = create_themeicon(current_theme->OReturn_Icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->o_return_icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
set_wstate(buf, FC_WS_NORMAL);
buf->action = unit_order_callback;
buf->info_label = create_utf8_from_char(cbuf, adj_font(10));
......
/* Goto City */
fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)", _("Go to City"), "T");
buf = create_themeicon(current_theme->OGotoCity_Icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->o_goto_city_icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
set_wstate(buf, FC_WS_NORMAL);
buf->action = unit_order_callback;
buf->info_label = create_utf8_from_char(cbuf, adj_font(10));
......
/* Airlift */
fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)", _("Airlift to City"), "T");
buf = create_themeicon(current_theme->Order_Icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->order_icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
set_wstate(buf, FC_WS_NORMAL);
buf->action = unit_order_callback;
buf->info_label = create_utf8_from_char(cbuf, adj_font(10));
......
/* Goto location */
fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)", _("Go to Tile"), "G");
buf = create_themeicon(current_theme->OGoto_Icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->o_goto_icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
set_wstate(buf, FC_WS_NORMAL);
buf->action = unit_order_callback;
buf->info_label = create_utf8_from_char(cbuf, adj_font(10));
......
/* Patrol */
fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)", _("Patrol"), "Q");
buf = create_themeicon(current_theme->OPatrol_Icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->o_patrol_icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
set_wstate(buf, FC_WS_NORMAL);
buf->action = unit_order_callback;
buf->info_label = create_utf8_from_char(cbuf, adj_font(10));
......
/* Connect irrigation */
fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)",
_("Connect With Irrigation"), "Ctrl+I");
buf = create_themeicon(current_theme->OAutoConnect_Icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->o_autoconnect_icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
set_wstate(buf, FC_WS_NORMAL);
buf->action = unit_order_callback;
buf->info_label = create_utf8_from_char(cbuf, adj_font(10));
......
_("Connect With %s (%s)"),
extra_name_translation(road_extra_get(proad)),
"Ctrl+R");
buf = create_themeicon(current_theme->OAutoConnect_Icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->o_autoconnect_icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
set_wstate(buf, FC_WS_NORMAL);
buf->action = unit_order_callback;
buf->info_label = create_utf8_from_char(cbuf, adj_font(10));
......
_("Connect With %s (%s)"),
extra_name_translation(road_extra_get(prail)),
"Ctrl+L");
buf = create_themeicon(current_theme->OAutoConnect_Icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->o_autoconnect_icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
set_wstate(buf, FC_WS_NORMAL);
buf->action = unit_order_callback;
buf->info_label = create_utf8_from_char(cbuf, adj_font(10));
......
/* Auto-Explore */
fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)", _("Auto Explore"), "X");
buf = create_themeicon(current_theme->OAutoExp_Icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->o_autoexp_icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
set_wstate(buf, FC_WS_NORMAL);
buf->action = unit_order_callback;
buf->info_label = create_utf8_from_char(cbuf, adj_font(10));
......
/* Auto-Settler */
fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)", _("Auto Settler"), "A");
buf = create_themeicon(current_theme->OAutoSett_Icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->o_autosett_icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
set_wstate(buf, FC_WS_NORMAL);
buf->action = unit_order_callback;
buf->info_label = create_utf8_from_char(cbuf, adj_font(10));
......
/* Wake Up Others */
fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)",
_("Unsentry All On Tile"), "Shift+S");
buf = create_themeicon(current_theme->OWakeUp_Icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->o_wakeup_icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
set_wstate(buf, FC_WS_NORMAL);
buf->action = unit_order_callback;
buf->info_label = create_utf8_from_char(cbuf, adj_font(10));
......
/* Unload */
fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)",
_("Unload All From Transporter"), "Shift+T");
buf = create_themeicon(current_theme->OUnload_Icon, main_data.gui,
buf = create_themeicon(current_theme->o_unload_icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
set_wstate(buf, FC_WS_NORMAL);
......
/* Load */
fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)", _("Load Unit"), "L");
buf = create_themeicon(current_theme->OLoad_Icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->o_load_icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
set_wstate(buf, FC_WS_NORMAL);
buf->action = unit_order_callback;
buf->info_label = create_utf8_from_char(cbuf, adj_font(10));
......
/* Unload */
fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)", _("Unload Unit"), "U");
buf = create_themeicon(current_theme->OUnload_Icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->o_unload_icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
set_wstate(buf, FC_WS_NORMAL);
buf->action = unit_order_callback;
buf->info_label = create_utf8_from_char(cbuf, adj_font(10));
......
/* Find Homecity */
fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)",
action_id_name_translation(ACTION_HOME_CITY), "H");
buf = create_themeicon(current_theme->OHomeCity_Icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->o_homecity_icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
set_wstate(buf, FC_WS_NORMAL);
buf->action = unit_order_callback;
buf->info_label = create_utf8_from_char(cbuf, adj_font(10));
......
/* Pillage */
fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)", _("Pillage"), "Shift+P");
buf = create_themeicon(current_theme->OPillage_Icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->o_pillage_icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
set_wstate(buf, FC_WS_NORMAL);
buf->action = unit_order_callback;
buf->info_label = create_utf8_from_char(cbuf, adj_font(10));
......
/* Sentry */
fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)", _("Sentry Unit"), "S");
buf = create_themeicon(current_theme->OSentry_Icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->o_sentry_icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
set_wstate(buf, FC_WS_NORMAL);
buf->action = unit_order_callback;
buf->info_label = create_utf8_from_char(cbuf, adj_font(10));
......
/* Clean Nuclear Fallout */
/* Label will be replaced by real_menus_update() before it's seen */
fc_snprintf(cbuf, sizeof(cbuf), "placeholder");
buf = create_themeicon(current_theme->OFallout_Icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->o_fallout_icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
set_wstate(buf, FC_WS_NORMAL);
buf->action = unit_order_callback;
buf->info_label = create_utf8_from_char(cbuf, adj_font(10));
......
/* Paradrop */
fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)",
action_id_name_translation(ACTION_PARADROP), "P");
buf = create_themeicon(current_theme->OParaDrop_Icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->o_paradrop_icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
set_wstate(buf, FC_WS_NORMAL);
buf->action = unit_order_callback;
buf->info_label = create_utf8_from_char(cbuf, adj_font(10));
......
/* Clean Pollution */
/* Label will be replaced by real_menus_update() before it's seen */
fc_snprintf(cbuf, sizeof(cbuf), "placeholder");
buf = create_themeicon(current_theme->OPollution_Icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->o_pollution_icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
set_wstate(buf, FC_WS_NORMAL);
buf->action = unit_order_callback;
buf->info_label = create_utf8_from_char(cbuf, adj_font(10));
......
/* Build Airbase */
/* Label will be replaced by real_menus_update() before it's seen */
fc_snprintf(cbuf, sizeof(cbuf), "placeholder");
buf = create_themeicon(current_theme->OAirBase_Icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->o_airbase_icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
set_wstate(buf, FC_WS_NORMAL);
buf->action = unit_order_callback;
buf->info_label = create_utf8_from_char(cbuf, adj_font(10));
......
/* Fortify */
fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)", _("Fortify Unit"), "F");
buf = create_themeicon(current_theme->OFortify_Icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->o_fortify_icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
set_wstate(buf, FC_WS_NORMAL);
buf->action = unit_order_callback;
buf->info_label = create_utf8_from_char(cbuf, adj_font(10));
......
/* Build Fortress */
/* Label will be replaced by real_menus_update() before it's seen */
fc_snprintf(cbuf, sizeof(cbuf), "placeholder");
buf = create_themeicon(current_theme->OFortress_Icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->o_fortress_icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
set_wstate(buf, FC_WS_NORMAL);
buf->action = unit_order_callback;
buf->info_label = create_utf8_from_char(cbuf, adj_font(10));
......
/* Transform Tile */
/* Label will be replaced by real_menus_update() before it's seen */
fc_snprintf(cbuf, sizeof(cbuf), "placeholder");
buf = create_themeicon(current_theme->OTransform_Icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->o_transform_icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
set_wstate(buf, FC_WS_NORMAL);
buf->action = unit_order_callback;
buf->info_label = create_utf8_from_char(cbuf, adj_font(10));
......
/* Build Mine */
/* Label will be replaced by real_menus_update() before it's seen */
fc_snprintf(cbuf, sizeof(cbuf), "placeholder");
buf = create_themeicon(current_theme->OMine_Icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->o_mine_icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
set_wstate(buf, FC_WS_NORMAL);
buf->action = unit_order_callback;
buf->info_label = create_utf8_from_char(cbuf, adj_font(10));
......
/* Build Irrigation */
/* Label will be replaced by real_menus_update() before it's seen */
fc_snprintf(cbuf, sizeof(cbuf), "placeholder");
buf = create_themeicon(current_theme->OIrrigation_Icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->o_irrigation_icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
set_wstate(buf, FC_WS_NORMAL);
buf->action = unit_order_callback;
buf->key = SDLK_i;
......
/* Cultivate */
/* Label will be replaced by real_menus_update() before it's seen */
fc_snprintf(cbuf, sizeof(cbuf), "placeholder");
buf = create_themeicon(current_theme->OCultivate_Icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->o_cultivate_icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
set_wstate(buf, FC_WS_NORMAL);
buf->action = unit_order_callback;
buf->key = SDLK_i;
......
/* Plant */
/* Label will be replaced by real_menus_update() before it's seen */
fc_snprintf(cbuf, sizeof(cbuf), "placeholder");
buf = create_themeicon(current_theme->OPlant_Icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->o_plant_icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
set_wstate(buf, FC_WS_NORMAL);
buf->action = unit_order_callback;
buf->key = SDLK_m;
......
/* Establish Trade route */
/* Label will be replaced by real_menus_update() before it's seen */
fc_snprintf(cbuf, sizeof(cbuf), "placeholder");
buf = create_themeicon(current_theme->OTrade_Icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->o_trade_icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
set_wstate(buf, FC_WS_NORMAL);
buf->action = unit_order_callback;
buf->info_label = create_utf8_from_char(cbuf, adj_font(10));
......
/* Build (Rail-)Road */
/* Label will be replaced by real_menus_update() before it's seen */
fc_snprintf(cbuf, sizeof(cbuf), "placeholder");
buf = create_themeicon(current_theme->ORoad_Icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->o_road_icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
set_wstate(buf, FC_WS_NORMAL);
buf->action = unit_order_callback;
buf->info_label = create_utf8_from_char(cbuf, adj_font(10));
......
/* Help Build Wonder */
fc_snprintf(cbuf, sizeof(cbuf), "%s (%s)",
action_id_name_translation(ACTION_HELP_WONDER), "B");
buf = create_themeicon(current_theme->OWonder_Icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->o_wonder_icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
set_wstate(buf, FC_WS_NORMAL);
buf->action = unit_order_callback;
buf->info_label = create_utf8_from_char(cbuf, adj_font(10));
......
/* Add to City / Build New City */
/* Label will be replaced by real_menus_update() before it's seen */
fc_snprintf(cbuf, sizeof(cbuf), "placeholder");
buf = create_themeicon(current_theme->OBuildCity_Icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
buf = create_themeicon(current_theme->o_build_city_icon, main_data.gui,
WF_HIDDEN | WF_RESTORE_BACKGROUND
| WF_WIDGET_HAS_INFO_LABEL);
set_wstate(buf, FC_WS_NORMAL);
buf->action = unit_order_callback;
buf->info_label = create_utf8_from_char(cbuf, adj_font(10));
......
PL_("turn", "turns", time));
if (compat == ROCO_RAILROAD) {
order_road_button->theme = current_theme->ORailRoad_Icon;
order_road_button->theme = current_theme->o_railroad_icon;
} else {
order_road_button->theme = current_theme->ORoad_Icon;
order_road_button->theme = current_theme->o_road_icon;
}
copy_chars_to_utf8_str(order_road_button->info_label, cbuf);
clear_wflag(order_road_button, WF_HIDDEN);
......
fc_snprintf(cbuf, sizeof(cbuf), _("Build %s (%s) %d %s"),
extra_name_translation(pextra), "I", time,
PL_("turn", "turns", time));
order_irrigation_button->theme = current_theme->OIrrigation_Icon;
order_irrigation_button->theme = current_theme->o_irrigation_icon;
copy_chars_to_utf8_str(order_irrigation_button->info_label, cbuf);
clear_wflag(order_irrigation_button, WF_HIDDEN);
......
fc_snprintf(cbuf, sizeof(cbuf), _("Build %s (%s) %d %s"),
extra_name_translation(pextra), "M", time,
PL_("turn", "turns", time));
order_mine_button->theme = current_theme->OMine_Icon;
order_mine_button->theme = current_theme->o_mine_icon;
copy_chars_to_utf8_str(order_mine_button->info_label, cbuf);
clear_wflag(order_mine_button, WF_HIDDEN);
client/gui-sdl2/optiondlg.c
pdialog->end_widget_list = window;
/* Create close button widget. */
close_button = create_themeicon(current_theme->Small_CANCEL_Icon, window->dst,
close_button = create_themeicon(current_theme->small_cancel_icon, window->dst,
WF_WIDGET_HAS_INFO_LABEL
| WF_RESTORE_BACKGROUND);
close_button->info_label = create_utf8_from_char(_("Close Dialog (Esc)"),
......
window = pdialog->end_widget_list;
/* Create the apply button. */
apply_button = create_themeicon(current_theme->Small_OK_Icon, window->dst,
apply_button = create_themeicon(current_theme->small_ok_icon, window->dst,
WF_WIDGET_HAS_INFO_LABEL
| WF_RESTORE_BACKGROUND);
apply_button->info_label = create_utf8_from_char(_("Apply changes"),
......
{
char buf[256];
options_button = create_themeicon(current_theme->Options_Icon, main_data.gui,
WF_WIDGET_HAS_INFO_LABEL
| WF_RESTORE_BACKGROUND);
options_button = create_themeicon(current_theme->options_icon, main_data.gui,
WF_WIDGET_HAS_INFO_LABEL
| WF_RESTORE_BACKGROUND);
options_button->action = optiondlg_callback;
fc_snprintf(buf, sizeof(buf), "%s (%s)", _("Options"), "Esc");
options_button->info_label = create_utf8_from_char(buf, adj_font(12));
client/gui-sdl2/plrdlg.c
pplayers_dlg->end_widget_list = pwindow;
/* ---------- */
/* exit button */
buf = create_themeicon(current_theme->Small_CANCEL_Icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"),
adj_font(12));
adj_font(12));
buf->action = exit_players_dlg_callback;
set_wstate(buf, FC_WS_NORMAL);
buf->key = SDLK_ESCAPE;
......
/* ---------- */
/* exit button */
buf = create_themeicon(current_theme->Small_CANCEL_Icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"),
adj_font(12));
adj_font(12));
area.w = MAX(area.w, buf->size.w + adj_size(10));
buf->action = exit_players_nations_dlg_callback;
set_wstate(buf, FC_WS_NORMAL);
client/gui-sdl2/repodlgs.c
area.w = MAX(area.w, text->w + adj_size(20));
/* cancel button */
buf = create_themeicon_button_from_chars(current_theme->CANCEL_Icon,
pwindow->dst, _("No"),
adj_font(12), 0);
buf = create_themeicon_button_from_chars(current_theme->cancel_icon,
pwindow->dst, _("No"),
adj_font(12), 0);
buf->action = cancel_upgrade_unit_callback;
set_wstate(buf, FC_WS_NORMAL);
......
add_to_gui_list(ID_BUTTON, buf);
if (value <= client.conn.playing->economic.gold) {
buf = create_themeicon_button_from_chars(current_theme->OK_Icon, pwindow->dst,
_("Yes"), adj_font(12), 0);
buf = create_themeicon_button_from_chars(current_theme->ok_icon, pwindow->dst,
_("Yes"), adj_font(12), 0);
buf->action = ok_upgrade_unit_window_callback;
set_wstate(buf, FC_WS_NORMAL);
......
/* ------------------------- */
/* exit button */
buf = create_themeicon(current_theme->Small_CANCEL_Icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"), adj_font(12));
buf->action = exit_units_dlg_callback;
set_wstate(buf, FC_WS_NORMAL);
......
area.h += (text->h + adj_size(10));
/* cancel button */
buf = create_themeicon_button_from_chars(current_theme->CANCEL_Icon,
pwindow->dst, _("No"),
adj_font(12), 0);
buf = create_themeicon_button_from_chars(current_theme->cancel_icon,
pwindow->dst, _("No"),
adj_font(12), 0);
buf->action = cancel_sell_impr_callback;
set_wstate(buf, FC_WS_NORMAL);
......
add_to_gui_list(ID_BUTTON, buf);
if (count > 0) {
buf = create_themeicon_button_from_chars(current_theme->OK_Icon, pwindow->dst,
_("Sell"), adj_font(12), 0);
buf = create_themeicon_button_from_chars(current_theme->ok_icon, pwindow->dst,
_("Sell"), adj_font(12), 0);
buf->action = ok_sell_impr_callback;
set_wstate(buf, FC_WS_NORMAL);
......
buf = create_checkbox(pwindow->dst,
sdl2_client_flags & CF_CHANGE_TAXRATE_LUX_BLOCK,
WF_RESTORE_BACKGROUND | WF_WIDGET_HAS_INFO_LABEL);
set_new_checkbox_theme(buf, current_theme->LOCK_Icon, current_theme->UNLOCK_Icon);
set_new_checkbox_theme(buf, current_theme->lock_icon, current_theme->unlock_icon);
buf->info_label = pstr;
buf->action = toggle_block_callback;
set_wstate(buf, FC_WS_NORMAL);
......
w2 = adj_size(10) + buf->size.w;
/* lux rate slider */
buf = create_horizontal(current_theme->Horiz, pwindow->dst, adj_size(30),
(WF_FREE_DATA | WF_RESTORE_BACKGROUND));
buf = create_horizontal(current_theme->horiz, pwindow->dst, adj_size(30),
(WF_FREE_DATA | WF_RESTORE_BACKGROUND));
buf->action = horiz_taxrate_callback;
buf->data.ptr = fc_calloc(1, sizeof(int));
......
pstr->style |= TTF_STYLE_BOLD;
buf = create_checkbox(pwindow->dst,
sdl2_client_flags & CF_CHANGE_TAXRATE_SCI_BLOCK,
WF_RESTORE_BACKGROUND | WF_WIDGET_HAS_INFO_LABEL);
sdl2_client_flags & CF_CHANGE_TAXRATE_SCI_BLOCK,
WF_RESTORE_BACKGROUND | WF_WIDGET_HAS_INFO_LABEL);
set_new_checkbox_theme(buf, current_theme->LOCK_Icon, current_theme->UNLOCK_Icon);
set_new_checkbox_theme(buf, current_theme->lock_icon, current_theme->unlock_icon);
buf->info_label = pstr;
buf->action = toggle_block_callback;
......
add_to_gui_list(ID_CHANGE_TAXRATE_DLG_SCI_BLOCK_CHECKBOX, buf);
/* science rate slider */
buf = create_horizontal(current_theme->Horiz, pwindow->dst, adj_size(30),
(WF_FREE_DATA | WF_RESTORE_BACKGROUND));
buf = create_horizontal(current_theme->horiz, pwindow->dst, adj_size(30),
(WF_FREE_DATA | WF_RESTORE_BACKGROUND));
buf->action = horiz_taxrate_callback;
buf->data.ptr = fc_calloc(1, sizeof(int));
......
fc_snprintf(cbuf, sizeof(cbuf), _("Update"));
pstr = create_utf8_from_char(cbuf, adj_font(12));
buf = create_themeicon_button(current_theme->Small_OK_Icon, pwindow->dst, pstr, 0);
buf = create_themeicon_button(current_theme->small_ok_icon, pwindow->dst, pstr, 0);
buf->action = apply_taxrates_callback;
set_wstate(buf, FC_WS_NORMAL);
......
fc_snprintf(cbuf, sizeof(cbuf), _("Close Dialog (Esc)"));
pstr = create_utf8_from_char(cbuf, adj_font(12));
buf = create_themeicon(current_theme->Small_CANCEL_Icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf->info_label = pstr;
buf->action = exit_economy_dialog_callback;
set_wstate(buf, FC_WS_NORMAL);
......
/* Luxuries Horizontal Scrollbar Background */
dst.x = area.x + adj_size(10) + w + (area.w - (w + adj_size(10)) - adj_size(184)) / 2;
dst.w = adj_size(184);
dst.h = current_theme->Horiz->h - adj_size(2);
dst.h = current_theme->horiz->h - adj_size(2);
fill_rect_alpha(pwindow->theme, &dst, &bg_color3);
......
buf->size.y = dst.y + 1;
/* Science Horizontal Scrollbar Background */
dst.y += current_theme->Horiz->h + 1;
dst.y += current_theme->horiz->h + 1;
fill_rect_alpha(pwindow->theme, &dst, &bg_color3);
create_frame(pwindow->theme,
......
/* ------------------------- */
/* exit button */
buf = create_themeicon(current_theme->Small_CANCEL_Icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"),
adj_font(12));
adj_font(12));
area.w += buf->size.w + adj_size(10);
buf->action = exit_change_tech_dlg_callback;
set_wstate(buf, FC_WS_NORMAL);
......
/* ------------------------- */
/* exit button */
buf = create_themeicon(current_theme->Small_CANCEL_Icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND);
buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"),
adj_font(12));
adj_font(12));
area.w += buf->size.w + adj_size(10);
buf->action = exit_change_tech_dlg_callback;
set_wstate(buf, FC_WS_NORMAL);
......
/* ------ */
/* exit button */
exit_button = create_themeicon(current_theme->Small_CANCEL_Icon, pwindow->dst,
exit_button = create_themeicon(current_theme->small_cancel_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL
| WF_RESTORE_BACKGROUND);
exit_button->info_label = create_utf8_from_char(_("Close Dialog (Esc)"),
client/gui-sdl2/spaceshipdlg.c
/* ---------- */
/* create exit button */
buf = create_themeicon(current_theme->Small_CANCEL_Icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL
| WF_RESTORE_BACKGROUND);
buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst,
WF_WIDGET_HAS_INFO_LABEL
| WF_RESTORE_BACKGROUND);
buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"),
adj_font(12));
adj_font(12));
buf->data.player = pplayer;
buf->action = exit_space_dialog_callback;
set_wstate(buf, FC_WS_NORMAL);
......
add_to_gui_list(ID_BUTTON, buf);
buf = create_themeicon_button_from_chars(current_theme->OK_Icon, pwindow->dst,
_("Launch"), adj_font(12), 0);
buf = create_themeicon_button_from_chars(current_theme->ok_icon, pwindow->dst,
_("Launch"), adj_font(12), 0);
buf->action = launch_spaceship_callback;
area.w = MAX(area.w, buf->size.w);
client/gui-sdl2/widget.c
Uint16 w, Uint16 h)
{
SDL_Surface *tmp_left =
ResizeSurface(current_theme->FR_Left, current_theme->FR_Left->w, h, 1);
ResizeSurface(current_theme->fr_left, current_theme->fr_left->w, h, 1);
SDL_Surface *tmp_right =
ResizeSurface(current_theme->FR_Right, current_theme->FR_Right->w, h, 1);
ResizeSurface(current_theme->fr_right, current_theme->fr_right->w, h, 1);
SDL_Surface *tmp_top =
ResizeSurface(current_theme->FR_Top, w, current_theme->FR_Top->h, 1);
ResizeSurface(current_theme->fr_top, w, current_theme->fr_top->h, 1);
SDL_Surface *tmp_bottom =
ResizeSurface(current_theme->FR_Bottom, w, current_theme->FR_Bottom->h, 1);
ResizeSurface(current_theme->fr_bottom, w, current_theme->fr_bottom->h, 1);
SDL_Rect tmp,dst = {start_x, start_y, 0, 0};
tmp = dst;
client/gui-sdl2/widget_checkbox.c
struct checkbox *ptmp = fc_calloc(1, sizeof(struct checkbox));
if (state) {
pCBox->theme = current_theme->CBOX_Sell_Icon;
pCBox->theme = current_theme->cbox_sell_icon;
} else {
pCBox->theme = current_theme->CBOX_Unsell_Icon;
pCBox->theme = current_theme->cbox_unsell_icon;
}
set_wflag(pCBox, (WF_FREE_STRING | WF_FREE_GFX | WF_FREE_PRIVATE_DATA | flags));
......
pCBox->mod = KMOD_NONE;
pCBox->dst = pdest;
ptmp->state = state;
ptmp->pTRUE_Theme = current_theme->CBOX_Sell_Icon;
ptmp->pFALSE_Theme = current_theme->CBOX_Unsell_Icon;
ptmp->pTRUE_Theme = current_theme->cbox_sell_icon;
ptmp->pFALSE_Theme = current_theme->cbox_unsell_icon;
pCBox->private_data.cbox = ptmp;
checkbox_baseclass_redraw = pCBox->redraw;
......
ptmp = fc_calloc(1, sizeof(struct checkbox));
if (state) {
surf = current_theme->CBOX_Sell_Icon;
surf = current_theme->cbox_sell_icon;
} else {
surf = current_theme->CBOX_Unsell_Icon;
surf = current_theme->cbox_unsell_icon;
}
icon = create_icon_from_theme(surf, 0);
......
set_wtype(pCBox, WT_TCHECKBOX);
ptmp->state = state;
ptmp->pTRUE_Theme = current_theme->CBOX_Sell_Icon;
ptmp->pFALSE_Theme = current_theme->CBOX_Unsell_Icon;
ptmp->pTRUE_Theme = current_theme->cbox_sell_icon;
ptmp->pFALSE_Theme = current_theme->cbox_unsell_icon;
pCBox->private_data.cbox = ptmp;
tmp_widget = widget_new();
client/gui-sdl2/widget_combo.c
SDL_Rect buf = {0, 0, 0, 0};
struct widget *combo = widget_new();
combo->theme = current_theme->Edit;
combo->theme = current_theme->edit;
combo->theme2 = background;
combo->string_utf8 = pstr;
set_wflag(combo, WF_FREE_STRING | WF_FREE_GFX | flags);
......
}
length = MAX(length, buf.w + adj_size(10));
correct_size_bcgnd_surf(current_theme->Edit, &length, &buf.h);
correct_size_bcgnd_surf(current_theme->edit, &length, &buf.h);
combo->size.w = buf.w + adj_size(10);
combo->size.h = buf.h;
client/gui-sdl2/widget_edit.c
SDL_Rect buf = {0, 0, 0, 0};
struct widget *pedit = widget_new();
pedit->theme = current_theme->Edit;
pedit->theme = current_theme->edit;
pedit->theme2 = background; /* FIXME: make somewhere use of it */
pedit->string_utf8 = pstr;
set_wflag(pedit, (WF_FREE_STRING | WF_FREE_GFX | flags));
......
length = MAX(length, buf.w + adj_size(10));
correct_size_bcgnd_surf(current_theme->Edit, &length, &buf.h);
correct_size_bcgnd_surf(current_theme->edit, &length, &buf.h);
pedit->size.w = length;
pedit->size.h = buf.h;
client/gui-sdl2/widget_scrollbar.c
if (create_buttons) {
/* create up button */
buf = create_themeicon_button(current_theme->UP_Icon, pwindow->dst,
NULL, WF_RESTORE_BACKGROUND);
buf = create_themeicon_button(current_theme->up_icon, pwindow->dst,
NULL, WF_RESTORE_BACKGROUND);
buf->id = ID_BUTTON;
buf->private_data.adv_dlg = dlg;
......
count = buf->size.w;
/* create down button */
buf = create_themeicon_button(current_theme->DOWN_Icon, pwindow->dst,
NULL, WF_RESTORE_BACKGROUND);
buf = create_themeicon_button(current_theme->down_icon, pwindow->dst,
NULL, WF_RESTORE_BACKGROUND);
buf->id = ID_BUTTON;
buf->private_data.adv_dlg = dlg;
......
if (create_scrollbar) {
/* create vscrollbar */
buf = create_vertical(current_theme->Vertic, pwindow->dst,
adj_size(10), WF_RESTORE_BACKGROUND);
buf = create_vertical(current_theme->vertic, pwindow->dst,
adj_size(10), WF_RESTORE_BACKGROUND);
buf->id = ID_SCROLLBAR;
buf->private_data.adv_dlg = dlg;
......
if (create_buttons) {
/* create up button */
buf = create_themeicon_button(current_theme->LEFT_Icon, pwindow->dst, NULL, 0);
buf = create_themeicon_button(current_theme->left_icon, pwindow->dst, NULL, 0);
buf->id = ID_BUTTON;
buf->data.ptr = (void *)dlg;
......
count = buf->size.h;
/* create down button */
buf = create_themeicon_button(current_theme->RIGHT_Icon, pwindow->dst, NULL, 0);
buf = create_themeicon_button(current_theme->right_icon, pwindow->dst, NULL, 0);
buf->id = ID_BUTTON;
buf->data.ptr = (void *)dlg;
......
if (create_scrollbar) {
/* create vscrollbar */
buf = create_horizontal(current_theme->Horiz, pwindow->dst,
width, WF_RESTORE_BACKGROUND);
buf = create_horizontal(current_theme->horiz, pwindow->dst,
width, WF_RESTORE_BACKGROUND);
buf->id = ID_SCROLLBAR;
buf->data.ptr = (void *)dlg;
client/gui-sdl2/widget_window.c
SDL_Rect area;
if (get_wflags(pwindow) & WF_DRAW_FRAME_AROUND_WIDGET) {
area.x = current_theme->FR_Left->w;
area.y = current_theme->FR_Top->h;
area.w = pwindow->size.w - current_theme->FR_Left->w - current_theme->FR_Right->w;
area.h = pwindow->size.h - current_theme->FR_Top->h - current_theme->FR_Bottom->h;
area.x = current_theme->fr_left->w;
area.y = current_theme->fr_top->h;
area.w = pwindow->size.w - current_theme->fr_left->w - current_theme->fr_right->w;
area.h = pwindow->size.h - current_theme->fr_top->h - current_theme->fr_bottom->h;
} else {
area = pwindow->size;
}
......
pwindow->mod = KMOD_NONE;
if (get_wflags(pwindow) & WF_DRAW_FRAME_AROUND_WIDGET) {
w += current_theme->FR_Left->w + current_theme->FR_Right->w;
h += current_theme->FR_Top->h + current_theme->FR_Bottom->h;
w += current_theme->fr_left->w + current_theme->fr_right->w;
h += current_theme->fr_top->h + current_theme->fr_bottom->h;
}
if (title != NULL) {
client/gui-sdl2/wldlg.c
*progress = 100;
}
icon = create_bcgnd_surf(current_theme->Edit, 0, adj_size(120), adj_size(30));
icon = create_bcgnd_surf(current_theme->edit, 0, adj_size(120), adj_size(30));
if (width) {
SDL_Rect dst = {2,1,0,0};
......
/* --------------------------- */
/* Commit Widget */
buf = create_themeicon(current_theme->OK_Icon, pwindow->dst, WF_RESTORE_BACKGROUND);
buf = create_themeicon(current_theme->ok_icon, pwindow->dst, WF_RESTORE_BACKGROUND);
buf->action = ok_worklist_editor_callback;
set_wstate(buf, FC_WS_NORMAL);
......
add_to_gui_list(ID_BUTTON, buf);
/* --------------------------- */
/* Cancel Widget */
buf = create_themeicon(current_theme->CANCEL_Icon, pwindow->dst,
WF_RESTORE_BACKGROUND);
buf = create_themeicon(current_theme->cancel_icon, pwindow->dst,
WF_RESTORE_BACKGROUND);
buf->action = popdown_worklist_editor_callback;
set_wstate(buf, FC_WS_NORMAL);
    (1-1/1)