void set_text(const TCHAR *_text) { assert_none_locked(); assert_thread(); text = _text; invalidate(); }
void Window::created(HWND _hWnd) { assert(hWnd == NULL); hWnd = _hWnd; assert_thread(); }
/** * Specifies whether this window can get user input. */ void set_enabled(bool enabled) { assert_thread(); #ifdef ENABLE_SDL // XXX #else ::EnableWindow(hWnd, enabled); #endif }
void set_capture() { assert_none_locked(); assert_thread(); #ifdef ENABLE_SDL // XXX #else ::SetCapture(hWnd); #endif }
void release_capture() { assert_none_locked(); assert_thread(); #ifdef ENABLE_SDL // XXX #else ::ReleaseCapture(); #endif }
void kill_timer(timer_t id) { assert_thread(); #ifdef ENABLE_SDL delete id; #else ::KillTimer(hWnd, id); #endif }
void SingleWindow::CancelDialog() { assert_thread(); assert(!dialogs.empty()); Window *dialog = dialogs.top(); dialog->reset(); }
void send_command(const Window &from) { assert_none_locked(); assert_thread(); #ifdef ENABLE_SDL // XXX #else /* !ENABLE_SDL */ ::SendMessage(hWnd, WM_COMMAND, (WPARAM)0, (LPARAM)from.hWnd); #endif /* !ENABLE_SDL */ }
void set_font(const Font &font) { assert_none_locked(); assert_thread(); #ifdef ENABLE_SDL // XXX #else ::SendMessage(hWnd, WM_SETFONT, (WPARAM)font.native(), MAKELPARAM(TRUE,0)); #endif }
timer_t set_timer(unsigned id, unsigned ms) { assert_thread(); #ifdef ENABLE_SDL return new SDLTimer(*this, ms); #else ::SetTimer(hWnd, id, ms, NULL); return id; #endif }
void show_on_top() { assert_none_locked(); assert_thread(); #ifdef ENABLE_SDL bring_to_top(); show(); #else ::SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0, SWP_SHOWWINDOW|SWP_NOMOVE|SWP_NOSIZE); #endif }
/** * Like move(), but does not trigger a synchronous redraw. The * caller is responsible for redrawing. */ void fast_move(int left, int top, unsigned width, unsigned height) { assert_none_locked(); assert_thread(); #ifdef ENABLE_SDL move(left, top, width, height); #else /* !ENABLE_SDL */ ::SetWindowPos(hWnd, NULL, left, top, width, height, SWP_NOCOPYBITS | SWP_NOREDRAW | SWP_DEFERERASE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOOWNERZORDER); #endif }
void move(int left, int top, unsigned width, unsigned height) { assert_none_locked(); assert_thread(); #ifdef ENABLE_SDL // XXX #else /* !ENABLE_SDL */ ::SetWindowPos(hWnd, NULL, left, top, width, height, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOOWNERZORDER); // XXX store new size? #endif }
void move(int left, int top) { assert_none_locked(); assert_thread(); #ifdef ENABLE_SDL this->left = left; this->top = top; #else ::SetWindowPos(hWnd, NULL, left, top, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOOWNERZORDER); #endif }
/** * Like hide(), but does not trigger a synchronous redraw of the * parent window's background. */ void fast_hide() { assert_thread(); #ifdef ENABLE_SDL hide(); #else ::SetWindowPos(hWnd, NULL, 0, 0, 0, 0, SWP_HIDEWINDOW | SWP_NOCOPYBITS | SWP_NOREDRAW | SWP_DEFERERASE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOOWNERZORDER); #endif }
void set_text(const TCHAR *_text) { assert_none_locked(); assert_thread(); #ifndef USE_GDI if (_text != NULL) text = _text; else text.clear(); invalidate(); #else /* USE_GDI */ ::SetWindowText(hWnd, _text); #endif /* USE_GDI */ }
bool is_down() const { assert_none_locked(); assert_thread(); return (Button_GetState(hWnd) & BST_PUSHED) != 0; }
/* True if somebody has called `pulse()`. */ bool is_pulsed() const { assert_thread(); return pulsed; }
void EndPaint(PAINTSTRUCT *ps) { assert_thread(); ::EndPaint(hWnd, ps); }
virtual ~store_view_t() { assert_thread(); }
HDC BeginPaint(PAINTSTRUCT *ps) { assert_thread(); return ::BeginPaint(hWnd, ps); }
void set_userdata(void *value) { assert_thread(); ::SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR)value); }
void bring_to_top() { assert_none_locked(); assert_thread(); ::BringWindowToTop(hWnd); }
WNDPROC set_wndproc(WNDPROC wndproc) { assert_thread(); return (WNDPROC)::SetWindowLongPtr(hWnd, GWLP_WNDPROC, (LONG_PTR)wndproc); }
void show() { assert_thread(); ::ShowWindow(hWnd, SW_SHOW); }
void hide() { assert_thread(); ::ShowWindow(hWnd, SW_HIDE); }
void set_focus() { assert_none_locked(); assert_thread(); ::SetFocus(hWnd); }
void set_text(const TCHAR *text) { assert_none_locked(); assert_thread(); ::SetWindowText(hWnd, text); }
void add(const std::string &msg) { assert_thread(); events.push_back(msg); }
const val_t &wait() const { assert_thread(); cond.wait_lazily_unordered(); return *value.get(); }