summaryrefslogtreecommitdiff
path: root/testobject.h
diff options
context:
space:
mode:
authorGravatar jonas <himself@jonasgunz.de> 2018-12-28 15:09:41 +0100
committerGravatar jonas <himself@jonasgunz.de> 2018-12-28 15:09:41 +0100
commit167abfe3746df80dd48dd65751583d97449e55f3 (patch)
treec308f70936e378eca8b68208a379e0458de934b4 /testobject.h
parentc5af4c3057a904f2a037a624273c1c7a4b0295a5 (diff)
downloadtermgl-167abfe3746df80dd48dd65751583d97449e55f3.tar.gz
Fixes in cObjectHandler:buildHitmap(), new Sample
Diffstat (limited to 'testobject.h')
-rw-r--r--testobject.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/testobject.h b/testobject.h
new file mode 100644
index 0000000..5e5475f
--- /dev/null
+++ b/testobject.h
@@ -0,0 +1,34 @@
+#pragma once
+
+#include "cObject.h"
+
+class testobject : cObject
+{
+
+public:
+ testobject()
+ {
+ setSize(10,5);
+ cc = 0;
+
+ drawRectangle('#', NULL, {0,0}, {9,4}, _COL_GREEN, _COL_DEFAULT);
+ }
+
+ ~testobject()
+ {
+ destruct();
+ }
+
+ virtual void onClick(sPos _pos, unsigned int _button)
+ {
+ cc++;
+ drawText(to_string(cc), {2,2}, _COL_RED);
+ }
+
+ virtual void onChar(unsigned char _c)
+ {
+ drawPoint(_c, {1,1},true, _COL_BLUE);
+ }
+private:
+ int cc;
+};