コード例 #1
0
wxTaskBarJumpListCategory& wxTaskBarJumpListImpl::GetTasks()
{
    if ( m_tasks.get() == NULL )
        m_tasks.reset(new wxTaskBarJumpListCategory(m_jumpList, wxT("Tasks")));

    return *(m_tasks.get());
}
コード例 #2
0
const wxTaskBarJumpListCategory& wxTaskBarJumpListImpl::GetRecentCategory()
{
    wxString title = wxT("Recent");
    if ( m_recent.get() == NULL )
        m_recent.reset(new wxTaskBarJumpListCategory(m_jumpList, title));
    LoadKnownCategory(title);

    return *m_recent.get();
}
コード例 #3
0
ファイル: menu_osx.cpp プロジェクト: 3v1n0/wxWidgets
wxMenu::~wxMenu()
{
#if wxOSX_USE_CARBON
    // when destroying the empty menu bar from the static scoped ptr
    // the peer destructor removes an association from an already deleted
    // hashmap leading to crashes. The guard avoids this, accepting some leaks...
    static bool finalmenubar = false;
    
    if ( this == gs_emptyMenuBar.get() )
        finalmenubar = true;
    
    if ( !finalmenubar )
#endif
        delete m_peer;
}
コード例 #4
0
ファイル: socket.cpp プロジェクト: CodeSmithyIDE/wxWidgets
void SocketTestCase::UrlTest()
{
    if ( gs_serverHost.empty() )
        return;

    SocketTestEventLoop loop(ms_useLoop);

    wxURL url("http://" + gs_serverHost);

    const wxScopedPtr<wxInputStream> in(url.GetInputStream());
    CPPUNIT_ASSERT( in.get() );

    wxStringOutputStream out;
    CPPUNIT_ASSERT_EQUAL( wxSTREAM_EOF, in->Read(out).GetLastError() );
}
コード例 #5
0
ファイル: taskbarbutton.cpp プロジェクト: Asmodean-/Ishiiruka
void wxTaskBarJumpListImpl::AddTasksToDestinationList()
{
    if ( !m_tasks.get() )
        return;

    wxCOMPtr<IObjectCollection> collection(CreateObjectCollection());
    if ( !collection )
        return;

    const wxTaskBarJumpListItems& tasks = m_tasks->GetItems();
    for ( wxTaskBarJumpListItems::const_iterator it = tasks.begin();
          it != tasks.end();
          ++it )
    {
        wxASSERT_MSG( ((*it)->GetType() == wxTASKBAR_JUMP_LIST_TASK ||
                       (*it)->GetType() == wxTASKBAR_JUMP_LIST_SEPARATOR),
                      "Invalid task Item." );
        AddShellLink(collection, *(*it));
    }
    m_destinationList->AddUserTasks(collection);
}