示例#1
0
void ClassListDialog::OnChoiceBookPageChange( wxChoicebookEvent& event )
{
    switch (event.GetSelection())
    {
    case 0:
        if (m_pRawListBox->GetCount())
        {
            m_pRawListBox->Select(0);
            UpdateClassInfo(m_pRawListBox->GetStringSelection());
        }
        break;
    case 1:
        if (m_pSizeListBox->GetCount())
        {
            m_pSizeListBox->Select(0);
            UpdateClassInfo(m_pSizeListBox->GetStringSelection());
        }
        break;
    case 2:
        {
            wxTreeItemId root = m_pParentTreeCtrl->GetRootItem();
            if (root.IsOk())
            {
                m_pParentTreeCtrl->SelectItem(root);
                UpdateClassInfo(m_pParentTreeCtrl->GetItemText(root));
            }
        }
        break;
    }
}
示例#2
0
void ClassListDialog::InitControls()
{
    // create a wxArrayString with the names of all classes:
    const wxClassInfo *ci = wxClassInfo::GetFirst();
    wxArrayString arr;
    while (ci)
    {
        arr.Add(ci->GetClassName());
        ci = ci->GetNext();
    }

    arr.Sort();     // sort alphabetically

    // now add it to the raw-mode listbox
    for (unsigned int i=0; i<arr.GetCount(); i++)
        if (!IsToDiscard(arr[i]))
            m_pRawListBox->Append(arr[i]);
    m_nCount = m_pRawListBox->GetCount();

    // sort again using size as sortkey
    arr.Sort((wxArrayString::CompareFunction)CompareClassSizes);

    // now add it to the size-mode listbox
    for (unsigned int i=0; i<arr.GetCount(); i++)
        if (!IsToDiscard(arr[i]))
            m_pSizeListBox->Append(arr[i]);

    // add root item to parent-mode treectrl
    wxTreeItemId id = m_pParentTreeCtrl->AddRoot(wxT("wxObject"));

    // recursively add all leaves to the treectrl
    int count = AddClassesWithParent(CLASSINFO(wxObject), id);
    m_pParentTreeCtrl->SetItemText(id, m_pParentTreeCtrl->GetItemText(id) +
                                 wxString::Format(wxT(" [%d]"), count));

    // initially expand the root item
    m_pParentTreeCtrl->Expand(id);

    m_nTotalCount = arr.GetCount();
    UpdateFilterText();

    // don't leave blank the XTI info display
    m_pChoiceBook->ChangeSelection(0);
    m_pRawListBox->Select(0);
    UpdateClassInfo(m_pRawListBox->GetStringSelection());
}
示例#3
0
void ClassListDialog::OnTreectrlSelChanged( wxTreeEvent& event )
{
    UpdateClassInfo(m_pParentTreeCtrl->GetItemText(event.GetItem()));
}
示例#4
0
void ClassListDialog::OnListboxSelected( wxCommandEvent& event )
{
    UpdateClassInfo(event.GetString());
}