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 //Pick up PKIF windows SDK configuration macros instead of WX's 
00015 #include "PKIFdll.h"
00016 // For compilers that support precompilation, includes "wx/wx.h".
00017 #include "wx/wxprec.h"
00018 
00019 #ifdef __BORLANDC__
00020     #pragma hdrstop
00021 #endif
00022 
00023 #include "CertificateDisplayNotebook.h"
00024 
00025 // WDR: class implementations
00026 
00027 //----------------------------------------------------------------------------
00028 // CPKIFCertificateDisplayNotebook
00029 //----------------------------------------------------------------------------
00030 
00031 // WDR: event table for CPKIFCertificateDisplayNotebook
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     // WDR: dialog function PathSettingsNotebook for CPKIFCertificateDisplayNotebook
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     //wxPanel *nameConstraintsPanel = new wxPanel( pNotebook, -1 );
00065  //   m_pUserNameConstraintsPanel = new CPKIFNameConstraintsPanel(nameConstraintsPanel);
00066  //   pNotebook->AddPage( nameConstraintsPanel, wxT("Initial name constraints") );
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     //if(m_pUserNameConstraintsPanel) delete m_pUserNameConstraintsPanel;
00084 }
00085 
00086 // WDR: handler implementations for CPKIFCertificateDisplayNotebook
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     //m_pUserPolicySetPanel->OnInitDialog(event);
00124     //m_pUserNameConstraintsPanel->OnInitDialog(event);
00125 }
00133 void CPKIFCertificateDisplayNotebook::SetCertificate(CPKIFCertificatePtr& cert)
00134 {
00135     m_cert = cert;
00136 }

Generated on Mon Nov 15 11:15:47 2010 for PublicKeyInfrastructureFramework(PKIF) by  doxygen 1.5.6