Last active
May 26, 2016 18:55
-
-
Save jerstlouis/2baa14b8f74bec5b5019412e88eb3eeb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define MODULE_NAME "HelloForm" | |
#include "ecere.hpp" | |
GuiApplication app; | |
main_DEFINITION; | |
class HelloForm2 : public Window | |
{ | |
public: | |
Button button; | |
CONSTRUCT(HelloForm2, Window) | |
{ | |
caption = $("My Second Ecere/C++ Bindings App"); | |
borderStyle = sizable; | |
clientSize = { 640, 480 }; | |
hasClose = true; | |
hasMaximize = true; | |
hasMinimize = true; | |
background = formColor; | |
font = { "Arial", 30 }; | |
button.parent = this; | |
button.position = { 200, 200 }; | |
button.caption = $("Yay!!"); | |
button.notifyClicked = [](Window & owner, Button & btn, int x, int y, Modifiers mods) | |
{ | |
HelloForm2 & self = (HelloForm2 &)owner; | |
MessageBox msgBox; | |
msgBox.caption = self.button.caption; | |
msgBox.contents = $("C++ Bindings!"); | |
msgBox.modal(); | |
return true; | |
}; | |
onRedraw = [](Window & w, Surface & surface) | |
{ | |
surface.writeTextf(100, 100, $("Testing stuff!")); | |
}; | |
} | |
}; | |
registerClass(app, HelloForm2, Window); | |
class HelloForm3 : public HelloForm2 | |
{ | |
public: | |
CONSTRUCT(HelloForm3, HelloForm2) | |
{ | |
background = 0x50B0F0; | |
position = { 0, 0 }; | |
} | |
}; | |
registerClass(app, HelloForm3, HelloForm2); | |
HelloForm2 hello2; | |
HelloForm3 hello3; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment