diff options
author | falkTX <falktx@gmail.com> | 2014-05-06 18:58:34 +0200 |
---|---|---|
committer | falkTX <falktx@gmail.com> | 2014-05-06 18:58:34 +0200 |
commit | 3ec241f04c4850be3c39049fa6ad53653ab24c4c (patch) | |
tree | 7d5c1b798ab16a298f7f2262a33adf705962647f /examples | |
parent | 142c6ddebd4f7bd8c8507591de7768d09792d588 (diff) |
More base changes
Diffstat (limited to 'examples')
-rw-r--r-- | examples/color.cpp | 10 | ||||
-rw-r--r-- | examples/images.cpp | 34 |
2 files changed, 23 insertions, 21 deletions
diff --git a/examples/color.cpp b/examples/color.cpp index e0dbba9b..b110e71d 100644 --- a/examples/color.cpp +++ b/examples/color.cpp @@ -110,15 +110,17 @@ private: void onReshape(int width, int height) override { - // make widget same size as window - setSize(width, height); - Widget::onReshape(width, height); - // full bg bgFull = Rectangle<int>(0, 0, width, height); // small bg, centered 2/3 size bgSmall = Rectangle<int>(width/6, height/6, width*2/3, height*2/3); + + // make widget same size as window + setSize(width, height); + + // default reshape implementation + Widget::onReshape(width, height); } char cur; diff --git a/examples/images.cpp b/examples/images.cpp index 8e8201d0..b113abb0 100644 --- a/examples/images.cpp +++ b/examples/images.cpp @@ -126,23 +126,6 @@ private: repaint(); } - void setNewTopImg(const int imgId) - { - if (fImgTop1st == imgId) - return; - - if (fImgTop2nd == imgId) - { - fImgTop2nd = fImgTop1st; - fImgTop1st = imgId; - return; - } - - fImgTop3rd = fImgTop2nd; - fImgTop2nd = fImgTop1st; - fImgTop1st = imgId; - } - void onDisplay() override { switch (fImgTop3rd) @@ -185,6 +168,23 @@ private: }; } + void setNewTopImg(const int imgId) + { + if (fImgTop1st == imgId) + return; + + if (fImgTop2nd == imgId) + { + fImgTop2nd = fImgTop1st; + fImgTop1st = imgId; + return; + } + + fImgTop3rd = fImgTop2nd; + fImgTop2nd = fImgTop1st; + fImgTop1st = imgId; + } + int fImgTop1st, fImgTop2nd, fImgTop3rd; int fImg1x, fImg2x, fImg3y; bool fImg1rev, fImg2rev, fImg3rev; |