~ubuntu-branches/ubuntu/saucy/lazarus/saucy

« back to all changes in this revision

Viewing changes to ide/frames/project_lazdoc_options.pas

  • Committer: Package Import Robot
  • Author(s): Paul Gevers, Abou Al Montacir, Bart Martens, Paul Gevers
  • Date: 2013-06-08 14:12:17 UTC
  • mfrom: (1.1.9)
  • Revision ID: package-import@ubuntu.com-20130608141217-7k0cy9id8ifcnutc
Tags: 1.0.8+dfsg-1
[ Abou Al Montacir ]
* New upstream major release and multiple maintenace release offering many
  fixes and new features marking a new milestone for the Lazarus development
  and its stability level.
  - The detailed list of changes can be found here:
    http://wiki.lazarus.freepascal.org/Lazarus_1.0_release_notes
    http://wiki.lazarus.freepascal.org/Lazarus_1.0_fixes_branch
* LCL changes:
  - LCL is now a normal package.
      + Platform independent parts of the LCL are now in the package LCLBase
      + LCL is automatically recompiled when switching the target platform,
        unless pre-compiled binaries for this target are already installed.
      + No impact on existing projects.
      + Linker options needed by LCL are no more added to projects that do
        not use the LCL package.
  - Minor changes in LCL basic classes behaviour
      + TCustomForm.Create raises an exception if a form resource is not
        found.
      + TNotebook and TPage: a new implementation of these classes was added.
      + TDBNavigator: It is now possible to have focusable buttons by setting
        Options = [navFocusableButtons] and TabStop = True, useful for
        accessibility and for devices with neither mouse nor touch screen.
      + Names of TControlBorderSpacing.GetSideSpace and GetSpace were swapped
        and are now consistent. GetSideSpace = Around + GetSpace.
      + TForm.WindowState=wsFullscreen was added
      + TCanvas.TextFitInfo was added to calculate how many characters will
        fit into a specified Width. Useful for word-wrapping calculations.
      + TControl.GetColorResolvingParent and
        TControl.GetRGBColorResolvingParent were added, simplifying the work
        to obtain the final color of the control while resolving clDefault
        and the ParentColor.
      + LCLIntf.GetTextExtentExPoint now has a good default implementation
        which works in any platform not providing a specific implementation.
        However, Widgetset specific implementation is better, when available.
      + TTabControl was reorganized. Now it has the correct class hierarchy
        and inherits from TCustomTabControl as it should.
  - New unit in the LCL:
      + lazdialogs.pas: adds non-native versions of various native dialogs,
        for example TLazOpenDialog, TLazSaveDialog, TLazSelectDirectoryDialog.
        It is used by widgetsets which either do not have a native dialog, or
        do not wish to use it because it is limited. These dialogs can also be
        used by user applications directly.
      + lazdeviceapis.pas: offers an interface to more hardware devices such
        as the accelerometer, GPS, etc. See LazDeviceAPIs
      + lazcanvas.pas: provides a TFPImageCanvas descendent implementing
        drawing in a LCL-compatible way, but 100% in Pascal.
      + lazregions.pas. LazRegions is a wholly Pascal implementation of
        regions for canvas clipping, event clipping, finding in which control
        of a region tree one an event should reach, for drawing polygons, etc.
      + customdrawncontrols.pas, customdrawndrawers.pas,
        customdrawn_common.pas, customdrawn_android.pas and
        customdrawn_winxp.pas: are the Lazarus Custom Drawn Controls -controls
        which imitate the standard LCL ones, but with the difference that they
        are non-native and support skinning.
  - New APIs added to the LCL to improve support of accessibility software
    such as screen readers.
* IDE changes:
  - Many improvments.
  - The detailed list of changes can be found here:
    http://wiki.lazarus.freepascal.org/New_IDE_features_since#v1.0_.282012-08-29.29
    http://wiki.lazarus.freepascal.org/Lazarus_1.0_release_notes#IDE_Changes
* Debugger / Editor changes:
  - Added pascal sources and breakpoints to the disassembler
  - Added threads dialog.
* Components changes:
  - TAChart: many fixes and new features
  - CodeTool: support Delphi style generics and new syntax extensions.
  - AggPas: removed to honor free licencing. (Closes: Bug#708695)
[Bart Martens]
* New debian/watch file fixing issues with upstream RC release.
[Abou Al Montacir]
* Avoid changing files in .pc hidden directory, these are used by quilt for
  internal purpose and could lead to surprises during build.
[Paul Gevers]
* Updated get-orig-source target and it compinion script orig-tar.sh so that they
  repack the source file, allowing bug 708695 to be fixed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 
7
7
uses
8
8
  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
9
 
  StdCtrls, Buttons, Project, IDEOptionsIntf, LazarusIDEStrConsts, IDEProcs;
 
9
  StdCtrls, Buttons, Project, IDEOptionsIntf, LazarusIDEStrConsts, IDEProcs,
 
10
  FPDocEditWindow, CodeHelp;
10
11
 
11
12
type
12
13
 
13
 
  { TProjectLazDocOptionsFrame }
 
14
  { TProjectFPDocOptionsFrame }
14
15
 
15
 
  TProjectLazDocOptionsFrame = class(TAbstractIDEOptionsEditor)
16
 
    LazDocAddPathButton: TBitBtn;
17
 
    LazDocBrowseButton: TButton;
18
 
    LazDocDeletePathButton: TBitBtn;
19
 
    LazDocListBox: TListBox;
20
 
    LazDocPathEdit: TEdit;
 
16
  TProjectFPDocOptionsFrame = class(TAbstractIDEOptionsEditor)
 
17
    AddPathButton: TBitBtn;
 
18
    BrowseButton: TButton;
 
19
    DeletePathButton: TBitBtn;
 
20
    FPDocPackageNameEdit: TEdit;
 
21
    FPDocPackageNameLabel: TLabel;
 
22
    PathsListBox: TListBox;
 
23
    PathEdit: TEdit;
 
24
    SearchPathsGroupBox: TGroupBox;
21
25
    SelectDirectoryDialog: TSelectDirectoryDialog;
22
 
    procedure LazDocAddPathButtonClick(Sender: TObject);
23
 
    procedure LazDocBrowseButtonClick(Sender: TObject);
24
 
    procedure LazDocDeletePathButtonClick(Sender: TObject);
 
26
    procedure AddPathButtonClick(Sender: TObject);
 
27
    procedure BrowseButtonClick(Sender: TObject);
 
28
    procedure DeletePathButtonClick(Sender: TObject);
 
29
    procedure FPDocPackageNameEditEnter(Sender: TObject);
 
30
    procedure FPDocPackageNameEditExit(Sender: TObject);
 
31
    procedure PathsListBoxSelectionChange(Sender: TObject; User: boolean);
 
32
    procedure PathEditChange(Sender: TObject);
25
33
  private
26
 
    { private declarations }
 
34
    function GetFPDocPkgNameEditValue: string;
27
35
  public
28
36
    function GetTitle: string; override;
29
37
    procedure Setup(ADialog: TAbstractOptionsEditorDialog); override;
36
44
 
37
45
{$R *.lfm}
38
46
 
39
 
{ TProjectLazDocOptionsFrame }
40
 
 
41
 
procedure TProjectLazDocOptionsFrame.LazDocBrowseButtonClick(Sender: TObject);
 
47
{ TProjectFPDocOptionsFrame }
 
48
 
 
49
function TProjectFPDocOptionsFrame.GetTitle: string;
 
50
begin
 
51
  Result := lisFPDocEditor;
 
52
end;
 
53
 
 
54
procedure TProjectFPDocOptionsFrame.Setup(ADialog: TAbstractOptionsEditorDialog);
 
55
begin
 
56
  FPDocPackageNameEdit.Hint:=lisFPDocPackageNameDefaultIsProjectFileName;
 
57
  FPDocPackageNameLabel.Caption:=lisFPDocPackageName;
 
58
  SearchPathsGroupBox.Caption:=lisSearchPaths2;
 
59
  AddPathButton.Caption := lisCodeHelpAddPathButton;
 
60
  DeletePathButton.Caption := lisCodeHelpDeletePathButton;
 
61
  DeletePathButton.LoadGlyphFromLazarusResource('laz_delete');
 
62
  AddPathButton.LoadGlyphFromLazarusResource('laz_add');
 
63
 
 
64
  PathEdit.Clear;
 
65
end;
 
66
 
 
67
procedure TProjectFPDocOptionsFrame.BrowseButtonClick(Sender: TObject);
42
68
begin
43
69
  if SelectDirectoryDialog.Execute then
44
 
    LazDocPathEdit.Text := SelectDirectoryDialog.FileName;
45
 
end;
46
 
 
47
 
procedure TProjectLazDocOptionsFrame.LazDocDeletePathButtonClick(Sender: TObject);
48
 
begin
49
 
  if (LazDocListBox.ItemIndex >= 0) then
50
 
    LazDocListBox.Items.Delete(LazDocListBox.ItemIndex);
51
 
end;
52
 
 
53
 
procedure TProjectLazDocOptionsFrame.LazDocAddPathButtonClick(Sender: TObject);
54
 
begin
55
 
  if LazDocPathEdit.Text <> '' then
56
 
    LazDocListBox.Items.Add(LazDocPathEdit.Text);
57
 
end;
58
 
 
59
 
function TProjectLazDocOptionsFrame.GetTitle: string;
60
 
begin
61
 
  Result := lisFPDocEditor;
62
 
end;
63
 
 
64
 
procedure TProjectLazDocOptionsFrame.Setup(ADialog: TAbstractOptionsEditorDialog);
65
 
begin
66
 
  LazDocAddPathButton.Caption := lisCodeHelpAddPathButton;
67
 
  LazDocDeletePathButton.Caption := lisCodeHelpDeletePathButton;
68
 
  LazDocDeletePathButton.LoadGlyphFromLazarusResource('laz_delete');
69
 
  LazDocAddPathButton.LoadGlyphFromLazarusResource('laz_add');
70
 
 
71
 
  LazDocPathEdit.Clear;
72
 
end;
73
 
 
74
 
procedure TProjectLazDocOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions);
75
 
begin
76
 
  with AOptions as TProject do
77
 
    SplitString(LazDocPaths, ';', LazDocListBox.Items, True);
78
 
end;
79
 
 
80
 
procedure TProjectLazDocOptionsFrame.WriteSettings(AOptions: TAbstractIDEOptions);
81
 
begin
82
 
  with AOptions as TProject do
83
 
    LazDocPaths := StringListToText(LazDocListBox.Items, ';', True);
84
 
end;
85
 
 
86
 
class function TProjectLazDocOptionsFrame.SupportedOptionsClass: TAbstractIDEOptionsClass;
 
70
    PathEdit.Text := SelectDirectoryDialog.FileName;
 
71
end;
 
72
 
 
73
procedure TProjectFPDocOptionsFrame.AddPathButtonClick(Sender: TObject);
 
74
begin
 
75
  if PathEdit.Text <> '' then begin
 
76
    PathsListBox.Items.Add(PathEdit.Text);
 
77
    PathEdit.Text := '';
 
78
  end;
 
79
end;
 
80
 
 
81
procedure TProjectFPDocOptionsFrame.DeletePathButtonClick(Sender: TObject);
 
82
begin
 
83
  if (PathsListBox.ItemIndex >= 0) then begin
 
84
    PathsListBox.Items.Delete(PathsListBox.ItemIndex);
 
85
    PathsListBoxSelectionChange(PathsListBox, True);
 
86
  end;
 
87
end;
 
88
 
 
89
procedure TProjectFPDocOptionsFrame.FPDocPackageNameEditEnter(Sender: TObject);
 
90
begin
 
91
  if FPDocPackageNameEdit.Text=lisDefaultPlaceholder then
 
92
    FPDocPackageNameEdit.Text:='';
 
93
end;
 
94
 
 
95
procedure TProjectFPDocOptionsFrame.FPDocPackageNameEditExit(Sender: TObject);
 
96
begin
 
97
  if GetFPDocPkgNameEditValue='' then
 
98
    FPDocPackageNameEdit.Text:=lisDefaultPlaceholder
 
99
  else
 
100
    FPDocPackageNameEdit.Text:=GetFPDocPkgNameEditValue;
 
101
end;
 
102
 
 
103
procedure TProjectFPDocOptionsFrame.PathsListBoxSelectionChange(Sender: TObject; User: boolean);
 
104
begin
 
105
  DeletePathButton.Enabled:=(Sender as TListBox).ItemIndex <> -1;
 
106
end;
 
107
 
 
108
procedure TProjectFPDocOptionsFrame.PathEditChange(Sender: TObject);
 
109
begin
 
110
  AddPathButton.Enabled:=(Sender as TEdit).Text <> '';
 
111
end;
 
112
 
 
113
function TProjectFPDocOptionsFrame.GetFPDocPkgNameEditValue: string;
 
114
begin
 
115
  if FPDocPackageNameEdit.Text=lisDefaultPlaceholder then
 
116
    Result:=''
 
117
  else
 
118
    Result:=MakeValidFPDocPackageName(FPDocPackageNameEdit.Text);
 
119
end;
 
120
 
 
121
procedure TProjectFPDocOptionsFrame.ReadSettings(AOptions: TAbstractIDEOptions);
 
122
begin
 
123
  with AOptions as TProject do begin
 
124
    SplitString(FPDocPaths, ';', PathsListBox.Items, True);
 
125
    if FPDocPackageName='' then
 
126
      FPDocPackageNameEdit.Text:=lisDefaultPlaceholder
 
127
    else
 
128
      FPDocPackageNameEdit.Text:=FPDocPackageName;
 
129
  end;
 
130
end;
 
131
 
 
132
procedure TProjectFPDocOptionsFrame.WriteSettings(AOptions: TAbstractIDEOptions);
 
133
begin
 
134
  with AOptions as TProject do begin
 
135
    FPDocPaths := StringListToText(PathsListBox.Items, ';', True);
 
136
    FPDocPackageName:=GetFPDocPkgNameEditValue;
 
137
  end;
 
138
end;
 
139
 
 
140
class function TProjectFPDocOptionsFrame.SupportedOptionsClass: TAbstractIDEOptionsClass;
87
141
begin
88
142
  Result := TProject;
89
143
end;
90
144
 
91
145
initialization
92
 
  RegisterIDEOptionsEditor(GroupProject, TProjectLazDocOptionsFrame, ProjectOptionsLazDoc);
 
146
  RegisterIDEOptionsEditor(GroupProject, TProjectFPDocOptionsFrame, ProjectOptionsLazDoc);
93
147
 
94
148
end.
95
149