blob: a9bde2676a6020515d9953896be2eb2b59df25b1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
// Fl_Output.C
// This subclass of Fl_Input_ does not allow user to edit the output.
// Used to display output.
#include <FL/Fl.H>
#include <FL/Fl_Output.H>
#include <FL/fl_draw.H>
void Fl_Output::draw() {
Fl_Boxtype b = box() ? box() : default_box();
if (damage() & FL_DAMAGE_ALL) draw_box(b, color());
Fl_Input_::drawtext(x()+Fl::box_dx(b)+3, y()+Fl::box_dy(b),
w()-Fl::box_dw(b)-6, h()-Fl::box_dh(b));
}
int Fl_Output::handle(int event) {
if (event == FL_FOCUS) return 0;
Fl_Boxtype b = box() ? box() : default_box();
return Fl_Input_::handletext(event,
x()+Fl::box_dx(b)+3, y()+Fl::box_dy(b),
w()-Fl::box_dw(b)-6, h()-Fl::box_dh(b));
}
|