void ULightingBuildInfo::Set( TWeakObjectPtr<UObject> InObject, double InLightingTime, float InUnmappedTexelsPercentage, int32 InUnmappedTexelsMemory, int32 InTotalTexelMemory ) { Object = InObject; LightingTime = (float)InLightingTime; UnmappedTexelsPercentage = InUnmappedTexelsPercentage; UnmappedTexelsMemory = (float)InUnmappedTexelsMemory / 1024.0f; TotalTexelMemory = (float)InTotalTexelMemory / 1024.0f; UpdateNames(); }
virtual void OnTimer ( DWORD uTimer ) { Dialog_Moving_c::OnTimer ( uTimer ); if ( uTimer != MY_UNIQUE_TIMER_DELETE || m_Deleter.IsInDialog () ) return; const double UPDATE_INTERVAL = 0.1; for ( int i = 0; i < FileDelete_c::FILES_IN_PASS; ++i ) if ( m_Deleter.PrepareFileName () ) { if ( m_fLastUpdateTime == 0.0 ) { m_fLastUpdateTime = g_Timer.GetTimeSec (); UpdateNames (); } else { double fCurTime = g_Timer.GetTimeSec (); if ( fCurTime - m_fLastUpdateTime >= UPDATE_INTERVAL ) { m_fLastUpdateTime = fCurTime; UpdateNames (); } } if ( ! m_Deleter.DeleteNext () ) { Close ( IDCANCEL ); break; } } else { UpdateNames (); Close ( IDOK ); break; } }
void CManagePasswordPolicies::UpdatePolicy(const wxString &polname, const PWPolicy &pol, CPP_FLAGS mode) { if (polname == _("Default Policy")) m_st_default_pp = pol; else m_MapPSWDPLC[tostringx(polname)] = pol; #ifdef NOTYET // Save changes for Undo/Redo PWPolicyChange st_change; st_change.flags = mode; st_change.name = policyname; st_change.st_pp_save = m_iSelectedItem != 0 ? m_mapIter->second : m_st_default_pp; switch (mode) { case CPP_ADD: break; case CPP_MODIFIED: break; case CPP_DELETE: break; default: ASSERT(0); } if (m_iSelectedItem != 0) { // Changed a named password policy PSWDPolicyMapIter iter_new = m_MapPSWDPLC.find(StringX(policyname.c_str())); if (iter_new == m_MapPSWDPLC.end()) ASSERT(0); st_change.st_pp_new = iter_new->second; } else { // Changed the database default policy st_change.st_pp_new = m_st_default_pp; } if (m_iundo_pos != (int)m_vchanges.size() - 1) { // We did have changes that could have been redone // But not anymore - delete all these to add new change on the end m_vchanges.resize(m_iundo_pos + 1); } // Add new change m_vchanges.push_back(st_change); // Update pointer to the one that is next to be undone m_iundo_pos++; // Update buttons appropriately FindWindow(wxID_UNDO)->Enable(true); FindWindow(wxID_REDO)->Enable(false); #else UNREFERENCED_PARAMETER(mode); #endif // Update lists UpdateNames(); int N = m_PolicyNames->GetNumberRows(); for (int row = 0; row < N; row++) if (m_PolicyNames->GetCellValue(row, 0) == polname) { m_PolicyNames->SelectRow(row); break; } UpdateDetails(); }
void CManagePasswordPolicies::CreateControls() { ////@begin CManagePasswordPolicies content construction CManagePasswordPolicies* itemDialog1 = this; wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL); itemDialog1->SetSizer(itemBoxSizer2); wxStaticText* itemStaticText3 = new wxStaticText( itemDialog1, wxID_STATIC, _("Available Password Policies:"), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer2->Add(itemStaticText3, 0, wxALIGN_LEFT|wxALL, 5); wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxHORIZONTAL); itemBoxSizer2->Add(itemBoxSizer4, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); m_PolicyNames = new wxGrid( itemDialog1, ID_POLICYLIST, wxDefaultPosition, wxSize(269, 150), wxSUNKEN_BORDER|wxHSCROLL|wxVSCROLL ); m_PolicyNames->SetDefaultColSize(100); m_PolicyNames->SetDefaultRowSize(25); m_PolicyNames->SetColLabelSize(25); m_PolicyNames->SetRowLabelSize(50); m_PolicyNames->CreateGrid(10, 2, wxGrid::wxGridSelectRows); itemBoxSizer4->Add(m_PolicyNames, 3, wxGROW|wxALL, 5); wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxVERTICAL); itemBoxSizer4->Add(itemBoxSizer6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); wxGridSizer* itemGridSizer7 = new wxGridSizer(0, 2, 0, 0); itemBoxSizer6->Add(itemGridSizer7, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); wxButton* itemButton8 = new wxButton( itemDialog1, wxID_NEW, _("&New"), wxDefaultPosition, wxDefaultSize, 0 ); itemGridSizer7->Add(itemButton8, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5); wxButton* itemButton9 = new wxButton( itemDialog1, ID_EDIT_PP, _("Edit"), wxDefaultPosition, wxDefaultSize, 0 ); itemGridSizer7->Add(itemButton9, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5); wxButton* itemButton10 = new wxButton( itemDialog1, wxID_DELETE, _("&Delete"), wxDefaultPosition, wxDefaultSize, 0 ); itemGridSizer7->Add(itemButton10, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5); wxButton* itemButton11 = new wxButton( itemDialog1, ID_LIST, _("List"), wxDefaultPosition, wxDefaultSize, 0 ); itemGridSizer7->Add(itemButton11, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5); wxButton* itemButton12 = new wxButton( itemDialog1, wxID_UNDO, _("&Undo"), wxDefaultPosition, wxDefaultSize, 0 ); itemGridSizer7->Add(itemButton12, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5); wxButton* itemButton13 = new wxButton( itemDialog1, wxID_REDO, _("&Redo"), wxDefaultPosition, wxDefaultSize, 0 ); itemGridSizer7->Add(itemButton13, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5); wxStaticBox* itemStaticBoxSizer14Static = new wxStaticBox(itemDialog1, wxID_STATIC, _("Test Selected Policy")); wxStaticBoxSizer* itemStaticBoxSizer14 = new wxStaticBoxSizer(itemStaticBoxSizer14Static, wxVERTICAL); itemBoxSizer6->Add(itemStaticBoxSizer14, 0, wxGROW|wxALL, 5); wxButton* itemButton15 = new wxButton( itemDialog1, ID_GENERATE_PASSWORD, _("Generate"), wxDefaultPosition, wxDefaultSize, 0 ); itemStaticBoxSizer14->Add(itemButton15, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); wxBoxSizer* itemBoxSizer16 = new wxBoxSizer(wxHORIZONTAL); itemStaticBoxSizer14->Add(itemBoxSizer16, 0, wxGROW|wxALL, 5); m_passwordCtrl = new wxTextCtrl( itemDialog1, ID_PASSWORD_TXT, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer16->Add(m_passwordCtrl, 5, wxALIGN_CENTER_VERTICAL|wxALL, 5); wxBitmapButton* itemBitmapButton18 = new wxBitmapButton( itemDialog1, ID_BITMAPBUTTON, itemDialog1->GetBitmapResource(wxT("graphics/toolbar/new/copypassword.xpm")), wxDefaultPosition, wxDefaultSize, wxBU_AUTODRAW ); wxBitmap itemBitmapButton18BitmapDisabled(itemDialog1->GetBitmapResource(wxT("graphics/toolbar/new/copypassword_disabled.xpm"))); itemBitmapButton18->SetBitmapDisabled(itemBitmapButton18BitmapDisabled); if (CManagePasswordPolicies::ShowToolTips()) itemBitmapButton18->SetToolTip(_("Copy Password to clipboard")); itemBoxSizer16->Add(itemBitmapButton18, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); m_lowerTableDesc = new wxStaticText( itemDialog1, wxID_STATIC, _("Selected policy details:"), wxDefaultPosition, wxDefaultSize, 0 ); itemBoxSizer2->Add(m_lowerTableDesc, 0, wxALIGN_LEFT|wxALL, 5); wxBoxSizer* itemBoxSizer20 = new wxBoxSizer(wxHORIZONTAL); itemBoxSizer2->Add(itemBoxSizer20, 0, wxGROW|wxALL, 5); m_PolicyDetails = new wxGrid( itemDialog1, ID_POLICYPROPERTIES, wxDefaultPosition, wxSize(-1, 150), wxSUNKEN_BORDER|wxHSCROLL|wxVSCROLL ); m_PolicyDetails->SetDefaultColSize(210); m_PolicyDetails->SetDefaultRowSize(25); m_PolicyDetails->SetColLabelSize(25); m_PolicyDetails->SetRowLabelSize(50); m_PolicyDetails->CreateGrid(5, 2, wxGrid::wxGridSelectRows); itemBoxSizer20->Add(m_PolicyDetails, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); m_PolicyEntries = new wxGrid( itemDialog1, ID_POLICYENTRIES, wxDefaultPosition, wxSize(-1, 150), wxSUNKEN_BORDER|wxHSCROLL|wxVSCROLL ); m_PolicyEntries->SetDefaultColSize(140); m_PolicyEntries->SetDefaultRowSize(25); m_PolicyEntries->SetColLabelSize(25); m_PolicyEntries->SetRowLabelSize(50); m_PolicyEntries->CreateGrid(5, 3, wxGrid::wxGridSelectRows); itemBoxSizer20->Add(m_PolicyEntries, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); wxStdDialogButtonSizer* itemStdDialogButtonSizer23 = new wxStdDialogButtonSizer; itemBoxSizer2->Add(itemStdDialogButtonSizer23, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); wxButton* itemButton24 = new wxButton( itemDialog1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 ); itemStdDialogButtonSizer23->AddButton(itemButton24); wxButton* itemButton25 = new wxButton( itemDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); itemStdDialogButtonSizer23->AddButton(itemButton25); wxButton* itemButton26 = new wxButton( itemDialog1, wxID_HELP, _("&Help"), wxDefaultPosition, wxDefaultSize, 0 ); itemStdDialogButtonSizer23->AddButton(itemButton26); itemStdDialogButtonSizer23->Realize(); ////@end CManagePasswordPolicies content construction if (m_core.IsReadOnly()) { FindWindow(wxID_NEW)->Enable(false); FindWindow(wxID_DELETE)->Enable(false); // Hide cancel button & change OK button text FindWindow(wxID_CANCEL)->Enable(false); FindWindow(wxID_CANCEL)->Show(false); FindWindow(wxID_OK)->SetLabel(_("Close")); FindWindow(wxID_EDIT)->SetLabel(_("View")); } // We have 2 grids, but we show only one at a time, // toggle when user clicks on ID_LIST button. // Setting these up: m_PolicyNames->SetRowLabelSize(0); int col0Width = m_PolicyNames->GetColSize(0); col0Width += 45; m_PolicyNames->SetColSize(0, col0Width); m_PolicyNames->SetColLabelValue(0, _("Policy Name")); m_PolicyNames->SetColLabelValue(1, _("Use count")); UpdateNames(); m_PolicyNames->SelectRow(0); // Since we select the default policy, disable List & Delete FindWindow(ID_LIST)->Enable(false); FindWindow(wxID_DELETE)->Enable(false); m_PolicyDetails->SetRowLabelSize(0); m_PolicyDetails->SetColLabelValue(0, _("Policy Field")); m_PolicyDetails->SetColLabelValue(1, _("Value")); UpdateDetails(); m_PolicyEntries->SetRowLabelSize(0); m_PolicyEntries->SetColLabelValue(0, _("Group")); m_PolicyEntries->SetColLabelValue(1, _("Title")); m_PolicyEntries->SetColLabelValue(2, _("User Name")); ShowPolicyDetails(); // Max. of 255 policy names allowed - only 2 hex digits used for number if (m_MapPSWDPLC.size() >= 255) FindWindow(wxID_NEW)->Enable(false); // No changes yet FindWindow(wxID_UNDO)->Enable(false); FindWindow(wxID_REDO)->Enable(false); m_PolicyNames->SetFocus(); }