Esempio n. 1
0
void OpenUserDataRec::EventProcCBCustomize(NavCBRecPtr ioParams)
{
    wxWindow* control = m_dialog->GetExtraControl();

    if ( control )
    {
        SInt16 neededRight, neededBottom;

        wxSize size = m_dialog->GetExtraControl()->GetSize();
        neededRight = ioParams->customRect.left + size.x;
        neededBottom = ioParams->customRect.top + size.y;

        if (ioParams->customRect.right == 0 && ioParams->customRect.bottom == 0)
        {
            ioParams->customRect.right = neededRight;
            ioParams->customRect.bottom = neededBottom;
        }
        else
        {
            if ( ioParams->customRect.right != m_lastRight )
            {
                if ( ioParams->customRect.right < neededRight )
                    ioParams->customRect.right = neededRight;
            }
            if ( ioParams->customRect.bottom != m_lastBottom )
            {
                if ( ioParams->customRect.bottom < neededBottom )
                    ioParams->customRect.bottom = neededBottom;
            }
        }
        m_lastRight = ioParams->customRect.right;
        m_lastBottom = ioParams->customRect.bottom;
    }
}
Esempio n. 2
0
void OpenUserDataRec::EventProcCBStart(NavCBRecPtr ioParams)
{
    if (!m_defaultLocation.empty())
    {
        // Set default location for the modern Navigation APIs
        // Apple Technical Q&A 1151
        FSRef theFile;
        wxMacPathToFSRef(m_defaultLocation, &theFile);
        AEDesc theLocation = { typeNull, NULL };
        if (noErr == ::AECreateDesc(typeFSRef, &theFile, sizeof(FSRef), &theLocation))
            ::NavCustomControl(ioParams->context, kNavCtlSetLocation, (void *) &theLocation);
    }

    if( m_extensions.GetCount() > 0 )
    {
        NavMenuItemSpec  menuItem;
        memset( &menuItem, 0, sizeof(menuItem) );
        menuItem.version = kNavMenuItemSpecVersion;
        menuItem.menuType = m_currentfilter;
        ::NavCustomControl(ioParams->context, kNavCtlSelectCustomType, &menuItem);
    }

    if (m_dialog->GetExtraControl())
    {
        m_controlAdded = true;
        ControlRef ref = m_dialog->GetExtraControl()->GetPeer()->GetControlRef();
        NavCustomControl(ioParams->context, kNavCtlAddControl, ref);
    }

}
Esempio n. 3
0
void OpenUserDataRec::EventProcCBAdjustRect(NavCBRecPtr ioParams)
{
    wxWindow* control = m_dialog->GetExtraControl();

    if ( control && m_controlAdded)
    {
        control->SetSize(ioParams->customRect.left , ioParams->customRect.top,
                         ioParams->customRect.right - ioParams->customRect.left,
                         ioParams->customRect.bottom - ioParams->customRect.top);
    }
}