OptionFormController.pas 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. unit OptionFormController;
  2. interface
  3. uses
  4. InterfaceAppCentre, Classes, SysUtils, Graphics, ceflib, StrUtils, RealICQButton;
  5. type
  6. TOptionFormController = class
  7. private
  8. FAppCentre: IAppCentre;
  9. FAppCentreConfig: IAppCentreConfig;
  10. constructor Create;
  11. public
  12. class function GetController: TOptionFormController;
  13. procedure ChangeStyle();
  14. procedure ChangeUIColor(AColor: TColor);
  15. end;
  16. implementation
  17. uses
  18. MainFrm, AppCentreImport, Dialogs, Controls, LoggerImport, OptionsFrm, ComCtrls;
  19. var
  20. controller: TOptionFormController;
  21. { TOptionFormController }
  22. procedure TOptionFormController.ChangeStyle;
  23. var
  24. I: Integer;
  25. Item: TListItem;
  26. begin
  27. if (FAppCentreConfig = nil) or (not FAppCentreConfig.GetEnable) then
  28. Exit;
  29. for I := 0 to OptionsForm.LVOptions.Items.Count - 1 do
  30. begin
  31. Item := OptionsForm.LVOptions.Items[I];
  32. if (Item.Caption = 'ϵͳµÇ½ÉèÖÃ') then
  33. begin
  34. OptionsForm.LVOptions.Items.Delete(i);
  35. Exit;
  36. end;
  37. end;
  38. // if OptionsForm = nil then
  39. // Exit;
  40. // OptionsForm.LVOptions.Items.
  41. end;
  42. procedure TOptionFormController.ChangeUIColor(AColor: TColor);
  43. begin
  44. end;
  45. constructor TOptionFormController.Create;
  46. begin
  47. FAppCentreConfig := GetAppCentreConfig;
  48. inherited Create;
  49. end;
  50. class function TOptionFormController.GetController: TOptionFormController;
  51. begin
  52. if controller = nil then
  53. controller := TOptionFormController.Create;
  54. Result := controller;
  55. end;
  56. initialization
  57. finalization
  58. if controller <> nil then
  59. FreeAndNil(controller);
  60. end.