expected ';' before 'dialog'

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Wanderer82
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 675
Joined: Tue Jul 26, 2016 2:00 pm

expected ';' before 'dialog'

Post by Wanderer82 »

Sorry, I have to start a thread again. This error is driving me nuts. I just want to open a dialog when clicking on a menu item. But always this error: expected ';' before 'dialog' is showing up. I had this before and somehow I managed to find my mistake or at least after fiddling around it suddenly worked; well, not this time. I just can't seem to find my mistake. Here's my code:

Main.cpp

Code: Select all

/***************************************************************
 * Name:      BehaveMain.cpp
 * Purpose:   Code for Application Frame
 * Author:    Thomas ()
 * Created:   2018-08-15
 * Copyright: Thomas ()
 * License:
 **************************************************************/

#include "BehaveMain.h"
#include <wx/msgdlg.h>
#include <fstream>
#include <iostream>
#include <string>
#include <sstream>
#include "Belohnung.h"
#include "wx/textdlg.h"

using namespace std;

string int_to_string(int Wert_int)
{
    ostringstream Str_Wert;
    Str_Wert << Wert_int;
    string Wert_string(Str_Wert.str());
    return Wert_string;
}

int SuS = 0;
string SuS_string = int_to_string(SuS);
int Total = 0;
int Kugeln = 3;

extern int Belohnung_Anzahl;

//(*InternalHeaders(BehaveFrame)
#include <wx/bitmap.h>
#include <wx/font.h>
#include <wx/intl.h>
#include <wx/image.h>
#include <wx/string.h>
//*)

//helper functions
enum wxbuildinfoformat {
    short_f, long_f };

wxString wxbuildinfo(wxbuildinfoformat format)
{
    wxString wxbuild(wxVERSION_STRING);

    if (format == long_f )
    {
#if defined(__WXMSW__)
        wxbuild << _T("-Windows");
#elif defined(__UNIX__)
        wxbuild << _T("-Linux");
#endif

#if wxUSE_UNICODE
        wxbuild << _T("-Unicode build");
#else
        wxbuild << _T("-ANSI build");
#endif // wxUSE_UNICODE
    }

    return wxbuild;
}

//(*IdInit(BehaveFrame)
const long BehaveFrame::ID_STATICBITMAP1 = wxNewId();
const long BehaveFrame::ID_STATICTEXT1 = wxNewId();
const long BehaveFrame::ID_GAUGE1 = wxNewId();
const long BehaveFrame::ID_STATICTEXT2 = wxNewId();
const long BehaveFrame::ID_BITMAPBUTTON1 = wxNewId();
const long BehaveFrame::ID_BITMAPBUTTON2 = wxNewId();
const long BehaveFrame::ID_BITMAPBUTTON3 = wxNewId();
const long BehaveFrame::ID_BUTTON1 = wxNewId();
const long BehaveFrame::ID_BUTTON2 = wxNewId();
const long BehaveFrame::ID_SCROLLEDWINDOW1 = wxNewId();
const long BehaveFrame::ID_STATICBITMAP2 = wxNewId();
const long BehaveFrame::ID_STATICTEXT3 = wxNewId();
const long BehaveFrame::ID_GAUGE2 = wxNewId();
const long BehaveFrame::ID_STATICTEXT4 = wxNewId();
const long BehaveFrame::ID_PANEL1 = wxNewId();
const long BehaveFrame::Belohnung = wxNewId();
const long BehaveFrame::idMenuQuit = wxNewId();
const long BehaveFrame::idMenuAbout = wxNewId();
//*)

BEGIN_EVENT_TABLE(BehaveFrame,wxFrame)
    //(*EventTable(BehaveFrame)
    //*)
END_EVENT_TABLE()

BehaveFrame::BehaveFrame(wxWindow* parent,wxWindowID id)
{
    //(*Initialize(BehaveFrame)
    wxBoxSizer* BoxSizer4;
    wxBoxSizer* BoxSizer6;
    wxBoxSizer* BoxSizer5;
    wxBoxSizer* BoxSizer10;
    wxBoxSizer* BoxSizer7;
    wxBoxSizer* BoxSizer8;
    wxMenuItem* MenuItem2;
    wxMenuItem* MenuItem1;
    wxBoxSizer* BoxSizer2;
    wxBoxSizer* BoxSizer11;
    wxMenu* Menu1;
    wxBoxSizer* BoxSizer1;
    wxBoxSizer* BoxSizer9;
    wxMenuBar* MenuBar1;
    wxBoxSizer* BoxSizer3;
    wxMenu* Menu2;

    Create(parent, wxID_ANY, _("Wall-Behave"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE, _T("wxID_ANY"));
    BoxSizer1 = new wxBoxSizer(wxHORIZONTAL);
    Panel1 = new wxPanel(this, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("ID_PANEL1"));
    BoxSizer2 = new wxBoxSizer(wxVERTICAL);
    ScrolledWindow1 = new wxScrolledWindow(Panel1, ID_SCROLLEDWINDOW1, wxDefaultPosition, wxDefaultSize, wxVSCROLL|wxHSCROLL, _T("ID_SCROLLEDWINDOW1"));
    BoxSizer4 = new wxBoxSizer(wxVERTICAL);
    BoxSizer5 = new wxBoxSizer(wxVERTICAL);
    BoxSizer6 = new wxBoxSizer(wxHORIZONTAL);
    BoxSizer6->Add(150,20,0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
    StaticBitmap1 = new wxStaticBitmap(ScrolledWindow1, ID_STATICBITMAP1, wxBitmap(wxImage(_T("C:\\Users\\Thomas\\Documents\\Programmprojekte\\Behave\\arrow-rose.png"))), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICBITMAP1"));
    BoxSizer6->Add(StaticBitmap1, 0, wxBOTTOM|wxALIGN_BOTTOM, 3);
    BoxSizer5->Add(BoxSizer6, 0, wxALL|wxEXPAND, 0);
    BoxSizer7 = new wxBoxSizer(wxHORIZONTAL);
    StaticText1 = new wxStaticText(ScrolledWindow1, ID_STATICTEXT1, _("Alexandrina"), wxDefaultPosition, wxSize(150,18), 0, _T("ID_STATICTEXT1"));
    wxFont StaticText1Font(12,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Calibri"),wxFONTENCODING_DEFAULT);
    StaticText1->SetFont(StaticText1Font);
    BoxSizer7->Add(StaticText1, 1, wxALL|wxALIGN_TOP, 5);
    Gauge1 = new wxGauge(ScrolledWindow1, ID_GAUGE1, 100, wxDefaultPosition, wxSize(300,25), 0, wxDefaultValidator, _T("ID_GAUGE1"));
    BoxSizer7->Add(Gauge1, 2, wxBOTTOM|wxLEFT|wxRIGHT|wxALIGN_TOP, 5);
    StaticText2 = new wxStaticText(ScrolledWindow1, ID_STATICTEXT2, _("Label"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT2"));
    wxFont StaticText2Font(12,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Calibri"),wxFONTENCODING_DEFAULT);
    StaticText2->SetFont(StaticText2Font);
    BoxSizer7->Add(StaticText2, 1, wxALL|wxALIGN_TOP, 5);
    BoxSizer5->Add(BoxSizer7, 0, wxALL|wxEXPAND, 0);
    BoxSizer8 = new wxBoxSizer(wxHORIZONTAL);
    BitmapButton1 = new wxBitmapButton(ScrolledWindow1, ID_BITMAPBUTTON1, wxBitmap(wxImage(_T("C:\\Users\\Thomas\\Documents\\Programmprojekte\\Behave\\kugel-rot-ok.png"))), wxDefaultPosition, wxDefaultSize, wxNO_BORDER, wxDefaultValidator, _T("ID_BITMAPBUTTON1"));
    BoxSizer8->Add(BitmapButton1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
    BitmapButton2 = new wxBitmapButton(ScrolledWindow1, ID_BITMAPBUTTON2, wxBitmap(wxImage(_T("C:\\Users\\Thomas\\Documents\\Programmprojekte\\Behave\\kugel-rot-ok.png"))), wxDefaultPosition, wxDefaultSize, wxNO_BORDER, wxDefaultValidator, _T("ID_BITMAPBUTTON2"));
    BoxSizer8->Add(BitmapButton2, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
    BitmapButton3 = new wxBitmapButton(ScrolledWindow1, ID_BITMAPBUTTON3, wxBitmap(wxImage(_T("C:\\Users\\Thomas\\Documents\\Programmprojekte\\Behave\\kugel-rot-ok.png"))), wxDefaultPosition, wxDefaultSize, wxNO_BORDER, wxDefaultValidator, _T("ID_BITMAPBUTTON3"));
    BoxSizer8->Add(BitmapButton3, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
    Button1 = new wxButton(ScrolledWindow1, ID_BUTTON1, _("Übernehmen"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON1"));
    BoxSizer8->Add(Button1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
    Button2 = new wxButton(ScrolledWindow1, ID_BUTTON2, _("Ändern"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON2"));
    BoxSizer8->Add(Button2, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
    BoxSizer5->Add(BoxSizer8, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
    BoxSizer4->Add(BoxSizer5, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
    ScrolledWindow1->SetSizer(BoxSizer4);
    BoxSizer4->Fit(ScrolledWindow1);
    BoxSizer4->SetSizeHints(ScrolledWindow1);
    BoxSizer2->Add(ScrolledWindow1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
    BoxSizer3 = new wxBoxSizer(wxVERTICAL);
    BoxSizer11 = new wxBoxSizer(wxVERTICAL);
    BoxSizer9 = new wxBoxSizer(wxHORIZONTAL);
    BoxSizer9->Add(150,20,0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
    StaticBitmap2 = new wxStaticBitmap(Panel1, ID_STATICBITMAP2, wxBitmap(wxImage(_T("C:\\Users\\Thomas\\Documents\\Programmprojekte\\Behave\\arrow-rose.png"))), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICBITMAP2"));
    BoxSizer9->Add(StaticBitmap2, 0, wxBOTTOM|wxALIGN_BOTTOM, 3);
    BoxSizer11->Add(BoxSizer9, 0, wxALL|wxEXPAND, 0);
    BoxSizer10 = new wxBoxSizer(wxHORIZONTAL);
    StaticText3 = new wxStaticText(Panel1, ID_STATICTEXT3, _("Klasse"), wxDefaultPosition, wxSize(150,23), 0, _T("ID_STATICTEXT3"));
    wxFont StaticText3Font(16,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Calibri"),wxFONTENCODING_DEFAULT);
    StaticText3->SetFont(StaticText3Font);
    BoxSizer10->Add(StaticText3, 1, wxBOTTOM|wxLEFT|wxRIGHT|wxALIGN_CENTER_VERTICAL, 5);
    Gauge2 = new wxGauge(Panel1, ID_GAUGE2, 100, wxDefaultPosition, wxSize(300,40), 0, wxDefaultValidator, _T("ID_GAUGE2"));
    BoxSizer10->Add(Gauge2, 2, wxBOTTOM|wxLEFT|wxRIGHT|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
    StaticText4 = new wxStaticText(Panel1, ID_STATICTEXT4, _("Label"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT4"));
    wxFont StaticText4Font(16,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,_T("Calibri"),wxFONTENCODING_DEFAULT);
    StaticText4->SetFont(StaticText4Font);
    BoxSizer10->Add(StaticText4, 1, wxBOTTOM|wxLEFT|wxRIGHT|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
    BoxSizer11->Add(BoxSizer10, 0, wxALL|wxEXPAND, 0);
    BoxSizer3->Add(BoxSizer11, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
    BoxSizer2->Add(BoxSizer3, 1, wxALL|wxEXPAND, 5);
    Panel1->SetSizer(BoxSizer2);
    BoxSizer2->Fit(Panel1);
    BoxSizer2->SetSizeHints(Panel1);
    BoxSizer1->Add(Panel1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 0);
    SetSizer(BoxSizer1);
    MenuBar1 = new wxMenuBar();
    Menu1 = new wxMenu();
    MenuItem3 = new wxMenuItem(Menu1, Belohnung, _("Belohnung"), wxEmptyString, wxITEM_NORMAL);
    Menu1->Append(MenuItem3);
    MenuItem1 = new wxMenuItem(Menu1, idMenuQuit, _("Beenden\tAlt-F4"), _("Quit the application"), wxITEM_NORMAL);
    Menu1->Append(MenuItem1);
    MenuBar1->Append(Menu1, _("Datei"));
    Menu2 = new wxMenu();
    MenuItem2 = new wxMenuItem(Menu2, idMenuAbout, _("Über\tF1"), _("Show info about this application"), wxITEM_NORMAL);
    Menu2->Append(MenuItem2);
    MenuBar1->Append(Menu2, _("\?"));
    SetMenuBar(MenuBar1);
    BoxSizer1->Fit(this);
    BoxSizer1->SetSizeHints(this);
    Center();

    Connect(Belohnung,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&BehaveFrame::OnBelohnung);
    Connect(idMenuQuit,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&BehaveFrame::OnQuit);
    Connect(idMenuAbout,wxEVT_COMMAND_MENU_SELECTED,(wxObjectEventFunction)&BehaveFrame::OnAbout);
    //*)
}

BehaveFrame::~BehaveFrame()
{
    //(*Destroy(BehaveFrame)
    //*)
}

void BehaveFrame::OnQuit(wxCommandEvent& event)
{
    Close();
}

void BehaveFrame::OnAbout(wxCommandEvent& event)
{
    wxString msg = wxbuildinfo(long_f);
    wxMessageBox(msg, _("Welcome to..."));
}

void BehaveFrame::OnBelohnung(wxCommandEvent& event)
{
    Belohnung dialog(this);
    dialog.ShowModal();
}

void BehaveFrame::OnBitmapButton3Click(wxCommandEvent& event)
{
    if (Kugeln == 3)
    {
        BitmapButton3->SetBitmap(wxImage(_T("C:\\Users\\Thomas\\Documents\\Programmprojekte\\Wall-Behave\\kugel-grau-ok.png")));
        Kugeln = Kugeln - 1;

    }
    else if (Kugeln == 2)
    {
        BitmapButton3->SetBitmap(wxImage(_T("C:\\Users\\Thomas\\Documents\\Programmprojekte\\Wall-Behave\\kugel-rot-ok.png")));
        Kugeln = Kugeln + 1;
    }
}

void BehaveFrame::OnBitmapButton2Click(wxCommandEvent& event)
{
    if (Kugeln == 3)
    {
    }
    else if (Kugeln == 2)
    {
        BitmapButton2->SetBitmap(wxImage(_T("C:\\Users\\Thomas\\Documents\\Programmprojekte\\Wall-Behave\\kugel-grau-ok.png")));
        Kugeln = Kugeln - 1;
    }
    else if (Kugeln == 1)
    {
        BitmapButton2->SetBitmap(wxImage(_T("C:\\Users\\Thomas\\Documents\\Programmprojekte\\Wall-Behave\\kugel-rot-ok.png")));
        Kugeln = Kugeln + 1;
    }
}

void BehaveFrame::OnBitmapButton1Click(wxCommandEvent& event)
{
    if (Kugeln == 1)
    {
        BitmapButton1->SetBitmap(wxImage(_T("C:\\Users\\Thomas\\Documents\\Programmprojekte\\Wall-Behave\\kugel-grau-ok.png")));
        Kugeln = Kugeln - 1;
    }
    else if (Kugeln == 0)
    {
        BitmapButton1->SetBitmap(wxImage(_T("C:\\Users\\Thomas\\Documents\\Programmprojekte\\Wall-Behave\\kugel-rot-ok.png")));
        Kugeln = Kugeln + 1;
    }
}


void BehaveFrame::OnButton1Click(wxCommandEvent& event)
{
    SuS = SuS + Kugeln;
    Total = Total + Kugeln;
    SuS_string = int_to_string(SuS);
    Gauge1->SetValue(SuS);
    Gauge2->SetValue(Total);
    StaticText2->SetLabelText(SuS_string + " / 60");
    BitmapButton1->SetBitmap(wxImage(_T("C:\\Users\\Thomas\\Documents\\Programmprojekte\\Wall-Behave\\kugel-rot-ok.png")));
    BitmapButton2->SetBitmap(wxImage(_T("C:\\Users\\Thomas\\Documents\\Programmprojekte\\Wall-Behave\\kugel-rot-ok.png")));
    BitmapButton3->SetBitmap(wxImage(_T("C:\\Users\\Thomas\\Documents\\Programmprojekte\\Wall-Behave\\kugel-rot-ok.png")));
    Kugeln = 3;
}
Main.h

Code: Select all

/***************************************************************
 * Name:      BehaveMain.h
 * Purpose:   Defines Application Frame
 * Author:    Thomas ()
 * Created:   2018-08-15
 * Copyright: Thomas ()
 * License:
 **************************************************************/

#ifndef BEHAVEMAIN_H
#define BEHAVEMAIN_H

//(*Headers(BehaveFrame)
#include <wx/scrolwin.h>
#include <wx/sizer.h>
#include <wx/stattext.h>
#include <wx/menu.h>
#include <wx/panel.h>
#include <wx/bmpbuttn.h>
#include <wx/statbmp.h>
#include <wx/button.h>
#include <wx/frame.h>
#include <wx/gauge.h>
//*)

class BehaveFrame: public wxFrame
{
    public:

        BehaveFrame(wxWindow* parent,wxWindowID id = -1);
        virtual ~BehaveFrame();

    private:

        //(*Handlers(BehaveFrame)
        void OnQuit(wxCommandEvent& event);
        void OnAbout(wxCommandEvent& event);
        void OnBitmapButton1Click(wxCommandEvent& event);
        void OnBitmapButton2Click(wxCommandEvent& event);
        void OnBitmapButton3Click(wxCommandEvent& event);
        void OnButton1Click(wxCommandEvent& event);
        void OnBelohnung(wxCommandEvent& event);
        //*)

        //(*Identifiers(BehaveFrame)
        static const long ID_STATICBITMAP1;
        static const long ID_STATICTEXT1;
        static const long ID_GAUGE1;
        static const long ID_STATICTEXT2;
        static const long ID_BITMAPBUTTON1;
        static const long ID_BITMAPBUTTON2;
        static const long ID_BITMAPBUTTON3;
        static const long ID_BUTTON1;
        static const long ID_BUTTON2;
        static const long ID_SCROLLEDWINDOW1;
        static const long ID_STATICBITMAP2;
        static const long ID_STATICTEXT3;
        static const long ID_GAUGE2;
        static const long ID_STATICTEXT4;
        static const long ID_PANEL1;
        static const long Belohnung;
        static const long idMenuQuit;
        static const long idMenuAbout;
        //*)

        //(*Declarations(BehaveFrame)
        wxStaticBitmap* StaticBitmap2;
        wxStaticText* StaticText2;
        wxScrolledWindow* ScrolledWindow1;
        wxButton* Button1;
        wxStaticBitmap* StaticBitmap1;
        wxGauge* Gauge1;
        wxPanel* Panel1;
        wxBitmapButton* BitmapButton2;
        wxStaticText* StaticText1;
        wxStaticText* StaticText3;
        wxBitmapButton* BitmapButton1;
        wxButton* Button2;
        wxMenuItem* MenuItem3;
        wxGauge* Gauge2;
        wxBitmapButton* BitmapButton3;
        wxStaticText* StaticText4;
        //*)

        DECLARE_EVENT_TABLE()
};

#endif // BEHAVEMAIN_H
dialog.cpp

Code: Select all

#include "Belohnung.h"
#include <wx/msgdlg.h>

int Belohnung_Anzahl;

//(*InternalHeaders(Belohnung)
#include <wx/font.h>
#include <wx/intl.h>
#include <wx/string.h>
//*)

//(*IdInit(Belohnung)
const long Belohnung::ID_STATICTEXT1 = wxNewId();
const long Belohnung::ID_SPINCTRL1 = wxNewId();
const long Belohnung::ID_BUTTON1 = wxNewId();
//*)

BEGIN_EVENT_TABLE(Belohnung,wxDialog)
	//(*EventTable(Belohnung)
	//*)
END_EVENT_TABLE()

Belohnung::Belohnung(wxWindow* parent,wxWindowID id,const wxPoint& pos,const wxSize& size)
{
	//(*Initialize(Belohnung)
	wxBoxSizer* BoxSizer1;

	Create(parent, id, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE, _T("id"));
	SetClientSize(wxDefaultSize);
	Move(wxDefaultPosition);
	BoxSizer1 = new wxBoxSizer(wxHORIZONTAL);
	StaticText1 = new wxStaticText(this, ID_STATICTEXT1, _("Punkte Belohnung"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_STATICTEXT1"));
	wxFont StaticText1Font(11,wxFONTFAMILY_SWISS,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_BOLD,false,wxEmptyString,wxFONTENCODING_DEFAULT);
	StaticText1->SetFont(StaticText1Font);
	BoxSizer1->Add(StaticText1, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 10);
	SpinCtrl1 = new wxSpinCtrl(this, ID_SPINCTRL1, _T("0"), wxDefaultPosition, wxSize(68,21), 0, 0, 7000, 0, _T("ID_SPINCTRL1"));
	SpinCtrl1->SetValue(_T("0"));
	BoxSizer1->Add(SpinCtrl1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	Button1 = new wxButton(this, ID_BUTTON1, _("OK"), wxDefaultPosition, wxSize(59,23), 0, wxDefaultValidator, _T("ID_BUTTON1"));
	BoxSizer1->Add(Button1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
	SetSizer(BoxSizer1);
	BoxSizer1->Fit(this);
	BoxSizer1->SetSizeHints(this);

	Connect(ID_BUTTON1,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&Belohnung::OnButton1Click1);
	//*)
}

Belohnung::~Belohnung()
{
	//(*Destroy(Belohnung)
	//*)
}


void Belohnung::OnButton1Click1(wxCommandEvent& event)
{
   Belohnung_Anzahl = SpinCtrl1->GetValue();
   Close();
}
dialog.h

Code: Select all

#ifndef BELOHNUNG_H
#define BELOHNUNG_H

//(*Headers(Belohnung)
#include <wx/sizer.h>
#include <wx/stattext.h>
#include <wx/spinctrl.h>
#include <wx/button.h>
#include <wx/dialog.h>
//*)

class Belohnung: public wxDialog
{
	public:

		Belohnung(wxWindow* parent,wxWindowID id=wxID_ANY,const wxPoint& pos=wxDefaultPosition,const wxSize& size=wxDefaultSize);
		virtual ~Belohnung();

		//(*Declarations(Belohnung)
		wxSpinCtrl* SpinCtrl1;
		wxButton* Button1;
		wxStaticText* StaticText1;
		//*)

	protected:

		//(*Identifiers(Belohnung)
		static const long ID_STATICTEXT1;
		static const long ID_SPINCTRL1;
		static const long ID_BUTTON1;
		//*)

	private:

		//(*Handlers(Belohnung)
		void OnButton1Click(wxCommandEvent& event);
		void OnButton1Click1(wxCommandEvent& event);
		//*)

		DECLARE_EVENT_TABLE()
};

#endif
User avatar
doublemax
Moderator
Moderator
Posts: 19158
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: expected ';' before 'dialog'

Post by doublemax »

You already have an ID defined as "Belohnung". Naming the dialog class the same was not a good idea :)

Code: Select all

const long BehaveFrame::Belohnung = wxNewId();
Use the source, Luke!
Wanderer82
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 675
Joined: Tue Jul 26, 2016 2:00 pm

Re: expected ';' before 'dialog'

Post by Wanderer82 »

:lol:
Post Reply