LazStats: Add licenses form to menu. Add license text to README.txt.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7350 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2020-04-01 08:32:14 +00:00
parent 526fa32671
commit 44da765dcc
5 changed files with 68 additions and 3 deletions

View File

@ -24,3 +24,23 @@ William Miller writes in file "html/introduction.pdf":
to give me credit if you use these resources. Because I do not warrant them
in any manner, you should insure yourself that the routines you use are
adequate for your purposes."
License displayed by program:
***************************************************************************
* *
* This source is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This code is distributed in the hope that it will be useful, but *
* WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
* General Public License for more details. *
* *
* A copy of the GNU General Public License is available on the World *
* Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also *
* obtain it by writing to the Free Software Foundation, *
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
* *
***************************************************************************

View File

@ -1017,6 +1017,10 @@ object OS3MainFrm: TOS3MainFrm
Caption = 'About...'
OnClick = AboutClick
end
object LicenseMenu: TMenuItem
Caption = 'License...'
OnClick = LicenseMenuClick
end
object MenuItem46: TMenuItem
Caption = '-'
end

View File

@ -96,6 +96,7 @@ type
MenuItem44: TMenuItem;
MenuItem45: TMenuItem;
MenuItem46: TMenuItem;
LicenseMenu: TMenuItem;
MenuItem48: TMenuItem;
MenuItem49: TMenuItem;
SimpChiSqr: TMenuItem;
@ -300,6 +301,7 @@ type
procedure JPEGViewClick(Sender: TObject);
procedure KSTestClick(Sender: TObject);
procedure LatinSquaresClick(Sender: TObject);
procedure LicenseMenuClick(Sender: TObject);
procedure lifetableClick(Sender: TObject);
procedure LSMRitemClick(Sender: TObject);
procedure MatManMnuClick(Sender: TObject);
@ -1712,6 +1714,11 @@ begin
LatinSqrsFrm.ShowModal;
end;
procedure TOS3MainFrm.LicenseMenuClick(Sender: TObject);
begin
ShowLicense(false);
end;
// Menu "Analysis" > "Nonparametric" > "Life table"
procedure TOS3MainFrm.lifetableClick(Sender: TObject);
begin

View File

@ -49,7 +49,6 @@ object LicenseFrm: TLicenseFrm
''
'Use at your own risk. Compare results to other statistics programs'
'or text book examples for each procedure.'
'Click on Accept or Reject below.'
)
ParentFont = False
TabOrder = 0
@ -67,10 +66,12 @@ object LicenseFrm: TLicenseFrm
ClientWidth = 621
TabOrder = 1
object AcceptBtn: TButton
AnchorSideTop.Control = Panel1
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = Bevel2
Left = 239
Height = 25
Top = 0
Top = 1
Width = 63
Anchors = [akTop, akRight]
AutoSize = True
@ -81,6 +82,8 @@ object LicenseFrm: TLicenseFrm
object RejectBtn: TButton
AnchorSideLeft.Control = Bevel2
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Panel1
AnchorSideTop.Side = asrCenter
AnchorSideRight.Control = Panel1
AnchorSideRight.Side = asrBottom
Left = 318
@ -97,10 +100,27 @@ object LicenseFrm: TLicenseFrm
AnchorSideLeft.Side = asrCenter
Left = 302
Height = 19
Top = 4
Top = 0
Width = 16
Shape = bsSpacer
end
object OKBtn: TButton
AnchorSideLeft.Control = Panel1
AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = Panel1
AnchorSideTop.Side = asrCenter
Left = 289
Height = 25
Top = 1
Width = 42
AutoSize = True
Cancel = True
Caption = 'OK'
Default = True
ModalResult = 1
TabOrder = 2
Visible = False
end
end
object Bevel1: TBevel
AnchorSideLeft.Control = Owner

View File

@ -16,6 +16,7 @@ type
AcceptBtn: TButton;
Bevel1: TBevel;
Bevel2: TBevel;
OKBtn: TButton;
RejectBtn: TButton;
Memo1: TMemo;
Panel1: TPanel;
@ -29,14 +30,27 @@ var
LicenseFrm: TLicenseFrm;
function AcceptLicenseForm: Boolean;
function ShowLicense(FirstTime: Boolean): Boolean;
implementation
function AcceptLicenseForm: Boolean;
begin
Result := ShowLicense(true);
end;
function ShowLicense(FirstTime: Boolean): Boolean;
begin
with TLicenseFrm.Create(nil) do
try
OKBtn.Visible := not FirstTime;
AcceptBtn.Visible := FirstTime;
RejectBtn.Visible := FirstTime;
Bevel2.Visible := FirstTime;
if FirstTime then
Memo1.Lines.Add('Click on Accept or Reject below.');
Result := (ShowModal = mrOK);
finally
Free;