Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added mouse cursor support for OSX examples #2585

Merged
merged 8 commits into from
May 28, 2019
Merged

Conversation

actboy168
Copy link
Contributor

@ocornut
Copy link
Owner

ocornut commented May 27, 2019

Thank you very much @actboy168, this is looking good!
Will be merging (I'll patch the style of opening brace on the switch statement)

As a Mac user what is your opinion on resize Diagonal Resize cursors for ImGuiMouseCursor_ResizeNESW and ImGuiMouseCursor_ResizeNWSE ?
Via the same topic being addressed in GLFW, we found that those cursors are actually available in OSX, see https://github.com/glfw/glfw/compare/more-standard-cursors#diff-9e4ea39e73b983e33beb8ef73c8fb558R1610:

    else if (shape == GLFW_RESIZE_NWSE_CURSOR)
    {
        // HACK: Use a Cocoa-internal message
        if ([NSCursor respondsToSelector:@selector(_windowResizeNorthWestSouthEastCursor)])
        {
            id object = [NSCursor _windowResizeNorthWestSouthEastCursor];
            if ([object isKindOfClass:[NSCursor class]])
                cursor->ns.object = object;
        }
    }

@actboy168
Copy link
Contributor Author

_windowResizeNorthWestSouthEastCursor is the style of the native window, it would be better, but it is not documented.

I have modified the cursors for ResizeNESW and ResizeNWSE. In order to ensure uniform style, I also modified ResizeNS and ResizeEW, which is also the style of the native window.

@ocornut
Copy link
Owner

ocornut commented May 27, 2019

Thank you.

For the Clang warning could you clarify what the warning says for future reference? (May be useful for GLFW also). Is Clang the only compiler reasonably supported for Obj-C nowadays?(Wondering if it needs an #ifdef __clang__ statement.

I don't know Obj-C very much, but I assume the leading default case behave differently than in C++? (where orders matter if I am not wrong)

@actboy168
Copy link
Contributor Author

There are warnings for using methods that are not defined, but I have found a way to remove the warning.

@actboy168
Copy link
Contributor Author

I just use it as C++. I think the order of default does not affect behavior. But putting default at the end is better in terms of code style.

@ocornut ocornut merged commit c0e6903 into ocornut:master May 28, 2019
ocornut added a commit that referenced this pull request May 28, 2019
@ocornut
Copy link
Owner

ocornut commented May 28, 2019

Merged, thank you!

@actboy168 actboy168 deleted the patch-1 branch January 23, 2024 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants