Hi!
Sorry for the strange title… but i don’t know how to define this technique.
I declared a class like this
because i need to use a pointer of this class inside another class… but i need to define this class later.
I don’t know if this is clear… so, this is my code:
#ifndef __IID_StudentPart__Button__
#define __IID_StudentPart__Button__
#include "ofMain.h"
class Button;
enum ButtonEvents
{
BUTTON_EVENT_RELEASE,
BUTTON_EVENT_MOUSE_OVER,
BUTTON_EVENT_MOUSE_OUT
};
class EventFromDependentStationArgs : ofEventArgs
{
public:
Button* button;
ButtonEvents eventType;
};
enum ButtonState
{
BUTTON_NORMAL_STATE,
BUTTON_RELEASED_STATE,
BUTTON_MOUSE_OVER_STATE,
BUTTON_MOUSE_OUT_STATE
};
class Button
{
public:
Button(string name);
~Button();
...
ofEvent<EventFromDependentStationArgs> buttonsEvent;
...
};
#endif /* defined(__IID_StudentPart__Button__) */
So… i declared class Button because i need to use inside EventFromDependentStationArgs… and i have also to use EventFromDependentStationArgs inside my class Button.
This all works fine in Xcode… but in codeBlocks 12.11 on Windows8 i have some problem to compile.
Where i use
compiler says:
“Button” does not name a type
Any idea?