From 05466b5c0641cc5514a57e75368b2935cfe83201 Mon Sep 17 00:00:00 2001 From: alexs75 Date: Tue, 6 Feb 2018 07:51:03 +0000 Subject: [PATCH] RxFPC:fix drawin separators in RxDBLookupCombo git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6179 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- .../rx/trunk/demos/RxLookup/project1.lpi | 16 +++-- components/rx/trunk/demos/RxLookup/unit1.lfm | 72 +++++++++---------- components/rx/trunk/demos/RxLookup/unit1.pas | 2 +- components/rx/trunk/rxdb/rxlookup.pas | 7 +- 4 files changed, 52 insertions(+), 45 deletions(-) diff --git a/components/rx/trunk/demos/RxLookup/project1.lpi b/components/rx/trunk/demos/RxLookup/project1.lpi index 6ec2d8aca..06c947d17 100644 --- a/components/rx/trunk/demos/RxLookup/project1.lpi +++ b/components/rx/trunk/demos/RxLookup/project1.lpi @@ -59,8 +59,7 @@ - - + @@ -128,14 +127,15 @@ + - - + + - + @@ -194,8 +194,12 @@ - + + + + + diff --git a/components/rx/trunk/demos/RxLookup/unit1.lfm b/components/rx/trunk/demos/RxLookup/unit1.lfm index a34a2560a..3cc828e21 100644 --- a/components/rx/trunk/demos/RxLookup/unit1.lfm +++ b/components/rx/trunk/demos/RxLookup/unit1.lfm @@ -14,9 +14,9 @@ object Form1: TForm1 AnchorSideTop.Control = GroupBox1 AnchorSideTop.Side = asrBottom Left = 6 - Height = 20 - Top = 114 - Width = 85 + Height = 15 + Top = 102 + Width = 67 BorderSpacing.Around = 6 Caption = 'Select item...' ParentColor = False @@ -26,10 +26,10 @@ object Form1: TForm1 AnchorSideLeft.Side = asrBottom AnchorSideTop.Control = Button1 AnchorSideTop.Side = asrCenter - Left = 106 - Height = 20 - Top = 186 - Width = 42 + Left = 103 + Height = 15 + Top = 161 + Width = 34 BorderSpacing.Around = 6 Caption = 'Label2' ParentColor = False @@ -41,8 +41,8 @@ object Form1: TForm1 AnchorSideRight.Control = Owner AnchorSideRight.Side = asrBottom Left = 12 - Height = 32 - Top = 140 + Height = 27 + Top = 123 Width = 480 AutoSize = True Anchors = [akTop, akLeft, akRight] @@ -76,9 +76,9 @@ object Form1: TForm1 AnchorSideTop.Control = RxDBLookupCombo1 AnchorSideTop.Side = asrBottom Left = 6 - Height = 36 - Top = 178 - Width = 94 + Height = 25 + Top = 156 + Width = 91 AutoSize = True BorderSpacing.Around = 6 Caption = 'Test caption' @@ -90,10 +90,10 @@ object Form1: TForm1 AnchorSideTop.Side = asrBottom AnchorSideRight.Control = Owner AnchorSideRight.Side = asrBottom - Left = 425 - Height = 36 - Top = 220 - Width = 67 + Left = 428 + Height = 25 + Top = 187 + Width = 64 Anchors = [akTop, akRight] AutoSize = True BorderSpacing.Around = 6 @@ -107,9 +107,9 @@ object Form1: TForm1 AnchorSideTop.Side = asrBottom AnchorSideRight.Control = Button2 Left = 6 - Height = 37 - Top = 220 - Width = 413 + Height = 23 + Top = 187 + Width = 416 Anchors = [akTop, akLeft, akRight] BorderSpacing.Around = 6 TabOrder = 3 @@ -119,8 +119,8 @@ object Form1: TForm1 AnchorSideTop.Control = Edit1 AnchorSideTop.Side = asrBottom Left = 0 - Height = 105 - Top = 263 + Height = 152 + Top = 216 Width = 498 Align = alBottom Anchors = [akTop, akLeft, akRight, akBottom] @@ -135,23 +135,23 @@ object Form1: TForm1 AnchorSideRight.Control = Owner AnchorSideRight.Side = asrBottom Left = 6 - Height = 102 + Height = 90 Top = 6 Width = 486 Anchors = [akTop, akLeft, akRight] AutoSize = True BorderSpacing.Around = 6 Caption = 'RxDBLookupCombo visual options' - ClientHeight = 81 - ClientWidth = 484 + ClientHeight = 70 + ClientWidth = 482 TabOrder = 5 object CheckBox1: TCheckBox AnchorSideLeft.Control = GroupBox1 AnchorSideTop.Control = GroupBox1 Left = 6 - Height = 24 + Height = 19 Top = 6 - Width = 50 + Width = 39 BorderSpacing.Around = 6 Caption = 'Flat' OnChange = CheckBox1Change @@ -161,10 +161,10 @@ object Form1: TForm1 AnchorSideLeft.Control = CheckBox1 AnchorSideLeft.Side = asrBottom AnchorSideTop.Control = GroupBox1 - Left = 62 - Height = 69 + Left = 51 + Height = 58 Top = 6 - Width = 95 + Width = 81 AutoFill = True AutoSize = True BorderSpacing.Around = 6 @@ -176,8 +176,8 @@ object Form1: TForm1 ChildSizing.ShrinkVertical = crsScaleChilds ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.ControlsPerLine = 1 - ClientHeight = 48 - ClientWidth = 93 + ClientHeight = 38 + ClientWidth = 77 ItemIndex = 0 Items.Strings = ( 'bsNone' @@ -190,10 +190,10 @@ object Form1: TForm1 AnchorSideLeft.Control = GroupBox1 AnchorSideLeft.Side = asrCenter AnchorSideTop.Control = GroupBox1 - Left = 164 - Height = 69 + Left = 176 + Height = 58 Top = 6 - Width = 156 + Width = 131 AutoFill = True AutoSize = True BorderSpacing.Around = 6 @@ -205,8 +205,8 @@ object Form1: TForm1 ChildSizing.ShrinkVertical = crsScaleChilds ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.ControlsPerLine = 1 - ClientHeight = 48 - ClientWidth = 154 + ClientHeight = 38 + ClientWidth = 127 ItemIndex = 0 Items.Strings = ( 'rxcsDropDown' diff --git a/components/rx/trunk/demos/RxLookup/unit1.pas b/components/rx/trunk/demos/RxLookup/unit1.pas index 30ab0faed..2c63c8697 100644 --- a/components/rx/trunk/demos/RxLookup/unit1.pas +++ b/components/rx/trunk/demos/RxLookup/unit1.pas @@ -87,7 +87,7 @@ begin rxLookUpData.AppendRecord([4, 'MS Windows XP', 150]); rxLookUpData.AppendRecord([5, 'MS Windows Vista', 100]); rxLookUpData.AppendRecord([6, 'MS Windows 7', 200]); - rxLookUpData.AppendRecord([7, 'Fedora Linux 11', 0]); + rxLookUpData.AppendRecord([7, 'Fedora Linux 11 - 27', 0]); Label2.Caption:=''; end; diff --git a/components/rx/trunk/rxdb/rxlookup.pas b/components/rx/trunk/rxdb/rxlookup.pas index 57c5cfe6c..ed3813552 100644 --- a/components/rx/trunk/rxdb/rxlookup.pas +++ b/components/rx/trunk/rxdb/rxlookup.pas @@ -974,12 +974,17 @@ begin begin R1:=R; R1.Left:=R1.Left + Max(0, X); + if R1.Right > ARight then + R1.Right:=ARight; ThemeServices.DrawText(ACanvas, AThemedDetails^, S, R1, DT_LEFT or DT_VCENTER or DT_SINGLELINE, 0) end else ACanvas.TextRect(R, R.Left + Max(0, X), ATop, S); Inc(R.Left, W); + if R.Left >= ARight then + Break; + if I < LastIndex then begin if ThemeServices.ThemesEnabled and (FStyle = rxcsDropDownList) then @@ -995,8 +1000,6 @@ begin end; Inc(R.Left); end; - if R.Left >= ARight then - Break; end; end;