4 #include "util/color.h"
10 struct widget_info_text
{
11 enum format_align align
;
12 unsigned int is_label
:1;
13 unsigned int is_scrollable
:1;
16 struct widget_data_info_text
{
17 /* The number of the first line that should be
18 * displayed within the widget.
19 * This is used only for scrollable text widgets */
22 /* The number of lines saved in @cdata */
25 /* The dialog width to which the lines are wrapped.
26 * This is used to check whether the lines must be
30 /* For mouse scrollbar handling. See bfu/text.c.*/
32 /* Height of selected part of scrollbar. */
35 /* Position of selected part of scrollbar. */
38 /* Direction of last mouse scroll. Used to adjust
39 * scrolling when selected bar part has a low height
40 * (especially the 1 char height) */
41 int scroller_last_dir
;
45 void add_dlg_text(struct dialog
*dlg
, unsigned char *text
,
46 enum format_align align
, int bottom_pad
);
48 extern const struct widget_ops text_ops
;
49 void dlg_format_text_do(struct dialog_data
*dlg_data
,
50 unsigned char *text
, int x
, int *y
, int w
, int *rw
,
51 struct color_pair
*scolor
, enum format_align align
, int format_only
);
54 dlg_format_text(struct dialog_data
*dlg_data
, struct widget_data
*widget_data
,
55 int x
, int *y
, int dlg_width
, int *real_width
, int height
, int format_only
);
57 #define text_is_scrollable(widget_data) \
58 ((widget_data)->widget->info.text.is_scrollable \
59 && (widget_data)->box.height > 0 \
60 && (widget_data)->info.text.lines > 0 \
61 && (widget_data)->box.height < (widget_data)->info.text.lines)