GroupBandEditorForm.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. using System.Windows.Forms;
  2. using FastReport.Utils;
  3. namespace FastReport.Forms
  4. {
  5. internal partial class GroupBandEditorForm : BaseDialogForm
  6. {
  7. private GroupHeaderBand band;
  8. private void GroupBandEditorForm_FormClosed(object sender, FormClosedEventArgs e)
  9. {
  10. Done();
  11. }
  12. private void Init()
  13. {
  14. cbxCondition.Report = band.Report;
  15. cbxCondition.Text = band.Condition;
  16. if (band.GroupDataBand != null)
  17. cbxCondition.DataSource = band.GroupDataBand.DataSource;
  18. cbxSort.SelectedIndex = (int)band.SortOrder;
  19. }
  20. private void Done()
  21. {
  22. if (DialogResult == DialogResult.OK)
  23. {
  24. band.Condition = cbxCondition.Text;
  25. band.SortOrder = (SortOrder)cbxSort.SelectedIndex;
  26. }
  27. }
  28. public override void Localize()
  29. {
  30. base.Localize();
  31. MyRes res = new MyRes("Forms,GroupBandEditor");
  32. Text = res.Get("");
  33. gbCondition.Text = res.Get("Condition");
  34. gbSettings.Text = res.Get("Settings");
  35. lblHint.Text = res.Get("Hint");
  36. lblSort.Text = res.Get("Sort");
  37. cbxSort.Items.Add(res.Get("NoSort"));
  38. cbxSort.Items.Add(res.Get("Ascending"));
  39. cbxSort.Items.Add(res.Get("Descending"));
  40. }
  41. public override void UpdateDpiDependencies()
  42. {
  43. base.UpdateDpiDependencies();
  44. }
  45. public GroupBandEditorForm(GroupHeaderBand band)
  46. {
  47. this.band = band;
  48. InitializeComponent();
  49. Localize();
  50. Init();
  51. UIUtils.CheckRTL(this);
  52. UpdateDpiDependencies();
  53. }
  54. }
  55. }