diff --git a/components/gradcontrols/examples/Forms/main.lfm b/components/gradcontrols/examples/Forms/main.lfm
index ffb782a37..42bcf5f6e 100644
--- a/components/gradcontrols/examples/Forms/main.lfm
+++ b/components/gradcontrols/examples/Forms/main.lfm
@@ -1,7 +1,7 @@
object Form1: TForm1
- Left = 89
+ Left = 368
Height = 439
- Top = 159
+ Top = 215
Width = 576
ActiveControl = TrackBar1
BorderIcons = [biSystemMenu, biMinimize]
@@ -10,7 +10,7 @@ object Form1: TForm1
ClientHeight = 439
ClientWidth = 576
OnCreate = FormCreate
- LCLVersion = '0.9.27'
+ LCLVersion = '0.9.29'
object Label1: TLabel
Left = 8
Height = 16
@@ -291,7 +291,7 @@ object Form1: TForm1
end
object LabeledEdit1: TLabeledEdit
Left = 328
- Height = 25
+ Height = 23
Top = 216
Width = 80
EditLabel.AnchorSideLeft.Control = LabeledEdit1
diff --git a/components/gradcontrols/examples/Forms/main.lrs b/components/gradcontrols/examples/Forms/main.lrs
index 5a096159d..9af02a4d8 100644
--- a/components/gradcontrols/examples/Forms/main.lrs
+++ b/components/gradcontrols/examples/Forms/main.lrs
@@ -1,15 +1,15 @@
{ Das ist eine automatisch erzeugte Lazarus-Ressourcendatei }
LazarusResources.Add('TForm1','FORMDATA',[
- 'TPF0'#6'TForm1'#5'Form1'#4'Left'#2'Y'#6'Height'#3#183#1#3'Top'#3#159#0#5'Wid'
- +'th'#3'@'#2#13'ActiveControl'#7#9'TrackBar1'#11'BorderIcons'#11#12'biSystemM'
- +'enu'#10'biMinimize'#0#11'BorderStyle'#7#8'bsSingle'#7'Caption'#6#16'TGradBu'
- +'tton-Demo'#12'ClientHeight'#3#183#1#11'ClientWidth'#3'@'#2#8'OnCreate'#7#10
- +'FormCreate'#10'LCLVersion'#6#6'0.9.27'#0#6'TLabel'#6'Label1'#4'Left'#2#8#6
- +'Height'#2#16#3'Top'#2'K'#5'Width'#2'G'#7'Caption'#6#11'NormalBlend'#11'Pare'
- +'ntColor'#8#0#0#6'TLabel'#6'Label2'#4'Left'#2#8#6'Height'#2#16#3'Top'#3#131#0
- +#5'Width'#2'8'#7'Caption'#6#9'OverBlend'#11'ParentColor'#8#0#0#6'TLabel'#6'L'
- +'abel3'#4'Left'#2'X'#6'Height'#2#16#3'Top'#2'K'#5'Width'#2#1#11'ParentColor'
+ 'TPF0'#6'TForm1'#5'Form1'#4'Left'#3'p'#1#6'Height'#3#183#1#3'Top'#3#215#0#5'W'
+ +'idth'#3'@'#2#13'ActiveControl'#7#9'TrackBar1'#11'BorderIcons'#11#12'biSyste'
+ +'mMenu'#10'biMinimize'#0#11'BorderStyle'#7#8'bsSingle'#7'Caption'#6#16'TGrad'
+ +'Button-Demo'#12'ClientHeight'#3#183#1#11'ClientWidth'#3'@'#2#8'OnCreate'#7
+ +#10'FormCreate'#10'LCLVersion'#6#6'0.9.29'#0#6'TLabel'#6'Label1'#4'Left'#2#8
+ +#6'Height'#2#16#3'Top'#2'K'#5'Width'#2'G'#7'Caption'#6#11'NormalBlend'#11'Pa'
+ +'rentColor'#8#0#0#6'TLabel'#6'Label2'#4'Left'#2#8#6'Height'#2#16#3'Top'#3#131
+ +#0#5'Width'#2'8'#7'Caption'#6#9'OverBlend'#11'ParentColor'#8#0#0#6'TLabel'#6
+ +'Label3'#4'Left'#2'X'#6'Height'#2#16#3'Top'#2'K'#5'Width'#2#1#11'ParentColor'
+#8#0#0#6'TLabel'#6'Label4'#4'Left'#2'X'#6'Height'#2#16#3'Top'#3#131#0#5'Widt'
+'h'#2#1#11'ParentColor'#8#0#0#6'TLabel'#6'Label5'#4'Left'#2'%'#6'Height'#2#16
+#3'Top'#2#16#5'Width'#2'9'#7'Caption'#6#10'Base Color'#11'ParentColor'#8#0#0
@@ -90,7 +90,7 @@ LazarusResources.Add('TForm1','FORMDATA',[
+'eight'#2'X'#11'ClientWidth'#2'}'#9'ItemIndex'#2#0#13'Items.Strings'#1#6#8't'
+'aCenter'#6#13'taLeftJustify'#6#14'taRightJustify'#0#7'OnClick'#7#16'RadioGr'
+'oup4Click'#8'TabOrder'#2#5#0#0#12'TLabeledEdit'#12'LabeledEdit1'#4'Left'#3
- +'H'#1#6'Height'#2#25#3'Top'#3#216#0#5'Width'#2'P EditLabel.AnchorSideLeft.Co'
+ +'H'#1#6'Height'#2#23#3'Top'#3#216#0#5'Width'#2'P EditLabel.AnchorSideLeft.Co'
+'ntrol'#7#12'LabeledEdit1"EditLabel.AnchorSideBottom.Control'#7#12'LabeledEd'
+'it1'#14'EditLabel.Left'#3'H'#1#16'EditLabel.Height'#2#16#13'EditLabel.Top'#3
+#197#0#15'EditLabel.Width'#2'R'#17'EditLabel.Caption'#6#14'Button Caption'#21
diff --git a/components/gradcontrols/examples/Forms/unit1.lfm b/components/gradcontrols/examples/Forms/unit1.lfm
index 15ab10c04..14eb5b20f 100644
--- a/components/gradcontrols/examples/Forms/unit1.lfm
+++ b/components/gradcontrols/examples/Forms/unit1.lfm
@@ -1,14 +1,14 @@
object Form1: TForm1
- Left = 275
+ Left = 229
Height = 493
- Top = 161
+ Top = 150
Width = 884
Caption = 'TGradTabControl-Testsuite'
ClientHeight = 493
ClientWidth = 884
OnCreate = FormCreate
OnDestroy = FormDestroy
- LCLVersion = '0.9.27'
+ LCLVersion = '0.9.29'
object Panel1: TPanel
Left = 0
Height = 493
@@ -94,7 +94,7 @@ object Form1: TForm1
end
object GradTabPage2: TGradTabPage
Left = 2
- Height = 488
+ Height = 489
Top = 22
Width = 642
PageIndex = 2
@@ -247,8 +247,8 @@ object Form1: TForm1
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
- ClientHeight = 95
- ClientWidth = 96
+ ClientHeight = 113
+ ClientWidth = 100
ItemIndex = 0
Items.Strings = (
'tpTop'
@@ -321,7 +321,7 @@ object Form1: TForm1
end
object SpinEdit2: TSpinEdit
Left = 16
- Height = 25
+ Height = 23
Top = 176
Width = 100
OnEditingDone = SpinEdit2EditingDone
@@ -329,7 +329,7 @@ object Form1: TForm1
end
object Edit1: TEdit
Left = 16
- Height = 25
+ Height = 23
Top = 136
Width = 72
TabOrder = 6
@@ -337,7 +337,7 @@ object Form1: TForm1
end
object GradButton1: TGradButton
Left = 90
- Height = 19
+ Height = 22
Top = 136
Width = 26
Caption = 'set'
@@ -402,8 +402,8 @@ object Form1: TForm1
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
- ClientHeight = 87
- ClientWidth = 96
+ ClientHeight = 105
+ ClientWidth = 100
ItemIndex = 0
Items.Strings = (
'blGlyphLeft'
@@ -414,6 +414,41 @@ object Form1: TForm1
OnClick = RadioGroup2Click
TabOrder = 9
end
+ object Label2: TLabel
+ Left = 18
+ Height = 16
+ Top = 208
+ Width = 26
+ Caption = 'Style'
+ ParentColor = False
+ end
+ object ComboBox2: TComboBox
+ Left = 16
+ Height = 23
+ Top = 225
+ Width = 100
+ AutoDropDown = True
+ ItemHeight = 15
+ ItemIndex = 0
+ Items.Strings = (
+ 'Standard'
+ 'Vista'
+ 'VistaBlue'
+ )
+ OnChange = ComboBox2Change
+ Style = csDropDownList
+ TabOrder = 10
+ Text = 'Standard'
+ end
+ object CheckBox2: TCheckBox
+ Left = 16
+ Height = 19
+ Top = 256
+ Width = 112
+ Caption = 'Rounded Corners'
+ OnChange = CheckBox2Change
+ TabOrder = 11
+ end
end
object PopupMenu1: TPopupMenu
left = 734
diff --git a/components/gradcontrols/examples/Forms/unit1.lrs b/components/gradcontrols/examples/Forms/unit1.lrs
index dba2d1f59..8ac57bfc3 100644
--- a/components/gradcontrols/examples/Forms/unit1.lrs
+++ b/components/gradcontrols/examples/Forms/unit1.lrs
@@ -1,10 +1,10 @@
{ Das ist eine automatisch erzeugte Lazarus-Ressourcendatei }
LazarusResources.Add('TForm1','FORMDATA',[
- 'TPF0'#6'TForm1'#5'Form1'#4'Left'#3#19#1#6'Height'#3#237#1#3'Top'#3#161#0#5'W'
- +'idth'#3't'#3#7'Caption'#6#25'TGradTabControl-Testsuite'#12'ClientHeight'#3
+ 'TPF0'#6'TForm1'#5'Form1'#4'Left'#3#229#0#6'Height'#3#237#1#3'Top'#3#150#0#5
+ +'Width'#3't'#3#7'Caption'#6#25'TGradTabControl-Testsuite'#12'ClientHeight'#3
+#237#1#11'ClientWidth'#3't'#3#8'OnCreate'#7#10'FormCreate'#9'OnDestroy'#7#11
- +'FormDestroy'#10'LCLVersion'#6#6'0.9.27'#0#6'TPanel'#6'Panel1'#4'Left'#2#0#6
+ +'FormDestroy'#10'LCLVersion'#6#6'0.9.29'#0#6'TPanel'#6'Panel1'#4'Left'#2#0#6
+'Height'#3#237#1#3'Top'#2#0#5'Width'#3#134#2#5'Align'#7#8'alClient'#7'Captio'
+'n'#6#6'Panel1'#12'ClientHeight'#3#237#1#11'ClientWidth'#3#134#2#8'TabOrder'
+#2#0#0#15'TGradTabControl'#15'GradTabControl1'#4'Left'#2#1#6'Height'#3#235#1
@@ -56,20 +56,20 @@ LazarusResources.Add('TForm1','FORMDATA',[
+#182#255'@'#157#187#255'N'#182#218#255'z'#204#233#130#0#0'#'#0'dNF'#128'hH?'
+#142'U5-~'#132#197#217'j['#186#217#252'Y'#190#225#255'Y'#185#219#255'P'#177
+#211#255'<'#164#200#255'0'#153#189#255'1'#147#181#255'9'#153#187#255'@'#164
- +#199#255'P'#175#207#253'|'#195#215#135#0#0'#'#0'kRJ|pLE'#137'\9-l'#195#218
- +'Ol'#210#245#254'_'#199#235#255'S'#187#223#255'G'#176#212#255'<'#164#200#255
- +'0'#153#189#255'('#144#180#255')'#145#181#255'4'#156#192#255'O'#182#218#255
- +#130#205#229'o'#0#0'#'#0#0#0#0#6'6"'#27'&M.(t}'#198#223'lk'#204#235#255'I'
- +#175#207#255';'#166#201#255'4'#162#197#255'.'#158#195#255'-'#157#194#255'-'
- +#156#191#255'/'#155#190#255'6'#158#192#255'P'#178#210#255'y'#204#234#130#0#0
- +'#'#0#0#0#0#9'bB:'#188'R2('#164'z'#164#179'U7'#162#195#243#24#159#207#255#24
- +#159#207#255#24#159#207#255#24#159#207#255#24#159#207#255#24#159#207#255#24
- +#159#207#255#24#159#207#255'.'#159#196#247'{'#184#200'i'#0#0'#'#0#0#0'#'#0'{'
- ,'SIfg@4'#148#26#0#0#10'q'#161#162'$:'#159#189#158'1'#159#193#188'.'#159#195
+ +#199#255'P'#175#207#253'|'#195#215#135#0#0'#'#0'kRJ|pLE'#137'\9-l'#127#195
+ +#218'Ol'#210#245#254'_'#199#235#255'S'#187#223#255'G'#176#212#255'<'#164#200
+ +#255'0'#153#189#255'('#144#180#255')'#145#181#255'4'#156#192#255'O'#182#218
+ +#255#130#205#229'o'#0#0'#'#0#0#0#0#6'6"'#27'&M.(t}'#198#223'lk'#204#235#255
+ +'I'#175#207#255';'#166#201#255'4'#162#197#255'.'#158#195#255'-'#157#194#255
+ +'-'#156#191#255'/'#155#190#255'6'#158#192#255'P'#178#210#255'y'#204#234#130#0
+ +#0'#'#0#0#0#0#9'bB:'#188'R2('#164'z'#164#179'U7'#162#195#243#24#159#207#255
+ +#24#159#207#255#24#159#207#255#24#159#207#255#24#159#207#255#24#159#207#255
+ +#24#159#207#255#24#159#207#255'.'#159#196#247'{'#184#200'i'#0#0'#'#0#0#0'#'#0
+ ,'{SIfg@4'#148#26#0#0#10'q'#161#162'$:'#159#189#158'1'#159#193#188'.'#159#195
+#211'+'#158#196#234'+'#159#195#236'-'#159#195#214'0'#159#195#191'7'#160#192
+#164'^'#161#173'1'#0#0'#'#0#0#0'#'#0#12'TabShowGlyph'#9#15'TabButtonLayout'#7
+#11'blGlyphLeft'#0#0#12'TGradTabPage'#12'GradTabPage2'#4'Left'#2#2#6'Height'
- +#3#232#1#3'Top'#2#22#5'Width'#3#130#2#9'PageIndex'#2#2#7'Caption'#6#12'GradT'
+ +#3#233#1#3'Top'#2#22#5'Width'#3#130#2#9'PageIndex'#2#2#7'Caption'#6#12'GradT'
+'abPage2'#15'ShowCloseButton'#9#8'TabColor'#7#6'clBlue'#16'TabTextAlignment'
+#7#13'taLeftJustify'#13'TabGlyph.Data'#10':'#4#0#0'6'#4#0#0'BM6'#4#0#0#0#0#0
+#0'6'#0#0#0'('#0#0#0#16#0#0#0#16#0#0#0#1#0' '#0#0#0#0#0#0#4#0#0'd'#0#0#0'd'#0
@@ -106,10 +106,10 @@ LazarusResources.Add('TForm1','FORMDATA',[
+#255'N'#182#218#255'z'#204#233#130#0#0'#'#0'dNF'#128'hH?'#142'U5-~'#132#197
+#217'j['#186#217#252'Y'#190#225#255'Y'#185#219#255'P'#177#211#255'<'#164#200
+#255'0'#153#189#255'1'#147#181#255'9'#153#187#255'@'#164#199#255'P'#175#207
- +#253'|'#195#215#135#0#0'#'#0'kRJ|pLE'#137'\9-l'#195#218'Ol'#210#245#254'_'
- +#199#235#255'S'#187#223#255'G'#176#212#255'<'#164#200#255'0'#153#189#255'('
- +#144#180#255')'#145#181#255'4'#156#192#255'O'#182#218#255#130#205#229'o'#0#0
- +'#'#0#0#0#0#6'6"'#27'&M.(t}'#198#223'lk'#204#235#255'I'#175#207#255';'#166
+ +#253'|'#195#215#135#0#0'#'#0'kRJ|pLE'#137'\9-l'#127#195#218'Ol'#210#245#254
+ +'_'#199#235#255'S'#187#223#255'G'#176#212#255'<'#164#200#255'0'#153#189#255
+ +'('#144#180#255')'#145#181#255'4'#156#192#255'O'#182#218#255#130#205#229'o'#0
+ +#0'#'#0#0#0#0#6'6"'#27'&M.(t}'#198#223'lk'#204#235#255'I'#175#207#255';'#166
+#201#255'4'#162#197#255'.'#158#195#255'-'#157#194#255'-'#156#191#255'/'#155
+#190#255'6'#158#192#255'P'#178#210#255'y'#204#234#130#0#0'#'#0#0#0#0#9'bB:'
+#188'R2('#164'z'#164#179'U7'#162#195#243#24#159#207#255#24#159#207#255#24#159
@@ -156,10 +156,10 @@ LazarusResources.Add('TForm1','FORMDATA',[
+#255'N'#182#218#255'z'#204#233#130#0#0'#'#0'dNF'#128'hH?'#142'U5-~'#132#197
+#217'j['#186#217#252'Y'#190#225#255'Y'#185#219#255'P'#177#211#255'<'#164#200
+#255'0'#153#189#255'1'#147#181#255'9'#153#187#255'@'#164#199#255'P'#175#207
- +#253'|'#195#215#135#0#0'#'#0'kRJ|pLE'#137'\9-l'#195#218'Ol'#210#245#254'_'
- +#199#235#255'S'#187#223#255'G'#176#212#255'<'#164#200#255'0'#153#189#255'('
- +#144#180#255')'#145#181#255'4'#156#192#255'O'#182#218#255#130#205#229'o'#0#0
- +'#'#0#0#0#0#6'6"'#27'&M.(t}'#198#223'lk'#204#235#255'I'#175#207#255';'#166
+ +#253'|'#195#215#135#0#0'#'#0'kRJ|pLE'#137'\9-l'#127#195#218'Ol'#210#245#254
+ +'_'#199#235#255'S'#187#223#255'G'#176#212#255'<'#164#200#255'0'#153#189#255
+ +'('#144#180#255')'#145#181#255'4'#156#192#255'O'#182#218#255#130#205#229'o'#0
+ +#0'#'#0#0#0#0#6'6"'#27'&M.(t}'#198#223'lk'#204#235#255'I'#175#207#255';'#166
+#201#255'4'#162#197#255'.'#158#195#255'-'#157#194#255'-'#156#191#255'/'#155
+#190#255'6'#158#192#255'P'#178#210#255'y'#204#234#130#0#0'#'#0#0#0#0#9'bB:'
+#188'R2('#164'z'#164#179'U7'#162#195#243#24#159#207#255#24#159#207#255#24#159
@@ -184,7 +184,7 @@ LazarusResources.Add('TForm1','FORMDATA',[
+'esize'#28'ChildSizing.ShrinkHorizontal'#7#14'crsScaleChilds'#26'ChildSizing'
+'.ShrinkVertical'#7#14'crsScaleChilds'#18'ChildSizing.Layout'#7#29'cclLeftTo'
+'RightThenTopToBottom'#27'ChildSizing.ControlsPerLine'#2#1#12'ClientHeight'#2
- +'_'#11'ClientWidth'#2'`'#9'ItemIndex'#2#0#13'Items.Strings'#1#6#5'tpTop'#6#8
+ +'q'#11'ClientWidth'#2'd'#9'ItemIndex'#2#0#13'Items.Strings'#1#6#5'tpTop'#6#8
+'tpBottom'#6#6'tpLeft'#6#7'tpRight'#0#7'OnClick'#7#16'RadioGroup1Click'#8'Ta'
+'bOrder'#2#1#0#0#9'TCheckBox'#9'CheckBox1'#4'Left'#2#16#6'Height'#2#16#3'Top'
+#2'p'#5'Width'#2'd'#8'AutoSize'#8#7'Caption'#6#9'Long Tabs'#7'OnClick'#7#14
@@ -205,11 +205,11 @@ LazarusResources.Add('TForm1','FORMDATA',[
+'clSilver'#15'BackgroundColor'#7#9'clBtnFace'#15'ShowFocusBorder'#9#9'ShowGl'
+'yph'#8#20'GlyphBackgroundColor'#7#7'clWhite'#10'ClickColor'#7#6'clBlue'#19
+'OwnerBackgroundDraw'#8#22'AutoWidthBorderSpacing'#2#15#23'AutoHeightBorderS'
- +'pacing'#2#15#0#0#9'TSpinEdit'#9'SpinEdit2'#4'Left'#2#16#6'Height'#2#25#3'To'
+ +'pacing'#2#15#0#0#9'TSpinEdit'#9'SpinEdit2'#4'Left'#2#16#6'Height'#2#23#3'To'
+'p'#3#176#0#5'Width'#2'd'#13'OnEditingDone'#7#20'SpinEdit2EditingDone'#8'Tab'
- +'Order'#2#5#0#0#5'TEdit'#5'Edit1'#4'Left'#2#16#6'Height'#2#25#3'Top'#3#136#0
+ +'Order'#2#5#0#0#5'TEdit'#5'Edit1'#4'Left'#2#16#6'Height'#2#23#3'Top'#3#136#0
+#5'Width'#2'H'#8'TabOrder'#2#6#4'Text'#6#5'Edit1'#0#0#11'TGradButton'#11'Gra'
- +'dButton1'#4'Left'#2'Z'#6'Height'#2#19#3'Top'#3#136#0#5'Width'#2#26#7'Captio'
+ +'dButton1'#4'Left'#2'Z'#6'Height'#2#22#3'Top'#3#136#0#5'Width'#2#26#7'Captio'
+'n'#6#3'set'#10'Font.Color'#7#7'clWhite'#7'OnClick'#7#16'GradButton1Click'#8
+'TabOrder'#2#7#7'TabStop'#9#11'NormalBlend'#5#0#0#0#0#0#0#0#128#254'?'#9'Ove'
+'rBlend'#5'5^'#186'I'#12#2'+'#167#254'?'#9'BaseColor'#7#6'clBlue'#5'Color'#7
@@ -234,22 +234,30 @@ LazarusResources.Add('TForm1','FORMDATA',[
+#24'crsHomogenousChildResize'#28'ChildSizing.ShrinkHorizontal'#7#14'crsScale'
+'Childs'#26'ChildSizing.ShrinkVertical'#7#14'crsScaleChilds'#18'ChildSizing.'
+'Layout'#7#29'cclLeftToRightThenTopToBottom'#27'ChildSizing.ControlsPerLine'
- +#2#1#12'ClientHeight'#2'W'#11'ClientWidth'#2'`'#9'ItemIndex'#2#0#13'Items.St'
+ +#2#1#12'ClientHeight'#2'i'#11'ClientWidth'#2'd'#9'ItemIndex'#2#0#13'Items.St'
+'rings'#1#6#11'blGlyphLeft'#6#13'blGlyphBottom'#6#12'blGlyphRight'#6#10'blGl'
- +'yphTop'#0#7'OnClick'#7#16'RadioGroup2Click'#8'TabOrder'#2#9#0#0#0#10'TPopup'
- +'Menu'#10'PopupMenu1'#4'left'#3#222#2#3'top'#3#141#1#0#9'TMenuItem'#9'MenuIt'
- +'em1'#3'Tag'#4#152''#18#0#7'Caption'#6#9'New Item1'#0#0#0#10'TImageList'#10
- +'ImageList1'#4'left'#3#144#2#3'top'#3#141#1#6'Bitmap'#10#14#4#0#0'Li'#1#0#0#0
- +#16#0#0#0#16#0#0#0#0#0'#'#0'{SIfg@4'#148#26#0#0#10'q'#161#162'$:'#159#189#158
- +'1'#159#193#188'.'#159#195#211'+'#158#196#234'+'#159#195#236'-'#159#195#214
- +'0'#159#195#191'7'#160#192#164'^'#161#173'1'#0#0'#'#0#0#0'#'#0#0#0#0#9'bB:'
- +#188'R2('#164'z'#164#179'U7'#162#195#243#24#159#207#255#24#159#207#255#24#159
- +#207#255#24#159#207#255#24#159#207#255#24#159#207#255#24#159#207#255#24#159
- +#207#255'.'#159#196#247'{'#184#200'i'#0#0'#'#0#0#0#0#6'6"'#27'&M.(t}'#198#223
- +'lk'#204#235#255'I'#175#207#255';'#166#201#255'4'#162#197#255'.'#158#195#255
- +'-'#157#194#255'-'#156#191#255'/'#155#190#255'6'#158#192#255'P'#178#210#255
- +'y'#204#234#130#0#0'#'#0'kRJ|pLE'#137'\9-l'#195#218'Ol'#210#245#254'_'#199
- +#235#255'S'#187#223#255'G'#176#212#255'<'#164#200#255'0'#153#189#255'('#144
+ +'yphTop'#0#7'OnClick'#7#16'RadioGroup2Click'#8'TabOrder'#2#9#0#0#6'TLabel'#6
+ +'Label2'#4'Left'#2#18#6'Height'#2#16#3'Top'#3#208#0#5'Width'#2#26#7'Caption'
+ +#6#5'Style'#11'ParentColor'#8#0#0#9'TComboBox'#9'ComboBox2'#4'Left'#2#16#6'H'
+ +'eight'#2#23#3'Top'#3#225#0#5'Width'#2'd'#12'AutoDropDown'#9#10'ItemHeight'#2
+ +#15#9'ItemIndex'#2#0#13'Items.Strings'#1#6#8'Standard'#6#5'Vista'#6#9'VistaB'
+ +'lue'#0#8'OnChange'#7#15'ComboBox2Change'#5'Style'#7#14'csDropDownList'#8'Ta'
+ +'bOrder'#2#10#4'Text'#6#8'Standard'#0#0#9'TCheckBox'#9'CheckBox2'#4'Left'#2
+ +#16#6'Height'#2#19#3'Top'#3#0#1#5'Width'#2'p'#7'Caption'#6#15'Rounded Corner'
+ +'s'#8'OnChange'#7#15'CheckBox2Change'#8'TabOrder'#2#11#0#0#0#10'TPopupMenu'
+ +#10'PopupMenu1'#4'left'#3#222#2#3'top'#3#141#1#0#9'TMenuItem'#9'MenuItem1'#3
+ +'Tag'#4#152#127#18#0#7'Caption'#6#9'New Item1'#0#0#0#10'TImageList'#10'Image'
+ +'List1'#4'left'#3#144#2#3'top'#3#141#1#6'Bitmap'#10#14#4#0#0'Li'#1#0#0#0#16#0
+ +#0#0#16#0#0#0#0#0'#'#0'{SIfg@4'#148#26#0#0#10'q'#161#162'$:'#159#189#158'1'
+ +#159#193#188'.'#159#195#211'+'#158#196#234'+'#159#195#236'-'#159#195#214'0'
+ +#159#195#191'7'#160#192#164'^'#161#173'1'#0#0'#'#0#0#0'#'#0#0#0#0#9'bB:'#188
+ +'R2('#164'z'#164#179'U7'#162#195#243#24#159#207#255#24#159#207#255#24#159#207
+ +#255#24#159#207#255#24#159#207#255#24#159#207#255#24#159#207#255#24#159#207
+ +#255'.'#159#196#247'{'#184#200'i'#0#0'#'#0#0#0#0#6'6"'#27'&M.(t}'#198#223'lk'
+ +#204#235#255'I'#175#207#255';'#166#201#255'4'#162#197#255'.'#158#195#255'-'
+ +#157#194#255'-'#156#191#255'/'#155#190#255'6'#158#192#255'P'#178#210#255'y'
+ +#204#234#130#0#0'#'#0'kRJ|pLE'#137'\9-l'#127#195#218'Ol'#210#245#254'_'#199
+ ,#235#255'S'#187#223#255'G'#176#212#255'<'#164#200#255'0'#153#189#255'('#144
+#180#255')'#145#181#255'4'#156#192#255'O'#182#218#255#130#205#229'o'#0#0'#'#0
+'dNF'#128'hH?'#142'U5-~'#132#197#217'j['#186#217#252'Y'#190#225#255'Y'#185
+#219#255'P'#177#211#255'<'#164#200#255'0'#153#189#255'1'#147#181#255'9'#153
@@ -257,7 +265,7 @@ LazarusResources.Add('TForm1','FORMDATA',[
+#150'G,$]{'#196#221'lj'#210#246#255'`'#189#217#255'O'#176#205#255'J'#170#200
+#255'L'#168#196#255'I'#164#193#255'='#154#184#255'6'#151#182#255'@'#157#187
+#255'N'#182#218#255'z'#204#233#130#0#0'#'#0#0#0#0#5'bD;'#177'P0('#159't'#157
- ,#168'Sl'#205#238#251'_'#199#235#255'S'#187#223#255'G'#176#212#255'<'#164#200
+ +#168'Sl'#205#238#251'_'#199#235#255'S'#187#223#255'G'#176#212#255'<'#164#200
+#255'0'#153#189#255'('#144#180#255')'#144#181#255'4'#156#192#255'U'#182#216
+#253#130#192#205'l'#0#0'#'#0#0#0#0#4'pND'#150'lB7'#154'z'#187#206'q]'#184#210
+#255'P'#178#212#255'I'#179#216#255'D'#176#212#255'A'#168#205#255'9'#160#196
diff --git a/components/gradcontrols/examples/Forms/unit1.pas b/components/gradcontrols/examples/Forms/unit1.pas
index 8bb5f4e98..30821cd46 100644
--- a/components/gradcontrols/examples/Forms/unit1.pas
+++ b/components/gradcontrols/examples/Forms/unit1.pas
@@ -19,8 +19,10 @@ type
TForm1 = class(TForm)
CheckBox1: TCheckBox;
+ CheckBox2: TCheckBox;
CheckGroup1: TCheckGroup;
ComboBox1: TComboBox;
+ ComboBox2: TComboBox;
Edit1: TEdit;
GradButton1: TGradButton;
GradTabPage1: TGradTabPage;
@@ -28,6 +30,7 @@ type
GradTabPage3: TGradTabPage;
ImageList1: TImageList;
Label1: TLabel;
+ Label2: TLabel;
Memo1: TMemo;
NewPageBtn: TGradButton;
DeleteBtn: TGradButton;
@@ -41,9 +44,11 @@ type
RadioGroup2: TRadioGroup;
SpinEdit2: TSpinEdit;
procedure CheckBox1Click(Sender: TObject);
+ procedure CheckBox2Change(Sender: TObject);
procedure CheckGroup1Click(Sender: TObject);
procedure CheckGroup1ItemClick(Sender: TObject; Index: integer);
procedure ComboBox1Change(Sender: TObject);
+ procedure ComboBox2Change(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure DeleteBtnClick(Sender: TObject);
@@ -91,7 +96,8 @@ uses
procedure TForm1.FormCreate(Sender: TObject);
begin
- GradTabControl1.Style :=TGradTabVistaStyle.Create;
+ GradTabControl1.Style :=TGradTabVistaBlueStyle.Create;
+ GradTabControl1.Style.RoundedCorners:=false;
GradTabControl1.Align:=alClient;
GradTabControl1.TabPosition:=tpTop;
SpinEdit2.Value:=GradTabControl1.TabHeight;
@@ -114,6 +120,12 @@ begin
Edit1.Text:=IntToStr(GradTabControl1.LongWidth);
end;
+procedure TForm1.CheckBox2Change(Sender: TObject);
+begin
+ GradTabControl1.Style.RoundedCorners:= CheckBox2.Checked;
+ Invalidate;
+end;
+
procedure TForm1.CheckGroup1Click(Sender: TObject);
begin
@@ -139,6 +151,17 @@ begin
GradTabControl1.PageIndex:=GradTabControl1.Tabs.IndexOf(ComboBox1.Text);
end;
+procedure TForm1.ComboBox2Change(Sender: TObject);
+begin
+ case ComboBox2.ItemIndex of
+ 0: GradTabControl1.Style := TGradTabStandardStyle.Create;
+ 1: GradTabControl1.Style := TGradTabVistaStyle.Create;
+ 2: GradTabControl1.Style := TGradTabVistaBlueStyle.Create;
+ end;
+
+ GradTabControl1.Style.RoundedCorners:= CheckBox2.Checked;
+end;
+
procedure TForm1.FormDestroy(Sender: TObject);
begin
GradTabControl1.Free;
diff --git a/components/gradcontrols/examples/gradbuttontest.lpi b/components/gradcontrols/examples/gradbuttontest.lpi
index 54b379c22..1ffcb5ccd 100644
--- a/components/gradcontrols/examples/gradbuttontest.lpi
+++ b/components/gradcontrols/examples/gradbuttontest.lpi
@@ -30,11 +30,10 @@
-
+
-
-
+
@@ -48,8 +47,8 @@
-
+
@@ -60,6 +59,7 @@
+
diff --git a/components/gradcontrols/examples/gradbuttontest.lpr b/components/gradcontrols/examples/gradbuttontest.lpr
index 872838bda..ff1e10f03 100644
--- a/components/gradcontrols/examples/gradbuttontest.lpr
+++ b/components/gradcontrols/examples/gradbuttontest.lpr
@@ -8,7 +8,7 @@ uses
{$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms
- { you can add units after this }, main;
+ { you can add units after this }, main, gradcontrols;
begin
Application.Title:='TGradButton-Demo';
diff --git a/components/gradcontrols/examples/gradcontroltest.lpi b/components/gradcontrols/examples/gradcontroltest.lpi
index 8f290864f..0ecaf0525 100644
--- a/components/gradcontrols/examples/gradcontroltest.lpi
+++ b/components/gradcontrols/examples/gradcontroltest.lpi
@@ -16,7 +16,7 @@
-
+
@@ -31,9 +31,9 @@
-
+
-
+
@@ -43,12 +43,8 @@
-
-
-
-
-
+
@@ -58,9 +54,9 @@
+
-
@@ -75,6 +71,7 @@
+
diff --git a/components/gradcontrols/examples/gradcontroltest.lpr b/components/gradcontrols/examples/gradcontroltest.lpr
index 8b53f2315..dc532be1c 100644
--- a/components/gradcontrols/examples/gradcontroltest.lpr
+++ b/components/gradcontrols/examples/gradcontroltest.lpr
@@ -8,7 +8,7 @@ uses
{$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms, multiloglaz
- { you can add units after this }, unit1, gradtabcontrol_with_multilog;
+ { you can add units after this }, unit1, gradcontrols;
{$IFDEF WINDOWS}{$R project1.rc}{$ENDIF}
diff --git a/components/gradcontrols/src/gradtabstyle.pas b/components/gradcontrols/src/gradtabstyle.pas
index f68294469..d691af9fe 100644
--- a/components/gradcontrols/src/gradtabstyle.pas
+++ b/components/gradcontrols/src/gradtabstyle.pas
@@ -2,6 +2,8 @@ unit gradtabstyle;
{$mode objfpc}{$H+}
+{.$DEFINE DEBUGTAB}
+
{-------------------------------------
Style-Class for TGradTabControl
--------------------------------------}
@@ -9,7 +11,12 @@ Style-Class for TGradTabControl
interface
uses
- Classes, SysUtils, Controls, Graphics, Buttons, ExtCtrls, ugradbtn;
+ Classes, SysUtils, Controls, Graphics, Buttons, ExtCtrls, ugradbtn
+ {$IFDEF DEBUGTAB}
+ , sharedloggerlcl
+ {$ELSE}
+ , DummyLogger
+ {$ENDIF};
type
TStylePaintEvent = procedure(Sender: TCustomControl; AIndex: Integer;
@@ -22,6 +29,7 @@ type
TGradTabStyleBase = class
private
+ FRoundedCorners: Boolean;
function GetHasCloseButtonPaint: Boolean;
function GetHasTabButtonPaint: Boolean;
function GetHasLeftRightButtonPaint: Boolean;
@@ -47,6 +55,7 @@ type
property HasLeftRightButtonPaint : Boolean read GetHasLeftRightButtonPaint;
property HasBorderButtonPaint : Boolean read GetHasBorderButtonPaint;
property HasCloseButtonPaint : Boolean read GetHasCloseButtonPaint;
+ property RoundedCorners : Boolean read FRoundedCorners write FRoundedCorners;
end;
{ TGradTabStandardStyle }
@@ -69,7 +78,7 @@ type
end;
TGradTabVistaStyle = class(TGradTabStyleBase)
- private
+ protected
Normal : TButtonVistaStyle;
Hover : TButtonVistaStyle;
ActiveButton : TButtonVistaStyle;
@@ -90,11 +99,39 @@ type
procedure PrepareButton(Button: TGradButton); override;
end;
+ { TGradTabVistaBlueStyle }
+
+ TGradTabVistaBlueStyle = class(TGradTabVistaStyle)
+ public
+ constructor Create; override;
+ end;
+
+ procedure LoggerButtonVistaStyle(Self: TButtonVistaStyle; Name: String);
+
implementation
uses
ugradtabcontrol, LCLProc;
+procedure LoggerButtonVistaStyle(Self: TButtonVistaStyle; Name: String);
+ procedure C(aName: String; aColor: TColor);
+ begin
+ Logger.Send(aName, ColorToString(aColor));
+ end;
+
+begin
+ Logger.EnterMethod('Style: '+ Name);
+
+ C('BorderColor', Self.BorderColor);
+ C('InnerBorderColor', Self.InnerBorderColor);
+ C('TopStartColor', Self.TopStartColor);
+ C('TopStopColor', Self.TopStopColor);
+ C('BottomStartColor', Self.BottomStartColor);
+ C('BottomStopColor', Self.BottomStopColor);
+
+ Logger.ExitMethod('Style');
+end;
+
{ TGradTabStyleBase }
function TGradTabStyleBase.GetHasCloseButtonPaint: Boolean;
@@ -120,6 +157,8 @@ end;
constructor TGradTabStyleBase.Create;
begin
FOptions:= [];
+
+ FRoundedCorners := true;
end;
procedure TGradTabStyleBase.PrepareButton(Button: TGradButton);
@@ -250,7 +289,18 @@ end;
procedure TGradTabVistaStyle.TabCloseButton(Sender: TCustomControl;
AIndex: Integer; Button: TGradButton; TargetCanvas: TCanvas; R: TRect;
BState: TButtonState);
+var
+ FGradTabControl : TGradTabControl;
begin
+ FGradTabControl := nil;
+
+ if Sender <> nil then
+ FGradTabControl := Sender as TGradTabControl;
+
+ if (FGradTabControl <> nil)
+ and (AIndex <> FGradTabControl.PageIndex) then
+ BState := bsUp;
+
TabButton(Sender, AIndex, Button, TargetCanvas, R, BState);
end;
@@ -258,6 +308,7 @@ procedure TGradTabVistaStyle.TabButtonBorder(Sender: TCustomControl; AIndex: Int
Button: TGradButton; TargetCanvas: TCanvas; R: TRect; BState : TButtonState);
var
ColorSet: TButtonVistaStyle;
+ Temp : Integer;
begin
//DebugLn('Border R: ',DbgS(R));
@@ -267,6 +318,25 @@ begin
else ColorSet := Normal;
end;
+ Temp := 0;
+
+ if not RoundedCorners then
+ begin
+ if R.Left > 0 then
+ R.Left := R.Left -1;
+
+ if R.Right < Button.Width then
+ R.Right := R.Right + 1;
+
+ if R.Top > 0 then
+ R.Top := R.Top - 1;
+
+ if R.Bottom < Button.Height then
+ R.Bottom := R.Bottom + 1;
+
+ Temp := 1;
+ end;
+
with Button do
begin
//Top
@@ -307,19 +377,19 @@ begin
//TopLeft
if (bsTopLine in BorderSides) AND (bsLeftLine in BorderSides) then
- TargetCanvas.Pixels[1,1]:=ColorSet.BorderColor;
+ TargetCanvas.Pixels[1-Temp,1-Temp]:=ColorSet.BorderColor;
//TopRight
if (bsTopLine in BorderSides) AND (bsRightLine in BorderSides) then
- TargetCanvas.Pixels[Width-2,1] := ColorSet.BorderColor;
+ TargetCanvas.Pixels[Width-2+Temp,1-Temp] := ColorSet.BorderColor;
//BottomLeft
if (bsBottomLine in BorderSides) AND (bsLeftLine in BorderSides) then
- TargetCanvas.Pixels[1, Height-2]:=ColorSet.BorderColor;
+ TargetCanvas.Pixels[1-Temp, Height-2+Temp]:=ColorSet.BorderColor;
//BottomRight
if (bsBottomLine in BorderSides) AND (bsRightLine in BorderSides) then
- TargetCanvas.Pixels[Width-2,Height-2]:=ColorSet.BorderColor;
+ TargetCanvas.Pixels[Width-2+Temp,Height-2+Temp]:=ColorSet.BorderColor;
end;
end;
@@ -327,7 +397,10 @@ procedure TGradTabVistaStyle.TabLeftRightButton(Sender: TGradButton;
TargetCanvas: TCanvas; R: TRect; BState: TButtonState);
begin
if BState = bsDown then
- BState := bsHot;
+ BState := bsHot;
+
+ if Sender.Font.Color = clWhite then
+ Sender.Font.Color := clBlack;
TabButton(Sender.Owner as TCustomControl, 0, Sender, TargetCanvas, R, BState);
end;
@@ -346,5 +419,44 @@ begin
Button.Font.Color:=clBlack;
end;
+{ TGradTabVistaBlueStyle }
+
+constructor TGradTabVistaBlueStyle.Create;
+begin
+ inherited Create;
+
+ with Normal do
+ begin
+ BorderColor:=RGBToColor(145, 150, 162); //#9196A2
+ InnerBorderColor:= RGBToColor(224, 255, 255);
+ TopStartColor := RGBToColor(252, 253, 254);
+ TopStopColor := RGBToColor(231, 235, 255);
+ BottomStartColor := RGBToColor(207, 215, 235);
+ BottomStopColor := RGBToColor(221, 227, 243);
+ end;
+
+ with Hover do
+ begin
+ BorderColor:=RGBToColor(145, 150, 162); //#9196A2
+ InnerBorderColor:= RGBToColor(224, 255, 255);
+ TopStartColor := RGBToColor(232, 240, 251);
+ TopStopColor := RGBToColor(184, 212, 244);
+ BottomStartColor := RGBToColor(115, 176, 232);
+ BottomStopColor := RGBToColor(173, 208, 241);
+ end;
+
+ with ActiveButton do
+ begin
+ BorderColor:=RGBToColor(145, 150, 162); //#9196A2
+ InnerBorderColor:= TColor($FFFFFF);
+ TopStartColor := RGBToColor(255, 245, 224); //#FFF5E0
+ TopStopColor := RGBToColor(255, 222, 147); //#FFDE93
+ BottomStartColor := RGBToColor(255, 184, 17); //#FFB811
+ BottomStopColor := RGBToColor(255, 213, 114);
+ end;
+
+ LoggerButtonVistaStyle(ActiveButton, 'ActiveButton');
+end;
+
end.
diff --git a/components/gradcontrols/src/ugradbtn.pas b/components/gradcontrols/src/ugradbtn.pas
index 051e1dc05..4bff2e922 100644
--- a/components/gradcontrols/src/ugradbtn.pas
+++ b/components/gradcontrols/src/ugradbtn.pas
@@ -1136,16 +1136,10 @@ end;
procedure TGradButton.MouseDown(Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
- inherited;
-
if PtInRect(Rect(0,0,Width,Height),Point(X,Y)) then
begin
-
-
- //WriteLn('X: ',X,' Y: ',Y);
FState:=bsDown;
- //FFocused:=true;
- //LCLIntf.SetFocus(Handle);
+
InvPaint;
end else begin
FState:=bsUp;
@@ -1156,33 +1150,27 @@ begin
InvPaint;
end;
+
+ inherited;
end;
procedure TGradButton.MouseUp(Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
- if PtInRect(Rect(0,0,Width,Height),Point(X,Y)) then
- begin
-
- //WriteLn('MouseUp');
-
+ if PtInRect(Rect(0,0,Width,Height),Point(X,Y)) then
+ begin
FState:=bsHot;
- //FFocused:=true;
InvPaint(true);
if Button = mbLeft then
- inherited Click; //Faster, than the Overrided Click procedure
+ inherited Click; //Faster, than the Overrided Click procedure
+ end else begin
+ FState := bsUp;
+ FFocused:=false;
+ InvPaint(true);
+ end;
- { if (Button = mbRight) AND Assigned(PopupMenu) then
- PopupMenu.PopUp(X,Y);
- }
- end else begin
- FState := bsUp;
- FFocused:=false;
- InvPaint(true);
- end;
-
- inherited;
+ inherited;
end;
//Thx to: http://www.delphipraxis.net/topic67805_farbverlauf+berechnen.html
diff --git a/components/gradcontrols/src/ugradtabcontrol.pas b/components/gradcontrols/src/ugradtabcontrol.pas
index 696492861..9861c3c82 100644
--- a/components/gradcontrols/src/ugradtabcontrol.pas
+++ b/components/gradcontrols/src/ugradtabcontrol.pas
@@ -3,22 +3,26 @@ unit ugradtabcontrol;
{-------------------------------------------------------------------------------
@name GradTabControl
@author Eugen Bolz
- @lastchange 26.06.2009 (DD.MM.YYYY)
- @version 0.1
+ @lastchange 13.12.2009 (DD.MM.YYYY)
+ @version 0.2
@comments TGradTabControl is based on TNotebook/TPageControl/TTabControl
@license http://creativecommons.org/licenses/LGPL/2.1/
------------------------------------------------------------------------------}
{$mode objfpc}{$H+}
+{.$DEFINE DEBUGTAB}
+
interface
uses
- Classes,LResources, SysUtils, Menus, LCLType,
- LCLProc, LCLIntf,ExtCtrls, Graphics, ugradbtn, Controls, uRotateBitmap,
- Buttons, Forms, ImgList, gradtabstyle
+ Classes, LResources, SysUtils, Menus, LCLType,
+ LCLProc, LCLIntf, ExtCtrls, Graphics, ugradbtn, Controls,
+ uRotateBitmap, Buttons, Forms, ImgList, gradtabstyle
{$IFDEF DEBUGTAB}
, sharedloggerlcl
+ {$ELSE}
+ , DummyLogger
{$ENDIF};
type
@@ -194,6 +198,7 @@ type
TGradTabPagesBar = class(TCustomControl)
private
FActiveTabColor: TColor;
+ FNeedOrderButtons: Boolean;
FNormalTabColor: TColor;
FPageList : TListWithEvent;
FTabControl : TGradTabControl;
@@ -225,6 +230,7 @@ type
procedure MoveTo(Num: Integer);
procedure MoveToNorm;
property TabPosition : TTabPosition read FTabPosition write SetTabPosition;
+ property NeedOrderButtons : Boolean read FNeedOrderButtons;
published
property OnStartDock;
property OnStartDrag;
@@ -285,6 +291,7 @@ type
FAutoShowScrollButton: Boolean;
FCustomDraw: Boolean;
FImages: TImageList;
+ FIsUpdating: Boolean;
FMoveIncrement: Integer;
FLeftButton, FRightButton : TGradButton;
FOnCustomDraw: TGradTabControlPaintEvent;
@@ -397,6 +404,8 @@ type
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
+ procedure BeginUpdate;
+ procedure EndUpdate;
function GetTabRect(AIndex : Integer) : TRect;
function AddPage(AName: String) : Integer;
function AddPage(APage: TGradTabPage) : Integer;
@@ -407,6 +416,7 @@ type
procedure UpdateAllDesignerFlags;
procedure UpdateDesignerFlags(APageIndex: integer);
+ property IsUpdating : Boolean read FIsUpdating;
property Page[Index: Integer] : TGradTabPage read GetPage;
property Bar : TGradTabBar read FBar;
property PagesBar : TGradTabPagesBar read FPagesBar;
@@ -445,7 +455,6 @@ type
property TabPosition : TTabPosition read FTabPosition write SetTabPosition default tpTop;
property LongTabs : Boolean read FLongTabs write SetLongTabs;
property LongWidth: Integer read FLongWidth write SetLongWidth;
- //property MoveIncrement : Integer read FMoveIncrement write FMoveIncrement;
property OnPageChanged: TNotifyEvent read FOnPageChanged write FOnPageChanged;
property AutoShowScrollButtons : Boolean read FAutoShowScrollButton write SetAutoShowScrollButtons default true;
property ShowLeftTopScrollButton : Boolean read FShowLeftTopScrollButton write SetShowLeftTopScrollButton;
@@ -467,7 +476,7 @@ type
implementation
uses
- gradtabcontroleditor, ComponentEditors;
+ gradtabcontroleditor, ComponentEditors;
{-------------------------------------------------------------------------------
Register
@@ -495,9 +504,9 @@ var
i : Integer;
begin
Result := false;
- {$IFDEF DEBUGTAB}
+
DebugLn('ValueInArray: Needle=%d Low=%d High=%d',[Needle, Low(Stack), High(Stack)]);
- {$ENDIF}
+
for i := Low(Stack) to High(Stack) do
if Needle =Stack[i] then
begin
@@ -673,19 +682,21 @@ procedure TGradTabPageButton.RealSetText(const Value: TCaption);
var
NewCaption : TCaption;
begin
+ Logger.EnterMethod(Self, 'RealSetText');
+
NewCaption:=Value;
inherited RealSetText(NewCaption);
AlignCloseButton;
- {$IFDEF DEBUGTAB}
- DebugLn('TGradTabPageButton RealSetText ',BoolToStr(Assigned(Parent),true),
- BoolToStr((Parent is TGradTabPagesBar),true) );
- {$ENDIF}
-
+ Logger.Send('Parent Assigned', Assigned(Parent));
+ Logger.Send('Parent is TGradTabPagesBar', Parent is TGradTabPagesBar);
+
if Assigned(Parent) AND (Parent is TGradTabPagesBar) then
(Parent as TGradTabPagesBar).OrderButtons;
+
+ Logger.ExitMethod(Self, 'RealSetText');
end;
procedure TGradTabPageButton.SetAutoHeightBorderSpacing(const AValue: Integer);
@@ -729,13 +740,13 @@ begin
begin
case RotateDirection of
rdNormal: begin
- TheRect.Right:=TheRect.Right-(FCloseButton.Glyph.Width);
+ TheRect.Right :=TheRect.Right-(FCloseButton.Glyph.Width);
end;
rdLeft: begin
- TheRect.Top:= TheRect.Top+(FCloseButton.Glyph.Height);
+ TheRect.Top := TheRect.Top+(FCloseButton.Glyph.Height);
end;
rdRight: begin
- TheRect.Bottom:= TheRect.Bottom-(FCloseButton.Glyph.Height);
+ TheRect.Bottom := TheRect.Bottom-(FCloseButton.Glyph.Height);
end;
end;
end;
@@ -1237,6 +1248,8 @@ var
begin
LastLeft := 0;
+ Logger.EnterMethod(Self, 'InsertButton('+IntToStr(Index)+')');
+
if (Index >= 1) AND (FPageList.Count>=1) then
LastLeft := TGradTabPage(FPageList.Items[Index-1]).TabButton.Left;
@@ -1292,7 +1305,7 @@ begin
OrderButtons;}
- {$IFDEF DEBUGTAB}WriteLn('TGradTabPagesBar.InsertButton');{$ENDIF}
+ Logger.ExitMethod(Self, 'InsertButton('+IntToStr(Index)+')');
end;
procedure TGradTabPagesBar.MoveTo(Num: Integer);
@@ -1357,13 +1370,21 @@ var
B : TGradButton;
begin
if csDestroying in FTabControl.ComponentState then Exit;
+ if FPageList.Count=0 then Exit;
- {$IFDEF DEBUGTAB}DebugLn('OrderButton Start');{$ENDIF}
+ if (FTabControl.IsUpdating) then
+ begin
+ FNeedOrderButtons := true;
+ Exit;
+ end;
+
+ FNeedOrderButtons := false;
+
+ Logger.EnterMethod(Self, 'OrderButtons');
+ Logger.
FMovedTo:=0;
- if FPageList.Count=0 then Exit;
-
for i := FShowFromButton-1 downto 0 do
begin
if i >= FPageList.Count then Continue;
@@ -1427,20 +1448,28 @@ begin
FActiveIndex:=FTabControl.PageIndex;
-
+ Logger.EnterMethod(Self, 'GROUP: foreach FPageList[i]');
for i := 0 to FPageList.Count - 1 do
begin
B := TGradTabPage(FPageList.Items[i]).TabButton;
+ Logger.EnterMethod(Self, 'GROUP: TabButton of Page');
+ Logger.Send('Visible', B.Visible);
+
if B.Visible then
begin
B.RotateDirection := NewDirection;
B.BorderSides := NewBorderSides;
B.GradientType := NewGradientType;
- {$IFDEF DEBUGTAB}
- DebugLn('Begin I: %d W: %d H: %d L: %d T: %d, BW: %d, BH: %d',[i,B.Width,B.Height,B.Left,B.Top,BarWidth,BarHeight]);
- {$ENDIF}
+ Logger.Send('Before');
+ Logger.Send('i', i);
+ Logger.Send('Width', B.Width);
+ Logger.Send('Height', B.Height);
+ Logger.Send('Left', B.Left);
+ Logger.Send('Top', B.Top);
+ Logger.Send('BarWidth', BarWidth);
+ Logger.Send('BarHeight', BarHeight);
case FTabPosition of
tpTop:
@@ -1521,30 +1550,46 @@ begin
B.Width := FTabControl.GetTabBarSize(tpRight)-3;
end;
- {$IFDEF DEBUGTAB}
- DebugLn('B.Width=%d TabBarSize(tpRight)=%d FActive=%d',[B.Width, FTabControl.GetTabBarSize(tpRight), FActiveIndex]);
- {$ENDIF}
+ Logger.Send('Width', B.Width);
+ Logger.Send('TabBarSize(tpRight)', FTabControl.GetTabBarSize(tpRight));
+ Logger.Send('FActive', FActiveIndex);
end;
end;
- {$IFDEF DEBUGTAB}
- DebugLn('End I: %d W: %d H: %d L: %d T: %d, BW: %d, BH: %d',[i,B.Width,B.Height,B.Left,B.Top,BarWidth,BarHeight]);
- {$ENDIF}
+ Logger.Send('After');
+ Logger.Send('i', i);
+ Logger.Send('Width', B.Width);
+ Logger.Send('Height', B.Height);
+ Logger.Send('Left', B.Left);
+ Logger.Send('Top', B.Top);
+ Logger.Send('BarWidth', BarWidth);
+ Logger.Send('BarHeight', BarHeight);
end;
if B.Parent <> Self then
B.Parent := Self;
+
+ Logger.ExitMethod(Self, 'GROUP: TabButton of Page');
end;
- {$IFDEF DEBUGTAB}
- DebugLn('BarWidth=%d LastLeft=%d FMovedTo=%d BarHeight=%d LastTop=%d',[BarWidth,
- LastLeft, FMovedTo, BarHeight, LastTop]);
+ Logger.ExitMethod(Self, 'GROUP: foreach FPageList[i]');
- DebugLn('BarWidth < LastLeft-FMovedTo = %s BarHeight < LastTop-FMovedTo=%s',[
- BoolStr(BarWidth < (LastLeft-FMovedTo)), BoolStr(BarHeight < (LastTop-FMovedTo))]);
- {$ENDIF}
+ Logger.Send('BarWidth', BarWidth);
+ Logger.Send('LastLeft', LastLeft);
+ Logger.Send('FMovedTo', FMovedTo);
+ Logger.Send('BarHeight', BarHeight);
+ Logger.Send('LastTop', LastTop);
- if not FTabControl.AutoShowScrollButtons then Exit;
+ Logger.Send('BarWidth < (LastLeft-FMovedTo)', BarWidth < (LastLeft-FMovedTo));
+ Logger.Send('BarHeight < (LastTop-FMovedTo)', BarHeight < (LastTop-FMovedTo));
+
+ Logger.Send('TabControl.AutoShowScrollButtons', FTabControl.AutoShowScrollButtons);
+
+ if not FTabControl.AutoShowScrollButtons then
+ begin
+ Logger.ExitMethod(Self, 'OrderButtons');
+ Exit;
+ end;
if ((BarWidth < (LastLeft-FMovedTo))
OR (BarHeight < (LastTop-FMovedTo))
@@ -1558,11 +1603,10 @@ begin
FTabControl.FRightButton.Visible:=false;
end;
- {$IFDEF DEBUGTAB}
- DebugLn('FR=%s FL=%s',[BoolStr(FTabControl.FRightButton.Visible),BoolStr(FTabControl.FLeftButton.Visible)]);
+ Logger.Send('FR', FTabControl.FRightButton.Visible);
+ Logger.Send('FL', FTabControl.FLeftButton.Visible);
- DebugLn('OrderButton End');
- {$ENDIF}
+ Logger.ExitMethod(Self, 'OrderButtons');
end;
{-------------------------------------------------------------------------------
@@ -1570,40 +1614,40 @@ end;
------------------------------------------------------------------------------}
procedure TGradTabPagesBar.UnFocusButton(Index: Integer);
begin
- if (Index < 0) or (Index >= FPageList.Count) then Exit;
+ if (Index < 0) or (Index >= FPageList.Count) then Exit;
- {$IFDEF DEBUGTAB}
- DebugLn('TGradTabPagesBar.UnFocusButton Index: %d Assigned %s', [Index,BoolToStr(Assigned(TGradTabPage(FPageList.Items[Index]).TabButton),true)]);
- {$ENDIF}
+ Logger.EnterMethod(Self, 'UnFocusButton('+IntToStr(Index)+')');
- with TGradTabPage(FPageList.Items[Index]).TabButton do
- begin
- case FTabPosition of
- tpTop : begin
- Top:=3;
- Height:=Self.Height-3;
- end;
- tpBottom: begin
- Top:=0;
- Height:=Self.Height-3;
- end;
- tpRight: begin
- Left := 0;
- Width:= Self.Width-3;
- end;
- tpLeft: begin
- Left := 3;
- Width:=Self.Width-3;
- end;
- end;
+ with TGradTabPage(FPageList.Items[Index]).TabButton do
+ begin
+ case FTabPosition of
+ tpTop : begin
+ Top:=3;
+ Height:=Self.Height-3;
+ end;
+ tpBottom: begin
+ Top:=0;
+ Height:=Self.Height-3;
+ end;
+ tpRight: begin
+ Left := 0;
+ Width:= Self.Width-3;
+ end;
+ tpLeft: begin
+ Left := 3;
+ Width:=Self.Width-3;
+ end;
+ end;
- if TGradTabPage(FPageList.Items[Index]).OwnerTabColor then
- Color := TGradTabPage(FPageList.Items[Index]).NormalTabColor
- else
- Color := NormalTabColor;
+ if TGradTabPage(FPageList.Items[Index]).OwnerTabColor then
+ Color := TGradTabPage(FPageList.Items[Index]).NormalTabColor
+ else
+ Color := NormalTabColor;
- UpdatePositions;
- end;
+ UpdatePositions;
+ end;
+
+ Logger.ExitMethod(Self, 'UnFocusButton('+IntToStr(Index)+')');
end;
{-------------------------------------------------------------------------------
@@ -1618,10 +1662,8 @@ begin
if csDestroying in FTabControl.ComponentState then Exit;
if (Index < 0) or (Index >= FPageList.Count) then Exit;
- {$IFDEF DEBUGTAB}
- DebugLn('TGradTabPagesBar.FocusButton Index: %d Assigned %s', [Index,BoolToStr(Assigned(TGradTabPage(FPageList.Items[Index]).TabButton),true)]);
- {$ENDIF}
-
+ Logger.EnterMethod(Self, 'FocusButton('+IntToStr(Index)+')');
+
with TGradTabPage(FPageList.Items[Index]).TabButton do
begin
case FTabPosition of
@@ -1647,27 +1689,16 @@ begin
else
Color := ActiveTabColor;
+ UpdateButton;
+ Invalidate;
end;
- {$IFDEF DEBUGTAB}
- DebugLn('FR=%s FL=%s',[BoolStr(FTabControl.FRightButton.Visible),BoolStr(FTabControl.FLeftButton.Visible)]);
- {$ENDIF}
-
if not (FTabControl.FRightButton.Visible AND FTabControl.FLeftButton.Visible) then Exit;
C := 0;
- {$IFDEF DEBUGTAB}
- DebugLn('Left=%d Width=%d Width=%d',[TGradTabPage(FPageList.Items[Index]).TabButton.Left,
- TGradTabPage(FPageList.Items[Index]).TabButton.Width, Width]);
-
- DebugLn('FocusButton Before ScrollToTab');
- {$ENDIF}
-
ScrollToTab(Index);
- {$IFDEF DEBUGTAB}
- DebugLn('FocusButton After ScrollToTab');
- {$ENDIF}
+ Logger.ExitMethod(Self, 'FocusButton('+IntToStr(Index)+')');
end;
{-------------------------------------------------------------------------------
@@ -1808,6 +1839,9 @@ begin
if (FPageList.Count=0) OR (PIndex>=FPageList.Count) then Exit;
if IsVisible(PIndex) then Exit;
+
+ Logger.EnterMethod(Self, 'ScrollToTab('+IntToStr(PIndex)+')');
+
CurTabs := GetViewedTabs;
TabsLeft:= GetTabsOfSide(CurTabs[0],true);
TabsRight:= GetTabsOfSide(CurTabs[High(CurTabs)],false);
@@ -1815,19 +1849,19 @@ begin
IsInLeft:= ValueInArray(PIndex,TabsLeft);
IsInRight:= ValueInArray(PIndex,TabsRight);
- {$IFDEF DEBUGTAB}
- DebugLn('ScrollToTab TabInLeft=%s TabInRight=%s',[BoolStr(IsInLeft),BoolStr(IsInRight)]);
- {$ENDIF}
-
if IsInLeft then begin
FShowFromButton := TabsLeft[0];
OrderButtons;
- if IsVisible(PIndex) then Exit;
+ if IsVisible(PIndex) then
+ begin
+ Logger.Send('Tab is Visible');
+ Logger.ExitMethod(Self, 'ScrollToTab('+IntToStr(PIndex)+')');
+ Exit;
+ end;
end;
- {$IFDEF DEBUGTAB} DebugLn('ScrollToTab=%d',[PIndex]); {$ENDIF}
repeat
- {$IFDEF DEBUGTAB} DebugLn('Run=%d',[C]); {$ENDIF}
+ Logger.Watch('RepeatCount', C);
with TGradTabPage(FPageList.Items[PIndex]).TabButton do
case FTabPosition of
@@ -1839,13 +1873,10 @@ begin
Inc(C);
- //{$IFDEF DEBUGTAB} DebugLn('ValInAr=%s',[BoolStr(ValueInArray(PIndex,CurTabs))]); {$ENDIF}
- {$IFDEF DEBUGTAB} DebugLn('IsVisible(%d)=%s',[PIndex, BoolStr(IsVisible(PIndex))]); {$ENDIF}
+ Logger.Watch('IsVisible', IsVisible(PIndex));
+ until(IsVisible(PIndex));
- until({ValueInArray(PIndex,CurTabs)} IsVisible(PIndex) {OR (C=10)});
-
- //if DoNext then MoveToNext else MoveToPrior;
- {$IFDEF DEBUGTAB} DebugLn('ScrollToTab End'); {$ENDIF}
+ Logger.ExitMethod(Self, 'ScrollToTab('+IntToStr(PIndex)+')');
end;
procedure TGradTabPagesBar.UpdateAllButtons;
@@ -1887,6 +1918,7 @@ begin
FCloseButton.OnHotBackgroundPaint := @FTabControl.StyleTabCloseButton;
FCloseButton.OwnerBackgroundDraw := true;
+ FCloseButton.UpdateButton;
end;
end else begin
OwnerBackgroundDraw:=false;
@@ -1961,10 +1993,13 @@ end;
------------------------------------------------------------------------------}
function TGradTabPages.Get(Index: Integer): String;
begin
- {$IFDEF DEBUGTAB}DebugLn('TGradTabPages.Get Index=',Index);{$ENDIF}
+ //Logger.Send('TGradTabPages.Get', Index);
+
if (Index<0) or (Index>=fPageList.Count) then
RaiseGDBException('TGradTabPages.Get Index out of bounds');
+
Result := TGradTabPage(fPageList[Index]).Caption;
+ //Logger.Send('TGradTabPages.Get', Result);
end;
{------------------------------------------------------------------------------
@@ -2230,6 +2265,24 @@ begin
inherited;
end;
+procedure TGradTabControl.BeginUpdate;
+begin
+ Logger.EnterMethod(Self, 'BeginUpdate');
+ FIsUpdating := True;
+end;
+
+procedure TGradTabControl.EndUpdate;
+begin
+ FIsUpdating:= False;
+
+ if FPagesBar.NeedOrderButtons then
+ begin
+ Logger.Send('OrderButtonsNeeded');
+ FPagesBar.OrderButtons;
+ end;
+ Logger.ExitMethod(Self, 'EndUpdate');
+end;
+
function TGradTabControl.GetTabRect(AIndex: Integer): TRect;
begin
if (AIndex >= FPageList.Count) or (AIndex < 0) then Exit;
@@ -2482,9 +2535,11 @@ procedure TGradTabControl.PageButtonMouseClick(Sender: TObject);
var
AButton : TGradTabPageButton;
begin
+ BeginUpdate;
AButton := TGradTabPageButton(Sender);
PageIndex:=FPageList.IndexOf(AButton.Owner);
-
+ EndUpdate;
+
if Assigned(FOnTabButtonClick) then
FOnTabButtonClick(Self, FPageList.IndexOf(AButton.Owner));
end;
@@ -2731,24 +2786,31 @@ end;
TGradTabControl SetCurrentPageNum(Value: Integer)
------------------------------------------------------------------------------}
procedure TGradTabControl.SetCurrentPageNum(Value: Integer);
+var
+ Last : Integer;
begin
- if (Value<0) or (Value>=fPageList.Count) then Exit;
- if FPageIndex=Value then Exit;
- if not Page[Value].Enabled then Exit;
- if not Page[Value].TabVisible then Exit;
+ FPagesBar.OrderButtons;
- if FPageIndex <> -1 then UnShowPage(FPageIndex);
+ if (Value<0) or (Value>=fPageList.Count) then Exit;
+ if FPageIndex=Value then Exit;
+ if not Page[Value].Enabled then Exit;
+ if not Page[Value].TabVisible then Exit;
- ShowPage(Value);
+ Last := FPageIndex;
- FPageIndex := Value;
+ // Set PageIndex here, that Un/FocusButton called by Un/ShowPage can
+ // read the current PageIndex to draw the right Style :)
+ FPageIndex := Value;
- UpdateAllDesignerFlags;
- FPagesBar.OrderButtons;
+ if Last <> -1 then UnShowPage(Last);
- if ([csDesigning, csLoading, csDestroying] * ComponentState = [])
- and Assigned(OnPageChanged) then
- OnPageChanged(Self);
+ ShowPage(Value);
+
+ UpdateAllDesignerFlags;
+
+ if ([csDesigning, csLoading, csDestroying] * ComponentState = [])
+ and Assigned(OnPageChanged) then
+ OnPageChanged(Self);
end;
procedure TGradTabControl.SetPagesBarDragOver(const AValue: TDragOverEvent);
@@ -2761,19 +2823,22 @@ end;
------------------------------------------------------------------------------}
procedure TGradTabControl.ShowPage(Index: Integer);
begin
- // Focus the TabButton
- FPagesBar.FocusButton(Index);
+ Logger.EnterMethod(Self, 'ShowPage('+IntToStr(Index)+')');
- // Enable Page
- with TGradTabPage(FPageList.Items[Index]) do
- begin
- Visible:=true;
- BringToFront;
- end;
+ // Focus the TabButton
+ FPagesBar.FocusButton(Index);
- UpdateDesignerFlags(Index);
+ // Enable Page
+ with TGradTabPage(FPageList.Items[Index]) do
+ begin
+ Visible:=true;
+ BringToFront;
+ end;
- AlignPage(TGradTabPage(FPageList.Items[Index]), GetClientRect);
+ UpdateDesignerFlags(Index);
+
+ AlignPage(TGradTabPage(FPageList.Items[Index]), GetClientRect);
+ Logger.ExitMethod(Self, 'ShowPage('+IntToStr(Index)+')');
end;
{------------------------------------------------------------------------------
@@ -2781,17 +2846,21 @@ end;
------------------------------------------------------------------------------}
procedure TGradTabControl.UnShowPage(Index: Integer);
begin
- // Disable Page
+ // Disable Page
- if (Index<0) or (Index>=fPageList.Count) then Exit;
+ if (Index<0) or (Index>=fPageList.Count) then Exit;
- // Unfocus the TabButton
- FPagesBar.UnFocusButton(Index);
+ Logger.EnterMethod(Self, 'UnShowPage('+IntToStr(Index)+')');
- UpdateDesignerFlags(Index);
+ // Unfocus the TabButton
+ FPagesBar.UnFocusButton(Index);
- with TGradTabPage(FPageList.Items[Index]) do
- Visible:=false;
+ UpdateDesignerFlags(Index);
+
+ with TGradTabPage(FPageList.Items[Index]) do
+ Visible:=false;
+
+ Logger.ExitMethod(Self, 'UnShowPage('+IntToStr(Index)+')');
end;
{------------------------------------------------------------------------------