jvcllaz: Add TJvOfficeColorButton. Some cosmetic changes, less hints and warnings.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7006 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2019-06-12 13:21:57 +00:00
parent 21b927cc27
commit 5d9aaa8380
19 changed files with 3290 additions and 31 deletions

View File

@ -311,7 +311,7 @@ end;
function TJvPersistentPropertyEditor.GetValue:string; function TJvPersistentPropertyEditor.GetValue:string;
begin begin
FmtStr(Result, '(%s)', [GetPropType^.Name]); Result := Format('(%s)', [GetPropType^.Name]);
end; end;

View File

@ -28,3 +28,4 @@ tjvrollout_200.png
tjvcombolistbox.bmp tjvcombolistbox.bmp
tjvlookupautocomplete.bmp tjvlookupautocomplete.bmp
tjvinstalllabel.bmp tjvinstalllabel.bmp
tjvofficecolorpanel.bmp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -17,6 +17,7 @@ uses
Classes, Controls, ActnList, PropEdits, JvDsgnConsts, Classes, Controls, ActnList, PropEdits, JvDsgnConsts,
JvMovableBevel, JvRuler, JvGroupHeader, JvRollOut, JvMovableBevel, JvRuler, JvGroupHeader, JvRollOut,
JvHtControls, JvHint, JvHTHintForm, JvComboListBox, JvInstallLabel, JvHtControls, JvHint, JvHTHintForm, JvComboListBox, JvInstallLabel,
JvOfficeColorPanel,
JvAutoComplete; // original JVCL has this in package JvCore JvAutoComplete; // original JVCL has this in package JvCore
procedure Register; procedure Register;
@ -24,6 +25,7 @@ begin
RegisterComponents(RsPaletteJvcl, [ RegisterComponents(RsPaletteJvcl, [
TJvMovableBevel, TJvMovablePanel, TJvRuler, TJvGroupHeader, TJvRollOut, TJvMovableBevel, TJvMovablePanel, TJvRuler, TJvGroupHeader, TJvRollOut,
TJvHint, TJvHTLabel, TJvHTListbox, TJvHTCombobox, TJvComboListBox, TJvHint, TJvHTLabel, TJvHTListbox, TJvHTCombobox, TJvComboListBox,
TJvOfficeColorPanel,
TJvLookupAutoComplete, TJvInstallLabel TJvLookupAutoComplete, TJvInstallLabel
]); ]);
RegisterPropertyEditor(TypeInfo(TCaption), TJvHTLabel, 'Caption', TJvHintProperty); RegisterPropertyEditor(TypeInfo(TCaption), TJvHTLabel, 'Caption', TJvHintProperty);

View File

@ -15,13 +15,13 @@ implementation
uses uses
Classes, Controls, PropEdits, Classes, Controls, PropEdits,
JvDsgnConsts, //JvDsgnEditors, JvDsgnConsts, JvCheckbox, JvPanel, JvBaseEdits;
JvButton, JvCheckbox, JvBaseEdits, JVPanel;
procedure Register; procedure Register;
begin begin
RegisterComponents(RsPaletteJvcl, [TJvCheckbox, TJvPanel, TJvCalcEdit]); RegisterComponents(RsPaletteJvcl, [
// RegisterPropertyEditor(TypeInfo(TJvArrangeSettings), nil, '', TJvPersistentPropertyEditor); TJvCheckbox, TJvPanel, TJvCalcEdit
]);
end; end;
end. end.

View File

@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="12"/>
<PathDelim Value="\"/>
<General>
<Flags>
<CompatibilityMode Value="True"/>
</Flags>
<SessionStorage Value="InProjectDir"/>
<Title Value="JvOfficeColorPanelDemo"/>
<Scaled Value="True"/>
<ResourceType Value="res"/>
<UseXPManifest Value="True"/>
<XPManifest>
<DpiAware Value="True"/>
</XPManifest>
<Icon Value="0"/>
</General>
<BuildModes Count="1">
<Item1 Name="Default" Default="True"/>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
<UseFileFilters Value="True"/>
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
<Modes Count="0"/>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="JvCtrlsLazR"/>
</Item1>
<Item2>
<PackageName Value="LCL"/>
</Item2>
</RequiredPackages>
<Units Count="2">
<Unit0>
<Filename Value="JvOfficeColorPanelDemo.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="main.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="Form1"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit1>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\bin\$(TargetCPU)-$(TargetOS)\JvOfficeColorPanelDemo"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Linking>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
</CompilerOptions>
<Debugging>
<Exceptions Count="3">
<Item1>
<Name Value="EAbort"/>
</Item1>
<Item2>
<Name Value="ECodetoolError"/>
</Item2>
<Item3>
<Name Value="EFOpenError"/>
</Item3>
</Exceptions>
</Debugging>
</CONFIG>

View File

@ -0,0 +1,22 @@
program JvOfficeColorPanelDemo;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms, main
{ you can add units after this };
{$R *.res}
begin
RequireDerivedFormResource:=True;
Application.Scaled:=True;
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.

View File

@ -0,0 +1,418 @@
object Form1: TForm1
Left = 361
Height = 292
Top = 225
Width = 559
AutoSize = True
Caption = 'JvOfficeColorPanel demo'
ClientHeight = 292
ClientWidth = 559
OnCreate = FormCreate
ShowHint = True
LCLVersion = '2.1.0.0'
object JvOfficeColorPanel1: TJvOfficeColorPanel
AnchorSideLeft.Control = gbColorView
AnchorSideTop.Control = gbColorView
AnchorSideTop.Side = asrBottom
Left = 6
Height = 162
Top = 117
Width = 152
BevelInner = bvRaised
BevelOuter = bvLowered
BorderSpacing.Bottom = 6
FlatBorderColor = clHotLight
SelectedColor = clDefault
ColorDlgCustomColors.Strings = (
'ColorA=000000'
'ColorB=000080'
'ColorC=008000'
'ColorD=008080'
'ColorE=800000'
'ColorF=800080'
'ColorG=808000'
'ColorH=808080'
'ColorI=C0C0C0'
'ColorJ=0000FF'
'ColorK=00FF00'
'ColorL=00FFFF'
'ColorM=FF0000'
'ColorN=FF00FF'
'ColorO=FFFF00'
'ColorP=FFFFFF'
'ColorQ=C0DCC0'
'ColorR=F0CAA6'
'ColorS=F0FBFF'
'ColorT=A4A0A0'
)
TabOrder = 0
Properties.NoneColorCaption = 'No Color'
Properties.DefaultColorCaption = 'Automatic'
Properties.CustomColorCaption = 'Other Colors...'
Properties.NoneColorHint = 'No Color'
Properties.DefaultColorHint = 'Automatic'
Properties.CustomColorHint = 'Other Colors...'
OnColorChange = JvOfficeColorPanel1ColorChange
end
object Panel1: TPanel
AnchorSideLeft.Control = JvOfficeColorPanel1
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = Owner
Left = 188
Height = 198
Top = 6
Width = 347
BorderSpacing.Left = 24
BorderSpacing.Around = 6
BevelOuter = bvNone
ClientHeight = 198
ClientWidth = 347
TabOrder = 1
object cbFlatBorder: TCheckBox
AnchorSideLeft.Control = Panel1
AnchorSideTop.Control = Panel1
Left = 0
Height = 19
Top = 0
Width = 77
Caption = 'Flat border'
OnChange = cbFlatBorderChange
TabOrder = 0
end
object cbDefaultColorColor: TColorButton
AnchorSideLeft.Control = cbShowDefaultColor
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = cbShowDefaultColor
AnchorSideTop.Side = asrCenter
Left = 127
Height = 25
Top = 43
Width = 33
BorderSpacing.Left = 8
BorderWidth = 2
ButtonColorSize = 16
ButtonColor = clBlack
Margin = 4
OnColorChanged = cbDefaultColorColorColorChanged
end
object cbShowCustomColor: TCheckBox
AnchorSideLeft.Control = Panel1
AnchorSideTop.Control = cbShowUserColor
AnchorSideTop.Side = asrBottom
Left = 0
Height = 19
Top = 103
Width = 122
Caption = 'Show custom color'
Checked = True
OnChange = cbShowCustomColorChange
State = cbChecked
TabOrder = 1
end
object cbShowDefaultColor: TCheckBox
AnchorSideLeft.Control = Panel1
AnchorSideTop.Control = cbShowNoneColor
AnchorSideTop.Side = asrBottom
Left = 0
Height = 19
Top = 46
Width = 119
Caption = 'Show default color'
Checked = True
OnChange = cbShowDefaultColorChange
State = cbChecked
TabOrder = 2
end
object cbShowNoneColor: TCheckBox
AnchorSideLeft.Control = Panel1
AnchorSideTop.Control = cbFlatBorder
AnchorSideTop.Side = asrBottom
Left = 0
Height = 19
Top = 27
Width = 110
BorderSpacing.Top = 8
Caption = 'Show NoneColor'
OnChange = cbShowNoneColorChange
TabOrder = 3
end
object cbShowSystemColors: TCheckBox
AnchorSideLeft.Control = Panel1
AnchorSideTop.Control = cbShowDefaultColor
AnchorSideTop.Side = asrBottom
Left = 0
Height = 19
Top = 65
Width = 124
Caption = 'Show system colors'
OnChange = cbShowSystemColorsChange
TabOrder = 4
end
object cbShowUserColor: TCheckBox
AnchorSideLeft.Control = Panel1
AnchorSideTop.Control = cbShowSystemColors
AnchorSideTop.Side = asrBottom
Left = 0
Height = 19
Top = 84
Width = 104
Caption = 'Show user color'
OnChange = cbShowUserColorChange
TabOrder = 5
end
object seButtonHeight: TSpinEdit
AnchorSideLeft.Control = seColorSpaceBottom
AnchorSideTop.Control = Panel1
Left = 297
Height = 23
Top = 0
Width = 50
Alignment = taRightJustify
OnChange = seButtonHeightChange
TabOrder = 6
Value = 25
end
object Label1: TLabel
AnchorSideLeft.Control = lblColorSpaceBottom
AnchorSideTop.Control = seButtonHeight
AnchorSideTop.Side = asrCenter
Left = 184
Height = 15
Top = 4
Width = 73
BorderSpacing.Top = 16
Caption = 'Button height'
ParentColor = False
end
object lblColorSize: TLabel
AnchorSideLeft.Control = lblColorSpaceBottom
AnchorSideTop.Control = seColorSize
AnchorSideTop.Side = asrCenter
Left = 184
Height = 15
Top = 29
Width = 51
BorderSpacing.Top = 16
Caption = 'Color size'
ParentColor = False
end
object seColorSize: TSpinEdit
AnchorSideLeft.Control = seColorSpaceBottom
AnchorSideTop.Control = seButtonHeight
AnchorSideTop.Side = asrBottom
Left = 297
Height = 23
Top = 25
Width = 50
Alignment = taRightJustify
BorderSpacing.Top = 2
OnChange = seColorSizeChange
TabOrder = 7
Value = 25
end
object lblColorSpace: TLabel
AnchorSideLeft.Control = lblColorSpaceBottom
AnchorSideTop.Control = seColorSpace
AnchorSideTop.Side = asrCenter
Left = 184
Height = 15
Top = 54
Width = 62
BorderSpacing.Top = 16
Caption = 'Color space'
ParentColor = False
end
object seColorSpace: TSpinEdit
AnchorSideLeft.Control = seColorSpaceBottom
AnchorSideTop.Control = seColorSize
AnchorSideTop.Side = asrBottom
Left = 297
Height = 23
Top = 50
Width = 50
Alignment = taRightJustify
BorderSpacing.Top = 2
OnChange = seColorSpaceChange
TabOrder = 8
Value = 25
end
object lblColorSpaceTop: TLabel
AnchorSideLeft.Control = lblColorSpaceBottom
AnchorSideTop.Control = seColorSpaceTop
AnchorSideTop.Side = asrCenter
Left = 184
Height = 15
Top = 79
Width = 83
BorderSpacing.Top = 16
Caption = 'Color space top'
ParentColor = False
end
object seColorSpaceTop: TSpinEdit
AnchorSideLeft.Control = seColorSpaceBottom
AnchorSideTop.Control = seColorSpace
AnchorSideTop.Side = asrBottom
Left = 297
Height = 23
Top = 75
Width = 50
Alignment = taRightJustify
BorderSpacing.Top = 2
OnChange = seColorSpaceTopChange
TabOrder = 9
Value = 25
end
object lblColorSpaceBottom: TLabel
AnchorSideLeft.Control = cbDefaultColorColor
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = seColorSpaceBottom
AnchorSideTop.Side = asrCenter
Left = 184
Height = 15
Top = 104
Width = 105
BorderSpacing.Left = 24
BorderSpacing.Top = 16
Caption = 'Color space bottom'
ParentColor = False
end
object seColorSpaceBottom: TSpinEdit
AnchorSideLeft.Control = lblColorSpaceBottom
AnchorSideLeft.Side = asrBottom
AnchorSideTop.Control = seColorSpaceTop
AnchorSideTop.Side = asrBottom
Left = 297
Height = 23
Top = 100
Width = 50
Alignment = taRightJustify
BorderSpacing.Left = 8
BorderSpacing.Top = 2
OnChange = seColorSpaceBottomChange
TabOrder = 10
Value = 25
end
object lblTopMargin: TLabel
AnchorSideLeft.Control = lblColorSpaceBottom
AnchorSideTop.Control = seTopMargin
AnchorSideTop.Side = asrCenter
Left = 184
Height = 15
Top = 154
Width = 61
BorderSpacing.Top = 16
Caption = 'Top margin'
ParentColor = False
end
object seTopMargin: TSpinEdit
AnchorSideLeft.Control = seColorSpaceBottom
AnchorSideTop.Control = seHorizontalMargin
AnchorSideTop.Side = asrBottom
Left = 297
Height = 23
Top = 150
Width = 50
Alignment = taRightJustify
BorderSpacing.Top = 2
OnChange = seTopMarginChange
TabOrder = 11
Value = 25
end
object seBottomMargin: TSpinEdit
AnchorSideLeft.Control = seColorSpaceBottom
AnchorSideTop.Control = seTopMargin
AnchorSideTop.Side = asrBottom
Left = 297
Height = 23
Top = 175
Width = 50
Alignment = taRightJustify
BorderSpacing.Top = 2
OnChange = seBottomMarginChange
TabOrder = 12
Value = 25
end
object lblBottomMargin: TLabel
AnchorSideLeft.Control = lblColorSpaceBottom
AnchorSideTop.Control = seBottomMargin
AnchorSideTop.Side = asrCenter
Left = 184
Height = 15
Top = 179
Width = 81
BorderSpacing.Top = 16
Caption = 'Bottom margin'
ParentColor = False
end
object lblColorSpaceBottom1: TLabel
AnchorSideLeft.Control = lblColorSpaceBottom
AnchorSideTop.Control = seHorizontalMargin
AnchorSideTop.Side = asrCenter
Left = 184
Height = 15
Top = 129
Width = 96
BorderSpacing.Top = 16
Caption = 'Horizontal margin'
ParentColor = False
end
object seHorizontalMargin: TSpinEdit
AnchorSideLeft.Control = seBottomMargin
AnchorSideTop.Control = seColorSpaceBottom
AnchorSideTop.Side = asrBottom
Left = 297
Height = 23
Top = 125
Width = 50
Alignment = taRightJustify
BorderSpacing.Top = 2
OnChange = seHorizontalMarginChange
TabOrder = 13
Value = 25
end
object cbBackColor: TColorButton
AnchorSideLeft.Control = Panel1
AnchorSideTop.Control = cbShowCustomColor
AnchorSideTop.Side = asrBottom
AnchorSideRight.Control = cbDefaultColorColor
AnchorSideRight.Side = asrBottom
Left = 0
Height = 25
Top = 130
Width = 160
Anchors = [akTop, akLeft, akRight]
BorderSpacing.Top = 8
BorderWidth = 2
ButtonColorAutoSize = False
ButtonColorSize = 16
ButtonColor = clBlack
Caption = 'Background color'
Margin = 4
OnColorChanged = cbBackColorColorChanged
end
end
object gbColorView: TGroupBox
AnchorSideLeft.Control = Owner
AnchorSideTop.Control = Owner
Left = 6
Height = 105
Top = 6
Width = 152
BorderSpacing.Around = 6
Caption = 'Selected:'
ClientHeight = 85
ClientWidth = 148
TabOrder = 2
object shColorView: TShape
Left = 8
Height = 73
Top = 4
Width = 132
Align = alClient
BorderSpacing.Left = 8
BorderSpacing.Top = 4
BorderSpacing.Right = 8
BorderSpacing.Bottom = 8
end
end
end

View File

@ -0,0 +1,198 @@
unit main;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ExtCtrls, StdCtrls,
Spin, JvOfficeColorPanel;
type
{ TForm1 }
TForm1 = class(TForm)
cbFlatBorder: TCheckBox;
cbDefaultColorColor: TColorButton;
cbShowCustomColor: TCheckBox;
cbShowDefaultColor: TCheckBox;
cbShowNoneColor: TCheckBox;
cbShowSystemColors: TCheckBox;
cbShowUserColor: TCheckBox;
cbBackColor: TColorButton;
gbColorView: TGroupBox;
JvOfficeColorPanel1: TJvOfficeColorPanel;
Label1: TLabel;
lblColorSize: TLabel;
lblColorSpace: TLabel;
lblColorSpaceBottom1: TLabel;
lblColorSpaceTop: TLabel;
lblColorSpaceBottom: TLabel;
lblTopMargin: TLabel;
lblBottomMargin: TLabel;
Panel1: TPanel;
seColorSize: TSpinEdit;
seColorSpace: TSpinEdit;
seHorizontalMargin: TSpinEdit;
seColorSpaceTop: TSpinEdit;
seColorSpaceBottom: TSpinEdit;
seTopMargin: TSpinEdit;
seBottomMargin: TSpinEdit;
shColorView: TShape;
seButtonHeight: TSpinEdit;
procedure cbFlatBorderChange(Sender: TObject);
procedure cbDefaultColorColorColorChanged(Sender: TObject);
procedure cbShowCustomColorChange(Sender: TObject);
procedure cbShowDefaultColorChange(Sender: TObject);
procedure cbShowNoneColorChange(Sender: TObject);
procedure cbShowSystemColorsChange(Sender: TObject);
procedure cbShowUserColorChange(Sender: TObject);
procedure cbBackColorColorChanged(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure JvOfficeColorPanel1ColorChange(Sender: TObject);
procedure seButtonHeightChange(Sender: TObject);
procedure seColorSizeChange(Sender: TObject);
procedure seColorSpaceBottomChange(Sender: TObject);
procedure seColorSpaceChange(Sender: TObject);
procedure seColorSpaceTopChange(Sender: TObject);
procedure seBottomMarginChange(Sender: TObject);
procedure seHorizontalMarginChange(Sender: TObject);
procedure seTopMarginChange(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
uses
LCLIntf, JvJCLUtils;
{$R *.lfm}
{ TForm1 }
procedure TForm1.cbFlatBorderChange(Sender: TObject);
begin
JvOfficeColorPanel1.FlatBorder := cbFlatBorder.Checked;
end;
procedure TForm1.cbShowCustomColorChange(Sender: TObject);
begin
JvOfficeColorPanel1.Properties.ShowCustomColor := cbShowCustomColor.Checked;
end;
procedure TForm1.cbShowDefaultColorChange(Sender: TObject);
begin
JvOfficeColorPanel1.Properties.ShowDefaultColor := cbShowDefaultColor.Checked;
end;
procedure TForm1.cbShowNoneColorChange(Sender: TObject);
begin
JvOfficeColorPanel1.Properties.ShowNoneColor := cbShowNoneColor.Checked;
end;
procedure TForm1.cbShowSystemColorsChange(Sender: TObject);
begin
JvOfficeColorPanel1.Properties.ShowSystemColors := cbShowSystemColors.Checked;
end;
procedure TForm1.cbShowUserColorChange(Sender: TObject);
begin
JvOfficeColorPanel1.Properties.ShowUserColors := cbShowUserColor.Checked;
end;
procedure TForm1.cbBackColorColorChanged(Sender: TObject);
begin
JvOfficeColorPanel1.BackColor := cbBackColor.ButtonColor;
end;
procedure TForm1.cbDefaultColorColorColorChanged(Sender: TObject);
begin
JvOfficeColorPanel1.Properties.DefaultColorColor := cbDefaultColorColor.ButtonColor;
end;
procedure TForm1.FormCreate(Sender: TObject);
var
i: Integer;
c: TColor;
begin
JvOfficeColorPanel1.UserColors.BeginUpdate;
try
for i:=0 to 15 do begin
c := RGB(Random(256), Random(256), Random(256));
JvOfficeColorPanel1.UserColors.Add(Format('$%.6x=($)', [c]));
end;
finally
JvOfficeColorPanel1.UserColors.EndUpdate;
end;
cbBackColor.ButtonColor := JvOfficeColorPanel1.BackColor;
cbDefaultColorColor.ButtonColor := JvOfficeColorPanel1.Properties.DefaultColorColor;
seButtonHeight.Value := JvOfficeColorPanel1.Properties.ButtonHeight;
seColorSize.Value := JvOfficeColorPanel1.Properties.ColorSize;
seColorSpace.Value := JvOfficeColorPanel1.Properties.ColorSpace;
seColorSpaceTop.Value := JvOfficeColorPanel1.Properties.ColorSpaceTop;
seColorSpaceBottom.Value := JvOfficeColorPanel1.Properties.ColorSpaceBottom;
seHorizontalMargin.Value := JvOfficeColorPanel1.Properties.HorizontalMargin;
seTopMargin.Value := JvOfficeColorPanel1.Properties.TopMargin;
seBottomMargin.Value := JvOfficeColorPanel1.Properties.BottomMargin;
end;
procedure TForm1.JvOfficeColorPanel1ColorChange(Sender: TObject);
begin
shColorView.Brush.Color := JvOfficeColorPanel1.SelectedColor;
if JvOfficeColorPanel1.SelectedColor = clNone then
shColorView.Brush.Style := bsClear
else
shColorView.Brush.Style := bsSolid;
gbColorView.Caption := 'Selected: ' + ColorToPrettyName(JvOfficeColorPanel1.SelectedColor);
end;
procedure TForm1.seButtonHeightChange(Sender: TObject);
begin
JvOfficeColorPanel1.Properties.ButtonHeight := seButtonHeight.Value;
end;
procedure TForm1.seColorSizeChange(Sender: TObject);
begin
JvOfficeColorPanel1.Properties.ColorSize := seColorSize.Value;
end;
procedure TForm1.seColorSpaceBottomChange(Sender: TObject);
begin
JvOfficeColorPanel1.Properties.ColorSpaceBottom := seColorSpaceBottom.Value;
end;
procedure TForm1.seColorSpaceChange(Sender: TObject);
begin
JvOfficeColorPanel1.Properties.ColorSpace := seColorSpace.Value;
end;
procedure TForm1.seColorSpaceTopChange(Sender: TObject);
begin
JvOfficeColorPanel1.Properties.ColorSpaceTop := seColorSpaceTop.Value;
end;
procedure TForm1.seHorizontalMarginChange(Sender: TObject);
begin
JvOfficeColorPanel1.Properties.HorizontalMargin := seHorizontalMargin.Value;
end;
procedure TForm1.seBottomMarginChange(Sender: TObject);
begin
JvOfficeColorPanel1.Properties.BottomMargin := seBottomMargin.Value;
end;
procedure TForm1.seTopMarginChange(Sender: TObject);
begin
JvOfficeColorPanel1.Properties.TopMargin := seTopMargin.Value;
end;
end.

View File

@ -17,7 +17,7 @@ Movable bevel and panel, ruler, exandable panel (RollOut), group header, hyperte
"/> "/>
<License Value="The JVCL is released in accordance with the MPL 1.1 license. To get your own copy or read it, go to http://www.mozilla.org/MPL/MPL-1.1.html. "/> <License Value="The JVCL is released in accordance with the MPL 1.1 license. To get your own copy or read it, go to http://www.mozilla.org/MPL/MPL-1.1.html. "/>
<Version Major="1" Release="6"/> <Version Major="1" Release="6"/>
<Files Count="9"> <Files Count="10">
<Item1> <Item1>
<Filename Value="..\run\JvCtrls\jvhint.pas"/> <Filename Value="..\run\JvCtrls\jvhint.pas"/>
<UnitName Value="JvHint"/> <UnitName Value="JvHint"/>
@ -54,14 +54,21 @@ Movable bevel and panel, ruler, exandable panel (RollOut), group header, hyperte
<Filename Value="..\run\JvCtrls\jvinstalllabel.pas"/> <Filename Value="..\run\JvCtrls\jvinstalllabel.pas"/>
<UnitName Value="JvInstallLabel"/> <UnitName Value="JvInstallLabel"/>
</Item9> </Item9>
<Item10>
<Filename Value="..\run\JvCtrls\jvofficecolorpanel.pas"/>
<UnitName Value="JvOfficeColorPanel"/>
</Item10>
</Files> </Files>
<RequiredPkgs Count="2"> <RequiredPkgs Count="3">
<Item1> <Item1>
<PackageName Value="JvCoreLazR"/> <PackageName Value="JvStdCtrlsLazR"/>
</Item1> </Item1>
<Item2> <Item2>
<PackageName Value="FCL"/> <PackageName Value="JvCoreLazR"/>
</Item2> </Item2>
<Item3>
<PackageName Value="FCL"/>
</Item3>
</RequiredPkgs> </RequiredPkgs>
<UsageOptions> <UsageOptions>
<UnitPath Value="$(PkgOutDir)"/> <UnitPath Value="$(PkgOutDir)"/>

View File

@ -90,10 +90,7 @@ procedure DrawDotNetControl(Control: TWinControl; AColor: TColor; InControl: Boo
procedure HandleDotNetHighlighting(Control: TWinControl; const Msg: TLMessage; procedure HandleDotNetHighlighting(Control: TWinControl; const Msg: TLMessage;
MouseOver: Boolean; Color: TColor); MouseOver: Boolean; Color: TColor);
procedure CreateWMMessage(var Mesg: TLMessage; Msg: Cardinal; WParam: WPARAM; LParam: LPARAM); overload; {$IFDEF SUPPORTS_INLINE} inline {$ENDIF} procedure CreateWMMessage(out Mesg: TLMessage; Msg: Cardinal; WParam: WPARAM; LParam: LPARAM); overload; {$IFDEF SUPPORTS_INLINE} inline {$ENDIF}
//function CreateWMMessage(Msg: Integer; WParam: PtrInt; LParam: PtrInt): TLMessage; overload; {$IFDEF SUPPORTS_INLINE} inline {$ENDIF}
//function CreateWMMessage(Msg: Integer; WParam: PtrInt; LParam: TControl): TLMessage; overload; {$IFDEF SUPPORTS_INLINE} inline {$ENDIF}
function SmallPointToLong(const Pt: TSmallPoint): LongInt; {$IFDEF SUPPORTS_INLINE} inline {$ENDIF} function SmallPointToLong(const Pt: TSmallPoint): LongInt; {$IFDEF SUPPORTS_INLINE} inline {$ENDIF}
function ShiftStateToKeyData(Shift: TShiftState): Longint; function ShiftStateToKeyData(Shift: TShiftState): Longint;
function GetFocusedControl(AControl: TControl): TWinControl; function GetFocusedControl(AControl: TControl): TWinControl;
@ -303,7 +300,7 @@ end;
begin begin
end; end;
procedure CreateWMMessage(var Mesg: TLMessage; Msg: Cardinal; WParam: WPARAM; LParam: LPARAM); procedure CreateWMMessage(out Mesg: TLMessage; Msg: Cardinal; WParam: WPARAM; LParam: LPARAM);
begin begin
Mesg.Msg := Msg; Mesg.Msg := Msg;
Mesg.WParam := WParam; Mesg.WParam := WParam;

View File

@ -47,7 +47,8 @@ interface
uses uses
LCLIntf, LCLType, LCLIntf, LCLType,
SysUtils, Classes, Graphics; SysUtils, Classes, Graphics,
JvTypes;
const const
(******************** NOT CONVERTED (******************** NOT CONVERTED
@ -322,8 +323,10 @@ function TrueInflateRect(const R: TRect; const I: Integer): TRect;
{**** Color routines } {**** Color routines }
procedure RGBToHSV(R, G, B: Integer; var H, S, V: Integer); procedure RGBToHSV(R, G, B: Integer; var H, S, V: Integer);
function RGBToBGR(Value: Cardinal): Cardinal; function RGBToBGR(Value: Cardinal): Cardinal;
***********************************)
function ColorToPrettyName(Value: TColor): string; function ColorToPrettyName(Value: TColor): string;
function PrettyNameToColor(const Value: string): TColor; function PrettyNameToColor(const Value: string): TColor;
(******************** NOT CONVERTED ***
{**** other routines } {**** other routines }
procedure SwapInt(var Int1, Int2: Integer); {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF SUPPORTS_INLINE} procedure SwapInt(var Int1, Int2: Integer); {$IFDEF SUPPORTS_INLINE} inline; {$ENDIF SUPPORTS_INLINE}
@ -366,6 +369,7 @@ function ReplaceAllStrings(const S: string; Words, Frases: TStrings): string;
function ReplaceStrings(const S: string; PosBeg, Len: Integer; Words, Frases: TStrings; var NewSelStart: Integer): string; function ReplaceStrings(const S: string; PosBeg, Len: Integer; Words, Frases: TStrings; var NewSelStart: Integer): string;
{ CountOfLines calculates the lines count in a string, S, { CountOfLines calculates the lines count in a string, S,
each line must be separated from another with CrLf sequence } each line must be separated from another with CrLf sequence }
*****************************)
function CountOfLines(const S: string): Integer; function CountOfLines(const S: string): Integer;
{ DeleteLines deletes all lines from strings which in the words, words. { DeleteLines deletes all lines from strings which in the words, words.
The word of will be deleted from strings. } The word of will be deleted from strings. }
@ -373,6 +377,7 @@ procedure DeleteOfLines(Ss: TStrings; const Words: array of string);
{ DeleteEmptyLines deletes all empty lines from strings, Ss. { DeleteEmptyLines deletes all empty lines from strings, Ss.
Lines contained only spaces also deletes. } Lines contained only spaces also deletes. }
procedure DeleteEmptyLines(Ss: TStrings); procedure DeleteEmptyLines(Ss: TStrings);
(************************** NOT CONVERTED ************
{ SQLAddWhere addes or modifies existing where-statement, where, { SQLAddWhere addes or modifies existing where-statement, where,
to the strings, SQL. to the strings, SQL.
Note: If strings SQL allready contains where-statement, Note: If strings SQL allready contains where-statement,
@ -3568,6 +3573,7 @@ begin
for I := 0 to Words.Count - 1 do for I := 0 to Words.Count - 1 do
Result := ReplaceString(Result, Words[I], Frases[I]); Result := ReplaceString(Result, Words[I], Frases[I]);
end; end;
*********************************)
function CountOfLines(const S: string): Integer; function CountOfLines(const S: string): Integer;
begin begin
@ -3600,6 +3606,7 @@ begin
DeleteOfLines(Ss,['']); DeleteOfLines(Ss,['']);
end; end;
(************************* NOT CONVERTED ****
procedure SQLAddWhere(SQL: TStrings; const Where: string); procedure SQLAddWhere(SQL: TStrings; const Where: string);
var var
I, J: Integer; I, J: Integer;
@ -9667,6 +9674,7 @@ begin
(Value and $0000FF00) or (Value and $0000FF00) or
((Value and $000000FF) shl 16); ((Value and $000000FF) shl 16);
end; end;
*************************)
function ColorToPrettyName(Value: TColor): string; function ColorToPrettyName(Value: TColor): string;
var var
@ -9728,6 +9736,7 @@ begin
Result := clNone; Result := clNone;
end; end;
(********************** NOT CONVERTED ****
{$IFNDEF CLR} {$IFNDEF CLR}
function StartsText(const SubStr, S: string): Boolean; function StartsText(const SubStr, S: string): Boolean;
begin begin

View File

@ -39,7 +39,9 @@ unit JvTypes;
interface interface
uses uses
Classes, Controls, Forms, Graphics, LMessages, SysUtils; LCLType,
Classes, Controls, Forms, Graphics, LMessages, SysUtils,
JvResources;
const const
MaxPixelCount = 32767; MaxPixelCount = 32767;
@ -385,11 +387,12 @@ const
DefaultHotTrackColor = $00D2BDB6; DefaultHotTrackColor = $00D2BDB6;
DefaultHotTrackFrameColor = $006A240A; DefaultHotTrackFrameColor = $006A240A;
(********************
type type
(******************** NOT CONVERTED ***********
// from JvListView.pas // from JvListView.pas
TJvSortMethod = (smAutomatic, smAlphabetic, smNonCaseSensitive, smNumeric, smDate, smTime, smDateTime, smCurrency); TJvSortMethod = (smAutomatic, smAlphabetic, smNonCaseSensitive, smNumeric, smDate, smTime, smDateTime, smCurrency);
TJvListViewColumnSortEvent = procedure(Sender: TObject; Column: Integer; var AMethod: TJvSortMethod) of object; TJvListViewColumnSortEvent = procedure(Sender: TObject; Column: Integer; var AMethod: TJvSortMethod) of object;
**********************************************)
// from JvOfficeColorPanel.pas // from JvOfficeColorPanel.pas
TJvAddInControlSiteInfo = record TJvAddInControlSiteInfo = record
@ -404,6 +407,10 @@ type
TJvColorQuadLayOut = (cqlNone, cqlLeft, cqlRight, cqlClient); TJvColorQuadLayOut = (cqlNone, cqlLeft, cqlRight, cqlClient);
TJvGetAddInControlSiteInfoEvent = procedure(Sender: TControl; var ASiteInfo: TJvAddInControlSiteInfo) of object; TJvGetAddInControlSiteInfoEvent = procedure(Sender: TControl; var ASiteInfo: TJvAddInControlSiteInfo) of object;
TJvColorDialogOption = (jcdFullOpen, jcdPreventFullOpen, jcdShowHelp,
jcdSolidColor, jcdAnyColor);
TJvColorDialogOptions = set of TJvColorDialogOption;
// from JvColorProvider.pas // from JvColorProvider.pas
TColorType = (ctStandard, ctSystem, ctCustom); TColorType = (ctStandard, ctSystem, ctCustom);
@ -417,19 +424,12 @@ const
ColCount = 20; ColCount = 20;
StandardColCount = 40; StandardColCount = 40;
SysColCount = 30; SysColCount = 30;
{$IFDEF COMPILER5}
clSystemColor = TColor($80000000); clSystemColor = TColor($80000000);
clHotLight = TColor(clSystemColor or COLOR_HOTLIGHT); clHotLight = TColor(clSystemColor or COLOR_HOTLIGHT);
clGradientActiveCaption = TColor(clSystemColor or COLOR_GRADIENTACTIVECAPTION); clGradientActiveCaption = TColor(clSystemColor or COLOR_GRADIENTACTIVECAPTION);
clGradientInactiveCaption = TColor(clSystemColor or COLOR_GRADIENTINACTIVECAPTION); clGradientInactiveCaption = TColor(clSystemColor or COLOR_GRADIENTINACTIVECAPTION);
clMenuHighlight = TColor(clSystemColor or COLOR_MENUHILIGHT); clMenuHighlight = TColor(clSystemColor or COLOR_MENUHILIGHT);
clMenuBar = TColor(clSystemColor or COLOR_MENUBAR); clMenuBar = TColor(clSystemColor or COLOR_MENUBAR);
{$ENDIF COMPILER5}
{$IFDEF COMPILER6}
{$IF not declared(clHotLight)}
{$MESSAGE ERROR 'You do not have installed Delphi 6 Update 2. Please install this before installing the JVCL. http://www.borland.com/downloads/registered/del6_reg_updates_prompt.html'}
{$IFEND}
{$ENDIF COMPILER6}
ColorValues: array [0 .. ColCount - 1] of TDefColorItem = ( ColorValues: array [0 .. ColCount - 1] of TDefColorItem = (
(Value: clBlack; Constant: 'clBlack'; Description: RsClBlack), (Value: clBlack; Constant: 'clBlack'; Description: RsClBlack),
@ -537,6 +537,7 @@ const
); );
(********************** NOT CONVERTED ****
type type
TJvSizeRect = packed record TJvSizeRect = packed record
Top: Integer; Top: Integer;
@ -692,6 +693,9 @@ type
{$ENDIF !CLR} {$ENDIF !CLR}
***************) ***************)
function DrawTextBiDiModeFlags(AControl: TControl; AFlags: LongInt): LongInt;
implementation implementation
{ TJvPersistent } { TJvPersistent }
@ -788,5 +792,29 @@ begin
Changed; Changed;
end; end;
{------------------------------------------------------------------------------}
function DrawTextBiDiModeFlags(AControl: TControl; AFlags: LongInt): LongInt;
var
alignment: TAlignment;
begin
Result := AFlags;
if AControl.UseRightToLeftAlignment then begin
if AFlags and DT_RIGHT <> 0 then
alignment := taRightJustify
else
if AFlags and DT_CENTER <> 0 then
alignment := taCenter
else
alignment := taLeftJustify;
case alignment of
taLeftJustify: Result := Result or DT_RIGHT;
taRightJustify: Result := Result and not DT_RIGHT;
end;
end;
if AControl.UseRightToLeftReading then
Result := Result or DT_RTLREADING;
end;
end. end.

View File

@ -270,6 +270,13 @@ begin
ts := Canvas.TextStyle; ts := Canvas.TextStyle;
ts.ShowPrefix := false; ts.ShowPrefix := false;
ts.RightToLeft := IsRightToLeft; ts.RightToLeft := IsRightToLeft;
ts.ExpandTabs := Flags and DT_EXPANDTABS <> 0;
ts.Wordbreak := Flags and DT_WORDBREAK <> 0;
ts.SingleLine := not ts.WordBreak;
ts.EndEllipsis := Flags and DT_END_ELLIPSIS <> 0;
ts.Alignment := taLeftJustify;
if Flags and DT_RIGHT <> 0 then ts.Alignment := taRightJustify;
if Flags and DT_CENTER <> 0 then ts.Alignment := taCenter;
Canvas.Font := Font; Canvas.Font := Font;
if not Enabled then if not Enabled then
begin begin

View File

@ -341,8 +341,8 @@ type
procedure SetSuperSubScriptRatio(const Value: Double); procedure SetSuperSubScriptRatio(const Value: Double);
protected protected
procedure CalculatePreferredSize(var PreferredWidth, PreferredHeight: integer; procedure CalculatePreferredSize(var PreferredWidth, PreferredHeight: integer;
WithThemeSpace: Boolean); override; {%H-}WithThemeSpace: Boolean); override;
procedure CalculateSize(MaxWidth: integer; var NeededWidth, NeededHeight: integer); procedure CalculateSize(MaxWidth: integer; out NeededWidth, NeededHeight: integer);
function ComputeLayoutRect: TRect; function ComputeLayoutRect: TRect;
procedure FontChanged(Sender: TObject); override; procedure FontChanged(Sender: TObject); override;
procedure MouseMove(Shift: TShiftState; X, Y: Integer); override; procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;
@ -895,7 +895,7 @@ begin
end; end;
procedure TJvCustomHTLabel.CalculateSize(MaxWidth: integer; procedure TJvCustomHTLabel.CalculateSize(MaxWidth: integer;
var NeededWidth, NeededHeight: integer); out NeededWidth, NeededHeight: integer);
begin begin
Canvas.Handle; Canvas.Handle;
Canvas.Font.Assign(Font); Canvas.Font.Assign(Font);

View File

@ -126,6 +126,7 @@ procedure TJvMovableBevel.DoMove(Shift: TShiftState; DeltaX, DeltaY: Integer);
begin begin
// Must work on it in order to make expand and shrink the way coreldraw does when // Must work on it in order to make expand and shrink the way coreldraw does when
// shift and ctrl keys are pressed. // shift and ctrl keys are pressed.
{ If ssCtrl in shift then { If ssCtrl in shift then
begin begin
if Abs(FStartPoint.X - Left) < Abs(FStartPoint.Y - Top) then if Abs(FStartPoint.X - Left) < Abs(FStartPoint.Y - Top) then

File diff suppressed because it is too large Load Diff

View File

@ -44,7 +44,7 @@ interface
uses uses
LCLType, LCLIntf, LMessages, Types, LCLType, LCLIntf, LMessages, Types,
SysUtils, Classes, Graphics, Controls, Forms, ExtCtrls, SysUtils, Classes, Graphics, Controls, Forms, ExtCtrls,
JvTypes, JvExtComponent, JvExControls, JvHotTrackPersistent; JvTypes, JvExtComponent, JvHotTrackPersistent;
type type
TJvPanelResizeParentEvent = procedure(Sender: TObject; nLeft, nTop, nWidth, nHeight: Integer) of object; TJvPanelResizeParentEvent = procedure(Sender: TObject; nLeft, nTop, nWidth, nHeight: Integer) of object;
@ -869,9 +869,7 @@ begin
Inc(BevelSize, BevelWidth); Inc(BevelSize, BevelWidth);
InflateRect(ATextRect, -BevelSize, -BevelSize); InflateRect(ATextRect, -BevelSize, -BevelSize);
Flags := DT_EXPANDTABS or WORDWRAPS[MultiLine] or ALIGNMENTS[Alignment]; Flags := DT_EXPANDTABS or WORDWRAPS[MultiLine] or ALIGNMENTS[Alignment];
(*************** NOT CONVERTED *** Flags := DrawTextBiDiModeFlags(Self, Flags);
Flags := DrawTextBiDiModeFlags(Flags);
*********************************)
//calculate required rectangle size //calculate required rectangle size
DrawText(ACanvas.Handle, PChar(Caption), -1, ATextRect, Flags or DT_CALCRECT); DrawText(ACanvas.Handle, PChar(Caption), -1, ATextRect, Flags or DT_CALCRECT);