Changed: #947 mouse wheel, resizable flag
This commit is contained in:
parent
1dc85173c6
commit
e390a83c18
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)
|
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
|
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
|
// create a cocoa window with the size provided by the mode parameter
|
||||||
g_window = [[CocoaWindow alloc]
|
g_window = [[CocoaWindow alloc]
|
||||||
initWithContentRect:NSMakeRect(0, 0, mode.Width, mode.Height)
|
initWithContentRect:NSMakeRect(0, 0, mode.Width, mode.Height)
|
||||||
styleMask:NSTitledWindowMask | NSResizableWindowMask |
|
styleMask:styleMask backing:NSBackingStoreBuffered defer:NO];
|
||||||
NSClosableWindowMask | NSMiniaturizableWindowMask
|
|
||||||
backing:NSBackingStoreBuffered
|
|
||||||
defer:NO];
|
|
||||||
|
|
||||||
if(!g_window)
|
if(!g_window)
|
||||||
nlerror("cannot create window");
|
nlerror("cannot create window");
|
||||||
|
@ -813,7 +816,16 @@ void submitEvents(NLMISC::CEventServer& server,
|
||||||
case NSApplicationDefined:break;
|
case NSApplicationDefined:break;
|
||||||
case NSPeriodic:break;
|
case NSPeriodic:break;
|
||||||
case NSCursorUpdate: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 NSTabletPoint:break;
|
||||||
case NSTabletProximity:break;
|
case NSTabletProximity:break;
|
||||||
case NSOtherMouseDown:break;
|
case NSOtherMouseDown:break;
|
||||||
|
|
Loading…
Reference in a new issue