24#include <FL/Fl_Window.H>
39 bool enter (
Widget *widget,
int link,
int img,
int x,
int y);
40 bool press (
Widget *widget,
int link,
int img,
int x,
int y,
42 bool release (
Widget *widget,
int link,
int img,
int x,
int y,
44 bool click (
Widget *widget,
int link,
int img,
int x,
int y,
48bool LinkTestReceiver::enter (
Widget *widget,
int link,
int img,
int x,
int y)
50 printf (
"enter: %d\n", link);
54bool LinkTestReceiver::press (
Widget *widget,
int link,
int img,
int x,
int y,
57 printf (
"press: %d\n", link);
61bool LinkTestReceiver::release (
Widget *widget,
int link,
int img,
int x,
int y,
64 printf (
"release: %d\n", link);
68bool LinkTestReceiver::click (
Widget *widget,
int link,
int img,
int x,
int y,
71 printf (
"click: %d\n", link);
75int main(
int argc,
char **argv)
78 int ww = 200, wh = 300, lh = 24;
83 Fl_Window *
window =
new Fl_Window(200, 300,
"Dw Links2");
86 Fl_Widget *Panel =
new Fl_Box(0, 0, ww, lh,
"CONTROL PANEL");
88 Panel->color(FL_GRAY_RAMP + 3);
89 Panel->labelcolor(FL_WHITE);
90 Panel->box(FL_FLAT_BOX);
91 Fl_Widget *Main =
new Fl_Box(0, lh, ww, wh - 2*lh,
"MAIN RENDERING AREA");
92 Main->color(FL_GRAY_RAMP + 4);
93 Main->labelcolor(FL_WHITE);
94 MainIdx =
window->find(Main);
96 Fl_Widget *Bar =
new Fl_Box(0, wh - lh, 200, lh,
"STATUS BAR...");
97 Bar->color(FL_GRAY_RAMP + 3);
98 Bar->labelcolor(FL_WHITE);
99 Bar->box(FL_FLAT_BOX);
121 fontAttrs.
name =
"Bitstream Charter";
152 for(
int i = 1; i <= 30; i++) {
154 sprintf(buf,
"%d.", i);
156 const char *words1[] = {
157 "This",
"is",
"the", buf,
"paragraph.",
158 "Here",
"comes",
"some",
"more",
"text",
159 "to",
"demonstrate",
"word",
"wrapping.",
161 const char *words2[] = {
162 "Click",
"here",
"for",
"more..", NULL };
164 for(
int j = 0; words1[j]; j++) {
172 for(
int j = 0; words2[j]; j++) {
173 textblock->
addText (words2[j], linkStyle);
188 int errorCode = Fl::run();
A Widget for rendering text blocks, i.e.
void addSpace(core::style::Style *style)
?
void addText(const char *text, size_t len, core::style::Style *style)
Add a word to the page structure.
void addParbreak(int space, core::style::Style *style)
Cause a paragraph break.
virtual bool click(Widget *widget, int link, int img, int x, int y, EventButton *event)
Called, when the user has clicked on a link.
virtual bool press(Widget *widget, int link, int img, int x, int y, EventButton *event)
Called, when the user has pressed the mouse button on a link (but not yet released).
virtual bool release(Widget *widget, int link, int img, int x, int y, EventButton *event)
Called, when the user has released the mouse button on a link.
virtual bool enter(Widget *widget, int link, int img, int x, int y)
Called, when a link is entered, left, or the position has changed.
The central class for managing and drawing a widget tree.
void attachView(View *view)
Attach a view to the layout.
void setWidget(Widget *widget)
void connectLink(LinkReceiver *receiver)
static Color * create(Layout *layout, int color)
static Font * create(Layout *layout, FontAttrs *attrs)
static Style * create(StyleAttrs *attrs)
static Style * widgetStyle
static Fl_Window * window
static FltkPlatform * platform
static FltkViewport * viewport
Anything related to Dillo Widget styles is defined here.
@ TEXT_DECORATION_UNDERLINE
The core of Dw is defined in this namespace.
This namespace contains FLTK implementations of Dw interfaces.
Dw is in this namespace, or sub namespaces of this one.