mirror of
https://github.com/tstellar/bygfoot.git
synced 2025-03-05 19:47:55 +01:00
included training camp
This commit is contained in:
parent
f07fe79012
commit
415cd9ba42
69
src/window.c
69
src/window.c
@ -45,6 +45,8 @@
|
||||
#include "option_gui.h"
|
||||
#include "options_interface.h"
|
||||
#include "support.h"
|
||||
#include "training.h"
|
||||
#include "training_interface.h"
|
||||
#include "transfer.h"
|
||||
#include "treeview.h"
|
||||
#include "treeview2.h"
|
||||
@ -234,7 +236,7 @@ window_show_help(gint page)
|
||||
|
||||
window_create(WINDOW_HELP);
|
||||
|
||||
sprintf(buf, "<span %s>Bygfoot Football Manager %s</span>\n(c) 2005 Győző Both (gyboth@bygfoot.com)\nhttp://bygfoot.sourceforge.net", const_app("string_help_window_program_name_attribute"), VERS);
|
||||
sprintf(buf, "<span %s>Bygfoot Football Manager %s</span>\n(c) %s Győző Both (gyboth@bygfoot.com)\nhttp://bygfoot.sourceforge.net", const_app("string_help_window_program_name_attribute"), VERS, YEAR);
|
||||
gtk_label_set_markup(GTK_LABEL(lookup_widget(window.help, "label_about")), buf);
|
||||
|
||||
treeview_show_contributors(
|
||||
@ -865,6 +867,15 @@ window_create(gint window_type)
|
||||
window.splash = create_window_splash();
|
||||
wind = window.splash;
|
||||
break;
|
||||
case WINDOW_TRAINING_CAMP:
|
||||
if(window.training_camp != NULL)
|
||||
g_warning("window_create: called on already existing window\n");
|
||||
else
|
||||
window.training_camp = create_window_training_camp();
|
||||
wind = window.training_camp;
|
||||
strcpy(buf, _("Training camp"));
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
if(window_type != WINDOW_FILE_CHOOSER)
|
||||
@ -901,3 +912,59 @@ window_destroy(GtkWidget **wind)
|
||||
|
||||
*wind = NULL;
|
||||
}
|
||||
|
||||
/* Show the training camp window for the current user. */
|
||||
void
|
||||
window_show_training_camp(void)
|
||||
{
|
||||
GtkEntry *tfCosts;
|
||||
GtkWidget *rb_camp1;
|
||||
GtkWidget *rb_camp2;
|
||||
GtkWidget *rb_camp3;
|
||||
GtkLabel *l_costs;
|
||||
GtkLabel *l_recreation;
|
||||
GtkLabel *l_training;
|
||||
GtkLabel *l_camp_points;
|
||||
GtkHScale *hs_recreation;
|
||||
GtkHScale *hs_training;
|
||||
GtkHScale *hs_camp_points;
|
||||
gchar buf[SMALL];
|
||||
|
||||
window_create(WINDOW_TRAINING_CAMP);
|
||||
|
||||
// Initialize entry costs
|
||||
sprintf(buf, "%d", COSTS_CAMP_1);
|
||||
tfCosts = GTK_ENTRY(lookup_widget(window.training_camp, "tf_costs"));
|
||||
gtk_entry_set_text (tfCosts, buf);
|
||||
|
||||
// Initialize radio group camp
|
||||
rb_camp1 = GTK_WIDGET(lookup_widget(window.training_camp, "rb_camp1"));
|
||||
rb_camp2 = GTK_WIDGET(lookup_widget(window.training_camp, "rb_camp2"));
|
||||
rb_camp3 = GTK_WIDGET(lookup_widget(window.training_camp, "rb_camp3"));
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(rb_camp1), TRUE);
|
||||
|
||||
//Initialize labels
|
||||
l_costs = GTK_LABEL(lookup_widget(window.training_camp, "l_costs"));
|
||||
l_recreation = GTK_LABEL(lookup_widget(window.training_camp, "l_recreation"));
|
||||
l_training = GTK_LABEL(lookup_widget(window.training_camp, "l_training"));
|
||||
l_camp_points = GTK_LABEL(lookup_widget(window.training_camp, "l_camp_points"));
|
||||
gtk_misc_set_alignment (GTK_MISC(l_costs), 0.0, 0.5);
|
||||
gtk_misc_set_alignment (GTK_MISC(l_recreation), 0.0, 0.5);
|
||||
gtk_misc_set_alignment (GTK_MISC(l_training), 0.0, 0.5);
|
||||
gtk_misc_set_alignment (GTK_MISC(l_camp_points), 0.0, 0.5);
|
||||
|
||||
//Initialize hScales
|
||||
hs_recreation = GTK_HSCALE(lookup_widget(window.training_camp, "hs_recreation"));
|
||||
hs_training = GTK_HSCALE(lookup_widget(window.training_camp, "hs_training"));
|
||||
hs_camp_points = GTK_HSCALE(lookup_widget(window.training_camp, "hs_camp_points"));
|
||||
gtk_range_set_range (GTK_RANGE(hs_recreation), CAMP_SCALE_MIN, CAMP_SCALE_MAX);
|
||||
gtk_range_set_range (GTK_RANGE(hs_training), CAMP_SCALE_MIN, CAMP_SCALE_MAX);
|
||||
gtk_range_set_range (GTK_RANGE(hs_camp_points), CAMP_SCALE_MIN, CAMP_SCALE_MAX);
|
||||
gtk_range_set_value (GTK_RANGE(hs_recreation), CAMP_SCALE_MIN);
|
||||
gtk_range_set_value (GTK_RANGE(hs_training), CAMP_SCALE_MIN);
|
||||
gtk_range_set_value (GTK_RANGE(hs_camp_points), CAMP_SCALE_MAX);
|
||||
gtk_scale_set_digits (GTK_SCALE(hs_recreation), 0);
|
||||
gtk_scale_set_digits (GTK_SCALE(hs_training), 0);
|
||||
gtk_scale_set_digits (GTK_SCALE(hs_camp_points), 0);
|
||||
gtk_widget_set_sensitive (GTK_WIDGET(hs_camp_points), FALSE);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user