From 1b52ead802e1f3b24c33cadacb8d67dbfb209253 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Mon, 12 Mar 2018 12:57:28 +0000 Subject: Android: Reinstated working simple cliping functionality based on an improved Fl_Rect_Region class instead of Fl_Rect. Commented out complex clipping. Android lib and apps now use C++11 because they can (and I like it). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12741 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- ide/AndroidStudio3/app/src/main/cpp/CMakeLists.txt | 2 ++ ide/AndroidStudio3/app/src/main/cpp/HelloAndroid.cxx | 18 ++++-------------- 2 files changed, 6 insertions(+), 14 deletions(-) (limited to 'ide/AndroidStudio3') diff --git a/ide/AndroidStudio3/app/src/main/cpp/CMakeLists.txt b/ide/AndroidStudio3/app/src/main/cpp/CMakeLists.txt index c7530ae38..c9f4fab48 100644 --- a/ide/AndroidStudio3/app/src/main/cpp/CMakeLists.txt +++ b/ide/AndroidStudio3/app/src/main/cpp/CMakeLists.txt @@ -17,6 +17,8 @@ cmake_minimum_required(VERSION 3.4.1) set(FLTK_DIR ../../../../../..) +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + # FIXME: add as a second argument the binary build dir # so that the first argument can link directly to FLTK diff --git a/ide/AndroidStudio3/app/src/main/cpp/HelloAndroid.cxx b/ide/AndroidStudio3/app/src/main/cpp/HelloAndroid.cxx index 207a78817..02b563517 100644 --- a/ide/AndroidStudio3/app/src/main/cpp/HelloAndroid.cxx +++ b/ide/AndroidStudio3/app/src/main/cpp/HelloAndroid.cxx @@ -22,7 +22,7 @@ #include -Fl_Window *win, *win2, *win3; +Fl_Window *win; Fl_Button *btn; @@ -31,30 +31,20 @@ class MyButton : public Fl_Button public: MyButton(int x, int y, int w, int h, const char *l) : Fl_Button(x, y, w, h, l) { } void draw() { - fl_push_clip(x(), y(), w()*2/3, h()*2/3); + //fl_push_clip(x(), y(), w()*2/3, h()*2/3); Fl_Button::draw(); - fl_pop_clip(); + //fl_pop_clip(); } }; int main(int argc, char **argv) { - win2 = new Fl_Window(100, 50, 150, 200, "on bottom"); - win2->color(FL_BLUE); - win2->end(); - win2->show(); - win = new Fl_Window(50, 150, 500, 400, "Hallo"); btn = new MyButton((win->w()-280)/2, 200, 280, 35, "Hello, Android!"); btn->color(FL_LIGHT2); win->show(argc, argv); -/* - win3 = new Fl_Window(300, 50, 150, 200, "on top"); - win3->color(FL_RED); - win3->end(); - win3->show(); -*/ + Fl::run(); return 0; -- cgit v1.2.3