<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://cegui.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Rogma</id>
		<title>CEGUI Wiki - Crazy Eddie's GUI System (Open Source) - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://cegui.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Rogma"/>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/Special:Contributions/Rogma"/>
		<updated>2026-08-03T05:53:00Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.24.1</generator>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Custom_ScriptingModule&amp;diff=3204</id>
		<title>Custom ScriptingModule</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Custom_ScriptingModule&amp;diff=3204"/>
				<updated>2008-07-11T22:04:24Z</updated>
		
		<summary type="html">&lt;p&gt;Rogma: /* A very basic event handler */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article show how to create a custom ScriptingModule that can catch events. &lt;br /&gt;
&lt;br /&gt;
This code has been tested with version 0.5.&lt;br /&gt;
&lt;br /&gt;
==A very basic ScriptingModule==&lt;br /&gt;
&lt;br /&gt;
This very basic scripting module link any event to a CommandInterpretor class. &lt;br /&gt;
  /// Specialized scripting module for CEGUI &lt;br /&gt;
  class ScriptingModule : public CEGUI::ScriptModule&lt;br /&gt;
  {&lt;br /&gt;
  public:&lt;br /&gt;
    &lt;br /&gt;
    virtual CEGUI::Event::Connection subscribeEvent(&lt;br /&gt;
        CEGUI::EventSet*     target, &lt;br /&gt;
        const CEGUI::String&amp;amp; name, &lt;br /&gt;
        const CEGUI::String&amp;amp; subscriber_name)&lt;br /&gt;
    {&lt;br /&gt;
      CommandInterpretor command(subscriber_name.c_str()) ;&lt;br /&gt;
      return target-&amp;gt;subscribeEvent(name,CEGUI::Event::Subscriber(command)) ;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    virtual CEGUI::Event::Connection subscribeEvent(&lt;br /&gt;
        CEGUI::EventSet*     target,&lt;br /&gt;
        const CEGUI::String&amp;amp; name,&lt;br /&gt;
        CEGUI::Event::Group  group,&lt;br /&gt;
        const CEGUI::String&amp;amp; subscriber_name)&lt;br /&gt;
    {&lt;br /&gt;
      CommandInterpretor command(subscriber_name.c_str()) ;&lt;br /&gt;
      return target-&amp;gt;subscribeEvent(name,group,CEGUI::Event::Subscriber(command)) ;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    virtual void executeScriptFile(const CEGUI::String &amp;amp;filename, const CEGUI::String &amp;amp;resourceGroup=&amp;quot;&amp;quot;)&lt;br /&gt;
    {}&lt;br /&gt;
    &lt;br /&gt;
    virtual int executeScriptGlobal(const CEGUI::String&amp;amp; function_name)&lt;br /&gt;
    {&lt;br /&gt;
      return 0 ;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    virtual void executeString(const CEGUI::String &amp;amp;str)&lt;br /&gt;
    {}&lt;br /&gt;
    &lt;br /&gt;
    virtual bool executeScriptedEventHandler(&lt;br /&gt;
        const CEGUI::String&amp;amp; handler_name,&lt;br /&gt;
        const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
    {&lt;br /&gt;
      return true ;&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
The two important methods are subscribeEvent that link an event to a subscriber that is implemented by a basic event handler.&lt;br /&gt;
&lt;br /&gt;
==A very basic event handler==&lt;br /&gt;
&lt;br /&gt;
Here the ''main'' function is '''operator()''' that will be called with an EventArgs parameter. We already have the name of the function &lt;br /&gt;
&lt;br /&gt;
  /// Callback for a event command &lt;br /&gt;
  class CommandInterpretor&lt;br /&gt;
  {&lt;br /&gt;
  public:&lt;br /&gt;
    &lt;br /&gt;
    CommandInterpretor(const std::string&amp;amp; name)&lt;br /&gt;
    : m_name(name)&lt;br /&gt;
    {}&lt;br /&gt;
    &lt;br /&gt;
    bool operator()(const CEGUI::EventArgs&amp;amp; args) const&lt;br /&gt;
    {&lt;br /&gt;
      std::cout &amp;lt;&amp;lt; m_name ;&lt;br /&gt;
      &lt;br /&gt;
      const CEGUI::WindowEventArgs* argument = dynamic_cast&amp;lt;const CEGUI::WindowEventArgs*&amp;gt;(&amp;amp;args) ;&lt;br /&gt;
      &lt;br /&gt;
      if (argument)&lt;br /&gt;
      {&lt;br /&gt;
        // we have the window that triggered the event&lt;br /&gt;
        std::cout &amp;lt;&amp;lt; &amp;quot; &amp;quot; &amp;lt;&amp;lt; argument-&amp;gt;window-&amp;gt;getName() ;&lt;br /&gt;
      }&lt;br /&gt;
      &lt;br /&gt;
      std::cout &amp;lt;&amp;lt; std::endl ;&lt;br /&gt;
      &lt;br /&gt;
      return true ;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    std::string m_name ;&lt;br /&gt;
    &lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
==Setup==&lt;br /&gt;
&lt;br /&gt;
The ScriptModule can be registered to CEGUI::System either at construction time :&lt;br /&gt;
  new CEGUI::System(CEGUIRenderer,0,0,module) ;&lt;br /&gt;
or after : &lt;br /&gt;
  CEGUI::System::getSingleton().setScriptingModule(module) ;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&lt;br /&gt;
If you put : &lt;br /&gt;
 &amp;lt;Event Name=&amp;quot;Clicked&amp;quot; Function=&amp;quot;play&amp;quot;/&amp;gt;&lt;br /&gt;
in the layout of a button named '''Foo''', you will have &lt;br /&gt;
&lt;br /&gt;
 play Foo&lt;br /&gt;
&lt;br /&gt;
printed on screen&lt;br /&gt;
&lt;br /&gt;
==Misc notes==&lt;br /&gt;
&lt;br /&gt;
To also have the name of the event triggered, you can add this name to the constructor of CommandInterpretor.&lt;/div&gt;</summary>
		<author><name>Rogma</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Tutorials&amp;diff=3203</id>
		<title>Tutorials</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Tutorials&amp;diff=3203"/>
				<updated>2008-07-11T18:39:44Z</updated>
		
		<summary type="html">&lt;p&gt;Rogma: /* Scripting with CEGUI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== CrazyEddie's Beginner Guides ===&lt;br /&gt;
* [[The Beginner Guide to Getting CEGUI Rendering]] - How to initialise CEGUI to render properly.&lt;br /&gt;
* [[The Beginner Guide to Resource Groups]] - How to define resource group locations and specify default resource groups.&lt;br /&gt;
* [[The Beginner Guide to Loading Data Files and Initialisation]] - How to load some data files and perform basic system initialisation.&lt;br /&gt;
* [[The Beginner Guide to Creating a CEGUI Window]] - How to create a simple window and get it on screen.&lt;br /&gt;
* [[The Beginner Guide to Injecting Inputs]] - How to inject inputs into CEGUI and get interactive.&lt;br /&gt;
* [[HOWTO:_Use_the_Unified_Positions_and_Sizes_System|The Beginner Guide to the Unified Position and Size System (CEGUI &amp;gt;= 0.4.0)]]&lt;br /&gt;
&lt;br /&gt;
=== Scripting with CEGUI ===&lt;br /&gt;
* [[Getting Started with Lua and CEGUI]] - How to initialise CEGUI with a Lua script module and configuration file.&lt;br /&gt;
* [[Handling Events from Lua]] - How to load Lua script files and bind CEGUI events to Lua functions.&lt;br /&gt;
* [[Writing CEGUI scripts]] - Code snippets&lt;br /&gt;
* [[Adding LuaScriptModule to Sample_FirstWindow]] - Experience adding scripting to an existing sample.&lt;br /&gt;
* [http://www.gpwiki.org/index.php/Crazy_Eddies_GUI_System:Tutorials:Creating_a_scriptable_interface_using_CEGUI Creating a scriptable interface using CEGUI]&lt;br /&gt;
* [[Custom_ScriptingModule]] - Creating a basic custom scripting module in CEGUI&lt;br /&gt;
&lt;br /&gt;
=== Window System Examples ===&lt;br /&gt;
* [[Using CEGUI with SDL and OpenGL]] - Guidelines on how to get SDL, OpenGL and CEGUI running together.&lt;br /&gt;
* [[Using CEGUI with Producer and OpenGL]] - Guidelines on how to render and inject input to CEGUI from the Producer API.&lt;br /&gt;
* [http://artis.imag.fr/Membres/Xavier.Decoret/resources/CEGUI/ Using CEGUI with Qt/QGLViewer]&lt;br /&gt;
* [[Using CEGUI with GLUT]] - Some tips on using OpenGL's GLUT with CEGUI.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Extending CEGUI ===&lt;br /&gt;
&lt;br /&gt;
* [[Using Expat XML parser within CEGUI]] - How to add support for another XML parser.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Skins - Tutorial For Artists ===&lt;br /&gt;
* [[Creating Skins]] - Extra notes for artists on how to create skins.&lt;br /&gt;
* [[The Beginners Guide to Falagard skinning - Part I]] - Learn by doing a Button.&lt;br /&gt;
* [[The Beginners Guide to Falagard skinning - Part II]] - More Falagard fun, this time with the Editbox.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Overviews ===&lt;br /&gt;
* [[Overview of GUI files]] - A quick introduction to all the XML files used by CEGUI.&lt;br /&gt;
&lt;br /&gt;
=== Miscellaneous HOW-TOs ===&lt;br /&gt;
* [[Create ImageButtons]] - A few different ways to create image buttons.&lt;br /&gt;
* [[Create a CheckListboxItem]] - Create a CheckListBoxItem that you can use with ItemListbox.&lt;br /&gt;
* [[Identifying Multiple Event Sources From A Single Callback]]&lt;br /&gt;
* [[Cool_window_effects]] - A collection of cool &amp;quot;special&amp;quot; effects on (frame)windows.&lt;/div&gt;</summary>
		<author><name>Rogma</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Custom_ScriptingModule&amp;diff=3202</id>
		<title>Custom ScriptingModule</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Custom_ScriptingModule&amp;diff=3202"/>
				<updated>2008-07-11T18:35:46Z</updated>
		
		<summary type="html">&lt;p&gt;Rogma: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article show how to create a custom ScriptingModule that can catch events. &lt;br /&gt;
&lt;br /&gt;
This code has been tested with version 0.5.&lt;br /&gt;
&lt;br /&gt;
==A very basic ScriptingModule==&lt;br /&gt;
&lt;br /&gt;
This very basic scripting module link any event to a CommandInterpretor class. &lt;br /&gt;
  /// Specialized scripting module for CEGUI &lt;br /&gt;
  class ScriptingModule : public CEGUI::ScriptModule&lt;br /&gt;
  {&lt;br /&gt;
  public:&lt;br /&gt;
    &lt;br /&gt;
    virtual CEGUI::Event::Connection subscribeEvent(&lt;br /&gt;
        CEGUI::EventSet*     target, &lt;br /&gt;
        const CEGUI::String&amp;amp; name, &lt;br /&gt;
        const CEGUI::String&amp;amp; subscriber_name)&lt;br /&gt;
    {&lt;br /&gt;
      CommandInterpretor command(subscriber_name.c_str()) ;&lt;br /&gt;
      return target-&amp;gt;subscribeEvent(name,CEGUI::Event::Subscriber(command)) ;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    virtual CEGUI::Event::Connection subscribeEvent(&lt;br /&gt;
        CEGUI::EventSet*     target,&lt;br /&gt;
        const CEGUI::String&amp;amp; name,&lt;br /&gt;
        CEGUI::Event::Group  group,&lt;br /&gt;
        const CEGUI::String&amp;amp; subscriber_name)&lt;br /&gt;
    {&lt;br /&gt;
      CommandInterpretor command(subscriber_name.c_str()) ;&lt;br /&gt;
      return target-&amp;gt;subscribeEvent(name,group,CEGUI::Event::Subscriber(command)) ;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    virtual void executeScriptFile(const CEGUI::String &amp;amp;filename, const CEGUI::String &amp;amp;resourceGroup=&amp;quot;&amp;quot;)&lt;br /&gt;
    {}&lt;br /&gt;
    &lt;br /&gt;
    virtual int executeScriptGlobal(const CEGUI::String&amp;amp; function_name)&lt;br /&gt;
    {&lt;br /&gt;
      return 0 ;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    virtual void executeString(const CEGUI::String &amp;amp;str)&lt;br /&gt;
    {}&lt;br /&gt;
    &lt;br /&gt;
    virtual bool executeScriptedEventHandler(&lt;br /&gt;
        const CEGUI::String&amp;amp; handler_name,&lt;br /&gt;
        const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
    {&lt;br /&gt;
      return true ;&lt;br /&gt;
    }&lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
The two important methods are subscribeEvent that link an event to a subscriber that is implemented by a basic event handler.&lt;br /&gt;
&lt;br /&gt;
==A very basic event handler==&lt;br /&gt;
&lt;br /&gt;
Here the ''main'' function is '''operator()''' that will be called with an EventArgs parameter. We already have the name of the function &lt;br /&gt;
&lt;br /&gt;
  /// Callback for a event command &lt;br /&gt;
  class CommandInterpretor&lt;br /&gt;
  {&lt;br /&gt;
  public:&lt;br /&gt;
    &lt;br /&gt;
    CommandInterpretor(const std::string&amp;amp; name)&lt;br /&gt;
    : m_name(name)&lt;br /&gt;
    {}&lt;br /&gt;
    &lt;br /&gt;
    bool operator()(const CEGUI::EventArgs&amp;amp; args) const&lt;br /&gt;
    {&lt;br /&gt;
      std::cout &amp;lt;&amp;lt; m_name ;&lt;br /&gt;
      &lt;br /&gt;
      const CEGUI::WindowEventArgs* argument = dynamic_cast&amp;lt;const CEGUI::WindowEventArgs*&amp;gt;(&amp;amp;args) ;&lt;br /&gt;
      &lt;br /&gt;
      if (argument)&lt;br /&gt;
      {&lt;br /&gt;
        // we have the window that triggered the event&lt;br /&gt;
        std::cout &amp;lt;&amp;lt; &amp;quot; &amp;quot; &amp;lt;&amp;lt; argument-&amp;gt;window-&amp;gt;getName() ;&lt;br /&gt;
      }&lt;br /&gt;
      &lt;br /&gt;
      std::cout &amp;lt;&amp;lt; std::endl ;&lt;br /&gt;
      &lt;br /&gt;
      return true ;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    string m_name ;&lt;br /&gt;
    &lt;br /&gt;
  };&lt;br /&gt;
&lt;br /&gt;
==Setup==&lt;br /&gt;
&lt;br /&gt;
The ScriptModule can be registered to CEGUI::System either at construction time :&lt;br /&gt;
  new CEGUI::System(CEGUIRenderer,0,0,module) ;&lt;br /&gt;
or after : &lt;br /&gt;
  CEGUI::System::getSingleton().setScriptingModule(module) ;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&lt;br /&gt;
If you put : &lt;br /&gt;
 &amp;lt;Event Name=&amp;quot;Clicked&amp;quot; Function=&amp;quot;play&amp;quot;/&amp;gt;&lt;br /&gt;
in the layout of a button named '''Foo''', you will have &lt;br /&gt;
&lt;br /&gt;
 play Foo&lt;br /&gt;
&lt;br /&gt;
printed on screen&lt;br /&gt;
&lt;br /&gt;
==Misc notes==&lt;br /&gt;
&lt;br /&gt;
To also have the name of the event triggered, you can add this name to the constructor of CommandInterpretor.&lt;/div&gt;</summary>
		<author><name>Rogma</name></author>	</entry>

	</feed>