bindings/cpp/samples: added comments; using (Gui)Application::class_registration()
authorJerome St-Louis <jerome@ecere.com>
Thu, 22 Sep 2016 21:30:01 +0000 (17:30 -0400)
committerJerome St-Louis <jerome@ecere.com>
Mon, 21 Nov 2016 14:19:00 +0000 (09:19 -0500)
bindings/cpp/samples/helloApp.cpp
bindings/cpp/samples/helloApp2.cpp
bindings/cpp/samples/helloApp3.cpp
bindings/cpp/samples/helloApp4.cpp

index 68922b3..5932d28 100644 (file)
@@ -2,6 +2,8 @@
 
 #include "eC.hpp"
 
+// Demonstrates overriding Application class, evolving instance from REGISTER()
+
 class MyApp;
 extern MyApp app;
 
@@ -11,6 +13,7 @@ public:
    APP_CONSTRUCT(MyApp, Application) { }
    REGISTER()
    {
+      Application::class_registration(_class);
       register_main(_class, [](Application & app)
       {
          PrintLn(class_String, "C++: Hello, eC", null);
index 70c703c..921104d 100644 (file)
@@ -2,6 +2,8 @@
 
 #include "eC.hpp"
 
+// Demonstrates 'main()' C++ style override (MyApp is not registered with eC COM)
+
 class MyApp : public Application
 {
 public:
index 7527adf..7eaab76 100644 (file)
@@ -2,24 +2,26 @@
 
 #include "ecere.hpp"
 
+// Demonstrates overriding GuiApplication class, evolving instance from constructor
+// Simpler alternative override of cycle() at instance level commented out
+// Still using C++ style override of main() (Could also override just like cycle() in constructor or REGISTER())
+
 class MyApp : public GuiApplication
 {
 public:
    APP_CONSTRUCT(MyApp, GuiApplication)
    {
       REGISTER_APP_CLASS(MyApp, GuiApplication, *this);
-      /*
-      cycle = +[](GuiApplication & app, bool idle)
+      /*cycle = +[](GuiApplication & app, bool idle)
       {
          PrintLn(class_String, "   Cycling!", null);
          return true;
-      };
-      */
+      };*/
    }
 
    REGISTER()
    {
-      GuiApplication_class_registration(GuiApplication);
+      GuiApplication::class_registration(_class);
       register_cycle(_class, [](GuiApplication & app, bool idle)
       {
          PrintLn(class_String, "   Cycling!", null);
index 281931a..6eadc3c 100644 (file)
@@ -2,6 +2,8 @@
 
 #include "eC.hpp"
 
+// Demonstrates overriding Application class, evolving instance from constructor
+
 class MyApp : public Application
 {
 public: