Difference between revisions of "Most important events"

From CEGUI Wiki - Crazy Eddie's GUI System (Open Source)
Jump to: navigation, search
 
Line 3: Line 3:
 
===Getting started===
 
===Getting started===
  
==EventGalore.h==
+
====EventGalore.h====
#ifndef _EventGalore_h_
+
<code><cpp/>
#define _EventGalore_h_
+
#ifndef _EventGalore_h_
<br>
+
#define _EventGalore_h_
#include "CEGuiSample.h"
+
 
#include "CEGUI.h"
+
#include "CEGuiSample.h"
<br>
+
#include "CEGUI.h"
class EventGalore : public CEGuiSample
+
 
{
+
class EventGalore : public CEGuiSample
public:
+
{
    bool initialiseSample()
+
public:
    {
+
  bool initialiseSample()
<b>       using namespace CEGUI;
+
  {
<br>
+
       using namespace CEGUI;
        return true;</b>
+
 
    }
+
      return true;
    void cleanupSample(void)
+
  }
    {
+
  void cleanupSample(void)
    }
+
  {
};
+
  }
#endif // _WidgetGalore_h_
+
};
 +
#endif // _EventGalore_h_
 +
</code>
 +
 
 +
====main.cpp====
 +
<code><cpp/>
 +
#if defined( __WIN32__ ) || defined( _WIN32 )
 +
#define WIN32_LEAN_AND_MEAN
 +
#define NOMINMAX
 +
#include "windows.h"
 +
#endif
 +
 
 +
#include "EventGalore.h"
 +
 
 +
 
 +
#if defined( __WIN32__ ) || defined( _WIN32 )
 +
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,int nCmdShow)
 +
#else
 +
int main(int argc, char *argv[])
 +
#endif
 +
{
 +
    EventGalore app;
 +
    return app.run();
 +
}
 +
</code>

Revision as of 10:57, 5 May 2007

This article is going to show you the most important and usefull events of each widget.

Getting started

EventGalore.h

<cpp/>

  1. ifndef _EventGalore_h_
  2. define _EventGalore_h_
  1. include "CEGuiSample.h"
  2. include "CEGUI.h"

class EventGalore : public CEGuiSample { public:

  bool initialiseSample()
  {
      using namespace CEGUI;
      return true;
  }
  void cleanupSample(void)
  {
  }

};

  1. endif // _EventGalore_h_

main.cpp

<cpp/>

  1. if defined( __WIN32__ ) || defined( _WIN32 )

#define WIN32_LEAN_AND_MEAN #define NOMINMAX #include "windows.h"

  1. endif
  1. include "EventGalore.h"


  1. if defined( __WIN32__ ) || defined( _WIN32 )

int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,int nCmdShow)

  1. else

int main(int argc, char *argv[])

  1. endif

{

   EventGalore app;
   return app.run();

}