summaryrefslogtreecommitdiff
path: root/src/widget.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-08-01 09:34:34 +0000
committerrubidium <rubidium@openttd.org>2008-08-01 09:34:34 +0000
commit019a51944696e5619ac6c635e1ce1d8af0981788 (patch)
tree2ff51cc080d35422ab3d268a167cf4863270082e /src/widget.cpp
parent6a401d5dfc04cc5e57dcdb8bcc2192f74e06a220 (diff)
downloadopenttd-019a51944696e5619ac6c635e1ce1d8af0981788.tar.xz
(svn r13910) -Document: string drawing related functions and types (Alberth)
Diffstat (limited to 'src/widget.cpp')
-rw-r--r--src/widget.cpp22
1 files changed, 19 insertions, 3 deletions
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];