本文整理匯總了C++中AssertNoneLocked函數的典型用法代碼示例。如果您正苦於以下問題:C++ AssertNoneLocked函數的具體用法?C++ AssertNoneLocked怎麽用?C++ AssertNoneLocked使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了AssertNoneLocked函數的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: AssertNoneLocked
LRESULT CALLBACK
Window::WndProc(HWND _hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
enum {
#ifndef _WIN32_WCE
WM_VERY_FIRST = WM_NCCREATE,
#else
WM_VERY_FIRST = WM_CREATE,
#endif
};
AssertNoneLocked();
if (message == WM_GETMINMAXINFO)
/* WM_GETMINMAXINFO is called before WM_CREATE, and we havn't set
a Window pointer yet - let DefWindowProc() handle it */
return ::DefWindowProc(_hWnd, message, wParam, lParam);
Window *window;
if (message == WM_VERY_FIRST) {
LPCREATESTRUCT cs = (LPCREATESTRUCT)lParam;
window = (Window *)cs->lpCreateParams;
window->Created(_hWnd);
window->SetUserData(window);
} else {
window = GetUnchecked(_hWnd);
}
LRESULT result = window->OnMessage(_hWnd, message, wParam, lParam);
AssertNoneLocked();
return result;
}
示例2: AssertNoneLocked
void
EventLoop::Dispatch(const Event &event)
{
AssertNoneLocked();
::TranslateMessage(&event.msg);
::DispatchMessage(&event.msg);
AssertNoneLocked();
}
示例3: AssertNoneLocked
void
LargeTextWindow::SetText(const TCHAR *text)
{
AssertNoneLocked();
// Replace \n by \r\r\n to enable usage of line-breaks in edit control
unsigned size = _tcslen(text);
TCHAR buffer[size * sizeof(TCHAR) * 3];
const TCHAR* p2 = text;
TCHAR* p3 = buffer;
for (; *p2 != _T('\0'); p2++) {
if (*p2 == _T('\n')) {
*p3 = _T('\r');
p3++;
*p3 = _T('\r');
p3++;
*p3 = _T('\n');
} else if (*p2 == _T('\r')) {
continue;
} else {
*p3 = *p2;
}
p3++;
}
*p3 = _T('\0');
::SetWindowText(hWnd, buffer);
}
示例4: SetFont
void SetFont(const Font &_font) {
AssertNoneLocked();
AssertThread();
font = &_font;
Invalidate();
}
示例5: set_text
void set_text(const TCHAR *_text) {
AssertNoneLocked();
AssertThread();
text = _text;
Invalidate();
}
示例6: AssertNoneLocked
void
ButtonWindow::SetText(const TCHAR *_text)
{
AssertNoneLocked();
AssertThread();
if (GetCustomPainting() || _tcschr(_text, _T('&')) == NULL) {
::SetWindowText(hWnd, _text);
return;
}
TCHAR buffer[256]; /* should be large enough for buttons */
static unsigned const int buffer_size = ARRAY_SIZE(buffer);
TCHAR const *s=_text;
TCHAR *d=buffer;
// Workaround WIN32 special use of '&' (replace every '&' with "&&")
// Note: Terminates loop two chars before the buffer_size. This might prevent
// potential char copies but assures that there is always room for
// two '&'s and the 0-terminator.
while (*s && d < buffer + buffer_size - 2) {
if (*s == _T('&'))
*d++ = *s;
*d++ = *s++;
}
*d=0;
::SetWindowText(hWnd, buffer);
}
示例7: AssertNoneLocked
void
ProgressWindow::SetMessage(const TCHAR *text)
{
AssertNoneLocked();
AssertThread();
message.set_text(text);
}
示例8: AssertNoneLocked
void
Window::BringToBottom()
{
AssertNoneLocked();
AssertThread();
parent->BringChildToBottom(*this);
}
示例9: Close
void Close() {
AssertNoneLocked();
#ifndef USE_GDI
OnClose();
#else
::SendMessage(hWnd, WM_CLOSE, 0, 0);
#endif
}
示例10: AssertNoneLocked
void
LargeTextWindow::SetText(const TCHAR *text)
{
AssertNoneLocked();
if (text != nullptr)
value = text;
else
value.clear();
Invalidate();
}
示例11: AssertNoneLocked
void
ProgressBar::Step()
{
AssertNoneLocked();
AssertThread();
#ifndef USE_GDI
value += step_size;
Expose();
#else
::SendMessage(hWnd, PBM_STEPIT, (WPARAM)0, (LPARAM)0);
#endif
}
示例12: Move
void Move(PixelScalar left, PixelScalar top) {
AssertNoneLocked();
AssertThread();
#ifndef USE_GDI
position = { left, top };
Invalidate();
#else
::SetWindowPos(hWnd, nullptr, left, top, 0, 0,
SWP_NOSIZE | SWP_NOZORDER |
SWP_NOACTIVATE | SWP_NOOWNERZORDER);
#endif
}
示例13: AssertNoneLocked
void
Window::SetCapture()
{
AssertNoneLocked();
AssertThread();
if (parent != nullptr)
parent->SetChildCapture(this);
else
EnableCapture();
capture = true;
}