*/
#include <windows.h>
+#include <commctrl.h>
#include <stdio.h>
#include <assert.h>
struct frontend {
midend_data *me;
- HWND hwnd;
+ HWND hwnd, statusbar;
HBITMAP bitmap, prevbm;
HDC hdc_bm;
COLORREF *colours;
exit(1);
}
+void status_bar(frontend *fe, char *text)
+{
+ SetWindowText(fe->statusbar, text);
+}
+
void frontend_default_colour(frontend *fe, float *output)
{
DWORD c = GetSysColor(COLOR_MENU); /* ick */
{
frontend *fe;
int x, y;
- RECT r;
+ RECT r, sr;
HDC hdc;
fe = snew(frontend);
SetMenu(fe->hwnd, bar);
}
+ if (midend_wants_statusbar(fe->me)) {
+ fe->statusbar = CreateWindowEx(0, STATUSCLASSNAME, "ooh",
+ WS_CHILD | WS_VISIBLE,
+ 0, 0, 0, 0, /* status bar does these */
+ fe->hwnd, NULL, inst, NULL);
+ GetWindowRect(fe->statusbar, &sr);
+ SetWindowPos(fe->hwnd, NULL, 0, 0,
+ r.right - r.left, r.bottom - r.top + sr.bottom - sr.top,
+ SWP_NOMOVE | SWP_NOZORDER);
+ SetWindowPos(fe->statusbar, NULL, 0, y, x, sr.bottom - sr.top,
+ SWP_NOZORDER);
+ } else {
+ fe->statusbar = NULL;
+ }
+
hdc = GetDC(fe->hwnd);
fe->bitmap = CreateCompatibleBitmap(hdc, x, y);
ReleaseDC(fe->hwnd, hdc);
int p = ((wParam &~ 0xF) - IDM_PRESETS) / 0x10;
if (p >= 0 && p < fe->npresets) {
- RECT r;
+ RECT r, sr;
HDC hdc;
int x, y;
WS_OVERLAPPED),
TRUE, 0);
+ if (fe->statusbar != NULL) {
+ GetWindowRect(fe->statusbar, &sr);
+ } else {
+ sr.left = sr.right = sr.top = sr.bottom = 0;
+ }
SetWindowPos(fe->hwnd, NULL, 0, 0,
- r.right - r.left, r.bottom - r.top,
+ r.right - r.left,
+ r.bottom - r.top + sr.bottom - sr.top,
SWP_NOMOVE | SWP_NOZORDER);
+ if (fe->statusbar != NULL)
+ SetWindowPos(fe->statusbar, NULL, 0, y, x,
+ sr.bottom - sr.top, SWP_NOZORDER);
DeleteObject(fe->bitmap);
srand(time(NULL));
+ InitCommonControls();
+
if (!prev) {
WNDCLASS wndclass;