Beispiel #1
0
        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;
        }
Beispiel #2
0
        public static void InitializeEngine(ContentManager content, GraphicsDeviceManager graphics, Game game)
        {
            EventManager = new EventManager();
            Config = IO.Serialization.LoadConfigFile("config.xml");
            Config.SetGraphics(graphics);
            LangCenter = new LanguageLoader(graphics.GraphicsDevice);
            ParticleEngine = new ParticleEngine(content,game);
            RessourceProvider.Fill(content, game);

            SoundCenter = SoundCenter.Instance;
            DisplayStack = new LayoutStack<IBasicLayout>();
            InputDevice = new InputDevice();
            GamePadState = new GamePadState[4];

            PrimaryHeightOfWindows = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height;
            PrimaryWidthOfWindows = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width;
        }
Beispiel #3
0
        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());
        }
Beispiel #4
0
        public ProtoActivity_Editing_Layout(ProtoActivity protoActivity, ProtoActivity_Database database, ActivityDatabase activityDatabase, LayoutStack layoutStack)
        {
            this.protoActivity    = protoActivity;
            this.database         = database;
            this.activityDatabase = activityDatabase;
            this.activityDatabase.ActivityAdded += ActivityDatabase_ActivityAdded;
            this.layoutStack  = layoutStack;
            this.textBox      = new Editor();
            this.textBox.Text = protoActivity.Text;

            Vertical_GridLayout_Builder gridBuilder = new Vertical_GridLayout_Builder();
            string titleText;

            if (protoActivity.Id >= 0)
            {
                titleText = "ProtoActivity #" + protoActivity.Id;
            }
            else
            {
                titleText = "New ProtoActivity";
            }
            gridBuilder.AddLayout(new TextblockLayout(titleText));
            gridBuilder.AddLayout(ScrollLayout.New(new TextboxLayout(this.textBox)));

            Button saveButton = new Button();

            saveButton.Text     = "Save";
            saveButton.Clicked += SaveButton_Clicked;

            Button promoteButton = new Button();

            promoteButton.Text     = "Promote to Activity";
            promoteButton.Clicked += PromoteButton_Clicked;

            Button splitButton = new Button();

            splitButton.Text     = "Split";
            splitButton.Clicked += SplitButton_Clicked;

            HelpButtonLayout helpButtonLayout = new HelpButtonLayout(new HelpWindowBuilder()
                                                                     .AddMessage("This screen allows you to edit " + titleText + ".")
                                                                     .AddMessage("Enter as much text as you like.")
                                                                     .AddMessage("To save your entry, either press Save or simply go back to another screen.")
                                                                     .AddMessage("  After you go back, if you later want to return to this same ProtoActivity, you will have to go to one of the screens for browsing existing ProtoActivities and then search for it.")
                                                                     .AddMessage("To turn this ProtoActivity into an Activity, press Promote to Activity.")
                                                                     .AddMessage("To delete this ProtoActivity, delete all of the text in the box and then either press Save or go back to a previous screen.")
                                                                     .AddLayout(new CreditsButtonBuilder(layoutStack)
                                                                                .AddContribution(ActRecContributor.AARON_SMITH, new DateTime(2019, 9, 16), "Pointed out that the promote-a-protoactivity button crashed if the text box was empty")
                                                                                .Build()
                                                                                )
                                                                     .Build()
                                                                     , layoutStack);

            LayoutChoice_Set buttonsLayout = new Horizontal_GridLayout_Builder()
                                             .AddLayout(new ButtonLayout(saveButton))
                                             .AddLayout(new ButtonLayout(promoteButton))
                                             .AddLayout(new ButtonLayout(splitButton))
                                             .AddLayout(helpButtonLayout)
                                             .BuildAnyLayout();

            gridBuilder.AddLayout(buttonsLayout);

            this.SubLayout = gridBuilder.Build();
        }
        public DataExportView(ActivityRecommender activityRecommender, Persona persona, LayoutStack layoutStack)
        {
            this.SetTitle("Export Your Data");

            this.persona = persona;


            this.exportButton          = new Button();
            this.exportButton.Clicked += ExportButton_Clicked;

            this.activityRecommender = activityRecommender;
            this.layoutStack         = layoutStack;

            this.SetupView();
            this.persona.NameChanged += Persona_NameChanged;
        }
Beispiel #6
0
 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);
 }
Beispiel #7
0
 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);
 }