jvcllaz: Add example WinXPBarDemo from Delphi version

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@5398 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2016-11-30 17:12:54 +00:00
parent 1a983b8ada
commit 35b5dac68e
10 changed files with 2265 additions and 5 deletions

View File

@ -13,9 +13,6 @@
<TextDesc Value="Your application description."/>
</XPManifest>
</General>
<VersionInfo>
<StringTable ProductVersion=""/>
</VersionInfo>
<BuildModes Count="1">
<Item1 Name="default" Default="True"/>
</BuildModes>
@ -54,7 +51,7 @@
<IsVisibleTab Value="True"/>
<EditorIndex Value="3"/>
<TopLine Value="107"/>
<CursorPos X="56" Y="345"/>
<CursorPos X="24" Y="122"/>
<UsageCount Value="22"/>
<Loaded Value="True"/>
<LoadedDesigner Value="True"/>
@ -95,7 +92,7 @@
<SearchPaths>
<IncludeFiles Value="..\..\resources"/>
<OtherUnitFiles Value="..\..\run"/>
<UnitOutputDirectory Value="..\..\out"/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Parsing>
<SyntaxOptions>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,199 @@
unit MainFrm;
{$MODE DELPHI}
interface
uses
//Windows, Messages,
SysUtils, Classes, Graphics, Controls, Forms,
Dialogs, JvXPCore, JvXPBar, {JvXPContainer, }ImgList, ActnList, ExtCtrls,
StdCtrls, ComCtrls, JvExControls, JvComponent {, JvXPCheckCtrls, JvXPButtons}
;
resourcestring
SClickEvent =
' You clicked on the action "%s"...';
type
TProcControl = procedure (Control:TControl) of object;
TfrmMain = class(TForm)
acConnectAdministrator: TAction;
acConnectLocalServer: TAction;
acConnectRemoteServer: TAction;
aclWinXPBar: TActionList;
acSettingsDatabase: TAction;
acSettingsDownloads: TAction;
acSettingsStatistics: TAction;
acSettingsUsers: TAction;
acSynchronizeUnknown: TAction;
acSynchronizeWeb: TAction;
btnCollapseAll: TButton; // was: TJvXPButton;
btnExpandAll: TButton; // was: TJvXPButton;
cntDetails: TGroupbox; // was: JvXPContainer;
cntWinXPBar: TGroupbox; // was: TJvXPContainer;
imlWinXPBar: TImageList;
lbWelcome: TLabel;
sbxWinXPBar: TScrollBox;
spltMain: TSplitter;
btnToogleEnableMode: TButton; // was: TJvXPButton;
btnToggleVisibleMode: TButton; // was: TJvXPButton;
ilOldButtons: TImageList;
chkGrouped: TCheckbox; // was: TJvXPCheckbox;
ilWhiteButtons: TImageList;
ilRedButtons: TImageList;
ilBlackButtons: TImageList;
acGettingStarted: TAction;
acHelp: TAction;
acHowDoI: TAction;
acCommonQuestions: TAction;
JvXPContainer1: TGroupbox; // was. TJvXPContainer;
dxWinXPBar4: TJvXPBar;
JvXPBar1: TJvXPBar;
dxWinXPBar3: TJvXPBar;
dxWinXPBar2: TJvXPBar;
dxWinXPBar1: TJvXPBar;
tvSelfView: TTreeView;
StatusBar1: TStatusBar;
ilMSN: TImageList;
ilMSN2: TImageList;
ilFB: TImageList;
procedure acConnectRemoteServerExecute(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure btnCollapseAllClick(Sender: TObject);
procedure btnExpandAllClick(Sender: TObject);
procedure btnToogleEnableModeClick(Sender: TObject);
procedure btnToggleVisibleModeClick(Sender: TObject);
procedure chkGroupedClick(Sender: TObject);
private
{ Private declarations }
procedure DoGrouped(Control:TControl);
procedure DoExpandAll(Control:TControl);
procedure DoCollapseAll(Control:TControl);
procedure DoEnableToggle(Control:TControl);
procedure DoVisibleToggle(Control:TControl);
procedure IterateControls(Proc:TProcControl);
procedure BuildStructure;
public
{ Public declarations }
end;
var
frmMain: TfrmMain;
implementation
{$R *.lfm}
procedure TfrmMain.FormCreate(Sender: TObject);
begin
cntDetails.Align := alClient;
BuildStructure;
end;
procedure TfrmMain.acConnectRemoteServerExecute(Sender: TObject);
begin
if Sender is TJvXPBarItem then
with TJvXPBarItem(Sender) do
if Assigned(Action) then
StatusBar1.Panels[0].Text := Format(SClickEvent, [Name])
else
Statusbar1.Panels[0].Text := Caption;
end;
procedure TfrmMain.btnCollapseAllClick(Sender: TObject);
begin
IterateControls(DoCollapseAll);
end;
procedure TfrmMain.btnExpandAllClick(Sender: TObject);
begin
IterateControls(DoExpandAll);
end;
procedure TfrmMain.btnToogleEnableModeClick(Sender: TObject);
begin
IterateControls(DoEnableToggle);
end;
procedure TfrmMain.btnToggleVisibleModeClick(Sender: TObject);
begin
IterateControls(DoVisibleToggle);
end;
procedure TfrmMain.chkGroupedClick(Sender: TObject);
begin
IterateControls(DoGrouped);
btnExpandAll.Enabled := not chkGrouped.Checked;
end;
procedure TfrmMain.DoGrouped(Control: TControl);
begin
if Control is TJvXPBar then
TJvXPBar(Control).Grouped := chkGrouped.Checked;
end;
procedure TfrmMain.DoExpandAll(Control: TControl);
begin
if Control is TJvXPBar then
TJvXPBar(COntrol).Collapsed := false;
end;
procedure TfrmMain.IterateControls(Proc: TProcControl);
var i:integer;
begin
for i := 0 to ComponentCount - 1 do
if Components[i] is TControl then
Proc(TControl(Components[i]));
end;
procedure TfrmMain.DoCollapseAll(Control: TControl);
begin
if Control is TJvXPBar then
TJvXPBar(COntrol).Collapsed := true;
end;
procedure TfrmMain.DoEnableToggle(Control: TControl);
var i:integer;
begin
if Control is TJvXPBar then
for i := 0 to TJvXPBar(Control).Items.Count - 1 do
if Odd(i) then
TJvXPBar(Control).Items[i].Enabled := not TJvXPBar(Control).Items[i].Enabled;
end;
procedure TfrmMain.DoVisibleToggle(Control: TControl);
var i:integer;
begin
if Control is TJvXPBar then
for i := 0 to TJvXPBar(Control).Items.Count - 1 do
if Odd(i) then
TJvXPBar(Control).Items[i].Visible := not TJvXPBar(Control).Items[i].Visible;
end;
procedure TfrmMain.BuildStructure;
var
i,j:integer;
Parent, Child:TTreeNode;
ABar:TJvXPBar;
begin
tvSelfView.Items.Clear;
for i := ComponentCount - 1 downto 0 do
if Components[i] is TJvXPBar then
begin
ABar := TJvXPBar(Components[i]);
Parent := tvSelfView.Items.AddChild(nil,ABar.Caption);
if ABar.ControlCount = 0 then
for j := 0 to ABar.Items.Count - 1 do
begin
Child := tvSelfView.Items.AddChild(Parent,ABar.Items[j].Caption);
Child.ImageIndex := ABar.Items[j].ImageIndex;
Child.SelectedIndex := Child.ImageIndex;
end;
end;
tvSelfView.FullExpand;
end;
end.

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

@ -0,0 +1,85 @@
<?xml version="1.0" encoding="UTF-8"?>
<CONFIG>
<ProjectOptions>
<Version Value="10"/>
<PathDelim Value="\"/>
<General>
<SessionStorage Value="InProjectDir"/>
<MainUnit Value="0"/>
<Title Value="WinXPBarDemo"/>
<ResourceType Value="res"/>
<UseXPManifest Value="True"/>
<XPManifest>
<TextName Value="CompanyName.ProductName.AppName"/>
<TextDesc Value="Your application description."/>
</XPManifest>
<Icon Value="0"/>
</General>
<BuildModes Count="1">
<Item1 Name="Default" Default="True"/>
</BuildModes>
<PublishOptions>
<Version Value="2"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
</local>
</RunParams>
<RequiredPackages Count="2">
<Item1>
<PackageName Value="JvXPBarLaz"/>
</Item1>
<Item2>
<PackageName Value="LCL"/>
</Item2>
</RequiredPackages>
<Units Count="2">
<Unit0>
<Filename Value="WinXPBarDemo.lpr"/>
<IsPartOfProject Value="True"/>
</Unit0>
<Unit1>
<Filename Value="MainFrm.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="frmMain"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit1>
</Units>
</ProjectOptions>
<CompilerOptions>
<Version Value="11"/>
<PathDelim Value="\"/>
<Target>
<Filename Value="..\..\bin\WinXPBarDemo"/>
</Target>
<SearchPaths>
<IncludeFiles Value="$(ProjOutDir)"/>
<UnitOutputDirectory Value="lib\$(TargetCPU)-$(TargetOS)"/>
</SearchPaths>
<Linking>
<Debugging>
<UseExternalDbgSyms Value="True"/>
</Debugging>
<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,13 @@
program WinXPBarDemo;
uses
Forms, Interfaces,
MainFrm in 'MainFrm.pas', JvXPBarLaz {frmMain};
{$R *.res}
begin
Application.Initialize;
Application.CreateForm(TfrmMain, frmMain);
Application.Run;
end.

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

@ -844,6 +844,7 @@ begin
//{$ELSE}
DrawText(ACanvas.Handle, PAnsiChar(ItemCaption), Length(ItemCaption), Rect,
DT_SINGLELINE or DT_VCENTER or DT_END_ELLIPSIS);
SetBkMode(ACanvas.Handle, OPAQUE);
end;
end;