Exemplo n.º 1
0
bool wxNotificationMessageWindow::AddAction(wxWindowID actionid, const wxString &label)
{
    wxSizer* msgSizer = m_messagePanel->GetSizer();
    if ( m_buttonSizer == NULL )
    {
        msgSizer->Detach(m_closeBtn);
        m_closeBtn->Hide();
        m_buttonSizer = new wxBoxSizer(wxVERTICAL);
        msgSizer->Add(m_buttonSizer, wxSizerFlags(0).Center().Border());
    }

    wxButton* actionButton = new wxButton(m_messagePanel, actionid, label);
    actionButton->Bind(wxEVT_BUTTON, &wxNotificationMessageWindow::OnActionButtonClicked, this);
    PrepareNotificationControl(actionButton, false);
    int borderDir = (m_buttonSizer->GetChildren().empty()) ? 0 : wxTOP;
    m_buttonSizer->Add(actionButton, wxSizerFlags(0).Border(borderDir).Expand());

    return true;
}