2#include <FL/Fl_Window.H>
19 printf(
"addTextToFloatTimeout\n");
21 const char *fWords[] = {
"This",
"is",
"a",
"float,",
"which",
"is",
22 "set",
"aside",
"from",
"the",
"main",
25 for(
int k = 0; fWords[k]; k++) {
35int main(
int argc,
char **argv)
40 Fl_Window *
window =
new Fl_Window(400, 600,
"Dw Floats Example");
51 fontAttrs.
name =
"Bitstream Charter";
88 for(
int i = 1; i <= 10; i++) {
90 snprintf(buf,
sizeof(buf),
"%d%s",
91 i, (i == 1 ?
"st" : (i == 2 ?
"nd" : (i == 3 ?
"rd" :
"th"))));
93 const char *words[] = {
"This",
"is",
"the", buf,
"paragraph.",
94 "Here",
"comes",
"some",
"more",
"text",
95 "to",
"demonstrate",
"word",
"wrapping.",
98 for(
int j = 0; words[j]; j++) {
102 if ((i == 3 || i == 5) && j == 8) {
107 textblock->
addWidget(vloat, i == 3 ? leftFloatStyle : rightFloatStyle);
109 const char *fWords[] = {
"This",
"is",
"a",
"float,",
"which",
"is",
110 "set",
"aside",
"from",
"the",
"main",
116 for(
int k = 0; fWords[k]; k++) {
131 leftFloatStyle->
unref();
132 rightFloatStyle->
unref();
139 int errorCode = Fl::run();
A Widget for rendering text blocks, i.e.
void addWidget(core::Widget *widget, core::style::Style *style)
Add a widget (word type) to the page.
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.
The central class for managing and drawing a widget tree.
void attachView(View *view)
Attach a view to the layout.
void setWidget(Widget *widget)
static Color * create(Layout *layout, int color)
static Font * create(Layout *layout, FontAttrs *attrs)
void setBorderStyle(BorderStyle val)
void setBorderColor(Color *val)
static Style * create(StyleAttrs *attrs)
static Style * widgetStyle
static Fl_Window * window
static FltkPlatform * platform
static FltkViewport * viewport
static Textblock * firstFloat
static void addTextToFloatTimeout(void *data)
Anything related to Dillo Widget styles is defined here.
Length createAbsLength(int n)
Returns a length of n pixels.
@ LENGTH_AUTO
Represents "auto" lengths.
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.