本文整理汇总了C++中GHOST_SystemWin32::pushEvent方法的典型用法代码示例。如果您正苦于以下问题:C++ GHOST_SystemWin32::pushEvent方法的具体用法?C++ GHOST_SystemWin32::pushEvent怎么用?C++ GHOST_SystemWin32::pushEvent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GHOST_SystemWin32
的用法示例。
在下文中一共展示了GHOST_SystemWin32::pushEvent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
GHOST_TSuccess GHOST_SystemWin32::pushDragDropEvent(GHOST_TEventType eventType,
GHOST_TDragnDropTypes draggedObjectType,
GHOST_IWindow *window,
int mouseX, int mouseY,
void *data)
{
GHOST_SystemWin32 *system = ((GHOST_SystemWin32 *)getSystem());
return system->pushEvent(new GHOST_EventDragnDrop(system->getMilliSeconds(),
eventType,
draggedObjectType,
window, mouseX, mouseY, data)
);
}
示例2: if
//.........这里部分代码省略.........
*/
case WM_NCPAINT:
/* An application sends the WM_NCPAINT message to a window when its frame must be painted. */
case WM_NCACTIVATE:
/* The WM_NCACTIVATE message is sent to a window when its nonclient area needs to be changed
* to indicate an active or inactive state.
*/
case WM_DESTROY:
/* The WM_DESTROY message is sent when a window is being destroyed. It is sent to the window
* procedure of the window being destroyed after the window is removed from the screen.
* This message is sent first to the window being destroyed and then to the child windows
* (if any) as they are destroyed. During the processing of the message, it can be assumed
* that all child windows still exist.
*/
case WM_NCDESTROY:
/* The WM_NCDESTROY message informs a window that its nonclient area is being destroyed. The
* DestroyWindow function sends the WM_NCDESTROY message to the window following the WM_DESTROY
* message. WM_DESTROY is used to free the allocated memory object associated with the window.
*/
break;
case WM_KILLFOCUS:
/* The WM_KILLFOCUS message is sent to a window immediately before it loses the keyboard focus.
* We want to prevent this if a window is still active and it loses focus to nowhere*/
if (!wParam && hwnd == GetActiveWindow())
SetFocus(hwnd);
case WM_SHOWWINDOW:
/* The WM_SHOWWINDOW message is sent to a window when the window is about to be hidden or shown. */
case WM_WINDOWPOSCHANGING:
/* The WM_WINDOWPOSCHANGING message is sent to a window whose size, position, or place in
* the Z order is about to change as a result of a call to the SetWindowPos function or
* another window-management function.
*/
case WM_SETFOCUS:
/* The WM_SETFOCUS message is sent to a window after it has gained the keyboard focus. */
case WM_ENTERSIZEMOVE:
/* The WM_ENTERSIZEMOVE message is sent one time to a window after it enters the moving
* or sizing modal loop. The window enters the moving or sizing modal loop when the user
* clicks the window's title bar or sizing border, or when the window passes the
* WM_SYSCOMMAND message to the DefWindowProc function and the wParam parameter of the
* message specifies the SC_MOVE or SC_SIZE value. The operation is complete when
* DefWindowProc returns.
*/
break;
////////////////////////////////////////////////////////////////////////
// Other events
////////////////////////////////////////////////////////////////////////
case WM_GETTEXT:
/* An application sends a WM_GETTEXT message to copy the text that
* corresponds to a window into a buffer provided by the caller.
*/
case WM_ACTIVATEAPP:
/* The WM_ACTIVATEAPP message is sent when a window belonging to a
* different application than the active window is about to be activated.
* The message is sent to the application whose window is being activated
* and to the application whose window is being deactivated.
*/
case WM_TIMER:
/* The WIN32 docs say:
* The WM_TIMER message is posted to the installing thread's message queue
* when a timer expires. You can process the message by providing a WM_TIMER
* case in the window procedure. Otherwise, the default window procedure will
* call the TimerProc callback function specified in the call to the SetTimer
* function used to install the timer.
*
* In GHOST, we let DefWindowProc call the timer callback.
*/
break;
case WM_CANCELMODE:
if(window->m_wsh.isWinChanges())
window->m_wsh.cancel();
}
}
else {
// Event found for a window before the pointer to the class has been set.
GHOST_PRINT("GHOST_SystemWin32::wndProc: GHOST window event before creation\n");
/* These are events we typically miss at this point:
* WM_GETMINMAXINFO 0x24
* WM_NCCREATE 0x81
* WM_NCCALCSIZE 0x83
* WM_CREATE 0x01
* We let DefWindowProc do the work.
*/
}
}
else {
// Events without valid hwnd
GHOST_PRINT("GHOST_SystemWin32::wndProc: event without window\n");
}
if (event) {
system->pushEvent(event);
eventHandled = true;
}
if (!eventHandled)
lResult = ::DefWindowProcW(hwnd, msg, wParam, lParam);
return lResult;
}