72 int lux,
int no_lux_scroll,
73 int sci,
int no_sci_scroll)
76 int tax_lock, lux_lock, sci_lock;
79 tax_lock = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(
rates_tax_toggle));
80 lux_lock = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(
rates_lux_toggle));
81 sci_lock = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(
rates_sci_toggle));
90 tax =
MIN(tax, maxrate);
91 lux =
MIN(lux, maxrate);
92 sci =
MIN(sci, maxrate);
94 if (tax + sci + lux != 100) {
97 lux =
MIN(
MAX(100 - tax - sci, 0), maxrate);
100 sci =
MIN(
MAX(100 - tax - lux, 0), maxrate);
104 tax =
MIN(
MAX(100 - lux - sci, 0), maxrate);
107 sci =
MIN(
MAX(100 - lux - tax, 0), maxrate);
111 lux =
MIN(
MAX(100 - tax - sci, 0), maxrate);
114 tax =
MIN(
MAX(100 - lux - sci, 0), maxrate);
118 if (tax + sci + lux != 100) {
136 if (strcmp(buf, gtk_label_get_text(GTK_LABEL(
rates_tax_label))) != 0) {
139 if (!no_tax_scroll) {
150 if (strcmp(buf, gtk_label_get_text(GTK_LABEL(
rates_lux_label))) != 0) {
153 if (!no_lux_scroll) {
164 if (strcmp(buf, gtk_label_get_text(GTK_LABEL(
rates_sci_label))) != 0) {
167 if (!no_sci_scroll) {
310 GtkWidget *
shell, *content;
311 GtkWidget *label, *scale;
314 shell = gtk_dialog_new_with_buttons(
_(
"Change policies"),
323 shell = gtk_dialog_new_with_buttons(
_(
"Policies"),
332 gtk_window_set_position(GTK_WINDOW(
shell), GTK_WIN_POS_MOUSE);
333 content = gtk_dialog_get_content_area(GTK_DIALOG(
shell));
336 label = gtk_label_new(
_(
"Changes will not take effect until next turn."));
337 gtk_box_pack_start( GTK_BOX( content ), label,
FALSE,
FALSE, 0);
348 scale = gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL,
358 G_CALLBACK(gtk_widget_destroyed),
360 gtk_box_pack_start( GTK_BOX( content ), label,
TRUE,
TRUE, 5 );
361 gtk_box_pack_start( GTK_BOX( content ), scale,
TRUE,
TRUE, 5 );
369 g_signal_connect(
shell,
"destroy",
372 g_signal_connect(
shell,
"response",
375 gtk_widget_show_all(content);
401 GtkWidget *
shell, *content;
402 GtkWidget *frame, *hgrid;
409 shell = gtk_dialog_new_with_buttons(
_(
"Select tax, luxury and science rates"),
418 gtk_dialog_set_default_response(GTK_DIALOG(
shell), GTK_RESPONSE_OK);
419 gtk_window_set_position(GTK_WINDOW(
shell), GTK_WIN_POS_MOUSE);
420 content = gtk_dialog_get_content_area(GTK_DIALOG(
shell));
425 frame = gtk_frame_new(
_(
"Tax") );
426 gtk_box_pack_start( GTK_BOX( content ), frame,
TRUE,
TRUE, 5 );
428 hgrid = gtk_grid_new();
429 gtk_grid_set_column_spacing(GTK_GRID(hgrid), 10);
430 gtk_container_add(GTK_CONTAINER(frame), hgrid);
433 gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL, 0, 10, 1);
435 for (i = 0; i <= 10; i++) {
450 frame = gtk_frame_new(
_(
"Luxury") );
451 gtk_box_pack_start( GTK_BOX( content ), frame,
TRUE,
TRUE, 5 );
453 hgrid = gtk_grid_new();
454 gtk_grid_set_column_spacing(GTK_GRID(hgrid), 10);
455 gtk_container_add(GTK_CONTAINER(frame), hgrid);
458 gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL, 0, 10, 1);
460 for (i = 0; i <= 10; i++) {
475 frame = gtk_frame_new(
_(
"Science") );
476 gtk_box_pack_start( GTK_BOX( content ), frame,
TRUE,
TRUE, 5 );
478 hgrid = gtk_grid_new();
479 gtk_grid_set_column_spacing(GTK_GRID(hgrid), 10);
480 gtk_container_add(GTK_CONTAINER(frame), hgrid);
483 gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL, 0, 10, 1);
485 for (i = 0; i <= 10; i++) {
501 g_signal_connect(
shell,
"response",
503 g_signal_connect(
shell,
"destroy",
506 gtk_widget_show_all(
shell);
bool can_client_issue_orders(void)