RxFPC:fix RxDBGrid filter form

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6206 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
alexs75
2018-02-19 05:28:33 +00:00
parent 73df13182b
commit 16664fcf64
3 changed files with 37 additions and 49 deletions

View File

@ -1,29 +1,6 @@
2. TPageManager предназначен для построения мастеров 1. Contributors
умеет отображать в заголовке формы (если установлена соответсвующая опция) brick08 - from freepascal.ru
текст, который сформатирует из строк информациия (пропускается через функцию Format) rtn - from freepascal.ru
строка информации может содержать в себе два целочисленных параметра (%d) kit - from freepascal.ru
первый - текущий шаг
второй - всего шагов
пример:
'Мастер приёма. Шаг %d из %d.'
StatusControl - если установлен то в заголовке также отображается эта же
информация.
событие OnCheckPageEnabled служит для указания, что конкретная страница
запрещена при нажатии на кнопки Next и Prior эта страница пропускается
5. Замечание о RXDBGRID_OPTIONS_WO_CANCEL_ON_EXIT и флаге dgCancelOnExit в
TRxDbGrid.Options
в случае использования следующей схемы под линуксом:
В форму ложим список TRxDbGrid с открытым набором данных и отдельную кнопку (TSpeedButton) на
добавление новой записи в набор данных с вызовом другой модальной формы для редактирования
добовляемых значение
при открытии формы редактирования набор данных, связанный с TRxDbGrid переходит в состояние
редактирования
это поведени наблюдается только по Linux
объяснение заключается в том что при потере фокуса TDbGrid и его наследниеи вызывают
метод Cancel
7. Вопросы задавать мылом или на форуме FreePascal.ru (предпочтительней) 7. Вопросы задавать мылом или на форуме FreePascal.ru (предпочтительней)

View File

@ -9,14 +9,14 @@ object rxFilterByForm: TrxFilterByForm
ClientWidth = 644 ClientWidth = 644
OnCreate = FormCreate OnCreate = FormCreate
Position = poScreenCenter Position = poScreenCenter
LCLVersion = '1.7' LCLVersion = '1.9.0.0'
object Label1: TLabel object Label1: TLabel
AnchorSideLeft.Control = Owner AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Owner AnchorSideTop.Control = Owner
Left = 6 Left = 6
Height = 20 Height = 20
Top = 6 Top = 6
Width = 214 Width = 212
BorderSpacing.Around = 6 BorderSpacing.Around = 6
Caption = 'Select filter expression for data' Caption = 'Select filter expression for data'
Font.Style = [fsBold] Font.Style = [fsBold]
@ -30,7 +30,7 @@ object rxFilterByForm: TrxFilterByForm
Left = 6 Left = 6
Height = 20 Height = 20
Top = 32 Top = 32
Width = 57 Width = 58
BorderSpacing.Around = 6 BorderSpacing.Around = 6
Caption = 'On field:' Caption = 'On field:'
Font.Color = clRed Font.Color = clRed
@ -44,7 +44,7 @@ object rxFilterByForm: TrxFilterByForm
Left = 168 Left = 168
Height = 20 Height = 20
Top = 32 Top = 32
Width = 75 Width = 74
BorderSpacing.Around = 6 BorderSpacing.Around = 6
Caption = 'Operation :' Caption = 'Operation :'
Font.Color = clRed Font.Color = clRed
@ -73,7 +73,7 @@ object rxFilterByForm: TrxFilterByForm
Left = 533 Left = 533
Height = 20 Height = 20
Top = 32 Top = 32
Width = 66 Width = 65
BorderSpacing.Around = 6 BorderSpacing.Around = 6
Caption = 'Operand :' Caption = 'Operand :'
Font.Color = clRed Font.Color = clRed
@ -143,7 +143,7 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideRight.Control = Owner AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 527 Left = 527
Height = 36 Height = 32
Top = 58 Top = 58
Width = 111 Width = 111
Anchors = [akTop, akRight] Anchors = [akTop, akRight]
@ -214,7 +214,7 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideRight.Control = Owner AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 527 Left = 527
Height = 36 Height = 32
Top = 100 Top = 100
Width = 111 Width = 111
Anchors = [akTop, akRight] Anchors = [akTop, akRight]
@ -285,7 +285,7 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideRight.Control = Owner AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 527 Left = 527
Height = 36 Height = 32
Top = 144 Top = 144
Width = 111 Width = 111
Anchors = [akTop, akRight] Anchors = [akTop, akRight]
@ -356,7 +356,7 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideRight.Control = Owner AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 527 Left = 527
Height = 36 Height = 32
Top = 188 Top = 188
Width = 111 Width = 111
Anchors = [akTop, akRight] Anchors = [akTop, akRight]
@ -427,7 +427,7 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideRight.Control = Owner AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 527 Left = 527
Height = 36 Height = 32
Top = 232 Top = 232
Width = 111 Width = 111
Anchors = [akTop, akRight] Anchors = [akTop, akRight]
@ -498,7 +498,7 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideRight.Control = Owner AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 527 Left = 527
Height = 36 Height = 32
Top = 276 Top = 276
Width = 111 Width = 111
Anchors = [akTop, akRight] Anchors = [akTop, akRight]
@ -569,7 +569,7 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideRight.Control = Owner AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 527 Left = 527
Height = 36 Height = 32
Top = 320 Top = 320
Width = 111 Width = 111
Anchors = [akTop, akRight] Anchors = [akTop, akRight]
@ -640,7 +640,7 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideRight.Control = Owner AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 527 Left = 527
Height = 36 Height = 32
Top = 364 Top = 364
Width = 111 Width = 111
Anchors = [akTop, akRight] Anchors = [akTop, akRight]
@ -710,8 +710,8 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideBottom.Control = Owner AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 6 Left = 6
Height = 36 Height = 32
Top = 403 Top = 407
Width = 58 Width = 58
Anchors = [akLeft, akBottom] Anchors = [akLeft, akBottom]
BorderSpacing.Around = 6 BorderSpacing.Around = 6
@ -729,10 +729,10 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = Owner AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 585 Left = 586
Height = 36 Height = 36
Top = 403 Top = 403
Width = 53 Width = 52
Anchors = [akRight, akBottom] Anchors = [akRight, akBottom]
AutoSize = True AutoSize = True
BorderSpacing.Around = 6 BorderSpacing.Around = 6
@ -745,10 +745,10 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideRight.Control = Button1 AnchorSideRight.Control = Button1
AnchorSideBottom.Control = Owner AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 519 Left = 521
Height = 36 Height = 36
Top = 403 Top = 403
Width = 60 Width = 59
Anchors = [akRight, akBottom] Anchors = [akRight, akBottom]
AutoSize = True AutoSize = True
BorderSpacing.Around = 6 BorderSpacing.Around = 6
@ -761,10 +761,10 @@ object rxFilterByForm: TrxFilterByForm
AnchorSideRight.Control = Button2 AnchorSideRight.Control = Button2
AnchorSideBottom.Control = Owner AnchorSideBottom.Control = Owner
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 429 Left = 432
Height = 36 Height = 36
Top = 403 Top = 403
Width = 84 Width = 83
Anchors = [akRight, akBottom] Anchors = [akRight, akBottom]
AutoSize = True AutoSize = True
BorderSpacing.Around = 6 BorderSpacing.Around = 6

View File

@ -181,22 +181,33 @@ end;
procedure TrxFilterByForm.ClearALL(AGrid: TRxDBGrid); procedure TrxFilterByForm.ClearALL(AGrid: TRxDBGrid);
var var
i : Integer; i , wsb, w, wt: Integer;
begin begin
//***************************************************************************** //*****************************************************************************
Combo_1[1].Items.Clear; Combo_1[1].Items.Clear;
Combo_1[1].Items.Add(''); Combo_1[1].Items.Add('');
wsb:= 30; //ширина скроллбара
w := Combo_1[1].Width - wsb;
for i := 0 To AGrid.Columns.Count-1 do for i := 0 To AGrid.Columns.Count-1 do
begin begin
if Assigned(AGrid.Columns[i].Field) and (AGrid.Columns[i].Field.FieldKind=fkData) and (AGrid.Columns[i].Visible) then if Assigned(AGrid.Columns[i].Field) and (AGrid.Columns[i].Field.FieldKind=fkData) and (AGrid.Columns[i].Visible) then
begin
Combo_1[1].Items.Objects[Combo_1[1].Items.Add(AGrid.Columns[i].Title.Caption)]:=AGrid.Columns[i].Field; Combo_1[1].Items.Objects[Combo_1[1].Items.Add(AGrid.Columns[i].Title.Caption)]:=AGrid.Columns[i].Field;
wt := Canvas.TextWidth(AGrid.Columns[i].Title.Caption);
if wt > w then
w := wt;
end;
end; end;
Combo_1[1].ItemIndex := 0; Combo_1[1].ItemIndex := 0;
Combo_1[1].ItemWidth := w + wsb;
for i := 2 To 9 do for i := 2 To 9 do
begin begin
Combo_1[i].Items.Assign(Combo_1[1].Items); Combo_1[i].Items.Assign(Combo_1[1].Items);
Combo_1[i].ItemIndex := 0; Combo_1[i].ItemIndex := 0;
Combo_1[i].ItemWidth := w + wsb;
end; end;
Combo_2[1].Items.Clear; Combo_2[1].Items.Clear;