While still working on modifying the "track info + seekbar + buttons" sample script, I moved the seekbar around a bit. I had trouble moving the %playback_time% and %length% text to follow it, as the text kept appearing above where I expected.
The panel height is currently 228 pixels. The var seekbar.y is (panel.h - 20) / 2, which is 104, and the seekbar is about where I expect it to be. So I figured I needed 104 or thereabouts for the gr.GdiDrawText 'h' value, but that doesn't work. I did some testing and came up with this...
//Test
// syntax: gr.GdiDrawText(str, IGdiFont, color, x, y, w, h, [format]);
gr.GdiDrawText("50h", _.gdiFont("Segoe UI", 12, 0), _.RGB(255, 255, 0), seekbar.x + seekbar.w + 60, 0, 40, 50, RIGHT);
gr.GdiDrawText("150h", _.gdiFont("Segoe UI", 12, 0), _.RGB(255, 255, 0), seekbar.x + seekbar.w + 60, 0, 40, 150, RIGHT);
gr.GdiDrawText("228h", _.gdiFont("Segoe UI", 12, 0), _.RGB(255, 255, 0), seekbar.x + seekbar.w + 60, 0, 40, 228, RIGHT);
gr.GdiDrawText("456h", _.gdiFont("Segoe UI", 12, 0), _.RGB(255, 255, 0), seekbar.x + seekbar.w + 60, 0, 40, 456, RIGHT);
gr.GdiDrawText("panel.h = " + panel.h, _.gdiFont("Segoe UI", 12, 0), _.RGB(255, 255, 255), 10, panel.h - 70, 900, 24, LEFT);
...which produces the result shown below. I see now that the value of 'h' needs to be double the pixel distance the text is to be moved below 'y' (which is zero in this case). Not what I expected, but at least it's not hard to remember.
Why does gr.GdiDrawText work this way?