fix work TToolBar in latest lazarus

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1180 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
alexs75
2010-03-15 17:56:12 +00:00
parent 990689bb63
commit 5bccf8036a
5 changed files with 189 additions and 126 deletions

View File

@ -2,8 +2,10 @@
<fpdoc-descriptions> <fpdoc-descriptions>
<package name="dcl_rx_fpc"> <package name="dcl_rx_fpc">
<short>Пакет времени разработки</short> <short>Пакет времени разработки</short>
<descr>Данный пакет содержит в себе вспомогательные классы и утилиты, которые необходимы во время разработки программы. <descr>
Все эти данные не испошльзуются во время работы готовой программы, поэтому этот код е включается в финальнуе версии программ</descr> <p>Данный пакет содержит в себе вспомогательные классы и утилиты, которые необходимы во время разработки программы.</p>
<p>Все эти данные не используются во время работы готовой программы, поэтому этот код не включается в финальные версии программ.</p>
</descr>
</package> </package>
<package name="rxfpc"> <package name="rxfpc">
<module name="rxdbgrid"> <module name="rxdbgrid">
@ -154,6 +156,7 @@
<link id="TRxDBGrid">RxDBGrid</link>-а.</p> <link id="TRxDBGrid">RxDBGrid</link>-а.</p>
</descr> </descr>
</element> </element>
@ -550,6 +553,7 @@
<link id="TRxDBGrid">RxDBGrid</link>-а.</p> <link id="TRxDBGrid">RxDBGrid</link>-а.</p>
</descr> </descr>
<seealso> <seealso>
@ -1096,6 +1100,7 @@ TRxDBCalcEdit является наследником TDBCalcEdit и имеет
<b>Count</b> <b>Count</b>
@ -1140,6 +1145,7 @@ TRxDBCalcEdit является наследником TDBCalcEdit и имеет
<b>Execute</b> и по содержимому которого будет произведено заполнение массива Files</descr> <b>Execute</b> и по содержимому которого будет произведено заполнение массива Files</descr>
@ -2380,6 +2386,7 @@ Description
<b>const</b> SearchDomain, FileName: <b>const</b> SearchDomain, FileName:
@ -2395,6 +2402,7 @@ Description
<b>String</b>; <b>String</b>;
@ -2410,6 +2418,7 @@ Description
<b>out</b> UserName, DomainName: <b>out</b> UserName, DomainName:
@ -2425,6 +2434,7 @@ Description
<b>String</b>); <b>String</b>);
</p> </p>
<p>Процедура возвращает имя и домен пользователя операционной системы владельца указанного файла. </p> <p>Процедура возвращает имя и домен пользователя операционной системы владельца указанного файла. </p>
@ -2457,6 +2467,7 @@ Description
<b>const</b> DirName: <b>const</b> DirName:
@ -2466,6 +2477,7 @@ Description
<b>string</b>): <b>string</b>):
@ -2475,6 +2487,7 @@ Description
<b>string</b>;</p> <b>string</b>;</p>
<p>Функция проверяет все разделители каталогов в указанном имени файла/каталога и, если нужно, меняет их на значение константы<b>DirectorySeparator</b>.</p> <p>Функция проверяет все разделители каталогов в указанном имени файла/каталога и, если нужно, меняет их на значение константы<b>DirectorySeparator</b>.</p>
</descr> </descr>
@ -2498,6 +2511,7 @@ Description
<b>string</b>;</p> <b>string</b>;</p>
<p>Функция <b>GetUserName</b> возвращает имя оператора, залогиненго в системе</p> <p>Функция <b>GetUserName</b> возвращает имя оператора, залогиненго в системе</p>
</descr> </descr>

View File

@ -2400,10 +2400,21 @@ var
P:TBookmark; P:TBookmark;
DS:TDataSet; DS:TDataSet;
i:integer; i:integer;
// J:integer; APresent:boolean;
begin begin
if (not ((rdgFooterRows in OptionsRx) and DatalinkActive)) or (Columns.Count = 0) then if (not ((rdgFooterRows in OptionsRx) and DatalinkActive)) or (Columns.Count = 0) then
Exit; Exit;
//Дополнительно проверим - а стоит ли делать пробег по данным - есть ли агрегатные функции
APresent:=false;
for i:=0 to Columns.Count - 1 do
begin
APresent:=TRxColumn(Columns[i]).Footer.FValueType in [fvtSum, fvtAvg, fvtMax, fvtMin];
if APresent then break;
end;
if not APresent then
exit;
inc(FInProcessCalc); inc(FInProcessCalc);
DS:=DataSource.DataSet;; DS:=DataSource.DataSet;;
P := Ds.GetBookMark; P := Ds.GetBookMark;

View File

@ -2,11 +2,11 @@ object ToolPanelSetupForm: TToolPanelSetupForm
Left = 383 Left = 383
Height = 487 Height = 487
Top = 176 Top = 176
Width = 659 Width = 657
ActiveControl = PageControl1 ActiveControl = PageControl1
Caption = 'Tool panel setup' Caption = 'Tool panel setup'
ClientHeight = 487 ClientHeight = 487
ClientWidth = 659 ClientWidth = 657
FormStyle = fsStayOnTop FormStyle = fsStayOnTop
OnClose = FormClose OnClose = FormClose
OnCreate = FormCreate OnCreate = FormCreate
@ -18,7 +18,7 @@ object ToolPanelSetupForm: TToolPanelSetupForm
Left = 0 Left = 0
Height = 435 Height = 435
Top = 0 Top = 0
Width = 659 Width = 657
ActivePage = TabSheet1 ActivePage = TabSheet1
Align = alClient Align = alClient
TabIndex = 0 TabIndex = 0
@ -26,15 +26,15 @@ object ToolPanelSetupForm: TToolPanelSetupForm
object TabSheet1: TTabSheet object TabSheet1: TTabSheet
Caption = 'Visible buttons' Caption = 'Visible buttons'
ClientHeight = 404 ClientHeight = 404
ClientWidth = 655 ClientWidth = 653
object Label1: TLabel object Label1: TLabel
AnchorSideLeft.Control = BitBtn3 AnchorSideLeft.Control = BitBtn3
AnchorSideLeft.Side = asrBottom AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = TabSheet1 AnchorSideTop.Control = TabSheet1
Left = 355 Left = 350
Height = 18 Height = 18
Top = 6 Top = 6
Width = 117 Width = 118
BorderSpacing.Around = 6 BorderSpacing.Around = 6
Caption = 'Avaliable buttons' Caption = 'Avaliable buttons'
FocusControl = ListBtnAvaliable FocusControl = ListBtnAvaliable
@ -45,7 +45,7 @@ object ToolPanelSetupForm: TToolPanelSetupForm
Left = 8 Left = 8
Height = 18 Height = 18
Top = 6 Top = 6
Width = 103 Width = 102
BorderSpacing.Around = 6 BorderSpacing.Around = 6
Caption = 'Visible buttons' Caption = 'Visible buttons'
FocusControl = ListBtnVisible FocusControl = ListBtnVisible
@ -57,10 +57,10 @@ object ToolPanelSetupForm: TToolPanelSetupForm
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = BitBtn6 AnchorSideRight.Control = BitBtn6
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 306 Left = 309
Height = 30 Height = 30
Top = 152 Top = 148
Width = 43 Width = 35
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 6 BorderSpacing.Top = 6
BorderSpacing.InnerBorder = 2 BorderSpacing.InnerBorder = 2
@ -75,10 +75,10 @@ object ToolPanelSetupForm: TToolPanelSetupForm
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = BitBtn6 AnchorSideRight.Control = BitBtn6
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 306 Left = 309
Height = 33 Height = 31
Top = 113 Top = 111
Width = 43 Width = 35
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
AutoSize = True AutoSize = True
BorderSpacing.Top = 6 BorderSpacing.Top = 6
@ -94,10 +94,10 @@ object ToolPanelSetupForm: TToolPanelSetupForm
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = BitBtn6 AnchorSideRight.Control = BitBtn6
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 306 Left = 309
Height = 38 Height = 38
Top = 69 Top = 67
Width = 43 Width = 35
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 6 BorderSpacing.Top = 6
BorderSpacing.InnerBorder = 2 BorderSpacing.InnerBorder = 2
@ -110,10 +110,10 @@ object ToolPanelSetupForm: TToolPanelSetupForm
AnchorSideLeft.Control = TabSheet1 AnchorSideLeft.Control = TabSheet1
AnchorSideLeft.Side = asrCenter AnchorSideLeft.Side = asrCenter
AnchorSideTop.Control = ListBtnAvaliable AnchorSideTop.Control = ListBtnAvaliable
Left = 306 Left = 309
Height = 33 Height = 31
Top = 30 Top = 30
Width = 43 Width = 35
AutoSize = True AutoSize = True
BorderSpacing.InnerBorder = 2 BorderSpacing.InnerBorder = 2
Caption = '>>' Caption = '>>'
@ -129,10 +129,10 @@ object ToolPanelSetupForm: TToolPanelSetupForm
AnchorSideRight.Control = TabSheet1 AnchorSideRight.Control = TabSheet1
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
AnchorSideBottom.Control = cbShowCaption AnchorSideBottom.Control = cbShowCaption
Left = 355 Left = 350
Height = 275 Height = 275
Top = 30 Top = 30
Width = 294 Width = 297
Anchors = [akTop, akLeft, akRight, akBottom] Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Around = 6 BorderSpacing.Around = 6
Items.Strings = ( Items.Strings = (
@ -159,7 +159,7 @@ object ToolPanelSetupForm: TToolPanelSetupForm
Left = 14 Left = 14
Height = 275 Height = 275
Top = 30 Top = 30
Width = 286 Width = 289
Anchors = [akTop, akLeft, akRight, akBottom] Anchors = [akTop, akLeft, akRight, akBottom]
BorderSpacing.Around = 6 BorderSpacing.Around = 6
ItemHeight = 0 ItemHeight = 0
@ -175,7 +175,7 @@ object ToolPanelSetupForm: TToolPanelSetupForm
Left = 3 Left = 3
Height = 62 Height = 62
Top = 336 Top = 336
Width = 643 Width = 641
Alignment = taLeftJustify Alignment = taLeftJustify
Anchors = [akLeft, akRight, akBottom] Anchors = [akLeft, akRight, akBottom]
BorderSpacing.Around = 6 BorderSpacing.Around = 6
@ -189,7 +189,7 @@ object ToolPanelSetupForm: TToolPanelSetupForm
Left = 6 Left = 6
Height = 19 Height = 19
Top = 311 Top = 311
Width = 113 Width = 112
Anchors = [akLeft, akBottom] Anchors = [akLeft, akBottom]
BorderSpacing.Around = 6 BorderSpacing.Around = 6
Caption = 'Show caption' Caption = 'Show caption'
@ -200,14 +200,14 @@ object ToolPanelSetupForm: TToolPanelSetupForm
object TabSheet2: TTabSheet object TabSheet2: TTabSheet
Caption = 'Options' Caption = 'Options'
ClientHeight = 404 ClientHeight = 404
ClientWidth = 655 ClientWidth = 653
object cbShowHint: TCheckBox object cbShowHint: TCheckBox
AnchorSideLeft.Control = TabSheet2 AnchorSideLeft.Control = TabSheet2
AnchorSideTop.Control = cbTransp AnchorSideTop.Control = cbTransp
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
Left = 6 Left = 6
Height = 19 Height = 19
Top = 159 Top = 148
Width = 88 Width = 88
BorderSpacing.Around = 6 BorderSpacing.Around = 6
Caption = 'Show hint' Caption = 'Show hint'
@ -219,8 +219,8 @@ object ToolPanelSetupForm: TToolPanelSetupForm
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
Left = 6 Left = 6
Height = 19 Height = 19
Top = 134 Top = 123
Width = 102 Width = 101
BorderSpacing.Around = 6 BorderSpacing.Around = 6
Caption = 'Transparent' Caption = 'Transparent'
TabOrder = 1 TabOrder = 1
@ -231,8 +231,8 @@ object ToolPanelSetupForm: TToolPanelSetupForm
AnchorSideTop.Side = asrBottom AnchorSideTop.Side = asrBottom
Left = 6 Left = 6
Height = 19 Height = 19
Top = 109 Top = 98
Width = 102 Width = 101
BorderSpacing.Around = 6 BorderSpacing.Around = 6
Caption = 'Flat buttons' Caption = 'Flat buttons'
TabOrder = 2 TabOrder = 2
@ -243,12 +243,13 @@ object ToolPanelSetupForm: TToolPanelSetupForm
AnchorSideTop.Control = TabSheet2 AnchorSideTop.Control = TabSheet2
AnchorSideRight.Control = TabSheet2 AnchorSideRight.Control = TabSheet2
AnchorSideRight.Side = asrBottom AnchorSideRight.Side = asrBottom
Left = 335 Left = 334
Height = 97 Height = 86
Top = 6 Top = 6
Width = 314 Width = 313
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
AutoFill = False AutoFill = False
AutoSize = True
BorderSpacing.Around = 6 BorderSpacing.Around = 6
Caption = 'Button align' Caption = 'Button align'
ChildSizing.LeftRightSpacing = 6 ChildSizing.LeftRightSpacing = 6
@ -257,8 +258,8 @@ object ToolPanelSetupForm: TToolPanelSetupForm
ChildSizing.ShrinkVertical = crsScaleChilds ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1 ChildSizing.ControlsPerLine = 1
ClientHeight = 76 ClientHeight = 69
ClientWidth = 306 ClientWidth = 313
Items.Strings = ( Items.Strings = (
'None' 'None'
'Left' 'Left'
@ -272,9 +273,9 @@ object ToolPanelSetupForm: TToolPanelSetupForm
AnchorSideTop.Control = TabSheet2 AnchorSideTop.Control = TabSheet2
AnchorSideRight.Control = Panel2 AnchorSideRight.Control = Panel2
Left = 6 Left = 6
Height = 90 Height = 86
Top = 6 Top = 6
Width = 314 Width = 313
Anchors = [akTop, akLeft, akRight] Anchors = [akTop, akLeft, akRight]
AutoFill = True AutoFill = True
AutoSize = True AutoSize = True
@ -289,7 +290,7 @@ object ToolPanelSetupForm: TToolPanelSetupForm
ChildSizing.Layout = cclLeftToRightThenTopToBottom ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1 ChildSizing.ControlsPerLine = 1
ClientHeight = 69 ClientHeight = 69
ClientWidth = 306 ClientWidth = 313
Items.Strings = ( Items.Strings = (
'Standart' 'Standart'
'Windows XP' 'Windows XP'
@ -304,7 +305,7 @@ object ToolPanelSetupForm: TToolPanelSetupForm
AnchorSideTop.Control = TabSheet2 AnchorSideTop.Control = TabSheet2
AnchorSideBottom.Control = TabSheet2 AnchorSideBottom.Control = TabSheet2
AnchorSideBottom.Side = asrBottom AnchorSideBottom.Side = asrBottom
Left = 326 Left = 325
Height = 392 Height = 392
Top = 6 Top = 6
Width = 3 Width = 3
@ -318,7 +319,7 @@ object ToolPanelSetupForm: TToolPanelSetupForm
Left = 6 Left = 6
Height = 40 Height = 40
Top = 441 Top = 441
Width = 647 Width = 645
TabOrder = 1 TabOrder = 1
ShowButtons = [pbClose, pbHelp] ShowButtons = [pbClose, pbHelp]
end end

View File

@ -2,51 +2,51 @@
LazarusResources.Add('TToolPanelSetupForm','FORMDATA',[ LazarusResources.Add('TToolPanelSetupForm','FORMDATA',[
'TPF0'#19'TToolPanelSetupForm'#18'ToolPanelSetupForm'#4'Left'#3#127#1#6'Heigh' 'TPF0'#19'TToolPanelSetupForm'#18'ToolPanelSetupForm'#4'Left'#3#127#1#6'Heigh'
+'t'#3#231#1#3'Top'#3#176#0#5'Width'#3#147#2#13'ActiveControl'#7#12'PageContr' +'t'#3#231#1#3'Top'#3#176#0#5'Width'#3#145#2#13'ActiveControl'#7#12'PageContr'
+'ol1'#7'Caption'#6#16'Tool panel setup'#12'ClientHeight'#3#231#1#11'ClientWi' +'ol1'#7'Caption'#6#16'Tool panel setup'#12'ClientHeight'#3#231#1#11'ClientWi'
+'dth'#3#147#2#9'FormStyle'#7#11'fsStayOnTop'#7'OnClose'#7#9'FormClose'#8'OnC' +'dth'#3#145#2#9'FormStyle'#7#11'fsStayOnTop'#7'OnClose'#7#9'FormClose'#8'OnC'
+'reate'#7#10'FormCreate'#9'OnDestroy'#7#11'FormDestroy'#8'OnResize'#7#10'For' +'reate'#7#10'FormCreate'#9'OnDestroy'#7#11'FormDestroy'#8'OnResize'#7#10'For'
+'mResize'#8'Position'#7#14'poScreenCenter'#10'LCLVersion'#6#6'0.9.29'#0#12'T' +'mResize'#8'Position'#7#14'poScreenCenter'#10'LCLVersion'#6#6'0.9.29'#0#12'T'
+'PageControl'#12'PageControl1'#4'Left'#2#0#6'Height'#3#179#1#3'Top'#2#0#5'Wi' +'PageControl'#12'PageControl1'#4'Left'#2#0#6'Height'#3#179#1#3'Top'#2#0#5'Wi'
+'dth'#3#147#2#10'ActivePage'#7#9'TabSheet1'#5'Align'#7#8'alClient'#8'TabInde' +'dth'#3#145#2#10'ActivePage'#7#9'TabSheet1'#5'Align'#7#8'alClient'#8'TabInde'
+'x'#2#0#8'TabOrder'#2#0#0#9'TTabSheet'#9'TabSheet1'#7'Caption'#6#15'Visible ' +'x'#2#0#8'TabOrder'#2#0#0#9'TTabSheet'#9'TabSheet1'#7'Caption'#6#15'Visible '
+'buttons'#12'ClientHeight'#3#148#1#11'ClientWidth'#3#143#2#0#6'TLabel'#6'Lab' +'buttons'#12'ClientHeight'#3#148#1#11'ClientWidth'#3#141#2#0#6'TLabel'#6'Lab'
+'el1'#22'AnchorSideLeft.Control'#7#7'BitBtn3'#19'AnchorSideLeft.Side'#7#9'as' +'el1'#22'AnchorSideLeft.Control'#7#7'BitBtn3'#19'AnchorSideLeft.Side'#7#9'as'
+'rBottom'#21'AnchorSideTop.Control'#7#9'TabSheet1'#4'Left'#3'c'#1#6'Height'#2 +'rBottom'#21'AnchorSideTop.Control'#7#9'TabSheet1'#4'Left'#3'^'#1#6'Height'#2
+#18#3'Top'#2#6#5'Width'#2'u'#20'BorderSpacing.Around'#2#6#7'Caption'#6#17'Av' +#18#3'Top'#2#6#5'Width'#2'v'#20'BorderSpacing.Around'#2#6#7'Caption'#6#17'Av'
+'aliable buttons'#12'FocusControl'#7#16'ListBtnAvaliable'#11'ParentColor'#8#0 +'aliable buttons'#12'FocusControl'#7#16'ListBtnAvaliable'#11'ParentColor'#8#0
+#0#6'TLabel'#6'Label2'#21'AnchorSideTop.Control'#7#9'TabSheet1'#4'Left'#2#8#6 +#0#6'TLabel'#6'Label2'#21'AnchorSideTop.Control'#7#9'TabSheet1'#4'Left'#2#8#6
+'Height'#2#18#3'Top'#2#6#5'Width'#2'g'#20'BorderSpacing.Around'#2#6#7'Captio' +'Height'#2#18#3'Top'#2#6#5'Width'#2'f'#20'BorderSpacing.Around'#2#6#7'Captio'
+'n'#6#15'Visible buttons'#12'FocusControl'#7#14'ListBtnVisible'#11'ParentCol' +'n'#6#15'Visible buttons'#12'FocusControl'#7#14'ListBtnVisible'#11'ParentCol'
+'or'#8#0#0#7'TBitBtn'#7'BitBtn3'#22'AnchorSideLeft.Control'#7#7'BitBtn6'#21 +'or'#8#0#0#7'TBitBtn'#7'BitBtn3'#22'AnchorSideLeft.Control'#7#7'BitBtn6'#21
+'AnchorSideTop.Control'#7#7'BitBtn4'#18'AnchorSideTop.Side'#7#9'asrBottom'#23 +'AnchorSideTop.Control'#7#7'BitBtn4'#18'AnchorSideTop.Side'#7#9'asrBottom'#23
+'AnchorSideRight.Control'#7#7'BitBtn6'#20'AnchorSideRight.Side'#7#9'asrBotto' +'AnchorSideRight.Control'#7#7'BitBtn6'#20'AnchorSideRight.Side'#7#9'asrBotto'
+'m'#4'Left'#3'2'#1#6'Height'#2#30#3'Top'#3#152#0#5'Width'#2'+'#7'Anchors'#11 +'m'#4'Left'#3'5'#1#6'Height'#2#30#3'Top'#3#148#0#5'Width'#2'#'#7'Anchors'#11
+#5'akTop'#6'akLeft'#7'akRight'#0#17'BorderSpacing.Top'#2#6#25'BorderSpacing.' +#5'akTop'#6'akLeft'#7'akRight'#0#17'BorderSpacing.Top'#2#6#25'BorderSpacing.'
+'InnerBorder'#2#2#7'Caption'#6#2'<<'#9'NumGlyphs'#2#0#7'OnClick'#7#12'BitBtn' +'InnerBorder'#2#2#7'Caption'#6#2'<<'#9'NumGlyphs'#2#0#7'OnClick'#7#12'BitBtn'
+'3Click'#8'TabOrder'#2#0#0#0#7'TBitBtn'#7'BitBtn4'#22'AnchorSideLeft.Control' +'3Click'#8'TabOrder'#2#0#0#0#7'TBitBtn'#7'BitBtn4'#22'AnchorSideLeft.Control'
+#7#7'BitBtn6'#21'AnchorSideTop.Control'#7#7'BitBtn5'#18'AnchorSideTop.Side'#7 +#7#7'BitBtn6'#21'AnchorSideTop.Control'#7#7'BitBtn5'#18'AnchorSideTop.Side'#7
+#9'asrBottom'#23'AnchorSideRight.Control'#7#7'BitBtn6'#20'AnchorSideRight.Si' +#9'asrBottom'#23'AnchorSideRight.Control'#7#7'BitBtn6'#20'AnchorSideRight.Si'
+'de'#7#9'asrBottom'#4'Left'#3'2'#1#6'Height'#2'!'#3'Top'#2'q'#5'Width'#2'+'#7 +'de'#7#9'asrBottom'#4'Left'#3'5'#1#6'Height'#2#31#3'Top'#2'o'#5'Width'#2'#'#7
+'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#8'AutoSize'#9#17'BorderSpacing.' +'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#8'AutoSize'#9#17'BorderSpacing.'
+'Top'#2#6#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#1'<'#9'NumGlyphs'#2 +'Top'#2#6#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#1'<'#9'NumGlyphs'#2
+#0#7'OnClick'#7#12'BitBtn4Click'#8'TabOrder'#2#1#0#0#7'TBitBtn'#7'BitBtn5'#22 +#0#7'OnClick'#7#12'BitBtn4Click'#8'TabOrder'#2#1#0#0#7'TBitBtn'#7'BitBtn5'#22
+'AnchorSideLeft.Control'#7#7'BitBtn6'#21'AnchorSideTop.Control'#7#7'BitBtn6' +'AnchorSideLeft.Control'#7#7'BitBtn6'#21'AnchorSideTop.Control'#7#7'BitBtn6'
+#18'AnchorSideTop.Side'#7#9'asrBottom'#23'AnchorSideRight.Control'#7#7'BitBt' +#18'AnchorSideTop.Side'#7#9'asrBottom'#23'AnchorSideRight.Control'#7#7'BitBt'
+'n6'#20'AnchorSideRight.Side'#7#9'asrBottom'#4'Left'#3'2'#1#6'Height'#2'&'#3 +'n6'#20'AnchorSideRight.Side'#7#9'asrBottom'#4'Left'#3'5'#1#6'Height'#2'&'#3
+'Top'#2'E'#5'Width'#2'+'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#17'Bo' +'Top'#2'C'#5'Width'#2'#'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#17'Bo'
+'rderSpacing.Top'#2#6#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#1'>'#9 +'rderSpacing.Top'#2#6#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#1'>'#9
+'NumGlyphs'#2#0#7'OnClick'#7#12'BitBtn5Click'#8'TabOrder'#2#2#0#0#7'TBitBtn' +'NumGlyphs'#2#0#7'OnClick'#7#12'BitBtn5Click'#8'TabOrder'#2#2#0#0#7'TBitBtn'
+#7'BitBtn6'#22'AnchorSideLeft.Control'#7#9'TabSheet1'#19'AnchorSideLeft.Side' +#7'BitBtn6'#22'AnchorSideLeft.Control'#7#9'TabSheet1'#19'AnchorSideLeft.Side'
+#7#9'asrCenter'#21'AnchorSideTop.Control'#7#16'ListBtnAvaliable'#4'Left'#3'2' +#7#9'asrCenter'#21'AnchorSideTop.Control'#7#16'ListBtnAvaliable'#4'Left'#3'5'
+#1#6'Height'#2'!'#3'Top'#2#30#5'Width'#2'+'#8'AutoSize'#9#25'BorderSpacing.I' +#1#6'Height'#2#31#3'Top'#2#30#5'Width'#2'#'#8'AutoSize'#9#25'BorderSpacing.I'
+'nnerBorder'#2#2#7'Caption'#6#2'>>'#9'NumGlyphs'#2#0#7'OnClick'#7#12'BitBtn6' +'nnerBorder'#2#2#7'Caption'#6#2'>>'#9'NumGlyphs'#2#0#7'OnClick'#7#12'BitBtn6'
+'Click'#8'TabOrder'#2#3#0#0#8'TListBox'#16'ListBtnAvaliable'#22'AnchorSideLe' +'Click'#8'TabOrder'#2#3#0#0#8'TListBox'#16'ListBtnAvaliable'#22'AnchorSideLe'
+'ft.Control'#7#7'BitBtn3'#19'AnchorSideLeft.Side'#7#9'asrBottom'#21'AnchorSi' +'ft.Control'#7#7'BitBtn3'#19'AnchorSideLeft.Side'#7#9'asrBottom'#21'AnchorSi'
+'deTop.Control'#7#6'Label1'#18'AnchorSideTop.Side'#7#9'asrBottom'#23'AnchorS' +'deTop.Control'#7#6'Label1'#18'AnchorSideTop.Side'#7#9'asrBottom'#23'AnchorS'
+'ideRight.Control'#7#9'TabSheet1'#20'AnchorSideRight.Side'#7#9'asrBottom'#24 +'ideRight.Control'#7#9'TabSheet1'#20'AnchorSideRight.Side'#7#9'asrBottom'#24
+'AnchorSideBottom.Control'#7#13'cbShowCaption'#4'Left'#3'c'#1#6'Height'#3#19 +'AnchorSideBottom.Control'#7#13'cbShowCaption'#4'Left'#3'^'#1#6'Height'#3#19
+#1#3'Top'#2#30#5'Width'#3'&'#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8 +#1#3'Top'#2#30#5'Width'#3')'#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8
+'akBottom'#0#20'BorderSpacing.Around'#2#6#13'Items.Strings'#1#6#3'111'#6#3'2' +'akBottom'#0#20'BorderSpacing.Around'#2#6#13'Items.Strings'#1#6#3'111'#6#3'2'
+'22'#6#3'333'#6#2'44'#6#3'555'#6#3'666'#6#3'777'#0#10'ItemHeight'#2#0#7'OnCl' +'22'#6#3'333'#6#2'44'#6#3'555'#6#3'666'#6#3'777'#0#10'ItemHeight'#2#0#7'OnCl'
+'ick'#7#21'ListBtnAvaliableClick'#10'OnDrawItem'#7#16'ListBox1DrawItem'#5'St' +'ick'#7#21'ListBtnAvaliableClick'#10'OnDrawItem'#7#16'ListBox1DrawItem'#5'St'
@ -54,59 +54,60 @@ LazarusResources.Add('TToolPanelSetupForm','FORMDATA',[
+'le'#22'AnchorSideLeft.Control'#7#6'Label2'#21'AnchorSideTop.Control'#7#6'La' +'le'#22'AnchorSideLeft.Control'#7#6'Label2'#21'AnchorSideTop.Control'#7#6'La'
+'bel2'#18'AnchorSideTop.Side'#7#9'asrBottom'#23'AnchorSideRight.Control'#7#7 +'bel2'#18'AnchorSideTop.Side'#7#9'asrBottom'#23'AnchorSideRight.Control'#7#7
+'BitBtn6'#24'AnchorSideBottom.Control'#7#13'cbShowCaption'#4'Left'#2#14#6'He' +'BitBtn6'#24'AnchorSideBottom.Control'#7#13'cbShowCaption'#4'Left'#2#14#6'He'
+'ight'#3#19#1#3'Top'#2#30#5'Width'#3#30#1#7'Anchors'#11#5'akTop'#6'akLeft'#7 +'ight'#3#19#1#3'Top'#2#30#5'Width'#3'!'#1#7'Anchors'#11#5'akTop'#6'akLeft'#7
+'akRight'#8'akBottom'#0#20'BorderSpacing.Around'#2#6#10'ItemHeight'#2#0#7'On' +'akRight'#8'akBottom'#0#20'BorderSpacing.Around'#2#6#10'ItemHeight'#2#0#7'On'
+'Click'#7#21'ListBtnAvaliableClick'#10'OnDrawItem'#7#16'ListBox1DrawItem'#5 +'Click'#7#21'ListBtnAvaliableClick'#10'OnDrawItem'#7#16'ListBox1DrawItem'#5
+'Style'#7#16'lbOwnerDrawFixed'#8'TabOrder'#2#5#8'TopIndex'#2#255#0#0#6'TPane' +'Style'#7#16'lbOwnerDrawFixed'#8'TabOrder'#2#5#8'TopIndex'#2#255#0#0#6'TPane'
+'l'#6'Panel1'#24'AnchorSideBottom.Control'#7#9'TabSheet1'#21'AnchorSideBotto' +'l'#6'Panel1'#24'AnchorSideBottom.Control'#7#9'TabSheet1'#21'AnchorSideBotto'
+'m.Side'#7#9'asrBottom'#4'Left'#2#3#6'Height'#2'>'#3'Top'#3'P'#1#5'Width'#3 +'m.Side'#7#9'asrBottom'#4'Left'#2#3#6'Height'#2'>'#3'Top'#3'P'#1#5'Width'#3
+#131#2#9'Alignment'#7#13'taLeftJustify'#7'Anchors'#11#6'akLeft'#7'akRight'#8 +#129#2#9'Alignment'#7#13'taLeftJustify'#7'Anchors'#11#6'akLeft'#7'akRight'#8
+'akBottom'#0#20'BorderSpacing.Around'#2#6#10'BevelOuter'#7#9'bvLowered'#11'F' +'akBottom'#0#20'BorderSpacing.Around'#2#6#10'BevelOuter'#7#9'bvLowered'#11'F'
+'ullRepaint'#8#8'TabOrder'#2#6#0#0#9'TCheckBox'#13'cbShowCaption'#22'AnchorS' +'ullRepaint'#8#8'TabOrder'#2#6#0#0#9'TCheckBox'#13'cbShowCaption'#22'AnchorS'
+'ideLeft.Control'#7#9'TabSheet1'#24'AnchorSideBottom.Control'#7#6'Panel1'#4 +'ideLeft.Control'#7#9'TabSheet1'#24'AnchorSideBottom.Control'#7#6'Panel1'#4
+'Left'#2#6#6'Height'#2#19#3'Top'#3'7'#1#5'Width'#2'q'#7'Anchors'#11#6'akLeft' +'Left'#2#6#6'Height'#2#19#3'Top'#3'7'#1#5'Width'#2'p'#7'Anchors'#11#6'akLeft'
,#8'akBottom'#0#20'BorderSpacing.Around'#2#6#7'Caption'#6#12'Show caption'#8 ,#8'akBottom'#0#20'BorderSpacing.Around'#2#6#7'Caption'#6#12'Show caption'#8
+'OnChange'#7#19'cbShowCaptionChange'#8'TabOrder'#2#7#0#0#0#9'TTabSheet'#9'Ta' +'OnChange'#7#19'cbShowCaptionChange'#8'TabOrder'#2#7#0#0#0#9'TTabSheet'#9'Ta'
+'bSheet2'#7'Caption'#6#7'Options'#12'ClientHeight'#3#148#1#11'ClientWidth'#3 +'bSheet2'#7'Caption'#6#7'Options'#12'ClientHeight'#3#148#1#11'ClientWidth'#3
+#143#2#0#9'TCheckBox'#10'cbShowHint'#22'AnchorSideLeft.Control'#7#9'TabSheet' +#141#2#0#9'TCheckBox'#10'cbShowHint'#22'AnchorSideLeft.Control'#7#9'TabSheet'
+'2'#21'AnchorSideTop.Control'#7#8'cbTransp'#18'AnchorSideTop.Side'#7#9'asrBo' +'2'#21'AnchorSideTop.Control'#7#8'cbTransp'#18'AnchorSideTop.Side'#7#9'asrBo'
+'ttom'#4'Left'#2#6#6'Height'#2#19#3'Top'#3#159#0#5'Width'#2'X'#20'BorderSpac' +'ttom'#4'Left'#2#6#6'Height'#2#19#3'Top'#3#148#0#5'Width'#2'X'#20'BorderSpac'
+'ing.Around'#2#6#7'Caption'#6#9'Show hint'#8'TabOrder'#2#0#0#0#9'TCheckBox'#8 +'ing.Around'#2#6#7'Caption'#6#9'Show hint'#8'TabOrder'#2#0#0#0#9'TCheckBox'#8
+'cbTransp'#22'AnchorSideLeft.Control'#7#9'TabSheet2'#21'AnchorSideTop.Contro' +'cbTransp'#22'AnchorSideLeft.Control'#7#9'TabSheet2'#21'AnchorSideTop.Contro'
+'l'#7#9'cbFlatBtn'#18'AnchorSideTop.Side'#7#9'asrBottom'#4'Left'#2#6#6'Heigh' +'l'#7#9'cbFlatBtn'#18'AnchorSideTop.Side'#7#9'asrBottom'#4'Left'#2#6#6'Heigh'
+'t'#2#19#3'Top'#3#134#0#5'Width'#2'f'#20'BorderSpacing.Around'#2#6#7'Caption' +'t'#2#19#3'Top'#2'{'#5'Width'#2'e'#20'BorderSpacing.Around'#2#6#7'Caption'#6
+#6#11'Transparent'#8'TabOrder'#2#1#0#0#9'TCheckBox'#9'cbFlatBtn'#22'AnchorSi' +#11'Transparent'#8'TabOrder'#2#1#0#0#9'TCheckBox'#9'cbFlatBtn'#22'AnchorSide'
+'deLeft.Control'#7#9'TabSheet2'#21'AnchorSideTop.Control'#7#11'RadioGroup1' +'Left.Control'#7#9'TabSheet2'#21'AnchorSideTop.Control'#7#11'RadioGroup1'#18
+#18'AnchorSideTop.Side'#7#9'asrBottom'#4'Left'#2#6#6'Height'#2#19#3'Top'#2'm' +'AnchorSideTop.Side'#7#9'asrBottom'#4'Left'#2#6#6'Height'#2#19#3'Top'#2'b'#5
+#5'Width'#2'f'#20'BorderSpacing.Around'#2#6#7'Caption'#6#12'Flat buttons'#8 +'Width'#2'e'#20'BorderSpacing.Around'#2#6#7'Caption'#6#12'Flat buttons'#8'Ta'
+'TabOrder'#2#2#0#0#11'TRadioGroup'#11'RadioGroup1'#22'AnchorSideLeft.Control' +'bOrder'#2#2#0#0#11'TRadioGroup'#11'RadioGroup1'#22'AnchorSideLeft.Control'#7
+#7#6'Panel2'#19'AnchorSideLeft.Side'#7#9'asrBottom'#21'AnchorSideTop.Control' +#6'Panel2'#19'AnchorSideLeft.Side'#7#9'asrBottom'#21'AnchorSideTop.Control'#7
+#7#9'TabSheet2'#23'AnchorSideRight.Control'#7#9'TabSheet2'#20'AnchorSideRigh' +#9'TabSheet2'#23'AnchorSideRight.Control'#7#9'TabSheet2'#20'AnchorSideRight.'
+'t.Side'#7#9'asrBottom'#4'Left'#3'O'#1#6'Height'#2'a'#3'Top'#2#6#5'Width'#3 +'Side'#7#9'asrBottom'#4'Left'#3'N'#1#6'Height'#2'V'#3'Top'#2#6#5'Width'#3'9'
+':'#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#8'AutoFill'#8#20'BorderS' +#1#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#0#8'AutoFill'#8#8'AutoSize'#9
+'pacing.Around'#2#6#7'Caption'#6#12'Button align'#28'ChildSizing.LeftRightSp' +#20'BorderSpacing.Around'#2#6#7'Caption'#6#12'Button align'#28'ChildSizing.L'
+'acing'#2#6#28'ChildSizing.TopBottomSpacing'#2#6#28'ChildSizing.ShrinkHorizo' +'eftRightSpacing'#2#6#28'ChildSizing.TopBottomSpacing'#2#6#28'ChildSizing.Sh'
+'ntal'#7#14'crsScaleChilds'#26'ChildSizing.ShrinkVertical'#7#14'crsScaleChil' +'rinkHorizontal'#7#14'crsScaleChilds'#26'ChildSizing.ShrinkVertical'#7#14'cr'
+'ds'#18'ChildSizing.Layout'#7#29'cclLeftToRightThenTopToBottom'#27'ChildSizi' +'sScaleChilds'#18'ChildSizing.Layout'#7#29'cclLeftToRightThenTopToBottom'#27
+'ng.ControlsPerLine'#2#1#12'ClientHeight'#2'L'#11'ClientWidth'#3'2'#1#13'Ite' +'ChildSizing.ControlsPerLine'#2#1#12'ClientHeight'#2'E'#11'ClientWidth'#3'9'
+'ms.Strings'#1#6#4'None'#6#4'Left'#6#5'Rignt'#0#8'TabOrder'#2#3#7'TabStop'#9 +#1#13'Items.Strings'#1#6#4'None'#6#4'Left'#6#5'Rignt'#0#8'TabOrder'#2#3#7'Ta'
+#0#0#11'TRadioGroup'#11'RadioGroup2'#22'AnchorSideLeft.Control'#7#9'TabSheet' +'bStop'#9#0#0#11'TRadioGroup'#11'RadioGroup2'#22'AnchorSideLeft.Control'#7#9
+'2'#21'AnchorSideTop.Control'#7#9'TabSheet2'#23'AnchorSideRight.Control'#7#6 +'TabSheet2'#21'AnchorSideTop.Control'#7#9'TabSheet2'#23'AnchorSideRight.Cont'
+'Panel2'#4'Left'#2#6#6'Height'#2'Z'#3'Top'#2#6#5'Width'#3':'#1#7'Anchors'#11 +'rol'#7#6'Panel2'#4'Left'#2#6#6'Height'#2'V'#3'Top'#2#6#5'Width'#3'9'#1#7'An'
+#5'akTop'#6'akLeft'#7'akRight'#0#8'AutoFill'#9#8'AutoSize'#9#20'BorderSpacin' +'chors'#11#5'akTop'#6'akLeft'#7'akRight'#0#8'AutoFill'#9#8'AutoSize'#9#20'Bo'
+'g.Around'#2#6#7'Caption'#6#14'Tool bar style'#28'ChildSizing.LeftRightSpaci' +'rderSpacing.Around'#2#6#7'Caption'#6#14'Tool bar style'#28'ChildSizing.Left'
+'ng'#2#6#28'ChildSizing.TopBottomSpacing'#2#6#29'ChildSizing.EnlargeHorizont' +'RightSpacing'#2#6#28'ChildSizing.TopBottomSpacing'#2#6#29'ChildSizing.Enlar'
+'al'#7#24'crsHomogenousChildResize'#27'ChildSizing.EnlargeVertical'#7#24'crs' +'geHorizontal'#7#24'crsHomogenousChildResize'#27'ChildSizing.EnlargeVertical'
+'HomogenousChildResize'#28'ChildSizing.ShrinkHorizontal'#7#14'crsScaleChilds' +#7#24'crsHomogenousChildResize'#28'ChildSizing.ShrinkHorizontal'#7#14'crsSca'
+#26'ChildSizing.ShrinkVertical'#7#14'crsScaleChilds'#18'ChildSizing.Layout'#7 +'leChilds'#26'ChildSizing.ShrinkVertical'#7#14'crsScaleChilds'#18'ChildSizin'
+#29'cclLeftToRightThenTopToBottom'#27'ChildSizing.ControlsPerLine'#2#1#12'Cl' +'g.Layout'#7#29'cclLeftToRightThenTopToBottom'#27'ChildSizing.ControlsPerLin'
+'ientHeight'#2'E'#11'ClientWidth'#3'2'#1#13'Items.Strings'#1#6#8'Standart'#6 +'e'#2#1#12'ClientHeight'#2'E'#11'ClientWidth'#3'9'#1#13'Items.Strings'#1#6#8
+#10'Windows XP'#6#6'Native'#0#8'TabOrder'#2#4#7'TabStop'#9#0#0#6'TPanel'#6'P' +'Standart'#6#10'Windows XP'#6#6'Native'#0#8'TabOrder'#2#4#7'TabStop'#9#0#0#6
+'anel2'#22'AnchorSideLeft.Control'#7#9'TabSheet2'#19'AnchorSideLeft.Side'#7#9 +'TPanel'#6'Panel2'#22'AnchorSideLeft.Control'#7#9'TabSheet2'#19'AnchorSideLe'
+'asrCenter'#21'AnchorSideTop.Control'#7#9'TabSheet2'#24'AnchorSideBottom.Con' +'ft.Side'#7#9'asrCenter'#21'AnchorSideTop.Control'#7#9'TabSheet2'#24'AnchorS'
+'trol'#7#9'TabSheet2'#21'AnchorSideBottom.Side'#7#9'asrBottom'#4'Left'#3'F'#1 +'ideBottom.Control'#7#9'TabSheet2'#21'AnchorSideBottom.Side'#7#9'asrBottom'#4
+#6'Height'#3#136#1#3'Top'#2#6#5'Width'#2#3#7'Anchors'#11#5'akTop'#6'akLeft'#8 +'Left'#3'E'#1#6'Height'#3#136#1#3'Top'#2#6#5'Width'#2#3#7'Anchors'#11#5'akTo'
+'akBottom'#0#20'BorderSpacing.Around'#2#6#8'TabOrder'#2#5#0#0#0#0#12'TButton' +'p'#6'akLeft'#8'akBottom'#0#20'BorderSpacing.Around'#2#6#8'TabOrder'#2#5#0#0
+'Panel'#12'ButtonPanel1'#4'Left'#2#6#6'Height'#2'('#3'Top'#3#185#1#5'Width'#3 +#0#0#12'TButtonPanel'#12'ButtonPanel1'#4'Left'#2#6#6'Height'#2'('#3'Top'#3
+#135#2#8'TabOrder'#2#1#11'ShowButtons'#11#7'pbClose'#6'pbHelp'#0#0#0#0 +#185#1#5'Width'#3#133#2#8'TabOrder'#2#1#11'ShowButtons'#11#7'pbClose'#6'pbHe'
+'lp'#0#0#0#0
]); ]);

View File

@ -224,6 +224,7 @@ type
constructor Create(AOwner: TComponent); override; constructor Create(AOwner: TComponent); override;
destructor Destroy; override; destructor Destroy; override;
procedure Customize(HelpCtx: Longint); procedure Customize(HelpCtx: Longint);
procedure SetBounds(aLeft, aTop, aWidth, aHeight: integer); override;
published published
property Items:TToolbarItems read GetItems write SetItems; property Items:TToolbarItems read GetItems write SetItems;
property ImageList:TImageList read FImageList write SetImageList; property ImageList:TImageList read FImageList write SetImageList;
@ -715,6 +716,7 @@ procedure TToolbarButton.SetBounds(aLeft, aTop, aWidth, aHeight: integer);
var var
TextSize:TSize; TextSize:TSize;
ImgH, ImgW:integer; ImgH, ImgW:integer;
tmpCanvas: TCanvas;
begin begin
if Assigned(Parent) and not (csLoading in TToolPanel(Parent).ComponentState) then if Assigned(Parent) and not (csLoading in TToolPanel(Parent).ComponentState) then
begin begin
@ -750,19 +752,26 @@ begin
if ShowCaption then if ShowCaption then
begin begin
TextSize:=Canvas.TextExtent(Caption); tmpCanvas := GetWorkingCanvas(Canvas);
if (Layout in [blGlyphLeft, blGlyphRight]) and Assigned(FImageList) then
begin try
aWidth:=ImgW + 4 + TextSize.cx; TextSize:=tmpCanvas.TextExtent(Caption);
aHeight:=Max(TextSize.cy + 8, ImgH); if (Layout in [blGlyphLeft, blGlyphRight]) and Assigned(FImageList) then
end begin
else aWidth:=ImgW + 4 + TextSize.cx;
begin aHeight:=Max(TextSize.cy + 8, ImgH);
aWidth:=Max(8 + TextSize.cx, ImgW); end
aHeight:=ImgH + TextSize.cy + 4; else
begin
aWidth:=Max(8 + TextSize.cx, ImgW);
aHeight:=ImgH + TextSize.cy + 4;
end;
if aHeight < TToolPanel(Parent).BtnHeight then
aHeight:=TToolPanel(Parent).BtnHeight;
finally
if TmpCanvas<>Canvas then
FreeWorkingCanvas(tmpCanvas);
end; end;
if aHeight < TToolPanel(Parent).BtnHeight then
aHeight:=TToolPanel(Parent).BtnHeight;
end end
else else
begin begin
@ -1009,11 +1018,16 @@ procedure TToolPanel.ReAlignToolBtn;
var var
i, L:integer; i, L:integer;
begin begin
{ for i:=0 to FToolbarItems.Count - 1 do
begin
FToolbarItems[i].FButton.Align:=alNone;
end;
}
L:=BorderWidth; L:=BorderWidth;
for i:=0 to FToolbarItems.Count - 1 do for i:=0 to FToolbarItems.Count - 1 do
begin begin
FToolbarItems[i].FButton.Left:=L; FToolbarItems[i].FButton.Left:=L;
FToolbarItems[i].FButton.Align:=BtnAl2Align[FButtonAllign]; // FToolbarItems[i].FButton.Align:=BtnAl2Align[FButtonAllign];
L:=L + FToolbarItems[i].FButton.Width; L:=L + FToolbarItems[i].FButton.Width;
end; end;
end; end;
@ -1057,7 +1071,7 @@ var
i, H:integer; i, H:integer;
begin begin
{
if not AutoSizeCanStart then exit; if not AutoSizeCanStart then exit;
if csDesigning in ComponentState then exit; if csDesigning in ComponentState then exit;
@ -1078,7 +1092,7 @@ begin
end end
// Exclude(FControlFlags,cfAutoSizeNeeded); // Exclude(FControlFlags,cfAutoSizeNeeded);
end end
else else }
inherited DoAutoSize; inherited DoAutoSize;
end; end;
@ -1091,13 +1105,13 @@ begin
end; end;
procedure TToolPanel.RequestAlign; procedure TToolPanel.RequestAlign;
var {var
i, L:integer; i, L:integer;}
begin begin
inherited RequestAlign; inherited RequestAlign;
{ if (Parent = nil) or (csDestroying in ComponentState) or (csLoading in ComponentState) or (not Parent.HandleAllocated) then { if (Parent = nil) or (csDestroying in ComponentState) or (csLoading in ComponentState) or (not Parent.HandleAllocated) then
exit; exit;
if not Parent.HandleAllocated then exit; // if not Parent.HandleAllocated then exit;
ReAlignToolBtn;} ReAlignToolBtn;}
end; end;
@ -1105,12 +1119,18 @@ procedure TToolPanel.Loaded;
var var
i, L:integer; i, L:integer;
begin begin
if csDesigning in ComponentState then { if csDesigning in ComponentState then
begin begin
for i:=0 to FToolbarItems.Count - 1 do for i:=0 to FToolbarItems.Count - 1 do
FToolbarItems[i].UpdateLeftAfterLoad; FToolbarItems[i].UpdateLeftAfterLoad;
end; end; }
inherited Loaded; inherited Loaded;
for i:=0 to FToolbarItems.Count - 1 do
begin
FToolbarItems[i].UpdateLeftAfterLoad;
FToolbarItems[i].FButton.Align:=BtnAl2Align[FButtonAllign];
end;
ReAlignToolBtn;
end; end;
constructor TToolPanel.Create(AOwner: TComponent); constructor TToolPanel.Create(AOwner: TComponent);
@ -1128,7 +1148,7 @@ begin
FDefButtonHeight:=DefButtonHeight; FDefButtonHeight:=DefButtonHeight;
FToolBarStyle:=tbsStandart; FToolBarStyle:=tbsStandart;
BorderWidth:=4; BorderWidth:=4;
ControlStyle:=ControlStyle - [csSetCaption]; ControlStyle:=ControlStyle - [csSetCaption] + [csAcceptsControls];
Caption:=''; Caption:='';
end; end;
@ -1154,6 +1174,15 @@ begin
SetCustomizing(true); SetCustomizing(true);
end; end;
procedure TToolPanel.SetBounds(aLeft, aTop, aWidth, aHeight: integer);
begin
if Assigned(FImageList) then
aHeight:=FImageList.Height+8 + BorderWidth * 2
else
aHeight:=FDefButtonHeight + BorderWidth * 2;
inherited SetBounds(aLeft, aTop, aWidth, aHeight);
end;
{ TToolbarItem } { TToolbarItem }
procedure TToolbarItem.SetAction(const AValue: TBasicAction); procedure TToolbarItem.SetAction(const AValue: TBasicAction);
@ -1345,8 +1374,11 @@ end;
constructor TToolbarItem.Create(ACollection: TCollection); constructor TToolbarItem.Create(ACollection: TCollection);
var var
i, W:integer; i, W:integer;
TB:TToolPanel;
begin begin
inherited Create(ACollection); inherited Create(ACollection);
TB:=TToolbarItems(ACollection).FToolPanel;
FButton:=TToolbarButton.Create(TToolbarItems(ACollection).FToolPanel); FButton:=TToolbarButton.Create(TToolbarItems(ACollection).FToolPanel);
FButton.Align:=BtnAl2Align[TToolbarItems(ACollection).FToolPanel.ButtonAllign]; FButton.Align:=BtnAl2Align[TToolbarItems(ACollection).FToolPanel.ButtonAllign];
@ -1361,15 +1393,19 @@ begin
FButton.FFullPush:=true; FButton.FFullPush:=true;
// if not (csLoading in TToolbarItems(ACollection).FToolPanel.ComponentState) then // if not (csLoading in TToolbarItems(ACollection).FToolPanel.ComponentState) then
// FButton.Align:=BtnAl2Align[TToolbarItems(ACollection).FToolPanel.ButtonAllign]; // FButton.Align:=BtnAl2Align[TToolbarItems(ACollection).FToolPanel.ButtonAllign];
{ if TToolbarItems(ACollection).FToolPanel.ButtonAllign = tbaLeft then
if (not (csLoading in TB.ComponentState)) and (csDesigning in TB.ComponentState) then
begin begin
W:=0; if TToolbarItems(ACollection).FToolPanel.ButtonAllign = tbaLeft then
for i:=0 to ACollection.Count - 1 do
begin begin
W:=Max(W, TToolbarItems(ACollection).Items[I].Width + TToolbarItems(ACollection).Items[I].Left); W:=0;
for i:=0 to ACollection.Count - 1 do
begin
W:=Max(W, TToolbarItems(ACollection).Items[I].Width + TToolbarItems(ACollection).Items[I].Left);
end;
Left:=W+1;
end; end;
Left:=W+1; end;
end;}
end; end;
destructor TToolbarItem.Destroy; destructor TToolbarItem.Destroy;