{"id":20697226,"url":"https://github.com/tsnsoft/dialogblocksconsoleapp","last_synced_at":"2026-05-08T04:45:02.486Z","repository":{"id":207772433,"uuid":"719991228","full_name":"tsnsoft/DialogBlocksConsoleApp","owner":"tsnsoft","description":"Пример консольной программы на C++ с использованием wxWidgets и DialogBlocks для Visual Studio 2022  и mingw64","archived":false,"fork":false,"pushed_at":"2025-07-12T09:57:01.000Z","size":16608,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-12T11:49:54.172Z","etag":null,"topics":["console","cpp","cross-platform","dialogblocks","linux","mingw64","visual-studio","windows","wxwidgets"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tsnsoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-11-17T10:44:00.000Z","updated_at":"2025-07-12T09:57:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"8114cf04-38bb-4f66-9eea-95294d88f286","html_url":"https://github.com/tsnsoft/DialogBlocksConsoleApp","commit_stats":null,"previous_names":["tsnsoft/dialogblocksconsoleapp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tsnsoft/DialogBlocksConsoleApp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsnsoft%2FDialogBlocksConsoleApp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsnsoft%2FDialogBlocksConsoleApp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsnsoft%2FDialogBlocksConsoleApp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsnsoft%2FDialogBlocksConsoleApp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tsnsoft","download_url":"https://codeload.github.com/tsnsoft/DialogBlocksConsoleApp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsnsoft%2FDialogBlocksConsoleApp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32767591,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T02:36:36.067Z","status":"ssl_error","status_checked_at":"2026-05-08T02:36:07.210Z","response_time":54,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["console","cpp","cross-platform","dialogblocks","linux","mingw64","visual-studio","windows","wxwidgets"],"created_at":"2024-11-17T00:17:13.284Z","updated_at":"2026-05-08T04:45:02.478Z","avatar_url":"https://github.com/tsnsoft.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DialogBlocksConsoleApp\nПример консольной программы на C++ с использованием wxWidgets и DialogBlocks для Visual Studio 2022 и mingw64\n\n![srcreenshot](screenshot.png)\n\n```\n#include \u003cwx/wx.h\u003e\n#include \u003cwx/file.h\u003e\n#include \u003cwx/dir.h\u003e\n#include \u003cwx/textfile.h\u003e\n\nint main(int argc, char** argv)\n{\n\tsetlocale(LC_ALL, \"ru_RU.UTF-8\"); // Установить русскую локаль для Linux\n\twxLocale m_locale; // Создать объект локали для wxWidgets\n\tm_locale.Init(wxLANGUAGE_RUSSIAN, wxLOCALE_DONT_LOAD_DEFAULT); // Установить локаль для wxWidgets\n\n#ifdef __WXMSW__ // Определение для Windows\n\t_setmode(_fileno(stdout), _O_U16TEXT); // Установить Юникод для вывода в консоли Windows\n\t_setmode(_fileno(stdin), _O_U16TEXT); // Установить Юникод для ввода в консоли Windows\n\t_setmode(_fileno(stderr), _O_U16TEXT); // Установить Юникод для вывода ошибок в консоли Windows\n#endif\n\n\twxPuts(wxT(\"Замечательно! Das ist großartig! Wonderful! 精彩的！ رائع!\")); // Вывести строку\n\twxPuts(\"\"); // Вывести пустую строку\n\n\tstd::wstring input; // Создать строковую переменную\n\twxPrintf(wxT(\"Как вас зовут: \")); // Вывести строку\n\tstd::wcin \u003e\u003e input; // Считать строку\n\twxString result(input); // Создать строку\n\twxPuts(wxT(\"Здравствуйте, \") + result + wxT(\"!\")); // Вывести строку\n\n\twxPuts(\"\"); // Вывести пустую строку\n\n\twxPuts(wxGetHomeDir()); // Получить домашнюю директорию\n\twxPuts(wxGetOsDescription()); // Получить описание ОС\n\twxPuts(wxGetUserName()); // Получить имя пользователя\n\twxPuts(wxGetFullHostName()); // Получить полное имя хоста\n\twxPuts(\"\"); // Вывести пустую строку\n\n\twxString str1 = wxT(\"Linux\"); // Создать строку\n\twxString str2 = wxT(\"Operating\"); // Создать строку\n\twxString str3 = wxT(\"System - это круто!\"); // Создать строку\n\twxString str = str1 + wxT(\" \") + str2 + wxT(\" \") + str3; // Склеить строки\n\twxPuts(str); // Вывести строку\n\twxPuts(\"\"); // Вывести пустую строку\n\n\twxString str4 = wxT(\"The history of my life\"); // Создать строку\n\twxPuts(str4.MakeLower()); // Вывести строку в нижнем регистре\n\twxPuts(str4.MakeUpper()); // Вывести строку в верхнем регистре\n\twxPuts(\"\"); // Вывести пустую строку\n\n\twxDateTime now = wxDateTime::Now();\n    wxPrintf(wxT(\"   Tokyo: %s\\n\"), now.Format(wxT(\"%Y-%m-%d %H:%M:%S\"), wxDateTime::GMT9).c_str());\n   \twxPrintf(wxT(\"  Moscow: %s\\n\"), now.Format(wxT(\"%Y-%m-%d %H:%M:%S\"), wxDateTime::MSD).c_str()); // Вывести дату и время\n\twxPrintf(wxT(\"Budapest: %s\\n\"), now.Format(wxT(\"%Y-%m-%d %H:%M:%S\"), wxDateTime::CEST).c_str()); // Вывести дату и время\n\twxPrintf(wxT(\"  London: %s\\n\"), now.Format(wxT(\"%Y-%m-%d %H:%M:%S\"), wxDateTime::WEST).c_str()); // Вывести дату и время\n\twxPrintf(wxT(\"New York: %s\\n\"), now.Format(wxT(\"%Y-%m-%d %H:%M:%S\"), wxDateTime::EDT).c_str()); // Вывести дату и время\n\twxPuts(\"\"); // Вывести пустую строку\n\n\twxString str5 = wxT(\"The history of my life\"); // Создать строку\n\tif (str5.Contains(wxT(\"history\"))) { // Проверить наличие подстроки\n\t\twxPuts(wxT(\"Contains!\")); // Вывести строку\n\t}\n\tif (!str5.Contains(wxT(\"plain\"))) { // Проверить отсутствие подстроки\n\t\twxPuts(wxT(\"Does not contain!\")); // Вывести строку\n\t}\n\twxPuts(\"\"); // Вывести пустую строку\n\n\twxString str6 = wxT(\"You make me want to be a better man.\\n\"); // Создать строку\n\twxString str61 = wxT(\"Замечательно! Das ist großartig! Wonderful! 精彩的！ رائع!\\n\"); // Создать строку\n\twxFile file; // Файловая переменная\n\tfile.Create(wxT(\"quote.txt\"), true); // Создать файл\n\tif (file.IsOpened()) // Проверить открытие файла\n\t\twxPuts(wxT(\"the file is opened\")); // Вывести строку\n\tfile.Write(str6); // Записать строку в файл\n\tfile.Write(str61); // Записать строку в файл\n\tfile.Close(); // Закрыть файл\n\tif (!file.IsOpened()) // Проверить закрытие файла\n\t\twxPuts(wxT(\"the file is not opened\")); // Вывести строку\n\twxPuts(\"\"); // Вывести пустую строку\n\n\twxDateTime now2 = wxDateTime::Now(); // Получить текущую дату и время\n\twxString date2 = now2.Format(wxT(\"%B %d %Y\")); // Сформировать строку\n\twxPuts(date2); // Вывести строку\n\twxDateSpan span(0, 1); // Создать временной интервал (1 месяц)\n\twxDateTime then = now.Add(span); // Добавить интервал к текущей дате и времени\n\twxString date3 = then.Format(wxT(\"%B %d %Y\")); // Сформировать строку\n\twxPuts(date3); // Вывести строку\n\twxPuts(\"\"); // Вывести пустую строку\n\n\twxDateTime now4 = wxDateTime::Now(); // Получить текущую дату и время\n\twxString date11 = now4.Format(); // Сформировать строку\n\twxString date12 = now4.Format(wxT(\"%X\")); // Сформировать строку\n\twxString date13 = now4.Format(wxT(\"%x\")); // Сформировать строку\n\twxPuts(date11); // Вывести строку\n\twxPuts(date12); // Вывести строку\n\twxPuts(date13); // Вывести строку\n\twxPuts(\"\"); // Вывести пустую строку\n\n\twxDir dir(wxGetCwd()); // Создать объект директории\n\twxString file2; // Переменная для имени файла\n\tbool cont = dir.GetFirst(\u0026file2, wxEmptyString, wxDIR_FILES | wxDIR_DIRS); // Получить первый файл\n\twhile (cont) { // Пока есть файлы\n\t\twxPuts(file2); // Вывести имя файла\n\t\tcont = dir.GetNext(\u0026file2); // Получить следующий файл\n\t}\n\twxPuts(\"\"); // Вывести пустую строку\n\n\tint flowers = 21; // Создать целочисленную переменную\n\twxString str7; // Создать строковую переменную\n\tstr7.Printf(wxT(\"There are %d red roses.\"), flowers); // Сформировать строку\n\twxPuts(str7); // Вывести строку\n\twxPuts(\"\"); // Вывести пустую строку\n\n\twxString str8 = wxT(\"The history of my life\");\n\twxPrintf(wxT(\"The string has %d characters\\n\"), (int)str8.Len());\n\twxPuts(\"\"); // Вывести пустую строку\n\n\twxTextFile file7(wxT(\"quote.txt\"));\n\tfile7.Open();\n\twxPrintf(wxT(\"Number of lines: %d\\n\"), (int)file7.GetLineCount());\n\twxPrintf(wxT(\"First line: %s\\n\"), file7.GetFirstLine().c_str());\n\twxPrintf(wxT(\"Last line: %s\\n\"), file7.GetLastLine().c_str());\n\twxPuts(wxT(\"-------------------------------------\"));\n\twxString s;\n\tfor (s = file7.GetFirstLine(); !file7.Eof();\n\t\ts = file7.GetNextLine()) {\n\t\twxPuts(s);\n\t}\n\tfile7.Close();\n\twxPuts(\"\"); // Вывести пустую строку\n\n#ifdef __WXMSW__ // Определение для Windows\n\twxExecute(\"notepad.exe\"); // Выполнить команду\n#endif\n\n#ifdef __WXMSW__ // Определение для Windows\n\tsystem(\"pause\"); // Приостановить выполнение программы\n#else // Определение для Linux\n\tsystem(\"read -p \\\"Нажмите Enter для продолжения...\\\"  var\"); // Приостановить выполнение программы\n#endif\n\n\treturn 0;\n}\n```\n\n## Ссылки:\n\n__DialogBlocks:__ http://www.anthemion.co.uk/dialogblocks/\n\nhttps://www.wxwidgets.org/\n\nhttps://visualstudio.microsoft.com/ru/vs/community/\n\nhttp://www.anthemion.co.uk/dialogblocks/ImageBlocks-1.07-Setup.exe\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsnsoft%2Fdialogblocksconsoleapp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftsnsoft%2Fdialogblocksconsoleapp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsnsoft%2Fdialogblocksconsoleapp/lists"}