! Now only 1 Package for Both Components

! Working Styles on TGradTabControl

#1

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1110 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
eugene1
2010-01-03 06:42:20 +00:00
parent c93619e15b
commit f8cbbc00b8
12 changed files with 480 additions and 248 deletions

View File

@ -1,7 +1,7 @@
object Form1: TForm1 object Form1: TForm1
Left = 89 Left = 368
Height = 439 Height = 439
Top = 159 Top = 215
Width = 576 Width = 576
ActiveControl = TrackBar1 ActiveControl = TrackBar1
BorderIcons = [biSystemMenu, biMinimize] BorderIcons = [biSystemMenu, biMinimize]
@ -10,7 +10,7 @@ object Form1: TForm1
ClientHeight = 439 ClientHeight = 439
ClientWidth = 576 ClientWidth = 576
OnCreate = FormCreate OnCreate = FormCreate
LCLVersion = '0.9.27' LCLVersion = '0.9.29'
object Label1: TLabel object Label1: TLabel
Left = 8 Left = 8
Height = 16 Height = 16
@ -291,7 +291,7 @@ object Form1: TForm1
end end
object LabeledEdit1: TLabeledEdit object LabeledEdit1: TLabeledEdit
Left = 328 Left = 328
Height = 25 Height = 23
Top = 216 Top = 216
Width = 80 Width = 80
EditLabel.AnchorSideLeft.Control = LabeledEdit1 EditLabel.AnchorSideLeft.Control = LabeledEdit1

View File

@ -1,15 +1,15 @@
{ Das ist eine automatisch erzeugte Lazarus-Ressourcendatei } { Das ist eine automatisch erzeugte Lazarus-Ressourcendatei }
LazarusResources.Add('TForm1','FORMDATA',[ 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' 'TPF0'#6'TForm1'#5'Form1'#4'Left'#3'p'#1#6'Height'#3#183#1#3'Top'#3#215#0#5'W'
+'th'#3'@'#2#13'ActiveControl'#7#9'TrackBar1'#11'BorderIcons'#11#12'biSystemM' +'idth'#3'@'#2#13'ActiveControl'#7#9'TrackBar1'#11'BorderIcons'#11#12'biSyste'
+'enu'#10'biMinimize'#0#11'BorderStyle'#7#8'bsSingle'#7'Caption'#6#16'TGradBu' +'mMenu'#10'biMinimize'#0#11'BorderStyle'#7#8'bsSingle'#7'Caption'#6#16'TGrad'
+'tton-Demo'#12'ClientHeight'#3#183#1#11'ClientWidth'#3'@'#2#8'OnCreate'#7#10 +'Button-Demo'#12'ClientHeight'#3#183#1#11'ClientWidth'#3'@'#2#8'OnCreate'#7
+'FormCreate'#10'LCLVersion'#6#6'0.9.27'#0#6'TLabel'#6'Label1'#4'Left'#2#8#6 +#10'FormCreate'#10'LCLVersion'#6#6'0.9.29'#0#6'TLabel'#6'Label1'#4'Left'#2#8
+'Height'#2#16#3'Top'#2'K'#5'Width'#2'G'#7'Caption'#6#11'NormalBlend'#11'Pare' +#6'Height'#2#16#3'Top'#2'K'#5'Width'#2'G'#7'Caption'#6#11'NormalBlend'#11'Pa'
+'ntColor'#8#0#0#6'TLabel'#6'Label2'#4'Left'#2#8#6'Height'#2#16#3'Top'#3#131#0 +'rentColor'#8#0#0#6'TLabel'#6'Label2'#4'Left'#2#8#6'Height'#2#16#3'Top'#3#131
+#5'Width'#2'8'#7'Caption'#6#9'OverBlend'#11'ParentColor'#8#0#0#6'TLabel'#6'L' +#0#5'Width'#2'8'#7'Caption'#6#9'OverBlend'#11'ParentColor'#8#0#0#6'TLabel'#6
+'abel3'#4'Left'#2'X'#6'Height'#2#16#3'Top'#2'K'#5'Width'#2#1#11'ParentColor' +'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' +#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 +'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 +#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' +'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' +'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 +'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' +'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 +'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 +#197#0#15'EditLabel.Width'#2'R'#17'EditLabel.Caption'#6#14'Button Caption'#21

View File

@ -1,14 +1,14 @@
object Form1: TForm1 object Form1: TForm1
Left = 275 Left = 229
Height = 493 Height = 493
Top = 161 Top = 150
Width = 884 Width = 884
Caption = 'TGradTabControl-Testsuite' Caption = 'TGradTabControl-Testsuite'
ClientHeight = 493 ClientHeight = 493
ClientWidth = 884 ClientWidth = 884
OnCreate = FormCreate OnCreate = FormCreate
OnDestroy = FormDestroy OnDestroy = FormDestroy
LCLVersion = '0.9.27' LCLVersion = '0.9.29'
object Panel1: TPanel object Panel1: TPanel
Left = 0 Left = 0
Height = 493 Height = 493
@ -94,7 +94,7 @@ object Form1: TForm1
end end
object GradTabPage2: TGradTabPage object GradTabPage2: TGradTabPage
Left = 2 Left = 2
Height = 488 Height = 489
Top = 22 Top = 22
Width = 642 Width = 642
PageIndex = 2 PageIndex = 2
@ -247,8 +247,8 @@ object Form1: TForm1
ChildSizing.ShrinkVertical = crsScaleChilds ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1 ChildSizing.ControlsPerLine = 1
ClientHeight = 95 ClientHeight = 113
ClientWidth = 96 ClientWidth = 100
ItemIndex = 0 ItemIndex = 0
Items.Strings = ( Items.Strings = (
'tpTop' 'tpTop'
@ -321,7 +321,7 @@ object Form1: TForm1
end end
object SpinEdit2: TSpinEdit object SpinEdit2: TSpinEdit
Left = 16 Left = 16
Height = 25 Height = 23
Top = 176 Top = 176
Width = 100 Width = 100
OnEditingDone = SpinEdit2EditingDone OnEditingDone = SpinEdit2EditingDone
@ -329,7 +329,7 @@ object Form1: TForm1
end end
object Edit1: TEdit object Edit1: TEdit
Left = 16 Left = 16
Height = 25 Height = 23
Top = 136 Top = 136
Width = 72 Width = 72
TabOrder = 6 TabOrder = 6
@ -337,7 +337,7 @@ object Form1: TForm1
end end
object GradButton1: TGradButton object GradButton1: TGradButton
Left = 90 Left = 90
Height = 19 Height = 22
Top = 136 Top = 136
Width = 26 Width = 26
Caption = 'set' Caption = 'set'
@ -402,8 +402,8 @@ object Form1: TForm1
ChildSizing.ShrinkVertical = crsScaleChilds ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1 ChildSizing.ControlsPerLine = 1
ClientHeight = 87 ClientHeight = 105
ClientWidth = 96 ClientWidth = 100
ItemIndex = 0 ItemIndex = 0
Items.Strings = ( Items.Strings = (
'blGlyphLeft' 'blGlyphLeft'
@ -414,6 +414,41 @@ object Form1: TForm1
OnClick = RadioGroup2Click OnClick = RadioGroup2Click
TabOrder = 9 TabOrder = 9
end 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 end
object PopupMenu1: TPopupMenu object PopupMenu1: TPopupMenu
left = 734 left = 734

View File

@ -1,10 +1,10 @@
{ Das ist eine automatisch erzeugte Lazarus-Ressourcendatei } { Das ist eine automatisch erzeugte Lazarus-Ressourcendatei }
LazarusResources.Add('TForm1','FORMDATA',[ 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' 'TPF0'#6'TForm1'#5'Form1'#4'Left'#3#229#0#6'Height'#3#237#1#3'Top'#3#150#0#5
+'idth'#3't'#3#7'Caption'#6#25'TGradTabControl-Testsuite'#12'ClientHeight'#3 +'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 +#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' +'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' +'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 +#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?' +#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 +#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 +#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 +#199#255'P'#175#207#253'|'#195#215#135#0#0'#'#0'kRJ|pLE'#137'\9-l'#127#195
+'Ol'#210#245#254'_'#199#235#255'S'#187#223#255'G'#176#212#255'<'#164#200#255 +#218'Ol'#210#245#254'_'#199#235#255'S'#187#223#255'G'#176#212#255'<'#164#200
+'0'#153#189#255'('#144#180#255')'#145#181#255'4'#156#192#255'O'#182#218#255 +#255'0'#153#189#255'('#144#180#255')'#145#181#255'4'#156#192#255'O'#182#218
+#130#205#229'o'#0#0'#'#0#0#0#0#6'6"'#27'&M.(t}'#198#223'lk'#204#235#255'I' +#255#130#205#229'o'#0#0'#'#0#0#0#0#6'6"'#27'&M.(t}'#198#223'lk'#204#235#255
+#175#207#255';'#166#201#255'4'#162#197#255'.'#158#195#255'-'#157#194#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 +'-'#156#191#255'/'#155#190#255'6'#158#192#255'P'#178#210#255'y'#204#234#130#0
+'#'#0#0#0#0#9'bB:'#188'R2('#164'z'#164#179'U7'#162#195#243#24#159#207#255#24 +#0'#'#0#0#0#0#9'bB:'#188'R2('#164'z'#164#179'U7'#162#195#243#24#159#207#255
+#159#207#255#24#159#207#255#24#159#207#255#24#159#207#255#24#159#207#255#24 +#24#159#207#255#24#159#207#255#24#159#207#255#24#159#207#255#24#159#207#255
+#159#207#255#24#159#207#255'.'#159#196#247'{'#184#200'i'#0#0'#'#0#0#0'#'#0'{' +#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 ,'{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 +#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 +#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' +#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' +'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 +#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 +#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 +#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 +#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 +#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'_' +#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'(' +'_'#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 +'('#144#180#255')'#145#181#255'4'#156#192#255'O'#182#218#255#130#205#229'o'#0
+'#'#0#0#0#0#6'6"'#27'&M.(t}'#198#223'lk'#204#235#255'I'#175#207#255';'#166 +#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 +#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:' +#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 +#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 +#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 +#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 +#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'_' +#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'(' +'_'#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 +'('#144#180#255')'#145#181#255'4'#156#192#255'O'#182#218#255#130#205#229'o'#0
+'#'#0#0#0#0#6'6"'#27'&M.(t}'#198#223'lk'#204#235#255'I'#175#207#255';'#166 +#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 +#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:' +#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 +#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' +'esize'#28'ChildSizing.ShrinkHorizontal'#7#14'crsScaleChilds'#26'ChildSizing'
+'.ShrinkVertical'#7#14'crsScaleChilds'#18'ChildSizing.Layout'#7#29'cclLeftTo' +'.ShrinkVertical'#7#14'crsScaleChilds'#18'ChildSizing.Layout'#7#29'cclLeftTo'
+'RightThenTopToBottom'#27'ChildSizing.ControlsPerLine'#2#1#12'ClientHeight'#2 +'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' +'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' +'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 +#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' +'clSilver'#15'BackgroundColor'#7#9'clBtnFace'#15'ShowFocusBorder'#9#9'ShowGl'
+'yph'#8#20'GlyphBackgroundColor'#7#7'clWhite'#10'ClickColor'#7#6'clBlue'#19 +'yph'#8#20'GlyphBackgroundColor'#7#7'clWhite'#10'ClickColor'#7#6'clBlue'#19
+'OwnerBackgroundDraw'#8#22'AutoWidthBorderSpacing'#2#15#23'AutoHeightBorderS' +'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' +'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' +#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 +'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' +'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 +'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' +#24'crsHomogenousChildResize'#28'ChildSizing.ShrinkHorizontal'#7#14'crsScale'
+'Childs'#26'ChildSizing.ShrinkVertical'#7#14'crsScaleChilds'#18'ChildSizing.' +'Childs'#26'ChildSizing.ShrinkVertical'#7#14'crsScaleChilds'#18'ChildSizing.'
+'Layout'#7#29'cclLeftToRightThenTopToBottom'#27'ChildSizing.ControlsPerLine' +'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' +'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' +'yphTop'#0#7'OnClick'#7#16'RadioGroup2Click'#8'TabOrder'#2#9#0#0#6'TLabel'#6
+'Menu'#10'PopupMenu1'#4'left'#3#222#2#3'top'#3#141#1#0#9'TMenuItem'#9'MenuIt' +'Label2'#4'Left'#2#18#6'Height'#2#16#3'Top'#3#208#0#5'Width'#2#26#7'Caption'
+'em1'#3'Tag'#4#152''#18#0#7'Caption'#6#9'New Item1'#0#0#0#10'TImageList'#10 +#6#5'Style'#11'ParentColor'#8#0#0#9'TComboBox'#9'ComboBox2'#4'Left'#2#16#6'H'
+'ImageList1'#4'left'#3#144#2#3'top'#3#141#1#6'Bitmap'#10#14#4#0#0'Li'#1#0#0#0 +'eight'#2#23#3'Top'#3#225#0#5'Width'#2'd'#12'AutoDropDown'#9#10'ItemHeight'#2
+#16#0#0#0#16#0#0#0#0#0'#'#0'{SIfg@4'#148#26#0#0#10'q'#161#162'$:'#159#189#158 +#15#9'ItemIndex'#2#0#13'Items.Strings'#1#6#8'Standard'#6#5'Vista'#6#9'VistaB'
+'1'#159#193#188'.'#159#195#211'+'#158#196#234'+'#159#195#236'-'#159#195#214 +'lue'#0#8'OnChange'#7#15'ComboBox2Change'#5'Style'#7#14'csDropDownList'#8'Ta'
+'0'#159#195#191'7'#160#192#164'^'#161#173'1'#0#0'#'#0#0#0'#'#0#0#0#0#9'bB:' +'bOrder'#2#10#4'Text'#6#8'Standard'#0#0#9'TCheckBox'#9'CheckBox2'#4'Left'#2
+#188'R2('#164'z'#164#179'U7'#162#195#243#24#159#207#255#24#159#207#255#24#159 +#16#6'Height'#2#19#3'Top'#3#0#1#5'Width'#2'p'#7'Caption'#6#15'Rounded Corner'
+#207#255#24#159#207#255#24#159#207#255#24#159#207#255#24#159#207#255#24#159 +'s'#8'OnChange'#7#15'CheckBox2Change'#8'TabOrder'#2#11#0#0#0#10'TPopupMenu'
+#207#255'.'#159#196#247'{'#184#200'i'#0#0'#'#0#0#0#0#6'6"'#27'&M.(t}'#198#223 +#10'PopupMenu1'#4'left'#3#222#2#3'top'#3#141#1#0#9'TMenuItem'#9'MenuItem1'#3
+'lk'#204#235#255'I'#175#207#255';'#166#201#255'4'#162#197#255'.'#158#195#255 +'Tag'#4#152#127#18#0#7'Caption'#6#9'New Item1'#0#0#0#10'TImageList'#10'Image'
+'-'#157#194#255'-'#156#191#255'/'#155#190#255'6'#158#192#255'P'#178#210#255 +'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
+'y'#204#234#130#0#0'#'#0'kRJ|pLE'#137'\9-l'#195#218'Ol'#210#245#254'_'#199 +#0#0#16#0#0#0#0#0'#'#0'{SIfg@4'#148#26#0#0#10'q'#161#162'$:'#159#189#158'1'
+#235#255'S'#187#223#255'G'#176#212#255'<'#164#200#255'0'#153#189#255'('#144 +#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 +#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 +'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 +#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 +#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'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 +#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 +#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 +#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 +#255'P'#178#212#255'I'#179#216#255'D'#176#212#255'A'#168#205#255'9'#160#196

View File

@ -19,8 +19,10 @@ type
TForm1 = class(TForm) TForm1 = class(TForm)
CheckBox1: TCheckBox; CheckBox1: TCheckBox;
CheckBox2: TCheckBox;
CheckGroup1: TCheckGroup; CheckGroup1: TCheckGroup;
ComboBox1: TComboBox; ComboBox1: TComboBox;
ComboBox2: TComboBox;
Edit1: TEdit; Edit1: TEdit;
GradButton1: TGradButton; GradButton1: TGradButton;
GradTabPage1: TGradTabPage; GradTabPage1: TGradTabPage;
@ -28,6 +30,7 @@ type
GradTabPage3: TGradTabPage; GradTabPage3: TGradTabPage;
ImageList1: TImageList; ImageList1: TImageList;
Label1: TLabel; Label1: TLabel;
Label2: TLabel;
Memo1: TMemo; Memo1: TMemo;
NewPageBtn: TGradButton; NewPageBtn: TGradButton;
DeleteBtn: TGradButton; DeleteBtn: TGradButton;
@ -41,9 +44,11 @@ type
RadioGroup2: TRadioGroup; RadioGroup2: TRadioGroup;
SpinEdit2: TSpinEdit; SpinEdit2: TSpinEdit;
procedure CheckBox1Click(Sender: TObject); procedure CheckBox1Click(Sender: TObject);
procedure CheckBox2Change(Sender: TObject);
procedure CheckGroup1Click(Sender: TObject); procedure CheckGroup1Click(Sender: TObject);
procedure CheckGroup1ItemClick(Sender: TObject; Index: integer); procedure CheckGroup1ItemClick(Sender: TObject; Index: integer);
procedure ComboBox1Change(Sender: TObject); procedure ComboBox1Change(Sender: TObject);
procedure ComboBox2Change(Sender: TObject);
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject); procedure FormDestroy(Sender: TObject);
procedure DeleteBtnClick(Sender: TObject); procedure DeleteBtnClick(Sender: TObject);
@ -91,7 +96,8 @@ uses
procedure TForm1.FormCreate(Sender: TObject); procedure TForm1.FormCreate(Sender: TObject);
begin begin
GradTabControl1.Style :=TGradTabVistaStyle.Create; GradTabControl1.Style :=TGradTabVistaBlueStyle.Create;
GradTabControl1.Style.RoundedCorners:=false;
GradTabControl1.Align:=alClient; GradTabControl1.Align:=alClient;
GradTabControl1.TabPosition:=tpTop; GradTabControl1.TabPosition:=tpTop;
SpinEdit2.Value:=GradTabControl1.TabHeight; SpinEdit2.Value:=GradTabControl1.TabHeight;
@ -114,6 +120,12 @@ begin
Edit1.Text:=IntToStr(GradTabControl1.LongWidth); Edit1.Text:=IntToStr(GradTabControl1.LongWidth);
end; end;
procedure TForm1.CheckBox2Change(Sender: TObject);
begin
GradTabControl1.Style.RoundedCorners:= CheckBox2.Checked;
Invalidate;
end;
procedure TForm1.CheckGroup1Click(Sender: TObject); procedure TForm1.CheckGroup1Click(Sender: TObject);
begin begin
@ -139,6 +151,17 @@ begin
GradTabControl1.PageIndex:=GradTabControl1.Tabs.IndexOf(ComboBox1.Text); GradTabControl1.PageIndex:=GradTabControl1.Tabs.IndexOf(ComboBox1.Text);
end; 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); procedure TForm1.FormDestroy(Sender: TObject);
begin begin
GradTabControl1.Free; GradTabControl1.Free;

View File

@ -30,11 +30,10 @@
</RunParams> </RunParams>
<RequiredPackages Count="3"> <RequiredPackages Count="3">
<Item1> <Item1>
<PackageName Value="ImagesForLazarus"/> <PackageName Value="gradcontrols"/>
</Item1> </Item1>
<Item2> <Item2>
<PackageName Value="gradbutton"/> <PackageName Value="ImagesForLazarus"/>
<MinVersion Valid="True"/>
</Item2> </Item2>
<Item3> <Item3>
<PackageName Value="LCL"/> <PackageName Value="LCL"/>
@ -48,8 +47,8 @@
</Unit0> </Unit0>
<Unit1> <Unit1>
<Filename Value="Forms\main.pas"/> <Filename Value="Forms\main.pas"/>
<ComponentName Value="Form1"/>
<IsPartOfProject Value="True"/> <IsPartOfProject Value="True"/>
<ComponentName Value="Form1"/>
<ResourceBaseClass Value="Form"/> <ResourceBaseClass Value="Form"/>
<UnitName Value="main"/> <UnitName Value="main"/>
</Unit1> </Unit1>
@ -60,6 +59,7 @@
<PathDelim Value="\"/> <PathDelim Value="\"/>
<SearchPaths> <SearchPaths>
<OtherUnitFiles Value="Forms\"/> <OtherUnitFiles Value="Forms\"/>
<UnitOutputDirectory Value="Output\"/>
</SearchPaths> </SearchPaths>
<Parsing> <Parsing>
<SyntaxOptions> <SyntaxOptions>

View File

@ -8,7 +8,7 @@ uses
{$ENDIF}{$ENDIF} {$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset Interfaces, // this includes the LCL widgetset
Forms Forms
{ you can add units after this }, main; { you can add units after this }, main, gradcontrols;
begin begin
Application.Title:='TGradButton-Demo'; Application.Title:='TGradButton-Demo';

View File

@ -16,7 +16,7 @@
<VersionInfo> <VersionInfo>
<UseVersionInfo Value="True"/> <UseVersionInfo Value="True"/>
<AutoIncrementBuild Value="True"/> <AutoIncrementBuild Value="True"/>
<CurrentBuildNr Value="1166"/> <CurrentBuildNr Value="1190"/>
<ProjectVersion Value="0.0.0.0"/> <ProjectVersion Value="0.0.0.0"/>
</VersionInfo> </VersionInfo>
<PublishOptions> <PublishOptions>
@ -31,9 +31,9 @@
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
</local> </local>
</RunParams> </RunParams>
<RequiredPackages Count="5"> <RequiredPackages Count="4">
<Item1> <Item1>
<PackageName Value="gradtabcontrol_with_multilog"/> <PackageName Value="gradcontrols"/>
</Item1> </Item1>
<Item2> <Item2>
<PackageName Value="multiloglaz"/> <PackageName Value="multiloglaz"/>
@ -43,12 +43,8 @@
<MinVersion Major="1" Valid="True"/> <MinVersion Major="1" Valid="True"/>
</Item3> </Item3>
<Item4> <Item4>
<PackageName Value="gradbutton"/>
<MinVersion Major="1" Minor="2" Valid="True"/>
</Item4>
<Item5>
<PackageName Value="LCL"/> <PackageName Value="LCL"/>
</Item5> </Item4>
</RequiredPackages> </RequiredPackages>
<Units Count="3"> <Units Count="3">
<Unit0> <Unit0>
@ -58,9 +54,9 @@
</Unit0> </Unit0>
<Unit1> <Unit1>
<Filename Value="Forms\unit1.pas"/> <Filename Value="Forms\unit1.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="Form1"/> <ComponentName Value="Form1"/>
<HasResources Value="True"/> <HasResources Value="True"/>
<IsPartOfProject Value="True"/>
<ResourceBaseClass Value="Form"/> <ResourceBaseClass Value="Form"/>
<UnitName Value="Unit1"/> <UnitName Value="Unit1"/>
</Unit1> </Unit1>
@ -75,6 +71,7 @@
<PathDelim Value="\"/> <PathDelim Value="\"/>
<SearchPaths> <SearchPaths>
<OtherUnitFiles Value="Forms\"/> <OtherUnitFiles Value="Forms\"/>
<UnitOutputDirectory Value="Output"/>
</SearchPaths> </SearchPaths>
<Parsing> <Parsing>
<SyntaxOptions> <SyntaxOptions>

View File

@ -8,7 +8,7 @@ uses
{$ENDIF}{$ENDIF} {$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset Interfaces, // this includes the LCL widgetset
Forms, multiloglaz 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} {$IFDEF WINDOWS}{$R project1.rc}{$ENDIF}

View File

@ -2,6 +2,8 @@ unit gradtabstyle;
{$mode objfpc}{$H+} {$mode objfpc}{$H+}
{.$DEFINE DEBUGTAB}
{------------------------------------- {-------------------------------------
Style-Class for TGradTabControl Style-Class for TGradTabControl
--------------------------------------} --------------------------------------}
@ -9,7 +11,12 @@ Style-Class for TGradTabControl
interface interface
uses uses
Classes, SysUtils, Controls, Graphics, Buttons, ExtCtrls, ugradbtn; Classes, SysUtils, Controls, Graphics, Buttons, ExtCtrls, ugradbtn
{$IFDEF DEBUGTAB}
, sharedloggerlcl
{$ELSE}
, DummyLogger
{$ENDIF};
type type
TStylePaintEvent = procedure(Sender: TCustomControl; AIndex: Integer; TStylePaintEvent = procedure(Sender: TCustomControl; AIndex: Integer;
@ -22,6 +29,7 @@ type
TGradTabStyleBase = class TGradTabStyleBase = class
private private
FRoundedCorners: Boolean;
function GetHasCloseButtonPaint: Boolean; function GetHasCloseButtonPaint: Boolean;
function GetHasTabButtonPaint: Boolean; function GetHasTabButtonPaint: Boolean;
function GetHasLeftRightButtonPaint: Boolean; function GetHasLeftRightButtonPaint: Boolean;
@ -47,6 +55,7 @@ type
property HasLeftRightButtonPaint : Boolean read GetHasLeftRightButtonPaint; property HasLeftRightButtonPaint : Boolean read GetHasLeftRightButtonPaint;
property HasBorderButtonPaint : Boolean read GetHasBorderButtonPaint; property HasBorderButtonPaint : Boolean read GetHasBorderButtonPaint;
property HasCloseButtonPaint : Boolean read GetHasCloseButtonPaint; property HasCloseButtonPaint : Boolean read GetHasCloseButtonPaint;
property RoundedCorners : Boolean read FRoundedCorners write FRoundedCorners;
end; end;
{ TGradTabStandardStyle } { TGradTabStandardStyle }
@ -69,7 +78,7 @@ type
end; end;
TGradTabVistaStyle = class(TGradTabStyleBase) TGradTabVistaStyle = class(TGradTabStyleBase)
private protected
Normal : TButtonVistaStyle; Normal : TButtonVistaStyle;
Hover : TButtonVistaStyle; Hover : TButtonVistaStyle;
ActiveButton : TButtonVistaStyle; ActiveButton : TButtonVistaStyle;
@ -90,11 +99,39 @@ type
procedure PrepareButton(Button: TGradButton); override; procedure PrepareButton(Button: TGradButton); override;
end; end;
{ TGradTabVistaBlueStyle }
TGradTabVistaBlueStyle = class(TGradTabVistaStyle)
public
constructor Create; override;
end;
procedure LoggerButtonVistaStyle(Self: TButtonVistaStyle; Name: String);
implementation implementation
uses uses
ugradtabcontrol, LCLProc; 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 } { TGradTabStyleBase }
function TGradTabStyleBase.GetHasCloseButtonPaint: Boolean; function TGradTabStyleBase.GetHasCloseButtonPaint: Boolean;
@ -120,6 +157,8 @@ end;
constructor TGradTabStyleBase.Create; constructor TGradTabStyleBase.Create;
begin begin
FOptions:= []; FOptions:= [];
FRoundedCorners := true;
end; end;
procedure TGradTabStyleBase.PrepareButton(Button: TGradButton); procedure TGradTabStyleBase.PrepareButton(Button: TGradButton);
@ -250,7 +289,18 @@ end;
procedure TGradTabVistaStyle.TabCloseButton(Sender: TCustomControl; procedure TGradTabVistaStyle.TabCloseButton(Sender: TCustomControl;
AIndex: Integer; Button: TGradButton; TargetCanvas: TCanvas; R: TRect; AIndex: Integer; Button: TGradButton; TargetCanvas: TCanvas; R: TRect;
BState: TButtonState); BState: TButtonState);
var
FGradTabControl : TGradTabControl;
begin 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); TabButton(Sender, AIndex, Button, TargetCanvas, R, BState);
end; end;
@ -258,6 +308,7 @@ procedure TGradTabVistaStyle.TabButtonBorder(Sender: TCustomControl; AIndex: Int
Button: TGradButton; TargetCanvas: TCanvas; R: TRect; BState : TButtonState); Button: TGradButton; TargetCanvas: TCanvas; R: TRect; BState : TButtonState);
var var
ColorSet: TButtonVistaStyle; ColorSet: TButtonVistaStyle;
Temp : Integer;
begin begin
//DebugLn('Border R: ',DbgS(R)); //DebugLn('Border R: ',DbgS(R));
@ -267,6 +318,25 @@ begin
else ColorSet := Normal; else ColorSet := Normal;
end; 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 with Button do
begin begin
//Top //Top
@ -307,19 +377,19 @@ begin
//TopLeft //TopLeft
if (bsTopLine in BorderSides) AND (bsLeftLine in BorderSides) then if (bsTopLine in BorderSides) AND (bsLeftLine in BorderSides) then
TargetCanvas.Pixels[1,1]:=ColorSet.BorderColor; TargetCanvas.Pixels[1-Temp,1-Temp]:=ColorSet.BorderColor;
//TopRight //TopRight
if (bsTopLine in BorderSides) AND (bsRightLine in BorderSides) then 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 //BottomLeft
if (bsBottomLine in BorderSides) AND (bsLeftLine in BorderSides) then 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 //BottomRight
if (bsBottomLine in BorderSides) AND (bsRightLine in BorderSides) then 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;
end; end;
@ -329,6 +399,9 @@ begin
if BState = bsDown then 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); TabButton(Sender.Owner as TCustomControl, 0, Sender, TargetCanvas, R, BState);
end; end;
@ -346,5 +419,44 @@ begin
Button.Font.Color:=clBlack; Button.Font.Color:=clBlack;
end; 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. end.

View File

@ -1136,16 +1136,10 @@ end;
procedure TGradButton.MouseDown(Button: TMouseButton; procedure TGradButton.MouseDown(Button: TMouseButton;
Shift: TShiftState; X, Y: Integer); Shift: TShiftState; X, Y: Integer);
begin begin
inherited;
if PtInRect(Rect(0,0,Width,Height),Point(X,Y)) then if PtInRect(Rect(0,0,Width,Height),Point(X,Y)) then
begin begin
//WriteLn('X: ',X,' Y: ',Y);
FState:=bsDown; FState:=bsDown;
//FFocused:=true;
//LCLIntf.SetFocus(Handle);
InvPaint; InvPaint;
end else begin end else begin
FState:=bsUp; FState:=bsUp;
@ -1156,6 +1150,8 @@ begin
InvPaint; InvPaint;
end; end;
inherited;
end; end;
procedure TGradButton.MouseUp(Button: TMouseButton; procedure TGradButton.MouseUp(Button: TMouseButton;
@ -1163,19 +1159,11 @@ procedure TGradButton.MouseUp(Button: TMouseButton;
begin begin
if PtInRect(Rect(0,0,Width,Height),Point(X,Y)) then if PtInRect(Rect(0,0,Width,Height),Point(X,Y)) then
begin begin
//WriteLn('MouseUp');
FState:=bsHot; FState:=bsHot;
//FFocused:=true;
InvPaint(true); InvPaint(true);
if Button = mbLeft then if Button = mbLeft then
inherited Click; //Faster, than the Overrided Click procedure inherited Click; //Faster, than the Overrided Click procedure
{ if (Button = mbRight) AND Assigned(PopupMenu) then
PopupMenu.PopUp(X,Y);
}
end else begin end else begin
FState := bsUp; FState := bsUp;
FFocused:=false; FFocused:=false;

View File

@ -3,22 +3,26 @@ unit ugradtabcontrol;
{------------------------------------------------------------------------------- {-------------------------------------------------------------------------------
@name GradTabControl @name GradTabControl
@author Eugen Bolz @author Eugen Bolz
@lastchange 26.06.2009 (DD.MM.YYYY) @lastchange 13.12.2009 (DD.MM.YYYY)
@version 0.1 @version 0.2
@comments TGradTabControl is based on TNotebook/TPageControl/TTabControl @comments TGradTabControl is based on TNotebook/TPageControl/TTabControl
@license http://creativecommons.org/licenses/LGPL/2.1/ @license http://creativecommons.org/licenses/LGPL/2.1/
------------------------------------------------------------------------------} ------------------------------------------------------------------------------}
{$mode objfpc}{$H+} {$mode objfpc}{$H+}
{.$DEFINE DEBUGTAB}
interface interface
uses uses
Classes,LResources, SysUtils, Menus, LCLType, Classes, LResources, SysUtils, Menus, LCLType,
LCLProc, LCLIntf,ExtCtrls, Graphics, ugradbtn, Controls, uRotateBitmap, LCLProc, LCLIntf, ExtCtrls, Graphics, ugradbtn, Controls,
Buttons, Forms, ImgList, gradtabstyle uRotateBitmap, Buttons, Forms, ImgList, gradtabstyle
{$IFDEF DEBUGTAB} {$IFDEF DEBUGTAB}
, sharedloggerlcl , sharedloggerlcl
{$ELSE}
, DummyLogger
{$ENDIF}; {$ENDIF};
type type
@ -194,6 +198,7 @@ type
TGradTabPagesBar = class(TCustomControl) TGradTabPagesBar = class(TCustomControl)
private private
FActiveTabColor: TColor; FActiveTabColor: TColor;
FNeedOrderButtons: Boolean;
FNormalTabColor: TColor; FNormalTabColor: TColor;
FPageList : TListWithEvent; FPageList : TListWithEvent;
FTabControl : TGradTabControl; FTabControl : TGradTabControl;
@ -225,6 +230,7 @@ type
procedure MoveTo(Num: Integer); procedure MoveTo(Num: Integer);
procedure MoveToNorm; procedure MoveToNorm;
property TabPosition : TTabPosition read FTabPosition write SetTabPosition; property TabPosition : TTabPosition read FTabPosition write SetTabPosition;
property NeedOrderButtons : Boolean read FNeedOrderButtons;
published published
property OnStartDock; property OnStartDock;
property OnStartDrag; property OnStartDrag;
@ -285,6 +291,7 @@ type
FAutoShowScrollButton: Boolean; FAutoShowScrollButton: Boolean;
FCustomDraw: Boolean; FCustomDraw: Boolean;
FImages: TImageList; FImages: TImageList;
FIsUpdating: Boolean;
FMoveIncrement: Integer; FMoveIncrement: Integer;
FLeftButton, FRightButton : TGradButton; FLeftButton, FRightButton : TGradButton;
FOnCustomDraw: TGradTabControlPaintEvent; FOnCustomDraw: TGradTabControlPaintEvent;
@ -397,6 +404,8 @@ type
public public
constructor Create(AOwner: TComponent); override; constructor Create(AOwner: TComponent); override;
destructor Destroy; override; destructor Destroy; override;
procedure BeginUpdate;
procedure EndUpdate;
function GetTabRect(AIndex : Integer) : TRect; function GetTabRect(AIndex : Integer) : TRect;
function AddPage(AName: String) : Integer; function AddPage(AName: String) : Integer;
function AddPage(APage: TGradTabPage) : Integer; function AddPage(APage: TGradTabPage) : Integer;
@ -407,6 +416,7 @@ type
procedure UpdateAllDesignerFlags; procedure UpdateAllDesignerFlags;
procedure UpdateDesignerFlags(APageIndex: integer); procedure UpdateDesignerFlags(APageIndex: integer);
property IsUpdating : Boolean read FIsUpdating;
property Page[Index: Integer] : TGradTabPage read GetPage; property Page[Index: Integer] : TGradTabPage read GetPage;
property Bar : TGradTabBar read FBar; property Bar : TGradTabBar read FBar;
property PagesBar : TGradTabPagesBar read FPagesBar; property PagesBar : TGradTabPagesBar read FPagesBar;
@ -445,7 +455,6 @@ type
property TabPosition : TTabPosition read FTabPosition write SetTabPosition default tpTop; property TabPosition : TTabPosition read FTabPosition write SetTabPosition default tpTop;
property LongTabs : Boolean read FLongTabs write SetLongTabs; property LongTabs : Boolean read FLongTabs write SetLongTabs;
property LongWidth: Integer read FLongWidth write SetLongWidth; property LongWidth: Integer read FLongWidth write SetLongWidth;
//property MoveIncrement : Integer read FMoveIncrement write FMoveIncrement;
property OnPageChanged: TNotifyEvent read FOnPageChanged write FOnPageChanged; property OnPageChanged: TNotifyEvent read FOnPageChanged write FOnPageChanged;
property AutoShowScrollButtons : Boolean read FAutoShowScrollButton write SetAutoShowScrollButtons default true; property AutoShowScrollButtons : Boolean read FAutoShowScrollButton write SetAutoShowScrollButtons default true;
property ShowLeftTopScrollButton : Boolean read FShowLeftTopScrollButton write SetShowLeftTopScrollButton; property ShowLeftTopScrollButton : Boolean read FShowLeftTopScrollButton write SetShowLeftTopScrollButton;
@ -495,9 +504,9 @@ var
i : Integer; i : Integer;
begin begin
Result := false; Result := false;
{$IFDEF DEBUGTAB}
DebugLn('ValueInArray: Needle=%d Low=%d High=%d',[Needle, Low(Stack), High(Stack)]); DebugLn('ValueInArray: Needle=%d Low=%d High=%d',[Needle, Low(Stack), High(Stack)]);
{$ENDIF}
for i := Low(Stack) to High(Stack) do for i := Low(Stack) to High(Stack) do
if Needle =Stack[i] then if Needle =Stack[i] then
begin begin
@ -673,19 +682,21 @@ procedure TGradTabPageButton.RealSetText(const Value: TCaption);
var var
NewCaption : TCaption; NewCaption : TCaption;
begin begin
Logger.EnterMethod(Self, 'RealSetText');
NewCaption:=Value; NewCaption:=Value;
inherited RealSetText(NewCaption); inherited RealSetText(NewCaption);
AlignCloseButton; AlignCloseButton;
{$IFDEF DEBUGTAB} Logger.Send('Parent Assigned', Assigned(Parent));
DebugLn('TGradTabPageButton RealSetText ',BoolToStr(Assigned(Parent),true), Logger.Send('Parent is TGradTabPagesBar', Parent is TGradTabPagesBar);
BoolToStr((Parent is TGradTabPagesBar),true) );
{$ENDIF}
if Assigned(Parent) AND (Parent is TGradTabPagesBar) then if Assigned(Parent) AND (Parent is TGradTabPagesBar) then
(Parent as TGradTabPagesBar).OrderButtons; (Parent as TGradTabPagesBar).OrderButtons;
Logger.ExitMethod(Self, 'RealSetText');
end; end;
procedure TGradTabPageButton.SetAutoHeightBorderSpacing(const AValue: Integer); procedure TGradTabPageButton.SetAutoHeightBorderSpacing(const AValue: Integer);
@ -729,13 +740,13 @@ begin
begin begin
case RotateDirection of case RotateDirection of
rdNormal: begin rdNormal: begin
TheRect.Right:=TheRect.Right-(FCloseButton.Glyph.Width); TheRect.Right :=TheRect.Right-(FCloseButton.Glyph.Width);
end; end;
rdLeft: begin rdLeft: begin
TheRect.Top:= TheRect.Top+(FCloseButton.Glyph.Height); TheRect.Top := TheRect.Top+(FCloseButton.Glyph.Height);
end; end;
rdRight: begin rdRight: begin
TheRect.Bottom:= TheRect.Bottom-(FCloseButton.Glyph.Height); TheRect.Bottom := TheRect.Bottom-(FCloseButton.Glyph.Height);
end; end;
end; end;
end; end;
@ -1237,6 +1248,8 @@ var
begin begin
LastLeft := 0; LastLeft := 0;
Logger.EnterMethod(Self, 'InsertButton('+IntToStr(Index)+')');
if (Index >= 1) AND (FPageList.Count>=1) then if (Index >= 1) AND (FPageList.Count>=1) then
LastLeft := TGradTabPage(FPageList.Items[Index-1]).TabButton.Left; LastLeft := TGradTabPage(FPageList.Items[Index-1]).TabButton.Left;
@ -1292,7 +1305,7 @@ begin
OrderButtons;} OrderButtons;}
{$IFDEF DEBUGTAB}WriteLn('TGradTabPagesBar.InsertButton');{$ENDIF} Logger.ExitMethod(Self, 'InsertButton('+IntToStr(Index)+')');
end; end;
procedure TGradTabPagesBar.MoveTo(Num: Integer); procedure TGradTabPagesBar.MoveTo(Num: Integer);
@ -1357,13 +1370,21 @@ var
B : TGradButton; B : TGradButton;
begin begin
if csDestroying in FTabControl.ComponentState then Exit; 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; FMovedTo:=0;
if FPageList.Count=0 then Exit;
for i := FShowFromButton-1 downto 0 do for i := FShowFromButton-1 downto 0 do
begin begin
if i >= FPageList.Count then Continue; if i >= FPageList.Count then Continue;
@ -1427,20 +1448,28 @@ begin
FActiveIndex:=FTabControl.PageIndex; FActiveIndex:=FTabControl.PageIndex;
Logger.EnterMethod(Self, 'GROUP: foreach FPageList[i]');
for i := 0 to FPageList.Count - 1 do for i := 0 to FPageList.Count - 1 do
begin begin
B := TGradTabPage(FPageList.Items[i]).TabButton; B := TGradTabPage(FPageList.Items[i]).TabButton;
Logger.EnterMethod(Self, 'GROUP: TabButton of Page');
Logger.Send('Visible', B.Visible);
if B.Visible then if B.Visible then
begin begin
B.RotateDirection := NewDirection; B.RotateDirection := NewDirection;
B.BorderSides := NewBorderSides; B.BorderSides := NewBorderSides;
B.GradientType := NewGradientType; B.GradientType := NewGradientType;
{$IFDEF DEBUGTAB} Logger.Send('Before');
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]); Logger.Send('i', i);
{$ENDIF} 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 case FTabPosition of
tpTop: tpTop:
@ -1521,30 +1550,46 @@ begin
B.Width := FTabControl.GetTabBarSize(tpRight)-3; B.Width := FTabControl.GetTabBarSize(tpRight)-3;
end; end;
{$IFDEF DEBUGTAB} Logger.Send('Width', B.Width);
DebugLn('B.Width=%d TabBarSize(tpRight)=%d FActive=%d',[B.Width, FTabControl.GetTabBarSize(tpRight), FActiveIndex]); Logger.Send('TabBarSize(tpRight)', FTabControl.GetTabBarSize(tpRight));
{$ENDIF} Logger.Send('FActive', FActiveIndex);
end; end;
end; end;
{$IFDEF DEBUGTAB} Logger.Send('After');
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]); Logger.Send('i', i);
{$ENDIF} 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; end;
if B.Parent <> Self then if B.Parent <> Self then
B.Parent := Self; B.Parent := Self;
Logger.ExitMethod(Self, 'GROUP: TabButton of Page');
end; end;
{$IFDEF DEBUGTAB} Logger.ExitMethod(Self, 'GROUP: foreach FPageList[i]');
DebugLn('BarWidth=%d LastLeft=%d FMovedTo=%d BarHeight=%d LastTop=%d',[BarWidth,
LastLeft, FMovedTo, BarHeight, LastTop]);
DebugLn('BarWidth < LastLeft-FMovedTo = %s BarHeight < LastTop-FMovedTo=%s',[ Logger.Send('BarWidth', BarWidth);
BoolStr(BarWidth < (LastLeft-FMovedTo)), BoolStr(BarHeight < (LastTop-FMovedTo))]); Logger.Send('LastLeft', LastLeft);
{$ENDIF} 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)) if ((BarWidth < (LastLeft-FMovedTo))
OR (BarHeight < (LastTop-FMovedTo)) OR (BarHeight < (LastTop-FMovedTo))
@ -1558,11 +1603,10 @@ begin
FTabControl.FRightButton.Visible:=false; FTabControl.FRightButton.Visible:=false;
end; end;
{$IFDEF DEBUGTAB} Logger.Send('FR', FTabControl.FRightButton.Visible);
DebugLn('FR=%s FL=%s',[BoolStr(FTabControl.FRightButton.Visible),BoolStr(FTabControl.FLeftButton.Visible)]); Logger.Send('FL', FTabControl.FLeftButton.Visible);
DebugLn('OrderButton End'); Logger.ExitMethod(Self, 'OrderButtons');
{$ENDIF}
end; end;
{------------------------------------------------------------------------------- {-------------------------------------------------------------------------------
@ -1572,9 +1616,7 @@ procedure TGradTabPagesBar.UnFocusButton(Index: Integer);
begin begin
if (Index < 0) or (Index >= FPageList.Count) then Exit; if (Index < 0) or (Index >= FPageList.Count) then Exit;
{$IFDEF DEBUGTAB} Logger.EnterMethod(Self, 'UnFocusButton('+IntToStr(Index)+')');
DebugLn('TGradTabPagesBar.UnFocusButton Index: %d Assigned %s', [Index,BoolToStr(Assigned(TGradTabPage(FPageList.Items[Index]).TabButton),true)]);
{$ENDIF}
with TGradTabPage(FPageList.Items[Index]).TabButton do with TGradTabPage(FPageList.Items[Index]).TabButton do
begin begin
@ -1604,6 +1646,8 @@ begin
UpdatePositions; UpdatePositions;
end; end;
Logger.ExitMethod(Self, 'UnFocusButton('+IntToStr(Index)+')');
end; end;
{------------------------------------------------------------------------------- {-------------------------------------------------------------------------------
@ -1618,9 +1662,7 @@ begin
if csDestroying in FTabControl.ComponentState then Exit; if csDestroying in FTabControl.ComponentState then Exit;
if (Index < 0) or (Index >= FPageList.Count) then Exit; if (Index < 0) or (Index >= FPageList.Count) then Exit;
{$IFDEF DEBUGTAB} Logger.EnterMethod(Self, 'FocusButton('+IntToStr(Index)+')');
DebugLn('TGradTabPagesBar.FocusButton Index: %d Assigned %s', [Index,BoolToStr(Assigned(TGradTabPage(FPageList.Items[Index]).TabButton),true)]);
{$ENDIF}
with TGradTabPage(FPageList.Items[Index]).TabButton do with TGradTabPage(FPageList.Items[Index]).TabButton do
begin begin
@ -1647,27 +1689,16 @@ begin
else else
Color := ActiveTabColor; Color := ActiveTabColor;
UpdateButton;
Invalidate;
end; 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; if not (FTabControl.FRightButton.Visible AND FTabControl.FLeftButton.Visible) then Exit;
C := 0; 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); ScrollToTab(Index);
{$IFDEF DEBUGTAB} Logger.ExitMethod(Self, 'FocusButton('+IntToStr(Index)+')');
DebugLn('FocusButton After ScrollToTab');
{$ENDIF}
end; end;
{------------------------------------------------------------------------------- {-------------------------------------------------------------------------------
@ -1808,6 +1839,9 @@ begin
if (FPageList.Count=0) OR (PIndex>=FPageList.Count) then Exit; if (FPageList.Count=0) OR (PIndex>=FPageList.Count) then Exit;
if IsVisible(PIndex) then Exit; if IsVisible(PIndex) then Exit;
Logger.EnterMethod(Self, 'ScrollToTab('+IntToStr(PIndex)+')');
CurTabs := GetViewedTabs; CurTabs := GetViewedTabs;
TabsLeft:= GetTabsOfSide(CurTabs[0],true); TabsLeft:= GetTabsOfSide(CurTabs[0],true);
TabsRight:= GetTabsOfSide(CurTabs[High(CurTabs)],false); TabsRight:= GetTabsOfSide(CurTabs[High(CurTabs)],false);
@ -1815,19 +1849,19 @@ begin
IsInLeft:= ValueInArray(PIndex,TabsLeft); IsInLeft:= ValueInArray(PIndex,TabsLeft);
IsInRight:= ValueInArray(PIndex,TabsRight); IsInRight:= ValueInArray(PIndex,TabsRight);
{$IFDEF DEBUGTAB}
DebugLn('ScrollToTab TabInLeft=%s TabInRight=%s',[BoolStr(IsInLeft),BoolStr(IsInRight)]);
{$ENDIF}
if IsInLeft then begin if IsInLeft then begin
FShowFromButton := TabsLeft[0]; FShowFromButton := TabsLeft[0];
OrderButtons; 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; end;
{$IFDEF DEBUGTAB} DebugLn('ScrollToTab=%d',[PIndex]); {$ENDIF}
repeat repeat
{$IFDEF DEBUGTAB} DebugLn('Run=%d',[C]); {$ENDIF} Logger.Watch('RepeatCount', C);
with TGradTabPage(FPageList.Items[PIndex]).TabButton do with TGradTabPage(FPageList.Items[PIndex]).TabButton do
case FTabPosition of case FTabPosition of
@ -1839,13 +1873,10 @@ begin
Inc(C); Inc(C);
//{$IFDEF DEBUGTAB} DebugLn('ValInAr=%s',[BoolStr(ValueInArray(PIndex,CurTabs))]); {$ENDIF} Logger.Watch('IsVisible', IsVisible(PIndex));
{$IFDEF DEBUGTAB} DebugLn('IsVisible(%d)=%s',[PIndex, BoolStr(IsVisible(PIndex))]); {$ENDIF} until(IsVisible(PIndex));
until({ValueInArray(PIndex,CurTabs)} IsVisible(PIndex) {OR (C=10)}); Logger.ExitMethod(Self, 'ScrollToTab('+IntToStr(PIndex)+')');
//if DoNext then MoveToNext else MoveToPrior;
{$IFDEF DEBUGTAB} DebugLn('ScrollToTab End'); {$ENDIF}
end; end;
procedure TGradTabPagesBar.UpdateAllButtons; procedure TGradTabPagesBar.UpdateAllButtons;
@ -1887,6 +1918,7 @@ begin
FCloseButton.OnHotBackgroundPaint := @FTabControl.StyleTabCloseButton; FCloseButton.OnHotBackgroundPaint := @FTabControl.StyleTabCloseButton;
FCloseButton.OwnerBackgroundDraw := true; FCloseButton.OwnerBackgroundDraw := true;
FCloseButton.UpdateButton;
end; end;
end else begin end else begin
OwnerBackgroundDraw:=false; OwnerBackgroundDraw:=false;
@ -1961,10 +1993,13 @@ end;
------------------------------------------------------------------------------} ------------------------------------------------------------------------------}
function TGradTabPages.Get(Index: Integer): String; function TGradTabPages.Get(Index: Integer): String;
begin begin
{$IFDEF DEBUGTAB}DebugLn('TGradTabPages.Get Index=',Index);{$ENDIF} //Logger.Send('TGradTabPages.Get', Index);
if (Index<0) or (Index>=fPageList.Count) then if (Index<0) or (Index>=fPageList.Count) then
RaiseGDBException('TGradTabPages.Get Index out of bounds'); RaiseGDBException('TGradTabPages.Get Index out of bounds');
Result := TGradTabPage(fPageList[Index]).Caption; Result := TGradTabPage(fPageList[Index]).Caption;
//Logger.Send('TGradTabPages.Get', Result);
end; end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------
@ -2230,6 +2265,24 @@ begin
inherited; inherited;
end; 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; function TGradTabControl.GetTabRect(AIndex: Integer): TRect;
begin begin
if (AIndex >= FPageList.Count) or (AIndex < 0) then Exit; if (AIndex >= FPageList.Count) or (AIndex < 0) then Exit;
@ -2482,8 +2535,10 @@ procedure TGradTabControl.PageButtonMouseClick(Sender: TObject);
var var
AButton : TGradTabPageButton; AButton : TGradTabPageButton;
begin begin
BeginUpdate;
AButton := TGradTabPageButton(Sender); AButton := TGradTabPageButton(Sender);
PageIndex:=FPageList.IndexOf(AButton.Owner); PageIndex:=FPageList.IndexOf(AButton.Owner);
EndUpdate;
if Assigned(FOnTabButtonClick) then if Assigned(FOnTabButtonClick) then
FOnTabButtonClick(Self, FPageList.IndexOf(AButton.Owner)); FOnTabButtonClick(Self, FPageList.IndexOf(AButton.Owner));
@ -2731,20 +2786,27 @@ end;
TGradTabControl SetCurrentPageNum(Value: Integer) TGradTabControl SetCurrentPageNum(Value: Integer)
------------------------------------------------------------------------------} ------------------------------------------------------------------------------}
procedure TGradTabControl.SetCurrentPageNum(Value: Integer); procedure TGradTabControl.SetCurrentPageNum(Value: Integer);
var
Last : Integer;
begin begin
FPagesBar.OrderButtons;
if (Value<0) or (Value>=fPageList.Count) then Exit; if (Value<0) or (Value>=fPageList.Count) then Exit;
if FPageIndex=Value then Exit; if FPageIndex=Value then Exit;
if not Page[Value].Enabled then Exit; if not Page[Value].Enabled then Exit;
if not Page[Value].TabVisible then Exit; if not Page[Value].TabVisible then Exit;
if FPageIndex <> -1 then UnShowPage(FPageIndex); Last := FPageIndex;
// Set PageIndex here, that Un/FocusButton called by Un/ShowPage can
// read the current PageIndex to draw the right Style :)
FPageIndex := Value;
if Last <> -1 then UnShowPage(Last);
ShowPage(Value); ShowPage(Value);
FPageIndex := Value;
UpdateAllDesignerFlags; UpdateAllDesignerFlags;
FPagesBar.OrderButtons;
if ([csDesigning, csLoading, csDestroying] * ComponentState = []) if ([csDesigning, csLoading, csDestroying] * ComponentState = [])
and Assigned(OnPageChanged) then and Assigned(OnPageChanged) then
@ -2761,6 +2823,8 @@ end;
------------------------------------------------------------------------------} ------------------------------------------------------------------------------}
procedure TGradTabControl.ShowPage(Index: Integer); procedure TGradTabControl.ShowPage(Index: Integer);
begin begin
Logger.EnterMethod(Self, 'ShowPage('+IntToStr(Index)+')');
// Focus the TabButton // Focus the TabButton
FPagesBar.FocusButton(Index); FPagesBar.FocusButton(Index);
@ -2774,6 +2838,7 @@ begin
UpdateDesignerFlags(Index); UpdateDesignerFlags(Index);
AlignPage(TGradTabPage(FPageList.Items[Index]), GetClientRect); AlignPage(TGradTabPage(FPageList.Items[Index]), GetClientRect);
Logger.ExitMethod(Self, 'ShowPage('+IntToStr(Index)+')');
end; end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------
@ -2785,6 +2850,8 @@ begin
if (Index<0) or (Index>=fPageList.Count) then Exit; if (Index<0) or (Index>=fPageList.Count) then Exit;
Logger.EnterMethod(Self, 'UnShowPage('+IntToStr(Index)+')');
// Unfocus the TabButton // Unfocus the TabButton
FPagesBar.UnFocusButton(Index); FPagesBar.UnFocusButton(Index);
@ -2792,6 +2859,8 @@ begin
with TGradTabPage(FPageList.Items[Index]) do with TGradTabPage(FPageList.Items[Index]) do
Visible:=false; Visible:=false;
Logger.ExitMethod(Self, 'UnShowPage('+IntToStr(Index)+')');
end; end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------