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