added svn revision to about box

git-svn-id: trunk@7765 -
This commit is contained in:
mattias 2005-09-21 08:54:58 +00:00
parent 8a4bb1671a
commit 8ada078b86
6 changed files with 116 additions and 86 deletions

View File

@ -1,39 +1,44 @@
object AboutForm: TAboutForm
ActiveControl = AboutPage
Caption = 'About Lazarus'
ClientHeight = 245
ClientWidth = 577
ClientHeight = 270
ClientWidth = 608
OnCreate = AboutFormCreate
PixelsPerInch = 112
Position = poScreenCenter
HorzScrollBar.Page = 576
VertScrollBar.Page = 244
HorzScrollBar.Page = 607
VertScrollBar.Page = 269
Left = 351
Height = 245
Height = 270
Top = 389
Width = 577
object Label1: TLabel
Width = 608
object VersionLabel: TLabel
Alignment = taCenter
BorderSpacing.OnChange = nil
Caption = 'Version #:'
ParentColor = True
Left = 14
Height = 13
Height = 12
Top = 6
Width = 50
Width = 57
end
object Label2: TLabel
object BuildDateLabel: TLabel
Alignment = taCenter
BorderSpacing.OnChange = nil
Caption = 'Date:'
ParentColor = True
Left = 14
Height = 13
Height = 12
Top = 23
Width = 27
Width = 29
end
object RevisionLabel: TLabel
BorderSpacing.OnChange = nil
Caption = 'RevisionLabel'
Color = clNone
Left = 14
Height = 12
Top = 40
Width = 79
end
object Button1: TBitBtn
BorderSpacing.OnChange = nil
Caption = 'Close'
Glyph.Data = {
F70200002F2A2058504D202A2F0A7374617469632063686172202A20626F7461
@ -63,50 +68,49 @@ object AboutForm: TAboutForm
}
ModalResult = 1
TabOrder = 1
Left = 78
Left = 70
Height = 25
Top = 184
Top = 225
Width = 75
end
object Notebook1: TNotebook
Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.OnChange = nil
PageIndex = 0
Left = 215
Height = 236
Height = 261
Top = 6
Width = 358
Width = 389
object AboutPage: TPage
Caption = 'About'
ClientWidth = 350
ClientHeight = 210
Height = 210
Width = 350
ClientWidth = 385
ClientHeight = 231
Left = 2
Height = 231
Top = 28
Width = 385
object AboutMemo: TMemo
Align = alClient
BorderSpacing.OnChange = nil
ReadOnly = True
ScrollBars = ssAutoBoth
TabOrder = 0
Height = 210
Width = 350
Height = 231
Width = 385
end
end
object ContributorsPage: TPage
Caption = 'Contributors'
ClientWidth = 350
ClientHeight = 210
ClientWidth = 389
ClientHeight = 261
Visible = False
Height = 210
Width = 350
Height = 261
Width = 389
object ContributorsMemo: TMemo
Align = alClient
BorderSpacing.OnChange = nil
ReadOnly = True
ScrollBars = ssAutoBoth
TabOrder = 0
Height = 202
Width = 349
Height = 261
Width = 389
end
end
end

View File

@ -1,40 +1,39 @@
{ This is an automatically generated lazarus resource file }
LazarusResources.Add('TAboutForm','FORMDATA',[
'TPF0'#10'TAboutForm'#9'AboutForm'#13'ActiveControl'#7#9'AboutPage'#7'Caption'
+#6#13'About Lazarus'#12'ClientHeight'#3#245#0#11'ClientWidth'#3'A'#2#8'OnCre'
+'ate'#7#15'AboutFormCreate'#13'PixelsPerInch'#2'`'#8'Position'#7#14'poScreen'
+'Center'#18'HorzScrollBar.Page'#3'@'#2#18'VertScrollBar.Page'#3#244#0#4'Left'
+#3'_'#1#6'Height'#3#245#0#3'Top'#3#133#1#5'Width'#3'A'#2#0#6'TLabel'#6'Label'
+'1'#9'Alignment'#7#8'taCenter'#22'BorderSpacing.OnChange'#13#7'Caption'#6#10
+'Version #:'#11'ParentColor'#9#4'Left'#2#14#6'Height'#2#13#3'Top'#2#6#5'Widt'
+'h'#2'2'#0#0#6'TLabel'#6'Label2'#9'Alignment'#7#8'taCenter'#22'BorderSpacing'
+'.OnChange'#13#7'Caption'#6#5'Date:'#11'ParentColor'#9#4'Left'#2#14#6'Height'
+#2#13#3'Top'#2#23#5'Width'#2#27#0#0#7'TBitBtn'#7'Button1'#22'BorderSpacing.O'
+'nChange'#13#7'Caption'#6#5'Close'#10'Glyph.Data'#10#251#2#0#0#247#2#0#0'/* '
+'XPM */'#10'static char * botaoFechar_xpm[] = {'#10'"24 24 2 1",'#10'" '#9'c'
+' None",'#10'".'#9'c #000000",'#10'" ",'#10'" '
+' ",'#10'" ",'#10'" '
+' ",'#10'" ",'#10'" ",'#10
+'" . . ",'#10'" . ... ",'#10'" ..'
+' .... ",'#10'" .. ... ",'#10'" ..... '
+' ",'#10'" ... ",'#10'" ..... ",'#10'"'
+' ....... ",'#10'" ... .... ",'#10'" ... '
+' .... ",'#10'" ... .. ",'#10'" '
+' ",'#10'" ",'#10'" ",'#10'" '
+' ",'#10'" ",'#10'" '
+' ",'#10'" "};'#10#11'ModalResult'#2#1#8'T'
+'abOrder'#2#1#4'Left'#2'N'#6'Height'#2#25#3'Top'#3#184#0#5'Width'#2'K'#0#0#9
+'TNotebook'#9'Notebook1'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBot'
+'tom'#0#22'BorderSpacing.OnChange'#13#9'PageIndex'#2#0#4'Left'#3#215#0#6'Hei'
+'ght'#3#236#0#3'Top'#2#6#5'Width'#3'f'#1#0#5'TPage'#9'AboutPage'#7'Caption'#6
+#5'About'#11'ClientWidth'#3'^'#1#12'ClientHeight'#3#210#0#6'Height'#3#210#0#5
+'Width'#3'^'#1#0#5'TMemo'#9'AboutMemo'#5'Align'#7#8'alClient'#22'BorderSpaci'
+'ng.OnChange'#13#8'ReadOnly'#9#10'ScrollBars'#7#10'ssAutoBoth'#8'TabOrder'#2
+#0#6'Height'#3#210#0#5'Width'#3'^'#1#0#0#0#5'TPage'#16'ContributorsPage'#7'C'
+'aption'#6#12'Contributors'#11'ClientWidth'#3'^'#1#12'ClientHeight'#3#210#0#7
+'Visible'#8#6'Height'#3#210#0#5'Width'#3'^'#1#0#5'TMemo'#16'ContributorsMemo'
+#5'Align'#7#8'alClient'#22'BorderSpacing.OnChange'#13#8'ReadOnly'#9#10'Scrol'
+'lBars'#7#10'ssAutoBoth'#8'TabOrder'#2#0#6'Height'#3#202#0#5'Width'#3']'#1#0
+#0#0#0#0
'TPF0'#10'TAboutForm'#9'AboutForm'#7'Caption'#6#13'About Lazarus'#12'ClientHe'
+'ight'#3#14#1#11'ClientWidth'#3'`'#2#8'OnCreate'#7#15'AboutFormCreate'#13'Pi'
+'xelsPerInch'#2'p'#8'Position'#7#14'poScreenCenter'#18'HorzScrollBar.Page'#3
+'_'#2#18'VertScrollBar.Page'#3#13#1#4'Left'#3'_'#1#6'Height'#3#14#1#3'Top'#3
+#133#1#5'Width'#3'`'#2#0#6'TLabel'#12'VersionLabel'#9'Alignment'#7#8'taCente'
+'r'#7'Caption'#6#10'Version #:'#11'ParentColor'#9#4'Left'#2#14#6'Height'#2#12
+#3'Top'#2#6#5'Width'#2'9'#0#0#6'TLabel'#14'BuildDateLabel'#9'Alignment'#7#8
+'taCenter'#7'Caption'#6#5'Date:'#11'ParentColor'#9#4'Left'#2#14#6'Height'#2
+#12#3'Top'#2#23#5'Width'#2#29#0#0#6'TLabel'#13'RevisionLabel'#22'BorderSpaci'
+'ng.OnChange'#13#7'Caption'#6#13'RevisionLabel'#5'Color'#7#6'clNone'#4'Left'
+#2#14#6'Height'#2#12#3'Top'#2'('#5'Width'#2'O'#0#0#7'TBitBtn'#7'Button1'#7'C'
+'aption'#6#5'Close'#10'Glyph.Data'#10#251#2#0#0#247#2#0#0'/* XPM */'#10'stat'
+'ic char * botaoFechar_xpm[] = {'#10'"24 24 2 1",'#10'" '#9'c None",'#10'".'
+#9'c #000000",'#10'" ",'#10'" '
+'",'#10'" ",'#10'" ",'#10'" '
+' ",'#10'" ",'#10'" . '
+'. ",'#10'" . ... ",'#10'" .. .... "'
+','#10'" .. ... ",'#10'" ..... ",'#10'" '
+' ... ",'#10'" ..... ",'#10'" .......'
+' ",'#10'" ... .... ",'#10'" ... .... ",'
+#10'" ... .. ",'#10'" ",'#10'" '
+' ",'#10'" ",'#10'" '
+' ",'#10'" ",'#10'" ",'#10
+'" "};'#10#11'ModalResult'#2#1#8'TabOrder'#2#1#4'Left'
+#2'F'#6'Height'#2#25#3'Top'#3#225#0#5'Width'#2'K'#0#0#9'TNotebook'#9'Noteboo'
+'k1'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#9'PageIndex'#2
+#0#4'Left'#3#215#0#6'Height'#3#5#1#3'Top'#2#6#5'Width'#3#133#1#0#5'TPage'#9
+'AboutPage'#7'Caption'#6#5'About'#11'ClientWidth'#3#129#1#12'ClientHeight'#3
+#231#0#4'Left'#2#2#6'Height'#3#231#0#3'Top'#2#28#5'Width'#3#129#1#0#5'TMemo'
+#9'AboutMemo'#5'Align'#7#8'alClient'#8'ReadOnly'#9#10'ScrollBars'#7#10'ssAut'
+'oBoth'#8'TabOrder'#2#0#6'Height'#3#231#0#5'Width'#3#129#1#0#0#0#5'TPage'#16
+'ContributorsPage'#7'Caption'#6#12'Contributors'#11'ClientWidth'#3#133#1#12
+'ClientHeight'#3#5#1#7'Visible'#8#6'Height'#3#5#1#5'Width'#3#133#1#0#5'TMemo'
+#16'ContributorsMemo'#5'Align'#7#8'alClient'#8'ReadOnly'#9#10'ScrollBars'#7
+#10'ssAutoBoth'#8'TabOrder'#2#0#6'Height'#3#5#1#5'Width'#3#133#1#0#0#0#0#0
]);

View File

@ -35,10 +35,11 @@ type
TAboutForm = class(TForm)
Button1: TBitBtn;
Label2: TLABEL;
BuildDateLabel: TLABEL;
AboutMemo: TMEMO;
Label1: TLABEL;
VersionLabel: TLABEL;
ContributorsMemo:TMemo;
RevisionLabel: TLabel;
Notebook1:TNotebook;
AboutPage:TPage;
ContributorsPage:TPage;
@ -48,13 +49,14 @@ type
procedure LoadContributors;
public
procedure Paint; override;
constructor Create(AOwner: TComponent); override;
constructor Create(THeOwner: TComponent); override;
destructor Destroy; override;
end;
end;
function ShowAboutForm: TModalResult;
function GetLazarusRevision: string;
implementation
@ -68,13 +70,28 @@ begin
AboutForm.Free;
end;
function GetLazarusRevision: string;
const RevisionStr =
'{ $Id$ }';
var
p: Integer;
l: Integer;
begin
// use first number as revision
p:=1;
while (p<=length(RevisionStr)) and (not (RevisionStr[p] in ['0'..'9'])) do
inc(p);
l:=1;
while (p+l<=length(RevisionStr)) and (RevisionStr[p+l] in ['0'..'9']) do
inc(l);
Result:=copy(RevisionStr,p,l);
end;
{ TAboutForm }
constructor TAboutForm.Create(AOwner: TComponent);
const Revision =
'{ $Id$ }';
constructor TAboutForm.Create(TheOwner: TComponent);
begin
inherited Create(AOwner);
inherited Create(TheOwner);
end;
destructor TAboutForm.Destroy;
@ -89,6 +106,7 @@ procedure TAboutForm.AboutFormCreate(Sender:TObject);
{The compiler generated date string is always of the form y/m/d.
This function gives it a string respresentation according to the
shortdateformat}
function GetLocalizedBuildDate(): string;
var
BuildDate: string;
@ -104,12 +122,14 @@ procedure TAboutForm.AboutFormCreate(Sender:TObject);
StrToWord(Copy(BuildDate,SlashPos2+1,Length(BuildDate)-SlashPos2)));
Result := DateTimeToStr(Date);
end;
begin
FPixmap := TPixmap.Create;
FPixmap.LoadFromLazarusResource('lazarus_about_logo');
Caption:=lisAboutLazarus;
Label1.Caption := lisVersion+' #: '+lisLazarusVersionString;
Label2.Caption := lisDate+': '+GetLocalizedBuildDate;
VersionLabel.Caption := lisVersion+' #: '+lisLazarusVersionString;
RevisionLabel.Caption := lisSVNRevision+GetLazarusRevision;
BuildDateLabel.Caption := lisDate+': '+GetLocalizedBuildDate;
AboutPage.Caption:=lisMenuTemplateAbout;
ContributorsPage.Caption:=lisContributors;
Constraints.MinWidth:= 600;
@ -142,7 +162,7 @@ procedure TAboutForm.Paint;
begin
inherited Paint;
if FPixmap <>nil
then Canvas.Copyrect(Bounds(12, 44, Width, Height)
then Canvas.Copyrect(Bounds(12, 70, Width, Height)
,FPixmap.Canvas, Rect(0,0, Width, Height));
end;

View File

@ -2732,7 +2732,8 @@ begin
if Key.Key1=VK_UNKNOWN then exit;
for a:=0 to FRelations.Count-1 do with Relations[a] do begin
{$IFDEF UseIDEScopes}
if not Category.Scope.HasIDEWindowClass(IDEWindowClass) then continue;
if (Category.Scope<>nil)
and (not Category.Scope.HasIDEWindowClass(IDEWindowClass)) then continue;
{$ELSE}
if Category.Areas*Areas=[] then continue;
{$ENDIF}

View File

@ -580,6 +580,7 @@ resourcestring
lisAboutLazarus = 'About Lazarus';
lisVersion = 'Version';
lisDate = 'Date';
lisSVNRevision = 'SVN Revision: ';
lisClose = 'Close';
lisAboutLazarusMsg =
'License: GPL/LGPL'

View File

@ -511,10 +511,15 @@ function TIDECommandScope.HasIDEWindowClass(AWindowClass: TCustomFormClass
var
i: Integer;
begin
for i:=0 to FIDEWindowClasses.Count-1 do
if (FIDEWindowClasses[i]=nil)
or AWindowClass.InheritsFrom(TCustomFormClass(FIDEWindowClasses[i])) then
if AWindowClass<>nil then begin
for i:=0 to FIDEWindowClasses.Count-1 do
if (FIDEWindowClasses[i]=nil)
or AWindowClass.InheritsFrom(TCustomFormClass(FIDEWindowClasses[i])) then
exit(true);
end else begin
if FIDEWindowClasses.IndexOf(nil)>=0 then
exit(true);
end;
Result:=false;
end;