Программы на C++. Форум разработчиков
-
Anonymous
Ошибка переопределения на функциях виртуальных событий с помощью wxwidgets
Сообщение
Anonymous »
класс MainScreen.hpp < /p>
Код: Выделить всё
#ifndef MAINSCREEN_HPP
#define MAINSCREEN_HPP
#include ...
class MainScreen : public wxFrame
{
private:
protected:...
// Virtual event handlers, override them in your derived class
virtual void open_clients_window( wxCommandEvent& event ) { event.Skip(); }
public:
MainScreen( wxWindow* parent,...
< /code>
class mainscreen.cpp < /p>
#include "MainScreen.hpp"
const int BTN_CLIENTS_ID = 1;
MainScreen::MainScreen( wxWindow* parent, ...
// Connect Events
btn_clients->Bind(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainScreen::open_clients_window ), this, BTN_CLIENTS_ID);
}
void MainScreen::open_clients_window( wxCommandEvent& event ) {
std::cout
Я попробовал: < /p>
#pragma once
< /code>
и < /p>
#ifndef MAINSCREEN_HPP
#define MAINSCREEN_HPP
..
#endif
Ожидается, что ошибка исчезнет, поскольку определение не должно дублировать
Подробнее здесь:
https://stackoverflow.com/questions/797 ... -wxwidgets
1755528833
Anonymous
класс MainScreen.hpp < /p>
[code]#ifndef MAINSCREEN_HPP
#define MAINSCREEN_HPP
#include ...
class MainScreen : public wxFrame
{
private:
protected:...
// Virtual event handlers, override them in your derived class
virtual void open_clients_window( wxCommandEvent& event ) { event.Skip(); }
public:
MainScreen( wxWindow* parent,...
< /code>
class mainscreen.cpp < /p>
#include "MainScreen.hpp"
const int BTN_CLIENTS_ID = 1;
MainScreen::MainScreen( wxWindow* parent, ...
// Connect Events
btn_clients->Bind(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainScreen::open_clients_window ), this, BTN_CLIENTS_ID);
}
void MainScreen::open_clients_window( wxCommandEvent& event ) {
std::cout
Я попробовал: < /p>
#pragma once
< /code>
и < /p>
#ifndef MAINSCREEN_HPP
#define MAINSCREEN_HPP
..
#endif
[/code]
Ожидается, что ошибка исчезнет, поскольку определение не должно дублировать
Подробнее здесь: [url]https://stackoverflow.com/questions/79738638/redefinition-error-on-virtual-event-functions-with-wxwidgets[/url]