From e66171ee732171467807507e4b4c3e0f468ab645 Mon Sep 17 00:00:00 2001 From: Markus Gans Date: Fri, 17 Mar 2017 23:22:13 +0100 Subject: [PATCH] More constant character pointers --- .gitignore | 1 + src/fvterm.cpp | 2 +- src/fvterm.h | 2 +- test/mouse.cpp | 21 +++++++++++++++++++++ 4 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 test/mouse.cpp diff --git a/.gitignore b/.gitignore index e3a3bb41..109ac5c7 100644 --- a/.gitignore +++ b/.gitignore @@ -38,5 +38,6 @@ test/input-dialog test/choice test/mandelbrot test/keyboard +test/mouse test/timer test/ui diff --git a/src/fvterm.cpp b/src/fvterm.cpp index a1716068..1c0dfe3a 100644 --- a/src/fvterm.cpp +++ b/src/fvterm.cpp @@ -387,7 +387,7 @@ int FVTerm::print (term_area* area, const std::string& s) } //---------------------------------------------------------------------- -int FVTerm::print (FString& s) +int FVTerm::print (const FString& s) { assert ( ! s.isNull() ); term_area* area = getPrintArea(); diff --git a/src/fvterm.h b/src/fvterm.h index af7a074b..d56afac9 100644 --- a/src/fvterm.h +++ b/src/fvterm.h @@ -263,7 +263,7 @@ class FVTerm : public FObject, public FTerm int print (term_area*, const char*); int print (const std::string&); int print (term_area*, const std::string&); - int print (FString&); + int print (const FString&); int print (term_area*, const FString&); int print (int); int print (term_area*, int); diff --git a/test/mouse.cpp b/test/mouse.cpp new file mode 100644 index 00000000..87977e86 --- /dev/null +++ b/test/mouse.cpp @@ -0,0 +1,21 @@ +// File: mouse.cpp + +#include "fapp.h" +#include "fdialog.h" + +//---------------------------------------------------------------------- +// main part +//---------------------------------------------------------------------- +int main (int argc, char* argv[]) +{ + // Create the application object + FApplication app(argc, argv); + + // Create a simple dialog box + FDialog mouse_draw(&app); + mouse_draw.setGeometry (12, 4, 60, 18); + + app.setMainWidget(&mouse_draw); + mouse_draw.show(); + return app.exec(); +}