1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
|
{
*****************************************************************************
See the file COPYING.modifiedLGPL.txt, included in this distribution,
for details about the license.
*****************************************************************************
Abstract:
Options dialog for minimap
}
unit fraMiniMapConfig;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, StdCtrls, ColorBox, Dialogs, SpinEx,
IDEOptionsIntf, IDEOptEditorIntf;
type
{ TMiniMapConfigFrame }
TMiniMapConfigFrame = class(TAbstractIDEOptionsEditor)
cbEnabled: TCheckBox;
cbViewWindow: TColorBox;
cbViewText: TColorBox;
CDView: TColorDialog;
cbAlignLeft: TCheckBox;
lblViewWindowColor: TLabel;
lblViewWindowTextColor: TLabel;
lblMapWidth: TLabel;
lblInitialFontSize: TLabel;
seWidth: TSpinEditEx;
seInitialFontSize: TSpinEditEx;
private
public
function GetTitle: String; override;
procedure Setup({%H-}ADialog: TAbstractOptionsEditorDialog); override;
procedure ReadSettings({%H-}AOptions: TAbstractIDEOptions); override;
procedure WriteSettings({%H-}AOptions: TAbstractIDEOptions); override;
class function SupportedOptionsClass: TAbstractIDEOptionsClass; override;
end;
implementation
uses CtrlMiniMap, StrMiniMap;
{$R *.lfm}
{ TMiniMapConfigFrame }
function TMiniMapConfigFrame.GetTitle: String;
begin
Result:=SMinimapConfigTitle;
end;
procedure TMiniMapConfigFrame.Setup(ADialog: TAbstractOptionsEditorDialog);
begin
cbEnabled.Caption:=SShowMinimap;
cbAlignLeft.Caption:=SPutMapLeftOfEditorRe;
lblMapWidth.Caption:=SMapWidth;
lblInitialFontSize.Caption:=SInitialFontSize;
lblViewWindowColor.Caption:=SViewWindowColor;
lblViewWindowTextColor.Caption:=SViewWindowTextColor;
end;
procedure TMiniMapConfigFrame.ReadSettings(AOptions: TAbstractIDEOptions);
var
C : TMiniMapController;
begin
C:=MiniMapController;
cbEnabled.Checked:=C.Enabled;
cbAlignLeft.Checked:=C.AlignLeft;
seWidth.Value:=C.MapWidth;
seInitialFontSize.Value:=C.InitialViewFontSize;
cbViewWindow.Selected:=C.ViewWindowColor;
cbViewText.Selected:=C.ViewWindowTextColor;
end;
procedure TMiniMapConfigFrame.WriteSettings(AOptions: TAbstractIDEOptions);
var
C : TMiniMapController;
begin
C:=MiniMapController;
C.Enabled:=cbEnabled.Checked;
C.AlignLeft:=cbAlignLeft.Checked;
C.MapWidth:=seWidth.Value;
C.InitialViewFontSize:=seInitialFontSize.Value;
C.ViewWindowColor:=cbViewWindow.Selected;
C.ViewWindowTextColor:=cbViewText.Selected;
C.SaveConfig;
C.ReconfigurePanels;
end;
class function TMiniMapConfigFrame.SupportedOptionsClass: TAbstractIDEOptionsClass;
begin
Result:=IDEEditorGroups.GetByIndex(GroupEnvironment)^.GroupClass;
end;
end.
|