private void OnBtnIcon(object sender, EventArgs e) { IconPickerForm ipf = new IconPickerForm(); ipf.InitEx(m_ilClientIcons, (uint)PwIcon.Count, m_pwDatabase, (uint)m_pwIconIndex, m_pwCustomIconID); if (ipf.ShowDialog() == DialogResult.OK) { m_pwIconIndex = (PwIcon)ipf.ChosenIconId; m_pwCustomIconID = ipf.ChosenCustomIconUuid; if (!m_pwCustomIconID.Equals(PwUuid.Zero)) { UIUtil.SetButtonImage(m_btnIcon, DpiUtil.GetIcon( m_pwDatabase, m_pwCustomIconID), true); } else { UIUtil.SetButtonImage(m_btnIcon, m_ilClientIcons.Images[ (int)m_pwIconIndex], true); } } UIUtil.DestroyForm(ipf); }
private void OnBtnIcon(object sender, EventArgs e) { IconPickerForm ipf = new IconPickerForm(); ipf.InitEx(m_ilClientIcons, (uint)PwIcon.Count, m_pwDatabase, (uint)m_pwIconIndex, m_pwCustomIconID); ipf.ShowDialog(); if (ipf.ChosenCustomIconUuid != PwUuid.Zero) // Custom icon { m_pwCustomIconID = ipf.ChosenCustomIconUuid; UIUtil.SetButtonImage(m_btnIcon, m_pwDatabase.GetCustomIcon( m_pwCustomIconID), true); } else // Standard icon { m_pwIconIndex = (PwIcon)ipf.ChosenIconId; m_pwCustomIconID = PwUuid.Zero; UIUtil.SetButtonImage(m_btnIcon, m_ilClientIcons.Images[ (int)m_pwIconIndex], true); } }
private void OnBtnIcon(object sender, EventArgs e) { IconPickerForm ipf = new IconPickerForm(); ipf.InitEx(m_ilClientIcons, (uint)PwIcon.Count, m_pwDatabase, (uint)m_pwIconIndex, m_pwCustomIconID); if(ipf.ShowDialog() == DialogResult.OK) { if(ipf.ChosenCustomIconUuid != PwUuid.Zero) // Custom icon { m_pwCustomIconID = ipf.ChosenCustomIconUuid; m_btnIcon.Image = m_pwDatabase.GetCustomIcon(m_pwCustomIconID); } else // Standard icon { m_pwIconIndex = (PwIcon)ipf.ChosenIconId; m_pwCustomIconID = PwUuid.Zero; m_btnIcon.Image = m_ilClientIcons.Images[(int)m_pwIconIndex]; } } }
private void OnBtnIcon(object sender, EventArgs e) { IconPickerForm ipf = new IconPickerForm(); ipf.InitEx(m_ilClientIcons, (uint)PwIcon.Count, m_pwDatabase, (uint)m_pwIconIndex, m_pwCustomIconID); if(ipf.ShowDialog() == DialogResult.OK) { if(!ipf.ChosenCustomIconUuid.Equals(PwUuid.Zero)) // Custom icon { m_pwCustomIconID = ipf.ChosenCustomIconUuid; UIUtil.SetButtonImage(m_btnIcon, DpiUtil.GetIcon( m_pwDatabase, m_pwCustomIconID), true); } else // Standard icon { m_pwIconIndex = (PwIcon)ipf.ChosenIconId; m_pwCustomIconID = PwUuid.Zero; UIUtil.SetButtonImage(m_btnIcon, m_ilClientIcons.Images[ (int)m_pwIconIndex], true); } } UIUtil.DestroyForm(ipf); }
private void OnEntryMassSetIcon(object sender, EventArgs e) { PwEntry[] vEntries = GetSelectedEntries(); if((vEntries == null) || (vEntries.Length == 0)) return; IconPickerForm ipf = new IconPickerForm(); ipf.InitEx(m_ilCurrentIcons, (uint)PwIcon.Count, m_docMgr.ActiveDatabase, (uint)vEntries[0].IconId, vEntries[0].CustomIconUuid); ipf.ShowDialog(); foreach(PwEntry pe in vEntries) { if(ipf.ChosenCustomIconUuid != PwUuid.Zero) pe.CustomIconUuid = ipf.ChosenCustomIconUuid; else { pe.IconId = (PwIcon)ipf.ChosenIconId; pe.CustomIconUuid = PwUuid.Zero; } pe.Touch(true, false); } bool bUpdImg = m_docMgr.ActiveDatabase.UINeedsIconUpdate; RefreshEntriesList(); UpdateUI(false, null, bUpdImg, null, false, null, true); UIUtil.DestroyForm(ipf); }
private void OnEntryMassSetIcon(object sender, EventArgs e) { PwEntry[] vEntries = GetSelectedEntries(); if((vEntries == null) || (vEntries.Length == 0)) return; PwDatabase pd = m_docMgr.ActiveDatabase; IconPickerForm ipf = new IconPickerForm(); ipf.InitEx(m_ilCurrentIcons, (uint)PwIcon.Count, pd, (uint)vEntries[0].IconId, vEntries[0].CustomIconUuid); bool bSetIcons = (ipf.ShowDialog() == DialogResult.OK); if(bSetIcons) { foreach(PwEntry pe in vEntries) { if(!ipf.ChosenCustomIconUuid.Equals(PwUuid.Zero)) pe.CustomIconUuid = ipf.ChosenCustomIconUuid; else { pe.IconId = (PwIcon)ipf.ChosenIconId; pe.CustomIconUuid = PwUuid.Zero; } pe.Touch(true, false); } } bool bUpdImg = pd.UINeedsIconUpdate; bool bModified = (bSetIcons || bUpdImg); if(bModified) RefreshEntriesList(); UpdateUI(false, null, bUpdImg, null, false, null, bModified); UIUtil.DestroyForm(ipf); }
private void OnBtnPickIcon(object sender, EventArgs e) { if(m_pwEditMode == PwEditMode.ViewReadOnlyEntry) return; IconPickerForm ipf = new IconPickerForm(); ipf.InitEx(m_ilIcons, (uint)PwIcon.Count, m_pwDatabase, (uint)m_pwEntryIcon, m_pwCustomIconID); if(ipf.ShowDialog() == DialogResult.OK) { if(!ipf.ChosenCustomIconUuid.Equals(PwUuid.Zero)) // Custom icon { m_pwCustomIconID = ipf.ChosenCustomIconUuid; UIUtil.SetButtonImage(m_btnIcon, m_pwDatabase.GetCustomIcon( m_pwCustomIconID), true); } else // Standard icon { m_pwEntryIcon = (PwIcon)ipf.ChosenIconId; m_pwCustomIconID = PwUuid.Zero; UIUtil.SetButtonImage(m_btnIcon, m_ilIcons.Images[ (int)m_pwEntryIcon], true); } } UIUtil.DestroyForm(ipf); }
/// <summary> /// Start Image Editing /// </summary> /// <param name="Item">ListViewItem to edit</param> private void StartImageEditing(ListViewItem item) { IconPickerForm ipf = new IconPickerForm(); PwListItem pli = (((ListViewItem)item).Tag as PwListItem); if (pli == null) { Debug.Assert(false); return; } PwEntry pe = pli.Entry; ipf.InitEx(m_host.MainWindow.ClientIcons, (uint)PwIcon.Count, m_host.Database, (uint)pe.IconId, pe.CustomIconUuid); if (ipf.ShowDialog() == DialogResult.OK) { if (ipf.ChosenCustomIconUuid != PwUuid.Zero) pe.CustomIconUuid = ipf.ChosenCustomIconUuid; else { pe.IconId = (PwIcon)ipf.ChosenIconId; pe.CustomIconUuid = PwUuid.Zero; } //m_host.MainWindow.RefreshEntriesList(); //Util.UpdateSaveIcon(); } }
private void OnEntryMassSetIcon(object sender, EventArgs e) { PwEntry[] vEntries = GetSelectedEntries(); if((vEntries == null) || (vEntries.Length == 0)) return; IconPickerForm ipf = new IconPickerForm(); ipf.InitEx(m_ilCurrentIcons, (uint)PwIcon.Count, m_docMgr.ActiveDatabase, (uint)vEntries[0].IconId, vEntries[0].CustomIconUuid); if(ipf.ShowDialog() == DialogResult.OK) { foreach(PwEntry pe in vEntries) { if(ipf.ChosenCustomIconUuid != PwUuid.Zero) pe.CustomIconUuid = ipf.ChosenCustomIconUuid; else { pe.IconId = (PwIcon)ipf.ChosenIconId; pe.CustomIconUuid = PwUuid.Zero; } } RefreshEntriesList(); UpdateUIState(true); } }