Removed warning for Android. Fixed "FIXME" in Fl_Tooltip. Removed tab characters.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12748 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Matthias Melcher
2018-03-15 09:34:20 +00:00
parent 630fc8e983
commit 67f0018dca
3 changed files with 52 additions and 25 deletions
+2
View File
@@ -34,6 +34,7 @@
*/ */
class FL_EXPORT Fl_Tooltip { class FL_EXPORT Fl_Tooltip {
friend class Fl_TooltipBox;
public: public:
/** Gets the tooltip delay. The default delay is 1.0 seconds. */ /** Gets the tooltip delay. The default delay is 1.0 seconds. */
static float delay() { return delay_; } static float delay() { return delay_; }
@@ -113,6 +114,7 @@ private:
static int margin_width_; //!< distance around tooltip text left+right static int margin_width_; //!< distance around tooltip text left+right
static int margin_height_; //!< distance around tooltip text top+bottom static int margin_height_; //!< distance around tooltip text top+bottom
static int wrap_width_; //!< maximum width of tooltip text before it word wraps static int wrap_width_; //!< maximum width of tooltip text before it word wraps
static const int draw_symbols_; // 1 = draw @-symbols in tooltips, 0 = no
}; };
#endif #endif
+23 -25
View File
@@ -23,25 +23,23 @@
#include <FL/Fl_System_Driver.H> #include <FL/Fl_System_Driver.H>
#include <stdio.h> #include <stdio.h>
#include <string.h> // strdup() #include <string.h> // strdup()
float Fl_Tooltip::delay_ = 1.0f; float Fl_Tooltip::delay_ = 1.0f;
float Fl_Tooltip::hoverdelay_ = 0.2f; float Fl_Tooltip::hoverdelay_ = 0.2f;
Fl_Color Fl_Tooltip::color_ = fl_color_cube(FL_NUM_RED - 1, Fl_Color Fl_Tooltip::color_ = fl_color_cube(FL_NUM_RED - 1,
FL_NUM_GREEN - 1, FL_NUM_GREEN - 1,
FL_NUM_BLUE - 2); FL_NUM_BLUE - 2);
Fl_Color Fl_Tooltip::textcolor_ = FL_BLACK; Fl_Color Fl_Tooltip::textcolor_ = FL_BLACK;
Fl_Font Fl_Tooltip::font_ = FL_HELVETICA; Fl_Font Fl_Tooltip::font_ = FL_HELVETICA;
Fl_Fontsize Fl_Tooltip::size_ = -1; Fl_Fontsize Fl_Tooltip::size_ = -1;
int Fl_Tooltip::margin_width_ = 3; int Fl_Tooltip::margin_width_ = 3;
int Fl_Tooltip::margin_height_ = 3; int Fl_Tooltip::margin_height_ = 3;
int Fl_Tooltip::wrap_width_ = 400; int Fl_Tooltip::wrap_width_ = 400;
const int Fl_Tooltip::draw_symbols_ = 1;
static const char* tip; static const char* tip;
// FIXME: this should be a static class variable: Fl_Tooltip::draw_symbols_
static const int draw_symbols_ = 1; // 1 = draw @-symbols in tooltips, 0 = no
/** /**
This widget creates a tooltip box window, with no caption. This widget creates a tooltip box window, with no caption.
*/ */
@@ -84,7 +82,7 @@ void Fl_TooltipBox::layout() {
fl_font(Fl_Tooltip::font(), Fl_Tooltip::size()); fl_font(Fl_Tooltip::font(), Fl_Tooltip::size());
int ww = Fl_Tooltip::wrap_width(); int ww = Fl_Tooltip::wrap_width();
int hh = 0; int hh = 0;
fl_measure(tip, ww, hh, draw_symbols_); fl_measure(tip, ww, hh, Fl_Tooltip::draw_symbols_);
ww += (Fl_Tooltip::margin_width() * 2); ww += (Fl_Tooltip::margin_width() * 2);
hh += (Fl_Tooltip::margin_height() * 2); hh += (Fl_Tooltip::margin_height() * 2);
@@ -117,7 +115,7 @@ void Fl_TooltipBox::draw() {
int Y = Fl_Tooltip::margin_height(); int Y = Fl_Tooltip::margin_height();
int W = w() - (Fl_Tooltip::margin_width()*2); int W = w() - (Fl_Tooltip::margin_width()*2);
int H = h() - (Fl_Tooltip::margin_height()*2); int H = h() - (Fl_Tooltip::margin_height()*2);
fl_draw(tip, X, Y, W, H, Fl_Align(FL_ALIGN_LEFT|FL_ALIGN_WRAP), 0, draw_symbols_); fl_draw(tip, X, Y, W, H, Fl_Align(FL_ALIGN_LEFT|FL_ALIGN_WRAP), 0, Fl_Tooltip::draw_symbols_);
} }
static char recent_tooltip; static char recent_tooltip;
@@ -156,14 +154,14 @@ static void tooltip_timeout(void*) {
// bugfix: no need to refactor // bugfix: no need to refactor
if (Fl::system_driver()->use_tooltip_timeout_condition()) condition = (Fl::grab() == NULL); if (Fl::system_driver()->use_tooltip_timeout_condition()) condition = (Fl::grab() == NULL);
if ( condition ) { if ( condition ) {
if (!window) window = new Fl_TooltipBox; if (!window) window = new Fl_TooltipBox;
// this cast bypasses the normal Fl_Window label() code: // this cast bypasses the normal Fl_Window label() code:
((Fl_Widget*)window)->label(tip); ((Fl_Widget *) window)->label(tip);
window->layout(); window->layout();
window->redraw(); window->redraw();
// printf("tooltip_timeout: Showing window %p with tooltip \"%s\"...\n", // printf("tooltip_timeout: Showing window %p with tooltip \"%s\"...\n",
// window, tip ? tip : "(null)"); // window, tip ? tip : "(null)");
window->show(); window->show();
} }
} }
} }
+27
View File
@@ -417,6 +417,33 @@ void unlock_ring() {}
#endif // FL_CFG_SYS_POSIX #endif // FL_CFG_SYS_POSIX
// TODO: can these functions be moved to the system drivers?
#ifdef __ANDROID__
static void unlock_ring()
{
// TODO: implement me
}
static void lock_ring()
{
// TODO: implement me
}
static void unlock_function()
{
// TODO: implement me
}
static void lock_function()
{
// TODO: implement me
}
#endif // __ANDROID__
void Fl::awake(void *v) { void Fl::awake(void *v) {
Fl::system_driver()->awake(v); Fl::system_driver()->awake(v);
} }