24#include <FL/Fl_Window.H>
42int main(
int argc,
char **argv)
47 Fl_Window *
window =
new Fl_Window(400, 400,
"Dw UI Test");
61 fontAttrs.
name =
"Helvetica";
92 "textarea placeholder!");
115 cbuttontext->
addText (
"Run (complex)!", cellStyle);
116 cbuttontext->
flush ();
121 form->addTextResource (
"val1", entryres1);
122 form->addTextResource (
"val2", entryres2);
123 form->addTextResource (
"text", textres);
124 const char *radiovalues[] = {
"radio1",
"radio2", NULL };
125 form->addRadioButtonResource (
"val3", radiores1, radiovalues);
126 form->addCheckButtonResource (
"check", checkres);
127 const char *selvalues[] = {
"i1",
"g1",
"i11",
"i12",
"i13",
"(pop)",
"i2",
128 "g2",
"i21",
"i22",
"i23",
"(pop)",
"i3", NULL};
129 form->addSelectionResource (
"val4", selres[0], selvalues);
130 form->addSelectionResource (
"val5", selres[1], selvalues);
131 form->addButtonResource (
"button", buttonres,
"Run!");
132 form->addButtonResource (
"cbutton", cbuttonres,
"cbuttonval");
135 table->
addRow (cellStyle);
140 label1->
addText (
"val1 = ", cellStyle);
147 table->
addRow (cellStyle);
152 label2->
addText (
"val2 = ", cellStyle);
159 table->
addRow (cellStyle);
164 label->
addText (
"text = ", cellStyle);
168 textres->
setText(
"Hi textarea");
172 table->
addRow (cellStyle);
176 table->
addCell (radiolabel1, 2, 1);
178 radiolabel1->
addWidget (radio1, cellStyle);
179 radiolabel1->
addText (
" radio1", cellStyle);
180 radiolabel1->
flush ();
182 table->
addRow (cellStyle);
185 table->
addCell (radiolabel2, 2, 1);
187 radiolabel2->
addWidget (radio2, cellStyle);
188 radiolabel2->
addText (
" radio2", cellStyle);
189 radiolabel2->
flush ();
191 table->
addRow (cellStyle);
194 table->
addCell (checklabel, 2, 1);
196 checklabel->
addWidget (check, cellStyle);
197 checklabel->
addText (
" check", cellStyle);
198 checklabel->
flush ();
200 for(
int i = 0; i < 2; i++) {
201 table->
addRow (cellStyle);
207 selres[i]->
addItem(
"item 1",
true,
false);
210 selres[i]->
addItem(
"item 1/1",
true,
false);
211 selres[i]->
addItem(
"item 1/2",
true,
true);
212 selres[i]->
addItem(
"item 1/3",
false,
false);
215 selres[i]->
addItem(
"item 2",
false, i == 1);
218 selres[i]->
addItem(
"item 2/1",
true,
false);
219 selres[i]->
addItem(
"item 2/2",
true,
false);
220 selres[i]->
addItem(
"item 2/3",
false,
false);
223 selres[i]->
addItem(
"item 3",
false,
false);
226 table->
addRow (cellStyle);
231 table->
addRow (cellStyle);
234 table->
addCell (cbutton, 2, 1);
240 int errorCode = Fl::run();
A Widget for rendering tables.
void addCell(Widget *widget, int colspan, int rowspan)
void addRow(core::style::Style *style)
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 addText(const char *text, size_t len, core::style::Style *style)
Add a word to the page structure.
The central class for managing and drawing a widget tree.
void attachView(View *view)
Attach a view to the layout.
void setWidget(Widget *widget)
ui::ResourceFactory * getResourceFactory()
static Color * create(Layout *layout, int color)
static Font * create(Layout *layout, FontAttrs *attrs)
static Style * create(StyleAttrs *attrs)
A widget for embedding UI widgets.
void setStyle(style::Style *style)
Change the style of a widget.
@ SELECTION_AT_MOST_ONE
At most one item is selected.
virtual OptionMenuResource * createOptionMenuResource()=0
virtual EntryResource * createEntryResource(int size, bool password, const char *label, const char *placeholder)=0
virtual MultiLineTextResource * createMultiLineTextResource(int cols, int rows, const char *placeholder)=0
virtual RadioButtonResource * createRadioButtonResource(RadioButtonResource *groupedWith, bool activated)=0
virtual CheckButtonResource * createCheckButtonResource(bool activated)=0
virtual ListResource * createListResource(ListResource::SelectionMode selectionMode, int rows)=0
virtual ComplexButtonResource * createComplexButtonResource(Widget *widget, bool relief)=0
virtual LabelButtonResource * createLabelButtonResource(const char *label)=0
Base interface for dw::core::ui::ListResource and dw::core::ui::OptionMenuResource.
virtual void pushGroup(const char *name, bool enabled)=0
virtual void addItem(const char *str, bool enabled, bool selected)=0
virtual void popGroup()=0
virtual void setText(const char *text)=0
static Fl_Window * window
static FltkPlatform * platform
static FltkViewport * viewport
Anything related to Dillo Widget styles is defined here.
Anything related to embedded UI widgets is defined here.
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.
This namespace provides thin wrappers, implemented as C++ templates, to gain type-safety.
Here, some common classes (or interfaces) are defined, to standardize the access to other classes.