diff --git a/components/gradcontrols/examples/Forms/main.lfm b/components/gradcontrols/examples/Forms/main.lfm index 295bf4b2a..969f863c4 100644 --- a/components/gradcontrols/examples/Forms/main.lfm +++ b/components/gradcontrols/examples/Forms/main.lfm @@ -1,7 +1,7 @@ object Form1: TForm1 - Left = 317 + Left = 292 Height = 440 - Top = 126 + Top = 151 Width = 575 ActiveControl = TrackBar1 BorderIcons = [biSystemMenu, biMinimize] @@ -312,8 +312,6 @@ object Form1: TForm1 Width = 168 Caption = 'Sample Text' Font.Height = -15 - Font.Style = [fsItalic] - OnClick = bClick TabOrder = 9 TabStop = True NormalBlend = 0.5 @@ -327,7 +325,7 @@ object Form1: TForm1 ShowFocusBorder = True Glyph.Data = { 3A000000424D3A00000000000000360000002800000001000000010000000100 - 1800000000000400000064000000640000000000000000000000E46CDC00 + 180000000000040000006400000064000000000000000000000054B60600 } GlyphBackgroundColor = clWhite ClickColor = clBlue @@ -352,7 +350,7 @@ object Form1: TForm1 ShowFocusBorder = True Glyph.Data = { 3A000000424D3A00000000000000360000002800000001000000010000000100 - 1800000000000400000064000000640000000000000000000000B46CDC00 + 18000000000004000000640000006400000000000000000000008C5A2500 } GlyphBackgroundColor = clWhite ClickColor = clBlue @@ -377,7 +375,7 @@ object Form1: TForm1 ShowFocusBorder = True Glyph.Data = { 3A000000424D3A00000000000000360000002800000001000000010000000100 - 1800000000000400000064000000640000000000000000000000BC330700 + 180000000000040000006400000064000000000000000000000044B32700 } GlyphBackgroundColor = clWhite ClickColor = clBlue @@ -402,7 +400,7 @@ object Form1: TForm1 ShowFocusBorder = True Glyph.Data = { 3A000000424D3A00000000000000360000002800000001000000010000000100 - 1800000000000400000064000000640000000000000000000000FC8BE500 + 18000000000004000000640000006400000000000000000000003C842500 } GlyphBackgroundColor = clWhite ClickColor = clBlue @@ -427,7 +425,7 @@ object Form1: TForm1 ShowFocusBorder = True Glyph.Data = { 3A000000424D3A00000000000000360000002800000001000000010000000100 - 1800000000000400000064000000640000000000000000000000BC03E200 + 18000000000004000000640000006400000000000000000000006C3A2500 } GlyphBackgroundColor = clWhite ClickColor = clBlue @@ -452,7 +450,7 @@ object Form1: TForm1 ShowFocusBorder = True Glyph.Data = { 3A000000424D3A00000000000000360000002800000001000000010000000100 - 1800000000000400000064000000640000000000000000000000646BDC00 + 1800000000000400000064000000640000000000000000000000D4D42700 } GlyphBackgroundColor = clWhite ClickColor = clBlue @@ -477,7 +475,7 @@ object Form1: TForm1 ShowFocusBorder = True Glyph.Data = { 3A000000424D3A00000000000000360000002800000001000000010000000100 - 18000000000004000000640000006400000000000000000000002CFDDE00 + 18000000000004000000640000006400000000000000000000003C602500 } GlyphBackgroundColor = clWhite ClickColor = clBlue @@ -502,7 +500,7 @@ object Form1: TForm1 ShowFocusBorder = True Glyph.Data = { 3A000000424D3A00000000000000360000002800000001000000010000000100 - 18000000000004000000640000006400000000000000000000005454DC00 + 1800000000000400000064000000640000000000000000000000BC5B2500 } GlyphBackgroundColor = clWhite ClickColor = clBlue @@ -545,7 +543,7 @@ object Form1: TForm1 ShowFocusBorder = True Glyph.Data = { 3A000000424D3A00000000000000360000002800000001000000010000000100 - 1800000000000400000064000000640000000000000000000000ACF3E100 + 1800000000000400000064000000640000000000000000000000F4F82700 } GlyphBackgroundColor = clWhite ClickColor = clBlue @@ -561,16 +559,12 @@ object Form1: TForm1 end object ColorDialog1: TColorDialog Color = 11954481 - left = 48 - top = 176 - end - object ImageList1: TImageList left = 8 top = 176 end object OpenPictureDialog1: TOpenPictureDialog Filter = 'Graphic (*.tga;*.jpg;*.ico;*.ppm;*.pgm;*.pbm;*.png;*.xpm;*.bmp)|*.tga;*.jpg;*.ico;*.ppm;*.pgm;*.pbm;*.png;*.xpm;*.bmp|TGA Image File (*.tga)|*.tga|Jpint Picture Expert Group (*.jpg)|*.jpg|Symbol (*.ico)|*.ico|Portable Pixmap (*.ppm)|*.ppm|Portable Graymap' - left = 88 + left = 48 top = 176 end end diff --git a/components/gradcontrols/examples/Forms/main.lrs b/components/gradcontrols/examples/Forms/main.lrs index 008036f45..b50f595f8 100644 --- a/components/gradcontrols/examples/Forms/main.lrs +++ b/components/gradcontrols/examples/Forms/main.lrs @@ -1,15 +1,13 @@ -{ This is an automatically generated lazarus resource file } - LazarusResources.Add('TForm1','FORMDATA',[ - 'TPF0'#6'TForm1'#5'Form1'#4'Left'#3'='#1#6'Height'#3#184#1#3'Top'#2'~'#5'Widt' - +'h'#3'?'#2#13'ActiveControl'#7#9'TrackBar1'#11'BorderIcons'#11#12'biSystemMe' - +'nu'#10'biMinimize'#0#11'BorderStyle'#7#8'bsSingle'#7'Caption'#6#16'TGradBut' - +'ton-Demo'#12'ClientHeight'#3#184#1#11'ClientWidth'#3'?'#2#8'OnCreate'#7#10 - +'FormCreate'#10'LCLVersion'#6#6'0.9.25'#0#6'TLabel'#6'Label1'#4'Left'#2#8#6 - +'Height'#2#14#3'Top'#2'K'#5'Width'#2'<'#7'Caption'#6#11'NormalBlend'#11'Pare' - +'ntColor'#8#0#0#6'TLabel'#6'Label2'#4'Left'#2#8#6'Height'#2#14#3'Top'#3#131#0 - +#5'Width'#2'3'#7'Caption'#6#9'OverBlend'#11'ParentColor'#8#0#0#6'TLabel'#6'L' - +'abel3'#4'Left'#2'X'#6'Height'#2#14#3'Top'#2'K'#5'Width'#2#1#11'ParentColor' + 'TPF0'#6'TForm1'#5'Form1'#4'Left'#3'$'#1#6'Height'#3#184#1#3'Top'#3#151#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#184#1#11'ClientWidth'#3'?'#2#8'OnCreate'#7 + +#10'FormCreate'#10'LCLVersion'#6#6'0.9.25'#0#6'TLabel'#6'Label1'#4'Left'#2#8 + +#6'Height'#2#14#3'Top'#2'K'#5'Width'#2'<'#7'Caption'#6#11'NormalBlend'#11'Pa' + +'rentColor'#8#0#0#6'TLabel'#6'Label2'#4'Left'#2#8#6'Height'#2#14#3'Top'#3#131 + +#0#5'Width'#2'3'#7'Caption'#6#9'OverBlend'#11'ParentColor'#8#0#0#6'TLabel'#6 + +'Label3'#4'Left'#2'X'#6'Height'#2#14#3'Top'#2'K'#5'Width'#2#1#11'ParentColor' +#8#0#0#6'TLabel'#6'Label4'#4'Left'#2'X'#6'Height'#2#14#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#14 +#3'Top'#2#16#5'Width'#2'4'#7'Caption'#6#10'Base Color'#11'ParentColor'#8#0#0 @@ -96,109 +94,107 @@ LazarusResources.Add('TForm1','FORMDATA',[ +'tLabel.Caption'#6#14'Button Caption'#21'EditLabel.ParentColor'#8#11'ParentC' +'olor'#8#8'TabOrder'#2#7#4'Text'#6#11'Sample Text'#7'OnKeyUp'#7#17'LabeledEd' +'it1KeyUp'#0#0#11'TGradButton'#1'b'#4'Left'#3#152#0#6'Height'#2'`'#3'Top'#3 - +#200#0#5'Width'#3#168#0#7'Caption'#6#11'Sample Text'#11'Font.Height'#2#241#10 - +'Font.Style'#11#8'fsItalic'#0#7'OnClick'#7#6'bClick'#8'TabOrder'#2#9#7'TabSt' - +'op'#9#11'NormalBlend'#5#0#0#0#0#0#0#0#128#254'?'#9'OverBlend'#5'5^'#186'I' - +#12#2'+'#167#254'?'#9'BaseColor'#7#6'clBlue'#5'Color'#7#6'clBlue'#16'NormalB' - +'lendColor'#7#7'clWhite'#14'OverBlendColor'#7#8'clSilver'#15'BackgroundColor' - +#7#9'clBtnFace'#11'BorderSides'#11#9'bsTopLine'#12'bsBottomLine'#10'bsLeftLi' - +'ne'#11'bsRightLine'#0#15'ShowFocusBorder'#9#10'Glyph.Data'#10'>'#0#0#0':'#0 - +#0#0'BM:'#0#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#1#0#0#0#1#0#0#0#1#0#24#0#0#0#0#0#4 - +#0#0#0'd'#0#0#0'd'#0#0#0#0#0#0#0#0#0#0#0#228'l'#220#0#20'GlyphBackgroundColo' - +'r'#7#7'clWhite'#10'ClickColor'#7#6'clBlue'#0#0#11'TGradButton'#15'BaseColor' - +'Button'#4'Left'#2#8#6'Height'#2#25#3'Top'#2'#'#5'Width'#2'h'#7'Caption'#6#15 - +'BaseColorButton'#7'OnClick'#7#14'BaseColorClick'#8'TabOrder'#2#10#7'TabStop' - +#9#11'NormalBlend'#5#0#0#0#0#0#0#0#128#254'?'#9'OverBlend'#5'5^'#186'I'#12#2 - +'+'#167#254'?'#9'BaseColor'#7#6'clBlue'#5'Color'#7#6'clBlue'#16'NormalBlendC' - +'olor'#7#7'clWhite'#14'OverBlendColor'#7#8'clSilver'#15'BackgroundColor'#7#9 - +'clBtnFace'#11'BorderSides'#11#9'bsTopLine'#12'bsBottomLine'#10'bsLeftLine' - +#11'bsRightLine'#0#15'ShowFocusBorder'#9#10'Glyph.Data'#10'>'#0#0#0':'#0#0#0 - +'BM:'#0#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#1#0#0#0#1#0#0#0#1#0#24#0#0#0#0#0#4#0#0 - +#0'd'#0#0#0'd'#0#0#0#0#0#0#0#0#0#0#0#180'l'#220#0#20'GlyphBackgroundColor'#7 - +#7'clWhite'#10'ClickColor'#7#6'clBlue'#0#0#11'TGradButton'#22'NormalBlendCol' - +'orButton'#4'Left'#2'x'#6'Height'#2#25#3'Top'#2'#'#5'Width'#2'h'#7'Caption'#6 - +#22'NormalBlendColorButton'#7'OnClick'#7#16'NormalBlendClick'#8'TabOrder'#2 - +#11#7'TabStop'#9#11'NormalBlend'#5#0#0#0#0#0#0#0#128#254'?'#9'OverBlend'#5'5' - +'^'#186'I'#12#2'+'#167#254'?'#9'BaseColor'#7#6'clBlue'#5'Color'#7#6'clBlue' - +#16'NormalBlendColor'#7#7'clWhite'#14'OverBlendColor'#7#8'clSilver'#15'Backg' - +'roundColor'#7#9'clBtnFace'#11'BorderSides'#11#9'bsTopLine'#12'bsBottomLine' - +#10'bsLeftLine'#11'bsRightLine'#0#15'ShowFocusBorder'#9#10'Glyph.Data'#10'>' - +#0#0#0':'#0#0#0'BM:'#0#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#1#0#0#0#1#0#0#0#1#0#24#0 - +#0#0#0#0#4#0#0#0'd'#0#0#0'd'#0#0#0#0#0#0#0#0#0#0#0#188'3'#7#0#20'GlyphBackgr' - +'oundColor'#7#7'clWhite'#10'ClickColor'#7#6'clBlue'#0#0#11'TGradButton'#15'O' - +'verBlendButton'#4'Left'#3#232#0#6'Height'#2#25#3'Top'#2'#'#5'Width'#2'h'#7 - +'Caption'#6#15'OverBlendButton'#7'OnClick'#7#14'OverBlendClick'#8'TabOrder'#2 - +#12#7'TabStop'#9#11'NormalBlend'#5#0#0#0#0#0#0#0#128#254'?'#9'OverBlend'#5'5' - ,'^'#186'I'#12#2'+'#167#254'?'#9'BaseColor'#7#6'clBlue'#5'Color'#7#6'clBlue' - +#16'NormalBlendColor'#7#7'clWhite'#14'OverBlendColor'#7#8'clSilver'#15'Backg' - +'roundColor'#7#9'clBtnFace'#11'BorderSides'#11#9'bsTopLine'#12'bsBottomLine' - +#10'bsLeftLine'#11'bsRightLine'#0#15'ShowFocusBorder'#9#10'Glyph.Data'#10'>' - +#0#0#0':'#0#0#0'BM:'#0#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#1#0#0#0#1#0#0#0#1#0#24#0 - +#0#0#0#0#4#0#0#0'd'#0#0#0'd'#0#0#0#0#0#0#0#0#0#0#0#252#139#229#0#20'GlyphBac' - +'kgroundColor'#7#7'clWhite'#10'ClickColor'#7#6'clBlue'#0#0#11'TGradButton'#11 - +'GradButton4'#4'Left'#3#196#1#6'Height'#2#25#3'Top'#3#149#0#5'Width'#2'h'#7 - +'Caption'#6#10'Load Glyph'#7'OnClick'#7#16'GradButton4Click'#8'TabOrder'#2#13 + +#200#0#5'Width'#3#168#0#7'Caption'#6#11'Sample Text'#11'Font.Height'#2#241#8 + +'TabOrder'#2#9#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 + +#6'clBlue'#16'NormalBlendColor'#7#7'clWhite'#14'OverBlendColor'#7#8'clSilver' + +#15'BackgroundColor'#7#9'clBtnFace'#11'BorderSides'#11#9'bsTopLine'#12'bsBot' + +'tomLine'#10'bsLeftLine'#11'bsRightLine'#0#15'ShowFocusBorder'#9#10'Glyph.Da' + +'ta'#10'>'#0#0#0':'#0#0#0'BM:'#0#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#1#0#0#0#1#0#0 + +#0#1#0#24#0#0#0#0#0#4#0#0#0'd'#0#0#0'd'#0#0#0#0#0#0#0#0#0#0#0'T'#182#6#0#20 + +'GlyphBackgroundColor'#7#7'clWhite'#10'ClickColor'#7#6'clBlue'#0#0#11'TGradB' + +'utton'#15'BaseColorButton'#4'Left'#2#8#6'Height'#2#25#3'Top'#2'#'#5'Width'#2 + +'h'#7'Caption'#6#15'BaseColorButton'#7'OnClick'#7#14'BaseColorClick'#8'TabOr' + +'der'#2#10#7'TabStop'#9#11'NormalBlend'#5#0#0#0#0#0#0#0#128#254'?'#9'OverBle' + +'nd'#5'5^'#186'I'#12#2'+'#167#254'?'#9'BaseColor'#7#6'clBlue'#5'Color'#7#6'c' + +'lBlue'#16'NormalBlendColor'#7#7'clWhite'#14'OverBlendColor'#7#8'clSilver'#15 + +'BackgroundColor'#7#9'clBtnFace'#11'BorderSides'#11#9'bsTopLine'#12'bsBottom' + +'Line'#10'bsLeftLine'#11'bsRightLine'#0#15'ShowFocusBorder'#9#10'Glyph.Data' + +#10'>'#0#0#0':'#0#0#0'BM:'#0#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#1#0#0#0#1#0#0#0#1 + +#0#24#0#0#0#0#0#4#0#0#0'd'#0#0#0'd'#0#0#0#0#0#0#0#0#0#0#0#140'Z%'#0#20'Glyph' + +'BackgroundColor'#7#7'clWhite'#10'ClickColor'#7#6'clBlue'#0#0#11'TGradButton' + +#22'NormalBlendColorButton'#4'Left'#2'x'#6'Height'#2#25#3'Top'#2'#'#5'Width' + +#2'h'#7'Caption'#6#22'NormalBlendColorButton'#7'OnClick'#7#16'NormalBlendCli' + +'ck'#8'TabOrder'#2#11#7'TabStop'#9#11'NormalBlend'#5#0#0#0#0#0#0#0#128#254'?' + +#9'OverBlend'#5'5^'#186'I'#12#2'+'#167#254'?'#9'BaseColor'#7#6'clBlue'#5'Col' + +'or'#7#6'clBlue'#16'NormalBlendColor'#7#7'clWhite'#14'OverBlendColor'#7#8'cl' + +'Silver'#15'BackgroundColor'#7#9'clBtnFace'#11'BorderSides'#11#9'bsTopLine' + +#12'bsBottomLine'#10'bsLeftLine'#11'bsRightLine'#0#15'ShowFocusBorder'#9#10 + +'Glyph.Data'#10'>'#0#0#0':'#0#0#0'BM:'#0#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#1#0#0 + +#0#1#0#0#0#1#0#24#0#0#0#0#0#4#0#0#0'd'#0#0#0'd'#0#0#0#0#0#0#0#0#0#0#0'D'#179 + +''''#0#20'GlyphBackgroundColor'#7#7'clWhite'#10'ClickColor'#7#6'clBlue'#0#0 + +#11'TGradButton'#15'OverBlendButton'#4'Left'#3#232#0#6'Height'#2#25#3'Top'#2 + +'#'#5'Width'#2'h'#7'Caption'#6#15'OverBlendButton'#7'OnClick'#7#14'OverBlend' + +'Click'#8'TabOrder'#2#12#7'TabStop'#9#11'NormalBlend'#5#0#0#0#0#0#0#0#128#254 + +'?'#9'OverBlend'#5'5^'#186'I'#12#2'+'#167#254'?'#9'BaseColor'#7#6'clBlue'#5 + ,'Color'#7#6'clBlue'#16'NormalBlendColor'#7#7'clWhite'#14'OverBlendColor'#7#8 + +'clSilver'#15'BackgroundColor'#7#9'clBtnFace'#11'BorderSides'#11#9'bsTopLine' + +#12'bsBottomLine'#10'bsLeftLine'#11'bsRightLine'#0#15'ShowFocusBorder'#9#10 + +'Glyph.Data'#10'>'#0#0#0':'#0#0#0'BM:'#0#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#1#0#0 + +#0#1#0#0#0#1#0#24#0#0#0#0#0#4#0#0#0'd'#0#0#0'd'#0#0#0#0#0#0#0#0#0#0#0'<'#132 + +'%'#0#20'GlyphBackgroundColor'#7#7'clWhite'#10'ClickColor'#7#6'clBlue'#0#0#11 + +'TGradButton'#11'GradButton4'#4'Left'#3#196#1#6'Height'#2#25#3'Top'#3#149#0#5 + +'Width'#2'h'#7'Caption'#6#10'Load Glyph'#7'OnClick'#7#16'GradButton4Click'#8 + +'TabOrder'#2#13#7'TabStop'#9#11'NormalBlend'#5#0#0#0#0#0#0#0#128#254'?'#9'Ov' + +'erBlend'#5'5^'#186'I'#12#2'+'#167#254'?'#9'BaseColor'#7#6'clBlue'#5'Color'#7 + +#6'clBlue'#16'NormalBlendColor'#7#7'clWhite'#14'OverBlendColor'#7#8'clSilver' + +#15'BackgroundColor'#7#9'clBtnFace'#11'BorderSides'#11#9'bsTopLine'#12'bsBot' + +'tomLine'#10'bsLeftLine'#11'bsRightLine'#0#15'ShowFocusBorder'#9#10'Glyph.Da' + +'ta'#10'>'#0#0#0':'#0#0#0'BM:'#0#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#1#0#0#0#1#0#0 + +#0#1#0#24#0#0#0#0#0#4#0#0#0'd'#0#0#0'd'#0#0#0#0#0#0#0#0#0#0#0'l:%'#0#20'Glyp' + +'hBackgroundColor'#7#7'clWhite'#10'ClickColor'#7#6'clBlue'#0#0#11'TGradButto' + +'n'#26'GlyphBackgroundColorButton'#4'Left'#3#196#1#6'Height'#2#25#3'Top'#3 + +#200#0#5'Width'#2'h'#7'Caption'#6#26'GlyphBackgroundColorButton'#7'OnClick'#7 + +#31'GlyphBackgroundColorButtonClick'#8'TabOrder'#2#14#7'TabStop'#9#11'Normal' + +'Blend'#5#0#0#0#0#0#0#0#128#254'?'#9'OverBlend'#5'5^'#186'I'#12#2'+'#167#254 + +'?'#9'BaseColor'#7#6'clBlue'#5'Color'#7#6'clBlue'#16'NormalBlendColor'#7#7'c' + +'lWhite'#14'OverBlendColor'#7#8'clSilver'#15'BackgroundColor'#7#9'clBtnFace' + +#11'BorderSides'#11#9'bsTopLine'#12'bsBottomLine'#10'bsLeftLine'#11'bsRightL' + +'ine'#0#15'ShowFocusBorder'#9#10'Glyph.Data'#10'>'#0#0#0':'#0#0#0'BM:'#0#0#0 + +#0#0#0#0'6'#0#0#0'('#0#0#0#1#0#0#0#1#0#0#0#1#0#24#0#0#0#0#0#4#0#0#0'd'#0#0#0 + +'d'#0#0#0#0#0#0#0#0#0#0#0#212#212''''#0#20'GlyphBackgroundColor'#7#7'clWhite' + +#10'ClickColor'#7#6'clBlue'#0#0#11'TGradButton'#16'ClickColorButton'#4'Left' + +#3#196#1#6'Height'#2#25#3'Top'#2'#'#5'Width'#2'h'#7'Caption'#6#16'ClickColor' + +'Button'#7'OnClick'#7#21'ClickColorButtonClick'#8'TabOrder'#2#15#7'TabStop'#9 + +#11'NormalBlend'#5#0#0#0#0#0#0#0#128#254'?'#9'OverBlend'#5'5^'#186'I'#12#2'+' + +#167#254'?'#9'BaseColor'#7#6'clBlue'#5'Color'#7#6'clBlue'#16'NormalBlendColo' + +'r'#7#7'clWhite'#14'OverBlendColor'#7#8'clSilver'#15'BackgroundColor'#7#9'cl' + +'BtnFace'#11'BorderSides'#11#9'bsTopLine'#12'bsBottomLine'#10'bsLeftLine'#11 + +'bsRightLine'#0#15'ShowFocusBorder'#9#10'Glyph.Data'#10'>'#0#0#0':'#0#0#0'BM' + +':'#0#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#1#0#0#0#1#0#0#0#1#0#24#0#0#0#0#0#4#0#0#0 + +'d'#0#0#0'd'#0#0#0#0#0#0#0#0#0#0#0'<`%'#0#20'GlyphBackgroundColor'#7#7'clWhi' + +'te'#10'ClickColor'#7#6'clBlue'#0#0#11'TGradButton'#19'DisabledColorButton'#4 + +'Left'#3#196#1#6'Height'#2#25#3'Top'#2']'#5'Width'#2'h'#7'Caption'#6#19'Disa' + +'bledColorButton'#7'OnClick'#7#24'DisabledColorButtonClick'#8'TabOrder'#2#16 +#7'TabStop'#9#11'NormalBlend'#5#0#0#0#0#0#0#0#128#254'?'#9'OverBlend'#5'5^' +#186'I'#12#2'+'#167#254'?'#9'BaseColor'#7#6'clBlue'#5'Color'#7#6'clBlue'#16 +'NormalBlendColor'#7#7'clWhite'#14'OverBlendColor'#7#8'clSilver'#15'Backgrou' +'ndColor'#7#9'clBtnFace'#11'BorderSides'#11#9'bsTopLine'#12'bsBottomLine'#10 +'bsLeftLine'#11'bsRightLine'#0#15'ShowFocusBorder'#9#10'Glyph.Data'#10'>'#0#0 +#0':'#0#0#0'BM:'#0#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#1#0#0#0#1#0#0#0#1#0#24#0#0#0 - +#0#0#4#0#0#0'd'#0#0#0'd'#0#0#0#0#0#0#0#0#0#0#0#188#3#226#0#20'GlyphBackgroun' - +'dColor'#7#7'clWhite'#10'ClickColor'#7#6'clBlue'#0#0#11'TGradButton'#26'Glyp' - +'hBackgroundColorButton'#4'Left'#3#196#1#6'Height'#2#25#3'Top'#3#200#0#5'Wid' - +'th'#2'h'#7'Caption'#6#26'GlyphBackgroundColorButton'#7'OnClick'#7#31'GlyphB' - +'ackgroundColorButtonClick'#8'TabOrder'#2#14#7'TabStop'#9#11'NormalBlend'#5#0 + +#0#0#4#0#0#0'd'#0#0#0'd'#0#0#0#0#0#0#0#0#0#0#0#188'[%'#0#20'GlyphBackgroundC' + +'olor'#7#7'clWhite'#10'ClickColor'#7#6'clBlue'#0#0#9'TCheckBox'#17'Underline' + +'CheckBox'#4'Left'#3'G'#1#6'Height'#2#19#3'Top'#3#242#0#5'Width'#2'G'#7'Capt' + +'ion'#6#9'Underline'#8'OnChange'#7#23'UnderlineCheckBoxChange'#8'TabOrder'#2 + +#17#0#0#9'TCheckBox'#12'BoldCheckBox'#4'Left'#3'G'#1#6'Height'#2#19#3'Top'#3 + +#5#1#5'Width'#2'.'#7'Caption'#6#4'Bold'#8'OnChange'#7#18'BoldCheckBoxChange' + +#8'TabOrder'#2#18#0#0#11'TGradButton'#15'TextColorButton'#4'Left'#3'X'#1#6'H' + +'eight'#2#25#3'Top'#2'#'#5'Width'#2'h'#7'Caption'#6#10'Text Color'#7'OnClick' + +#7#20'TextColorButtonClick'#8'TabOrder'#2#19#7'TabStop'#9#11'NormalBlend'#5#0 +#0#0#0#0#0#0#128#254'?'#9'OverBlend'#5'5^'#186'I'#12#2'+'#167#254'?'#9'BaseC' +'olor'#7#6'clBlue'#5'Color'#7#6'clBlue'#16'NormalBlendColor'#7#7'clWhite'#14 +'OverBlendColor'#7#8'clSilver'#15'BackgroundColor'#7#9'clBtnFace'#11'BorderS' +'ides'#11#9'bsTopLine'#12'bsBottomLine'#10'bsLeftLine'#11'bsRightLine'#0#15 +'ShowFocusBorder'#9#10'Glyph.Data'#10'>'#0#0#0':'#0#0#0'BM:'#0#0#0#0#0#0#0'6' +#0#0#0'('#0#0#0#1#0#0#0#1#0#0#0#1#0#24#0#0#0#0#0#4#0#0#0'd'#0#0#0'd'#0#0#0#0 - +#0#0#0#0#0#0#0'dk'#220#0#20'GlyphBackgroundColor'#7#7'clWhite'#10'ClickColor' - +#7#6'clBlue'#0#0#11'TGradButton'#16'ClickColorButton'#4'Left'#3#196#1#6'Heig' - +'ht'#2#25#3'Top'#2'#'#5'Width'#2'h'#7'Caption'#6#16'ClickColorButton'#7'OnCl' - +'ick'#7#21'ClickColorButtonClick'#8'TabOrder'#2#15#7'TabStop'#9#11'NormalBle' - +'nd'#5#0#0#0#0#0#0#0#128#254'?'#9'OverBlend'#5'5^'#186'I'#12#2'+'#167#254'?' - +#9'BaseColor'#7#6'clBlue'#5'Color'#7#6'clBlue'#16'NormalBlendColor'#7#7'clWh' - +'ite'#14'OverBlendColor'#7#8'clSilver'#15'BackgroundColor'#7#9'clBtnFace'#11 - +'BorderSides'#11#9'bsTopLine'#12'bsBottomLine'#10'bsLeftLine'#11'bsRightLine' - +#0#15'ShowFocusBorder'#9#10'Glyph.Data'#10'>'#0#0#0':'#0#0#0'BM:'#0#0#0#0#0#0 - +#0'6'#0#0#0'('#0#0#0#1#0#0#0#1#0#0#0#1#0#24#0#0#0#0#0#4#0#0#0'd'#0#0#0'd'#0#0 - +#0#0#0#0#0#0#0#0#0','#253#222#0#20'GlyphBackgroundColor'#7#7'clWhite'#10'Cli' - +'ckColor'#7#6'clBlue'#0#0#11'TGradButton'#19'DisabledColorButton'#4'Left'#3 - +#196#1#6'Height'#2#25#3'Top'#2']'#5'Width'#2'h'#7'Caption'#6#19'DisabledColo' - +'rButton'#7'OnClick'#7#24'DisabledColorButtonClick'#8'TabOrder'#2#16#7'TabSt' - +'op'#9#11'NormalBlend'#5#0#0#0#0#0#0#0#128#254'?'#9'OverBlend'#5'5^'#186'I' - +#12#2'+'#167#254'?'#9'BaseColor'#7#6'clBlue'#5'Color'#7#6'clBlue'#16'NormalB' - +'lendColor'#7#7'clWhite'#14'OverBlendColor'#7#8'clSilver'#15'BackgroundColor' - +#7#9'clBtnFace'#11'BorderSides'#11#9'bsTopLine'#12'bsBottomLine'#10'bsLeftLi' - +'ne'#11'bsRightLine'#0#15'ShowFocusBorder'#9#10'Glyph.Data'#10'>'#0#0#0':'#0 - +#0#0'BM:'#0#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#1#0#0#0#1#0#0#0#1#0#24#0#0#0#0#0#4 - +#0#0#0'd'#0#0#0'd'#0#0#0#0#0#0#0#0#0#0#0'TT'#220#0#20'GlyphBackgroundColor'#7 - +#7'clWhite'#10'ClickColor'#7#6'clBlue'#0#0#9'TCheckBox'#17'UnderlineCheckBox' - +#4'Left'#3'G'#1#6'Height'#2#19#3'Top'#3#242#0#5'Width'#2'G'#7'Caption'#6#9'U' - +'nderline'#8'OnChange'#7#23'UnderlineCheckBoxChange'#8'TabOrder'#2#17#0#0#9 - +'TCheckBox'#12'BoldCheckBox'#4'Left'#3'G'#1#6'Height'#2#19#3'Top'#3#5#1#5'Wi' - +'dth'#2'.'#7'Caption'#6#4'Bold'#8'OnChange'#7#18'BoldCheckBoxChange'#8'TabOr' - +'der'#2#18#0#0#11'TGradButton'#15'TextColorButton'#4'Left'#3'X'#1#6'Height'#2 - +#25#3'Top'#2'#'#5'Width'#2'h'#7'Caption'#6#10'Text Color'#7'OnClick'#7#20'Te' - +'xtColorButtonClick'#8'TabOrder'#2#19#7'TabStop'#9#11'NormalBlend'#5#0#0#0#0 - +#0#0#0#128#254'?'#9'OverBlend'#5'5^'#186'I'#12#2'+'#167#254'?'#9'BaseColor'#7 - +#6'clBlue'#5'Color'#7#6'clBlue'#16'NormalBlendColor'#7#7'clWhite'#14'OverBle' - +'ndColor'#7#8'clSilver'#15'BackgroundColor'#7#9'clBtnFace'#11'BorderSides'#11 - +#9'bsTopLine'#12'bsBottomLine'#10'bsLeftLine'#11'bsRightLine'#0#15'ShowFocus' - +'Border'#9#10'Glyph.Data'#10'>'#0#0#0':'#0#0#0'BM:'#0#0#0#0#0#0#0'6'#0#0#0'(' - +#0#0#0#1#0#0#0#1#0#0#0#1#0#24#0#0#0#0#0#4#0#0#0'd'#0#0#0'd'#0#0#0#0#0#0#0#0#0 - +#0#0#172#243#225#0#20'GlyphBackgroundColor'#7#7'clWhite'#10'ClickColor'#7#6 - +'clBlue'#0#0#9'TCheckBox'#14'ItalicCheckBox'#4'Left'#3'G'#1#6'Height'#2#19#3 - +'Top'#3#24#1#5'Width'#2'1'#7'Caption'#6#6'Italic'#8'OnChange'#7#20'ItalicChe' - ,'ckBoxChange'#8'TabOrder'#2#20#0#0#12'TColorDialog'#12'ColorDialog1'#5'Color' - +#4'1i'#182#0#4'left'#2'0'#3'top'#3#176#0#0#0#10'TImageList'#10'ImageList1'#4 - +'left'#2#8#3'top'#3#176#0#0#0#18'TOpenPictureDialog'#18'OpenPictureDialog1'#6 - +'Filter'#6#255'Graphic (*.tga;*.jpg;*.ico;*.ppm;*.pgm;*.pbm;*.png;*.xpm;*.bm' - +'p)|*.tga;*.jpg;*.ico;*.ppm;*.pgm;*.pbm;*.png;*.xpm;*.bmp|TGA Image File (*.' - +'tga)|*.tga|Jpint Picture Expert Group (*.jpg)|*.jpg|Symbol (*.ico)|*.ico|Po' - +'rtable Pixmap (*.ppm)|*.ppm|Portable Graymap'#4'left'#2'X'#3'top'#3#176#0#0 - +#0#0 + +#0#0#0#0#0#0#0#244#248''''#0#20'GlyphBackgroundColor'#7#7'clWhite'#10'ClickC' + +'olor'#7#6'clBlue'#0#0#9'TCheckBox'#14'ItalicCheckBox'#4'Left'#3'G'#1#6'Heig' + +'ht'#2#19#3'Top'#3#24#1#5'Width'#2'1'#7'Caption'#6#6'Italic'#8'OnChange'#7#20 + +'ItalicCheckBoxChange'#8'TabOrder'#2#20#0#0#12'TColorDialog'#12'ColorDialog1' + ,#5'Color'#4'1i'#182#0#4'left'#2#8#3'top'#3#176#0#0#0#18'TOpenPictureDialog' + +#18'OpenPictureDialog1'#6'Filter'#6#255'Graphic (*.tga;*.jpg;*.ico;*.ppm;*.p' + +'gm;*.pbm;*.png;*.xpm;*.bmp)|*.tga;*.jpg;*.ico;*.ppm;*.pgm;*.pbm;*.png;*.xpm' + +';*.bmp|TGA Image File (*.tga)|*.tga|Jpint Picture Expert Group (*.jpg)|*.jp' + +'g|Symbol (*.ico)|*.ico|Portable Pixmap (*.ppm)|*.ppm|Portable Graymap'#4'le' + +'ft'#2'0'#3'top'#3#176#0#0#0#0 ]); diff --git a/components/gradcontrols/examples/Forms/main.pas b/components/gradcontrols/examples/Forms/main.pas index eee112722..0ad086768 100644 --- a/components/gradcontrols/examples/Forms/main.pas +++ b/components/gradcontrols/examples/Forms/main.pas @@ -30,7 +30,6 @@ type GlyphBackgroundColorButton: TGradButton; ClickColorButton: TGradButton; DisabledColorButton: TGradButton; - ImageList1: TImageList; Label1: TLabel; Label10: TLabel; Label11: TLabel; @@ -50,7 +49,6 @@ type RadioGroup4: TRadioGroup; TrackBar1: TTrackBar; TrackBar2: TTrackBar; - procedure bClick(Sender: TObject); procedure BoldCheckBoxChange(Sender: TObject); procedure CheckGroup1ItemClick(Sender: TObject; Index: integer); procedure CheckGroup2ItemClick(Sender: TObject; Index: integer); @@ -81,8 +79,7 @@ var implementation uses - GraphType, LazPNG; - + GraphType; procedure UpdateButtonColor(Button: TGradButton; Color: TColor); begin Button.BaseColor := Color; @@ -115,13 +112,12 @@ begin CheckGroup2.Checked[0]:=b.ShowFocusBorder; CheckGroup2.Checked[2]:=true; - //ImageList1.AddLazarusResource('house'); - - //ImageList1.GetBitmap(0,b.Glyph,gdeHighlighted); - - //ImageList1.GetBitmap(); - b.Caption:=LabeledEdit1.Text; + + //ImageList1.Add(LoadBitmapFromLazarusResource('script_go'),nil); + //b.Glyph := LoadBitmapFromLazarusResource('table_gear'); + + b.ShowGlyph:=true; end; procedure TForm1.RadioGroup1Click(Sender: TObject); @@ -185,35 +181,20 @@ end; procedure TForm1.GradButton4Click(Sender: TObject); var tempPicture : TPicture; - png : TPNGImage; begin if OpenPictureDialog1.Execute then begin - ImageList1.Clear; + tempPicture := TPicture.Create; try - tempPicture := TPicture.Create; tempPicture.LoadFromFile(OpenPictureDialog1.FileName); - //png := TPNGImage.Create; - //png.LoadFromFile(OpenPictureDialog1.FileName); - GradButton4.Glyph.Assign(tempPicture.Graphic); b.Glyph.Assign(tempPicture.Graphic); - GradButton4.UpdateButton; - b.UpdateButton; - //ImageList1.; - //Image1.Picture.LoadFromFile(OpenPictureDialog1.FileName); - //tempPicture.Picture.Bitmap.Canvas.Pixels[1,2]:=clRed; - //ImageList1.AddMasked(tempPicture.Picture.Bitmap,clNone); - //ImageList1.GetBitmap(0,b.Glyph); - //mageList1.GetBitmap(0,); - //GradButton4.Glyph := Image1.Picture.Bitmap; - //Image1.Picture.Bitmap := tempPicture.Picture.Bitmap; - GradButton4.ShowGlyph:=true; - GradButton4.Caption:=''; + GradButton4.Glyph.Assign(tempPicture.Graphic); + GradButton4.ShowGlyph := true; + GradButton4.Caption := ''; finally tempPicture.Free; - //png.Free; end; end; end; @@ -290,11 +271,6 @@ begin end; end; -procedure TForm1.bClick(Sender: TObject); -begin - -end; - procedure TForm1.BoldCheckBoxChange(Sender: TObject); begin if BoldCheckBox.Checked then @@ -345,6 +321,5 @@ end; initialization {$I main.lrs} - end. diff --git a/components/gradcontrols/examples/Forms/unit1.lfm b/components/gradcontrols/examples/Forms/unit1.lfm index 35709e433..cc0ad5f0a 100644 --- a/components/gradcontrols/examples/Forms/unit1.lfm +++ b/components/gradcontrols/examples/Forms/unit1.lfm @@ -1,7 +1,7 @@ object Form1: TForm1 - Left = 81 + Left = 264 Height = 506 - Top = 164 + Top = 155 Width = 898 Caption = 'Form1' ClientHeight = 506 @@ -9,533 +9,50 @@ object Form1: TForm1 OnCreate = FormCreate OnDestroy = FormDestroy LCLVersion = '0.9.25' - object GradButton1: TGradButton - Left = 24 - Height = 104 - Top = 88 - Width = 176 - Caption = 'GradButton1' - OnClick = GradButton1Click - OnMouseDown = GradButton1MouseDown - OnMouseEnter = GradButton1MouseEnter - OnMouseLeave = GradButton1MouseLeave - OnMouseMove = GradButton1MouseMove - OnMouseUp = GradButton1MouseUp - TabOrder = 0 - TabStop = True - NormalBlend = 0.5 - OverBlend = 0.653 - BaseColor = clBlue - Color = clBlue - NormalBlendColor = clWhite - OverBlendColor = clSilver - BackgroundColor = clBtnFace - BorderSides = [bsTopLine, bsBottomLine, bsLeftLine, bsRightLine] - ShowFocusBorder = True - Glyph.Data = { - 3A000000424D3A00000000000000360000002800000001000000010000000100 - 18000000000004000000640000006400000000000000000000009451DC00 - } - GlyphBackgroundColor = clWhite - ClickColor = clBlue - end object Panel1: TPanel Height = 506 - Width = 759 + Width = 655 Align = alLeft Anchors = [akTop, akLeft, akRight, akBottom] Caption = 'Panel1' ClientHeight = 506 - ClientWidth = 759 - TabOrder = 1 + ClientWidth = 655 + TabOrder = 0 object GradTabControl1: TGradTabControl - Left = 248 - Height = 504 - Top = 1 - Width = 392 - Align = alClient - ControlStyle = [csAcceptsControls, csDesignInteractive, csOpaque, csMenuEvents, csParentBackground, csOwnedChildsSelectable] + Left = 40 + Height = 312 + Top = 32 + Width = 136 + ControlStyle = [csAcceptsControls] ActivePage = GradTabPage2 - OnTabButtonClick = GradTabControl1TabButtonClick - OnTabButtonMouseUp = GradTabControl1TabButtonMouseUp PageIndex = 1 - TabHeight = 20 + TabHeight = 30 + TabPosition = tpRight object GradTabPage1: TGradTabPage Left = 2 - Height = 480 - Top = 22 - Width = 388 - ControlState = [csVisibleSetInLoading] - ControlStyle = [csAcceptsControls, csCaptureMouse, csClickEvents, csSetCaption, csDoubleClicks, csNoDesignVisible, csDesignFixedBounds, csNoDesignSelectable] + Height = 308 + Top = 2 + Width = 126 Caption = 'GradTabPage1' - ShowCloseButton = True - object Edit1: TEdit - Height = 480 - Width = 388 - Align = alClient - TabOrder = 0 - Text = 'Edit1' - end - end - object GradTabPage3: TGradTabPage - Left = 2 - Height = 480 - Top = 22 - Width = 388 - ControlState = [csVisibleSetInLoading] - ControlStyle = [csCaptureMouse, csClickEvents, csSetCaption, csDoubleClicks, csNoDesignVisible, csDesignFixedBounds, csNoDesignSelectable] - PageIndex = 2 - Caption = 'GradTabPage3' - object Memo1: TMemo - Left = 6 - Height = 362 - Top = 49 - Width = 326 - Align = alClient - Lines.Strings = ( - 'Memo1' - ) - TabOrder = 0 - end end object GradTabPage2: TGradTabPage Left = 2 - Height = 480 - Top = 22 - Width = 388 - ControlState = [csVisibleSetInLoading] - ControlStyle = [csAcceptsControls, csCaptureMouse, csClickEvents, csSetCaption, csDoubleClicks, csDesignFixedBounds] + Height = 308 + Top = 2 + Width = 102 PageIndex = 1 Caption = 'GradTabPage2' end end - object GradTabControl2: TGradTabControl - Left = 1 - Height = 504 - Top = 1 - Width = 247 - Align = alLeft - ControlStyle = [csAcceptsControls] - ActivePage = GradTabPage5 - OnTabButtonClick = GradTabControl2TabButtonClick - PageIndex = 1 - TabHeight = 25 - TabPosition = tpRight - object GradTabPage4: TGradTabPage - Left = 2 - Height = 587 - Top = 2 - Width = 218 - ControlState = [csVisibleSetInLoading] - ControlStyle = [csAcceptsControls, csCaptureMouse, csClickEvents, csSetCaption, csDoubleClicks, csNoDesignVisible, csDesignFixedBounds, csNoDesignSelectable] - TabVisible = False - Caption = 'GradTabPage4wewwerwerwer' - object SynEdit1: TSynEdit - Height = 587 - Width = 218 - Align = alClient - Font.Height = 12 - Font.Name = 'Courier' - Font.Pitch = fpFixed - ParentColor = False - TabOrder = 0 - BookMarkOptions.OnChange = nil - Highlighter = SynPHPSyn1 - Keystrokes = < - item - Command = 3 - ShortCut = 38 - end - item - Command = 103 - ShortCut = 8230 - end - item - Command = 211 - ShortCut = 16422 - end - item - Command = 4 - ShortCut = 40 - end - item - Command = 104 - ShortCut = 8232 - end - item - Command = 212 - ShortCut = 16424 - end - item - Command = 1 - ShortCut = 37 - end - item - Command = 101 - ShortCut = 8229 - end - item - Command = 5 - ShortCut = 16421 - end - item - Command = 105 - ShortCut = 24613 - end - item - Command = 2 - ShortCut = 39 - end - item - Command = 102 - ShortCut = 8231 - end - item - Command = 6 - ShortCut = 16423 - end - item - Command = 106 - ShortCut = 24615 - end - item - Command = 10 - ShortCut = 34 - end - item - Command = 110 - ShortCut = 8226 - end - item - Command = 14 - ShortCut = 16418 - end - item - Command = 114 - ShortCut = 24610 - end - item - Command = 9 - ShortCut = 33 - end - item - Command = 109 - ShortCut = 8225 - end - item - Command = 13 - ShortCut = 16417 - end - item - Command = 113 - ShortCut = 24609 - end - item - Command = 7 - ShortCut = 36 - end - item - Command = 107 - ShortCut = 8228 - end - item - Command = 15 - ShortCut = 16420 - end - item - Command = 115 - ShortCut = 24612 - end - item - Command = 8 - ShortCut = 35 - end - item - Command = 108 - ShortCut = 8227 - end - item - Command = 16 - ShortCut = 16419 - end - item - Command = 116 - ShortCut = 24611 - end - item - Command = 223 - ShortCut = 45 - end - item - Command = 201 - ShortCut = 16429 - end - item - Command = 604 - ShortCut = 8237 - end - item - Command = 502 - ShortCut = 46 - end - item - Command = 603 - ShortCut = 8238 - end - item - Command = 501 - ShortCut = 8 - end - item - Command = 501 - ShortCut = 8200 - end - item - Command = 504 - ShortCut = 16392 - end - item - Command = 601 - ShortCut = 32776 - end - item - Command = 602 - ShortCut = 40968 - end - item - Command = 509 - ShortCut = 13 - end - item - Command = 199 - ShortCut = 16449 - end - item - Command = 201 - ShortCut = 16451 - end - item - Command = 610 - ShortCut = 24649 - end - item - Command = 509 - ShortCut = 16461 - end - item - Command = 510 - ShortCut = 16462 - end - item - Command = 503 - ShortCut = 16468 - end - item - Command = 611 - ShortCut = 24661 - end - item - Command = 604 - ShortCut = 16470 - end - item - Command = 603 - ShortCut = 16472 - end - item - Command = 507 - ShortCut = 16473 - end - item - Command = 506 - ShortCut = 24665 - end - item - Command = 601 - ShortCut = 16474 - end - item - Command = 602 - ShortCut = 24666 - end - item - Command = 301 - ShortCut = 16432 - end - item - Command = 302 - ShortCut = 16433 - end - item - Command = 303 - ShortCut = 16434 - end - item - Command = 304 - ShortCut = 16435 - end - item - Command = 305 - ShortCut = 16436 - end - item - Command = 306 - ShortCut = 16437 - end - item - Command = 307 - ShortCut = 16438 - end - item - Command = 308 - ShortCut = 16439 - end - item - Command = 309 - ShortCut = 16440 - end - item - Command = 310 - ShortCut = 16441 - end - item - Command = 351 - ShortCut = 24624 - end - item - Command = 352 - ShortCut = 24625 - end - item - Command = 353 - ShortCut = 24626 - end - item - Command = 354 - ShortCut = 24627 - end - item - Command = 355 - ShortCut = 24628 - end - item - Command = 356 - ShortCut = 24629 - end - item - Command = 357 - ShortCut = 24630 - end - item - Command = 358 - ShortCut = 24631 - end - item - Command = 359 - ShortCut = 24632 - end - item - Command = 360 - ShortCut = 24633 - end - item - Command = 231 - ShortCut = 24654 - end - item - Command = 232 - ShortCut = 24643 - end - item - Command = 233 - ShortCut = 24652 - end - item - Command = 612 - ShortCut = 9 - end - item - Command = 613 - ShortCut = 8201 - end - item - Command = 250 - ShortCut = 24642 - end> - Lines.Strings = ( - '' - ) - SelectedColor.OnChange = nil - end - end - object GradTabPage5: TGradTabPage - Left = 2 - Height = 500 - Top = 2 - Width = 218 - ControlState = [csVisibleSetInLoading] - ControlStyle = [csAcceptsControls, csCaptureMouse, csClickEvents, csSetCaption, csDoubleClicks, csDesignFixedBounds] - PageIndex = 1 - Caption = 'GradTabPage5' - ShowCloseButton = True - object StringGrid1: TStringGrid - Height = 500 - Width = 218 - Align = alClient - ColCount = 5 - ExtendedSelect = True - FixedColor = clBtnFace - Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goSmoothScroll] - RowCount = 5 - TabOrder = 0 - end - end - end - object GradTabControl3: TGradTabControl - Left = 640 - Height = 504 - Top = 1 - Width = 118 - Align = alRight - ControlStyle = [csAcceptsControls] - ActivePage = GradTabPage6 - PageIndex = 1 - TabHeight = 30 - TabPosition = tpLeft - object GradTabPage7: TGradTabPage - Left = 32 - Height = 500 - Top = 2 - Width = 84 - ControlState = [csVisibleSetInLoading] - ControlStyle = [csAcceptsControls, csCaptureMouse, csClickEvents, csSetCaption, csDoubleClicks, csNoDesignVisible, csDesignFixedBounds, csNoDesignSelectable] - Caption = 'GradTabPage7' - end - object GradTabPage6: TGradTabPage - Left = 32 - Height = 500 - Top = 2 - Width = 84 - ControlState = [csVisibleSetInLoading] - ControlStyle = [csAcceptsControls, csCaptureMouse, csClickEvents, csSetCaption, csDoubleClicks, csDesignFixedBounds] - PageIndex = 1 - Caption = 'GradTabPage6' - ShowCloseButton = True - end - end end object Panel2: TPanel - Left = 764 + Left = 660 Height = 506 - Width = 134 + Width = 238 Align = alClient Caption = 'Panel2' ClientHeight = 506 - ClientWidth = 134 + ClientWidth = 238 TabOrder = 2 object ComboBox1: TComboBox Left = 16 @@ -548,81 +65,6 @@ object Form1: TForm1 Style = csDropDownList TabOrder = 0 end - object GradButton3: TGradButton - Left = 16 - Height = 25 - Top = 48 - Width = 100 - Caption = 'Add' - OnClick = GradButton3Click - TabOrder = 1 - TabStop = True - NormalBlend = 0.5 - OverBlend = 0.653 - BaseColor = clBlue - Color = clBlue - NormalBlendColor = clWhite - OverBlendColor = clSilver - BackgroundColor = clBtnFace - BorderSides = [bsTopLine, bsBottomLine, bsLeftLine, bsRightLine] - ShowFocusBorder = True - Glyph.Data = { - 3A000000424D3A00000000000000360000002800000001000000010000000100 - 1800000000000400000064000000640000000000000000000000FC8FE500 - } - GlyphBackgroundColor = clWhite - ClickColor = clBlue - end - object GradButton4: TGradButton - Left = 16 - Height = 25 - Top = 112 - Width = 100 - Caption = 'Delete' - OnClick = GradButton4Click - TabOrder = 2 - TabStop = True - NormalBlend = 0.5 - OverBlend = 0.653 - BaseColor = clBlue - Color = clBlue - NormalBlendColor = clWhite - OverBlendColor = clSilver - BackgroundColor = clBtnFace - BorderSides = [bsTopLine, bsBottomLine, bsLeftLine, bsRightLine] - ShowFocusBorder = True - Glyph.Data = { - 3A000000424D3A00000000000000360000002800000001000000010000000100 - 1800000000000400000064000000640000000000000000000000ACA4E500 - } - GlyphBackgroundColor = clWhite - ClickColor = clBlue - end - object GradButton2: TGradButton - Left = 16 - Height = 25 - Top = 80 - Width = 100 - Caption = 'Add Custom Page' - OnClick = GradButton2Click - TabOrder = 3 - TabStop = True - NormalBlend = 0.5 - OverBlend = 0.653 - BaseColor = clBlue - Color = clBlue - NormalBlendColor = clWhite - OverBlendColor = clSilver - BackgroundColor = clBtnFace - BorderSides = [bsTopLine, bsBottomLine, bsLeftLine, bsRightLine] - ShowFocusBorder = True - Glyph.Data = { - 3A000000424D3A00000000000000360000002800000001000000010000000100 - 18000000000004000000640000006400000000000000000000008C440700 - } - GlyphBackgroundColor = clWhite - ClickColor = clBlue - end object RadioGroup1: TRadioGroup Left = 16 Height = 113 @@ -648,7 +90,7 @@ object Form1: TForm1 'tpRight' ) OnClick = RadioGroup1Click - TabOrder = 4 + TabOrder = 2 end object CheckBox1: TCheckBox Left = 15 @@ -666,7 +108,7 @@ object Form1: TForm1 Width = 34 MaxValue = 50 OnEditingDone = SpinEdit1EditingDone - TabOrder = 6 + TabOrder = 1 Value = 50 end object Arrow1: TArrow @@ -675,34 +117,6 @@ object Form1: TForm1 Top = 456 Width = 10 end - object GradButton5: TGradButton - Left = 44 - Height = 24 - Top = 336 - Width = 24 - Caption = 'X' - Font.Name = 'System' - Font.Style = [fsBold] - TabOrder = 8 - TabStop = True - NormalBlend = 0.5 - OverBlend = 0.653 - BaseColor = clBtnFace - Color = clBtnFace - NormalBlendColor = clBtnFace - OverBlendColor = clWhite - BackgroundColor = clBtnFace - AutoWidth = True - BorderSides = [bsTopLine, bsBottomLine, bsLeftLine, bsRightLine] - ShowFocusBorder = True - RotateDirection = rdRight - Glyph.Data = { - 3A000000424D3A00000000000000360000002800000001000000010000000100 - 1800000000000400000064000000640000000000000000000000FCCFE100 - } - GlyphBackgroundColor = clWhite - ClickColor = clBtnFace - end object ScrollBox1: TScrollBox Left = -28 Height = 150 @@ -711,11 +125,11 @@ object Form1: TForm1 HorzScrollBar.Page = 145 VertScrollBar.Page = 145 AutoScroll = False - TabOrder = 9 + TabOrder = 3 end end object Splitter1: TSplitter - Left = 759 + Left = 655 Height = 506 Width = 5 end diff --git a/components/gradcontrols/examples/Forms/unit1.lrs b/components/gradcontrols/examples/Forms/unit1.lrs index 46a803ddd..7f5cf5243 100644 --- a/components/gradcontrols/examples/Forms/unit1.lrs +++ b/components/gradcontrols/examples/Forms/unit1.lrs @@ -1,192 +1,44 @@ { Das ist eine automatisch erzeugte Lazarus-Ressourcendatei } LazarusResources.Add('TForm1','FORMDATA',[ - 'TPF0'#6'TForm1'#5'Form1'#4'Left'#2'Q'#6'Height'#3#250#1#3'Top'#3#164#0#5'Wid' - +'th'#3#130#3#7'Caption'#6#5'Form1'#12'ClientHeight'#3#250#1#11'ClientWidth'#3 - +#130#3#8'OnCreate'#7#10'FormCreate'#9'OnDestroy'#7#11'FormDestroy'#10'LCLVer' - +'sion'#6#6'0.9.25'#0#11'TGradButton'#11'GradButton1'#4'Left'#2#24#6'Height'#2 - +'h'#3'Top'#2'X'#5'Width'#3#176#0#7'Caption'#6#11'GradButton1'#7'OnClick'#7#16 - +'GradButton1Click'#11'OnMouseDown'#7#20'GradButton1MouseDown'#12'OnMouseEnte' - +'r'#7#21'GradButton1MouseEnter'#12'OnMouseLeave'#7#21'GradButton1MouseLeave' - +#11'OnMouseMove'#7#20'GradButton1MouseMove'#9'OnMouseUp'#7#18'GradButton1Mou' - +'seUp'#8'TabOrder'#2#0#7'TabStop'#9#11'NormalBlend'#5#0#0#0#0#0#0#0#128#254 - +'?'#9'OverBlend'#5'5^'#186'I'#12#2'+'#167#254'?'#9'BaseColor'#7#6'clBlue'#5 - +'Color'#7#6'clBlue'#16'NormalBlendColor'#7#7'clWhite'#14'OverBlendColor'#7#8 - +'clSilver'#15'BackgroundColor'#7#9'clBtnFace'#11'BorderSides'#11#9'bsTopLine' - +#12'bsBottomLine'#10'bsLeftLine'#11'bsRightLine'#0#15'ShowFocusBorder'#9#10 - +'Glyph.Data'#10'>'#0#0#0':'#0#0#0'BM:'#0#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#1#0#0 - +#0#1#0#0#0#1#0#24#0#0#0#0#0#4#0#0#0'd'#0#0#0'd'#0#0#0#0#0#0#0#0#0#0#0#148'Q' - +#220#0#20'GlyphBackgroundColor'#7#7'clWhite'#10'ClickColor'#7#6'clBlue'#0#0#6 - +'TPanel'#6'Panel1'#6'Height'#3#250#1#5'Width'#3#247#2#5'Align'#7#6'alLeft'#7 - +'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#7'Caption'#6#6'Pane' - +'l1'#12'ClientHeight'#3#250#1#11'ClientWidth'#3#247#2#8'TabOrder'#2#1#0#15'T' - +'GradTabControl'#15'GradTabControl1'#4'Left'#3#248#0#6'Height'#3#248#1#3'Top' - +#2#1#5'Width'#3#136#1#5'Align'#7#8'alClient'#12'ControlStyle'#11#17'csAccept' - +'sControls'#19'csDesignInteractive'#8'csOpaque'#12'csMenuEvents'#18'csParent' - +'Background'#23'csOwnedChildsSelectable'#0#10'ActivePage'#7#12'GradTabPage2' - +#16'OnTabButtonClick'#7#29'GradTabControl1TabButtonClick'#18'OnTabButtonMous' - +'eUp'#7#31'GradTabControl1TabButtonMouseUp'#9'PageIndex'#2#1#9'TabHeight'#2 - +#20#0#12'TGradTabPage'#12'GradTabPage1'#4'Left'#2#2#6'Height'#3#224#1#3'Top' - +#2#22#5'Width'#3#132#1#12'ControlState'#11#21'csVisibleSetInLoading'#0#12'Co' - +'ntrolStyle'#11#17'csAcceptsControls'#14'csCaptureMouse'#13'csClickEvents'#12 - +'csSetCaption'#14'csDoubleClicks'#17'csNoDesignVisible'#19'csDesignFixedBoun' - +'ds'#20'csNoDesignSelectable'#0#7'Caption'#6#12'GradTabPage1'#15'ShowCloseBu' - +'tton'#9#0#5'TEdit'#5'Edit1'#6'Height'#3#224#1#5'Width'#3#132#1#5'Align'#7#8 - +'alClient'#8'TabOrder'#2#0#4'Text'#6#5'Edit1'#0#0#0#12'TGradTabPage'#12'Grad' - +'TabPage3'#4'Left'#2#2#6'Height'#3#224#1#3'Top'#2#22#5'Width'#3#132#1#12'Con' - +'trolState'#11#21'csVisibleSetInLoading'#0#12'ControlStyle'#11#14'csCaptureM' - +'ouse'#13'csClickEvents'#12'csSetCaption'#14'csDoubleClicks'#17'csNoDesignVi' - +'sible'#19'csDesignFixedBounds'#20'csNoDesignSelectable'#0#9'PageIndex'#2#2#7 - +'Caption'#6#12'GradTabPage3'#0#5'TMemo'#5'Memo1'#4'Left'#2#6#6'Height'#3'j'#1 - +#3'Top'#2'1'#5'Width'#3'F'#1#5'Align'#7#8'alClient'#13'Lines.Strings'#1#6#5 - +'Memo1'#0#8'TabOrder'#2#0#0#0#0#12'TGradTabPage'#12'GradTabPage2'#4'Left'#2#2 - +#6'Height'#3#224#1#3'Top'#2#22#5'Width'#3#132#1#12'ControlState'#11#21'csVis' - +'ibleSetInLoading'#0#12'ControlStyle'#11#17'csAcceptsControls'#14'csCaptureM' - +'ouse'#13'csClickEvents'#12'csSetCaption'#14'csDoubleClicks'#19'csDesignFixe' - +'dBounds'#0#9'PageIndex'#2#1#7'Caption'#6#12'GradTabPage2'#0#0#0#15'TGradTab' - +'Control'#15'GradTabControl2'#4'Left'#2#1#6'Height'#3#248#1#3'Top'#2#1#5'Wid' - +'th'#3#247#0#5'Align'#7#6'alLeft'#12'ControlStyle'#11#17'csAcceptsControls'#0 - +#10'ActivePage'#7#12'GradTabPage5'#16'OnTabButtonClick'#7#29'GradTabControl2' - +'TabButtonClick'#9'PageIndex'#2#1#9'TabHeight'#2#25#11'TabPosition'#7#7'tpRi' - +'ght'#0#12'TGradTabPage'#12'GradTabPage4'#4'Left'#2#2#6'Height'#3'K'#2#3'Top' - +#2#2#5'Width'#3#218#0#12'ControlState'#11#21'csVisibleSetInLoading'#0#12'Con' - +'trolStyle'#11#17'csAcceptsControls'#14'csCaptureMouse'#13'csClickEvents'#12 - +'csSetCaption'#14'csDoubleClicks'#17'csNoDesignVisible'#19'csDesignFixedBoun' - +'ds'#20'csNoDesignSelectable'#0#10'TabVisible'#8#7'Caption'#6#24'GradTabPage' - +'4wewwerwerwer'#0#8'TSynEdit'#8'SynEdit1'#6'Height'#3'K'#2#5'Width'#3#218#0#5 - +'Align'#7#8'alClient'#11'Font.Height'#2#12#9'Font.Name'#6#7'Courier'#10'Font' - +'.Pitch'#7#7'fpFixed'#11'ParentColor'#8#8'TabOrder'#2#0#24'BookMarkOptions.O' - +'nChange'#13#11'Highlighter'#7#10'SynPHPSyn1'#10'Keystrokes'#14#1#7'Command' - +#2#3#8'ShortCut'#2'&'#0#1#7'Command'#2'g'#8'ShortCut'#3'& '#0#1#7'Command'#3 - +#211#0#8'ShortCut'#3'&@'#0#1#7'Command'#2#4#8'ShortCut'#2'('#0#1#7'Command'#2 - +'h'#8'ShortCut'#3'( '#0#1#7'Command'#3#212#0#8'ShortCut'#3'(@'#0#1#7'Command' - +#2#1#8'ShortCut'#2'%'#0#1#7'Command'#2'e'#8'ShortCut'#3'% '#0#1#7'Command'#2 - +#5#8'ShortCut'#3'%@'#0#1#7'Command'#2'i'#8'ShortCut'#3'%`'#0#1#7'Command'#2#2 - +#8'ShortCut'#2''''#0#1#7'Command'#2'f'#8'ShortCut'#3''' '#0#1#7'Command'#2#6 - +#8'ShortCut'#3'''@'#0#1#7'Command'#2'j'#8'ShortCut'#3'''`'#0#1#7'Command'#2 - +#10#8'ShortCut'#2'"'#0#1#7'Command'#2'n'#8'ShortCut'#3'" '#0#1#7'Command'#2 - ,#14#8'ShortCut'#3'"@'#0#1#7'Command'#2'r'#8'ShortCut'#3'"`'#0#1#7'Command'#2 - +#9#8'ShortCut'#2'!'#0#1#7'Command'#2'm'#8'ShortCut'#3'! '#0#1#7'Command'#2#13 - +#8'ShortCut'#3'!@'#0#1#7'Command'#2'q'#8'ShortCut'#3'!`'#0#1#7'Command'#2#7#8 - +'ShortCut'#2'$'#0#1#7'Command'#2'k'#8'ShortCut'#3'$ '#0#1#7'Command'#2#15#8 - +'ShortCut'#3'$@'#0#1#7'Command'#2's'#8'ShortCut'#3'$`'#0#1#7'Command'#2#8#8 - +'ShortCut'#2'#'#0#1#7'Command'#2'l'#8'ShortCut'#3'# '#0#1#7'Command'#2#16#8 - +'ShortCut'#3'#@'#0#1#7'Command'#2't'#8'ShortCut'#3'#`'#0#1#7'Command'#3#223#0 - +#8'ShortCut'#2'-'#0#1#7'Command'#3#201#0#8'ShortCut'#3'-@'#0#1#7'Command'#3 - +'\'#2#8'ShortCut'#3'- '#0#1#7'Command'#3#246#1#8'ShortCut'#2'.'#0#1#7'Comman' - +'d'#3'['#2#8'ShortCut'#3'. '#0#1#7'Command'#3#245#1#8'ShortCut'#2#8#0#1#7'Co' - +'mmand'#3#245#1#8'ShortCut'#3#8' '#0#1#7'Command'#3#248#1#8'ShortCut'#3#8'@' - +#0#1#7'Command'#3'Y'#2#8'ShortCut'#4#8#128#0#0#0#1#7'Command'#3'Z'#2#8'Short' - +'Cut'#4#8#160#0#0#0#1#7'Command'#3#253#1#8'ShortCut'#2#13#0#1#7'Command'#3 - +#199#0#8'ShortCut'#3'A@'#0#1#7'Command'#3#201#0#8'ShortCut'#3'C@'#0#1#7'Comm' - +'and'#3'b'#2#8'ShortCut'#3'I`'#0#1#7'Command'#3#253#1#8'ShortCut'#3'M@'#0#1#7 - +'Command'#3#254#1#8'ShortCut'#3'N@'#0#1#7'Command'#3#247#1#8'ShortCut'#3'T@' - +#0#1#7'Command'#3'c'#2#8'ShortCut'#3'U`'#0#1#7'Command'#3'\'#2#8'ShortCut'#3 - +'V@'#0#1#7'Command'#3'['#2#8'ShortCut'#3'X@'#0#1#7'Command'#3#251#1#8'ShortC' - +'ut'#3'Y@'#0#1#7'Command'#3#250#1#8'ShortCut'#3'Y`'#0#1#7'Command'#3'Y'#2#8 - +'ShortCut'#3'Z@'#0#1#7'Command'#3'Z'#2#8'ShortCut'#3'Z`'#0#1#7'Command'#3'-' - +#1#8'ShortCut'#3'0@'#0#1#7'Command'#3'.'#1#8'ShortCut'#3'1@'#0#1#7'Command'#3 - +'/'#1#8'ShortCut'#3'2@'#0#1#7'Command'#3'0'#1#8'ShortCut'#3'3@'#0#1#7'Comman' - +'d'#3'1'#1#8'ShortCut'#3'4@'#0#1#7'Command'#3'2'#1#8'ShortCut'#3'5@'#0#1#7'C' - +'ommand'#3'3'#1#8'ShortCut'#3'6@'#0#1#7'Command'#3'4'#1#8'ShortCut'#3'7@'#0#1 - +#7'Command'#3'5'#1#8'ShortCut'#3'8@'#0#1#7'Command'#3'6'#1#8'ShortCut'#3'9@' - +#0#1#7'Command'#3'_'#1#8'ShortCut'#3'0`'#0#1#7'Command'#3'`'#1#8'ShortCut'#3 - +'1`'#0#1#7'Command'#3'a'#1#8'ShortCut'#3'2`'#0#1#7'Command'#3'b'#1#8'ShortCu' - +'t'#3'3`'#0#1#7'Command'#3'c'#1#8'ShortCut'#3'4`'#0#1#7'Command'#3'd'#1#8'Sh' - +'ortCut'#3'5`'#0#1#7'Command'#3'e'#1#8'ShortCut'#3'6`'#0#1#7'Command'#3'f'#1 - +#8'ShortCut'#3'7`'#0#1#7'Command'#3'g'#1#8'ShortCut'#3'8`'#0#1#7'Command'#3 - +'h'#1#8'ShortCut'#3'9`'#0#1#7'Command'#3#231#0#8'ShortCut'#3'N`'#0#1#7'Comma' - +'nd'#3#232#0#8'ShortCut'#3'C`'#0#1#7'Command'#3#233#0#8'ShortCut'#3'L`'#0#1#7 - +'Command'#3'd'#2#8'ShortCut'#2#9#0#1#7'Command'#3'e'#2#8'ShortCut'#3#9' '#0#1 - +#7'Command'#3#250#0#8'ShortCut'#3'B`'#0#0#13'Lines.Strings'#1#6#2''#0#22'SelectedColor.OnChange'#13#0#0#0#12'TGr' - +'adTabPage'#12'GradTabPage5'#4'Left'#2#2#6'Height'#3#244#1#3'Top'#2#2#5'Widt' - +'h'#3#218#0#12'ControlState'#11#21'csVisibleSetInLoading'#0#12'ControlStyle' - +#11#17'csAcceptsControls'#14'csCaptureMouse'#13'csClickEvents'#12'csSetCapti' - +'on'#14'csDoubleClicks'#19'csDesignFixedBounds'#0#9'PageIndex'#2#1#7'Caption' - +#6#12'GradTabPage5'#15'ShowCloseButton'#9#0#11'TStringGrid'#11'StringGrid1'#6 - +'Height'#3#244#1#5'Width'#3#218#0#5'Align'#7#8'alClient'#8'ColCount'#2#5#14 - +'ExtendedSelect'#9#10'FixedColor'#7#9'clBtnFace'#7'Options'#11#15'goFixedVer' - +'tLine'#15'goFixedHorzLine'#10'goVertLine'#10'goHorzLine'#13'goRangeSelect' - +#14'goSmoothScroll'#0#8'RowCount'#2#5#8'TabOrder'#2#0#0#0#0#0#15'TGradTabCon' - +'trol'#15'GradTabControl3'#4'Left'#3#128#2#6'Height'#3#248#1#3'Top'#2#1#5'Wi' - +'dth'#2'v'#5'Align'#7#7'alRight'#12'ControlStyle'#11#17'csAcceptsControls'#0 - +#10'ActivePage'#7#12'GradTabPage6'#9'PageIndex'#2#1#9'TabHeight'#2#30#11'Tab' - +'Position'#7#6'tpLeft'#0#12'TGradTabPage'#12'GradTabPage7'#4'Left'#2' '#6'He' - +'ight'#3#244#1#3'Top'#2#2#5'Width'#2'T'#12'ControlState'#11#21'csVisibleSetI' - +'nLoading'#0#12'ControlStyle'#11#17'csAcceptsControls'#14'csCaptureMouse'#13 - +'csClickEvents'#12'csSetCaption'#14'csDoubleClicks'#17'csNoDesignVisible'#19 - +'csDesignFixedBounds'#20'csNoDesignSelectable'#0#7'Caption'#6#12'GradTabPage' - +'7'#0#0#12'TGradTabPage'#12'GradTabPage6'#4'Left'#2' '#6'Height'#3#244#1#3'T' - +'op'#2#2#5'Width'#2'T'#12'ControlState'#11#21'csVisibleSetInLoading'#0#12'Co' - +'ntrolStyle'#11#17'csAcceptsControls'#14'csCaptureMouse'#13'csClickEvents'#12 - +'csSetCaption'#14'csDoubleClicks'#19'csDesignFixedBounds'#0#9'PageIndex'#2#1 - +#7'Caption'#6#12'GradTabPage6'#15'ShowCloseButton'#9#0#0#0#0#6'TPanel'#6'Pan' - +'el2'#4'Left'#3#252#2#6'Height'#3#250#1#5'Width'#3#134#0#5'Align'#7#8'alClie' - +'nt'#7'Caption'#6#6'Panel2'#12'ClientHeight'#3#250#1#11'ClientWidth'#3#134#0 - +#8'TabOrder'#2#2#0#9'TComboBox'#9'ComboBox1'#4'Left'#2#16#6'Height'#2#21#3'T' - +'op'#2#16#5'Width'#2'd'#16'AutoCompleteText'#11#22'cbactEndOfLineComplete'#20 - +'cbactSearchAscending'#0#10'ItemHeight'#2#13#8'OnChange'#7#15'ComboBox1Chang' - +'e'#5'Style'#7#14'csDropDownList'#8'TabOrder'#2#0#0#0#11'TGradButton'#11'Gra' - +'dButton3'#4'Left'#2#16#6'Height'#2#25#3'Top'#2'0'#5'Width'#2'd'#7'Caption'#6 - ,#3'Add'#7'OnClick'#7#16'GradButton3Click'#8'TabOrder'#2#1#7'TabStop'#9#11'No' - +'rmalBlend'#5#0#0#0#0#0#0#0#128#254'?'#9'OverBlend'#5'5^'#186'I'#12#2'+'#167 - +#254'?'#9'BaseColor'#7#6'clBlue'#5'Color'#7#6'clBlue'#16'NormalBlendColor'#7 - +#7'clWhite'#14'OverBlendColor'#7#8'clSilver'#15'BackgroundColor'#7#9'clBtnFa' - +'ce'#11'BorderSides'#11#9'bsTopLine'#12'bsBottomLine'#10'bsLeftLine'#11'bsRi' - +'ghtLine'#0#15'ShowFocusBorder'#9#10'Glyph.Data'#10'>'#0#0#0':'#0#0#0'BM:'#0 - +#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#1#0#0#0#1#0#0#0#1#0#24#0#0#0#0#0#4#0#0#0'd'#0 - +#0#0'd'#0#0#0#0#0#0#0#0#0#0#0#252#143#229#0#20'GlyphBackgroundColor'#7#7'clW' - +'hite'#10'ClickColor'#7#6'clBlue'#0#0#11'TGradButton'#11'GradButton4'#4'Left' - +#2#16#6'Height'#2#25#3'Top'#2'p'#5'Width'#2'd'#7'Caption'#6#6'Delete'#7'OnCl' - +'ick'#7#16'GradButton4Click'#8'TabOrder'#2#2#7'TabStop'#9#11'NormalBlend'#5#0 - +#0#0#0#0#0#0#128#254'?'#9'OverBlend'#5'5^'#186'I'#12#2'+'#167#254'?'#9'BaseC' - +'olor'#7#6'clBlue'#5'Color'#7#6'clBlue'#16'NormalBlendColor'#7#7'clWhite'#14 - +'OverBlendColor'#7#8'clSilver'#15'BackgroundColor'#7#9'clBtnFace'#11'BorderS' - +'ides'#11#9'bsTopLine'#12'bsBottomLine'#10'bsLeftLine'#11'bsRightLine'#0#15 - +'ShowFocusBorder'#9#10'Glyph.Data'#10'>'#0#0#0':'#0#0#0'BM:'#0#0#0#0#0#0#0'6' - +#0#0#0'('#0#0#0#1#0#0#0#1#0#0#0#1#0#24#0#0#0#0#0#4#0#0#0'd'#0#0#0'd'#0#0#0#0 - +#0#0#0#0#0#0#0#172#164#229#0#20'GlyphBackgroundColor'#7#7'clWhite'#10'ClickC' - +'olor'#7#6'clBlue'#0#0#11'TGradButton'#11'GradButton2'#4'Left'#2#16#6'Height' - +#2#25#3'Top'#2'P'#5'Width'#2'd'#7'Caption'#6#15'Add Custom Page'#7'OnClick'#7 - +#16'GradButton2Click'#8'TabOrder'#2#3#7'TabStop'#9#11'NormalBlend'#5#0#0#0#0 - +#0#0#0#128#254'?'#9'OverBlend'#5'5^'#186'I'#12#2'+'#167#254'?'#9'BaseColor'#7 - +#6'clBlue'#5'Color'#7#6'clBlue'#16'NormalBlendColor'#7#7'clWhite'#14'OverBle' - +'ndColor'#7#8'clSilver'#15'BackgroundColor'#7#9'clBtnFace'#11'BorderSides'#11 - +#9'bsTopLine'#12'bsBottomLine'#10'bsLeftLine'#11'bsRightLine'#0#15'ShowFocus' - +'Border'#9#10'Glyph.Data'#10'>'#0#0#0':'#0#0#0'BM:'#0#0#0#0#0#0#0'6'#0#0#0'(' - +#0#0#0#1#0#0#0#1#0#0#0#1#0#24#0#0#0#0#0#4#0#0#0'd'#0#0#0'd'#0#0#0#0#0#0#0#0#0 - +#0#0#140'D'#7#0#20'GlyphBackgroundColor'#7#7'clWhite'#10'ClickColor'#7#6'clB' - +'lue'#0#0#11'TRadioGroup'#11'RadioGroup1'#4'Left'#2#16#6'Height'#2'q'#3'Top' - +#3#152#0#5'Width'#2'd'#8'AutoFill'#9#7'Caption'#6#12'Tab Position'#28'ChildS' - +'izing.LeftRightSpacing'#2#6#28'ChildSizing.TopBottomSpacing'#2#6#29'ChildSi' - +'zing.EnlargeHorizontal'#7#24'crsHomogenousChildResize'#27'ChildSizing.Enlar' - +'geVertical'#7#24'crsHomogenousChildResize'#28'ChildSizing.ShrinkHorizontal' - +#7#14'crsScaleChilds'#26'ChildSizing.ShrinkVertical'#7#14'crsScaleChilds'#18 - +'ChildSizing.Layout'#7#29'cclLeftToRightThenTopToBottom'#27'ChildSizing.Cont' - +'rolsPerLine'#2#1#12'ClientHeight'#2'_'#11'ClientWidth'#2'`'#9'ItemIndex'#2#0 - +#13'Items.Strings'#1#6#5'tpTop'#6#8'tpBottom'#6#6'tpLeft'#6#7'tpRight'#0#7'O' - +'nClick'#7#16'RadioGroup1Click'#8'TabOrder'#2#4#0#0#9'TCheckBox'#9'CheckBox1' - +#4'Left'#2#15#6'Height'#2#19#3'Top'#3#20#1#5'Width'#2'K'#7'Caption'#6#9'Long' - +' Tabs'#7'OnClick'#7#14'CheckBox1Click'#8'TabOrder'#2#5#0#0#9'TSpinEdit'#9'S' - +'pinEdit1'#4'Left'#2'_'#6'Height'#2#19#3'Top'#3#20#1#5'Width'#2'"'#8'MaxValu' - +'e'#2'2'#13'OnEditingDone'#7#20'SpinEdit1EditingDone'#8'TabOrder'#2#6#5'Valu' - +'e'#2'2'#0#0#6'TArrow'#6'Arrow1'#4'Left'#2#31#6'Height'#2#10#3'Top'#3#200#1#5 - +'Width'#2#10#0#0#11'TGradButton'#11'GradButton5'#4'Left'#2','#6'Height'#2#24 - +#3'Top'#3'P'#1#5'Width'#2#24#7'Caption'#6#1'X'#9'Font.Name'#6#6'System'#10'F' - +'ont.Style'#11#6'fsBold'#0#8'TabOrder'#2#8#7'TabStop'#9#11'NormalBlend'#5#0#0 - +#0#0#0#0#0#128#254'?'#9'OverBlend'#5'5^'#186'I'#12#2'+'#167#254'?'#9'BaseCol' - +'or'#7#9'clBtnFace'#5'Color'#7#9'clBtnFace'#16'NormalBlendColor'#7#9'clBtnFa' - +'ce'#14'OverBlendColor'#7#7'clWhite'#15'BackgroundColor'#7#9'clBtnFace'#9'Au' - +'toWidth'#9#11'BorderSides'#11#9'bsTopLine'#12'bsBottomLine'#10'bsLeftLine' - +#11'bsRightLine'#0#15'ShowFocusBorder'#9#15'RotateDirection'#7#7'rdRight'#10 - +'Glyph.Data'#10'>'#0#0#0':'#0#0#0'BM:'#0#0#0#0#0#0#0'6'#0#0#0'('#0#0#0#1#0#0 - +#0#1#0#0#0#1#0#24#0#0#0#0#0#4#0#0#0'd'#0#0#0'd'#0#0#0#0#0#0#0#0#0#0#0#252#207 - +#225#0#20'GlyphBackgroundColor'#7#7'clWhite'#10'ClickColor'#7#9'clBtnFace'#0 + 'TPF0'#6'TForm1'#5'Form1'#4'Left'#3#8#1#6'Height'#3#250#1#3'Top'#3#155#0#5'Wi' + +'dth'#3#130#3#7'Caption'#6#5'Form1'#12'ClientHeight'#3#250#1#11'ClientWidth' + +#3#130#3#8'OnCreate'#7#10'FormCreate'#9'OnDestroy'#7#11'FormDestroy'#10'LCLV' + +'ersion'#6#6'0.9.25'#0#6'TPanel'#6'Panel1'#6'Height'#3#250#1#5'Width'#3#143#2 + +#5'Align'#7#6'alLeft'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom' + +#0#7'Caption'#6#6'Panel1'#12'ClientHeight'#3#250#1#11'ClientWidth'#3#143#2#8 + +'TabOrder'#2#0#0#15'TGradTabControl'#15'GradTabControl1'#4'Left'#2'('#6'Heig' + +'ht'#3'8'#1#3'Top'#2' '#5'Width'#3#136#0#12'ControlStyle'#11#17'csAcceptsCon' + +'trols'#0#10'ActivePage'#7#12'GradTabPage2'#9'PageIndex'#2#1#9'TabHeight'#2 + +#30#11'TabPosition'#7#7'tpRight'#0#12'TGradTabPage'#12'GradTabPage1'#4'Left' + +#2#2#6'Height'#3'4'#1#3'Top'#2#2#5'Width'#2'~'#7'Caption'#6#12'GradTabPage1' + +#0#0#12'TGradTabPage'#12'GradTabPage2'#4'Left'#2#2#6'Height'#3'4'#1#3'Top'#2 + +#2#5'Width'#2'f'#9'PageIndex'#2#1#7'Caption'#6#12'GradTabPage2'#0#0#0#0#6'TP' + +'anel'#6'Panel2'#4'Left'#3#148#2#6'Height'#3#250#1#5'Width'#3#238#0#5'Align' + +#7#8'alClient'#7'Caption'#6#6'Panel2'#12'ClientHeight'#3#250#1#11'ClientWidt' + +'h'#3#238#0#8'TabOrder'#2#2#0#9'TComboBox'#9'ComboBox1'#4'Left'#2#16#6'Heigh' + +'t'#2#21#3'Top'#2#16#5'Width'#2'd'#16'AutoCompleteText'#11#22'cbactEndOfLine' + +'Complete'#20'cbactSearchAscending'#0#10'ItemHeight'#2#13#8'OnChange'#7#15'C' + +'omboBox1Change'#5'Style'#7#14'csDropDownList'#8'TabOrder'#2#0#0#0#11'TRadio' + +'Group'#11'RadioGroup1'#4'Left'#2#16#6'Height'#2'q'#3'Top'#3#152#0#5'Width'#2 + +'d'#8'AutoFill'#9#7'Caption'#6#12'Tab Position'#28'ChildSizing.LeftRightSpac' + +'ing'#2#6#28'ChildSizing.TopBottomSpacing'#2#6#29'ChildSizing.EnlargeHorizon' + +'tal'#7#24'crsHomogenousChildResize'#27'ChildSizing.EnlargeVertical'#7#24'cr' + +'sHomogenousChildResize'#28'ChildSizing.ShrinkHorizontal'#7#14'crsScaleChild' + +'s'#26'ChildSizing.ShrinkVertical'#7#14'crsScaleChilds'#18'ChildSizing.Layou' + +'t'#7#29'cclLeftToRightThenTopToBottom'#27'ChildSizing.ControlsPerLine'#2#1 + +#12'ClientHeight'#2'_'#11'ClientWidth'#2'`'#9'ItemIndex'#2#0#13'Items.String' + +'s'#1#6#5'tpTop'#6#8'tpBottom'#6#6'tpLeft'#6#7'tpRight'#0#7'OnClick'#7#16'Ra' + +'dioGroup1Click'#8'TabOrder'#2#2#0#0#9'TCheckBox'#9'CheckBox1'#4'Left'#2#15#6 + +'Height'#2#19#3'Top'#3#20#1#5'Width'#2'K'#7'Caption'#6#9'Long Tabs'#7'OnClic' + +'k'#7#14'CheckBox1Click'#8'TabOrder'#2#5#0#0#9'TSpinEdit'#9'SpinEdit1'#4'Lef' + +'t'#2'_'#6'Height'#2#19#3'Top'#3#20#1#5'Width'#2'"'#8'MaxValue'#2'2'#13'OnEd' + +'itingDone'#7#20'SpinEdit1EditingDone'#8'TabOrder'#2#1#5'Value'#2'2'#0#0#6'T' + +'Arrow'#6'Arrow1'#4'Left'#2#31#6'Height'#2#10#3'Top'#3#200#1#5'Width'#2#10#0 +#0#10'TScrollBox'#10'ScrollBox1'#4'Left'#2#228#6'Height'#3#150#0#3'Top'#3'P' +#1#5'Width'#3#150#0#18'HorzScrollBar.Page'#3#145#0#18'VertScrollBar.Page'#3 - +#145#0#10'AutoScroll'#8#8'TabOrder'#2#9#0#0#0#9'TSplitter'#9'Splitter1'#4'Le' - +'ft'#3#247#2#6'Height'#3#250#1#5'Width'#2#5#0#0#10'TPopupMenu'#10'PopupMenu1' + +#145#0#10'AutoScroll'#8#8'TabOrder'#2#3#0#0#0#9'TSplitter'#9'Splitter1'#4'Le' + +'ft'#3#143#2#6'Height'#3#250#1#5'Width'#2#5#0#0#10'TPopupMenu'#10'PopupMenu1' +#4'left'#3#222#2#3'top'#3#141#1#0#9'TMenuItem'#9'MenuItem1'#7'Caption'#6#9'N' +'ew Item1'#0#0#0#10'TSynPHPSyn'#10'SynPHPSyn1'#13'DefaultFilter'#6'CPHP-Date' +'ien (*.php,*.php3,*.phtml,*.inc)|*.php;*.php3;*.phtml;*.inc'#7'Enabled'#8#4 diff --git a/components/gradcontrols/examples/Forms/unit1.pas b/components/gradcontrols/examples/Forms/unit1.pas index 69323c5c5..6affe58bd 100644 --- a/components/gradcontrols/examples/Forms/unit1.pas +++ b/components/gradcontrols/examples/Forms/unit1.pas @@ -45,25 +45,15 @@ type CheckBox1: TCheckBox; ComboBox1: TComboBox; Edit1: TEdit; - GradButton1: TGradButton; - GradButton2: TGradButton; - GradButton3: TGradButton; - GradButton4: TGradButton; - GradButton5: TGradButton; GradTabControl1: TGradTabControl; - GradTabControl2: TGradTabControl; - GradTabControl3: TGradTabControl; GradTabPage1: TGradTabPage; GradTabPage2: TGradTabPage; - GradTabPage3: TGradTabPage; - GradTabPage4: TGradTabPage; - GradTabPage5: TGradTabPage; - GradTabPage6: TGradTabPage; - GradTabPage7: TGradTabPage; Memo1: TMemo; + Memo2: TMemo; MenuItem1: TMenuItem; Panel1: TPanel; Panel2: TPanel; + Panel3: TPanel; PopupMenu1: TPopupMenu; RadioGroup1: TRadioGroup; ScrollBox1: TScrollBox; diff --git a/components/gradcontrols/examples/gradbuttontest.lpi b/components/gradcontrols/examples/gradbuttontest.lpi index 86093133f..b9233e3f9 100644 --- a/components/gradcontrols/examples/gradbuttontest.lpi +++ b/components/gradcontrols/examples/gradbuttontest.lpi @@ -57,15 +57,16 @@ - + - + + diff --git a/components/gradcontrols/examples/gradcontroltest.lpi b/components/gradcontrols/examples/gradcontroltest.lpi index a37a9c2f4..4e5e7579f 100644 --- a/components/gradcontrols/examples/gradcontroltest.lpi +++ b/components/gradcontrols/examples/gradcontroltest.lpi @@ -15,7 +15,7 @@ - + @@ -68,14 +68,11 @@ - + - - - diff --git a/components/gradcontrols/packages/gradbutton.pas b/components/gradcontrols/packages/gradbutton.pas index f1f320a30..bae5e893a 100644 --- a/components/gradcontrols/packages/gradbutton.pas +++ b/components/gradcontrols/packages/gradbutton.pas @@ -1,6 +1,5 @@ -{ Diese Datei wurde automatisch von Lazarus erzeugt. Sie darf nicht bearbeitet - werden! - Dieser Quelltext dient nur dem Übersetzen und Installieren des Packages. +{ This file was automatically created by Lazarus. do not edit! + This source is only used to compile and install the package. } unit gradbutton; @@ -8,7 +7,7 @@ unit gradbutton; interface uses -ugradbtn, urotatebitmap, LazarusPackageIntf; +ugradbtn, uRotateBitmap, LazarusPackageIntf; implementation diff --git a/components/gradcontrols/src/ugradbtn.pas b/components/gradcontrols/src/ugradbtn.pas index 2df428e69..c02bb4889 100644 --- a/components/gradcontrols/src/ugradbtn.pas +++ b/components/gradcontrols/src/ugradbtn.pas @@ -21,8 +21,6 @@ uses type TGradButton = class; - TRotateDirection = urotatebitmap.TRotateDirection; - TTextAlignment = (taLeftJustify, taRightJustify, taCenter); TBorderSide = (bsTopLine, bsBottomLine, bsLeftLine, bsRightLine); TBorderSides = set of TBorderSide; @@ -40,7 +38,7 @@ type FButtonLayout: TButtonLayout; FTextPoint, FGlyphPoint : TPoint; FTextSize, FGlyphSize : TSize; - FBackground, bm, FGlyph, + FBackground, bm, FNormalBackgroundCache, FHotBackgroundCache, FDownBackgroundCache, FDisabledBackgroundCache : TBitmap; FRotatedGlyph : TRotatedGlyph; @@ -55,7 +53,6 @@ type FOnDownBackgroundPaint, FOnDisabledBackgroundPaint : TGBBackgroundPaintEvent; procedure PaintGradient(TrgCanvas: TCanvas; pr : TRect); procedure UpdateText; - procedure UpdateGlyph; procedure UpdateBackground; procedure PaintBackground(AState: TButtonState; TrgBitmap: TBitmap); protected @@ -65,6 +62,7 @@ type FBackgroundColor, FGlyphBackgroundColor, FClickColor: TColor; procedure InvPaint(StateCheck:Boolean=false); procedure FontChanged(Sender: TObject); override; + procedure GlyphChanged(Sender: TObject); procedure GetBackgroundRect(var TheRect : TRect); function GetGlyph : TBitmap; procedure SetEnabled(Value: Boolean); override; @@ -200,13 +198,7 @@ end; procedure TGradButton.SetGlyph(const Value: TBitmap); begin - //FGlyph.Clear; - //FGlyph.Assign(Value); - - FRotatedGlyph.Glyph := FGlyph; - //FRotatedGlyph.Update; - - //UpdateGlyph; + FRotatedGlyph.Bitmap := Value; end; procedure TGradButton.TextChanged; @@ -240,11 +232,11 @@ end; procedure TGradButton.UpdateText; begin - UpdatePositions; + //UpdatePositions; - FRotatedText.Canvas.Font.Color := Canvas.Font.Color; - FRotatedText.Canvas.Font := Canvas.Font; - FRotatedText.Update; + //FRotatedText.Canvas.Font.Color := Canvas.Font.Color; + //FRotatedText.Canvas.Font := Canvas.Font; + //FRotatedText.Update; end; procedure TGradButton.SetAutoWidth(const Value : Boolean); @@ -254,11 +246,6 @@ begin UpdateButton; end; -procedure TGradButton.UpdateGlyph; -begin - // -end; - procedure TGradButton.Resize; begin if (HasParent) then @@ -290,7 +277,7 @@ begin tempGS.cx:=0; tempGS.cy:=0; - if FShowGlyph then + if FShowGlyph and not FRotatedGlyph.Empty then begin tempGS.cx:=FRotatedGlyph.Width; tempGS.cy:=FRotatedGlyph.Height; @@ -320,7 +307,7 @@ begin tempGS.cy := p; end; } - if FShowGlyph then begin + if FShowGlyph and not FRotatedGlyph.Empty then begin case tempBL of blGlyphLeft: begin FGlyphPoint.x := AlignItem(tempGS.cx+FTextGlyphSpacing+tempTS.cx,AreaWidth,4,FTextAlignment); @@ -550,7 +537,7 @@ end; function TGradButton.GetGlyph : TBitmap; begin - Result := FRotatedGlyph.Glyph; + Result := FRotatedGlyph.Bitmap; end; procedure TGradButton.SetDisabledColor(const Value: TColor); @@ -583,7 +570,8 @@ end; procedure TGradButton.SetGlyphBackgroundColor(const Value: TColor); begin FGlyphBackgroundColor:=Value; - FRotatedGlyph.TransparentColor:=Value; + //todo: see the desired behavior of GlyphBackgroundColor + //FRotatedGlyph.TransparentColor:=Value; InvPaint; end; @@ -653,17 +641,15 @@ begin UpdateBackground; UpdateText; - UpdateGlyph; UpdatePositions; end; procedure TGradButton.SetShowGlyph(const Value: Boolean); begin - if FShowGlyph <> Value then + if (FShowGlyph <> Value) AND FRotatedGlyph.IsBitmapStored then begin FShowGlyph:=Value; - UpdateGlyph; UpdatePositions; InvPaint; @@ -675,9 +661,8 @@ begin FRotateDirection:=Value; //Rotate and Cache - FRotatedText.RotateDirection:=FRotateDirection; - if FShowGlyph then - FRotatedGlyph.RotateDirection:=FRotateDirection; + FRotatedText.Direction:=FRotateDirection; + FRotatedGlyph.Direction:=FRotateDirection; UpdatePositions; @@ -829,8 +814,9 @@ begin Height:=Self.Height; end; - //FGlyph := TBitmap.Create; + FRotatedGlyph := TRotatedGlyph.Create; + FRotatedGlyph.OnChange := @GlyphChanged; FRotatedText := TRotatedText.Create; FButtonLayout:=blGlyphLeft; FGlyphBackgroundColor:=clWhite; @@ -854,8 +840,6 @@ begin bm.Free; DebugLn('FRotatedGlyph.Free'); FRotatedGlyph.Free; - //DebugLn('FGlyph.Free'); - //if Assigned(FGlyph) then FGlyph.Free; DebugLn('FRotatedText.Free'); FRotatedText.Free; DebugLn('FBackground.Free'); @@ -954,23 +938,24 @@ begin if doIt then begin FOldState:=FState; - if csDesigning in ComponentState then - begin - Invalidate; - end else begin - Paint; - end; + Invalidate; end; end; procedure TGradButton.FontChanged(Sender: TObject); begin inherited FontChanged(Sender); - FRotatedText.Canvas.Font := Font; - FRotatedText.Update; + + FRotatedText.Font := Font; UpdatePositions; end; +procedure TGradButton.GlyphChanged(Sender: TObject); +begin + UpdatePositions; + Invalidate; +end; + procedure TGradButton.DoEnter; begin FState:=bsHot; @@ -1037,9 +1022,9 @@ begin end; if Caption <> '' then - FRotatedText.Draw(FTextPoint.x+p, FTextPoint.y+p, bm); + FRotatedText.Draw(bm.Canvas, FTextPoint.x+p, FTextPoint.y+p); - if FShowGlyph then + if FShowGlyph AND FRotatedGlyph.IsBitmapStored then begin if not FEnabled then tempState := bsDisabled @@ -1047,7 +1032,7 @@ begin tempState := FState; FRotatedGlyph.State:=tempState; - FRotatedGlyph.Draw(FGlyphPoint.x+p, FGlyphPoint.y+p, bm, FGlyphBackgroundColor); + FRotatedGlyph.Draw(bm.Canvas, FGlyphPoint.x+p, FGlyphPoint.y+p); end; if not (csDesigning in ComponentState) then diff --git a/components/gradcontrols/src/ugradtabcontrol.pas b/components/gradcontrols/src/ugradtabcontrol.pas index 993532306..9e40ab08a 100644 --- a/components/gradcontrols/src/ugradtabcontrol.pas +++ b/components/gradcontrols/src/ugradtabcontrol.pas @@ -70,8 +70,8 @@ type property TabButton : TGradTabPageButton read FButton; function VisibleIndex: integer; published - property ControlState; - property ControlStyle; + //property ControlState; + //property ControlStyle; property TabVisible : Boolean read FTabVisible write SetTabVisible default true; property PageIndex : Integer read GetPageIndex write SetPageIndex; property Caption : TCaption read GetText write SetText; @@ -1169,6 +1169,9 @@ begin FPagesBar.Top:=0; FPagesBar.Width:=FBar.Width; FPagesBar.Height:=FBar.Height; + + Height:=200; + Width:=200; end; {------------------------------------------------------------------------------ @@ -1409,7 +1412,7 @@ begin if (Index<0) or (Index>=fPageList.Count) then Exit; FPagesBar.UnFocusButton(Index); - //UpdateDesignerFlags(Index); + UpdateDesignerFlags(Index); with TGradTabPage(FPageList.Items[Index]) do Visible:=false; diff --git a/components/gradcontrols/src/urotatebitmap.pas b/components/gradcontrols/src/urotatebitmap.pas index df9c73e16..06bb31a5c 100644 --- a/components/gradcontrols/src/urotatebitmap.pas +++ b/components/gradcontrols/src/urotatebitmap.pas @@ -1,475 +1,333 @@ -unit urotatebitmap; +unit uRotateBitmap; {$mode objfpc}{$H+} interface uses - Classes, SysUtils, Graphics, Buttons, LCLType, - IntfGraphics, fpImage, LCLIntf, Types; - + Classes, SysUtils, Graphics, Buttons, LCLType, IntfGraphics, Types; + type - TRotateDirection = (rdRight, rdNormal, rdLeft); - TRotatedBitmap = class( TObject ) - private - FNormalImage, FRotatedImage : TLazIntfImage; - FRotateTo : TRotateDirection; - function GetBitmap : TBitmap; - procedure SetRotateTo(const Value : TRotateDirection); - procedure DoRotate; - protected - function GetWidth : Integer; - function GetHeight : Integer; - public - constructor Create; virtual; - destructor Destroy; override; - procedure Free; - procedure LoadBitmap(var b : TBitmap); - //property Bitmap : TBitmap read GetBitmap; - property Image : TLazIntfImage read FRotatedImage; - property RotateDirection : TRotateDirection read FRotateTo write SetRotateTo; - procedure Draw(X,Y: Integer;var b : TBitmap); virtual; - procedure Draw(X,Y: Integer;var b : TLazIntfImage); virtual; - procedure Draw(X,Y: Integer;var b : TBitmap; - TransparentColor : TColor); virtual; - procedure Draw(X,Y: Integer;var b : TLazIntfImage; - TransparentColor : TFPColor); virtual; - property Width : Integer read GetWidth; - property Height : Integer read GetHeight; - end; + TRotateDirection = (rdNormal, rdRight, rdLeft); - TRotatedGlyph = class(TRotatedBitmap) - private - FNormalGlyphBitmap : TBitmap; - FNormalGlyph : TButtonGlyph; - FTransparentColor : TColor; - FButtonState : TButtonState; - function GetGlyph : TBitmap; - procedure SetGlyph(Value: TBitmap); - procedure SetButtonState(Value: TButtonState); - procedure SetTransparentColor(Value: TColor); - public - constructor Create; override; - destructor Destroy; override; - procedure Draw(X,Y: Integer;var b : TBitmap; - TransparentColor : TColor); override; - procedure Draw(X, Y: Integer; var b: TLazIntfImage; - TransparentColor: TFPColor); override; - procedure Update; - property State : TButtonState read FButtonState write SetButtonState; - property Glyph : TBitmap read GetGlyph write SetGlyph; - property TransparentColor: TColor read FTransparentColor write SetTransparentColor; - end; + { TCustomRotatedBitmap } - TRotatedText = class(TRotatedBitmap) - private - FBitmap : TBitmap; - FText : String; - procedure SetText(const Value: String); - function GetCanvas : TCanvas; - procedure PaintText; - public - constructor Create; override; - destructor Destroy; override; - procedure Update; - property Text : String read FText write SetText; - property Canvas : TCanvas read GetCanvas; - procedure Draw(X,Y: Integer;var b : TBitmap); override; - procedure Draw(X,Y: Integer;var b : TLazIntfImage); override; - end; + TCustomRotatedBitmap = class + private + FActiveBitmap: TBitmap; + FDirection: TRotateDirection; + FNormalBitmap: TBitmap; + FRotatedBitmap: TBitmap; + FTransparent: Boolean; + FActiveBitmapNeedsUpdate: Boolean; + function GetBitmap : TBitmap; + function GetEmpty: Boolean; + procedure NormalBitmapChanged(Sender: TObject); + procedure SetBitmap(const AValue: TBitmap); + procedure SetDirection(const AValue: TRotateDirection); + procedure SetTransparent(const AValue: Boolean); + procedure UpdateActiveBitmap; virtual; + protected + procedure NotifyBitmapChange; virtual; + function GetWidth: Integer; virtual; + function GetHeight: Integer; virtual; + property Bitmap: TBitmap read GetBitmap write SetBitmap; + property Transparent: Boolean read FTransparent write SetTransparent; + public + constructor Create; virtual; + destructor Destroy; override; + procedure Draw(Canvas: TCanvas; X, Y: Integer); virtual; + function IsBitmapStored : Boolean; + property Direction: TRotateDirection read FDirection write SetDirection; + property Empty: Boolean read GetEmpty; + property Width: Integer read GetWidth; + property Height: Integer read GetHeight; + end; - operator := (const b : TBitmap) : TLazIntfImage; - operator := (const i : TLazIntfImage) : TBitmap; + { TRotatedBitmap } + + TRotatedBitmap = class (TCustomRotatedBitmap) + public + property Bitmap; + property Transparent; + end; + + { TRotatedGlyph } + + TRotatedGlyph = class (TCustomRotatedBitmap) + private + FGlyph : TButtonGlyph; + FButtonState : TButtonState; + FOnChange: TNotifyEvent; + procedure SetButtonState(Value: TButtonState); + procedure UpdateActiveBitmap; override; + protected + procedure NotifyBitmapChange; override; + public + constructor Create; override; + destructor Destroy; override; + procedure Draw(Canvas: TCanvas; X, Y: Integer); override; + property OnChange: TNotifyEvent read FOnChange write FOnChange; + property State: TButtonState read FButtonState write SetButtonState; + property Bitmap; + property Transparent; + end; + + { TRotatedText } + + TRotatedText = class (TCustomRotatedBitmap) + private + FText : String; + procedure SetFont(const AValue: TFont); + procedure SetText(const Value: String); + procedure UpdateText; + protected + public + constructor Create; override; + property Font: TFont write SetFont; + property Text: String read FText write SetText; + end; + +function CreateRotatedBitmap(SrcImage: TRasterImage; Direction: TRotateDirection): TBitmap; implementation uses - LCLProc; + LCLProc; + +function CreateRotatedBitmap(SrcImage: TRasterImage; Direction: TRotateDirection): TBitmap; +var + px, py, nx, ny : Integer; + RotateImg, NormalImg: TLazIntfImage; + ImageHandle, MaskHandle: HBITMAP; +begin + NormalImg := SrcImage.CreateIntfImage; + + RotateImg := TLazIntfImage.Create(NormalImg.Height, NormalImg.Width); + RotateImg.DataDescription := GetDescriptionFromDevice(0, NormalImg.Height, NormalImg.Width); + + for px := 0 to NormalImg.Width - 1 do + for py := 0 to NormalImg.Height - 1 do + begin + if Direction = rdRight then + begin + nx := RotateImg.Width - 1 - py; + ny := px; + end else begin + nx := py; + ny := RotateImg.Height - 1 - px; + end; + + RotateImg.Colors[nx, ny] := NormalImg.Colors[px, py]; + end; + + Result := TBitmap.Create; + + //todo: Set mask manually and than create the mask handle here + //LoadFromIntfImage always create a mask leading to wrong display + RotateImg.CreateBitmaps(ImageHandle, MaskHandle, True); + Result.SetHandles(ImageHandle, MaskHandle); + if SrcImage.MaskHandleAllocated then + begin + //Calling TransparentMode and than TransparentColor creates the mask twice + //Set TransparentColor and call Mask + Result.TransparentColor := SrcImage.TransparentColor; + Result.Mask(SrcImage.TransparentColor); + end; + + RotateImg.Free; + NormalImg.Free; +end; + +{ TCustomRotatedBitmap } + +function TCustomRotatedBitmap.GetBitmap: TBitmap; +begin + Result := FNormalBitmap; +end; + +function TCustomRotatedBitmap.GetEmpty: Boolean; +begin + Result := (FNormalBitmap.Width = 0) or (FNormalBitmap.Height = 0); +end; + +procedure TCustomRotatedBitmap.NormalBitmapChanged(Sender: TObject); +begin + FActiveBitmapNeedsUpdate := True; + NotifyBitmapChange; +end; + +procedure TCustomRotatedBitmap.SetBitmap(const AValue: TBitmap); +begin + FNormalBitmap.Assign(AValue); + FActiveBitmapNeedsUpdate := True; +end; + +procedure TCustomRotatedBitmap.SetDirection(const AValue: TRotateDirection); +begin + if FDirection = AValue then + Exit; + FDirection := AValue; + FActiveBitmapNeedsUpdate := True; +end; + +procedure TCustomRotatedBitmap.SetTransparent(const AValue: Boolean); +begin + if FTransparent = AValue then exit; + FTransparent := AValue; + FActiveBitmap.Transparent := FTransparent; +end; + +procedure TCustomRotatedBitmap.UpdateActiveBitmap; +begin + FreeAndNil(FRotatedBitmap); + if FDirection = rdNormal then + FActiveBitmap := FNormalBitmap + else + begin + FRotatedBitmap := CreateRotatedBitmap(FNormalBitmap, FDirection); + FActiveBitmap := FRotatedBitmap; + end; + FActiveBitmap.Transparent := FTransparent; + FActiveBitmapNeedsUpdate := False; +end; + +procedure TCustomRotatedBitmap.NotifyBitmapChange; +begin + +end; + +function TCustomRotatedBitmap.GetWidth: Integer; +begin + if FActiveBitmapNeedsUpdate then + UpdateActiveBitmap; + Result := FActiveBitmap.Width; +end; + +function TCustomRotatedBitmap.GetHeight: Integer; +begin + if FActiveBitmapNeedsUpdate then + UpdateActiveBitmap; + Result := FActiveBitmap.Height; +end; + +constructor TCustomRotatedBitmap.Create; +begin + FDirection := rdNormal; + FNormalBitmap := TBitmap.Create; + FNormalBitmap.OnChange := @NormalBitmapChanged; + FActiveBitmap := FNormalBitmap; +end; + +destructor TCustomRotatedBitmap.Destroy; +begin + FNormalBitmap.Destroy; + FRotatedBitmap.Free; +end; + +procedure TCustomRotatedBitmap.Draw(Canvas: TCanvas; X, Y: Integer); +begin + if FActiveBitmapNeedsUpdate then + UpdateActiveBitmap; + Canvas.Draw(X, Y, FActiveBitmap); +end; + +function TCustomRotatedBitmap.IsBitmapStored : Boolean; +begin + Result := (not FActiveBitmap.Empty) + and (FActiveBitmap.Width>0) and (FActiveBitmap.Height>0); +end; + +{ TRotatedGlyph } + +procedure TRotatedGlyph.SetButtonState(Value: TButtonState); +begin + FButtonState := Value; +end; + +procedure TRotatedGlyph.UpdateActiveBitmap; +begin + inherited UpdateActiveBitmap; + FGlyph.Glyph := FActiveBitmap; +end; + +procedure TRotatedGlyph.NotifyBitmapChange; +begin + if Assigned(FOnChange) then + FOnChange(Self); +end; constructor TRotatedGlyph.Create; begin - inherited; - - FNormalGlyph := TButtonGlyph.Create; - //FNormalGlyph.SetTransparentMode(gtmTransparent); - - FTransparentColor:=clFuchsia; - FNormalGlyphBitmap := TBitmap.Create; - - FButtonState := bsUp; + inherited Create; + FGlyph := TButtonGlyph.Create; end; destructor TRotatedGlyph.Destroy; begin - DebugLn('TRotatedGlyph.Destroy'); - DebugLn('FNormalGlyph.Free Assigned: %s',[BoolToStr(Assigned(FNormalGlyph),true)]); - if Assigned(FNormalGlyph) then FNormalGlyph.Free; - DebugLn('FNormalGlyphBitmap.Free Assigned: %s',[BoolToStr(Assigned(FNormalGlyphBitmap),true)]); - if Assigned(FNormalGlyphBitmap) then FNormalGlyphBitmap.Free; - - DebugLn('Inherited'); - inherited; + FGlyph.Destroy; + inherited Destroy; end; -procedure TRotatedGlyph.SetTransparentColor(Value: TColor); -begin - FTransparentColor:=Value; - - Update; -end; - -function TRotatedGlyph.GetGlyph : TBitmap; -begin - Result := FNormalGlyphBitmap; -end; - -procedure TRotatedGlyph.SetGlyph(Value: TBitmap); -begin - FNormalGlyphBitmap.Assign(Value); - //FNormalGlyph.Glyph.TransparentMode:=tmFixed; - //FNormalGlyph.Glyph.Transparent:=true; - - Update; -end; - -procedure TRotatedGlyph.SetButtonState(Value: TButtonState); -begin - FButtonState:=Value; - - Update; -end; - -procedure TRotatedGlyph.Update; +procedure TRotatedGlyph.Draw(Canvas: TCanvas; X, Y: Integer); var - TempBitmap : TBitmap; - SrcIntf, TrgIntf : TLazIntfImage; - i, j : Integer; + R: TRect; + P: TPoint; begin - TempBitmap := TBitmap.Create; - TempBitmap.Width:=FNormalGlyphBitmap.Width; - TempBitmap.Height:=FNormalGlyphBitmap.Height; - - TempBitmap.Canvas.Brush.Color:=clNone; - TempBitmap.Canvas.FillRect(0,0,TempBitmap.Width,TempBitmap.Height); - - SrcIntf := FNormalGlyphBitmap; - - TrgIntf := TempBitmap; - {TmpIntf.DataDescription := GetDescriptionFromDevice(0); - TmpIntf.SetSize(TempBitmap.Width, TempBitmap.Height); - } - - for i := 0 to TempBitmap.Width-1 do - for j := 0 to TempBitmap.Height-1 do - if SrcIntf.Colors[i,j] <> TColorToFPColor(FTransparentColor) then - TrgIntf.Colors[i,j] := SrcIntf.Colors[i,j]; - - {FNormalGlyph.Draw(TempBitmap.Canvas,Rect(0,0,TempBitmap.Width,TempBitmap.Height), - Point(0,0), FButtonState, true, 0); - } - - TempBitmap.Free; - - TempBitmap := TrgIntf; - - LoadBitmap(TempBitmap); - - TempBitmap.Free; - TrgIntf.Free; - SrcIntf.Free; + if FActiveBitmapNeedsUpdate then + UpdateActiveBitmap; + R := Rect(0, 0, FActiveBitmap.Width, FActiveBitmap.Height); + P := Point(X, Y); + FGlyph.Draw(Canvas, R, P, FButtonState, Transparent, 0); end; -procedure TRotatedGlyph.Draw(X,Y: Integer;var b : TBitmap; - TransparentColor : TColor); -var - Temp : TLazIntfImage; +{ TRotatedText } + +procedure TRotatedText.SetText(const Value: String); begin - Temp := b; - b.Free; - Draw(X,Y,Temp, TColorToFPColor(TransparentColor)); - b := Temp; - Temp.Free; + if Value = FText then + Exit; + FText := Value; + UpdateText; end; -procedure TRotatedGlyph.Draw(X, Y: Integer; var b: TLazIntfImage; - TransparentColor: TFPColor); -var - TempBitmap,Trg : TBitmap; +procedure TRotatedText.SetFont(const AValue: TFont); begin - Trg := TBitmap.Create; + FNormalBitmap.Canvas.Font := AValue; + UpdateText; +end; - //First Rotate the Glyph then Draw it with an other State - inherited Draw(X,Y,b,TransparentColor); - - TempBitmap := b; - b.Free; - - Trg.Width:=b.Width; - Trg.Height:=b.Height; - - FNormalGlyph.Glyph.Assign(TempBitmap); - - FNormalGlyph.Draw(Trg.Canvas,Rect(0,0,Trg.Width,Trg.Height), - Point(0,0), FButtonState, true, 0); - - b := Trg; - - Trg.Free; - TempBitmap.Free; +procedure TRotatedText.UpdateText; +var + TextSize : TSize; +begin + //todo: handle font + with FNormalBitmap, Canvas do + begin + TextSize := TextExtent(FText); + {$if defined(LCLWin32) or defined (LCLQt)} + //win32 and Qt does not comput correct text extent when Italic style is set. + //gtk1/2 does not support Italic at all + if fsItalic in Font.Style then + Inc(TextSize.cx, 4); + {$endif} + SetSize(TextSize.cx, TextSize.cy); + if Font.Color <> clFuchsia then + Brush.Color := clFuchsia + else + Brush.Color := clWhite; + FillRect(0, 0, FNormalBitmap.Width, FNormalBitmap.Height); + TextOut(0, 0, FText); + Mask(Brush.Color); + end; + //FActiveBitmapNeedsUpdate := True; end; constructor TRotatedText.Create; begin - inherited; - - FBitmap := TBitmap.Create; - FText:='X'; - SetText(''); -end; - -destructor TRotatedText.Destroy; -begin - FBitmap.Free; - - inherited; -end; - -procedure TRotatedText.Update; -begin - PaintText; -end; - -procedure TRotatedText.SetText(const Value: String); -begin - if FText <> Value then - begin - FText:=Value; - - PaintText; - end; -end; - -function TRotatedText.GetCanvas : TCanvas; -begin - Result := FBitmap.Canvas; -end; - -procedure TRotatedText.PaintText; -var - TextSize : TSize; -begin - TextSize := FBitmap.Canvas.TextExtent(FText); - - {$ifdef LCLWin32} - //win32 does not comput correct text extent when Italic style is set. - //small workaround to this bug - //not sure if other widgetsets alsoa have this bug. Enable it only for win32 for now - if fsItalic in FBitmap.Canvas.Font.Style then - Inc(TextSize.cx, 4); - {$endif} - FBitmap.SetSize(TextSize.cx, TextSize.cy); - - //check to allow Text with Fuchsia color - if FBitmap.Canvas.Font.Color = clFuchsia then - FBitmap.Canvas.Brush.Color := clWhite - else - FBitmap.Canvas.Brush.Color := clFuchsia; - - FBitmap.Canvas.FillRect(0,0, FBitmap.Width, FBitmap.Height); - - FBitmap.Canvas.TextOut(0,0, FText); - - Inherited LoadBitmap(FBitmap); -end; - -procedure TRotatedText.Draw(X,Y: Integer;var b : TBitmap); -begin - Inherited Draw(X,Y,b,FBitmap.Canvas.Brush.Color); -end; - -procedure TRotatedText.Draw(X,Y: Integer;var b : TLazIntfImage); -begin - Inherited Draw(X,Y,b,TColorToFPColor(FBitmap.Canvas.Brush.Color)); -end; - -operator := (const b : TBitmap) : TLazIntfImage; -begin - Result := TLazIntfImage.Create(0,0); - Result.LoadFromBitmap(b.Handle,b.MaskHandle); -end; - -operator := (const i : TLazIntfImage) : TBitmap; -begin - Result := TBitmap.Create; - Result.LoadFromIntfImage(i); -end; - -constructor TRotatedBitmap.Create; -begin - //inherited; - - FRotateTo:=rdNormal; -end; - -destructor TRotatedBitmap.Destroy; -begin - DebugLn('Destroy'); - if Assigned(FNormalImage) then FNormalImage.Free; - if Assigned(FRotatedImage) then FRotatedImage.Free; -end; - -procedure TRotatedBitmap.Free; -begin - inherited; - //if Self<>nil then - //Self.Destroy; -end; - -function TRotatedBitmap.GetBitmap : TBitmap; -var - TempIntf : TLazIntfImage; -begin - if FRotateTo = rdNormal then - TempIntf := FNormalImage - else - TempIntf := FRotatedImage; - - if Assigned(TempIntf) then - Result := TempIntf; -end; - -procedure TRotatedBitmap.SetRotateTo(const Value : TRotateDirection); -begin - //WriteLn(FRotateTo<>Value); - if FRotateTo<>Value then - begin - //WriteLn('SetRotateTo'); - FRotateTo:=Value; - - DoRotate; - end; -end; - -procedure TRotatedBitmap.LoadBitmap(var b : TBitmap); -begin - if FNormalImage <> nil then FNormalImage.Free; - - if FRotatedImage = nil then begin - FRotatedImage := TLazIntfImage.Create(0,0); - FRotatedImage.DataDescription := GetDescriptionFromDevice(0); - end; - - DebugLn('Assigned: B',BoolToStr(Assigned(FNormalImage),true)); - FNormalImage := b; - //FNormalImage := TLazIntfImage.Create(0,0); - DebugLn('Assigned: A',BoolToStr(Assigned(FNormalImage),true)); - - if FRotateTo <> rdNormal then DoRotate; -end; - -procedure TRotatedBitmap.DoRotate; -var - px, py, iw, ih, nx, ny : Integer; - CurColor: TFPColor; -begin - if FRotateTo=rdNormal then Exit; - - {if Assigned(FRotatedImage) then - FRotatedImage.Free; - - FRotatedImage := TLazIntfImage.Create(0,0); - - FRotatedImage.DataDescription := GetDescriptionFromDevice(0); - } - FRotatedImage.SetSize({FNormalImage.Width,FNormalImage.Height} - FNormalImage.Height,FNormalImage.Width); - - FRotatedImage.FillPixels(colWhite); - - //WriteLn(FRotatedImage.Width, ' ', FRotatedImage.Height); - - for px := 0 to FNormalImage.Width-1 do - for py := 0 to FNormalImage.Height-1 do - begin - if FRotateTo = rdRight then - begin - nx := FRotatedImage.Width-1-py; - ny := px; - end else begin - nx := py; - ny := FRotatedImage.Height-1-px; - end; - - //WriteLn(nx, ' ', ny, ' ', px, ' ', py); - - CurColor := FNormalImage.Colors[px,py]; - - FRotatedImage.Colors[nx,ny]:= CurColor; - end; -end; - -procedure TRotatedBitmap.Draw(X,Y: Integer;var b : TBitmap); -begin - Draw(X,Y,b,clNone); -end; - -procedure TRotatedBitmap.Draw(X,Y: Integer;var b : TLazIntfImage); -begin - Draw(X,Y,b,TColorToFPColor(clNone)); -end; - -procedure TRotatedBitmap.Draw(X,Y: Integer;var b : TBitmap; TransparentColor : TColor); -var - TempIntfImage : TLazIntfImage; -begin - TempIntfImage := b; - b.Free; - Draw(X,Y, TempIntfImage, TColorToFPColor(TransparentColor)); - b := TempIntfImage; - TempIntfImage.Free; -end; - -procedure TRotatedBitmap.Draw(X,Y: Integer;var b : TLazIntfImage; TransparentColor : TFPColor); -var - px, py : Integer; - TempIntf : TLazIntfImage; -begin - if FRotateTo = rdNormal then - TempIntf := FNormalImage - else - TempIntf := FRotatedImage; - - //WriteLn(Assigned(FNormalImage)); - //WriteLn(Assigned(FRotatedImage)); - - for px := 0 to TempIntf.Width-1 do - for py := 0 to TempIntf.Height-1 do - if (TempIntf.Colors[px,py] <> TransparentColor) - AND ((X+px) < b.Width) AND ((Y+py) < b.Height) - AND ((X+px) >= 0) AND ((Y+py) >= 0) then - begin - //WriteLn(px, ' ', py); - b.Colors[X+px,Y+py]:=TempIntf.Colors[px,py]; - end; -end; - -function TRotatedBitmap.GetWidth : Integer; -begin - Result := -1; - if (FRotateTo = rdNormal) AND Assigned(FNormalImage) then - Result := FNormalImage.Width - else if Assigned(FRotatedImage) then - Result := FRotatedImage.Width; -end; - -function TRotatedBitmap.GetHeight : Integer; -begin - Result := -1; - if (FRotateTo = rdNormal) AND Assigned(FNormalImage) then - Result := FNormalImage.Height - else if Assigned(FRotatedImage) then - Result := FRotatedImage.Height; + inherited Create; + Transparent := True; end; end.