Skip to content

Instantly share code, notes, and snippets.

@jerstlouis
Created May 27, 2016 03:02
Show Gist options
  • Save jerstlouis/6aadc4c77e7625f835f8f0bdf9b8b572 to your computer and use it in GitHub Desktop.
Save jerstlouis/6aadc4c77e7625f835f8f0bdf9b8b572 to your computer and use it in GitHub Desktop.
#define MODULE_NAME "HelloForm"
#include <ecere>
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