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

« back to all changes in this revision

Viewing changes to src/Fl_Widget.cxx

  • Committer: Bazaar Package Importer
  • Author(s): Aaron M. Ucko
  • Date: 2005-05-22 13:57:06 UTC
  • mfrom: (2.1.1 hoary)
  • Revision ID: james.westby@ubuntu.com-20050522135706-mchag24yf42lu7bu
Tags: 1.1.6-5
* Revert previous change, which seems to have been ineffective for some
  reason, in favor of commenting out the problematic Makefile rule
  altogether.  (Closes: #310151.)
* debian/control: Go back to specifying the URL as part of the
  description rather than via a non-standard field that doesn't seem to
  have caught on.  (Closes: #310240.)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
//
2
 
// "$Id: Fl_Widget.cxx,v 1.5.2.4.2.23 2004/04/11 04:38:58 easysw Exp $"
 
2
// "$Id: Fl_Widget.cxx,v 1.5.2.4.2.26 2004/11/23 19:51:03 easysw Exp $"
3
3
//
4
4
// Base widget class for the Fast Light Tool Kit (FLTK).
5
5
//
28
28
#include <FL/Fl_Group.H>
29
29
#include <FL/Fl_Tooltip.H>
30
30
#include <FL/fl_draw.H>
 
31
#include <stdlib.h>
 
32
#include "flstring.h"
31
33
 
32
34
 
33
35
////////////////////////////////////////////////////////////////
129
131
// However, it is only legal to destroy a "root" such as an Fl_Window,
130
132
// and automatic destructors may be called.
131
133
Fl_Widget::~Fl_Widget() {
 
134
  if (flags() & COPIED_LABEL) free((void *)(label_.value));
132
135
  parent_ = 0; // Don't throw focus to a parent widget.
133
136
  fl_throw_focus(this);
134
137
}
150
153
 
151
154
  fl_color(fl_contrast(FL_BLACK, color()));
152
155
 
153
 
#if defined(WIN32) || defined(__APPLE__)
 
156
#if defined(WIN32) || defined(__APPLE_QD__)
154
157
  // Windows 95/98/ME do not implement the dotted line style, so draw
155
158
  // every other pixel around the focus area...
156
159
  //
244
247
  return 0;
245
248
}
246
249
 
 
250
 
 
251
void
 
252
Fl_Widget::label(const char *a) {
 
253
  if (flags() & COPIED_LABEL) {
 
254
    free((void *)(label_.value));
 
255
    clear_flag(COPIED_LABEL);
 
256
  }
 
257
  label_.value=a;
 
258
  redraw_label();
 
259
}
 
260
 
 
261
 
 
262
void
 
263
Fl_Widget::copy_label(const char *a) {
 
264
  if (flags() & COPIED_LABEL) free((void *)(label_.value));
 
265
  set_flag(COPIED_LABEL);
 
266
  label_.value=strdup(a);
 
267
  redraw_label();
 
268
}
 
269
 
 
270
 
247
271
//
248
 
// End of "$Id: Fl_Widget.cxx,v 1.5.2.4.2.23 2004/04/11 04:38:58 easysw Exp $".
 
272
// End of "$Id: Fl_Widget.cxx,v 1.5.2.4.2.26 2004/11/23 19:51:03 easysw Exp $".
249
273
//