public override void UpdateItemsToBeDrawn() { Items.Clear(); var rect = Window.ClientRectangle; var button_color = Color.FromArgb(0xff, 0x00, 0x00, 0x80); var helpTextBox = CreateHelpTextBox(); helpTextBox.Left = 840; helpTextBox.Top = 100; helpTextBox.Width = 150; helpTextBox.Height = 400; // helpTextBox.Left = 0; // helpTextBox.Top = 0; Items.Add(helpTextBox); var title_label = new EigoTestLabelItem() { MarginTop = 30f, MarginBottom = 30f, Color = button_color, BackColor = Color.FromArgb(0xff, 0xb0, 0xc4, 0xde), BorderLine = true, Text = Daimon.Name, Height = 56f, }; title_label.Font = EPuzzleFonts.GetFont("Arial", (int)(title_label.Height / 2f)); title_label.MarginLeft = title_label.MarginRight = 300f; Items.Add(title_label); // 前の問題ドキュメントへ遷移するボタン var previousMondaiDocumentButton = new EigoTestButtonItem() { Position = DrawingObjectPosition.Absolute, Left = 800, Top = 10, Width = 40, Height = 40, Text = "↑", Name = "PreviousMondaiDocumentButton", IsVisible = Daimon.Parent.PreviousItem != null, IsClickable = Daimon.Parent.PreviousItem != null, HelpText = "前の問題ファイルに移動します。", }; previousMondaiDocumentButton.Click += (sender, e) => { if (e.Info.Button != MouseButtons.Left) return; OnActionUp(); }; Items.Add(previousMondaiDocumentButton); // 次の問題ドキュメントへ遷移するボタン var nextMondaiDocumentButton = new EigoTestButtonItem() { Position = DrawingObjectPosition.Absolute, Left = 850, Top = 10, Width = 40, Height = 40, Text = "↓", Name = "NextMondaiDocumentButton", IsVisible = Daimon.Parent.NextItem != null, IsClickable = Daimon.Parent.NextItem != null, HelpText = "次の問題ファイルに移動します。", }; nextMondaiDocumentButton.Click += (sender, e) => { if (e.Info.Button != MouseButtons.Left) return; OnActionDown(); }; Items.Add(nextMondaiDocumentButton); // 問題ドキュメントメニューへ遷移するボタン var mondaiDocumentMenuButton = new EigoTestButtonItem() { Position = DrawingObjectPosition.Absolute, Left = 900, Top = 10, Width = 40, Height = 40, Text = "=", Name = "MondaiMenuButton", HelpText = "問題ファイルの選択メニューに戻ります。", }; mondaiDocumentMenuButton.Click += (sender, e) => { MoveToMondaiDocumentMenuState(); }; Items.Add(mondaiDocumentMenuButton); // タイトルに戻るボタン _back_button = new EigoTestButtonItem() { Position = DrawingObjectPosition.Absolute, Left = 950, Top = 10, Width = 40, Height = 40, Text = "T", Name = "タイトル画面に戻る", HelpText = "タイトル画面に戻ります。", }; _back_button.Font = EPuzzleFonts.GetMsGothic((int)(_back_button.Height / 2f)); _back_button.Click += (sender, e) => { MoveToStartGameState(); }; Items.Add(_back_button); // 成績グラフ _kirokuBox = new KirokuBox2() { Position = DrawingObjectPosition.Absolute, Left = 10, Top = 100, Width = 180, Height = 180, UserInfo = Window.EPuzzleData.CurrentUserInfo, Chumon = (Chumon)Daimon.Items.First(), }; Items.Add(_kirokuBox); _kirokuInfoBox = new KirokuInfoBox() { Position = DrawingObjectPosition.Absolute, Left = 50, Top = 300, Width = 160, Height = 200, UserInfo = Window.EPuzzleData.CurrentUserInfo, Chumon = (Chumon)Daimon.Items.First(), }; Items.Add(_kirokuInfoBox); var chumonButtonHeight = 36; var chumonButtonWidth = 600; _helpWithScroll.Items = Daimon.Items.OfType<Chumon>().ToArray(); _chumonButtons = _helpWithScroll.GetItemsToBeShown().Select(x => { var mondaiResult = Window.EPuzzleData.CurrentUserInfo.MondaiResults.GetBest(x.Id); var shoyou = null == mondaiResult ? TimeSpan.Zero : mondaiResult.所要時間; // var button = new ChumonButton(new MondaiJirushi(Window.EPuzzleData.CurrentUserInfo, x), Window.EPuzzleData.CurrentUserInfo) var button = new ChumonButton(Window.EPuzzleData.CurrentUserInfo, x) { Color = button_color, BackColor = Color.FromArgb(0xff, 0xb0, 0xc4, 0xde), Height = chumonButtonHeight, Size = new SizeF(chumonButtonWidth, chumonButtonHeight), }; button.MarginLeft = button.MarginRight = (DrawingObjectRoot.Width - chumonButtonWidth) / 2f; button.Font = EPuzzleFonts.GetFont("Arial", (int)(button.Height / 2f)); return button; }).ToArray(); foreach (var chumonButton in _chumonButtons) { Items.Add(chumonButton); } // 発音問題ボタンを追加する /* if (Window.EPuzzleData.発音問題を有効にする) { var chumonCreator = new ChumonCreator(Window.EPuzzleData.PronunciationInfoContainer); foreach (var chumonButton in _chumonButtons) { var proChumon = chumonCreator.GetPronunciationChumon(chumonButton.Chumon); if (null == proChumon) continue; var button = new EigoTestButtonItem() { Position = DrawingObjectPosition.Absolute, Left = chumonButton.BorderRight + 10, Top = chumonButton.BorderTop, Width = chumonButton.Height, Height = chumonButton.Height, Text = "P", Name = "pron-mondai", Tag = proChumon, BorderLine = true, }; Items.Add(button); } }*/ // 次のDaimonへ遷移するボタン var nextButtonSize = new SizeF(30, 45); if (null != Daimon.NextItem) { var nextDaimonButton = new NextButton() { Position = DrawingObjectPosition.Absolute, Color = button_color, BackColor = Color.FromArgb(0xff, 0xb0, 0xc4, 0xde), Location = new PointF(Window.ClientRectangle.Width - nextButtonSize.Width - 10, Window.ClientRectangle.Height / 2 - nextButtonSize.Height / 2), Size = nextButtonSize, Name = "NextDaimon", }; nextDaimonButton.Click += (sender, e) => { if (e.Info.Button != MouseButtons.Left) return; MoveToNextDaimon(); // OnActionRight(); }; Items.Add(nextDaimonButton); } // 前のDaimonへ遷移するボタン if (null != Daimon.PreviousItem) { var previousButton = new PreviousButton() { Position = DrawingObjectPosition.Absolute, Color = button_color, BackColor = Color.FromArgb(0xff, 0xb0, 0xc4, 0xde), Location = new PointF(10, Window.ClientRectangle.Height / 2 - nextButtonSize.Height / 2), Size = nextButtonSize, Name = "PreviousDaimon", }; previousButton.Click += (sender, e) => { if (e.Info.Button != MouseButtons.Left) return; MoveToPreviousDaimon(); // OnActionLeft(); }; Items.Add(previousButton); } if (_helpWithScroll.NeedToShowButtonToScrollUp) { var upButton = new EigoTestButtonItem() { Position = DrawingObjectPosition.Absolute, Left = 800, Top = 10, Width = 80, Height = 40, Text = "↑ " + _helpWithScroll.NumberOfUpperItems, Name = "upButton", IsVisible = true, IsClickable = true, }; Items.Add(upButton); upButton.水平方向に中央揃え(); } if (_helpWithScroll.NeedToShowButtonToScrollDown) { var downButton = new EigoTestButtonItem() { Position = DrawingObjectPosition.Absolute, Left = 800, Top = 718, Width = 80, Height = 40, Text = "↓ " + _helpWithScroll.NumberOfLowerItems, Name = "downButton", IsVisible = true, IsClickable = true, }; Items.Add(downButton); downButton.水平方向に中央揃え(); } { var label = CreateLabelToShowNumberOfQuestionsThatHaveBeenFinished(); label.Top -= 100f; Items.Add(label); } var daimons = Daimon.Parent.Items.OfType<Daimon>().ToArray(); var daimonIndex = daimons.GetIndexOf(x => object.ReferenceEquals(x, Daimon)); var daimonButtonBox = new DaimonButtonBox(daimons, daimonIndex, Window.EPuzzleData.CurrentUserInfo) { Position = DrawingObjectPosition.Absolute, MarginBottom = 30f, }; Items.Add(daimonButtonBox); daimonButtonBox.水平方向に中央揃え(); daimonButtonBox.下揃え(); LockButtons(); CurrentItemにロックされていない最後の問題を設定する(); }
public override void UpdateItemsToBeDrawn() { _tutor.もっとやる係数を適正値に修正(); var currentItemInfo = SaveCurrentItem(); Items.Clear(); CurrentItem = null; var userInfo = Window.EPuzzleData.CurrentUserInfo; var chumonButtonBox = new DrawingObjectContainer() { Position = DrawingObjectPosition.Absolute, Left = 300, Top = 60, }; Items.Add(chumonButtonBox); var buttonColor = Color.FromArgb(0xff, 0x00, 0x00, 0x80); var buttonBackColor = Color.FromArgb(0xff, 0xb0, 0xc4, 0xde); var chumonButtonHeight = 36; var chumonButtonWidth = 714; _helpWithScroll = GetScrollHelper(_sortType); _helpWithScroll.Items = GetChumons(_tutor, _sortType); foreach (var chumon in _helpWithScroll.GetItemsToBeShown()) { var chumonButton = new ChumonButton(userInfo, chumon, true) { Color = buttonColor, BackColor = buttonBackColor, Width = chumonButtonWidth, Height = chumonButtonHeight, }; chumonButtonBox.Items.Add(chumonButton); } if (_helpWithScroll.NeedToShowButtonToScrollUp) { var upButton = new EigoTestButtonItem() { Position = DrawingObjectPosition.Absolute, Left = DrawingObjectRoot.Width - (80 + 10), Top = 15, Width = 80, Height = 40, Text = "↑ " + _helpWithScroll.NumberOfUpperItems, Name = "upButton", IsVisible = true, IsClickable = true, }; Items.Add(upButton); // upButton.水平方向に中央揃え(); } if (_helpWithScroll.NeedToShowButtonToScrollDown) { var downButton = new EigoTestButtonItem() { Position = DrawingObjectPosition.Absolute, Left = DrawingObjectRoot.Width - (80 + 10), Top = DrawingObjectRoot.Height - (40 + 10), Width = 80, Height = 40, Text = "↓ " + _helpWithScroll.NumberOfLowerItems, Name = "downButton", IsVisible = true, IsClickable = true, }; Items.Add(downButton); // downButton.水平方向に中央揃え(); } var xxx = !chumonButtonBox.Items.Any(); var mottoyaruButton = new EigoTestButtonItem() { Position = DrawingObjectPosition.Absolute, Left = 10, Top = 500, Width = 160, Height = 40, Text = string.Format("もっとやる ({0}回目)", もっとやる係数), Name = "mottoyaruButton", IsVisible = xxx, IsClickable = xxx, }; Items.Add(mottoyaruButton); /* var orderByGradeStringsButton = new EigoTestButtonItem() { Position = DrawingObjectPosition.Absolute, Left = 854, Top = 10, Width = 160, Height = 40, Name = "orderByGradeStringsButton", Text = OrderByGradeStrings ? "最新の成績順" : "復習猶予期間順", IsVisible = true, IsClickable = true, }; Items.Add(orderByGradeStringsButton);*/ var byGracePriodButton = new EigoTestButtonItem() { Position = DrawingObjectPosition.Absolute, Left = 300, Top = 15, Width = 160, Height = 40, Name = "byGracePriodButton", Text = "猶予順", IsVisible = true, IsClickable = TutorStateSortType.GracePriod != _sortType, ChangeColorWhenUnclickable = true, }; Items.Add(byGracePriodButton); var byDateYouDidThemButton = new EigoTestButtonItem() { Position = DrawingObjectPosition.Absolute, Left = 465, Top = 15, Width = 160, Height = 40, Name = "byDateYouDidThemButton", Text = "試験順", IsVisible = true, IsClickable = TutorStateSortType.DateYouDidThem != _sortType, ChangeColorWhenUnclickable = true, }; Items.Add(byDateYouDidThemButton); var byGradeButton = new EigoTestButtonItem() { Position = DrawingObjectPosition.Absolute, Left = 630, Top = 15, Width = 160, Height = 40, Name = "byGradeButton", Text = "成績順", IsVisible = true, IsClickable = TutorStateSortType.Grade != _sortType, ChangeColorWhenUnclickable = true, }; Items.Add(byGradeButton); var backToStartGameStateButton = new EigoTestButtonItem() { Position = DrawingObjectPosition.Absolute, Left = 10, Top = 10, Width = 160, Height = 40, Name = "backToStartGameStateButton", Text = "タイトルに戻る", IsVisible = true, IsClickable = true, }; Items.Add(backToStartGameStateButton); Items.Add(CreateLabelToShowNumberOfQuestionsThatHaveBeenFinished()); Items.Add(_kirokuBox); RestoreCurrentItem(currentItemInfo); if (null == CurrentItem) { CurrentItem = GetAllItems().OfType<ChumonButton>().FirstOrDefault(); } }