Ejemplo n.º 1
0
void Window::setCarbonWindow( WindowRef window )
{
    LBVERB << "set Carbon window " << window << std::endl;

    if( _impl->carbonWindow == window )
        return;

    if( _impl->carbonWindow )
        exitEventHandler();
    _impl->carbonWindow = window;

    if( !window )
        return;

    if( getIAttribute( WindowSettings::IATTR_HINT_DRAWABLE ) == OFF )
        return;

    initEventHandler();

    Rect rect;
    Global::enterCarbon();
    if( GetWindowBounds( window, kWindowContentRgn, &rect ) == noErr )
    {
        PixelViewport pvp( rect.left, rect.top,
                           rect.right - rect.left, rect.bottom - rect.top );

        if( getIAttribute( WindowSettings::IATTR_HINT_DECORATION ) != OFF )
            pvp.y -= EQ_AGL_MENUBARHEIGHT;

        setPixelViewport( pvp );
    }
    Global::leaveCarbon();
}
Ejemplo n.º 2
0
//Return string with item info
string ItemProcessor::generateTicket() {
	cout << endl << "------------------" << endl;
	cout << "TICKET:" << endl;
	std::stringstream s;
	for (int i = 0; i < _numUniqueItems; i++) {
		s << _cartItems[i]->getInfo();
	}
	s << "Total: " << endl;
	s << pvp();
	s << "------------------" << endl;
	return s.str();
}