#ifndef __DW_UI_HH__
#define __DW_UI_HH__
#ifndef __INCLUDED_FROM_DW_CORE_HH__
# error Do not include this file directly, use "core.hh" instead.
#endif
namespace dw {
namespace core {
/**
* \brief Anything related to embedded UI widgets is defined here.
*
* UI resources are another abstraction for Dw widgets, which are not
* fully implemented in a platform-independent way. Typically, they
* involve creating widgets, which the underlying UI toolkit provides.
*
* As you see in this diagram:
*
* \dot
* digraph G {
* node [shape=record, fontname=Helvetica, fontsize=10];
* edge [arrowhead="none", arrowtail="empty", labelfontname=Helvetica,
* labelfontsize=10, color="#404040", labelfontcolor="#000080"];
* fontname=Helvetica; fontsize=10;
*
* subgraph cluster_core {
* style="dashed"; color="#000080"; fontname=Helvetica; fontsize=10;
* label="dw::core";
*
* subgraph cluster_ui {
* style="dashed"; color="#000080"; fontname=Helvetica; fontsize=10;
* label="dw::core::ui";
*
* Embed [URL="\ref dw::core::ui::Embed"];
* Resource [color="#a0a0a0", URL="\ref dw::core::ui::Resource"];
* LabelButtonResource [color="#a0a0a0",
* URL="\ref dw::core::ui::LabelButtonResource"];
* EntryResource [color="#a0a0a0",
* URL="\ref dw::core::ui::EntryResource"];
* etc [color="#a0a0a0", label="..."];
* }
*
* Widget [URL="\ref dw::core::Widget", color="#a0a0a0"];
* }
*
* subgraph cluster_fltk {
* style="dashed"; color="#000080"; fontname=Helvetica; fontsize=10;
* label="dw::fltk::ui";
*
* FltkLabelButtonResource
* [URL="\ref dw::fltk::ui::FltkLabelButtonResource"];
* FltkEntryResource [URL="\ref dw::fltk::ui::FltkEntryResource"];
* }
*
* Widget -> Embed;
* Embed -> Resource [arrowhead="open", arrowtail="none",
* headlabel="1", taillabel="1"];
* Resource -> LabelButtonResource;
* Resource -> EntryResource;
* Resource -> etc;
* LabelButtonResource -> FltkLabelButtonResource;
* EntryResource -> FltkEntryResource;
* }
* \enddot
*
*
[\ref uml-legend "legend"]
*
* there are several levels:
*
*
*
The Dw widget is dw::core::ui::Embed. It delegates most to
* dw::core::ui::Resource, which has similar methods like
* dw::core::Widget.
*
*
There are several sub interfaces of dw::core::ui::Resource, which
* may provide methods, as e.g. dw::core::ui::ListResource::addItem. In a
* platform independent context, you can cast the result of
* dw::core::ui::Embed::getResource to a specific sub class, if you
* know, which one is used. E.g., if you know, that a given instance
* dw::core::ui::Embed refers to a dw::core::ui::ListResource, you can
* write something like:
*
* \code
* dw::core::ui::Embed *embed;
* //...
* ((dw::core::ui::ListResource*)embed->getResource ())->addItem ("Hello!");
* \endcode
*
*
These sub classes are then fully implemented in a platform specific
* way. For an example, look at dw::fltk::ui.
*
*
* There is a factory interface, dw::core::ui::ResourceFactory, which
* provides methods for creating common resources. By calling
* dw::core::Layout::getResourceFactory, which calls
* dw::core::Platform::getResourceFactory, you get the factory for the used
* platform.
*
* It is possible to define additional sub classes of
* dw::core::ui::Resource, but since they are not provided by
* dw::core::ui::ResourceFactory, you have to define some other
* abstractions, if you want to remain platform independent.
*
*
*
...
*
*
*
Resouces needed for HTML
*
* This chapter describes, how the form controls defined by HTML are
* implemented in Dw. Some of them do not refer to UI resources, but to
* other widgets, links to the respective documentations are provided
* here.
*
*
Resouces created with \
*
* The HTML \ is always implemented by using UI
* resources. \ element has the following attributes:
*
*
*
Attribute
Implementation
*
type
This defines the resource you have to instantiate.
*
name
Not needed within Dw.
*
value
The initial value is treated differently by different
* resources.
*
checked
Parameter to
* dw::core::ui::ResourceFactory::createCheckButtonResource
* and dw::core::ui::ResourceFactory::createRadioButtonResource.
*
disabled
This is provided for all resources by
* dw::core::ui::Resource::setEnabled.
*
readonly
This is provided by
* dw::core::ui::TextResource::setEditable.
*
size
This is handled by styles.
*
maxlength
Parameter of
* dw::core::ui::ResourceFactory::createEntryResource.
*
src
Handled by the caller (HTML parser).
*
alt
Handled by the caller (HTML parser).
*
usemap
Handled by the caller (HTML parser).
*
ismap
Handled by the caller (HTML parser).
*
tabindex
Not supported currently.
*
accesskey
Not supported currently.
*
onfocus
Not supported currently.
*
onblur
Not supported currently.
*
onselect
Not supported currently.
*
onchange
Not supported currently.
*
accept
Not supported currently.
*
*
* For the different values of \em type, the following resources can be
* used:
*
*