mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-30 04:40:53 +00:00
Changed: #947 mouse wheel, resizable flag
This commit is contained in:
parent
db99233b0f
commit
265650262d
1 changed files with 87 additions and 75 deletions
|
@ -78,20 +78,23 @@ bool init(uint windowIcon, emptyProc exitFunc)
|
|||
bool setDisplay(nlWindow wnd, const GfxMode& mode, bool show, bool resizeable)
|
||||
{
|
||||
/*
|
||||
TODO use show and resizable flags
|
||||
TODO use show
|
||||
*/
|
||||
|
||||
/*
|
||||
TODO add menu, on quit send EventDestroyWindowId
|
||||
*/
|
||||
|
||||
unsigned int styleMask = NSTitledWindowMask | NSClosableWindowMask |
|
||||
NSMiniaturizableWindowMask;
|
||||
|
||||
if(resizeable)
|
||||
styleMask |= NSResizableWindowMask;
|
||||
|
||||
// create a cocoa window with the size provided by the mode parameter
|
||||
g_window = [[CocoaWindow alloc]
|
||||
initWithContentRect:NSMakeRect(0, 0, mode.Width, mode.Height)
|
||||
styleMask:NSTitledWindowMask | NSResizableWindowMask |
|
||||
NSClosableWindowMask | NSMiniaturizableWindowMask
|
||||
backing:NSBackingStoreBuffered
|
||||
defer:NO];
|
||||
styleMask:styleMask backing:NSBackingStoreBuffered defer:NO];
|
||||
|
||||
if(!g_window)
|
||||
nlerror("cannot create window");
|
||||
|
@ -813,7 +816,16 @@ void submitEvents(NLMISC::CEventServer& server,
|
|||
case NSApplicationDefined:break;
|
||||
case NSPeriodic:break;
|
||||
case NSCursorUpdate:break;
|
||||
case NSScrollWheel:break;
|
||||
case NSScrollWheel:
|
||||
{
|
||||
/*
|
||||
TODO modifiers with mouse events
|
||||
*/
|
||||
server.postEvent(new NLMISC::CEventMouseWheel(
|
||||
mouseX, mouseY, (NLMISC::TMouseButton)0 /* modifiers */,
|
||||
(event.deltaY > 0), eventEmitter));
|
||||
break;
|
||||
}
|
||||
case NSTabletPoint:break;
|
||||
case NSTabletProximity:break;
|
||||
case NSOtherMouseDown:break;
|
||||
|
|
Loading…
Reference in a new issue