CertificateDisplayNotebook.cpp
Go to the documentation of this file.00001
00010 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) && defined(PKIFRESOURCES_ALLOW_GCC_PRAGMA)
00011 #pragma implementation "CertificateDisplayNotebook.cpp"
00012 #endif
00013
00014
00015 #include "PKIFdll.h"
00016
00017 #include "wx/wxprec.h"
00018
00019 #ifdef __BORLANDC__
00020 #pragma hdrstop
00021 #endif
00022
00023 #include "CertificateDisplayNotebook.h"
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 BEGIN_EVENT_TABLE(CPKIFCertificateDisplayNotebook,wxDialog)
00034 EVT_BUTTON( wxID_OK, CPKIFCertificateDisplayNotebook::OnOK )
00035 EVT_BUTTON( wxID_CANCEL, CPKIFCertificateDisplayNotebook::OnCancel )
00036 EVT_INIT_DIALOG( CPKIFCertificateDisplayNotebook::OnInitDialog )
00037 END_EVENT_TABLE()
00045 CPKIFCertificateDisplayNotebook::CPKIFCertificateDisplayNotebook( wxWindow *parent, wxWindowID id, const wxString &title,
00046 const wxPoint &position, const wxSize& size, long style ) :
00047 wxDialog( parent, id, title, position, size, style )
00048 {
00049
00050 wxSizer* sizerTop = CertificateDisplayNotebook( this, TRUE, TRUE);
00051 SetSizer(sizerTop);
00052
00053 wxNotebook* pNotebook = static_cast<wxNotebook *>(this->FindWindow(ID_NOTEBOOK_CERT_DISPLAY));
00054 wxASSERT(pNotebook);
00055
00056 wxPanel *generalDetailsPanel = new wxPanel( pNotebook, -1 );
00057 m_pGeneralDetailsPanel = new CPKIFGeneralCertificateDetailsPanel(generalDetailsPanel);
00058 pNotebook->AddPage( generalDetailsPanel, wxT("General") );
00059
00060 wxPanel *certDetailsPanel = new wxPanel( pNotebook, -1 );
00061 m_pDetailsPanel = new CPKIFCertificateDetailsPanel(certDetailsPanel);
00062 pNotebook->AddPage( certDetailsPanel, wxT("Details") );
00063
00064
00065
00066
00067
00068 sizerTop->Layout();
00069 sizerTop->SetSizeHints(this);
00070 sizerTop->Fit(this);
00071 }
00079 CPKIFCertificateDisplayNotebook::~CPKIFCertificateDisplayNotebook()
00080 {
00081 if(m_pGeneralDetailsPanel) delete m_pGeneralDetailsPanel;
00082 if(m_pDetailsPanel) delete m_pDetailsPanel;
00083
00084 }
00085
00086
00094 void CPKIFCertificateDisplayNotebook::OnCancel( wxCommandEvent &event )
00095 {
00096 EndModal(wxID_CANCEL);
00097 }
00105 void CPKIFCertificateDisplayNotebook::OnOK( wxCommandEvent &event )
00106 {
00107 if(m_pGeneralDetailsPanel->Validate() && m_pDetailsPanel->Validate())
00108 EndModal(wxID_OK);
00109 }
00117 void CPKIFCertificateDisplayNotebook::OnInitDialog(wxInitDialogEvent& event)
00118 {
00119 m_pGeneralDetailsPanel->SetCertificate(m_cert);
00120 m_pGeneralDetailsPanel->OnInitDialog(event);
00121 m_pDetailsPanel->SetCertificate(m_cert);
00122 m_pDetailsPanel->OnInitDialog(event);
00123
00124
00125 }
00133 void CPKIFCertificateDisplayNotebook::SetCertificate(CPKIFCertificatePtr& cert)
00134 {
00135 m_cert = cert;
00136 }