jvcllaz: Fix JvHMI package name case. Fix compilation in Linux. Add color selection to demo program of DialButton.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6946 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2019-05-25 18:41:09 +00:00
parent bc9e8f14dc
commit bf30233549
7 changed files with 59 additions and 33 deletions

View File

@ -1,11 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<CONFIG> <CONFIG>
<ProjectOptions> <ProjectOptions>
<Version Value="11"/> <Version Value="12"/>
<PathDelim Value="\"/> <PathDelim Value="\"/>
<General> <General>
<Flags>
<CompatibilityMode Value="True"/>
</Flags>
<SessionStorage Value="InProjectDir"/> <SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="JvDialButtonDemo"/> <Title Value="JvDialButtonDemo"/>
<Scaled Value="True"/> <Scaled Value="True"/>
<ResourceType Value="res"/> <ResourceType Value="res"/>
@ -28,7 +30,7 @@
</RunParams> </RunParams>
<RequiredPackages Count="2"> <RequiredPackages Count="2">
<Item1> <Item1>
<PackageName Value="jvhmilazr"/> <PackageName Value="JvHMILazR"/>
</Item1> </Item1>
<Item2> <Item2>
<PackageName Value="LCL"/> <PackageName Value="LCL"/>

View File

@ -2,10 +2,10 @@ object Form1: TForm1
Left = 345 Left = 345
Height = 290 Height = 290
Top = 131 Top = 131
Width = 320 Width = 363
Caption = 'Form1' Caption = 'Form1'
ClientHeight = 290 ClientHeight = 290
ClientWidth = 320 ClientWidth = 363
OnCreate = FormCreate OnCreate = FormCreate
LCLVersion = '2.1.0.0' LCLVersion = '2.1.0.0'
object JvDialButton1: TJvDialButton object JvDialButton1: TJvDialButton
@ -17,7 +17,6 @@ object Form1: TForm1
Color = clMoneyGreen Color = clMoneyGreen
DefaultPos = 0 DefaultPos = 0
ParentColor = False ParentColor = False
PointerPenWidth = 3
Radius = 48 Radius = 48
TickStyle = tsAuto TickStyle = tsAuto
TabOrder = 0 TabOrder = 0
@ -25,65 +24,65 @@ object Form1: TForm1
end end
object JvLED1: TJvLED object JvLED1: TJvLED
Left = 197 Left = 197
Top = 24 Top = 8
ColorOn = clRed ColorOn = clRed
ColorOff = clMaroon ColorOff = clMaroon
Status = False Status = False
end end
object JvLED2: TJvLED object JvLED2: TJvLED
Left = 197 Left = 197
Top = 40 Top = 24
ColorOn = clRed ColorOn = clRed
ColorOff = clMaroon ColorOff = clMaroon
Status = False Status = False
end end
object JvLED3: TJvLED object JvLED3: TJvLED
Left = 197 Left = 197
Top = 56 Top = 40
ColorOn = clYellow ColorOn = clYellow
ColorOff = clOlive ColorOff = clOlive
Status = False Status = False
end end
object JvLED4: TJvLED object JvLED4: TJvLED
Left = 197 Left = 197
Top = 72 Top = 56
ColorOn = clYellow ColorOn = clYellow
ColorOff = clOlive ColorOff = clOlive
Status = False Status = False
end end
object JvLED5: TJvLED object JvLED5: TJvLED
Left = 197 Left = 197
Top = 88 Top = 72
ColorOff = clGreen ColorOff = clGreen
Status = False Status = False
end end
object JvLED6: TJvLED object JvLED6: TJvLED
Left = 197 Left = 197
Top = 104 Top = 88
ColorOff = clGreen ColorOff = clGreen
Status = False Status = False
end end
object JvLED7: TJvLED object JvLED7: TJvLED
Left = 197 Left = 197
Top = 120 Top = 104
ColorOff = clGreen ColorOff = clGreen
Status = False Status = False
end end
object JvLED8: TJvLED object JvLED8: TJvLED
Left = 197 Left = 197
Top = 136 Top = 120
ColorOff = clGreen ColorOff = clGreen
Status = False Status = False
end end
object JvLED9: TJvLED object JvLED9: TJvLED
Left = 197 Left = 197
Top = 152 Top = 136
ColorOff = clGreen ColorOff = clGreen
Status = False Status = False
end end
object JvLED10: TJvLED object JvLED10: TJvLED
Left = 197 Left = 197
Top = 168 Top = 152
ColorOff = clGreen ColorOff = clGreen
Status = False Status = False
end end
@ -136,4 +135,22 @@ object Form1: TForm1
TabOrder = 2 TabOrder = 2
Text = 'bsNone' Text = 'bsNone'
end end
object cbColor: TColorBox
Left = 192
Height = 24
Top = 201
Width = 128
Selected = clMoneyGreen
ItemHeight = 16
OnChange = cbColorChange
TabOrder = 3
end
object Label1: TLabel
Left = 192
Height = 15
Top = 184
Width = 29
Caption = 'Color'
ParentColor = False
end
end end

View File

@ -5,8 +5,8 @@ unit JvDialButtonDemoForm;
interface interface
uses uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, JvDialButton, Classes, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ColorBox,
JvLED; JvDialButton, JvLED;
type type
@ -15,6 +15,7 @@ type
TForm1 = class(TForm) TForm1 = class(TForm)
cmbPointerShape: TComboBox; cmbPointerShape: TComboBox;
cmbBorderStyle: TComboBox; cmbBorderStyle: TComboBox;
cbColor: TColorBox;
JvDialButton1: TJvDialButton; JvDialButton1: TJvDialButton;
JvLED1: TJvLED; JvLED1: TJvLED;
JvLED10: TJvLED; JvLED10: TJvLED;
@ -26,10 +27,12 @@ type
JvLED7: TJvLED; JvLED7: TJvLED;
JvLED8: TJvLED; JvLED8: TJvLED;
JvLED9: TJvLED; JvLED9: TJvLED;
Label1: TLabel;
lblPointerShape: TLabel; lblPointerShape: TLabel;
lblBorderStyle: TLabel; lblBorderStyle: TLabel;
procedure cmbBorderStyleChange(Sender: TObject); procedure cmbBorderStyleChange(Sender: TObject);
procedure cmbPointerShapeChange(Sender: TObject); procedure cmbPointerShapeChange(Sender: TObject);
procedure cbColorChange(Sender: TObject);
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
procedure JvDialButton1Change(Sender: TObject); procedure JvDialButton1Change(Sender: TObject);
private private
@ -81,6 +84,11 @@ begin
JvDialButton1.PointerShape := TJvDialPointerShape(cmbPointerShape.ItemIndex); JvDialButton1.PointerShape := TJvDialPointerShape(cmbPointerShape.ItemIndex);
end; end;
procedure TForm1.cbColorChange(Sender: TObject);
begin
JvDialButton1.Color := cbColor.Selected;
end;
procedure TForm1.cmbBorderStyleChange(Sender: TObject); procedure TForm1.cmbBorderStyleChange(Sender: TObject);
begin begin
case cmbBorderStyle.ItemIndex of case cmbBorderStyle.ItemIndex of

View File

@ -1,11 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<CONFIG> <CONFIG>
<ProjectOptions> <ProjectOptions>
<Version Value="11"/> <Version Value="12"/>
<PathDelim Value="\"/> <PathDelim Value="\"/>
<General> <General>
<Flags>
<CompatibilityMode Value="True"/>
</Flags>
<SessionStorage Value="InProjectDir"/> <SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="JvLEDDemo"/> <Title Value="JvLEDDemo"/>
<Scaled Value="True"/> <Scaled Value="True"/>
<ResourceType Value="res"/> <ResourceType Value="res"/>
@ -27,7 +29,7 @@
</RunParams> </RunParams>
<RequiredPackages Count="2"> <RequiredPackages Count="2">
<Item1> <Item1>
<PackageName Value="jvhmilazr"/> <PackageName Value="JvHMILazR"/>
</Item1> </Item1>
<Item2> <Item2>
<PackageName Value="LCL"/> <PackageName Value="LCL"/>

View File

@ -2,7 +2,7 @@
<CONFIG> <CONFIG>
<Package Version="4"> <Package Version="4">
<PathDelim Value="\"/> <PathDelim Value="\"/>
<Name Value="jvhmilazd"/> <Name Value="JvHMILazD"/>
<Type Value="RunAndDesignTime"/> <Type Value="RunAndDesignTime"/>
<Author Value="Various authors - see header of each unit for original author."/> <Author Value="Various authors - see header of each unit for original author."/>
<CompilerOptions> <CompilerOptions>
@ -32,7 +32,7 @@
<PackageName Value="JvCoreLazD"/> <PackageName Value="JvCoreLazD"/>
</Item1> </Item1>
<Item2> <Item2>
<PackageName Value="jvhmilazr"/> <PackageName Value="JvHMILazR"/>
</Item2> </Item2>
</RequiredPkgs> </RequiredPkgs>
<UsageOptions> <UsageOptions>

View File

@ -2,7 +2,7 @@
<CONFIG> <CONFIG>
<Package Version="4"> <Package Version="4">
<PathDelim Value="\"/> <PathDelim Value="\"/>
<Name Value="jvhmilazr"/> <Name Value="JvHMILazR"/>
<Author Value="Various authors - see header of each unit for original author."/> <Author Value="Various authors - see header of each unit for original author."/>
<CompilerOptions> <CompilerOptions>
<Version Value="11"/> <Version Value="11"/>
@ -29,13 +29,10 @@
<UnitName Value="JvLED"/> <UnitName Value="JvLED"/>
</Item2> </Item2>
</Files> </Files>
<RequiredPkgs Count="2"> <RequiredPkgs Count="1">
<Item1> <Item1>
<PackageName Value="JvCoreLazR"/> <PackageName Value="JvCoreLazR"/>
</Item1> </Item1>
<Item2>
<PackageName Value="LCL"/>
</Item2>
</RequiredPkgs> </RequiredPkgs>
<UsageOptions> <UsageOptions>
<UnitPath Value="$(PkgOutDir)"/> <UnitPath Value="$(PkgOutDir)"/>

View File

@ -125,8 +125,8 @@ type
// procedure CMCtl3DChanged(var Msg: TLMessage); message CM_CTL3DCHANGED; // procedure CMCtl3DChanged(var Msg: TLMessage); message CM_CTL3DCHANGED;
// procedure WMSysColorChange(var Msg: TLMessage); message LM_SYSCOLORCHANGE; // procedure WMSysColorChange(var Msg: TLMessage); message LM_SYSCOLORCHANGE;
// procedure WndProc(var Msg: TLMessage); override; // procedure WndProc(var Msg: TLMessage); override;
procedure FocusSet(PrevWnd: THandle); override; // procedure FocusSet(PrevWnd: THandle); override;
procedure FocusKilled(NextWnd: THandle); override; // procedure FocusKilled(NextWnd: THandle); override;
procedure ColorChanged; override; procedure ColorChanged; override;
procedure ParentColorChanged; override; procedure ParentColorChanged; override;
procedure DrawBorder; dynamic; procedure DrawBorder; dynamic;
@ -929,7 +929,6 @@ const
HalfPi = 1.57079632679489661923; HalfPi = 1.57079632679489661923;
var var
Edge: Integer; Edge: Integer;
ButtonRect: TRect;
Face, Highlight, Shadow: TColor; Face, Highlight, Shadow: TColor;
Size: Integer; Size: Integer;
OldOrg: TPoint; OldOrg: TPoint;
@ -938,7 +937,6 @@ var
lColor: TColor; lColor: TColor;
begin begin
Size := 2 * FRadius + 1; Size := 2 * FRadius + 1;
ButtonRect := Bounds(0, 0, Size, Size);
lCanvas := FBitmap.Canvas; lCanvas := FBitmap.Canvas;
lCanvas.Brush.Color := Parent.Brush.Color; lCanvas.Brush.Color := Parent.Brush.Color;
lCanvas.Brush.Style := bsSolid; lCanvas.Brush.Style := bsSolid;
@ -1072,6 +1070,8 @@ begin
end; end;
end; end;
{ - strange: does not compile in qt with these methods...
procedure TJvCustomDialButton.FocusKilled(NextWnd: THandle); procedure TJvCustomDialButton.FocusKilled(NextWnd: THandle);
begin begin
inherited FocusKilled(NextWnd); inherited FocusKilled(NextWnd);
@ -1085,7 +1085,7 @@ begin
if HandleAllocated then if HandleAllocated then
DrawBorder; DrawBorder;
end; end;
}
procedure TJvCustomDialButton.MouseDown(Button: TMouseButton; procedure TJvCustomDialButton.MouseDown(Button: TMouseButton;
Shift: TShiftState; X, Y: Integer); Shift: TShiftState; X, Y: Integer);
var var