ide: add small border for TSimpleHTMLControl

git-svn-id: trunk@19513 -
This commit is contained in:
paul 2009-04-19 13:24:34 +00:00
parent b4435027f4
commit 884e566a1e
3 changed files with 45 additions and 121 deletions

View File

@ -3,17 +3,9 @@ object HelpSelectorDialog: THelpSelectorDialog
Height = 283 Height = 283
Top = 414 Top = 414
Width = 500 Width = 500
HelpContext = 0
Caption = 'HelpSelectorDialog' Caption = 'HelpSelectorDialog'
ChildSizing.LeftRightSpacing = 0
ChildSizing.TopBottomSpacing = 0
ChildSizing.HorizontalSpacing = 0
ChildSizing.VerticalSpacing = 0
ChildSizing.ControlsPerLine = 0
ClientHeight = 283 ClientHeight = 283
ClientWidth = 500 ClientWidth = 500
Font.Height = 0
Font.Style = []
OnClose = HelpSelectorDialogClose OnClose = HelpSelectorDialogClose
Position = poScreenCenter Position = poScreenCenter
LCLVersion = '0.9.27' LCLVersion = '0.9.27'
@ -23,47 +15,22 @@ object HelpSelectorDialog: THelpSelectorDialog
Height = 233 Height = 233
Top = 6 Top = 6
Width = 488 Width = 488
HelpContext = 0
Align = alClient Align = alClient
BorderSpacing.Left = 0
BorderSpacing.Top = 0
BorderSpacing.Right = 0
BorderSpacing.Bottom = 0
BorderSpacing.Around = 6 BorderSpacing.Around = 6
BorderSpacing.CellAlignHorizontal = ccaFill
BorderSpacing.CellAlignVertical = ccaFill
Caption = 'NodesGroupBox' Caption = 'NodesGroupBox'
ChildSizing.LeftRightSpacing = 0
ChildSizing.TopBottomSpacing = 0
ChildSizing.HorizontalSpacing = 0
ChildSizing.VerticalSpacing = 0
ChildSizing.ControlsPerLine = 0
ClientHeight = 215 ClientHeight = 215
ClientWidth = 484 ClientWidth = 484
Ctl3D = False
TabOrder = 0 TabOrder = 0
object NodesListBox: TListBox object NodesListBox: TListBox
Left = 6 Left = 6
Height = 203 Height = 203
Top = 6 Top = 6
Width = 472 Width = 472
HelpContext = 0
Align = alClient Align = alClient
BorderSpacing.Left = 0
BorderSpacing.Top = 0
BorderSpacing.Right = 0
BorderSpacing.Bottom = 0
BorderSpacing.Around = 6 BorderSpacing.Around = 6
BorderSpacing.CellAlignHorizontal = ccaFill
BorderSpacing.CellAlignVertical = ccaFill
IntegralHeight = False
ItemHeight = 0 ItemHeight = 0
MultiSelect = False
OnDblClick = NodesListBoxDblClick OnDblClick = NodesListBoxDblClick
Sorted = False
Style = lbStandard
TabOrder = 0 TabOrder = 0
TopIndex = 0
end end
end end
object BtnPanel: TPanel object BtnPanel: TPanel
@ -71,22 +38,9 @@ object HelpSelectorDialog: THelpSelectorDialog
Height = 38 Height = 38
Top = 245 Top = 245
Width = 500 Width = 500
HelpContext = 0
Align = alBottom Align = alBottom
AutoSize = True AutoSize = True
BorderSpacing.Left = 0
BorderSpacing.Top = 0
BorderSpacing.Right = 0
BorderSpacing.Bottom = 0
BorderSpacing.Around = 0
BorderSpacing.CellAlignHorizontal = ccaFill
BorderSpacing.CellAlignVertical = ccaFill
BevelOuter = bvNone BevelOuter = bvNone
ChildSizing.LeftRightSpacing = 0
ChildSizing.TopBottomSpacing = 0
ChildSizing.HorizontalSpacing = 0
ChildSizing.VerticalSpacing = 0
ChildSizing.ControlsPerLine = 0
ClientHeight = 38 ClientHeight = 38
ClientWidth = 500 ClientWidth = 500
TabOrder = 1 TabOrder = 1
@ -100,16 +54,9 @@ object HelpSelectorDialog: THelpSelectorDialog
Height = 26 Height = 26
Top = 6 Top = 6
Width = 75 Width = 75
HelpContext = 0
Anchors = [akRight, akBottom] Anchors = [akRight, akBottom]
AutoSize = True AutoSize = True
BorderSpacing.Left = 0
BorderSpacing.Top = 0
BorderSpacing.Right = 0
BorderSpacing.Bottom = 0
BorderSpacing.Around = 6 BorderSpacing.Around = 6
BorderSpacing.CellAlignHorizontal = ccaFill
BorderSpacing.CellAlignVertical = ccaFill
Caption = '&OK' Caption = '&OK'
Constraints.MinWidth = 75 Constraints.MinWidth = 75
Default = True Default = True
@ -129,16 +76,9 @@ object HelpSelectorDialog: THelpSelectorDialog
Height = 26 Height = 26
Top = 6 Top = 6
Width = 77 Width = 77
HelpContext = 0
Anchors = [akRight, akBottom] Anchors = [akRight, akBottom]
AutoSize = True AutoSize = True
BorderSpacing.Left = 0
BorderSpacing.Top = 0
BorderSpacing.Right = 0
BorderSpacing.Bottom = 0
BorderSpacing.Around = 6 BorderSpacing.Around = 6
BorderSpacing.CellAlignHorizontal = ccaFill
BorderSpacing.CellAlignVertical = ccaFill
Caption = 'Cancel' Caption = 'Cancel'
Constraints.MinWidth = 75 Constraints.MinWidth = 75
Kind = bkCancel Kind = bkCancel

View File

@ -2,56 +2,31 @@
LazarusResources.Add('THelpSelectorDialog','FORMDATA',[ LazarusResources.Add('THelpSelectorDialog','FORMDATA',[
'TPF0'#19'THelpSelectorDialog'#18'HelpSelectorDialog'#4'Left'#3'H'#1#6'Height' 'TPF0'#19'THelpSelectorDialog'#18'HelpSelectorDialog'#4'Left'#3'H'#1#6'Height'
+#3#27#1#3'Top'#3#158#1#5'Width'#3#244#1#11'HelpContext'#2#0#7'Caption'#6#18 +#3#27#1#3'Top'#3#158#1#5'Width'#3#244#1#7'Caption'#6#18'HelpSelectorDialog'
+'HelpSelectorDialog'#28'ChildSizing.LeftRightSpacing'#2#0#28'ChildSizing.Top' +#12'ClientHeight'#3#27#1#11'ClientWidth'#3#244#1#7'OnClose'#7#23'HelpSelecto'
+'BottomSpacing'#2#0#29'ChildSizing.HorizontalSpacing'#2#0#27'ChildSizing.Ver' +'rDialogClose'#8'Position'#7#14'poScreenCenter'#10'LCLVersion'#6#6'0.9.27'#0
+'ticalSpacing'#2#0#27'ChildSizing.ControlsPerLine'#2#0#12'ClientHeight'#3#27 +#9'TGroupBox'#13'NodesGroupBox'#24'AnchorSideBottom.Control'#7#12'CancelButt'
+#1#11'ClientWidth'#3#244#1#11'Font.Height'#2#0#10'Font.Style'#11#0#7'OnClose' +'on'#4'Left'#2#6#6'Height'#3#233#0#3'Top'#2#6#5'Width'#3#232#1#5'Align'#7#8
+#7#23'HelpSelectorDialogClose'#8'Position'#7#14'poScreenCenter'#10'LCLVersio' +'alClient'#20'BorderSpacing.Around'#2#6#7'Caption'#6#13'NodesGroupBox'#12'Cl'
+'n'#6#6'0.9.27'#0#9'TGroupBox'#13'NodesGroupBox'#24'AnchorSideBottom.Control' +'ientHeight'#3#215#0#11'ClientWidth'#3#228#1#8'TabOrder'#2#0#0#8'TListBox'#12
+#7#12'CancelButton'#4'Left'#2#6#6'Height'#3#233#0#3'Top'#2#6#5'Width'#3#232#1 +'NodesListBox'#4'Left'#2#6#6'Height'#3#203#0#3'Top'#2#6#5'Width'#3#216#1#5'A'
+#11'HelpContext'#2#0#5'Align'#7#8'alClient'#18'BorderSpacing.Left'#2#0#17'Bo' +'lign'#7#8'alClient'#20'BorderSpacing.Around'#2#6#10'ItemHeight'#2#0#10'OnDb'
+'rderSpacing.Top'#2#0#19'BorderSpacing.Right'#2#0#20'BorderSpacing.Bottom'#2 +'lClick'#7#20'NodesListBoxDblClick'#8'TabOrder'#2#0#0#0#0#6'TPanel'#8'BtnPan'
+#0#20'BorderSpacing.Around'#2#6'!BorderSpacing.CellAlignHorizontal'#7#7'ccaF' +'el'#4'Left'#2#0#6'Height'#2'&'#3'Top'#3#245#0#5'Width'#3#244#1#5'Align'#7#8
+'ill'#31'BorderSpacing.CellAlignVertical'#7#7'ccaFill'#7'Caption'#6#13'Nodes' +'alBottom'#8'AutoSize'#9#10'BevelOuter'#7#6'bvNone'#12'ClientHeight'#2'&'#11
+'GroupBox'#28'ChildSizing.LeftRightSpacing'#2#0#28'ChildSizing.TopBottomSpac' +'ClientWidth'#3#244#1#8'TabOrder'#2#1#0#7'TBitBtn'#8'OKButton'#21'AnchorSide'
+'ing'#2#0#29'ChildSizing.HorizontalSpacing'#2#0#27'ChildSizing.VerticalSpaci' +'Top.Control'#7#8'BtnPanel'#18'AnchorSideTop.Side'#7#9'asrCenter'#23'AnchorS'
+'ng'#2#0#27'ChildSizing.ControlsPerLine'#2#0#12'ClientHeight'#3#215#0#11'Cli' +'ideRight.Control'#7#12'CancelButton'#24'AnchorSideBottom.Control'#7#8'BtnPa'
+'entWidth'#3#228#1#5'Ctl3D'#8#8'TabOrder'#2#0#0#8'TListBox'#12'NodesListBox' +'nel'#21'AnchorSideBottom.Side'#7#9'asrBottom'#4'Left'#3'P'#1#6'Height'#2#26
+#4'Left'#2#6#6'Height'#3#203#0#3'Top'#2#6#5'Width'#3#216#1#11'HelpContext'#2 +#3'Top'#2#6#5'Width'#2'K'#7'Anchors'#11#7'akRight'#8'akBottom'#0#8'AutoSize'
+#0#5'Align'#7#8'alClient'#18'BorderSpacing.Left'#2#0#17'BorderSpacing.Top'#2 +#9#20'BorderSpacing.Around'#2#6#7'Caption'#6#3'&OK'#20'Constraints.MinWidth'
+#0#19'BorderSpacing.Right'#2#0#20'BorderSpacing.Bottom'#2#0#20'BorderSpacing' +#2'K'#7'Default'#9#4'Kind'#7#4'bkOK'#11'ModalResult'#2#1#9'NumGlyphs'#2#0#8
+'.Around'#2#6'!BorderSpacing.CellAlignHorizontal'#7#7'ccaFill'#31'BorderSpac' +'TabOrder'#2#0#0#0#7'TBitBtn'#12'CancelButton'#21'AnchorSideTop.Control'#7#8
+'ing.CellAlignVertical'#7#7'ccaFill'#14'IntegralHeight'#8#10'ItemHeight'#2#0 +'BtnPanel'#18'AnchorSideTop.Side'#7#9'asrCenter'#23'AnchorSideRight.Control'
+#11'MultiSelect'#8#10'OnDblClick'#7#20'NodesListBoxDblClick'#6'Sorted'#8#5'S' +#7#8'BtnPanel'#20'AnchorSideRight.Side'#7#9'asrBottom'#24'AnchorSideBottom.C'
+'tyle'#7#10'lbStandard'#8'TabOrder'#2#0#8'TopIndex'#2#0#0#0#0#6'TPanel'#8'Bt' +'ontrol'#7#8'BtnPanel'#21'AnchorSideBottom.Side'#7#9'asrBottom'#4'Left'#3#161
+'nPanel'#4'Left'#2#0#6'Height'#2'&'#3'Top'#3#245#0#5'Width'#3#244#1#11'HelpC' +#1#6'Height'#2#26#3'Top'#2#6#5'Width'#2'M'#7'Anchors'#11#7'akRight'#8'akBott'
+'ontext'#2#0#5'Align'#7#8'alBottom'#8'AutoSize'#9#18'BorderSpacing.Left'#2#0 +'om'#0#8'AutoSize'#9#20'BorderSpacing.Around'#2#6#7'Caption'#6#6'Cancel'#20
+#17'BorderSpacing.Top'#2#0#19'BorderSpacing.Right'#2#0#20'BorderSpacing.Bott' +'Constraints.MinWidth'#2'K'#4'Kind'#7#8'bkCancel'#11'ModalResult'#2#2#9'NumG'
+'om'#2#0#20'BorderSpacing.Around'#2#0'!BorderSpacing.CellAlignHorizontal'#7#7 +'lyphs'#2#0#8'TabOrder'#2#1#0#0#0#0
+'ccaFill'#31'BorderSpacing.CellAlignVertical'#7#7'ccaFill'#10'BevelOuter'#7#6
+'bvNone'#28'ChildSizing.LeftRightSpacing'#2#0#28'ChildSizing.TopBottomSpacin'
+'g'#2#0#29'ChildSizing.HorizontalSpacing'#2#0#27'ChildSizing.VerticalSpacing'
+#2#0#27'ChildSizing.ControlsPerLine'#2#0#12'ClientHeight'#2'&'#11'ClientWidt'
+'h'#3#244#1#8'TabOrder'#2#1#0#7'TBitBtn'#8'OKButton'#21'AnchorSideTop.Contro'
+'l'#7#8'BtnPanel'#18'AnchorSideTop.Side'#7#9'asrCenter'#23'AnchorSideRight.C'
+'ontrol'#7#12'CancelButton'#24'AnchorSideBottom.Control'#7#8'BtnPanel'#21'An'
+'chorSideBottom.Side'#7#9'asrBottom'#4'Left'#3'P'#1#6'Height'#2#26#3'Top'#2#6
+#5'Width'#2'K'#11'HelpContext'#2#0#7'Anchors'#11#7'akRight'#8'akBottom'#0#8
+'AutoSize'#9#18'BorderSpacing.Left'#2#0#17'BorderSpacing.Top'#2#0#19'BorderS'
+'pacing.Right'#2#0#20'BorderSpacing.Bottom'#2#0#20'BorderSpacing.Around'#2#6
+'!BorderSpacing.CellAlignHorizontal'#7#7'ccaFill'#31'BorderSpacing.CellAlign'
+'Vertical'#7#7'ccaFill'#7'Caption'#6#3'&OK'#20'Constraints.MinWidth'#2'K'#7
+'Default'#9#4'Kind'#7#4'bkOK'#11'ModalResult'#2#1#9'NumGlyphs'#2#0#8'TabOrde'
+'r'#2#0#0#0#7'TBitBtn'#12'CancelButton'#21'AnchorSideTop.Control'#7#8'BtnPan'
+'el'#18'AnchorSideTop.Side'#7#9'asrCenter'#23'AnchorSideRight.Control'#7#8'B'
+'tnPanel'#20'AnchorSideRight.Side'#7#9'asrBottom'#24'AnchorSideBottom.Contro'
+'l'#7#8'BtnPanel'#21'AnchorSideBottom.Side'#7#9'asrBottom'#4'Left'#3#161#1#6
+'Height'#2#26#3'Top'#2#6#5'Width'#2'M'#11'HelpContext'#2#0#7'Anchors'#11#7'a'
+'kRight'#8'akBottom'#0#8'AutoSize'#9#18'BorderSpacing.Left'#2#0#17'BorderSpa'
+'cing.Top'#2#0#19'BorderSpacing.Right'#2#0#20'BorderSpacing.Bottom'#2#0#20'B'
+'orderSpacing.Around'#2#6'!BorderSpacing.CellAlignHorizontal'#7#7'ccaFill'#31
+'BorderSpacing.CellAlignVertical'#7#7'ccaFill'#7'Caption'#6#6'Cancel'#20'Con'
+'straints.MinWidth'#2'K'#4'Kind'#7#8'bkCancel'#11'ModalResult'#2#2#9'NumGlyp'
+'hs'#2#0#8'TabOrder'#2#1#0#0#0#0
]); ]);

View File

@ -35,7 +35,7 @@ interface
uses uses
// FCL+LCL // FCL+LCL
Classes, SysUtils, AVL_Tree, LCLProc, LCLIntf, LCLType, Forms, Controls, Buttons, Classes, SysUtils, AVL_Tree, LCLProc, LCLIntf, LCLType, Forms, Controls, Buttons,
StdCtrls, Dialogs, ExtCtrls, LResources, FileUtil, StdCtrls, Dialogs, ExtCtrls, LResources, FileUtil, Graphics,
// CodeTools // CodeTools
BasicCodeTools, CodeToolManager, CodeAtom, CodeCache, CustomCodeTool, CodeTree, BasicCodeTools, CodeToolManager, CodeAtom, CodeCache, CustomCodeTool, CodeTree,
PascalParserTool, FindDeclarationTool, PascalParserTool, FindDeclarationTool,
@ -316,6 +316,8 @@ constructor TSimpleHTMLControl.Create(AOwner: TComponent);
begin begin
inherited Create(AOwner); inherited Create(AOwner);
WordWrap := True; WordWrap := True;
Layout := tlCenter;
Alignment := taCenter;
end; end;
function TSimpleHTMLControl.GetURL: string; function TSimpleHTMLControl.GetURL: string;
@ -377,8 +379,8 @@ begin
LabelText := GetLabelText; LabelText := GetLabelText;
DrawText(DC, PChar(LabelText), Length(LabelText), R, Flags); DrawText(DC, PChar(LabelText), Length(LabelText), R, Flags);
SelectObject(DC, OldFont); SelectObject(DC, OldFont);
AWidth := R.Right - R.Left; AWidth := R.Right - R.Left + 8; // border
AHeight := R.Bottom - R.Top; AHeight := R.Bottom - R.Top + 8; // border
finally finally
ReleaseDC(Parent.Handle, DC); ReleaseDC(Parent.Handle, DC);
end; end;
@ -1285,12 +1287,19 @@ begin
ms.Free; ms.Free;
end; end;
Provider.ControlIntf.GetPreferredControlSize(NewWidth,NewHeight); Provider.ControlIntf.GetPreferredControlSize(NewWidth,NewHeight);
if NewWidth<=0 then
NewWidth:=500; if NewWidth <= 0 then
if NewHeight<=0 then NewWidth := 500
NewHeight:=200; else
HintWinRect := Rect(0,0,NewWidth,NewHeight); inc(NewWidth, 8); // border
TheHint:='';
if NewHeight <= 0 then
NewHeight := 200
else
inc(NewHeight, 8); // border
HintWinRect := Rect(0, 0, NewWidth, NewHeight);
TheHint := '';
end else begin end else begin
HintWinRect := aHintWindow.CalcHintRect(Screen.Width, TheHint, nil); HintWinRect := aHintWindow.CalcHintRect(Screen.Width, TheHint, nil);
end; end;