From 019a51944696e5619ac6c635e1ce1d8af0981788 Mon Sep 17 00:00:00 2001 From: rubidium Date: Fri, 1 Aug 2008 09:34:34 +0000 Subject: (svn r13910) -Document: string drawing related functions and types (Alberth) --- src/widget.cpp | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'src/widget.cpp') diff --git a/src/widget.cpp b/src/widget.cpp index 47e6f7097..92c402e5d 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -17,13 +17,21 @@ static const char *UPARROW = "\xEE\x8A\xA0"; static const char *DOWNARROW = "\xEE\x8A\xAA"; +/** + * Compute the vertical position of the draggable part of scrollbar + * @param sb Scrollbar list data + * @param top Top position of the scrollbar (top position of the up-button) + * @param bottom Bottom position of the scrollbar (bottom position of the down-button) + * @return A Point, with x containing the top coordinate of the draggable part, and + * y containing the bottom coordinate of the draggable part + */ static Point HandleScrollbarHittest(const Scrollbar *sb, int top, int bottom) { Point pt; int height, count, pos, cap; - top += 10; - bottom -= 9; + top += 10; // top points to just below the up-button + bottom -= 9; // bottom points to top of the down-button height = (bottom - top); @@ -153,7 +161,15 @@ int GetWidgetFromPos(const Window *w, int x, int y) return found_index; } - +/** + * Draw frame rectangle. + * @param left Left edge of the frame + * @param top Top edge of the frame + * @param right Right edge of the frame + * @param bottom Bottom edge of the frame + * @param ctab Colour table to use. @see _colour_gradient + * @param flags Flags controlling how to draw the frame. @see FrameFlags + */ void DrawFrameRect(int left, int top, int right, int bottom, int ctab, FrameFlags flags) { uint dark = _colour_gradient[ctab][3]; -- cgit v1.2.3-54-g00ecf