jvcllaz: Add TJvXPCheckbox

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5405 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2016-12-04 17:28:50 +00:00
parent 0e82c11b1e
commit 11ba71dc58
14 changed files with 535 additions and 43 deletions

View File

@ -320,14 +320,14 @@ object frmMain: TfrmMain
TabOrder = 3
OnClick = btnToggleVisibleModeClick
end
object chkGrouped: TCheckBox
object chkGrouped: TJvXPCheckbox
Left = 24
Height = 19
Top = 152
Width = 66
Caption = 'Grouped'
OnClick = chkGroupedClick
TabOrder = 4
OnClick = chkGroupedClick
end
end
object StatusBar1: TStatusBar

View File

@ -7,7 +7,7 @@ interface
uses
SysUtils, Classes, Graphics, Controls, Forms,
Dialogs, JvXPCore, JvXPBar, JvXPContainer, ImgList, ActnList, ExtCtrls,
StdCtrls, ComCtrls, JvExControls, JvComponent {, JvXPCheckCtrls}, JvXPButtons;
StdCtrls, ComCtrls, JvExControls, JvComponent, JvXPCheckCtrls, JvXPButtons;
resourcestring
SClickEventAc = ' You clicked on the action "%s"...';
@ -37,7 +37,7 @@ type
btnToogleEnableMode: TJvXPButton;
btnToggleVisibleMode: TJvXPButton;
ilOldButtons: TImageList;
chkGrouped: TCheckbox; // was: TJvXPCheckbox;
chkGrouped: TJvXPCheckbox;
ilWhiteButtons: TImageList;
ilRedButtons: TImageList;
ilBlackButtons: TImageList;

View File

@ -24,7 +24,7 @@
"/>
<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="1"/>
<Files Count="6">
<Files Count="7">
<Item1>
<Filename Value="..\run\JvXPCoreUtils.pas"/>
<UnitName Value="JvXPCoreUtils"/>
@ -50,6 +50,10 @@
<Filename Value="..\run\JvXPButtons.pas"/>
<UnitName Value="JvXPButtons"/>
</Item6>
<Item7>
<Filename Value="..\run\JvXPCheckCtrls.pas"/>
<UnitName Value="JvXPCheckCtrls"/>
</Item7>
</Files>
<RequiredPkgs Count="3">
<Item1>

View File

@ -9,7 +9,7 @@ interface
uses
JvXPCoreUtils, JvXPBar, JvXPCore, JvXPBarReg, JvXPContainer, JvXPButtons,
LazarusPackageIntf;
JvXPCheckCtrls, LazarusPackageIntf;
implementation

View File

@ -11,20 +11,23 @@ procedure Register;
implementation
//{$R ../resource/JvXPCore.res}
uses
JvXPBar, JvXPContainer, JvXPButtons;
JvXPBar, JvXPContainer, JvXPButtons, JvXPCheckCtrls;
procedure Register;
begin
RegisterComponents('JvXP', [
RegisterComponents('JvXPCtrls', [
TJvXPBar,
TJvXPContainer,
TJvXPButton
TJvXPButton,
TJvXPCheckbox
]);
end;
initialization
{$I JvXPBarLaz.lrs}
{$I ../resource/JvXPBarLaz.lrs}
end.

Binary file not shown.

View File

@ -1,4 +1,4 @@
LazarusResources.Add('TJvXPBar','PNG',[
LazarusResources.Add('TJvXpBar','PNG',[
#137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#24#0#0#0#24#8#6#0#0#0#224'w='#248#0
+#0#0#9'pHYs'#0#0#11#19#0#0#11#19#1#0#154#156#24#0#0#1#31'IDATH'#137#237'U1R'
+#195'0'#16#220'c'#244#0#26#170'0'#19#215'<'#128#142#193#159'H'#159#159'X~B~'
@ -15,7 +15,7 @@ LazarusResources.Add('TJvXPBar','PNG',[
+#160#170'm'#192#202'|>%'#172'c'#250#13'w'#228#229'NGO\?'#0#0#0#0'IEND'#174'B'
+'`'#130
]);
LazarusResources.Add('TJvXPContainer','PNG',[
LazarusResources.Add('TJvXpContainer','PNG',[
#137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#24#0#0#0#24#8#6#0#0#0#224'w='#248#0
+#0#0#9'pHYs'#0#0#11#19#0#0#11#19#1#0#154#156#24#0#0#1#17'IDATH'#137#173'U'
+#203#177#195' '#12'\2'#233#195#156'S'#5'M'#228#158'N'#158'_'')'#133't'#178'U'
@ -31,7 +31,7 @@ LazarusResources.Add('TJvXPContainer','PNG',[
+#162'g'#225#136'DG'#171#227'rD'#20#178'n'#160#166#252'Q'#248#139','#254#0#27
+'='#239'S'#30'9'#228#160#0#0#0#0'IEND'#174'B`'#130
]);
LazarusResources.Add('TJvXPButton','PNG',[
LazarusResources.Add('TJvXpButton','PNG',[
#137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#24#0#0#0#24#8#6#0#0#0#224'w='#248#0
+#0#0#9'pHYs'#0#0#11#19#0#0#11#19#1#0#154#156#24#0#0#1'0IDATH'#137#181'U;'#146
+#132' '#16'}Ly'#133'1'#213'X'#15#1#151#152'|o'#178#238'M&'#223'K'#192'!4'#238
@ -48,3 +48,20 @@ LazarusResources.Add('TJvXPButton','PNG',[
+#137#220#239' ,'#151' h&'#202''''#144#139#252#171#225#236'1'#253#7#147#182
+#239#202'!'#176#21#156#0#0#0#0'IEND'#174'B`'#130
]);
LazarusResources.Add('TJvXpCheckbox','PNG',[
#137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#24#0#0#0#24#8#6#0#0#0#224'w='#248#0
+#0#0#9'pHYs'#0#0#11#19#0#0#11#19#1#0#154#156#24#0#0#1#24'IDATH'#137#181#148
+'Ar'#195' '#12'E'#31#29#223#195'^'#247#20#190'D'#246#189'I'#157#155#244'('
+#248#18'Yk'#223'}'#182#234#2'c'#227'X'#17'Nc'#255#25#13#16#194#251'H`'#130'D'
+#148#172#142'C$E'#255#227'L'#248'bp'#18'<'#25#156#8'O'#6''''#194#15'1'#240
+#224#0#13'@'#215'9'#0#135'P'#131'C'#145#129#170#174'#'#14'Wo'#225#30#248#202
+#0#128#223#219'8'#135#161#156'in{'#163#205'a'#27'T$'#146#224'Q'#210'8J'#130
+#149#227#178'}'#217' '#195#203#29#150'z'#204#8#166'C'#6'`'#188'Vkn'#237#240
+'Y?+'#136#160#181'[d'#172#219'%a'#202#224#221#171#232#173's'#207#224']8'#148
+'g'#240'Ox'#223#170';o'#26#236#133#207#10#207#167'6%z'#25'nHuq\'#25#28#1#223
+'H'#4#5'?'#162'l'#199#243'o'#170#10#235'Pe'#238'7@'#245'a'#27#25#190'a'#249
+#144#242#243#16#5#250#233'?'#170#129#16#182#7#222#8#208'~^'#250#205'L'#169
+#251'`g'#239'.'#154#244#152#190#21'V'#137'~'#140#18#229#151#190',W'#16#162
+#138#248#9'x;'#255'j'#213#189#166#127#166'I'#183#254#181'|i5'#0#0#0#0'IEND'
+#174'B`'#130
]);

Binary file not shown.

Binary file not shown.

View File

@ -548,6 +548,8 @@ procedure RoundedFrame(Canvas: TCanvas; ARect: TRect; AColor: TColor; R: Integer
implementation
{$R ../resource/JvXPBar.res}
uses
Menus;
@ -2028,11 +2030,11 @@ var
end;
Bitmap.Assign(nil); // fixes GDI resource leak
if FCollapsed then
//Bitmap.LoadFromResourceName(HInstance, 'JvXPCustomWinXPBarEXPAND' + IntToStr(Index))
Bitmap.LoadFromLazarusResource('JvXPCustomWinXPBarEXPAND' + IntToStr(Index))
Bitmap.LoadFromResourceName(HInstance, 'JvXPCustomWinXPBarEXPAND' + IntToStr(Index))
//Bitmap.LoadFromLazarusResource('JvXPCustomWinXPBarEXPAND' + IntToStr(Index))
else
//Bitmap.LoadFromResourceName(HInstance, 'JvXPCustomWinXPBarCOLLAPSE' + IntToStr(Index));
Bitmap.LoadFromLazarusResource('JvXPCustomWinXPBarCOLLAPSE' + IntToStr(Index));
Bitmap.LoadFromResourceName(HInstance, 'JvXPCustomWinXPBarCOLLAPSE' + IntToStr(Index));
//Bitmap.LoadFromLazarusResource('JvXPCustomWinXPBarCOLLAPSE' + IntToStr(Index));
end;
// Transparency fix not needed Here! -WPostma
Bitmap.Transparent := True;
@ -2332,8 +2334,8 @@ begin
end;
end;
initialization
{$I JvXPBar.lrs}
//initialization
// {$I JvXPBar.lrs}
end.

View File

@ -47,8 +47,7 @@ type
TJvXPLayout = (blGlyphLeft, blGlyphRight, blGlyphTop, blGlyphBottom);
// TJvXPCustomButton = class(TJvXPCustomStyleControl)
TJvXPCustomButton = class(TJvXPCustomControl)
TJvXPCustomButton = class(TJvXPCustomStyleControl)
private
FAutoGray: Boolean;
FBgGradient: TBitmap;
@ -159,7 +158,7 @@ type
property ParentShowHint;
property PopupMenu;
property ShowHint;
// property Style;
property Style;
// property StyleManager;
property Visible;
//property OnDockDrop;
@ -190,7 +189,7 @@ type
TJvXPToolType =
(ttArrowLeft, ttArrowRight, ttClose, ttMaximize, ttMinimize, ttPopup, ttRestore, ttImage);
TJvXPCustomToolButton = class(TJvXPCustomControl)
TJvXPCustomToolButton = class(TJvXPCustomStyleControl)
private
FToolType: TJvXPToolType;
FDropDownMenu: TPopupMenu;
@ -255,7 +254,7 @@ type
property ParentShowHint;
property PopupMenu;
property ShowHint;
// property Style;
property Style;
// property StyleManager;
property Visible;
//property OnDockDrop;

View File

@ -0,0 +1,456 @@
{-----------------------------------------------------------------------------
The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/MPL-1.1.html
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either expressed or implied. See the License for
the specific language governing rights and limitations under the License.
The Original Code is: JvXPCheckCtrls.PAS, released on 2004-01-01.
The Initial Developer of the Original Code is Marc Hoffman.
Portions created by Marc Hoffman are Copyright (C) 2002 APRIORI business solutions AG.
Portions created by APRIORI business solutions AG are Copyright (C) 2002 APRIORI business solutions AG
All Rights Reserved.
Contributor(s):
ZENSan : State and AllowGrayed properties
Anudedeus (Alexandre Pranke) : State and AllowGrayed properties
You may retrieve the latest version of this file at the Project JEDI's JVCL home page,
located at http://jvcl.sourceforge.net
Known Issues:
-----------------------------------------------------------------------------}
// $Id: JvXPCheckCtrls.pas 11400 2007-06-28 21:24:06Z ahuser $
{$MODE DELPHI}
unit JvXPCheckCtrls;
interface
uses
Classes, LCLIntf, LCLProc, LCLType, LResources, Graphics, Controls, StdCtrls,
JvXPCore, JvXPCoreUtils;
type
TJvXPCustomCheckControl = class(TJvXPCustomStyleControl)
// TJvXPCustomCheckControl = class(TJvXPCustomControl)
private
FBgGradient: TBitmap;
FBoundLines: TJvXPBoundLines;
FChecked: Boolean;
FCheckSize: Byte;
FCkGradient: TBitmap;
FHlGradient: TBitmap;
FSpacing: Byte;
FState: TCheckBoxState;
FAllowGrayed: Boolean;
procedure SetState(const Value: TCheckBoxState);
procedure SetAllowGrayed(const Value: Boolean);
protected
procedure SetBoundLines(Value: TJvXPBoundLines); virtual;
procedure SetChecked(Value: Boolean); virtual;
procedure SetSpacing(Value: Byte); virtual;
procedure DrawCheckSymbol(const R: TRect); virtual; abstract;
procedure Click; override;
procedure Paint; override;
procedure HookResized; override;
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
property BoundLines: TJvXPBoundLines read FBoundLines write SetBoundLines default [];
property AllowGrayed: Boolean read FAllowGrayed write SetAllowGrayed default False;
property Checked: Boolean read FChecked write SetChecked default False;
property Spacing: Byte read FSpacing write SetSpacing default 3;
property State: TCheckBoxState read FState write SetState default cbUnchecked;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
end;
TJvXPCheckbox = class(TJvXPCustomCheckControl)
protected
procedure DrawCheckSymbol(const R: TRect); override;
published
// common properties.
property Caption;
property AllowGrayed;
property Enabled;
property TabOrder;
property TabStop default True;
// advanced properties.
property BoundLines;
property Checked;
property Spacing;
property ParentColor;
property State;
property Color;
//property BevelInner;
//property BevelOuter;
//property BevelWidth;
//property BiDiMode;
//property Ctl3D;
//property DockSite;
//property ParentBiDiMode;
//property ParentCtl3D;
//property TabOrder;
//property TabStop;
//property UseDockManager default True;
property Align;
property Anchors;
//property AutoSize;
property Constraints;
property BiDiMode;
property DragCursor;
property DragKind;
// property OnCanResize;
property DragMode;
//property Enabled;
property Font;
property ParentFont;
property ParentShowHint;
property PopupMenu;
property ShowHint;
// property Style;
// property StyleManager;
property Visible;
//property OnDockDrop;
//property OnDockOver;
//property OnEndDock;
//property OnGetSiteInfo;
//property OnStartDock;
//property OnUnDock;
property OnClick;
property OnConstrainedResize;
{$IFDEF COMPILER6_UP}
property OnContextPopup;
{$ENDIF COMPILER6_UP}
property OnDragDrop;
property OnDragOver;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnKeyDown;
property OnKeyPress;
property OnKeyUp;
property OnMouseDown;
property OnMouseEnter;
property OnMouseLeave;
property OnMouseMove;
property OnMouseUp;
property OnStartDrag;
end;
implementation
{ $R }
//=== { TJvXPCustomCheckControl } ============================================
constructor TJvXPCustomCheckControl.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
// set default properties.
ControlStyle := ControlStyle - [csDoubleClicks];
Height := 17;
TabStop := True;
Width := 161;
// set custom properties.
FBoundLines := [];
FChecked := False;
FCheckSize := 13;
FSpacing := 3;
// create ...
FBgGradient := TBitmap.Create; // background gradient
FCkGradient := TBitmap.Create; // clicked gradient
FHlGradient := TBitmap.Create; // Highlight gradient
end;
destructor TJvXPCustomCheckControl.Destroy;
begin
FBgGradient.Free;
FCkGradient.Free;
FHlGradient.Free;
inherited Destroy;
end;
procedure TJvXPCustomCheckControl.Click;
begin
if not AllowGrayed then
Checked := not Checked
else
State := TCheckBoxState((Byte(State) + 1) mod 3);
inherited Click;
end;
procedure TJvXPCustomCheckControl.HookResized;
begin
// create gradient rectangles for...
// background.
JvXPCreateGradientRect(FCheckSize - 2, FCheckSize - 2, dxColor_Btn_Enb_BgFrom_WXP,
dxColor_Btn_Enb_BgTo_WXP, 16, gsTop, False, FBgGradient);
// clicked.
JvXPCreateGradientRect(FCheckSize - 2, FCheckSize - 2, dxColor_Btn_Enb_CkFrom_WXP,
dxColor_Btn_Enb_CkTo_WXP, 16, gsTop, True, FCkGradient);
// highlight.
JvXPCreateGradientRect(FCheckSize - 2, FCheckSize - 2, dxColor_Btn_Enb_HlFrom_WXP,
dxColor_Btn_Enb_HlTo_WXP, 16, gsTop, True, FHlGradient);
LockedInvalidate;
end;
procedure TJvXPCustomCheckControl.KeyDown(var Key: Word; Shift: TShiftState);
begin
case Key of
VK_SPACE:
Checked := not Checked;
end;
inherited KeyDown(Key, Shift);
end;
procedure TJvXPCustomCheckControl.SetAllowGrayed(const Value: Boolean);
begin
FAllowGrayed := Value;
if Value = False then
if FState = cbGrayed then
begin
State := cbUnchecked;
LockedInvalidate;
end;
end;
procedure TJvXPCustomCheckControl.SetBoundLines(Value: TJvXPBoundLines);
begin
if Value <> FBoundLines then
begin
FBoundLines := Value;
LockedInvalidate;
end;
end;
procedure TJvXPCustomCheckControl.SetChecked(Value: Boolean);
begin
if Value <> FChecked then
begin
FChecked := Value;
if Value then
FState := cbChecked
else
FState := cbUnchecked;
LockedInvalidate;
end;
end;
procedure TJvXPCustomCheckControl.SetSpacing(Value: Byte);
begin
if Value <> FSpacing then
begin
FSpacing := Value;
LockedInvalidate;
end;
end;
procedure TJvXPCustomCheckControl.SetState(const Value: TCheckBoxState);
begin
// will not change FState if FAllowGrayed = false and passed Value is cbGrayed
if (FState <> Value) and (FAllowGrayed or (Value <> cbGrayed)) then
begin
FState := Value;
if FState = cbChecked then
FChecked := True
else
FChecked := False;
LockedInvalidate;
end;
end;
procedure TJvXPCustomCheckControl.Paint;
var
Rect: TRect;
BoundColor: TColor;
begin
with Canvas do
begin
// clear background.
Rect := GetClientRect;
Brush.Color := Color;
FillRect(Rect);
// draw designtime rect.
if csDesigning in ComponentState then
DrawFocusRect(Rect);
// draw boundlines.
if BoundLines <> [] then
begin
if Style.GetTheme = WindowsXP then
BoundColor := dxColor_Btn_Enb_Border_WXP
else
BoundColor := dxColor_DotNetFrame;
JvXPDrawBoundLines(Self.Canvas, BoundLines, BoundColor, Rect);
end;
// draw focusrect.
if dsFocused in DrawState then
begin
Brush.Style := bsSolid;
DrawFocusRect(Rect);
end;
// draw check symbol.
DrawCheckSymbol(Rect);
// draw caption.
SetBkMode(Handle, Transparent);
Font.Assign(Self.Font);
if BiDiMode = bdRightToLeft then
begin
Dec(Rect.Right, FCheckSize + 4 + Spacing);
JvXPPlaceText(Self, Canvas, Caption, Font, Enabled, True, taRightJustify, True, Rect)
end
else
begin
Inc(Rect.Left, FCheckSize + 4 + Spacing);
JvXPPlaceText(Self, Canvas, Caption, Font, Enabled, True, taLeftJustify, True, Rect);
end;
end;
end;
//=== { TJvXPCheckbox } ======================================================
procedure TJvXPCheckbox.DrawCheckSymbol(const R: TRect);
var
ClipW: Integer;
Bitmap: TBitmap;
Theme: TJvXPTheme;
procedure DrawGradient(const Bitmap: TBitmap);
begin
if BiDiMode = bdRightToLeft then
BitBlt(Canvas.Handle, R.Right - 1 - FCheckSize, (ClientHeight - FCheckSize) div 2 + 1,
FCheckSize - 2, FCheckSize - 2, Bitmap.Canvas.Handle, 0, 0, SRCCOPY)
else
BitBlt(Canvas.Handle, R.Left + 3, (ClientHeight - FCheckSize) div 2 + 1,
FCheckSize - 2, FCheckSize - 2, Bitmap.Canvas.Handle, 0, 0, SRCCOPY);
end;
begin
// get current theme.
Theme := Style.GetTheme;
with Canvas do
begin
// check for highlight.
ClipW := Ord(dsHighlight in DrawState);
// draw border.
if (Theme = WindowsXP) or ((Theme = OfficeXP) and (ClipW = 0)) then
Pen.Color := dxColor_Chk_Enb_Border_WXP
else
Pen.Color := dxColor_BorderLineOXP;
if BiDiMode = bdRightToLeft then
Rectangle(Bounds(R.Right - 2 - FCheckSize , (ClientHeight - FCheckSize) div 2,FCheckSize, FCheckSize))
else
Rectangle(Bounds(R.Left + 2, (ClientHeight - FCheckSize) div 2,FCheckSize, FCheckSize));
// draw background.
case Theme of
WindowsXP:
begin
if not ((ClipW <> 0) and (dsClicked in DrawState)) then
begin
if ClipW <> 0 then
DrawGradient(FHlGradient);
if BiDiMode = bdRightToLeft then
BitBlt(Handle, R.Right - 1 - FCheckSize + ClipW, (ClientHeight - FCheckSize) div 2 + 1 +
ClipW, FCheckSize - 2 - ClipW * 2, FCheckSize - 2 - ClipW * 2,
FBgGradient.Canvas.Handle, 0, 0, SRCCOPY)
else
BitBlt(Handle, R.Left + 3 + ClipW, (ClientHeight - FCheckSize) div 2 + 1 +
ClipW, FCheckSize - 2 - ClipW * 2, FCheckSize - 2 - ClipW * 2,
FBgGradient.Canvas.Handle, 0, 0, SRCCOPY);
end
else
DrawGradient(FCkGradient);
end;
OfficeXP:
begin
if ClipW <> 0 then
begin
if not (dsClicked in DrawState) then
Brush.Color := dxColor_BgOXP
else
Brush.Color := dxColor_BgCkOXP;
if BiDiMode = bdRightToLeft then
FillRect(Bounds(R.Right - 1, (ClientHeight - FCheckSize) div 2 + 1,
FCheckSize - 2, FCheckSize - 2))
else
FillRect(Bounds(R.Left + 3, (ClientHeight - FCheckSize) div 2 + 1,
FCheckSize - 2, FCheckSize - 2))
end;
end;
end;
// draw checked or grayed symbols:
if FState in [cbChecked, cbGrayed] then
begin
Brush.Color := clSilver;
Pen.Color := dxColor_Btn_Enb_Border_WXP;
Bitmap := TBitmap.Create;
try
Bitmap.Transparent := True;
Bitmap.Assign(nil); // fixes GDI resource leak
if FState = cbChecked then
begin
//Bitmap.LoadFromLazarusResource(HInstance, 'JvXPCheckboxCHECKBOX')
Bitmap.LoadFromResourceName(HInstance, 'JvXPCheckboxCHECKBOX')
end
else
begin
Bitmap.Transparent := false;
//Bitmap.LoadFromLazarusResource(HInstance, 'JvXPCheckboxCHECKBOXGRAY');
Bitmap.LoadFromResourceName(HInstance, 'JvXPCheckboxCHECKBOXGRAY');
end;
if Theme = WindowsXP then
begin
if FState = cbChecked then
JvXPColorizeBitmap(Bitmap, dxColor_Chk_Enb_NmSymb_WXP)
else
JvXPColorizeBitmap(Bitmap, dxColor_Chk_Enb_GraSymb_WXP);
end
else
if (dsClicked in DrawState) and (dsHighlight in DrawState) then
begin
JvXPColorizeBitmap(Bitmap, clWhite);
end;
if BiDiMode = bdRightToLeft then
Draw(R.Right - FCheckSize + 1, (ClientHeight - FCheckSize) div 2 + 3, Bitmap)
else
Draw(FCheckSize div 2 - 1, (ClientHeight - FCheckSize) div 2 + 3, Bitmap);
finally
Bitmap.Free;
end;
end;
end;
end;
{$IFDEF USEJVCL}
{$IFDEF UNITVERSIONING}
initialization
RegisterUnitVersion(HInstance, UnitVersioning);
finalization
UnregisterUnitVersion(HInstance);
{$ENDIF UNITVERSIONING}
{$ENDIF USEJVCL}
end.

View File

@ -72,7 +72,7 @@ const
dxColor_BgCkOXP = TColor($00CC9999);
type
// TJvXPCustomStyleControl = class;
TJvXPCustomStyleControl = class;
TJvXPBoundLines = set of (
blLeft, // left line
@ -248,23 +248,25 @@ type
property OnMouseUp;
property OnStartDrag;
end;
******************** NOT CONVERTED *)
TJvXPStyle = class(TPersistent)
private
FTheme: TJvXPTheme;
FUseStyleManager: Boolean;
//FUseStyleManager: Boolean;
protected
Parent: TJvXPCustomStyleControl;
procedure SetTheme(Value: TJvXPTheme); virtual;
procedure SetUseStyleManager(Value: Boolean); virtual;
//procedure SetUseStyleManager(Value: Boolean); virtual;
public
constructor Create(AOwner: TComponent);
function GetTheme: TJvXPTheme;
published
property Theme: TJvXPTheme read FTheme write SetTheme default WindowsXP;
property UseStyleManager: Boolean read FUseStyleManager write SetUseStyleManager default True;
//property UseStyleManager: Boolean read FUseStyleManager write SetUseStyleManager default True;
end;
(******************** NOT CONVERTED
TJvXPStyleManager = class(TJvXPCustomComponent)
private
FControls: TList;
@ -282,21 +284,21 @@ type
property Theme: TJvXPTheme read FTheme write SetTheme default WindowsXP;
property OnThemeChanged: TNotifyEvent read FOnThemeChanged write FOnThemeChanged;
end;
******************** NOT CONVERTED *)
TJvXPCustomStyleControl = class(TJvXPCustomControl)
private
FStyle: TJvXPStyle;
FStyleManager: TJvXPStyleManager;
//FStyleManager: TJvXPStyleManager;
protected
procedure SetStyleManager(Value: TJvXPStyleManager); virtual;
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
//procedure SetStyleManager(Value: TJvXPStyleManager); virtual;
//procedure Notification(AComponent: TComponent; Operation: TOperation); override;
property Style: TJvXPStyle read FStyle write FStyle;
property StyleManager: TJvXPStyleManager read FStyleManager write SetStyleManager;
//property StyleManager: TJvXPStyleManager read FStyleManager write SetStyleManager;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
end;
******************** NOT CONVERTED *)
TJvXPGradientColors = 2..255;
@ -336,6 +338,8 @@ type
implementation
{$R ../resource/JvXPCore.res}
//=== { TJvXPCustomControl } =================================================
constructor TJvXPCustomControl.Create(AOwner: TComponent);
@ -664,8 +668,6 @@ begin
end;
(******************** NOT CONVERTED
//=== { TJvXPStyle } =========================================================
constructor TJvXPStyle.Create(AOwner: TComponent);
@ -673,7 +675,7 @@ begin
inherited Create;
Parent := TJvXPCustomStyleControl(AOwner);
FTheme := WindowsXP;
FUseStyleManager := True;
//FUseStyleManager := True;
end;
procedure TJvXPStyle.SetTheme(Value: TJvXPTheme);
@ -688,10 +690,13 @@ end;
function TJvXPStyle.GetTheme: TJvXPTheme;
begin
Result := FTheme;
{
if FUseStyleManager and Assigned(Parent.StyleManager) then
Result := Parent.StyleManager.Theme;
}
end;
{
procedure TJvXPStyle.SetUseStyleManager(Value: Boolean);
begin
if Value <> FUseStyleManager then
@ -700,6 +705,9 @@ begin
Parent.InternalRedraw;
end;
end;
}
(******************** NOT CONVERTED
//=== { TJvXPStyleManager } ==================================================
@ -754,6 +762,7 @@ begin
if FControls.IndexOf(AControls[I]) <> -1 then
FControls.Delete(FControls.IndexOf(AControls[I]));
end;
******************** NOT CONVERTED *)
//=== { TJvXPCustomStyleControl } ============================================
@ -762,17 +771,19 @@ constructor TJvXPCustomStyleControl.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FStyle := TJvXPStyle.Create(Self);
FStyleManager := nil;
//FStyleManager := nil;
end;
destructor TJvXPCustomStyleControl.Destroy;
begin
{
if FStyleManager <> nil then
FStyleManager.UnregisterControls([Self]);
}
FStyle.Free;
inherited Destroy;
end;
{
procedure TJvXPCustomStyleControl.Notification(AComponent: TComponent;
Operation: TOperation);
begin
@ -792,9 +803,10 @@ begin
FStyleManager := Value;
InternalRedraw;
end;
end;
end; }
(******************** NOT CONVERTED
//=== { TJvXPGradient } ======================================================
constructor TJvXPGradient.Create(AOwner: TControl);

View File

@ -61,13 +61,14 @@ procedure JvXPFrame3D(const ACanvas: TCanvas; const ARect: TRect;
const TopColor, BottomColor: TColor; const Swapped: Boolean = False);
procedure JvXPColorizeBitmap(ABitmap: TBitmap; const AColor: TColor);
(******************** NOT CONVERTED - NOT USED
procedure JvXPSetDrawFlags(const AAlignment: TAlignment; const AWordWrap: Boolean;
var Flags: Integer);
procedure JvXPPlaceText(const AParent: TControl; const ACanvas: TCanvas;
const AText: TCaption; const AFont: TFont; const AEnabled, AShowAccelChar: Boolean;
const AAlignment: TAlignment; const AWordWrap: Boolean; var Rect: TRect);
******************** NOT CONVERTED *)
implementation
@ -406,7 +407,6 @@ begin
end;
end;
(******************** NOT CONVERTED
procedure JvXPSetDrawFlags(const AAlignment: TAlignment; const AWordWrap: Boolean;
var Flags: Integer);
begin
@ -446,7 +446,6 @@ begin
OffsetRect(Rect, DX, (OH - Rect.Bottom) div 2);
JvXPRenderText(AParent, ACanvas, AText, AFont, AEnabled, AShowAccelChar, Rect, Flags);
end;
******************** NOT CONVERTED *)
end.