https://github.com/tsnsoft/dialogblocks_test
Пример простейшей визуальной программы с wxWidgets для DialogBlocks
https://github.com/tsnsoft/dialogblocks_test
cpp dialogblocks example wxwidgets
Last synced: about 9 hours ago
JSON representation
Пример простейшей визуальной программы с wxWidgets для DialogBlocks
- Host: GitHub
- URL: https://github.com/tsnsoft/dialogblocks_test
- Owner: tsnsoft
- License: mit
- Created: 2020-11-10T12:44:15.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-04-14T17:13:19.000Z (9 days ago)
- Last Synced: 2025-04-14T17:54:58.752Z (8 days ago)
- Topics: cpp, dialogblocks, example, wxwidgets
- Language: Batchfile
- Homepage:
- Size: 864 KB
- Stars: 5
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# DialogBlocks_test
Пример простейшей визуальной программы с wxWidgets для DialogBlocks
```
#include
#include "tsnsoft.xpm" // Иконка в формате xpm// Главное окно приложения
class MyFrame : public wxFrame {
public:
MyFrame() : wxFrame(nullptr, wxID_ANY, "Test", wxDefaultPosition, wxSize(300, 200)) {
SetIcon(tsnsoft_xpm); // Установка иконкиnew wxStaticText(this, wxID_ANY, wxT("Текстовая метка"), wxPoint(100, 30));
wxButton* button = new wxButton(this, wxID_ANY, wxT("Нажми меня!"),
wxPoint(100, 70), wxSize(100, 30)); // Создаём кнопкуbutton->Bind(wxEVT_BUTTON, &MyFrame::OnButtonClick, this); // Обработчик нажатия кнопки
}private:
void OnButtonClick(wxCommandEvent&) {
wxMessageBox(wxT("Привет! Это моя фраза!"), wxT("Сообщение"), wxOK | wxICON_INFORMATION, this);
}
};// Класс приложения
class MyApp : public wxApp {
public:
virtual bool OnInit() override {
MyFrame* frame = new MyFrame();
frame->Show(true);
frame->Centre();
return true;
}
};wxIMPLEMENT_APP(MyApp); // Создание точки входа в приложение
```