summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FL/Fl_Screen_Driver.H2
-rw-r--r--src/Fl_Input_.cxx8
-rw-r--r--src/Fl_Screen_Driver.cxx2
-rw-r--r--src/drivers/X11/Fl_X11_Screen_Driver.cxx3
4 files changed, 9 insertions, 6 deletions
diff --git a/FL/Fl_Screen_Driver.H b/FL/Fl_Screen_Driver.H
index b2ca764ec..55824a014 100644
--- a/FL/Fl_Screen_Driver.H
+++ b/FL/Fl_Screen_Driver.H
@@ -89,6 +89,8 @@ public:
virtual void repeat_timeout(double time, Fl_Timeout_Handler cb, void *argp) = 0;
virtual int has_timeout(Fl_Timeout_Handler cb, void *argp) = 0;
virtual void remove_timeout(Fl_Timeout_Handler cb, void *argp) = 0;
+
+ static int secret_input_character;
};
diff --git a/src/Fl_Input_.cxx b/src/Fl_Input_.cxx
index 2230a0c7b..e17cfb597 100644
--- a/src/Fl_Input_.cxx
+++ b/src/Fl_Input_.cxx
@@ -19,6 +19,7 @@
#include <FL/Fl.H>
#include <FL/Fl_Input_.H>
#include <FL/Fl_Window.H>
+#include <FL/Fl_Screen_Driver.H>
#include <FL/fl_draw.H>
#include <FL/fl_ask.H>
#include <math.h>
@@ -35,11 +36,6 @@
#define MAXBUF 1024
-#if defined(USE_X11) && !USE_XFT
-const int secret_char = '*'; // asterisk to hide secret input
-#else
-const int secret_char = 0x2022; // bullet to hide secret input
-#endif
static int l_secret;
extern void fl_draw(const char*, int, float, float);
@@ -72,7 +68,7 @@ const char* Fl_Input_::expand(const char* p, char* buf) const {
if (input_type()==FL_SECRET_INPUT) {
while (o<e && p < value_+size_) {
if (fl_utf8len((char)p[0]) >= 1) {
- l_secret = fl_utf8encode(secret_char, o);
+ l_secret = fl_utf8encode(Fl_Screen_Driver::secret_input_character, o);
o += l_secret;
}
p++;
diff --git a/src/Fl_Screen_Driver.cxx b/src/Fl_Screen_Driver.cxx
index eafa23539..a3210c7de 100644
--- a/src/Fl_Screen_Driver.cxx
+++ b/src/Fl_Screen_Driver.cxx
@@ -142,6 +142,8 @@ const char *Fl_Screen_Driver::get_system_scheme()
return 0L;
}
+/** The bullet character used by default by Fl_Secret_Input */
+int Fl_Screen_Driver::secret_input_character = 0x2022;
//
// End of "$Id$".
diff --git a/src/drivers/X11/Fl_X11_Screen_Driver.cxx b/src/drivers/X11/Fl_X11_Screen_Driver.cxx
index e168031c2..f938b1417 100644
--- a/src/drivers/X11/Fl_X11_Screen_Driver.cxx
+++ b/src/drivers/X11/Fl_X11_Screen_Driver.cxx
@@ -102,6 +102,9 @@ static double missed_timeout_by;
*/
Fl_Screen_Driver *Fl_Screen_Driver::newScreenDriver()
{
+#if !USE_XFT
+ secret_input_character = '*';
+#endif
return new Fl_X11_Screen_Driver();
}