Changed: #947 mouse wheel, resizable flag

hg/feature/sound
rti 15 years ago
parent 0eda79d7b3
commit cb9217d8a3

@ -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…
Cancel
Save