From 6e16d033aefffab71e2674143bbb722bf43df7c0 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Mon, 1 Feb 2016 23:06:14 +0000 Subject: Add fl_focus_rect function to driver. Focus rectangles are dotted lines. The default implementation uses the dotted line style, However, for systems without line stye, we draw many dots instead. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11110 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Device.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/Fl_Device.cxx') diff --git a/src/Fl_Device.cxx b/src/Fl_Device.cxx index 689ee4654..c4b7c8585 100644 --- a/src/Fl_Device.cxx +++ b/src/Fl_Device.cxx @@ -20,6 +20,7 @@ #include "config_lib.h" #include #include +#include #ifdef FL_CFG_GFX_QUARTZ #include "drivers/Quartz/Fl_Quartz_Graphics_Driver.h" @@ -87,6 +88,13 @@ void Fl_Graphics_Driver::text_extents(const char*t, int n, int& dx, int& dy, int dy = descent(); } +void Fl_Graphics_Driver::focus_rect(int x, int y, int w, int h) +{ + line_style(FL_DOT); + rect(x, y, w, h); + line_style(FL_SOLID); +} + /** A constructor that sets the graphics driver used by the display */ Fl_Display_Device::Fl_Display_Device(Fl_Graphics_Driver *graphics_driver) : Fl_Surface_Device(graphics_driver) { this->set_current(); -- cgit v1.2.3