From 013f93a05ffa299612ab8f672bd0d871c872d522 Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Wed, 2 Dec 2020 23:35:42 +0000 Subject: [PATCH] Inherit ABCLogLinUnit from BasicStatsReportFormUnit git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7916 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- applications/lazstats/source/LazStats.lpi | 11 +- applications/lazstats/source/LazStats.res | Bin 55556 -> 55600 bytes .../cross-classification/abcloglinunit.lfm | 971 ++++++++---------- .../cross-classification/abcloglinunit.pas | 511 +++++---- .../lazstats/source/forms/mainunit.lfm | 2 +- .../lazstats/source/forms/mainunit.pas | 51 +- 6 files changed, 737 insertions(+), 809 deletions(-) diff --git a/applications/lazstats/source/LazStats.lpi b/applications/lazstats/source/LazStats.lpi index 4c8099190..19e248e71 100644 --- a/applications/lazstats/source/LazStats.lpi +++ b/applications/lazstats/source/LazStats.lpi @@ -1,11 +1,13 @@ - + + + + - @@ -97,7 +99,6 @@ - @@ -597,7 +598,7 @@ - + @@ -613,7 +614,7 @@ - + diff --git a/applications/lazstats/source/LazStats.res b/applications/lazstats/source/LazStats.res index 73ed432afb324c3520946bbd4db1fef113637198..608538ce6860335e76dbb5ac9dd06e922256845e 100644 GIT binary patch delta 60 zcmZqK#Jph>^8^LP2OAZqvZ*N8<`k#e=%WZuUc=_L`3sxC FB>=UH7exR7 delta 26 icmdn6iMeGH^8^LPO&b-bvQ2)%X2Zn5uvvj!;1U3aAPD9F diff --git a/applications/lazstats/source/forms/analysis/cross-classification/abcloglinunit.lfm b/applications/lazstats/source/forms/analysis/cross-classification/abcloglinunit.lfm index f3544a54a..e55ed49f7 100644 --- a/applications/lazstats/source/forms/analysis/cross-classification/abcloglinunit.lfm +++ b/applications/lazstats/source/forms/analysis/cross-classification/abcloglinunit.lfm @@ -1,530 +1,465 @@ -object ABCLogLinearFrm: TABCLogLinearFrm +inherited ABCLogLinearForm: TABCLogLinearForm Left = 596 - Height = 432 + Height = 408 Top = 216 - Width = 395 + Width = 854 HelpType = htKeyword HelpKeyword = 'html/html/AxBxCLogLinear.htm' - AutoSize = True Caption = 'Log Linear Analysis for AxBxC Classification Table' - ClientHeight = 432 - ClientWidth = 395 - OnActivate = FormActivate - OnCreate = FormCreate - OnShow = FormShow - Position = poMainFormCenter - LCLVersion = '2.1.0.0' - object ResetBtn: TButton - AnchorSideRight.Control = ComputeBtn - AnchorSideBottom.Control = Owner - AnchorSideBottom.Side = asrBottom - Left = 186 - Height = 25 - Top = 399 - Width = 54 - Anchors = [akRight, akBottom] - AutoSize = True - BorderSpacing.Left = 8 - BorderSpacing.Top = 8 - BorderSpacing.Right = 8 - BorderSpacing.Bottom = 8 - Caption = 'Reset' - OnClick = ResetBtnClick - TabOrder = 3 - end - object ComputeBtn: TButton - AnchorSideRight.Control = CloseBtn - AnchorSideBottom.Control = Owner - AnchorSideBottom.Side = asrBottom - Left = 248 - Height = 25 - Top = 399 - Width = 76 - Anchors = [akRight, akBottom] - AutoSize = True - BorderSpacing.Left = 8 - BorderSpacing.Top = 8 - BorderSpacing.Right = 8 - BorderSpacing.Bottom = 8 - Caption = 'Compute' - OnClick = ComputeBtnClick - TabOrder = 4 - end - object CloseBtn: TButton - AnchorSideRight.Control = Owner - AnchorSideRight.Side = asrBottom - AnchorSideBottom.Control = Owner - AnchorSideBottom.Side = asrBottom - Left = 332 - Height = 25 - Top = 399 - Width = 55 - Anchors = [akRight, akBottom] - AutoSize = True - BorderSpacing.Left = 8 - BorderSpacing.Top = 8 - BorderSpacing.Right = 8 - BorderSpacing.Bottom = 8 - Caption = 'Close' - ModalResult = 11 - TabOrder = 5 - end - object HelpBtn: TButton - Tag = 101 - AnchorSideRight.Control = ResetBtn - AnchorSideBottom.Control = Owner - AnchorSideBottom.Side = asrBottom - Left = 127 - Height = 25 - Top = 399 - Width = 51 - Anchors = [akRight, akBottom] - AutoSize = True - BorderSpacing.Left = 8 - BorderSpacing.Top = 8 - BorderSpacing.Right = 8 - BorderSpacing.Bottom = 8 - Caption = 'Help' - OnClick = HelpBtnClick - TabOrder = 2 - end - object Notebook1: TNotebook - AnchorSideLeft.Control = Owner - AnchorSideTop.Control = FileFromGrp - AnchorSideTop.Side = asrBottom - AnchorSideRight.Control = Owner - AnchorSideRight.Side = asrBottom - AnchorSideBottom.Control = Bevel1 - Left = 8 - Height = 316 - Top = 67 - Width = 379 - PageIndex = 0 - Anchors = [akTop, akLeft, akRight, akBottom] - BorderSpacing.Left = 8 - BorderSpacing.Top = 8 - BorderSpacing.Right = 8 - TabOrder = 1 - object Page1: TPage - object Label3: TLabel - AnchorSideLeft.Control = RowVarEdit - AnchorSideBottom.Control = RowVarEdit - Left = 211 - Height = 15 - Top = 8 - Width = 67 - Anchors = [akLeft, akBottom] - BorderSpacing.Bottom = 2 - Caption = 'Row Variable' - ParentColor = False - end - object Label4: TLabel - AnchorSideLeft.Control = ColVarEdit - AnchorSideBottom.Control = ColVarEdit - Left = 211 - Height = 15 - Top = 84 - Width = 87 - Anchors = [akLeft, akBottom] - BorderSpacing.Bottom = 2 - Caption = 'Column Variable' - ParentColor = False - end - object Label5: TLabel - AnchorSideLeft.Control = SliceVarEdit - AnchorSideBottom.Control = SliceVarEdit - Left = 211 - Height = 15 - Top = 160 - Width = 68 - Anchors = [akLeft, akBottom] - BorderSpacing.Bottom = 2 - Caption = 'Slice Variable' - ParentColor = False - end - object Label6: TLabel - AnchorSideLeft.Control = FreqVarEdit - AnchorSideBottom.Control = FreqVarEdit - Left = 211 - Height = 15 - Top = 236 - Width = 99 - Anchors = [akLeft, akBottom] - BorderSpacing.Bottom = 2 - Caption = 'Frequency Variable' - ParentColor = False - end - object VarList: TListBox - AnchorSideLeft.Control = Page1 - AnchorSideTop.Control = Page1 - AnchorSideRight.Control = RowInBtn - AnchorSideBottom.Control = Page1 - AnchorSideBottom.Side = asrBottom - Left = 0 - Height = 316 - Top = 0 - Width = 167 - Anchors = [akTop, akLeft, akRight, akBottom] - BorderSpacing.Right = 8 - ItemHeight = 0 - OnSelectionChange = VarListSelectionChange - TabOrder = 0 - end - object RowInBtn: TBitBtn - AnchorSideLeft.Control = Page1 - AnchorSideLeft.Side = asrCenter - AnchorSideTop.Control = VarList - Left = 175 - Height = 28 - Top = 0 - Width = 28 - Images = MainDataModule.ImageList - ImageIndex = 1 - OnClick = RowInBtnClick - Spacing = 0 - TabOrder = 1 - end - object RowOutBtn: TBitBtn - AnchorSideLeft.Control = Page1 - AnchorSideLeft.Side = asrCenter - AnchorSideTop.Control = RowInBtn - AnchorSideTop.Side = asrBottom - Left = 175 - Height = 28 - Top = 32 - Width = 28 - BorderSpacing.Top = 4 - Enabled = False - Images = MainDataModule.ImageList - ImageIndex = 0 - OnClick = RowOutBtnClick - Spacing = 0 - TabOrder = 2 - end - object ColInBtn: TBitBtn - AnchorSideLeft.Control = Page1 - AnchorSideLeft.Side = asrCenter - AnchorSideTop.Control = RowOutBtn - AnchorSideTop.Side = asrBottom - Left = 175 - Height = 28 - Top = 76 - Width = 28 - BorderSpacing.Top = 16 - Images = MainDataModule.ImageList - ImageIndex = 1 - OnClick = ColInBtnClick - Spacing = 0 - TabOrder = 4 - end - object ColOutBtn: TBitBtn - AnchorSideLeft.Control = Page1 - AnchorSideLeft.Side = asrCenter - AnchorSideTop.Control = ColInBtn - AnchorSideTop.Side = asrBottom - Left = 175 - Height = 28 - Top = 108 - Width = 28 - BorderSpacing.Top = 4 - Enabled = False - Images = MainDataModule.ImageList - ImageIndex = 0 - OnClick = ColOutBtnClick - Spacing = 0 - TabOrder = 5 - end - object SliceBtnIn: TBitBtn - AnchorSideLeft.Control = Page1 - AnchorSideLeft.Side = asrCenter - AnchorSideTop.Control = ColOutBtn - AnchorSideTop.Side = asrBottom - Left = 175 - Height = 28 - Top = 152 - Width = 28 - BorderSpacing.Top = 16 - Images = MainDataModule.ImageList - ImageIndex = 1 - OnClick = SliceBtnInClick - Spacing = 0 - TabOrder = 7 - end - object SliceBtnOut: TBitBtn - AnchorSideLeft.Control = Page1 - AnchorSideLeft.Side = asrCenter - AnchorSideTop.Control = SliceBtnIn - AnchorSideTop.Side = asrBottom - Left = 175 - Height = 28 - Top = 184 - Width = 28 - BorderSpacing.Top = 4 - Enabled = False - Images = MainDataModule.ImageList - ImageIndex = 0 - OnClick = SliceBtnOutClick - Spacing = 0 - TabOrder = 8 - end - object FreqInBtn: TBitBtn - AnchorSideLeft.Control = Page1 - AnchorSideLeft.Side = asrCenter - AnchorSideTop.Control = SliceBtnOut - AnchorSideTop.Side = asrBottom - Left = 175 - Height = 28 - Top = 228 - Width = 28 - BorderSpacing.Top = 16 - Images = MainDataModule.ImageList - ImageIndex = 1 - OnClick = FreqInBtnClick - Spacing = 0 - TabOrder = 10 - end - object FreqOutBtn: TBitBtn - AnchorSideLeft.Control = Page1 - AnchorSideLeft.Side = asrCenter - AnchorSideTop.Control = FreqInBtn - AnchorSideTop.Side = asrBottom - AnchorSideBottom.Side = asrBottom - Left = 175 - Height = 28 - Top = 260 - Width = 28 - BorderSpacing.Top = 4 - Enabled = False - Images = MainDataModule.ImageList - ImageIndex = 0 - OnClick = FreqOutBtnClick - Spacing = 0 - TabOrder = 11 - end - object RowVarEdit: TEdit - AnchorSideLeft.Control = RowInBtn - AnchorSideLeft.Side = asrBottom - AnchorSideRight.Control = Page1 - AnchorSideRight.Side = asrBottom - AnchorSideBottom.Control = RowOutBtn - AnchorSideBottom.Side = asrBottom - Left = 211 - Height = 23 - Top = 25 - Width = 168 - Anchors = [akLeft, akRight, akBottom] - BorderSpacing.Left = 8 - BorderSpacing.Bottom = 12 - ReadOnly = True - TabOrder = 3 - Text = 'RowVarEdit' - end - object ColVarEdit: TEdit - AnchorSideLeft.Control = ColInBtn - AnchorSideLeft.Side = asrBottom - AnchorSideRight.Control = Page1 - AnchorSideRight.Side = asrBottom - AnchorSideBottom.Control = ColOutBtn - AnchorSideBottom.Side = asrBottom - Left = 211 - Height = 23 - Top = 101 - Width = 168 - Anchors = [akLeft, akRight, akBottom] - BorderSpacing.Left = 8 - BorderSpacing.Bottom = 12 - ReadOnly = True - TabOrder = 6 - Text = 'ColVarEdit' - end - object SliceVarEdit: TEdit - AnchorSideLeft.Control = SliceBtnIn - AnchorSideLeft.Side = asrBottom - AnchorSideRight.Control = Page1 - AnchorSideRight.Side = asrBottom - AnchorSideBottom.Control = SliceBtnOut - AnchorSideBottom.Side = asrBottom - Left = 211 - Height = 23 - Top = 177 - Width = 168 - Anchors = [akLeft, akRight, akBottom] - BorderSpacing.Left = 8 - BorderSpacing.Bottom = 12 - ReadOnly = True - TabOrder = 9 - Text = 'SliceVarEdit' - end - object FreqVarEdit: TEdit - AnchorSideLeft.Control = FreqInBtn - AnchorSideLeft.Side = asrBottom - AnchorSideRight.Control = Page1 - AnchorSideRight.Side = asrBottom - AnchorSideBottom.Control = FreqOutBtn - AnchorSideBottom.Side = asrBottom - Left = 211 - Height = 23 - Top = 253 - Width = 168 - Anchors = [akLeft, akRight, akBottom] - BorderSpacing.Left = 8 - BorderSpacing.Bottom = 12 - ReadOnly = True - TabOrder = 12 - Text = 'FreqVarEdit' - end + ClientHeight = 408 + ClientWidth = 854 + inherited ParamsPanel: TPanel + Height = 392 + Width = 376 + ClientHeight = 392 + ClientWidth = 376 + inherited CloseBtn: TButton + Left = 321 + Top = 367 + TabOrder = 5 end - object Page2: TPage - object Label1: TLabel - AnchorSideLeft.Control = Page2 - AnchorSideTop.Control = NRowsEdit - AnchorSideTop.Side = asrCenter - Left = 0 - Height = 15 - Top = 4 - Width = 67 - Caption = 'No. of Rows:' - ParentColor = False + inherited ComputeBtn: TButton + Left = 237 + Top = 367 + TabOrder = 4 + end + inherited ResetBtn: TButton + Left = 175 + Top = 367 + TabOrder = 3 + end + inherited HelpBtn: TButton + Tag = 101 + Left = 116 + Top = 367 + TabOrder = 2 + end + inherited ButtonBevel: TBevel + Top = 351 + Width = 376 + end + object FileFromGrp: TRadioGroup[5] + AnchorSideLeft.Control = ParamsPanel + AnchorSideLeft.Side = asrCenter + AnchorSideTop.Control = ParamsPanel + Left = 7 + Height = 51 + Top = 0 + Width = 362 + AutoFill = True + AutoSize = True + Caption = 'Enter Data From:' + ChildSizing.LeftRightSpacing = 12 + ChildSizing.TopBottomSpacing = 6 + ChildSizing.HorizontalSpacing = 24 + ChildSizing.VerticalSpacing = 2 + ChildSizing.EnlargeHorizontal = crsHomogenousChildResize + ChildSizing.EnlargeVertical = crsHomogenousChildResize + ChildSizing.ShrinkHorizontal = crsScaleChilds + ChildSizing.ShrinkVertical = crsScaleChilds + ChildSizing.Layout = cclLeftToRightThenTopToBottom + ChildSizing.ControlsPerLine = 2 + ClientHeight = 31 + ClientWidth = 358 + Columns = 2 + Items.Strings = ( + 'File Data in the Main Grid' + 'Data Entered on this Form' + ) + OnClick = FileFromGrpClick + TabOrder = 0 + end + object Notebook: TNotebook[6] + AnchorSideLeft.Control = ParamsPanel + AnchorSideTop.Control = FileFromGrp + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = ParamsPanel + AnchorSideRight.Side = asrBottom + AnchorSideBottom.Control = ButtonBevel + Left = 0 + Height = 284 + Top = 67 + Width = 376 + PageIndex = 1 + Anchors = [akTop, akLeft, akRight, akBottom] + BorderSpacing.Top = 16 + TabOrder = 1 + object Page1: TPage + object Label3: TLabel + AnchorSideLeft.Control = RowVarEdit + AnchorSideBottom.Control = RowVarEdit + Left = 210 + Height = 15 + Top = 8 + Width = 67 + Anchors = [akLeft, akBottom] + BorderSpacing.Bottom = 2 + Caption = 'Row Variable' + ParentColor = False + end + object Label4: TLabel + AnchorSideLeft.Control = ColVarEdit + AnchorSideBottom.Control = ColVarEdit + Left = 210 + Height = 15 + Top = 84 + Width = 87 + Anchors = [akLeft, akBottom] + BorderSpacing.Bottom = 2 + Caption = 'Column Variable' + ParentColor = False + end + object Label5: TLabel + AnchorSideLeft.Control = SliceVarEdit + AnchorSideBottom.Control = SliceVarEdit + Left = 210 + Height = 15 + Top = 160 + Width = 68 + Anchors = [akLeft, akBottom] + BorderSpacing.Bottom = 2 + Caption = 'Slice Variable' + ParentColor = False + end + object Label6: TLabel + AnchorSideLeft.Control = FreqVarEdit + AnchorSideBottom.Control = FreqVarEdit + Left = 210 + Height = 15 + Top = 236 + Width = 99 + Anchors = [akLeft, akBottom] + BorderSpacing.Bottom = 2 + Caption = 'Frequency Variable' + ParentColor = False + end + object VarList: TListBox + AnchorSideLeft.Control = Page1 + AnchorSideTop.Control = Page1 + AnchorSideRight.Control = RowInBtn + AnchorSideBottom.Control = Page1 + AnchorSideBottom.Side = asrBottom + Left = 0 + Height = 292 + Top = 0 + Width = 166 + Anchors = [akTop, akLeft, akRight, akBottom] + BorderSpacing.Right = 8 + ItemHeight = 0 + OnDblClick = VarListDblClick + OnSelectionChange = VarListSelectionChange + TabOrder = 0 + end + object RowInBtn: TBitBtn + AnchorSideLeft.Control = Page1 + AnchorSideLeft.Side = asrCenter + AnchorSideTop.Control = VarList + Left = 174 + Height = 28 + Top = 0 + Width = 28 + Images = MainDataModule.ImageList + ImageIndex = 1 + OnClick = RowInBtnClick + Spacing = 0 + TabOrder = 1 + end + object RowOutBtn: TBitBtn + AnchorSideLeft.Control = Page1 + AnchorSideLeft.Side = asrCenter + AnchorSideTop.Control = RowInBtn + AnchorSideTop.Side = asrBottom + Left = 174 + Height = 28 + Top = 32 + Width = 28 + BorderSpacing.Top = 4 + Enabled = False + Images = MainDataModule.ImageList + ImageIndex = 0 + OnClick = RowOutBtnClick + Spacing = 0 + TabOrder = 2 + end + object ColInBtn: TBitBtn + AnchorSideLeft.Control = Page1 + AnchorSideLeft.Side = asrCenter + AnchorSideTop.Control = RowOutBtn + AnchorSideTop.Side = asrBottom + Left = 174 + Height = 28 + Top = 76 + Width = 28 + BorderSpacing.Top = 16 + Images = MainDataModule.ImageList + ImageIndex = 1 + OnClick = ColInBtnClick + Spacing = 0 + TabOrder = 4 + end + object ColOutBtn: TBitBtn + AnchorSideLeft.Control = Page1 + AnchorSideLeft.Side = asrCenter + AnchorSideTop.Control = ColInBtn + AnchorSideTop.Side = asrBottom + Left = 174 + Height = 28 + Top = 108 + Width = 28 + BorderSpacing.Top = 4 + Enabled = False + Images = MainDataModule.ImageList + ImageIndex = 0 + OnClick = ColOutBtnClick + Spacing = 0 + TabOrder = 5 + end + object SliceBtnIn: TBitBtn + AnchorSideLeft.Control = Page1 + AnchorSideLeft.Side = asrCenter + AnchorSideTop.Control = ColOutBtn + AnchorSideTop.Side = asrBottom + Left = 174 + Height = 28 + Top = 152 + Width = 28 + BorderSpacing.Top = 16 + Images = MainDataModule.ImageList + ImageIndex = 1 + OnClick = SliceBtnInClick + Spacing = 0 + TabOrder = 7 + end + object SliceBtnOut: TBitBtn + AnchorSideLeft.Control = Page1 + AnchorSideLeft.Side = asrCenter + AnchorSideTop.Control = SliceBtnIn + AnchorSideTop.Side = asrBottom + Left = 174 + Height = 28 + Top = 184 + Width = 28 + BorderSpacing.Top = 4 + Enabled = False + Images = MainDataModule.ImageList + ImageIndex = 0 + OnClick = SliceBtnOutClick + Spacing = 0 + TabOrder = 8 + end + object FreqInBtn: TBitBtn + AnchorSideLeft.Control = Page1 + AnchorSideLeft.Side = asrCenter + AnchorSideTop.Control = SliceBtnOut + AnchorSideTop.Side = asrBottom + Left = 174 + Height = 28 + Top = 228 + Width = 28 + BorderSpacing.Top = 16 + Images = MainDataModule.ImageList + ImageIndex = 1 + OnClick = FreqInBtnClick + Spacing = 0 + TabOrder = 10 + end + object FreqOutBtn: TBitBtn + AnchorSideLeft.Control = Page1 + AnchorSideLeft.Side = asrCenter + AnchorSideTop.Control = FreqInBtn + AnchorSideTop.Side = asrBottom + AnchorSideBottom.Side = asrBottom + Left = 174 + Height = 28 + Top = 260 + Width = 28 + BorderSpacing.Top = 4 + Enabled = False + Images = MainDataModule.ImageList + ImageIndex = 0 + OnClick = FreqOutBtnClick + Spacing = 0 + TabOrder = 11 + end + object RowVarEdit: TEdit + AnchorSideLeft.Control = RowInBtn + AnchorSideLeft.Side = asrBottom + AnchorSideRight.Control = Page1 + AnchorSideRight.Side = asrBottom + AnchorSideBottom.Control = RowOutBtn + AnchorSideBottom.Side = asrBottom + Left = 210 + Height = 23 + Top = 25 + Width = 166 + Anchors = [akLeft, akRight, akBottom] + BorderSpacing.Left = 8 + BorderSpacing.Bottom = 12 + ReadOnly = True + TabOrder = 3 + Text = 'RowVarEdit' + end + object ColVarEdit: TEdit + AnchorSideLeft.Control = ColInBtn + AnchorSideLeft.Side = asrBottom + AnchorSideRight.Control = Page1 + AnchorSideRight.Side = asrBottom + AnchorSideBottom.Control = ColOutBtn + AnchorSideBottom.Side = asrBottom + Left = 210 + Height = 23 + Top = 101 + Width = 166 + Anchors = [akLeft, akRight, akBottom] + BorderSpacing.Left = 8 + BorderSpacing.Bottom = 12 + ReadOnly = True + TabOrder = 6 + Text = 'ColVarEdit' + end + object SliceVarEdit: TEdit + AnchorSideLeft.Control = SliceBtnIn + AnchorSideLeft.Side = asrBottom + AnchorSideRight.Control = Page1 + AnchorSideRight.Side = asrBottom + AnchorSideBottom.Control = SliceBtnOut + AnchorSideBottom.Side = asrBottom + Left = 210 + Height = 23 + Top = 177 + Width = 166 + Anchors = [akLeft, akRight, akBottom] + BorderSpacing.Left = 8 + BorderSpacing.Bottom = 12 + ReadOnly = True + TabOrder = 9 + Text = 'SliceVarEdit' + end + object FreqVarEdit: TEdit + AnchorSideLeft.Control = FreqInBtn + AnchorSideLeft.Side = asrBottom + AnchorSideRight.Control = Page1 + AnchorSideRight.Side = asrBottom + AnchorSideBottom.Control = FreqOutBtn + AnchorSideBottom.Side = asrBottom + Left = 210 + Height = 23 + Top = 253 + Width = 166 + Anchors = [akLeft, akRight, akBottom] + BorderSpacing.Left = 8 + BorderSpacing.Bottom = 12 + ReadOnly = True + TabOrder = 12 + Text = 'FreqVarEdit' + end end - object Label2: TLabel - AnchorSideLeft.Control = NRowsEdit - AnchorSideLeft.Side = asrBottom - AnchorSideTop.Control = Label1 - AnchorSideTop.Side = asrCenter - Left = 134 - Height = 15 - Top = 4 - Width = 65 - BorderSpacing.Left = 16 - Caption = 'No. of Cols.:' - ParentColor = False - end - object Label7: TLabel - AnchorSideLeft.Control = NColsEdit - AnchorSideLeft.Side = asrBottom - AnchorSideTop.Control = Label2 - AnchorSideTop.Side = asrCenter - Left = 270 - Height = 15 - Top = 4 - Width = 68 - BorderSpacing.Left = 16 - Caption = 'No. of Slices:' - ParentColor = False - end - object NRowsEdit: TEdit - AnchorSideLeft.Control = Label1 - AnchorSideLeft.Side = asrBottom - AnchorSideTop.Control = Page2 - Left = 75 - Height = 23 - Top = 0 - Width = 43 - Alignment = taRightJustify - BorderSpacing.Left = 8 - OnKeyPress = NRowsEditKeyPress - TabOrder = 0 - Text = 'NRowsEdit' - end - object NColsEdit: TEdit - AnchorSideLeft.Control = Label2 - AnchorSideLeft.Side = asrBottom - AnchorSideTop.Control = Page2 - Left = 207 - Height = 23 - Top = 0 - Width = 47 - Alignment = taRightJustify - BorderSpacing.Left = 8 - OnKeyPress = NColsEditKeyPress - TabOrder = 1 - Text = 'NColsEdit' - end - object Grid: TStringGrid - AnchorSideLeft.Control = Page2 - AnchorSideTop.Control = NRowsEdit - AnchorSideTop.Side = asrBottom - AnchorSideRight.Control = Page2 - AnchorSideRight.Side = asrBottom - AnchorSideBottom.Control = Page2 - AnchorSideBottom.Side = asrBottom - Left = 0 - Height = 339 - Top = 31 - Width = 444 - Anchors = [akTop, akLeft, akRight, akBottom] - BorderSpacing.Top = 8 - ColCount = 2 - Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goEditing, goTabs, goSmoothScroll] - RowCount = 2 - TabOrder = 2 - end - object NslicesEdit: TEdit - AnchorSideLeft.Control = Label7 - AnchorSideLeft.Side = asrBottom - AnchorSideTop.Control = Page2 - Left = 346 - Height = 23 - Top = 0 - Width = 39 - Alignment = taRightJustify - BorderSpacing.Left = 8 - OnKeyPress = NslicesEditKeyPress - TabOrder = 3 - Text = 'NslicesEdit' + object Page2: TPage + object Label1: TLabel + AnchorSideLeft.Control = Page2 + AnchorSideTop.Control = NRowsEdit + AnchorSideTop.Side = asrCenter + Left = 0 + Height = 15 + Top = 4 + Width = 67 + Caption = 'No. of Rows:' + ParentColor = False + end + object Label2: TLabel + AnchorSideLeft.Control = NRowsEdit + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = Label1 + AnchorSideTop.Side = asrCenter + Left = 134 + Height = 15 + Top = 4 + Width = 65 + BorderSpacing.Left = 16 + Caption = 'No. of Cols.:' + ParentColor = False + end + object Label7: TLabel + AnchorSideLeft.Control = NColsEdit + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = Label2 + AnchorSideTop.Side = asrCenter + Left = 270 + Height = 15 + Top = 4 + Width = 68 + BorderSpacing.Left = 16 + Caption = 'No. of Slices:' + ParentColor = False + end + object NRowsEdit: TEdit + AnchorSideLeft.Control = Label1 + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = Page2 + Left = 75 + Height = 23 + Top = 0 + Width = 43 + Alignment = taRightJustify + BorderSpacing.Left = 8 + OnKeyPress = NRowsEditKeyPress + TabOrder = 0 + Text = 'NRowsEdit' + end + object NColsEdit: TEdit + AnchorSideLeft.Control = Label2 + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = Page2 + Left = 207 + Height = 23 + Top = 0 + Width = 47 + Alignment = taRightJustify + BorderSpacing.Left = 8 + OnKeyPress = NColsEditKeyPress + TabOrder = 1 + Text = 'NColsEdit' + end + object Grid: TStringGrid + AnchorSideLeft.Control = Page2 + AnchorSideTop.Control = NRowsEdit + AnchorSideTop.Side = asrBottom + AnchorSideRight.Control = Page2 + AnchorSideRight.Side = asrBottom + AnchorSideBottom.Control = Page2 + AnchorSideBottom.Side = asrBottom + Left = 0 + Height = 253 + Top = 31 + Width = 376 + Anchors = [akTop, akLeft, akRight, akBottom] + BorderSpacing.Top = 8 + ColCount = 4 + FixedCols = 3 + MouseWheelOption = mwGrid + Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goEditing, goTabs, goThumbTracking, goSmoothScroll] + RowCount = 2 + TabOrder = 3 + end + object NslicesEdit: TEdit + AnchorSideLeft.Control = Label7 + AnchorSideLeft.Side = asrBottom + AnchorSideTop.Control = Page2 + Left = 346 + Height = 23 + Top = 0 + Width = 39 + Alignment = taRightJustify + BorderSpacing.Left = 8 + OnKeyPress = NslicesEditKeyPress + TabOrder = 2 + Text = 'NslicesEdit' + end end end end - object FileFromGrp: TRadioGroup - AnchorSideLeft.Control = Owner - AnchorSideTop.Control = Owner - Left = 8 - Height = 51 - Top = 8 - Width = 362 - AutoFill = True - AutoSize = True - BorderSpacing.Left = 8 - BorderSpacing.Top = 8 - BorderSpacing.Right = 8 - Caption = 'Enter Data From:' - ChildSizing.LeftRightSpacing = 12 - ChildSizing.TopBottomSpacing = 6 - ChildSizing.HorizontalSpacing = 24 - ChildSizing.VerticalSpacing = 2 - ChildSizing.EnlargeHorizontal = crsHomogenousChildResize - ChildSizing.EnlargeVertical = crsHomogenousChildResize - ChildSizing.ShrinkHorizontal = crsScaleChilds - ChildSizing.ShrinkVertical = crsScaleChilds - ChildSizing.Layout = cclLeftToRightThenTopToBottom - ChildSizing.ControlsPerLine = 2 - ClientHeight = 31 - ClientWidth = 358 - Columns = 2 - Items.Strings = ( - 'File Data in the Main Grid' - 'Data Entered on this Form' - ) - OnClick = FileFromGrpClick - TabOrder = 0 - end - object Bevel1: TBevel - AnchorSideLeft.Control = Owner - AnchorSideRight.Control = Owner - AnchorSideRight.Side = asrBottom - AnchorSideBottom.Control = CloseBtn - Left = 0 - Height = 8 - Top = 383 - Width = 395 - Anchors = [akLeft, akRight, akBottom] - Shape = bsBottomLine - end - object Bevel2: TBevel - Left = 1 - Height = 12 - Top = 434 - Width = 10 - Shape = bsSpacer + inherited ParamsSplitter: TSplitter + Left = 388 + Height = 408 end end diff --git a/applications/lazstats/source/forms/analysis/cross-classification/abcloglinunit.pas b/applications/lazstats/source/forms/analysis/cross-classification/abcloglinunit.pas index 69d80abbe..b02148a5c 100644 --- a/applications/lazstats/source/forms/analysis/cross-classification/abcloglinunit.pas +++ b/applications/lazstats/source/forms/analysis/cross-classification/abcloglinunit.pas @@ -7,19 +7,17 @@ unit ABCLogLinUnit; interface uses - Classes, SysUtils, FileUtil, LResources, Forms, Controls, Graphics, Dialogs, + Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls, Buttons, Grids, - OutputUnit, MainUnit, Globals, DataProcs, ContextHelpUnit; + MainUnit, Globals, DataProcs, BasicStatsReportFormUnit; type - { TABCLogLinearFrm } + { TABCLogLinearForm } - TABCLogLinearFrm = class(TForm) - Bevel1: TBevel; + TABCLogLinearForm = class(TBasicStatsReportForm) Bevel2: TBevel; - HelpBtn: TButton; - Notebook1: TNotebook; + Notebook: TNotebook; Page1: TPage; Page2: TPage; RowInBtn: TBitBtn; @@ -32,9 +30,6 @@ type FreqOutBtn: TBitBtn; NslicesEdit: TEdit; Label7: TLabel; - ResetBtn: TButton; - ComputeBtn: TButton; - CloseBtn: TButton; NRowsEdit: TEdit; NColsEdit: TEdit; RowVarEdit: TEdit; @@ -52,26 +47,20 @@ type FileFromGrp: TRadioGroup; procedure ColInBtnClick(Sender: TObject); procedure ColOutBtnClick(Sender: TObject); - procedure ComputeBtnClick(Sender: TObject); procedure FileFromGrpClick(Sender: TObject); - procedure FormActivate(Sender: TObject); - procedure FormCreate(Sender: TObject); - procedure FormShow(Sender: TObject); procedure FreqInBtnClick(Sender: TObject); procedure FreqOutBtnClick(Sender: TObject); procedure NColsEditKeyPress(Sender: TObject; var Key: char); procedure NRowsEditKeyPress(Sender: TObject; var Key: char); procedure NslicesEditKeyPress(Sender: TObject; var Key: char); - procedure ResetBtnClick(Sender: TObject); - procedure HelpBtnClick(Sender: TObject); procedure RowInBtnClick(Sender: TObject); procedure RowOutBtnClick(Sender: TObject); procedure SliceBtnInClick(Sender: TObject); procedure SliceBtnOutClick(Sender: TObject); + procedure VarListDblClick(Sender: TObject); procedure VarListSelectionChange(Sender: TObject; {%H-}User: boolean); + private - { private declarations } - FAutoSized: Boolean; procedure ModelEffect( Nrows, Ncols, Nslices: integer; const Data: DblDyneCube; @@ -95,200 +84,56 @@ type procedure PrintMatrix(const X: DblDyneMat; Nrows, Ncols: integer; Title: string; AReport: TStrings); - procedure UpdateBtnStates; + protected + procedure AdjustConstraints; override; + procedure Compute; override; + procedure UpdateBtnStates; override; + function Validate(out AMsg: String; out AControl: TWinControl): Boolean; override; public - { public declarations } + procedure Reset; override; + end; var - ABCLogLinearFrm: TABCLogLinearFrm; + ABCLogLinearForm: TABCLogLinearForm; + implementation +{$R *.lfm} + uses - Math; + Math, + GridProcs; -{ TABCLogLinearFrm } -procedure TABCLogLinearFrm.ResetBtnClick(Sender: TObject); -var - i: integer; +{ TABCLogLinearForm } + +procedure TABCLogLinearForm.AdjustConstraints; begin - Grid.ColCount := 4; - Grid.RowCount := 2; - Grid.Cells[0,0] := 'ROW'; - Grid.Cells[1,0] := 'COL'; - Grid.Cells[2,0] := 'SLICE'; - Grid.Cells[3,0] := 'FREQ.'; - VarList.Clear; - for i := 1 to NoVariables do - VarList.Items.Add(OS3MainFrm.DataGrid.Cells[i,0]); - RowVarEdit.Text := ''; - ColVarEdit.Text := ''; - SliceVarEdit.Text := ''; - FreqVarEdit.Text := ''; - NRowsEdit.Text := ''; - NColsEdit.Text := ''; - NSlicesEdit.Text := ''; - FileFromGrp.ItemIndex := -1; - Notebook1.Hide; - UpdateBtnStates; + inherited; + + ParamsPanel.Constraints.MinWidth := MaxValue([ + FileFromGrp.Width, + NSlicesEdit.Left + NSlicesEdit.Width, + 4*CloseBtn.Width + 3*CloseBtn.BorderSpacing.Left + ]); + ParamsPanel.Constraints.MinHeight := + FileFromGrp.Height + NoteBook.BorderSpacing.Top + + FreqOutBtn.Top + FreqOutBtn.Height + ButtonBevel.Height + + Closebtn.BorderSpacing.Top + CloseBtn.Height; end; -procedure TABCLogLinearFrm.HelpBtnClick(Sender: TObject); + +procedure TABCLogLinearForm.FileFromGrpClick(Sender: TObject); begin - if ContextHelpForm = nil then - Application.CreateForm(TContextHelpForm, ContextHelpForm); - ContextHelpForm.HelpMessage((Sender as TButton).tag); + Notebook.Show; + Notebook.PageIndex := fileFromGrp.ItemIndex; end; -procedure TABCLogLinearFrm.RowInBtnClick(Sender: TObject); -var - index: integer; -begin - index := VarList.ItemIndex; - if (index > -1) and (RowVarEdit.Text = '') then - begin - RowVarEdit.Text := VarList.Items[index]; - VarList.Items.Delete(index); - end; - UpdateBtnStates; -end; -procedure TABCLogLinearFrm.RowOutBtnClick(Sender: TObject); -begin - if RowVarEdit.Text <> '' then - begin - VarList.Items.Add(RowVarEdit.Text); - RowVarEdit.Text := ''; - end; - UpdateBtnStates; -end; - -procedure TABCLogLinearFrm.SliceBtnInClick(Sender: TObject); -var - index: integer; -begin - index := VarList.ItemIndex; - if (index > -1) and (SliceVarEdit.Text = '') then - begin - SliceVarEdit.Text := VarList.Items[index]; - VarList.Items.Delete(index); - end; - UpdateBtnStates; -end; - -procedure TABCLogLinearFrm.SliceBtnOutClick(Sender: TObject); -begin - if SliceVarEdit.Text <> '' then - begin - VarList.Items.Add(SliceVarEdit.Text); - SliceVarEdit.Text := ''; - end; -end; - -procedure TABCLogLinearFrm.VarListSelectionChange(Sender: TObject; - User: boolean); -begin - UpdateBtnStates; -end; - -procedure TABCLogLinearFrm.FileFromGrpClick(Sender: TObject); -begin - NoteBook1.Show; - NoteBook1.PageIndex := fileFromGrp.ItemIndex; - { - if FileFromGrp.ItemIndex = 0 then // file from main form - begin - VarList.Visible := true; - RowInBtn.Visible := true; - RowOutBtn.Visible := false; - ColInBtn.Visible := true; - ColOutBtn.Visible := false; - SliceBtnIn.Visible := true; - SliceBtnOut.Visible := false; - FreqInBtn.Visible := true; - FreqOutBtn.Visible := false; - Label4.Visible := true; - Label5.Visible := true; - Label6.Visible := true; - Label3.Visible := true; - RowVarEdit.Visible := true; - ColVarEdit.Visible := true; - SliceVarEdit.Visible := true; - FreqVarEdit.Visible := true; - Label1.Visible := false; - Label2.Visible := false; - Label7.Visible := false; - NRowsEdit.Visible := false; - NColsEdit.Visible := false; - NSlicesEdit.Visible := false; - Grid.Visible := false; - end; - if FileFromGrp.ItemIndex = 1 then // data from this form - begin - VarList.Visible := false; - RowInBtn.Visible := false; - RowOutBtn.Visible := false; - ColInBtn.Visible := false; - ColOutBtn.Visible := false; - SliceBtnIn.Visible := false; - SliceBtnOut.Visible := false; - FreqInBtn.Visible := false; - FreqOutBtn.Visible := false; - Label4.Visible := false; - Label5.Visible := false; - Label6.Visible := false; - Label3.Visible := false; - RowVarEdit.Visible := false; - ColVarEdit.Visible := false; - SliceVarEdit.Visible := false; - FreqVarEdit.Visible := false; - Label1.Visible := true; - Label2.Visible := true; - Label7.Visible := true; - NRowsEdit.Visible := true; - NColsEdit.Visible := true; - NSlicesEdit.Visible := true; - Grid.Visible := true; - end; - } -end; - -procedure TABCLogLinearFrm.FormActivate(Sender: TObject); -var - w: Integer; -begin - if FAutoSized then - exit; - - w := MaxValue([HelpBtn.Width, ResetBtn.Width, ComputeBtn.Width, CloseBtn.Width]); - HelpBtn.Constraints.MinWidth := w; - ResetBtn.Constraints.MinWidth := w; - ComputeBtn.Constraints.MinWidth := w; - CloseBtn.Constraints.MinWidth := w; - - VarList.Constraints.MinHeight := FreqOutBtn.Top + FreqOutBtn.Height - VarList.Top; - Grid.Constraints.MinHeight := FreqOutBtn.Top + FreqOutBtn.Height - Grid.Top; - - Constraints.MinWidth := Width; - Constraints.MinHeight := Height; - - FAutoSized := true; -end; - -procedure TABCLogLinearFrm.FormCreate(Sender: TObject); -begin - Assert(OS3MainFrm <> nil); -end; - -procedure TABCLogLinearFrm.FormShow(Sender: TObject); -begin - ResetBtnClick(Self); -end; - -procedure TABCLogLinearFrm.FreqInBtnClick(Sender: TObject); +procedure TABCLogLinearForm.FreqInBtnClick(Sender: TObject); var index: integer; begin @@ -301,7 +146,7 @@ begin UpdateBtnStates; end; -procedure TABCLogLinearFrm.FreqOutBtnClick(Sender: TObject); +procedure TABCLogLinearForm.FreqOutBtnClick(Sender: TObject); begin if FreqVarEdit.Text <> '' then begin @@ -310,17 +155,17 @@ begin end; end; -procedure TABCLogLinearFrm.NColsEditKeyPress(Sender: TObject; var Key: char); +procedure TABCLogLinearForm.NColsEditKeyPress(Sender: TObject; var Key: char); begin if ord(Key) = 13 then NslicesEdit.SetFocus; end; -procedure TABCLogLinearFrm.NRowsEditKeyPress(Sender: TObject; var Key: char); +procedure TABCLogLinearForm.NRowsEditKeyPress(Sender: TObject; var Key: char); begin if ord(Key) = 13 then NcolsEdit.SetFocus; end; -procedure TABCLogLinearFrm.NslicesEditKeyPress(Sender: TObject; var Key: char); +procedure TABCLogLinearForm.NslicesEditKeyPress(Sender: TObject; var Key: char); var i, j, k, row : integer; Nslices, Ncols, Nrows : integer; @@ -349,7 +194,7 @@ begin end; end; -procedure TABCLogLinearFrm.ColInBtnClick(Sender: TObject); +procedure TABCLogLinearForm.ColInBtnClick(Sender: TObject); var index: integer; begin @@ -362,7 +207,7 @@ begin UpdateBtnStates; end; -procedure TABCLogLinearFrm.ColOutBtnClick(Sender: TObject); +procedure TABCLogLinearForm.ColOutBtnClick(Sender: TObject); begin if ColVarEdit.Text <> '' then begin @@ -372,43 +217,26 @@ begin UpdateBtnStates; end; -procedure TABCLogLinearFrm.ComputeBtnClick(Sender: TObject); +procedure TABCLogLinearForm.Compute; var - i, j, k, row, col, slice, Nrows, Ncols, Nslices : integer; - Data : DblDyneCube; - AB, AC, BC : DblDyneMat; - RowMarg, ColMarg, SliceMarg : DblDyneVec; - Total : double; - arraysize : integer; - Model : integer; - astr, Title : string; - RowCol, ColCol, SliceCol, Fcol : integer; - GridPos : IntDyneVec; - value : integer; - Fx : double; - lReport: TStrings; + i, j, k, row, col, slice, Nrows, Ncols, Nslices : integer; + Data: DblDyneCube = nil; + AB: DblDyneMat = nil; + AC: DblDyneMat = nil; + BC: DblDyneMat = nil; + RowMarg: DblDyneVec = nil; + ColMarg: DblDyneVec = nil; + SliceMarg: DblDyneVec = nil; + Total: double; + arraysize: integer; + Model: integer; + astr, Title: string; + RowCol, ColCol, SliceCol, Fcol: integer; + GridPos: IntDyneVec = nil; + value: integer; + Fx: double; + lReport: TStrings; begin - if RowVarEdit.Text = '' then - begin - MessageDlg('Row variable is not selected.', mtError, [mbOK], 0); - exit; - end; - if ColVarEdit.Text = '' then - begin - MessageDlg('Column variable is not selected.', mtError, [mbOK], 0); - exit; - end; - if SliceVarEdit.Text = '' then - begin - MessageDlg('Slice variable is not selected.', mtError, [mbOK], 0); - exit; - end; - if FreqVarEdit.Text = '' then - begin - MessageDlg('Frequency variable is not selected.', mtError, [mbOK], 0); - exit; - end; - Nrows := 0; Ncols := 0; Nslices := 0; @@ -417,13 +245,10 @@ begin if FileFromGrp.ItemIndex = 0 then // mainfrm input begin SetLength(GridPos, 4); - for i := 1 to NoVariables do - begin - if RowVarEdit.Text = OS3MainFrm.DataGrid.Cells[i,0] then GridPos[0] := i; - if ColVarEdit.Text = OS3MainFrm.DataGrid.Cells[i,0] then GridPos[1] := i; - if SliceVarEdit.Text = OS3MainFrm.DataGrid.Cells[i,0] then GridPos[2] := i; - if FreqVarEdit.Text = OS3MainFrm.DataGrid.Cells[i,0] then GridPos[3] := i; - end; + GridPos[0] := GetVariableIndex(OS3MainFrm.DataGrid, RowVarEdit.Text); + GridPos[1] := GetVariableIndex(OS3MainFrm.DataGrid, ColVarEdit.Text); + GridPos[2] := GetVariableIndex(OS3MainFrm.DataGrid, SliceVarEdit.Text); + GridPos[3] := GetVariableIndex(OS3MainFrm.DataGrid, FreqVarEdit.Text); // get no. of rows, columns and slices for i := 1 to OS3MainFrm.DataGrid.RowCount - 1 do @@ -466,7 +291,7 @@ begin Fcol := GridPos[3]; for i := 1 to OS3MainFrm.DataGrid.RowCount - 1 do begin - if not GoodRecord(i, 4, GridPos) then continue; + if not GoodRecord(OS3MainFrm.DataGrid, i, GridPos) then continue; row := StrToInt(OS3MainFrm.DataGrid.Cells[rowcol,i]); col := StrToInt(OS3MainFrm.DataGrid.Cells[colcol,i]); slice := StrToInt(OS3MainFrm.DataGrid.Cells[slicecol,i]); @@ -547,21 +372,14 @@ begin for Model := 1 to 9 do ModelEffect(Nrows, Ncols, Nslices, Data, RowMarg, ColMarg, SliceMarg, AB, AC, BC, Total, Model, lReport); - DisplayReport(lReport); + FReportFrame.DisplayReport(lReport); finally lReport.Free; - SliceMarg := nil; - ColMarg := nil; - RowMarg := nil; - Data := nil; - BC := nil; - AC := nil; - AB := nil; end; end; -procedure TABCLogLinearFrm.ModelEffect( +procedure TABCLogLinearForm.ModelEffect( Nrows, Ncols, Nslices: integer; const Data: DblDyneCube; const RowMarg, ColMarg, SliceMarg: DblDyneVec; @@ -840,7 +658,7 @@ begin end; //------------------------------------------------------------------- -procedure TABCLogLinearFrm.Iterate( +procedure TABCLogLinearForm.Iterate( Nrows, Ncols, Nslices: integer; const Data: DblDyneCube; const RowMarg, ColMarg, SliceMarg: DblDyneVec; var Total: double; @@ -937,7 +755,7 @@ Step: end; //------------------------------------------------------------------- -procedure TABCLogLinearFrm.PrintTable( +procedure TABCLogLinearForm.PrintTable( Nrows, Ncols, Nslices: integer; const Data: DblDyneCube; const RowMarg, ColMarg, SliceMarg: DblDyneVec; Total: double; @@ -963,9 +781,9 @@ begin for k := 1 to Nslices do AReport.Add('Slice %d %8.3f', [k, SliceMarg[k]]); end; -//------------------------------------------------------------------- -procedure TABCLogLinearFrm.PrintLamdas(Nrows, Ncols, Nslices: integer; + +procedure TABCLogLinearForm.PrintLamdas(Nrows, Ncols, Nslices: integer; const CellLambdas: DblDyneQuad; mu: Double; AReport: TStrings); var i, j, k, l: integer; @@ -989,9 +807,9 @@ begin AReport.Add(''); end; end; -//------------------------------------------------------------------- -procedure TABCLogLinearFrm.PrintMatrix(const X: DblDyneMat; + +procedure TABCLogLinearForm.PrintMatrix(const X: DblDyneMat; Nrows, Ncols: integer; Title: string; AReport: TStrings); Label loop; var @@ -1031,8 +849,89 @@ loop: AReport.Add(''); end; -procedure TABCLogLinearFrm.UpdateBtnStates; + +procedure TABCLogLinearForm.Reset; +var + i: integer; begin + inherited; + + Grid.ColCount := 4; + Grid.RowCount := 2; + Grid.Cells[0,0] := 'ROW'; + Grid.Cells[1,0] := 'COL'; + Grid.Cells[2,0] := 'SLICE'; + Grid.Cells[3,0] := 'FREQ.'; + CollectVariableNames(OS3MainFrm.DataGrid, VarList.Items); + + RowVarEdit.Text := ''; + ColVarEdit.Text := ''; + SliceVarEdit.Text := ''; + FreqVarEdit.Text := ''; + NRowsEdit.Text := ''; + NColsEdit.Text := ''; + NSlicesEdit.Text := ''; + + FileFromGrp.ItemIndex := -1; + Notebook.Hide; + + UpdateBtnStates; +end; + + +procedure TABCLogLinearForm.RowInBtnClick(Sender: TObject); +var + index: integer; +begin + index := VarList.ItemIndex; + if (index > -1) and (RowVarEdit.Text = '') then + begin + RowVarEdit.Text := VarList.Items[index]; + VarList.Items.Delete(index); + end; + UpdateBtnStates; +end; + + +procedure TABCLogLinearForm.RowOutBtnClick(Sender: TObject); +begin + if RowVarEdit.Text <> '' then + begin + VarList.Items.Add(RowVarEdit.Text); + RowVarEdit.Text := ''; + end; + UpdateBtnStates; +end; + + +procedure TABCLogLinearForm.SliceBtnInClick(Sender: TObject); +var + index: integer; +begin + index := VarList.ItemIndex; + if (index > -1) and (SliceVarEdit.Text = '') then + begin + SliceVarEdit.Text := VarList.Items[index]; + VarList.Items.Delete(index); + end; + UpdateBtnStates; +end; + + +procedure TABCLogLinearForm.SliceBtnOutClick(Sender: TObject); +begin + if SliceVarEdit.Text <> '' then + begin + VarList.Items.Add(SliceVarEdit.Text); + SliceVarEdit.Text := ''; + end; +end; + + +procedure TABCLogLinearForm.UpdateBtnStates; +begin + inherited; + RowInBtn.Enabled := (VarList.ItemIndex > -1) and (RowVarEdit.Text = ''); RowOutBtn.Enabled := (RowVarEdit.Text <> ''); ColInBtn.Enabled := (VarList.ItemIndex > -1) and (ColVarEdit.Text = ''); @@ -1043,8 +942,98 @@ begin FreqOutBtn.Enabled := (FreqVarEdit.Text <> ''); end; -initialization - {$I abcloglinunit.lrs} + +function TABCLogLinearForm.Validate(out AMsg: String; out AControl: TWinControl): Boolean; +var + i, n: Integer; +begin + Result := false; + + if FileFromGrp.ItemIndex = 0 then // mainfrm input + begin + if RowVarEdit.Text = '' then + begin + AMsg := 'Row variable is not selected.'; + AControl := VarList; + exit; + end; + if ColVarEdit.Text = '' then + begin + AMsg := 'Column variable is not selected.'; + AControl := VarList; + exit; + end; + if SliceVarEdit.Text = '' then + begin + AMsg := 'Slice variable is not selected.'; + AControl := VarList; + exit; + end; + if FreqVarEdit.Text = '' then + begin + AMsg := 'Frequency variable is not selected.'; + AControl := VarList; + exit; + end; + end + else + for i := 1 to Grid.RowCount-1 do + begin + if Grid.Cells[3, i] = '' then + begin + AMsg := 'Data missing in row ' + IntToStr(i); + AControl := Grid; + Grid.Row := i; + Grid.Col := 3; + exit; + end; + if not TryStrToInt(Grid.Cells[3, i], n) then + begin + AMsg := 'No valid integer in row ' + IntToStr(i); + AControl := Grid; + Grid.Row := i; + Grid.Col := 3; + exit; + end; + end; + + Result := true; +end; + + +procedure TABCLogLinearForm.VarListDblClick(Sender: TObject); +var + index: Integer; + s: String; +begin + index := VarList.ItemIndex; + if index > -1 then begin + s := VarList.Items[index]; + if RowVarEdit.Text = '' then + RowVarEdit.Text := s + else + if ColVarEdit.Text = '' then + ColVarEdit.text := s + else + if SliceVarEdit.Text = '' then + SliceVarEdit.Text := s + else + if FreqVaredit.Text = '' then + FreqVarEdit.Text := s + else + exit; + VarList.Items.Delete(index); + UpdateBtnStates; + end; +end; + + +procedure TABCLogLinearForm.VarListSelectionChange(Sender: TObject; + User: boolean); +begin + UpdateBtnStates; +end; + end. diff --git a/applications/lazstats/source/forms/mainunit.lfm b/applications/lazstats/source/forms/mainunit.lfm index b0e1aa809..55602488a 100644 --- a/applications/lazstats/source/forms/mainunit.lfm +++ b/applications/lazstats/source/forms/mainunit.lfm @@ -19,7 +19,7 @@ object OS3MainFrm: TOS3MainFrm OnCreate = FormCreate OnDestroy = FormDestroy OnShow = FormShow - LCLVersion = '2.0.10.0' + LCLVersion = '2.1.0.0' object PanelTop: TPanel Left = 0 Height = 35 diff --git a/applications/lazstats/source/forms/mainunit.pas b/applications/lazstats/source/forms/mainunit.pas index 2f86ca73f..b3ab2dfc9 100644 --- a/applications/lazstats/source/forms/mainunit.pas +++ b/applications/lazstats/source/forms/mainunit.pas @@ -734,30 +734,6 @@ begin DblDeclineFrm.ShowModal; end; -// Menu "Analysis" > "Cross-classification" > "AxB Log Linear" -procedure TOS3MainFrm.mnuAnalysisCC_ABLogLinClick(Sender: TObject); -begin - if TwoWayLogLinFrm = nil then - Application.CreateForm(TTwoWayLogLinFrm, TwoWayLogLinFrm); - TwoWayLogLinFrm.ShowModal; -end; - -// Menu "Analysis" > "Cross-Classification" > "AxBxC Log Linear" -procedure TOS3MainFrm.mnuAnalysisCC_ABCLogLinClick(Sender: TObject); -begin - if ABCLogLinearFrm = nil then - Application.CreateForm(TABCLogLinearFrm, ABCLogLinearFrm); - ABCLogLinearFrm.ShowModal; -end; - -// Menu "Analysis" > "Cross-classification" > "Log Linear Screen" -procedure TOS3MainFrm.mnuAnalysisCC_LogLinScreenClick(Sender: TObject); -begin - if LogLinScreenFrm = nil then - Application.CreateForm(TLogLinScreenFrm, LogLinScreenFrm); - LogLinScreenFrm.ShowModal; -end; - // Menu "Analysis" > "One sample tests" procedure TOS3MainFrm.mnuAnalysisOneSampleTestsClick(Sender: TObject); begin @@ -1509,6 +1485,33 @@ begin end; +{ "Cross-classification" commands } + +// Menu "Analysis" > "Cross-classification" > "AxB Log Linear" +procedure TOS3MainFrm.mnuAnalysisCC_ABLogLinClick(Sender: TObject); +begin + if TwoWayLogLinFrm = nil then + Application.CreateForm(TTwoWayLogLinFrm, TwoWayLogLinFrm); + TwoWayLogLinFrm.Show; +end; + +// Menu "Analysis" > "Cross-Classification" > "AxBxC Log Linear" +procedure TOS3MainFrm.mnuAnalysisCC_ABCLogLinClick(Sender: TObject); +begin + if ABCLogLinearForm = nil then + Application.CreateForm(TABCLogLinearForm, ABCLogLinearForm); + ABCLogLinearForm.Show; +end; + +// Menu "Analysis" > "Cross-classification" > "Log Linear Screen" +procedure TOS3MainFrm.mnuAnalysisCC_LogLinScreenClick(Sender: TObject); +begin + if LogLinScreenForm = nil then + Application.CreateForm(TLogLinScreenForm, LogLinScreenForm); + LogLinScreenForm.Show; +end; + + { "Measurement Programs" commands } // Menu "Analysis" > "Measurement Programs" > "Generate Sample Test Data"