| 67 | } |
| 68 | |
| 69 | void WindowTestApp::setup() |
| 70 | { |
| 71 | for( auto display : Display::getDisplays() ) |
| 72 | CI_LOG_V( "display name: '" << display->getName() << "', bounds: " << display->getBounds() ); |
| 73 | |
| 74 | getWindow()->setUserData( new WindowData ); |
| 75 | |
| 76 | getWindow()->getSignalMouseDown().connect( signals::slot( this, &WindowTestApp::anotherTest ) ); |
| 77 | getWindow()->getSignalMouseDown().connect( std::bind( &WindowTestApp::mouseDown1, this, std::placeholders::_1 ) ); |
| 78 | // getWindow()->getSignalMouseDown().connect( std::bind( &WindowTestApp::mouseDown2, this, std::placeholders::_1 ) ); // This shouldn't build because it has the wrong signature (<bool( MouseEvent )>) - to note, the reference is not the problem, just the return value is different. |
| 79 | getWindow()->getSignalMouseDown().connect( std::bind( &WindowTestApp::mouseDown3, this, std::placeholders::_1 ) ); |
| 80 | getSignalShouldQuit().connect( std::bind( &WindowTestApp::shouldQuit, this ) ); |
| 81 | |
| 82 | getWindow()->getSignalMove().connect( std::bind( &WindowTestApp::windowMove, this ) ); |
| 83 | getWindow()->getSignalDraw().connect( std::bind( &WindowTestApp::windowDraw, this ) ); |
| 84 | getWindow()->getSignalDisplayChange().connect( std::bind( &WindowTestApp::displayChange, this ) ); |
| 85 | getWindow()->getSignalClose().connect( std::bind( &WindowTestApp::windowClose, this ) ); |
| 86 | |
| 87 | getSignalDidBecomeActive().connect( [] { CI_LOG_V( "App became active." ); } ); |
| 88 | getSignalWillResignActive().connect( [] { CI_LOG_V( "App will resign active." ); } ); |
| 89 | } |
| 90 | |
| 91 | bool WindowTestApp::shouldQuit() |
| 92 | { |