Line style and focus boxes.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1821 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet 2001-12-07 16:28:38 +00:00
parent e92f9842b7
commit a93a8031f1
2 changed files with 22 additions and 7 deletions

View File

@ -1,5 +1,5 @@
//
// "$Id: Fl_Widget.cxx,v 1.5.2.4.2.8 2001/11/28 20:43:44 easysw Exp $"
// "$Id: Fl_Widget.cxx,v 1.5.2.4.2.9 2001/12/07 16:28:38 easysw Exp $"
//
// Base widget class for the Fast Light Tool Kit (FLTK).
//
@ -147,9 +147,13 @@ Fl_Widget::draw_focus(Fl_Boxtype B, int X, int Y, int W, int H) const {
fl_color(fl_contrast(FL_BLACK, color()));
#ifdef WIN32
#if defined(WIN32) || defined(__APPLE__)
// Windows 95/98/ME do not implement the dotted line style, so draw
// every other pixel around the focus area...
//
// Also, QuickDraw (MacOS) does not support line styles specifically,
// and the hack we use in fl_line_style() will not horizontal lines
// on odd-numbered rows...
int i, xx, yy;
X += Fl::box_dx(B);
@ -244,5 +248,5 @@ int Fl_Widget::contains(const Fl_Widget *o) const {
}
//
// End of "$Id: Fl_Widget.cxx,v 1.5.2.4.2.8 2001/11/28 20:43:44 easysw Exp $".
// End of "$Id: Fl_Widget.cxx,v 1.5.2.4.2.9 2001/12/07 16:28:38 easysw Exp $".
//

View File

@ -1,5 +1,5 @@
//
// "$Id: fl_line_style.cxx,v 1.3.2.3.2.6 2001/11/27 17:44:08 easysw Exp $"
// "$Id: fl_line_style.cxx,v 1.3.2.3.2.7 2001/12/07 16:28:38 easysw Exp $"
//
// Line style code for the Fast Light Tool Kit (FLTK).
//
@ -55,8 +55,19 @@ void fl_line_style(int style, int width, char* dashes) {
DeleteObject(oldpen);
fl_current_xmap->pen = newpen;
#elif defined(__APPLE__)
//++
// Use PenPat, PenSize
// QuickDraw supports pen size and pattern, but no arbitrary line styles.
static Pattern styles[] = {
{ { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff } }, // FL_SOLID
{ { 0xcc, 0xcc, 0x00, 0x00, 0xcc, 0xcc, 0x00, 0x00 } }, // FL_DASH
{ { 0xaa, 0x00, 0xaa, 0x00, 0xaa, 0x00, 0xaa, 0x00 } } // FL_DOT
};
if (!width) width = 1;
PenSize(width, width);
style &= 0xff;
if (style > 2) style = 2;
PenPat(styles + style);
#else
int ndashes = dashes ? strlen(dashes) : 0;
// emulate the WIN32 dash patterns on X
@ -93,5 +104,5 @@ void fl_line_style(int style, int width, char* dashes) {
//
// End of "$Id: fl_line_style.cxx,v 1.3.2.3.2.6 2001/11/27 17:44:08 easysw Exp $".
// End of "$Id: fl_line_style.cxx,v 1.3.2.3.2.7 2001/12/07 16:28:38 easysw Exp $".
//