{"id":20697263,"url":"https://github.com/tsnsoft/dialogblocksfileconf","last_synced_at":"2025-03-11T02:49:53.823Z","repository":{"id":276112128,"uuid":"731113043","full_name":"tsnsoft/DialogBlocksFileconf","owner":"tsnsoft","description":"Пример консольной программы работы с файлом настроек на C++ с использованием wxWidgets и DialogBlocks в Visual Studio 2022","archived":false,"fork":false,"pushed_at":"2025-03-10T09:38:58.000Z","size":6878,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-10T10:28:41.899Z","etag":null,"topics":["config","console","file","settings","visual-studio","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}},"created_at":"2023-12-13T11:39:35.000Z","updated_at":"2025-03-10T09:39:01.000Z","dependencies_parsed_at":"2025-02-21T10:21:35.644Z","dependency_job_id":"d547079c-af73-4c29-ae34-1918ea4a9838","html_url":"https://github.com/tsnsoft/DialogBlocksFileconf","commit_stats":null,"previous_names":["tsnsoft/dialogblocksfileconf"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsnsoft%2FDialogBlocksFileconf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsnsoft%2FDialogBlocksFileconf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsnsoft%2FDialogBlocksFileconf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tsnsoft%2FDialogBlocksFileconf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tsnsoft","download_url":"https://codeload.github.com/tsnsoft/DialogBlocksFileconf/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242961747,"owners_count":20213315,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["config","console","file","settings","visual-studio","wxwidgets"],"created_at":"2024-11-17T00:17:20.374Z","updated_at":"2025-03-11T02:49:53.813Z","avatar_url":"https://github.com/tsnsoft.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DialogBlocksFileсonf\nПример консольной программы работы с файлом настроек на C++ с использованием wxWidgets и DialogBlocks в Visual Studio 2022\n\n![srcreenshot](screenshot1.png)\n\n![srcreenshot](screenshot2.png)\n\n```\n#include \u003cwx/wx.h\u003e\n#include \u003cwx/fileconf.h\u003e\n#include \u003cwx/stdpaths.h\u003e\n#include \u003cwx/filename.h\u003e\n#include \u003clocale\u003e\n#include \u003cmemory\u003e\n\n#ifdef __WXMSW__\n#include \u003cfcntl.h\u003e\n#include \u003cio.h\u003e\n#endif\n\nclass MyApp : public wxApp {\nprivate:\n    wxLocale m_locale; // Держим локаль в объекте класса\npublic:\n    virtual bool OnInit() override {\n        // Устанавливаем локаль для Unicode\n        setlocale(LC_ALL, \"ru_RU.UTF-8\");\n        m_locale.Init(wxLANGUAGE_RUSSIAN, wxLOCALE_DONT_LOAD_DEFAULT);\n\n        wxPuts(L\"Работа с файлом настроек\");\n\n        // Создаем имя файла конфигурации\n        wxFileName fn(wxStandardPaths::Get().GetExecutablePath());\n        fn.SetExt(\"ini\");\n\n        // Создаем объект конфигурации\n        auto m_fileconfig = std::make_unique\u003cwxFileConfig\u003e(\n            wxEmptyString, wxEmptyString, fn.GetFullPath(), wxEmptyString,\n            wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_NO_ESCAPE_CHARACTERS\n        );\n\n        wxConfigBase::Set(m_fileconfig.get());\n\n        wxConfigBase* conf = wxConfigBase::Get(false);\n        if (!conf) {\n            wxPuts(L\"Ошибка: объект конфигурации не создан!\");\n            return false;\n        }\n\n        conf-\u003eSetPath(L\"/settings\");\n        conf-\u003eWrite(L\"language_ru\", L\"русский\");\n\n        conf-\u003eSetPath(L\"/settings_add\");\n        conf-\u003eWrite(L\"language_en\", L\"английский\");\n        conf-\u003eWrite(L\"language_de\", L\"немецкий\");\n\n        wxPuts(conf-\u003eRead(L\"language_de\", L\"de ?\"));\n        wxPuts(conf-\u003eRead(L\"language_en\", L\"en ?\"));\n\n        conf-\u003eSetPath(L\"/settings\");\n        wxPuts(conf-\u003eRead(L\"language_ru\", L\"ru ?\"));\n\n        m_fileconfig-\u003eFlush(); // Сохраняем настройки\n\n        wxConfigBase::Set(nullptr); // Очищаем объект конфигурации\n\n        // Ожидание ввода без использования system()\n        wxPuts(L\"Нажмите Enter для выхода...\");\n        std::wcin.get();\n\n        return false; // Завершаем приложение\n    }\n};\n\n// Определяем точку входа вручную\nwxIMPLEMENT_APP_NO_MAIN(MyApp);\n\nint main(int argc, char** argv) {\n    wxInitializer initializer;\n    if (!initializer.IsOk()) {\n        wxPuts(L\"Ошибка: wxWidgets не инициализирован!\");\n        return -1;\n    }\n    return wxEntry(argc, argv);\n}\n```\n\n## Ссылки:\n\nhttp://www.anthemion.co.uk/dialogblocks/\n\n***Бесплатная лицензия на DialogBlocks:*** https://github.com/proffix4/dialogblocks_free\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%2Fdialogblocksfileconf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftsnsoft%2Fdialogblocksfileconf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftsnsoft%2Fdialogblocksfileconf/lists"}