public ParticipationView(Participation participation, ScoreSummarizer ratingSummarizer, LayoutStack layoutStack, Engine engine, bool showCalculatedValues = true) { this.participation = participation; this.engine = engine; this.ratingSummarizer = ratingSummarizer; this.layoutStack = layoutStack; this.showCalculatedValues = showCalculatedValues; this.draw(); }
public Browse_RecentSignificantActivities_Layout(Engine engine, ScoreSummarizer scoreSummarizer, LayoutStack layoutStack) { this.SetTitle("Significant recent activities"); this.engine = engine; this.scoreSummarizer = scoreSummarizer; this.layoutStack = layoutStack; Button okButton = new Button(); okButton.Clicked += OkButton_Clicked; this.durationLayout = new DurationEntryView(); GridLayout_Builder gridBuilder = new Vertical_GridLayout_Builder().Uniform(); gridBuilder.AddLayout(new TextblockLayout("What changed your happiness most")); gridBuilder.AddLayout(new TitledControl("in the last:", durationLayout)); gridBuilder.AddLayout(new ButtonLayout(okButton, "OK")); this.SetContent(gridBuilder.Build()); }
public BrowseParticipations_Layout(ActivityDatabase activityDatabase, Engine engine, ScoreSummarizer scoreSummarizer, LayoutStack layoutStack) { this.activityDatabase = activityDatabase; this.engine = engine; this.layoutStack = layoutStack; this.scoreSummarizer = scoreSummarizer; TextblockLayout helpLayout = new TextblockLayout("Browse participations"); ActivityNameEntryBox categoryBox = new ActivityNameEntryBox("Category", activityDatabase, layoutStack, false, false); categoryBox.Placeholder("(Optional)"); this.categoryBox = categoryBox; this.sinceDate_box = new DateEntryView("Since", layoutStack, false); this.sinceDate_box.Placeholder("(Optional)"); this.displayRatings_box = new VisiPlacement.CheckBox("No", "Yes"); this.displayRatings_box.Checked = true; Thickness buttonMargin = new Thickness(0, 1); LayoutChoice_Set displayRatings_layout = new Horizontal_GridLayout_Builder() .Uniform() .AddLayout(new TextblockLayout("Show ratings?")) .AddLayout(new MustBorderLayout(null, this.displayRatings_box, buttonMargin)) .BuildAnyLayout(); this.requireComments_box = new VisiPlacement.CheckBox("No", "Yes"); this.requireComments_box.Checked = true; LayoutChoice_Set requireComments_layout = new Horizontal_GridLayout_Builder() .Uniform() .AddLayout(new TextblockLayout("Require comments?")) .AddLayout(new MustBorderLayout(null, this.requireComments_box, buttonMargin)) .BuildAnyLayout(); this.requireSuccessful_box = new VisiPlacement.SingleSelect(null, new List <string>() { "Any", "No Metric", "Successful", "Failed" }); LayoutChoice_Set requireSuccessful_layout = new Horizontal_GridLayout_Builder() .Uniform() .AddLayout(new TextblockLayout("Require success status =")) .AddLayout(new MustBorderLayout(null, this.requireSuccessful_box, buttonMargin)) .BuildAnyLayout(); this.sortBy_box = new VisiPlacement.SingleSelect(null, new List <string>() { this.sortByFun_text, this.sortBy_netPresentHappiness_text, this.sortByEfficiency_text }); LayoutChoice_Set sortBy_layout = new Horizontal_GridLayout_Builder() .Uniform() .AddLayout(new TextblockLayout("Sort by")) .AddLayout(new MustBorderLayout(null, this.sortBy_box, buttonMargin)) .BuildAnyLayout(); Button browseTopParticipations_button = new Button(); ButtonLayout browseTopParticipations_layout = new ButtonLayout(browseTopParticipations_button, "Top " + this.maxNumTopParticipationsToShow); browseTopParticipations_button.Clicked += BrowseTopParticipations_Button_Clicked; Button browseExtremeParticipations_button = new Button(); ButtonLayout browseExtremeParticipations_layout = new ButtonLayout(browseExtremeParticipations_button, "" + this.maxNumTopParticipationsToShow + " best/worst"); browseExtremeParticipations_button.Clicked += BrowseExtremeParticipations_button_Clicked; Button seeGoodRandomParticipation_button = new Button(); ButtonLayout seeGoodRandomParticipation_layout = new ButtonLayout(seeGoodRandomParticipation_button, "A random, probably good one"); seeGoodRandomParticipation_button.Clicked += SeeGoodRandomParticipation_Clicked; Button seeRandomParticipations_button = new Button(); ButtonLayout seeRandomParticipations_layout = new ButtonLayout(seeRandomParticipations_button, "" + this.maxNumRandomActivitiesToShow + " (uniformly) random"); seeRandomParticipations_button.Clicked += SeeRandomParticipations_button_Clicked; this.SubLayout = new Vertical_GridLayout_Builder() .AddLayout(helpLayout) .AddLayout(categoryBox) .AddLayout(sinceDate_box) .AddLayout(displayRatings_layout) .AddLayout(requireComments_layout) .AddLayout(requireSuccessful_layout) .AddLayout(sortBy_layout) .AddLayout( new Horizontal_GridLayout_Builder() .Uniform() .AddLayout(browseTopParticipations_layout) .AddLayout(browseExtremeParticipations_layout) .AddLayout(seeGoodRandomParticipation_layout) .AddLayout(seeRandomParticipations_layout) .BuildAnyLayout() ) .Build(); this.randomGenerator = new Random(); }
public SignificantActivity_Layout(string text, Activity activity, DateTime start, Engine engine, ScoreSummarizer scoreSummarizer, LayoutStack layoutStack) { this.engine = engine; this.activity = activity; this.start = start; this.scoreSummarizer = scoreSummarizer; this.layoutStack = layoutStack; Button button = new Button(); button.Clicked += Button_Clicked; ButtonLayout buttonLayout = new ButtonLayout(button, text); this.SubLayout = buttonLayout; }
public ListParticipations_Layout(List <Participation> participations, Engine engine, ScoreSummarizer scoreSummarizer, LayoutStack layoutStack) { this.participations = participations; this.engine = engine; this.scoreSummarizer = scoreSummarizer; this.layoutStack = layoutStack; this.initialize(true); }
public ListParticipations_Layout(List <Participation> participations, bool showRatings, Engine engine, ScoreSummarizer scoreSummarizer, LayoutStack layoutStack, Random randomGenerator) { this.participations = participations; this.engine = engine; this.scoreSummarizer = scoreSummarizer; this.layoutStack = layoutStack; this.randomGenerator = randomGenerator; this.initialize(showRatings); }