コード例 #1
0
ファイル: Suggestions.cpp プロジェクト: heinermann/Chkdraft
void Suggestions::SetStrings(const char* strings[], int numStrings)
{
    strList.clear();
    for ( int i = 0; i < numStrings; i++ )
        strList.push_back(std::string(strings[i]));

    SetStrings();
}
コード例 #2
0
ファイル: plPageInfo.cpp プロジェクト: branan/Plasma
void    plPageInfo::ISetFrom( const plPageInfo &src )
{
    fLocation = src.fLocation;

    SetStrings( src.fAge, src.fPage );
    fMajorVersion = src.fMajorVersion;
    fClassVersions = src.fClassVersions;
    fChecksum = src.fChecksum;
    fDataStart = src.fDataStart;
    fIndexStart = src.fIndexStart;
}
コード例 #3
0
bool wxEditableListBox::Create(wxWindow *parent, wxWindowID id,
                          const wxString& label,
                          const wxPoint& pos, const wxSize& size,
                          long style,
                          const wxString& name)
{
    if (!wxPanel::Create(parent, id, pos, size, wxTAB_TRAVERSAL, name))
        return false;

    m_style = style;

    wxSizer *sizer = new wxBoxSizer(wxVERTICAL);

    wxPanel *subp = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
                                wxSUNKEN_BORDER | wxTAB_TRAVERSAL);
    wxSizer *subsizer = new wxBoxSizer(wxHORIZONTAL);
    subsizer->Add(new wxStaticText(subp, wxID_ANY, label), 1, wxALIGN_CENTRE_VERTICAL | wxLEFT, 4);

#ifdef __WXMSW__
    #define BTN_BORDER 4
    // FIXME - why is this needed? There's some reason why sunken border is
    //         ignored by sizers in wxMSW but not in wxGTK that I can't
    //         figure out...
#else
    #define BTN_BORDER 0
#endif

    if ( m_style & wxEL_ALLOW_EDIT )
    {
        m_bEdit = new wxBitmapButton(subp, wxID_ELB_EDIT,
                                     wxArtProvider::GetBitmap(wxART_EDIT, wxART_BUTTON));
        subsizer->Add(m_bEdit, 0, wxALIGN_CENTRE_VERTICAL | wxTOP | wxBOTTOM, BTN_BORDER);
    }

    if ( m_style & wxEL_ALLOW_NEW )
    {
        m_bNew = new wxBitmapButton(subp, wxID_ELB_NEW,
                                    wxArtProvider::GetBitmap(wxART_NEW, wxART_BUTTON));
        subsizer->Add(m_bNew, 0, wxALIGN_CENTRE_VERTICAL | wxTOP | wxBOTTOM, BTN_BORDER);
    }

    if ( m_style & wxEL_ALLOW_DELETE )
    {
        m_bDel = new wxBitmapButton(subp, wxID_ELB_DELETE,
                                    wxArtProvider::GetBitmap(wxART_DELETE, wxART_BUTTON));
        subsizer->Add(m_bDel, 0, wxALIGN_CENTRE_VERTICAL | wxTOP | wxBOTTOM, BTN_BORDER);
    }

    if (!(m_style & wxEL_NO_REORDER))
    {
        m_bUp = new wxBitmapButton(subp, wxID_ELB_UP,
                                   wxArtProvider::GetBitmap(wxART_GO_UP, wxART_BUTTON));
        subsizer->Add(m_bUp, 0, wxALIGN_CENTRE_VERTICAL | wxTOP | wxBOTTOM, BTN_BORDER);

        m_bDown = new wxBitmapButton(subp, wxID_ELB_DOWN,
                                     wxArtProvider::GetBitmap(wxART_GO_DOWN, wxART_BUTTON));
        subsizer->Add(m_bDown, 0, wxALIGN_CENTRE_VERTICAL | wxTOP | wxBOTTOM, BTN_BORDER);
    }

#if wxUSE_TOOLTIPS
    if ( m_bEdit ) m_bEdit->SetToolTip(_("Edit item"));
    if ( m_bNew ) m_bNew->SetToolTip(_("New item"));
    if ( m_bDel ) m_bDel->SetToolTip(_("Delete item"));
    if ( m_bUp ) m_bUp->SetToolTip(_("Move up"));
    if ( m_bDown ) m_bDown->SetToolTip(_("Move down"));
#endif

    subp->SetSizer(subsizer);
    subsizer->Fit(subp);

    sizer->Add(subp, 0, wxEXPAND);

    long st = wxLC_REPORT | wxLC_NO_HEADER | wxLC_SINGLE_SEL | wxSUNKEN_BORDER;
    if ( style & wxEL_ALLOW_EDIT )
         st |= wxLC_EDIT_LABELS;
    m_listCtrl = new CleverListCtrl(this, wxID_ELB_LISTCTRL,
                                    wxDefaultPosition, wxDefaultSize, st);
    wxArrayString empty_ar;
    SetStrings(empty_ar);

    sizer->Add(m_listCtrl, 1, wxEXPAND);

    SetSizer(sizer);
    Layout();

    return true;
}
コード例 #4
0
ファイル: Suggestions.cpp プロジェクト: heinermann/Chkdraft
void Suggestions::Show()
{
    SetStrings();
    ShowWindow(getHandle(), SW_SHOWNA);
    isShown = true;
}
コード例 #5
0
ファイル: plPageInfo.cpp プロジェクト: branan/Plasma
plPageInfo::~plPageInfo()
{
    SetStrings( nil, nil );
}