jvcllaz: Add TJvOutlookBar and two demos.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6240 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2018-03-12 14:03:31 +00:00
parent 251ed51f04
commit d041eee65c
23 changed files with 11623 additions and 31 deletions

View File

@ -1,31 +0,0 @@
unit JvCustomReg;
{$mode objfpc}{$H+}
interface
uses
SysUtils;
procedure Register;
implementation
{$R ../../resource/jvcustomreg.res}
uses
Classes, PropEdits, ComponentEditors, Controls,
JvDsgnConsts, JvTimeLine, JvTMTimeline, JvTimeLineEditor;
procedure Register;
begin
RegisterComponents(RsPaletteJvcl, [
TJvTimeLine,
TJvTMTimeLine
]);
RegisterComponentEditor(TJvCustomTimeLine, TJvTimeLineEditor);
RegisterPropertyEditor(TypeInfo(TDate), TJvTimeLine, 'FirstVisibledate', TDatePropertyEditor)
end;
end.

View File

@ -1,2 +1,3 @@
tjvoutlookbar.bmp
tjvtimeline.bmp
tjvtmtimeline.bmp

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1,50 @@
unit JvCustomReg;
{$mode objfpc}{$H+}
interface
uses
SysUtils;
procedure Register;
implementation
{$R ../../resource/jvcustomreg.res}
uses
Classes, ImgList, Controls, PropEdits, GraphPropEdits, ComponentEditors,
JvDsgnConsts, JvOutlookBar, JvOutlookBarEditors,
JvTimeLine, JvTMTimeline, JvTimeLineEditor;
procedure Register;
begin
RegisterComponents(RsPaletteJvcl, [
TJvOutlookBar,
TJvTimeLine,
TJvTMTimeLine
]);
// Timeline
RegisterComponentEditor(TJvCustomTimeLine, TJvTimeLineEditor);
RegisterPropertyEditor(TypeInfo(TDate), TJvTimeLine, 'FirstVisibledate', TDatePropertyEditor);
// Outlookbar
(*
RegisterPropertyEditor(TypeInfo(TJvOutlookBarPages), TJvCustomOutlookBar,
'', TJvOutlookBarPagesProperty);
RegisterPropertyEditor(TypeInfo(TJvOutlookBarButtons), TJvOutlookBarPage,
'', TJvOutlookBarPagesProperty);
*)
RegisterPropertyEditor(TypeInfo(Integer), TJvCustomOutlookBar,
'ActivePageIndex', TJvOutlookBarActivePageProperty);
RegisterPropertyEditor(TypeInfo(TImageIndex), TJvOutlookBarButton,
'ImageIndex', TJvOutlookBarButtonImageIndexProperty);
RegisterPropertyEditor(TypeInfo(TImageIndex), TJvOutlookBarPage,
'ImageIndex', TJvOutlookBarPageImageIndexProperty);
end;
end.

View File

@ -0,0 +1,274 @@
{-----------------------------------------------------------------------------
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: JvOutlookBarEditors.PAS, released on 2002-05-26.
The Initial Developer of the Original Code is John Doe.
Portions created by John Doe are Copyright (C) 2003 John Doe.
All Rights Reserved.
Contributor(s):
You may retrieve the latest version of this file at the Project JEDI's JVCL home page,
located at http://jvcl.delphi-jedi.org
Known Issues:
-----------------------------------------------------------------------------}
// $Id$
unit JvOutlookBarEditors;
{$mode objfpc}{$H+}
interface
uses
SysUtils, Classes,
Windows, Controls, Forms, ToolWin,
Menus, ActnList, ComCtrls, ImgList,
PropEdits, GraphPropEdits,ComponentEditors,
// DesignEditors, DesignIntf, DesignMenus, DesignWindows,
//JvDsgnEditors,
JvOutlookBar;
type
TJvOutlookBarActivePageProperty = class(TIntegerProperty)
private
function GetOL: TJvCustomOutlookBar;
protected
property OL: TJvCustomOutlookBar read GetOL;
public
procedure Edit; override;
function GetAttributes: TPropertyAttributes; override;
function GetValue: string; override;
procedure SetValue(const Value: string); override;
procedure GetValues(Proc: TGetStrProc); override;
end;
(*
TJvOutlookBarEditor = class(TComponentEditor)
public
procedure ExecuteVerb(Index: Integer); override;
function GetVerb(Index: Integer): string; override;
function GetVerbCount: Integer; override;
end;
TJvOutlookBarPagesProperty = class(TPropertyEditor)
private
function GetOutlookBar: TJvCustomOutlookBar;
public
procedure Edit; override;
function GetAttributes: TPropertyAttributes; override;
function GetValue: string; override;
end; *)
TJvOutlookBarButtonImageIndexProperty = class(TImageIndexPropertyEditor) //TJvDefaultImageIndexProperty)
protected
function GetPage: TJvOutlookBarPage;
function GetBar: TJvCustomOutlookBar;
function GetImageList: TCustomImageList; override;
end;
TJvOutlookBarPageImageIndexProperty = class(TImageIndexPropertyEditor) //TJvDefaultImageIndexProperty)
function GetImageList: TCustomImageList; override;
end;
implementation
uses
//JvOutlookBarForm,
JvDsgnConsts;
type
THackOutlookBar = class(TJvCustomOutlookBar);
THackPages = class(TJvOutlookBarPages);
THackButtons = class(TJvOutlookBarButtons);
(*
procedure ShowEditor(Designer: TIDesigner; OutlookBar: TJvCustomOutlookBar);
var
I: Integer;
AEditor: TFrmOLBEditor;
begin
AEditor := nil;
for I := 0 to Screen.FormCount - 1 do
if Screen.Forms[I] is TFrmOLBEditor then
if TFrmOLBEditor(Screen.Forms[I]).OutlookBar = OutlookBar then
begin
AEditor := TFrmOLBEditor(Screen.Forms[I]);
Break;
end;
// Show the editor
if Assigned(AEditor) then
begin
AEditor.Show;
if AEditor.WindowState = wsMinimized then
AEditor.WindowState := wsNormal;
end
else
begin
AEditor := TFrmOLBEditor.Create(Application);
try
AEditor.Designer := Designer;
AEditor.OutlookBar := OutlookBar;
AEditor.Show;
except
AEditor.Free;
raise;
end;
end;
end;
*)
//=== { TJvOutlookBarPagesProperty } =========================================
(*
procedure TJvOutlookBarPagesProperty.Edit;
begin
ShowEditor(Designer, GetOutlookBar);
end;
function TJvOutlookBarPagesProperty.GetAttributes: TPropertyAttributes;
begin
Result := [paDialog, paReadOnly];
end;
function TJvOutlookBarPagesProperty.GetOutlookBar: TJvCustomOutlookBar;
begin
if GetComponent(0) is TJvCustomOutlookBar then
Result := TJvCustomOutlookBar(GetComponent(0))
else
if GetComponent(0) is TJvOutlookBarPage then
Result := THackOutlookBar(THackPages(TJvOutlookBarPage(GetComponent(0)).Collection).GetOwner)
else
Result := nil;
end;
function TJvOutlookBarPagesProperty.GetValue: string;
begin
Result := Format('(%s)', [GetPropType^.Name]);
end;
//=== { TJvOutlookBarEditor } ================================================
procedure TJvOutlookBarEditor.ExecuteVerb(Index: Integer);
begin
case Index of
0:
ShowEditor(Designer, Component as TJvCustomOutlookBar);
else
inherited ExecuteVerb(Index);
end;
end;
function TJvOutlookBarEditor.GetVerb(Index: Integer): string;
begin
case Index of
0:
Result := RsOLEditor;
else
Result := inherited GetVerb(Index);
end;
end;
function TJvOutlookBarEditor.GetVerbCount: Integer;
begin
Result := 1;
end; *)
//=== { TJvOutlookBarActivePageProperty } ====================================
procedure TJvOutlookBarActivePageProperty.Edit;
begin
inherited Edit;
end;
function TJvOutlookBarActivePageProperty.GetAttributes: TPropertyAttributes;
begin
Result := [paValueList, paSortList, paRevertable];
end;
function TJvOutlookBarActivePageProperty.GetOL: TJvCustomOutlookBar;
begin
if GetComponent(0) is TJvCustomOutlookBar then
Result := TJvCustomOutlookBar(GetComponent(0))
else
Result := nil;
end;
function TJvOutlookBarActivePageProperty.GetValue: string;
var
I: Integer;
begin
I := GetOrdValue;
if I < 0 then
Result := ''
else
if I < THackOutlookBar(OL).Pages.Count then
Result := THackOutlookBar(OL).Pages[I].Caption
else
Result := inherited GetValue;
end;
procedure TJvOutlookBarActivePageProperty.GetValues(Proc: TGetStrProc);
var
I: Integer;
begin
for I := 0 to THackOutlookBar(OL).Pages.Count - 1 do
Proc(THackOutlookBar(OL).Pages[I].Caption);
end;
procedure TJvOutlookBarActivePageProperty.SetValue(const Value: string);
var
I: Integer;
begin
I := StrToIntDef(Value, -1);
if I < 0 then
begin
for I := 0 to THackOutlookBar(OL).Pages.Count - 1 do
if AnsiSameText(THackOutlookBar(OL).Pages[I].Caption, Value) then
begin
SetOrdValue(I);
Modified;
Break;
end;
end
else
inherited SetValue(Value);
end;
//=== { TJvOutlookBarButtonImageIndexProperty } ==============================
function TJvOutlookBarButtonImageIndexProperty.GetBar: TJvCustomOutlookBar;
begin
Result := THackPages(GetPage.Collection).GetOwner as TJvCustomOutlookBar;
end;
function TJvOutlookBarButtonImageIndexProperty.GetPage: TJvOutlookBarPage;
begin
Result := TJvOutlookBarPage(THackButtons((GetComponent(0) as TJvOutlookBarButton).Collection).GetOwner);
end;
function TJvOutlookBarButtonImageIndexProperty.GetImageList: TCustomImageList;
begin
if GetPage.ButtonSize = olbsLarge then
Result := THackOutlookBar(GetBar).LargeImages
else
Result := THackOutlookBar(GetBar).SmallImages;
end;
//=== { TJvOutlookBarPageImageIndexProperty } ================================
function TJvOutlookBarPageImageIndexProperty.GetImageList: TCustomImageList;
begin
Result := THackOutlookBar(THackPages(TJvOutlookBarPage(GetComponent(0)).Collection).Owner).PageImages;
end;
end.

View File

@ -0,0 +1,81 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<General>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="OLBarDemo"/>
<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"/>
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
<Modes Count="0"/>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="JvCustomLazR"/>
</Item1>
<Item2>
<PackageName Value="LCL"/>
</Item2>
</RequiredPackages>
<Units Count="2">
<Unit0>
<Filename Value="OLBarDemo.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="OLBarMainFormU.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="OLBarMainForm"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit1>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="OLBarDemo"/>
</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,16 @@
program OLBarDemo;
uses
Forms, Interfaces, LCLVersion,
OLBarMainFormU in 'OLBarMainFormU.pas' {OLBarMainForm};
{$R *.res}
begin
{$IF LCL_FullVersion >= 1080000}
Application.Scaled := True;
{$ENDIF}
Application.Initialize;
Application.CreateForm(TOLBarMainForm, OLBarMainForm);
Application.Run;
end.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,211 @@
{******************************************************************
JEDI-VCL Demo
Copyright (C) 2002 Project JEDI
Original author:
Contributor(s):
You may retrieve the latest version of this file at the JEDI-JVCL
home page, located at http://jvcl.delphi-jedi.org
The contents of this file are used with permission, 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_1Final.html
Software distributed under the License is distributed on an
"AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
implied. See the License for the specific language governing
rights and limitations under the License.
******************************************************************}
unit OLBarMainFormU;
{$mode objfpc}{$H+}
interface
uses
SysUtils, Classes, Graphics, Controls, Forms,
Dialogs, ComCtrls, StdCtrls, Menus, ExtCtrls, ActnList,
JvExControls, JvOutlookBar;
type
{ TOLBarMainForm }
TOLBarMainForm = class(TForm)
chkThemed: TCheckBox;
popOL: TPopupMenu;
Splitter1: TSplitter;
ImageList1: TImageList;
ImageList2: TImageList;
Defaultpopupmenu1: TMenuItem;
popButton: TPopupMenu;
popPage: TPopupMenu;
Editbuttoncaption1: TMenuItem;
Editpagecaption1: TMenuItem;
StatusBar1: TStatusBar;
JvOutlookBar1: TJvOutlookBar;
Panel1: TPanel;
Panel2: TPanel;
Button1: TButton;
chkSmallImages: TCheckBox;
Button2: TButton;
Button3: TButton;
chkButtonFont: TCheckBox;
Memo1: TMemo;
Smallbuttons1: TMenuItem;
Smallbuttons2: TMenuItem;
ActionList1: TActionList;
acSmallButtons: TAction;
acEditButtonCaption: TAction;
acEditPageCaption: TAction;
chkFlat: TCheckBox;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure chkThemedChange(Sender: TObject);
procedure JvOutlookBar1ButtonClick(Sender: TObject; Index: Integer);
procedure JvOutlookBar1PageChanging(Sender: TObject; Index: Integer;
var AllowChange: Boolean);
procedure JvOutlookBar1PageChange(Sender: TObject; Index: Integer);
procedure JvOutlookBar1ContextPopup(Sender: TObject; MousePos: TPoint;
var Handled: Boolean);
procedure acSmallButtonsExecute(Sender: TObject);
procedure acEditButtonCaptionExecute(Sender: TObject);
procedure acEditPageCaptionExecute(Sender: TObject);
procedure chkFlatClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
end;
var
OLBarMainForm: TOLBarMainForm;
implementation
{$R *.lfm}
uses
Themes;
procedure TOLBarMainForm.Button1Click(Sender: TObject);
begin
JvOutlookBar1.LargeImages := ImageList1;
JvOutlookBar1.SmallImages := ImageList2;
end;
procedure TOLBarMainForm.Button2Click(Sender: TObject);
begin
JvOutlookBar1.LargeImages := nil;
JvOutlookBar1.SmallImages := nil;
end;
procedure TOLBarMainForm.Button3Click(Sender: TObject);
var i:integer; FD:TFontDialog;
begin
FD := TFontDialog.Create(nil);
try
if not chkButtonFont.Checked then
FD.Font := JvOutlookBar1.Font
else
FD.Font := JvOutlookBar1.ActivePage.Font;
if FD.Execute then
begin
if not chkButtonFont.Checked then
JvOutlookBar1.Font := FD.Font // this sets the font of all the pages
else
for i := 0 to JvOutlookBar1.Pages.Count - 1 do
JvOutlookBar1.Pages[i].Font := FD.Font; // this sets the button's fonts!
end;
finally
FD.Free;
end;
end;
procedure TOLBarMainForm.JvOutlookBar1ButtonClick(Sender: TObject;
Index: Integer);
var P:TJvOutlookBarPage;
begin
if (Index > -1) then
with JvOutlookBar1 do
begin
P := Pages[ActivePageIndex];
Caption := Format('Clicked button "%s" on page "%s"',[P.Buttons[Index].Caption,P.Caption]);
end;
end;
procedure TOLBarMainForm.JvOutlookBar1PageChanging(Sender: TObject;
Index: Integer; var AllowChange: Boolean);
begin
with JvOutlookBar1 do
if (ActivePageIndex > -1) and (Index > -1) then
Caption := Format('Page changing from "%s" to "%s"',
[Pages[ActivePageIndex].Caption, Pages[Index].Caption]);
end;
procedure TOLBarMainForm.JvOutlookBar1PageChange(Sender: TObject;
Index: Integer);
begin
if Index > -1 then
Caption := Format('Page changed to "%s"',[JvOutlookBar1.Pages[Index].Caption]);
end;
procedure TOLBarMainForm.JvOutlookBar1ContextPopup(Sender: TObject;
MousePos: TPoint; var Handled: Boolean);
begin
with Sender as TJvOutlookbar do
if PopupObject is TJvOutlookBarPage then
PopUpMenu := popPage
else if PopupObject is TJvOutlookBarButton then
PopUpMenu := popButton
else
PopUpMenu := popOL;
end;
procedure TOLBarMainForm.acSmallButtonsExecute(Sender: TObject);
const
cButtonSize: array[boolean] of TJvBarButtonSize = (olbsLarge,olbsSmall);
begin
acSmallButtons.Checked := not acSmallButtons.Checked;
JvOutlookBar1.ButtonSize := cButtonSize[acSmallButtons.Checked];
end;
procedure TOLBarMainForm.acEditButtonCaptionExecute(Sender: TObject);
begin
with JvOutlookBar1.PopUpObject as TJvOutlookBarButton do
EditCaption;
end;
procedure TOLBarMainForm.acEditPageCaptionExecute(Sender: TObject);
begin
with JvOutlookBar1.PopUpObject as TJvOutlookBarPage do
EditCaption;
end;
procedure TOLBarMainForm.chkFlatClick(Sender: TObject);
const
cBorderStyle:array [boolean] of TBorderStyle = (bsSingle, bsNone);
begin
JvOutlookbar1.BorderStyle := cBorderStyle[chkFlat.Checked];
end;
procedure TOLBarMainForm.chkThemedChange(Sender: TObject);
begin
JvOutlookbar1.Themed := chkThemed.Checked;
end;
procedure TOLBarMainForm.FormCreate(Sender: TObject);
begin
Memo1.Wordwrap := True;
chkThemed.Visible := ThemeServices.ThemesEnabled;
end;
end.

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<General>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="JvOutlookBarCustomDrawDemo"/>
<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"/>
</PublishOptions>
<RunParams>
<FormatVersion Value="2"/>
<Modes Count="0"/>
</RunParams>
<RequiredPackages Count="3">
<Item1>
<PackageName Value="JvPageCompsR"/>
</Item1>
<Item2>
<PackageName Value="JvCustomLazR"/>
</Item2>
<Item3>
<PackageName Value="LCL"/>
</Item3>
</RequiredPackages>
<Units Count="2">
<Unit0>
<Filename Value="JvOutlookBarCustomDrawDemo.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="JvOutlookBarCustomDrawDemoMainForm.pas"/>
<IsPartOfProject Value="True"/>
<HasResources Value="True"/>
</Unit1>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="JvOutlookBarCustomDrawDemo"/>
</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,18 @@
program JvOutlookBarCustomDrawDemo;
{$mode objfpc}{$H+}
uses
Forms, Interfaces, LCLVersion,
JvOutlookBarCustomDrawDemoMainForm in 'JvOutlookBarCustomDrawDemoMainForm.pas' {JvOutlookBarCustomDrawDemoMainFrm};
{$R *.res}
begin
{$IFDEF LCL_FullVersion >= 1080000}
Application.Scaled := True;
{$ENDIF}
Application.Initialize;
Application.CreateForm(TJvOutlookBarCustomDrawDemoMainFrm, JvOutlookBarCustomDrawDemoMainFrm);
Application.Run;
end.

View File

@ -0,0 +1,124 @@
{******************************************************************
JEDI-VCL Demo
Copyright (C) 2002 Project JEDI
Original author:
Contributor(s):
You may retrieve the latest version of this file at the JEDI-JVCL
home page, located at http://jvcl.delphi-jedi.org
The contents of this file are used with permission, 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_1Final.html
Software distributed under the License is distributed on an
"AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
implied. See the License for the specific language governing
rights and limitations under the License.
******************************************************************}
unit JvOutlookBarCustomDrawDemoMainForm;
{$mode objfpc}{$H+}
interface
uses
LCLIntf, LCLType,
SysUtils, Classes, Graphics, Controls, Forms, StdCtrls, Dialogs,
JvOutlookBar, JvNavigationPane;
type
TJvOutlookBarCustomDrawDemoMainFrm = class(TForm)
JvOutlookBar1: TJvOutlookBar;
ImageList1: TImageList;
ImageList2: TImageList;
JvNavPaneStyleManager1: TJvNavPaneStyleManager;
Label1: TLabel;
ComboBox1: TComboBox;
Label2: TLabel;
ComboBox2: TComboBox;
procedure FormCreate(Sender: TObject);
procedure ComboBox1Change(Sender: TObject);
procedure ComboBox2Change(Sender: TObject);
public
{ Public declarations }
procedure DoCustomDraw(Sender: TObject; ACanvas: TCanvas; ARect: TRect;
AStage: TJvOutlookBarCustomDrawStage; AIndex:integer; ADown, AInside: boolean;
var DefaultDraw:boolean);
end;
var
JvOutlookBarCustomDrawDemoMainFrm: TJvOutlookBarCustomDrawDemoMainFrm;
implementation
uses
JvJVCLUtils;
{$R *.lfm}
procedure TJvOutlookBarCustomDrawDemoMainFrm.DoCustomDraw(Sender: TObject; ACanvas: TCanvas; ARect: TRect; AStage: TJvOutlookBarCustomDrawStage; AIndex: integer; ADown, AInside: boolean; var DefaultDraw:boolean);
begin
DefaultDraw := False;
case AStage of
odsBackground:
with JvNavPaneStyleManager1.Colors do
GradientFillRect(ACanvas, ARect, HeaderColorFrom, HeaderColorTo, fdTopToBottom, 255);
odsPage:
with JvNavPaneStyleManager1.Colors do
GradientFillRect(ACanvas,ARect, ButtonColorFrom, ButtonColorTo, fdTopToBottom, 255);
odsPageButton:
begin
with JvNavPaneStyleManager1.Colors do
GradientFillRect(ACanvas,ARect, HeaderColorFrom, HeaderColorTo, fdTopToBottom, 255);
if ADown then
OffsetRect(ARect,1,1);
ACanvas.Font.Color := clWhite;
DrawText(ACanvas.Handle, PChar(JvOutlookBar1.Pages[AIndex].Caption),
Length(JvOutlookBar1.Pages[AIndex].Caption), ARect, DT_SINGLELINE or DT_VCENTER or DT_CENTER);
end;
odsButtonFrame:
begin
if ADown then
ACanvas.Brush.Color := clNavy
else
ACanvas.Brush.Color := clBlack;
ACanvas.FrameRect(ARect);
InflateRect(ARect,-1,-1);
if not ADown then
ACanvas.Brush.Color := clWhite;
ACanvas.FrameRect(ARect);
end;
odsButton:
DefaultDraw := True;
end;
end;
procedure TJvOutlookBarCustomDrawDemoMainFrm.FormCreate(Sender: TObject);
begin
ComboBox1.ItemIndex := 0;
JvOutlookBar1.OnCustomDraw := @DoCustomDraw;
ComboBox2.ItemIndex := 0;
ComboBox1Change(ComboBox1);
ComboBox2Change(ComboBox2);
end;
procedure TJvOutlookBarCustomDrawDemoMainFrm.ComboBox1Change(Sender: TObject);
begin
JvNavPaneStyleManager1.Theme := TJvNavPanelTheme(ComboBox1.ItemIndex);
JvOutlookBar1.Invalidate;
end;
procedure TJvOutlookBarCustomDrawDemoMainFrm.ComboBox2Change(Sender: TObject);
begin
JvOutlookBar1.ButtonSize := TJvBarButtonSize(ComboBox2.ItemIndex);
end;
end.

View File

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<Package Version="4">
<PathDelim Value="\"/>
<Name Value="JvCustomLazD"/>
<Type Value="RunAndDesignTime"/>
<Author Value="Various authors - see header of each unit for original author."/>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<SearchPaths>
<OtherUnitFiles Value="..\design\JvCustomControls"/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
</CompilerOptions>
<Description Value="Custom controls of the JVCL library (https://sourceforge.net/projects/jvcl/) (designtime code):
- TimeLine componentx
- OutlookBar component
"/>
<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="4"/>
<Files Count="3">
<Item1>
<Filename Value="..\design\JvCustomControls\jvcustomreg.pas"/>
<HasRegisterProc Value="True"/>
<UnitName Value="JvCustomReg"/>
</Item1>
<Item2>
<Filename Value="..\design\JvCustomControls\jvtimelineeditor.pas"/>
<UnitName Value="JvTimeLineEditor"/>
</Item2>
<Item3>
<Filename Value="..\design\JvCustomControls\jvoutlookbareditors.pas"/>
<UnitName Value="JvOutlookBarEditors"/>
</Item3>
</Files>
<RequiredPkgs Count="4">
<Item1>
<PackageName Value="IDEIntf"/>
</Item1>
<Item2>
<PackageName Value="JvCoreLazD"/>
</Item2>
<Item3>
<PackageName Value="JvCustomLazR"/>
</Item3>
<Item4>
<PackageName Value="FCL"/>
</Item4>
</RequiredPkgs>
<UsageOptions>
<UnitPath Value="$(PkgOutDir)"/>
</UsageOptions>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
</Package>
</CONFIG>

Binary file not shown.

File diff suppressed because it is too large Load Diff