1998-10-20 00:46:58 +04:00
|
|
|
//
|
2005-02-25 00:55:12 +03:00
|
|
|
// "$Id$"
|
1998-10-20 00:46:58 +04:00
|
|
|
//
|
|
|
|
// Forms pixmap drawing routines for the Fast Light Tool Kit (FLTK).
|
|
|
|
//
|
2010-11-29 00:06:39 +03:00
|
|
|
// Copyright 1998-2010 by Bill Spitzak and others.
|
1998-10-20 00:46:58 +04:00
|
|
|
//
|
2011-07-19 08:49:30 +04:00
|
|
|
// This library is free software. Distribution and use rights are outlined in
|
|
|
|
// the file "COPYING" which should have been included with this file. If this
|
|
|
|
// file is missing or damaged, see the license at:
|
|
|
|
//
|
|
|
|
// http://www.fltk.org/COPYING.php
|
1998-10-20 00:46:58 +04:00
|
|
|
//
|
2005-04-16 04:13:17 +04:00
|
|
|
// Please report all bugs and problems on the following page:
|
|
|
|
//
|
|
|
|
// http://www.fltk.org/str.php
|
1998-10-20 00:46:58 +04:00
|
|
|
//
|
1998-10-06 22:21:25 +04:00
|
|
|
|
|
|
|
#include <FL/forms.H>
|
|
|
|
|
2008-10-02 02:02:55 +04:00
|
|
|
/**
|
2008-12-07 18:46:43 +03:00
|
|
|
Creates a new Fl_FormsPixmap widget using the given box type, position,
|
2008-10-02 02:02:55 +04:00
|
|
|
size and label string.
|
|
|
|
\param[in] t box type
|
|
|
|
\param[in] X, Y, W, H position and size
|
|
|
|
\param[in] L widget label, default is no label
|
|
|
|
*/
|
1998-10-06 22:21:25 +04:00
|
|
|
Fl_FormsPixmap::Fl_FormsPixmap(
|
2008-10-02 02:02:55 +04:00
|
|
|
Fl_Boxtype t, int X, int Y, int W, int H, const char* L)
|
|
|
|
: Fl_Widget(X, Y, W, H, L) {
|
1998-10-06 22:21:25 +04:00
|
|
|
box(t);
|
|
|
|
b = 0;
|
|
|
|
color(FL_BLACK);
|
|
|
|
align(FL_ALIGN_BOTTOM);
|
|
|
|
}
|
|
|
|
|
2008-10-02 02:02:55 +04:00
|
|
|
/**
|
|
|
|
Set/create the internal pixmap using raw data.
|
|
|
|
\param[in] bits raw data
|
|
|
|
*/
|
1998-10-06 22:21:25 +04:00
|
|
|
void Fl_FormsPixmap::set(char*const* bits) {
|
|
|
|
delete b;
|
|
|
|
b = new Fl_Pixmap(bits);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Fl_FormsPixmap::draw() {
|
|
|
|
draw_box(box(), selection_color());
|
|
|
|
if (b) {fl_color(color()); b->draw(x(), y(), w(), h());}
|
|
|
|
draw_label();
|
|
|
|
}
|
1998-10-20 00:46:58 +04:00
|
|
|
|
|
|
|
//
|
2005-02-25 00:55:12 +03:00
|
|
|
// End of "$Id$".
|
1998-10-20 00:46:58 +04:00
|
|
|
//
|