예제 #1
0
/****************************************************************
... 
*****************************************************************/
void popup_rates_dialog(void)
{
  Position x, y;
  Dimension width, height;
  char buf[64];

  if (!can_client_issue_orders()) {
    return;
  }

  XtSetSensitive(main_form, FALSE);

  create_rates_dialog();
  
  XtVaGetValues(toplevel, XtNwidth, &width, XtNheight, &height, NULL);
  
  XtTranslateCoords(toplevel, (Position) width/10, (Position) height/10,
		    &x, &y);
  XtVaSetValues(rates_dialog_shell, XtNx, x, XtNy, y, NULL);

  my_snprintf(buf, sizeof(buf), _("%s max rate: %d%%"),
	      government_name_for_player(client.conn.playing),
	      get_player_bonus(client.conn.playing, EFT_MAX_RATES));
  xaw_set_label(rates_gov_label, buf);
  
  XtPopup(rates_dialog_shell, XtGrabNone);
}
예제 #2
0
파일: gamedlgs.c 프로젝트: jheusala/freeciv
/****************************************************************
  Popup rates dialog
*****************************************************************/
void popup_rates_dialog(void)
{
  char buf[64];

  if (!can_client_issue_orders()) {
    return;
  }

  if (!rates_dialog_shell) {
    rates_dialog_shell = create_rates_dialog();
  }
  if (!rates_dialog_shell) {
    return;
  }

  fc_snprintf(buf, sizeof(buf), _("%s max rate: %d%%"),
      government_name_for_player(client.conn.playing),
      get_player_bonus(client.conn.playing, EFT_MAX_RATES));
  gtk_label_set_text(GTK_LABEL(rates_gov_label), buf);
  gtk_range_set_fill_level(GTK_RANGE(rates_tax_scale),
                           get_player_bonus(client.conn.playing,
                                            EFT_MAX_RATES)/10);
  gtk_range_set_fill_level(GTK_RANGE(rates_lux_scale),
                           get_player_bonus(client.conn.playing,
                                            EFT_MAX_RATES)/10);
  gtk_range_set_fill_level(GTK_RANGE(rates_sci_scale),
                           get_player_bonus(client.conn.playing,
                                            EFT_MAX_RATES)/10);

  gtk_window_present(GTK_WINDOW(rates_dialog_shell));
}
예제 #3
0
/****************************************************************
... 
*****************************************************************/
void popup_rates_dialog(void)
{
  Position x, y;
  Dimension width, height;

  XtSetSensitive(main_form, FALSE);

  create_rates_dialog();
  
  XtVaGetValues(toplevel, XtNwidth, &width, XtNheight, &height, NULL);
  
  XtTranslateCoords(toplevel, (Position) width/10, (Position) height/10,
		    &x, &y);
  XtVaSetValues(rates_dialog_shell, XtNx, x, XtNy, y, NULL);
  
  XtPopup(rates_dialog_shell, XtGrabNone);
}