CertificatePolicyEntryDlg.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 "CertificatePolicyEntryDlg.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 "CertificatePolicyEntryDlg.h"
00024 #include "ResourceUtils.h"
00025 
00026 // WDR: class implementations
00027 
00028 //----------------------------------------------------------------------------
00029 // CPKIFCertificatePolicyEntryDlg
00030 //----------------------------------------------------------------------------
00031 
00032 // WDR: event table for CPKIFCertificatePolicyEntryDlg
00033 
00034 wxChar CPKIFCertificatePolicyEntryDlg::m_oidIncludes[] = wxT("1234567890.");
00035 wxString CPKIFCertificatePolicyEntryDlg::m_longLiveThisString;
00036 
00037 BEGIN_EVENT_TABLE(CPKIFCertificatePolicyEntryDlg,wxDialog)
00038     EVT_BUTTON( wxID_OK, CPKIFCertificatePolicyEntryDlg::OnOk )
00039     EVT_BUTTON( wxID_CANCEL, CPKIFCertificatePolicyEntryDlg::OnCancel )
00040 END_EVENT_TABLE()
00041 
00049 CPKIFCertificatePolicyEntryDlg::CPKIFCertificatePolicyEntryDlg( wxWindow *parent, wxWindowID id, const wxString &title,
00050     const wxPoint &position, const wxSize& size, long style ) :
00051     wxDialog( parent, id, title, position, size, style ),
00052     m_oidValidator(wxFILTER_INCLUDE_CHAR_LIST, &m_longLiveThisString)
00053 {
00054     // WDR: dialog function CertificatePolicyEntryDlg for CPKIFCertificatePolicyEntryDlg
00055     CertificatePolicyEntryDlg( this, TRUE ); 
00056 
00057     wxArrayString sl;
00058     for(int ii = 0; 0x00 != m_oidIncludes[ii]; ++ii)
00059         sl.Add((wxString)m_oidIncludes[ii]);
00060     m_oidValidator.SetIncludes(sl);
00061 
00062     GetTextPolicyOid()->SetValidator(m_oidValidator);
00063 }
00064 
00065 // WDR: handler implementations for CPKIFCertificatePolicyEntryDlg
00066 
00075 void CPKIFCertificatePolicyEntryDlg::OnOk(wxCommandEvent &event)
00076 {
00077     if(!ValidateOID(GetTextPolicyOid()->GetValue()))
00078     {
00079         wxMessageBox(wxT("Please enter a valid OID value"), wxT("Certificate Policy Entry Dialog"));
00080     }
00081     else if(!ValidateOIDComponents(GetTextPolicyOid()->GetValue()))
00082     {
00083         wxMessageBox(wxT("One of the OID components is too large, it has to be less then 2147483647"), wxT("Certificate Policy Entry Dialog"));
00084     }
00085     else
00086     {
00087         event.Skip();
00088     }
00089 }
00097 void CPKIFCertificatePolicyEntryDlg::OnCancel(wxCommandEvent &event)
00098 {
00099     event.Skip();
00100 }
00108 bool CPKIFCertificatePolicyEntryDlg::TransferDataToWindow()
00109 {
00110     return TRUE;
00111 }
00119 bool CPKIFCertificatePolicyEntryDlg::TransferDataFromWindow()
00120 {
00121     return TRUE;
00122 }

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