Mercurial > dwindows
diff dwtestoo.cpp @ 2867:ada74f4d3f39
C++: Implement conditional signal handlers based on overrides.
This uses templates in a sort of hacky way to determine if our virtual
functions have been overridden. Leaving some debug code in for the moment
to make sure it works on all platforms. OS/2 will require using GCC for the
C++ bindings, since VisualAge only supports C++99 and Watcom doesn't even
support that as far as I know.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sat, 17 Dec 2022 21:39:00 +0000 |
parents | 6ea67d0809eb |
children | 5ee1aaa48fc7 |
line wrap: on
line diff
--- a/dwtestoo.cpp Sat Dec 17 11:51:22 2022 +0000 +++ b/dwtestoo.cpp Sat Dec 17 21:39:00 2022 +0000 @@ -1,15 +1,14 @@ #include <dw.hpp> -class MyWindow : public DW::Window +class MyWindow : public DW::Window<MyWindow> { public: MyWindow() { SetText("Basic application"); SetSize(200, 200); } -protected: - virtual int OnDelete() { DW::App *app = DW::App::Init(); app->MainQuit(); return FALSE; } - virtual int OnConfigure(int width, int height) { return FALSE; } + virtual int OnDelete() override { DW::App *app = DW::App::Init(); app->MainQuit(); return FALSE; } + virtual int OnConfigure(int width, int height) override { return FALSE; } }; int dwmain(int argc, char* argv[])