Mercurial > minori
comparison src/dialog/information.cpp @ 1:1ae666fdf9e2
*: initial commit
| author | Paper <mrpapersonic@gmail.com> | 
|---|---|
| date | Tue, 08 Aug 2023 19:49:15 -0400 | 
| parents | |
| children | 23d0d9319a00 | 
   comparison
  equal
  deleted
  inserted
  replaced
| 0:5a76e1b94163 | 1:1ae666fdf9e2 | 
|---|---|
| 1 #include "window.h" | |
| 2 #include "anime.h" | |
| 3 #include "information.h" | |
| 4 #include "ui_utils.h" | |
| 5 #include "string_utils.h" | |
| 6 | |
| 7 InformationDialog::InformationDialog(wxWindow* parent, wxWindowID id, const wxString& title, const Anime& anime, | |
| 8 const wxPoint& position, long style) | |
| 9 : wxDialog(parent, id, title, position, wxSize(840, 613), style) { | |
| 10 wxFont font; | |
| 11 this->SetBackgroundColour(*wxWHITE); | |
| 12 wxPanel* left_panel = new wxPanel(this, wxID_ANY, wxPoint(0, 12), wxSize(170, 518)); | |
| 13 wxPanel* right_panel = new wxPanel(this, wxID_ANY, wxPoint(170, 12), wxSize(840-186, 518)); | |
| 14 right_panel->SetBackgroundColour(*wxWHITE); | |
| 15 wxTextCtrl* anime_title = new wxTextCtrl(right_panel, wxID_ANY, anime.title, wxPoint(0, 0), wxSize(840-186, 28), wxTE_LEFT | wxBORDER_NONE | wxTE_BESTWRAP | wxTE_READONLY | wxTE_MULTILINE | wxTE_NO_VSCROLL); | |
| 16 anime_title->SetForegroundColour(wxTheColourDatabase->Find("STEEL BLUE")); | |
| 17 font = anime_title->GetFont(); | |
| 18 font.SetPointSize(12); | |
| 19 anime_title->SetFont(font); | |
| 20 wxNotebook* notebook = new wxNotebook(right_panel, wxID_ANY, wxPoint(0, 35), wxSize(840-186, 518-35)); | |
| 21 notebook->SetBackgroundColour(*wxWHITE); | |
| 22 wxPanel* main_information_panel = new wxPanel(notebook, wxID_ANY, wxPoint(6, 6), wxDefaultSize); | |
| 23 UiUtils::CreateSelectableTextParagraph(main_information_panel, L"Alternative titles", L"-", 840-186-6-6, 15); | |
| 24 std::wstringstream details_data; | |
| 25 details_data << AnimeFormatToStringMap[anime.type] << "\n" | |
| 26 << anime.episodes << "\n" | |
| 27 << AnimeAiringToStringMap[anime.airing] << "\n" | |
| 28 << AnimeSeasonToStringMap[anime.season] << " " << int(anime.air_date.year()) << "\n" | |
| 29 << StringUtils::Implode(anime.genres, ", ") << "\n" | |
| 30 << anime.audience_score << "%\n"; | |
| 31 UiUtils::CreateTextParagraphWithLabels(main_information_panel, L"Details", L"Type:\nEpisodes:\nStatus:\nSeason:\nGenres:\nScore:", details_data.str().c_str(), 840-186-6-6, 94, 0, 50); | |
| 32 UiUtils::CreateSelectableTextParagraph(main_information_panel, L"Synopsis", anime.synopsis.c_str(), 840-186-6-6, 200, 0, 200); | |
| 33 | |
| 34 wxPanel* data_input_panel = new wxPanel(notebook, wxID_ANY, wxPoint(6, 6), wxDefaultSize); | |
| 35 | |
| 36 notebook->AddPage(main_information_panel, "Main information"); | |
| 37 notebook->AddPage(data_input_panel, "Anime list and settings"); | |
| 38 | |
| 39 } | 
