~ubuntu-branches/ubuntu/jaunty/fltk1.1/jaunty

« back to all changes in this revision

Viewing changes to src/fl_show_colormap.cxx

  • Committer: Bazaar Package Importer
  • Author(s): Aaron M. Ucko
  • Date: 2007-02-21 16:56:13 UTC
  • mfrom: (2.1.5 edgy)
  • Revision ID: james.westby@ubuntu.com-20070221165613-tgsyru29aprq97yj
Tags: 1.1.7-3
* debian/po/pt.po: new (European) Portuguese translation for
  libfltk1.1-dev, courtesy of Pedro Ribeiro <p.m42.ribeiro@gmail.com>.
  (Closes: #410733.)
* Declare (preexisting) compliance with Standards-Version: 3.7.2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
//
2
 
// "$Id: fl_show_colormap.cxx,v 1.5.2.4.2.6 2004/04/11 04:39:00 easysw Exp $"
 
2
// "$Id: fl_show_colormap.cxx 4288 2005-04-16 00:13:17Z mike $"
3
3
//
4
4
// Colormap color selection dialog for the Fast Light Tool Kit (FLTK).
5
5
//
6
 
// Copyright 1998-2004 by Bill Spitzak and others.
 
6
// Copyright 1998-2005 by Bill Spitzak and others.
7
7
//
8
8
// This library is free software; you can redistribute it and/or
9
9
// modify it under the terms of the GNU Library General Public
20
20
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
21
21
// USA.
22
22
//
23
 
// Please report all bugs and problems to "fltk-bugs@fltk.org".
 
23
// Please report all bugs and problems on the following page:
 
24
//
 
25
//     http://www.fltk.org/str.php
24
26
//
25
27
 
26
28
// Select a color from the colormap.
116
118
    int by = (c/8)*BOXSIZE+BORDER;
117
119
    int px = x();
118
120
    int py = y();
119
 
    if (px+bx+BOXSIZE+BORDER >= Fl::w()) px = Fl::w()-bx-BOXSIZE-BORDER;
120
 
    if (py+by+BOXSIZE+BORDER >= Fl::h()) py = Fl::h()-by-BOXSIZE-BORDER;
 
121
    int scr_x, scr_y, scr_w, scr_h;
 
122
    Fl::screen_xywh(scr_x, scr_y, scr_w, scr_h);
 
123
    if (px < scr_x) px = scr_x;
 
124
    if (px+bx+BOXSIZE+BORDER >= scr_x+scr_w) px = scr_x+scr_w-bx-BOXSIZE-BORDER;
 
125
    if (py < scr_y) py = scr_y;
 
126
    if (py+by+BOXSIZE+BORDER >= scr_y+scr_h) py = scr_y+scr_h-by-BOXSIZE-BORDER;
121
127
    if (px+bx < BORDER) px = BORDER-bx;
122
128
    if (py+by < BORDER) py = BORDER-by;
123
129
    position(px,py);
151
157
}
152
158
 
153
159
//
154
 
// End of "$Id: fl_show_colormap.cxx,v 1.5.2.4.2.6 2004/04/11 04:39:00 easysw Exp $".
 
160
// End of "$Id: fl_show_colormap.cxx 4288 2005-04-16 00:13:17Z mike $".
155
161
//