Mercurial > dwindows
comparison 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 |
comparison
equal
deleted
inserted
replaced
2866:6ea67d0809eb | 2867:ada74f4d3f39 |
---|---|
1 #include <dw.hpp> | 1 #include <dw.hpp> |
2 | 2 |
3 class MyWindow : public DW::Window | 3 class MyWindow : public DW::Window<MyWindow> |
4 { | 4 { |
5 public: | 5 public: |
6 MyWindow() { | 6 MyWindow() { |
7 SetText("Basic application"); | 7 SetText("Basic application"); |
8 SetSize(200, 200); | 8 SetSize(200, 200); |
9 } | 9 } |
10 protected: | 10 virtual int OnDelete() override { DW::App *app = DW::App::Init(); app->MainQuit(); return FALSE; } |
11 virtual int OnDelete() { DW::App *app = DW::App::Init(); app->MainQuit(); return FALSE; } | 11 virtual int OnConfigure(int width, int height) override { return FALSE; } |
12 virtual int OnConfigure(int width, int height) { return FALSE; } | |
13 }; | 12 }; |
14 | 13 |
15 int dwmain(int argc, char* argv[]) | 14 int dwmain(int argc, char* argv[]) |
16 { | 15 { |
17 DW::App *app = DW::App::Init(argc, argv, "org.dbsoft.dwindows.dwtestoo"); | 16 DW::App *app = DW::App::Init(argc, argv, "org.dbsoft.dwindows.dwtestoo"); |