Ejemplo n.º 1
0
BOOL CCreateShortcutDlg::OnInitDialog() 
{
  CPWDialog::OnInitDialog();

  // Populate the combo box
  m_ex_group.ResetContent(); // groups might be from a previous DB (BR 3062758)
  std::vector<std::wstring> aryGroups;
  app.GetCore()->GetUniqueGroups(aryGroups);
  for (std::vector<std::wstring>::iterator iter = aryGroups.begin();
       iter != aryGroups.end(); ++iter) {
    m_ex_group.AddString(iter->c_str());
  }

  // Make sure Group combobox is wide enough
  SetGroupComboBoxWidth();

  m_title.Format(IDS_SCTARGET, m_tt);

  CSecString cs_target(L"");
  if (!m_tg.IsEmpty())
    cs_target = m_tg + L".";
  cs_target += m_tt;
  if (!m_tu.IsEmpty())
    cs_target += L"." + m_tu;
  GetDlgItem(IDC_MYBASE)->SetWindowText(cs_target);

  m_ex_group.ChangeColour();

  UpdateData(FALSE);

  return TRUE;
}
Ejemplo n.º 2
0
BOOL CCreateShortcutDlg::OnInitDialog() 
{
  CPWDialog::OnInitDialog();

  // Get Add/Edit font
  CFont *pFont = Fonts::GetInstance()->GetAddEditFont();

  // Change font size of the group, title & username fields and the base entry name
  m_ex_group.SetFont(pFont);
  m_ex_title.SetFont(pFont);
  m_ex_username.SetFont(pFont);
  GetDlgItem(IDC_MYBASE)->SetFont(pFont);

  // Populate the combo box
  m_ex_group.ResetContent(); // groups might be from a previous DB (BR 3062758)
  std::vector<std::wstring> vGroups;
  app.GetCore()->GetAllGroups(vGroups);
  for (std::vector<std::wstring>::iterator iter = vGroups.begin();
       iter != vGroups.end(); ++iter) {
    m_ex_group.AddString(iter->c_str());
  }

  // Make sure Group combobox is wide enough
  SetGroupComboBoxWidth();

  m_title.Format(IDS_SCTARGET, static_cast<LPCWSTR>(m_basetitle));

  CSecString cs_base(L"");
  cs_base = L"\xab" + m_basegroup + L"\xbb " +
            L"\xab" + m_basetitle + L"\xbb " +
            L"\xab" + m_baseuser  + L"\xbb";
  GetDlgItem(IDC_MYBASE)->SetWindowText(cs_base);

  m_ex_group.ChangeColour();

  UpdateData(FALSE);

  return TRUE;
}