rx component: updated to version 1.1.3.86 from http://alexs75.narod.ru/fpc/rxfpc/RxFPC.rar

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@234 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
vsnijders
2007-08-10 22:15:51 +00:00
parent 3b3bbb969c
commit 38fdedb1cc
51 changed files with 4529 additions and 732 deletions

View File

@ -0,0 +1,277 @@
<?xml version="1.0"?>
<CONFIG>
<ProjectOptions>
<PathDelim Value="\"/>
<Version Value="5"/>
<General>
<MainUnit Value="0"/>
<IconPath Value="./"/>
<TargetFileExt Value=".exe"/>
<ActiveEditorIndexAtStart Value="0"/>
</General>
<VersionInfo>
<ProjectVersion Value=""/>
<Language Value=""/>
<CharSet Value=""/>
</VersionInfo>
<PublishOptions>
<Version Value="2"/>
<IgnoreBinaries Value="False"/>
<IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/>
<ExcludeFileFilter Value="*.(bak|ppu|ppw|o|so);*~;backup"/>
</PublishOptions>
<RunParams>
<local>
<FormatVersion Value="1"/>
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
</local>
</RunParams>
<RequiredPackages Count="3">
<Item1>
<PackageName Value="rxnew"/>
<MinVersion Major="1" Release="18" Build="56" Valid="True"/>
</Item1>
<Item2>
<PackageName Value="LCL"/>
</Item2>
<Item3>
<PackageName Value="FCL"/>
<MinVersion Major="1" Valid="True"/>
</Item3>
</RequiredPackages>
<Units Count="9">
<Unit0>
<Filename Value="RxDBGridDemo.lpr"/>
<IsPartOfProject Value="True"/>
<UnitName Value="RxDBGridDemo"/>
<CursorPos X="3" Y="11"/>
<TopLine Value="1"/>
<EditorIndex Value="2"/>
<UsageCount Value="21"/>
<Loaded Value="True"/>
</Unit0>
<Unit1>
<Filename Value="rxdbgridmainunit.pas"/>
<ComponentName Value="RxDBGridMainForm"/>
<IsPartOfProject Value="True"/>
<ResourceFilename Value="rxdbgridmainunit.lrs"/>
<UnitName Value="RxDBGridMainUnit"/>
<CursorPos X="20" Y="34"/>
<TopLine Value="14"/>
<EditorIndex Value="0"/>
<UsageCount Value="21"/>
<Loaded Value="True"/>
</Unit1>
<Unit2>
<Filename Value="..\..\..\..\fpcsrc\fcl\db\db.pp"/>
<UnitName Value="db"/>
<CursorPos X="17" Y="1116"/>
<TopLine Value="1112"/>
<UsageCount Value="10"/>
</Unit2>
<Unit3>
<Filename Value="..\..\..\..\fpcsrc\fcl\db\dataset.inc"/>
<CursorPos X="21" Y="1139"/>
<TopLine Value="1134"/>
<UsageCount Value="10"/>
</Unit3>
<Unit4>
<Filename Value="..\..\rxmemds.pas"/>
<UnitName Value="rxmemds"/>
<CursorPos X="23" Y="1322"/>
<TopLine Value="1318"/>
<UsageCount Value="10"/>
</Unit4>
<Unit5>
<Filename Value="..\..\rxdbgrid.pas"/>
<UnitName Value="rxdbgrid"/>
<CursorPos X="13" Y="626"/>
<TopLine Value="608"/>
<EditorIndex Value="3"/>
<UsageCount Value="11"/>
<Bookmarks Count="1">
<Item0 X="3" Y="1444" ID="1"/>
</Bookmarks>
<Loaded Value="True"/>
</Unit5>
<Unit6>
<Filename Value="..\..\..\..\lcl\lresources.pp"/>
<UnitName Value="LResources"/>
<CursorPos X="1" Y="2644"/>
<TopLine Value="2626"/>
<UsageCount Value="10"/>
</Unit6>
<Unit7>
<Filename Value="..\..\..\..\lcl\grids.pas"/>
<UnitName Value="Grids"/>
<CursorPos X="60" Y="68"/>
<TopLine Value="58"/>
<UsageCount Value="10"/>
</Unit7>
<Unit8>
<Filename Value="..\..\..\..\lcl\dbgrids.pas"/>
<UnitName Value="DBGrids"/>
<CursorPos X="14" Y="455"/>
<TopLine Value="437"/>
<EditorIndex Value="1"/>
<UsageCount Value="10"/>
<Loaded Value="True"/>
</Unit8>
</Units>
<JumpHistory Count="29" HistoryIndex="28">
<Position1>
<Filename Value="RxDBGridDemo.lpr"/>
<Caret Line="5" Column="37" TopLine="1"/>
</Position1>
<Position2>
<Filename Value="rxdbgridmainunit.pas"/>
<Caret Line="30" Column="40" TopLine="9"/>
</Position2>
<Position3>
<Filename Value="rxdbgridmainunit.pas"/>
<Caret Line="29" Column="7" TopLine="9"/>
</Position3>
<Position4>
<Filename Value="rxdbgridmainunit.pas"/>
<Caret Line="17" Column="20" TopLine="9"/>
</Position4>
<Position5>
<Filename Value="rxdbgridmainunit.pas"/>
<Caret Line="22" Column="5" TopLine="9"/>
</Position5>
<Position6>
<Filename Value="rxdbgridmainunit.pas"/>
<Caret Line="48" Column="1" TopLine="19"/>
</Position6>
<Position7>
<Filename Value="rxdbgridmainunit.pas"/>
<Caret Line="23" Column="45" TopLine="16"/>
</Position7>
<Position8>
<Filename Value="..\..\rxdbgrid.pas"/>
<Caret Line="945" Column="14" TopLine="917"/>
</Position8>
<Position9>
<Filename Value="..\..\rxdbgrid.pas"/>
<Caret Line="625" Column="14" TopLine="612"/>
</Position9>
<Position10>
<Filename Value="..\..\rxdbgrid.pas"/>
<Caret Line="326" Column="23" TopLine="308"/>
</Position10>
<Position11>
<Filename Value="..\..\rxdbgrid.pas"/>
<Caret Line="326" Column="23" TopLine="308"/>
</Position11>
<Position12>
<Filename Value="..\..\rxdbgrid.pas"/>
<Caret Line="626" Column="53" TopLine="607"/>
</Position12>
<Position13>
<Filename Value="rxdbgridmainunit.pas"/>
<Caret Line="41" Column="5" TopLine="27"/>
</Position13>
<Position14>
<Filename Value="rxdbgridmainunit.pas"/>
<Caret Line="20" Column="28" TopLine="9"/>
</Position14>
<Position15>
<Filename Value="rxdbgridmainunit.pas"/>
<Caret Line="27" Column="47" TopLine="13"/>
</Position15>
<Position16>
<Filename Value="rxdbgridmainunit.pas"/>
<Caret Line="53" Column="21" TopLine="35"/>
</Position16>
<Position17>
<Filename Value="rxdbgridmainunit.pas"/>
<Caret Line="45" Column="44" TopLine="35"/>
</Position17>
<Position18>
<Filename Value="rxdbgridmainunit.pas"/>
<Caret Line="16" Column="30" TopLine="9"/>
</Position18>
<Position19>
<Filename Value="rxdbgridmainunit.pas"/>
<Caret Line="27" Column="5" TopLine="26"/>
</Position19>
<Position20>
<Filename Value="rxdbgridmainunit.pas"/>
<Caret Line="49" Column="4" TopLine="38"/>
</Position20>
<Position21>
<Filename Value="rxdbgridmainunit.pas"/>
<Caret Line="27" Column="1" TopLine="9"/>
</Position21>
<Position22>
<Filename Value="rxdbgridmainunit.pas"/>
<Caret Line="62" Column="1" TopLine="32"/>
</Position22>
<Position23>
<Filename Value="rxdbgridmainunit.pas"/>
<Caret Line="28" Column="48" TopLine="28"/>
</Position23>
<Position24>
<Filename Value="rxdbgridmainunit.pas"/>
<Caret Line="57" Column="1" TopLine="39"/>
</Position24>
<Position25>
<Filename Value="rxdbgridmainunit.pas"/>
<Caret Line="30" Column="60" TopLine="29"/>
</Position25>
<Position26>
<Filename Value="rxdbgridmainunit.pas"/>
<Caret Line="56" Column="1" TopLine="41"/>
</Position26>
<Position27>
<Filename Value="rxdbgridmainunit.pas"/>
<Caret Line="32" Column="1" TopLine="14"/>
</Position27>
<Position28>
<Filename Value="rxdbgridmainunit.pas"/>
<Caret Line="24" Column="26" TopLine="14"/>
</Position28>
<Position29>
<Filename Value="rxdbgridmainunit.pas"/>
<Caret Line="25" Column="26" TopLine="14"/>
</Position29>
</JumpHistory>
</ProjectOptions>
<CompilerOptions>
<Version Value="5"/>
<PathDelim Value="\"/>
<SearchPaths>
<SrcPath Value="$(LazarusDir)\lcl\;$(LazarusDir)\lcl\interfaces\$(LCLWidgetType)\"/>
</SearchPaths>
<CodeGeneration>
<Generate Value="Faster"/>
</CodeGeneration>
<Linking>
<Options>
<Win32>
<GraphicApplication Value="True"/>
</Win32>
</Options>
</Linking>
<Other>
<CompilerPath Value="$(CompPath)"/>
</Other>
</CompilerOptions>
<Debugging>
<BreakPoints Count="2">
<Item1>
<Source Value="..\..\rxlookup.pas"/>
<Line Value="1013"/>
</Item1>
<Item2>
<Source Value="..\..\rxpopupunit.pas"/>
<Line Value="267"/>
</Item2>
</BreakPoints>
<Watches Count="1">
<Item1>
<Expression Value="W"/>
</Item1>
</Watches>
</Debugging>
</CONFIG>

View File

@ -0,0 +1,18 @@
program RxDBGridDemo;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Interfaces, // this includes the LCL widgetset
Forms,
RxDBGridMainUnit;
begin
Application.Initialize;
Application.CreateForm(TRxDBGridMainForm, RxDBGridMainForm);
Application.Run;
end.

View File

@ -0,0 +1,155 @@
object RxDBGridMainForm: TRxDBGridMainForm
Left = 353
Height = 582
Top = 161
Width = 652
HorzScrollBar.Page = 651
VertScrollBar.Page = 581
ActiveControl = RxDBGrid1
Caption = 'RxDBGrid Demo (ver 2) ...'
ClientHeight = 582
ClientWidth = 652
OnCreate = FormCreate
object RxDBGrid1: TRxDBGrid
Height = 532
Top = 50
Width = 652
Columns = <
item
Title.Alignment = taCenter
Title.Caption = 'Code'
FieldName = 'ID'
Footer.Alignment = taRightJustify
Footer.DisplayFormat = 'Count: %d'
Footer.ValueType = fvtCount
Filter.ItemIndex = -1
end
item
Title.Alignment = taCenter
Title.Caption = 'Software Name'
Width = 450
FieldName = 'NAME'
Filter.ItemIndex = -1
end
item
Title.Alignment = taCenter
Title.Caption = 'Cost'
Width = 90
FieldName = 'PRICE'
DisplayFormat = '#,##0.00'
Footer.Alignment = taRightJustify
Footer.DisplayFormat = '#,##0.00'
Footer.FieldName = 'PRICE'
Footer.ValueType = fvtSum
Filter.ItemIndex = -1
end>
OptionsRx = [rdgFooterRows]
FooterColor = clYellow
FooterRowCount = 1
Align = alClient
FocusColor = clRed
SelectedColor = clHighlight
DataSource = Datasource1
FixedColor = clBtnFace
Options = [dgEditing, dgTitles, dgIndicator, dgColumnResize, dgColumnMove, dgColLines, dgRowLines, dgTabs, dgAlwaysShowSelection, dgConfirmDelete, dgCancelOnExit, dgMultiselect]
OptionsExtra = [dgeAutoColumns, dgeCheckboxColumn]
ParentColor = False
PopupMenu = PopupMenu1
Scrollbars = ssBoth
TabOrder = 0
TabStop = True
end
object Panel1: TPanel
Height = 50
Width = 652
Align = alTop
ClientHeight = 50
ClientWidth = 652
TabOrder = 1
object Button1: TButton
Left = 8
Height = 25
Top = 8
Width = 75
Action = actCalcTotal
BorderSpacing.InnerBorder = 4
TabOrder = 0
end
object Button2: TButton
Left = 88
Height = 25
Top = 8
Width = 136
Action = actOptimizeColumnsWidthAll
BorderSpacing.InnerBorder = 4
TabOrder = 1
end
end
object RxMemoryData1: TRxMemoryData
Active = True
FieldDefs = <
item
Name = 'ID'
DataType = ftInteger
Precision = -1
Size = 7
end
item
Name = 'NAME'
DataType = ftString
Precision = -1
Size = 150
end
item
Name = 'PRICE'
DataType = ftFloat
Precision = 2
Size = 12
end>
left = 152
top = 264
end
object Datasource1: TDatasource
DataSet = RxMemoryData1
left = 120
top = 264
end
object PopupMenu1: TPopupMenu
left = 152
top = 197
object MenuItem1: TMenuItem
Action = actOptimizeWidthCol1
OnClick = actOptimizeWidthCol1Execute
end
object MenuItem2: TMenuItem
Caption = '-'
end
object MenuItem4: TMenuItem
Action = actCalcTotal
OnClick = actCalcTotalExecute
end
object MenuItem3: TMenuItem
Action = actOptimizeColumnsWidthAll
OnClick = actOptimizeColumnsWidthAllExecute
end
end
object ActionList1: TActionList
left = 206
top = 197
object actCalcTotal: TAction
Caption = 'Calc total...'
DisableIfNoHandler = True
OnExecute = actCalcTotalExecute
end
object actOptimizeColumnsWidthAll: TAction
Caption = 'Optimize width for all...'
DisableIfNoHandler = True
OnExecute = actOptimizeColumnsWidthAllExecute
end
object actOptimizeWidthCol1: TAction
Caption = 'Optimize width...'
DisableIfNoHandler = True
OnExecute = actOptimizeWidthCol1Execute
end
end
end

View File

@ -0,0 +1,52 @@
{ ��� - ���� ��������, ������������� ��������� lazarus }
LazarusResources.Add('TRxDBGridMainForm','FORMDATA',[
'TPF0'#17'TRxDBGridMainForm'#16'RxDBGridMainForm'#4'Left'#3'a'#1#6'Height'#3
+'F'#2#3'Top'#3#161#0#5'Width'#3#140#2#18'HorzScrollBar.Page'#3#139#2#18'Vert'
+'ScrollBar.Page'#3'E'#2#13'ActiveControl'#7#9'RxDBGrid1'#7'Caption'#6#26'RxD'
+'BGrid Demo (ver 2) ...'#12'ClientHeight'#3'F'#2#11'ClientWidth'#3#140#2#8
+'OnCreate'#7#10'FormCreate'#0#9'TRxDBGrid'#9'RxDBGrid1'#6'Height'#3#20#2#3'T'
+'op'#2'2'#5'Width'#3#140#2#7'Columns'#14#1#15'Title.Alignment'#7#8'taCenter'
+#13'Title.Caption'#6#4'Code'#9'FieldName'#6#2'ID'#16'Footer.Alignment'#7#14
+'taRightJustify'#20'Footer.DisplayFormat'#6#9'Count: %d'#16'Footer.ValueType'
+#7#8'fvtCount'#16'Filter.ItemIndex'#2#255#0#1#15'Title.Alignment'#7#8'taCent'
+'er'#13'Title.Caption'#6#13'Software Name'#5'Width'#3#194#1#9'FieldName'#6#4
+'NAME'#16'Filter.ItemIndex'#2#255#0#1#15'Title.Alignment'#7#8'taCenter'#13'T'
+'itle.Caption'#6#4'Cost'#5'Width'#2'Z'#9'FieldName'#6#5'PRICE'#13'DisplayFor'
+'mat'#6#8'#,##0.00'#16'Footer.Alignment'#7#14'taRightJustify'#20'Footer.Disp'
+'layFormat'#6#8'#,##0.00'#16'Footer.FieldName'#6#5'PRICE'#16'Footer.ValueTyp'
+'e'#7#6'fvtSum'#16'Filter.ItemIndex'#2#255#0#0#9'OptionsRx'#11#13'rdgFooterR'
+'ows'#0#11'FooterColor'#7#8'clYellow'#14'FooterRowCount'#2#1#5'Align'#7#8'al'
+'Client'#10'FocusColor'#7#5'clRed'#13'SelectedColor'#7#11'clHighlight'#10'Da'
+'taSource'#7#11'Datasource1'#10'FixedColor'#7#9'clBtnFace'#7'Options'#11#9'd'
+'gEditing'#8'dgTitles'#11'dgIndicator'#14'dgColumnResize'#12'dgColumnMove'#10
+'dgColLines'#10'dgRowLines'#6'dgTabs'#21'dgAlwaysShowSelection'#15'dgConfirm'
+'Delete'#14'dgCancelOnExit'#13'dgMultiselect'#0#12'OptionsExtra'#11#14'dgeAu'
+'toColumns'#17'dgeCheckboxColumn'#0#11'ParentColor'#8#9'PopupMenu'#7#10'Popu'
+'pMenu1'#10'Scrollbars'#7#6'ssBoth'#8'TabOrder'#2#0#7'TabStop'#9#0#0#6'TPane'
+'l'#6'Panel1'#6'Height'#2'2'#5'Width'#3#140#2#5'Align'#7#5'alTop'#12'ClientH'
+'eight'#2'2'#11'ClientWidth'#3#140#2#8'TabOrder'#2#1#0#7'TButton'#7'Button1'
+#4'Left'#2#8#6'Height'#2#25#3'Top'#2#8#5'Width'#2'K'#6'Action'#7#12'actCalcT'
+'otal'#25'BorderSpacing.InnerBorder'#2#4#8'TabOrder'#2#0#0#0#7'TButton'#7'Bu'
+'tton2'#4'Left'#2'X'#6'Height'#2#25#3'Top'#2#8#5'Width'#3#136#0#6'Action'#7
+#26'actOptimizeColumnsWidthAll'#25'BorderSpacing.InnerBorder'#2#4#8'TabOrder'
+#2#1#0#0#0#13'TRxMemoryData'#13'RxMemoryData1'#6'Active'#9#9'FieldDefs'#14#1
+#4'Name'#6#2'ID'#8'DataType'#7#9'ftInteger'#9'Precision'#2#255#4'Size'#2#7#0
+#1#4'Name'#6#4'NAME'#8'DataType'#7#8'ftString'#9'Precision'#2#255#4'Size'#3
+#150#0#0#1#4'Name'#6#5'PRICE'#8'DataType'#7#7'ftFloat'#9'Precision'#2#2#4'Si'
+'ze'#2#12#0#0#4'left'#3#152#0#3'top'#3#8#1#0#0#11'TDatasource'#11'Datasource'
+'1'#7'DataSet'#7#13'RxMemoryData1'#4'left'#2'x'#3'top'#3#8#1#0#0#10'TPopupMe'
+'nu'#10'PopupMenu1'#4'left'#3#152#0#3'top'#3#197#0#0#9'TMenuItem'#9'MenuItem'
+'1'#6'Action'#7#20'actOptimizeWidthCol1'#7'OnClick'#7#27'actOptimizeWidthCol'
+'1Execute'#0#0#9'TMenuItem'#9'MenuItem2'#7'Caption'#6#1'-'#0#0#9'TMenuItem'#9
+'MenuItem4'#6'Action'#7#12'actCalcTotal'#7'OnClick'#7#19'actCalcTotalExecute'
+#0#0#9'TMenuItem'#9'MenuItem3'#6'Action'#7#26'actOptimizeColumnsWidthAll'#7
+'OnClick'#7'!actOptimizeColumnsWidthAllExecute'#0#0#0#11'TActionList'#11'Act'
+'ionList1'#4'left'#3#206#0#3'top'#3#197#0#0#7'TAction'#12'actCalcTotal'#7'Ca'
+'ption'#6#13'Calc total...'#18'DisableIfNoHandler'#9#9'OnExecute'#7#19'actCa'
+'lcTotalExecute'#0#0#7'TAction'#26'actOptimizeColumnsWidthAll'#7'Caption'#6
+#25'Optimize width for all...'#18'DisableIfNoHandler'#9#9'OnExecute'#7'!actO'
+'ptimizeColumnsWidthAllExecute'#0#0#7'TAction'#20'actOptimizeWidthCol1'#7'Ca'
+'ption'#6#17'Optimize width...'#18'DisableIfNoHandler'#9#9'OnExecute'#7#27'a'
+'ctOptimizeWidthCol1Execute'#0#0#0#0
]);

View File

@ -0,0 +1,78 @@
unit RxDBGridMainUnit;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, rxmemds,
DB, rxdbgrid, ExtCtrls, Buttons, Menus, ActnList;
type
{ TRxDBGridMainForm }
TRxDBGridMainForm = class(TForm)
actCalcTotal: TAction;
actOptimizeWidthCol1: TAction;
actOptimizeColumnsWidthAll: TAction;
ActionList1: TActionList;
Button1: TButton;
Button2: TButton;
Datasource1: TDatasource;
MenuItem1: TMenuItem;
MenuItem2: TMenuItem;
MenuItem3: TMenuItem;
MenuItem4: TMenuItem;
Panel1: TPanel;
PopupMenu1: TPopupMenu;
RxDBGrid1: TRxDBGrid;
RxMemoryData1: TRxMemoryData;
procedure actCalcTotalExecute(Sender: TObject);
procedure actOptimizeColumnsWidthAllExecute(Sender: TObject);
procedure actOptimizeWidthCol1Execute(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
RxDBGridMainForm: TRxDBGridMainForm;
implementation
{ TRxDBGridMainForm }
procedure TRxDBGridMainForm.FormCreate(Sender: TObject);
begin
RxMemoryData1.Open;
RxMemoryData1.AppendRecord([1, 'Lazarus 0.9.23', 0]);
RxMemoryData1.AppendRecord([2, 'Delphi 7.0 Prof', 990]);
RxMemoryData1.AppendRecord([3, 'Open Office 2.2.0', 0]);
RxMemoryData1.AppendRecord([4, 'Microsof Office', 150]);
RxDBGrid1.CalcStatTotals; //fix error in GotoBookmark
end;
procedure TRxDBGridMainForm.actCalcTotalExecute(Sender: TObject);
begin
RxDBGrid1.CalcStatTotals; //fix error in GotoBookmark
end;
procedure TRxDBGridMainForm.actOptimizeColumnsWidthAllExecute(Sender: TObject);
begin
RxDBGrid1.OptimizeColumnsWidthAll;
end;
procedure TRxDBGridMainForm.actOptimizeWidthCol1Execute(Sender: TObject);
begin
TRxColumn(RxDBGrid1.SelectedColumn).OptimizeWidth;
end;
initialization
{$I rxdbgridmainunit.lrs}
end.

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
type="win32"
name="DelphiApplication"
version="1.0.0.0"
processorArchitecture="*"/>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
publicKeyToken="6595b64144ccf1df"
language="*"
processorArchitecture="*"/>
</dependentAssembly>
</dependency>
</assembly>

View File

@ -0,0 +1 @@
1 24 "WinXP.manifest"

View File

@ -44,7 +44,7 @@ type
procedure SetZeroEmpty(const AValue: Boolean); procedure SetZeroEmpty(const AValue: Boolean);
function TextToValText(const AValue: string): string; function TextToValText(const AValue: string): string;
function CheckValue(NewValue: Extended; RaiseOnError: Boolean): Extended; function CheckValue(NewValue: Extended; RaiseOnError: Boolean): Extended;
procedure SetFocused(aValue: Boolean); procedure SetFocused(Value: Boolean);
protected protected
//messages //messages
procedure CMEnabledChanged(var Message: TLMessage); message CM_ENABLEDCHANGED; procedure CMEnabledChanged(var Message: TLMessage); message CM_ENABLEDCHANGED;
@ -63,7 +63,7 @@ type
function DefaultDisplayFormat: string; virtual; function DefaultDisplayFormat: string; virtual;
procedure KeyPress(var Key: Char); override; procedure KeyPress(var Key: Char); override;
function IsValidChar(Key: Char): Boolean; virtual; function IsValidChar(Key: Char): Boolean; virtual;
function FormatDisplayText(aValue: Extended): string; function FormatDisplayText(Value: Extended): string;
function GetDisplayText: string; virtual; function GetDisplayText: string; virtual;
procedure Reset; override; procedure Reset; override;
procedure CheckRange; procedure CheckRange;
@ -425,11 +425,11 @@ begin
end; end;
end; end;
procedure TCustomNumEdit.SetFocused(aValue: Boolean); procedure TCustomNumEdit.SetFocused(Value: Boolean);
begin begin
if FFocused <> aValue then if FFocused <> Value then
begin begin
FFocused := aValue; FFocused := Value;
Invalidate; Invalidate;
FFormatting := True; FFormatting := True;
try try
@ -465,7 +465,7 @@ begin
raise; raise;
end; end;
SetFocused(False); SetFocused(False);
SetCursor(0); Cursor:=0;
DoExit; DoExit;
end; end;
@ -524,7 +524,7 @@ begin
raise; raise;
end; end;
SetFocused(False); SetFocused(False);
SetCursor(0); Cursor:=0;
inherited DoExit; inherited DoExit;
Invalidate; Invalidate;
@ -638,12 +638,12 @@ begin
Result := False; Result := False;
end; end;
function TCustomNumEdit.FormatDisplayText(aValue: Extended): string; function TCustomNumEdit.FormatDisplayText(Value: Extended): string;
begin begin
if DisplayFormat <> '' then if DisplayFormat <> '' then
Result := FormatFloat(DisplayFormat, aValue) Result := FormatFloat(DisplayFormat, Value)
else else
Result := FloatToStr(aValue); Result := FloatToStr(Value);
end; end;
procedure TCustomNumEdit.Clear; procedure TCustomNumEdit.Clear;

View File

@ -258,6 +258,7 @@ begin
FDataLink.OnActiveChange:=@ActiveChange; FDataLink.OnActiveChange:=@ActiveChange;
FDataLink.OnDataChange:=@DataChange; FDataLink.OnDataChange:=@DataChange;
FDataLink.OnUpdateData:=@UpdateData; FDataLink.OnUpdateData:=@UpdateData;
Text:='';
end; end;
destructor TDBDateEdit.Destroy; destructor TDBDateEdit.Destroy;

View File

@ -0,0 +1,61 @@
25.06.2007 - version 1.1.3.86
- fix error in TRxMemoryData.SortOnFields
+ add sorting in RxDBGrid for TRxMemoryData
- use module rxsortmemds
+ In RxDBGrid add procedure UpdateTitleHight - direc recalc title hight
- fix error RxDBGrid on press on last collumn title
+ in RxDBGrid � ��������� ������� ᯥ樠�쭠� ��ࠡ�⪠ ᨬ���� | - ���
���⠥��� ����᫮���� ࠧ����⥫� ��ப
+ � RxDBGrid.OptionsRx �������� 䫠� rdgMultiTitleLines -
��� ����稨 � ��������� ᨬ���� | ����� ��ப��� �������� ࠧ����⥫쭠�
�����
+ � rx.inc ���� ����� ��४⨢㪮�����樨
NEW_STYLE_TITLE_ALIGNMENT_RXDBGRID
�᫨ ��� ��।����, �� ��� ᮧ����� ����� ������� � RxDBGrid ��������� 業���������,
�᫨ ��� ��४⨢� �� ��।����� - �� ��������� ��������� �⠭���⭮� - ��ࠢ��������
�� ������ ����
+ in TRxDBLookupCombo �᫨ � ᢮��⢥ PopUpFormOptions ������ ������� �� ��� ����ᮢ�� ������
� ��ப� �ᯮ�������� ��ਭ�, 㪠������ � ��������
+ in TRxDBLookupCombo after close popup window saved width of collumn
31.05.2007 - version 1.1.2.77
- fix compile error in rxtoolbar.pas - TToolPanel not work this theme manager :-(
- fix compile error in rxlogin.pas - error in SetCursor
15.05.2007 - version 1.1.1.75
+ in RxDBGrid add procedure OptimizeColumnsWidth(AColList:String) - calc width of
column
+ in RxDBGrid add procedure OptimizeColumnsWidthAll - calc width for all columns
+ in TRxColumn add procedure OptimizeWidth - calc width of column
+ option rdgDblClickOptimizeColWidth in RxDBGrid.OptionsRx now work
- fix calc height title column for for RxDBGrid
- fix open demo for RxDBGrid
+ in demo for RxDBGrid add code for OptimizeWidth procedure
28.03.2007 - version 1.1.0.68
- In RxDBGrid fix draw summary footer line on resize collumns
+ In RxDBGrid in property OptionsRx add new value rdgXORColSizing
- change draw code for footer line (code from Yogrik)
+ minor fix on reposition button in ToolBar
+ in TRxDBLookupCombo fix draw dropdown box
+ in TRxColumnTitle add property Hint and ShowHint
+ In TRxDBGrid add filtrenig (code from Yogrik)
01.11.2006 - version 1.0.19.61
+ In dropdown box from TRxDBLookupCombo write fast find in collumn on press keys
+ In RxDBGrid add summary footer line. Warning: not work aggregate function
(SUM, MAX, MIN, AVG) - error in TDataSet
+ In TRxMemoryData create method AppendRecord - AppendRecord from TDataSet not work :-(
+ New demo app - RxDBGrid
- In RxDBGrid fix call OnDrawColumnCell
08.09.2006 - version 1.0.18.56
+ In component TToolPanel add new property ButtonAllign = (tbaNone, tbaLeft, tbaRignt)
default align for button
+ Object TToolbarItem (button on ToolBar) process type tbrSeparator -
the button appears as an empty space on the toolbar (used to separate other controls).
+ On close drop down in TRxDBLookupCombo repaint parent of component
19.08.2006 - version 1.0.17.53
+ change default style of window frame in TRxDBLookupCombo to bsNone
+ single mouse click in TRxDBLookupCombo closes it's
- fix work ESK key in TRxDBLookupCombo
+ In RxDBLookupCombo not fire event OnChange
15.05.2006 - version 1.0.16.49
+ rewrite dropdown box for component TRxDBLookupCombo
+ for TRxDBLookupCombo add new property - PopUpFormOptions - all parametrs for
dropdown list

View File

@ -0,0 +1,290 @@
25.06.2007 - ������ 1.1.3.86
- ���������� ������ � ������ TRxMemoryData.SortOnFields
+ ��������� ��������� ���������� �� RxDBGrid �� TRxMemoryData
- ���������� ������ ���������� � ������ ������ rxsortmemds
+ � RxDBGrid �������� ����� UpdateTitleHight - �������������� �������� ������ ��������� �������
- � RxDBGrid ��������� ����������� ������� �� ��������� �������
+ � RxDBGrid � ��������� ������� ����������� ��������� ������� | - ���
��������� ����������� ����������� �����
+ � RxDBGrid.OptionsRx �������� ���� rdgMultiTitleLines -
��� ������� � ��������� ������� | ����� �������� �������� ��������������
�����
+ � rx.inc ���� ����� ��������� ����������
NEW_STYLE_TITLE_ALIGNMENT_RXDBGRID
���� ��� ���������, �� ��� �������� ����� ������� � RxDBGrid ��������� ������������,
���� ��� ��������� �� ���������� - �� ��������� ��������� ����������� - �������������
�� ������ ����
+ � TRxDBLookupCombo ���� � �������� PopUpFormOptions ������ ������� �� ��� ��������� ������
� ������ ������������ ������, ��������� � ��������
+ � TRxDBLookupCombo ����� �������� ������ ������������ ������ �������, �������������
����������
31.05.2007 - ������ 1.1.2.77
- ���������� ���������� ������ rxtoolbar.pas � ���������� �������� LCL
(����� �������� ���) - ��� TToolPanel ��� �� �������� � ������
- �������� ���������� ������ rxlogin.pas - ���� ������ �� SetCursor
15.05.2007 - ������ 1.1.1.75
+ � RxDBGrid �������� ����� OptimizeColumnsWidth(AColList:String) - ���������
������ ������� (������� - ������������ ����� ";") �� �����������
+ � RxDBGrid �������� ����� OptimizeColumnsWidthAll - ������������� ���������� ����������
������ ��� ���� �������
+ TRxColumn �������� ����� OptimizeWidth - ������ ������ ��������� �������
��� ���� ������� ������� ������ ������������ ����� ������������ ���� �������
+ ����� rdgDblClickOptimizeColWidth � �������� RxDBGrid.OptionsRx ��������
- ��������� ���� ������� ������ ��������� ������� ��� �������������� ���������
- ��������� ���� �������� ������� �� RxDBGrid
+ � ������� �� RxDBGrid �������� ������� �� ����������� ������
28.03.2007 - ������ 1.1.0.68
- � RxDBGrid ���������� ��������� �������� ������ ��� ��������� ������� �������
+ � RxDBGrid � �������� OptionsRx ��������� ��������� rdgXORColSizing
- ��� ���������� ���������� ��������������� ������� ���������� ������
(��������), ������������� ���������� ������� ���������� ����� ��������� ���������
������� ������� - ����������� ��������� � Delphi
- ������� ����� ��������� �������� ������ (��� �� Yogrik)
+ ��������� ��������� � ����������������� ������ � ToolBar-�
+ � TRxDBLookupCombo �������� ��������� ����������� ������
+ � TRxColumnTitle ��������� �������� Hint � ShowHint - ���������, ����������� ���
��������� ������� �� ��������� ������� � TRxDBGrid
+ ����������� ��������� ���������� ����� � TRxDBGrid (��� �� Yogrik)
01.11.2006 - ������ 1.0.19.61
+ � ���������� ������ ���������� TRxDBLookupCombo ���������� ������� �����
�� �������, ��������� ��������� LookupDisplayIndex.
��-�� ����������� LCL ����� �������������� ���� ������ �� ����� �����
+ � RxDBGrid ��������� ����������� ������ ������ (Footer row), ������������� �������
����������� �������� � ��������.
��������: ��-�� ������ � TDataSet �� �������� �������� ���� ���������� �������
(SUM, MAX, MIN, AVG)
+ � TRxMemoryData ���������� �������� AppendRecord - ���� �� ����� �������� �����������
� TDataSet
+ ����� ���� - RxDBGrid - ������������ ������������ RxDBGrid
- � RxDBGrid ��������� ����� OnDrawColumnCell
08.09.2006 - ������ 1.0.18.56
+ � ������� TToolPanel ���� �������� ButtonAllign = (tbaNone, tbaLeft, tbaRignt)
������������ �� ��������� ������, tbaNone - ��� ������ ���������
+ � ������� TToolbarItem (������ ������ ������������) ������� ��������� ����
tbrSeparator - ����������� ����� ��������
+ ��� �������� ������ � TRxDBLookupCombo ���������� �����������
��������� (parent) ���������� - ������ ���� LCL � Win32
19.08.2006 - ������ 1.0.17.53
+ ������� �� ��������� ����� popup ���� � TRxDBLookupCombo �� ����� bsNone
(��� ���������)
+ ��������� ���� ����� � ������ popup ���� � TRxDBLookupCombo ����� ���������
���
- ���������� ��������� � ��������� ������� ESC � ���������� TRxDBLookupCombo -
���� ���� ������ ������ �� ������ - �� ���������� ��������� ���� � null � ���������
�������� �������, ��� ������ ���� (��������� �������) - ������� �� �������������
+ � RxDBLookupCombo �� ����������� ������� OnChange
15.05.2006 - ������ 1.0.16.49
+ ��������� ��������� ���������� ������ ��� ������� TRxDBLookupCombo
+ � ������� TRxDBLookupCombo ������� ����� �������� PopUpFormOptions - � ���
������� ��� ��������� ����������� ������
���� �������� ������ PopUpFormOptions.Columns �� ������ �������������
����� � ����� ������� �� ����� ��������, ����� ��������� ������
LookupDisplay - ����� ������������� ������ ����� ����� ����� � ������� (";")
11.05.2006 - ������ 1.0.15.47
+ � RxDBGrid ��������� �������� � ��������������� �����������, �������� ���� ���
����������� ���� ������ � ������ � ���� ������ ������� � �����������
+ ��� ���������� ����� � �������� OptionsRx ������� ��������� ����� Ctrl+F
���������� ���� ������ �� ������
+ ��� ���������� ����� � �������� OptionsRx ������� ��������� ����� Ctrl+W
���������� ���� ������ �������
+ ������� ������ ������ ��� ������� TRxDbGrid.OnGetCellProps - ��� �����, �������
� ������ ������ ������������� - ������� �� ���������
+ � TRxDBGrid ��������� ��������:
function TRxDBGrid.ColumnByFieldName(AFieldName: string): TRxColumn
���������� ��������� �� ��������� ������� �� ����� ���� ������ ������
� ������ ��������� ������� ������� - ������ nil
11.04.2006 - ������ 1.0.14.41
- ��������� ����������� � ����������� CurrencyEdit
14.02.2006 - ������ 1.0.13.40
- ���������� ��������� RxDbGrid � �� ������������ ������� ������
- ���������� � RxDbGrid ��������� ��������� ������� � ������� ����� �� ���������
+ � TToolPanel ��������� ��������� ����������� ������ ����������� (Selected image list)
(��� ������� � ��� ����������� ������ �������� �� ���� ��� ���������� �� ���� �������)
- ���������� ������ ������ ������� � RxDbGrid (������� �� 0)
- ���������� ������������ TToolPanel �� ����� ���������� ������ � ���� Items
����������� �������� Action
12.01.2006 - ������ 1.0.12.38
+ � RxDbGrid � ��������� ������� ��������� �������� Orientation - �������� ��
����������� ��������� ������ � ��������� �������
+ ��������� ����� ��� ��������������������� ������ ����������� (��� ����� 90
��������)
21.12.2005
+ � RxDbGrid ��������� �������� AllowedOperation - ��� ������� ��������� ���������
��������
+ � RxDbGrid ��������� ���������� ������� OnGetCellProps
+ � TRxMemoryData ������� �������� OnFilterRecordEx - ��������, ���� � TDataSet
�� ��������� ������ �������� OnFilterRecord
16.12.2005 - ������ 1.0.11.35
+ ���������� ��������� TToolbarButton ��� ��������� ������
� ��������� ������� Lazarus
+ ��������� ������� � ��������� ��������� �������
+ ������� ������ ��� Linux
27.11.2005 - ������ 1.0.11.34
- TToolPanel - ���������� ������ ���������� ������� ������ ���
�������������� �� � runtime
22.10.2005 - ������ 1.0.10.33
+ TRxLabel - ��������� ���������
+ TSecretPanel - ��������� ���������
- TRxMemoryData - ������ ���, ��������� ������ ������������� �������� FieldDefs
� ������ DB - �������� ����� ������ ��� ���������
+ TRxLoginDialog - ����� ���������
- TRxDBComboBox - ��������� �������
15.10.2005 - ������ 1.0.9.30
+ TRxCustomDBLookupCombo - �������� ���������
(������ ����� ��������� ����� ��� ���������� Flat)
+ TRxCustomDBLookupCombo - ��� ������� ������� ESC ���� ��������� (����� DataField.Clear)
- TRxCustomDBLookupCombo - ���������� ������ ��������� ������� �������� DataField � ������
DisplayAllFields - ������������ �������� �������� EmptyValue
- TRxCustomDBLookupCombo - ���������� ������ �������� ������ ���������� �������� ���
������ DataField (������ ����� �� ��������� ������)
- TRxCustomDBLookupCombo - ��������� ������ ������ ����������� ������ � �����������
�� �������� �������� DropDownCount
- TRxCustomDBLookupCombo - ��������� ����� �������� � ���������� ������ ��������
������� Enter
+ TRxMemoryData - ������ ��� ��� ������ ����� Lazarus � �� ���������� ��������� �����
�� ������ FieldDefs, ������� ���� ������� � Design-time
+ TRxMemoryData - ���������� �������� ���������� - ����� ���������� �� �������
DataSet-�
+ TRxDBGrid - ��������� �������� �������� FieldName � �������
+ TRxDBGrid - ����������� ����������� ����������� �������� ��� �����������
����� �������� KeyList � PickList (���������� TRxDBComboBox)
10.10.2005
- ���������� ������ ��� ��������� ����������� � RxDbGrid �� ImageList,
����� �������� ������� ��������
- ���������� ������ ��� ��������� ������ ������� (������� �� 0)
+ ������ ������ ��� ����������� ��������� ������� RxDbGrid ����� FormStorage
- ��������� �������� ��� ������ � ������������� � TToolPanel
+ ������� ��������� TPageManager
+ ������� ����� ��������� TRxAppIcon - ��� ��� ��� ��� �� ����� �������� �
��������� - � ������ ������� ���������� ����� ������������ ��������� ������.
�.�. ��� �������� �� � ����������� �������� ������� - ������� ���������
����� ���������� �� ���������� ������� ������ - �� � ������ �������
�������� ���������. �������� ������ ��� Windows - ���� ��� ����� ��� ���
�������� � ������ �������� - ��������.
����� � ������ �������� ���������� ������ � �������� - ���������� ����
���������� - � ����� ������ �������� ��������� ����������� ������ ��������
��� ��������� - ����� � ���� ���������� ���������� ����� �������
08.10.2005
+ ���� ��������� ������ ����� ������
+ ��� ����� ������ ��������� ����������� ������ ������ � ������ �������
��� �������������� ����� - tpGlyphPopup, tpCaptionPopup
- ��������� ���������
+ ����������� ������ � ������������� � RxDbGrid ����� ImageList (��. readmy.txt)
+ �������� ��������� TRXXPManifest - �������� ������ ��� Windows -
��������� XP ���������
05.10.2005
+ ����� �������� Flat, TransparentBtn
+ ������� �������� Options, ���������� tpFlatBtns, tpTransparentBtns
+ ������� ��������� ���� ��������� ���������� ����� �� ������
������ ������� ����� � ������� Ctrl
- ������� ��� �������������� �������� ���� ��������� ������
+ � TToolbarItem ������� �������� Tag
04.10.2005
+ � TToolPanel �������� ��� �� ������� ���������� ������� ������
+ ��������� ����������� ���������� ������ � ����� WindowsXP
+ ��� � ����� Flat � WindowsXP ��� ��������� ������� �� ������
��� �������������� ��� ������� ������������
- �.�. TImageList.Draw �� ����� �������� ������������ ���������
���������� ��� �������������� Action �� ���������� ��������
����� ��-�� ����� ��� ����������� ������� ����������� � �����
- �������� ��� � ������ ���� � ��������� ������� �������� � ������
������ (�� ����� Items) - ��� �� ���� ��� � ������ � ���������
��� ��������� ��������� ��������� ��������
+ ������� ����� ��� TToolPanel
03.10.2005
+ ������� ��� ����� ������ � ������� ��������
+ � TToolPanel �������� �������� ����
+ �������� ���� ��������� ������
+ �������������� DropDownMenu � ����� ������� ������� ������
+ ������� �� ������ ������ (��������� � run-time)
02.10.2005 (beta)
+ ������ ���������� (��������� ����) TToolPanel - ������ RxToolbar
�� ���������������� ������ �� ����������� ToolBar - �����
����� �������� ����� Actions (��� ���������� ������ ������������ ����� Items)
��������� ��� ����������� ������ - ���������� ������� ���.
��������:
+ ������������ ������������ ������ � �������� ���� � run-time
+ ���������� �� ������� ���������������� ���� ����� propstorage
����� �����������:
- DropDownMenu - � ����������� �� ����� ������ ���� ��������
��� ������� �� ������, ���� ����� ���������� ������� ������ (���.������) ���
������ ����
- ������� �������� ������ (��������� � run-time)
- ����� ����������� (������ �������� Win9x, Flat) - �������� ��� � WinXP
- ������ �������� ������ � DesignTime � ������
�������� �����
- �� ������ �������� ���������������� ��� ������ ������
�������� ������ �� ���������������� � ������
30.10.2005
+ �������
+ ������� RxDice, RxSwith, TRxDBComboBox
+ ������ �� 2 �������� - RX � RX DBAware
- �������� ��� � ��������� �������� � TRxDBLookupCombo
28.10.2005
+ ����������� �������� Currency edit (�� �������� ��� �������)
- ��-�� ������ � �������� FormatFloat �� FCL ������ ������������ � ������
�������������� ��������� ��� ������� ������� - ���������
19.10.2005
+ TRxMemoryData - �������� ����� ��������� - ��� ��������� blob - ���� ���������
+ ����� ������� Currency edit
+ ������ ������
- ��� �� ��� �������� � ������� - ������������ ������ ��������� � ��������
05.10.2005
+ �������� TRxDBGrid - ������� �� "������� �������������, ��� ���� ��� ����������
����� �������, ������ ��� ����� ���������� - ���������� ������� ����������
������� ������ ��� � DBGridEh �� EhLib. � ����� � ������������ ��
Jesus Reyes (����� DBGrid-� � ���������� ����������������) - �� ������, ��� �����
���������� ����������� ��������� � ���������� ����. ������� ���� ��� ����������
����������.
������ �������� ������������� ���������, ������������� ������� �� ���������
��� �� ������ � ������������ ������������ ������� ���������� (�������������� �������)
����� ������� �������� �������������� ��. ���� exSortFB.pas - ��� �������� ���������
���. ������ - ��� ����������� ����� ���������� ������
������� ������� (��������� �� TExDBGridSortEngine) ������� ����� � ����
��������� ������ ����������������� ������. ��� TFBDataSet (������� � FireBird)
����� ��� � ��������� ���� ����������� ����� - ������� ��� ��� ������.
exsortmds.pas - ���� ������ ��� ���������� ������ � ����������� MemDS
������� ��������� �������� - ����������� ��� ���������� ��������� �� �����������
������ ������ (������ � MemDS ���� ��� ���������������� ������� �� 1-� ������)
- TRxMemoryData - ����� ��� ���������������� ����������� ��� ������ - �� ����� ���
���������� ������ - ������ (���������� �� ������������� DataSet-� �� ������� � ������)
���� �����������. ����������� MemDS ��������� - ��� ���� � �������.
31.09.2005
+ Add component TFolderLister - ��� ��� ���������� - �� ������ ��� �������
��� ��������� ��� ���������� ����, ���������� ������ ��� LazReport-a
(������ � ���� � ������� ���� ����� ����������)
07.01.2005
i'm port next RX components:
TDBDateEdit - �� ���� ������� �������� ������ - ���������� �� �������������
TDateEdit
TRxDBCalcEdit
TRXLookupEdit,
TRxDBLookupCombo - ��� ��� - ��� ������� �� ����� �� �������� ���������������
�������, ���������� ������ ��������� - ����� ���� ������� - ��� ��� ������ -
���������.
and next modules:
DateUtil.pas
DbUtils.pas
rxdconst.pas
RXStrutils.pas
VCLUtils.pas
��� ��������� � �����������
������� ������� (alexs)
ALEXS75-��-YANDEX-�����-RU

View File

@ -1,4 +1,2 @@
���������� ��������: ���������� ��������:
1. �� Linux ��� ���������� � ���������� GTK2
�� ����� ������������ ������ RxToolbar ��� ���������� ����� Flat ���
WinXP

View File

@ -31,3 +31,8 @@
RxAppIcon1.LoadFromFile('full-2.ico'); RxAppIcon1.LoadFromFile('full-2.ico');
RxAppIcon1.ApplyIcon; RxAppIcon1.ApplyIcon;
^^^^^^^^^^^ - ���� � ������ ^^^^^^^^^^^ - ���� � ������
4. ��� ���������� ������ ����������� ��������� ������ Lazarus
������� �� ���� 0.9.19 (10151) - ��������� � SVN 01.11.2006
5. ������� �������� ����� ��� �� ������ FreePascal.ru (����������������)

View File

@ -1,19 +1,13 @@
1. 1.
RxTrayIcon
2.
� TPageManager ���������� ���������� �������� ������� ��������� � TPageManager ���������� ���������� �������� ������� ���������
�������� � PageControl-� �������� � PageControl-�
3. � RxDBGrid 2. � RxDBGrid
- �������� ������� ����������� ���������� � ���� �����������: - �������� ������� ����������� ���������� � ���� �����������:
|-----------------| |-----------------|
| | | |
|-----------------| |-----------------|
| | | | | |
|-----------------| |-----------------|
����� �������� �� ����� ����� �������� ��������� �������� ������
(������ �������� �� DBGridEh :-) )
��� ����� � ����� - ���� ������ ��� ������
4. TRxDbComboBox �� ��������� ���������� ��������� �������� �� ���� 3. TRxDbComboBox �� ��������� ���������� ��������� �������� �� ����

View File

@ -1,4 +1,4 @@
unit exSortFB; unit exsortfb;
{$mode objfpc}{$H+} {$mode objfpc}{$H+}

View File

@ -1,4 +1,4 @@
unit exSortMDS; unit exsortmds;
{$mode objfpc}{$H+} {$mode objfpc}{$H+}

View File

@ -1,52 +1,49 @@
object DualListForm: TDualListForm object DualListForm: TDualListForm
Left = 311
Height = 269
Top = 225
Width = 392
HorzScrollBar.Page = 391
VertScrollBar.Page = 268
BorderIcons = [] BorderIcons = []
BorderStyle = bsDialog BorderStyle = bsDialog
Caption = 'DualListForm' Caption = 'DualListForm'
ClientHeight = 269
ClientWidth = 392
Font.Height = -11 Font.Height = -11
Font.Name = 'MS Sans Serif' Font.Name = 'MS Sans Serif'
Font.Style = [fsBold] Font.Style = [fsBold]
OnActivate = ListClick OnActivate = ListClick
OnCreate = FormCreate OnCreate = FormCreate
OnShow = ListClick OnShow = ListClick
PixelsPerInch = 96
Position = poScreenCenter Position = poScreenCenter
TextHeight = 13
HorzScrollBar.Page = 391
VertScrollBar.Page = 268
Left = 311
Height = 269
Top = 225
Width = 392
object Bevel1: TBevel object Bevel1: TBevel
Height = 224
Left = 4
Name = 'Bevel1'
Top = 7
Width = 384
Left = 4 Left = 4
Height = 224 Height = 224
Top = 7 Top = 7
Width = 384 Width = 384
end end
object SrcLabel: TLabel object SrcLabel: TLabel
Left = 12
Height = 14
Top = 12
Width = 34
Caption = 'Source' Caption = 'Source'
Color = clNone Color = clNone
Left = 12 ParentColor = False
Height = 13
Top = 12
Width = 33
end end
object DstLabel: TLabel object DstLabel: TLabel
Left = 216
Height = 14
Top = 12
Width = 23
Caption = 'Dest' Caption = 'Dest'
Color = clNone Color = clNone
Left = 216 ParentColor = False
Height = 13
Top = 12
Width = 22
end end
object SrcList: TListBox object SrcList: TListBox
Left = 12
Height = 194
Top = 30
Width = 164
ItemHeight = 13 ItemHeight = 13
MultiSelect = True MultiSelect = True
OnClick = ListClick OnClick = ListClick
@ -56,12 +53,12 @@ object DualListForm: TDualListForm
ShowHint = True ShowHint = True
Sorted = True Sorted = True
TabOrder = 0 TabOrder = 0
Left = 12 end
object DstList: TListBox
Left = 216
Height = 194 Height = 194
Top = 30 Top = 30
Width = 164 Width = 164
end
object DstList: TListBox
ItemHeight = 13 ItemHeight = 13
MultiSelect = True MultiSelect = True
OnClick = ListClick OnClick = ListClick
@ -71,13 +68,12 @@ object DualListForm: TDualListForm
ShowHint = True ShowHint = True
Sorted = True Sorted = True
TabOrder = 5 TabOrder = 5
Left = 216
Height = 194
Top = 30
Width = 164
end end
object IncBtn: TButton object IncBtn: TButton
BorderSpacing.InnerBorder = 2 Left = 183
Height = 26
Top = 32
Width = 26
Caption = '>' Caption = '>'
Font.Color = clBlack Font.Color = clBlack
Font.Height = -12 Font.Height = -12
@ -85,13 +81,12 @@ object DualListForm: TDualListForm
Font.Style = [fsBold] Font.Style = [fsBold]
OnClick = IncBtnClick OnClick = IncBtnClick
TabOrder = 1 TabOrder = 1
Left = 183
Height = 26
Top = 32
Width = 26
end end
object IncAllBtn: TButton object IncAllBtn: TButton
BorderSpacing.InnerBorder = 2 Left = 183
Height = 26
Top = 64
Width = 26
Caption = '>>' Caption = '>>'
Font.Color = clBlack Font.Color = clBlack
Font.Height = -12 Font.Height = -12
@ -99,13 +94,12 @@ object DualListForm: TDualListForm
Font.Style = [fsBold] Font.Style = [fsBold]
OnClick = IncAllBtnClick OnClick = IncAllBtnClick
TabOrder = 2 TabOrder = 2
Left = 183
Height = 26
Top = 64
Width = 26
end end
object ExclBtn: TButton object ExclBtn: TButton
BorderSpacing.InnerBorder = 2 Left = 183
Height = 26
Top = 97
Width = 26
Caption = '<' Caption = '<'
Font.Color = clBlack Font.Color = clBlack
Font.Height = -12 Font.Height = -12
@ -113,13 +107,12 @@ object DualListForm: TDualListForm
Font.Style = [fsBold] Font.Style = [fsBold]
OnClick = ExclBtnClick OnClick = ExclBtnClick
TabOrder = 3 TabOrder = 3
Left = 183
Height = 26
Top = 97
Width = 26
end end
object ExclAllBtn: TButton object ExclAllBtn: TButton
BorderSpacing.InnerBorder = 2 Left = 183
Height = 26
Top = 129
Width = 26
Caption = '<<' Caption = '<<'
Font.Color = clBlack Font.Color = clBlack
Font.Height = -12 Font.Height = -12
@ -127,41 +120,34 @@ object DualListForm: TDualListForm
Font.Style = [fsBold] Font.Style = [fsBold]
OnClick = ExclAllBtnClick OnClick = ExclAllBtnClick
TabOrder = 4 TabOrder = 4
Left = 183
Height = 26
Top = 129
Width = 26
end end
object OkBtn: TButton object OkBtn: TButton
BorderSpacing.InnerBorder = 2
Caption = 'OK'
Default = True
ModalResult = 1
TabOrder = 6
Left = 138 Left = 138
Height = 25 Height = 25
Top = 239 Top = 239
Width = 77 Width = 77
Caption = 'OK'
Default = True
ModalResult = 1
TabOrder = 6
end end
object CancelBtn: TButton object CancelBtn: TButton
BorderSpacing.InnerBorder = 2
Cancel = True
Caption = 'Cancel'
ModalResult = 2
TabOrder = 7
Left = 221 Left = 221
Height = 25 Height = 25
Top = 239 Top = 239
Width = 77 Width = 77
Cancel = True
Caption = 'Cancel'
ModalResult = 2
TabOrder = 7
end end
object HelpBtn: TButton object HelpBtn: TButton
BorderSpacing.InnerBorder = 2
Caption = 'Help'
OnClick = HelpBtnClick
TabOrder = 8
Left = 310 Left = 310
Height = 25 Height = 25
Top = 239 Top = 239
Width = 77 Width = 77
Caption = 'Help'
OnClick = HelpBtnClick
TabOrder = 8
end end
end end

View File

@ -1,48 +1,43 @@
{ ��� - ���� ��������, ������������� ��������� lazarus } { ��� - ���� ��������, ������������� ��������� lazarus }
LazarusResources.Add('TDualListForm','FORMDATA',[ LazarusResources.Add('TDualListForm','FORMDATA',[
'TPF0'#13'TDualListForm'#12'DualListForm'#11'BorderIcons'#11#0#11'BorderStyle' 'TPF0'#13'TDualListForm'#12'DualListForm'#4'Left'#3'7'#1#6'Height'#3#13#1#3'T'
+#7#8'bsDialog'#7'Caption'#6#12'DualListForm'#12'ClientHeight'#3#13#1#11'Clie' +'op'#3#225#0#5'Width'#3#136#1#18'HorzScrollBar.Page'#3#135#1#18'VertScrollBa'
+'ntWidth'#3#136#1#11'Font.Height'#2#245#9'Font.Name'#6#13'MS Sans Serif'#10 +'r.Page'#3#12#1#11'BorderIcons'#11#0#11'BorderStyle'#7#8'bsDialog'#7'Caption'
+#6#12'DualListForm'#11'Font.Height'#2#245#9'Font.Name'#6#13'MS Sans Serif'#10
+'Font.Style'#11#6'fsBold'#0#10'OnActivate'#7#9'ListClick'#8'OnCreate'#7#10'F' +'Font.Style'#11#6'fsBold'#0#10'OnActivate'#7#9'ListClick'#8'OnCreate'#7#10'F'
+'ormCreate'#6'OnShow'#7#9'ListClick'#13'PixelsPerInch'#2'`'#8'Position'#7#14 +'ormCreate'#6'OnShow'#7#9'ListClick'#8'Position'#7#14'poScreenCenter'#0#6'TB'
+'poScreenCenter'#10'TextHeight'#2#13#18'HorzScrollBar.Page'#3#135#1#18'VertS' +'evel'#6'Bevel1'#4'Left'#2#4#6'Height'#3#224#0#3'Top'#2#7#5'Width'#3#128#1#0
+'crollBar.Page'#3#12#1#4'Left'#3'7'#1#6'Height'#3#13#1#3'Top'#3#225#0#5'Widt' +#0#6'TLabel'#8'SrcLabel'#4'Left'#2#12#6'Height'#2#14#3'Top'#2#12#5'Width'#2
+'h'#3#136#1#0#6'TBevel'#6'Bevel1'#6'Height'#3#224#0#4'Left'#2#4#4'Name'#6#6 +'"'#7'Caption'#6#6'Source'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#6'TLab'
+'Bevel1'#3'Top'#2#7#5'Width'#3#128#1#4'Left'#2#4#6'Height'#3#224#0#3'Top'#2#7 +'el'#8'DstLabel'#4'Left'#3#216#0#6'Height'#2#14#3'Top'#2#12#5'Width'#2#23#7
+#5'Width'#3#128#1#0#0#6'TLabel'#8'SrcLabel'#7'Caption'#6#6'Source'#5'Color'#7 +'Caption'#6#4'Dest'#5'Color'#7#6'clNone'#11'ParentColor'#8#0#0#8'TListBox'#7
+#6'clNone'#4'Left'#2#12#6'Height'#2#13#3'Top'#2#12#5'Width'#2'!'#0#0#6'TLabe' +'SrcList'#4'Left'#2#12#6'Height'#3#194#0#3'Top'#2#30#5'Width'#3#164#0#10'Ite'
+'l'#8'DstLabel'#7'Caption'#6#4'Dest'#5'Color'#7#6'clNone'#4'Left'#3#216#0#6 +'mHeight'#2#13#11'MultiSelect'#9#7'OnClick'#7#9'ListClick'#10'OnDblClick'#7
+'Height'#2#13#3'Top'#2#12#5'Width'#2#22#0#0#8'TListBox'#7'SrcList'#10'ItemHe' +#11'IncBtnClick'#9'OnKeyDown'#7#14'SrcListKeyDown'#14'ParentShowHint'#8#8'Sh'
+'ight'#2#13#11'MultiSelect'#9#7'OnClick'#7#9'ListClick'#10'OnDblClick'#7#11 +'owHint'#9#6'Sorted'#9#8'TabOrder'#2#0#0#0#8'TListBox'#7'DstList'#4'Left'#3
+'IncBtnClick'#9'OnKeyDown'#7#14'SrcListKeyDown'#14'ParentShowHint'#8#8'ShowH' +#216#0#6'Height'#3#194#0#3'Top'#2#30#5'Width'#3#164#0#10'ItemHeight'#2#13#11
+'int'#9#6'Sorted'#9#8'TabOrder'#2#0#4'Left'#2#12#6'Height'#3#194#0#3'Top'#2 +'MultiSelect'#9#7'OnClick'#7#9'ListClick'#10'OnDblClick'#7#12'ExclBtnClick'#9
+#30#5'Width'#3#164#0#0#0#8'TListBox'#7'DstList'#10'ItemHeight'#2#13#11'Multi' +'OnKeyDown'#7#14'DstListKeyDown'#14'ParentShowHint'#8#8'ShowHint'#9#6'Sorted'
+'Select'#9#7'OnClick'#7#9'ListClick'#10'OnDblClick'#7#12'ExclBtnClick'#9'OnK' +#9#8'TabOrder'#2#5#0#0#7'TButton'#6'IncBtn'#4'Left'#3#183#0#6'Height'#2#26#3
+'eyDown'#7#14'DstListKeyDown'#14'ParentShowHint'#8#8'ShowHint'#9#6'Sorted'#9 +'Top'#2' '#5'Width'#2#26#7'Caption'#6#1'>'#10'Font.Color'#7#7'clBlack'#11'Fo'
+#8'TabOrder'#2#5#4'Left'#3#216#0#6'Height'#3#194#0#3'Top'#2#30#5'Width'#3#164 +'nt.Height'#2#244#9'Font.Name'#6#13'MS Sans Serif'#10'Font.Style'#11#6'fsBol'
+#0#0#0#7'TButton'#6'IncBtn'#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#1 +'d'#0#7'OnClick'#7#11'IncBtnClick'#8'TabOrder'#2#1#0#0#7'TButton'#9'IncAllBt'
+'>'#10'Font.Color'#7#7'clBlack'#11'Font.Height'#2#244#9'Font.Name'#6#13'MS S' +'n'#4'Left'#3#183#0#6'Height'#2#26#3'Top'#2'@'#5'Width'#2#26#7'Caption'#6#2
+'ans Serif'#10'Font.Style'#11#6'fsBold'#0#7'OnClick'#7#11'IncBtnClick'#8'Tab' +'>>'#10'Font.Color'#7#7'clBlack'#11'Font.Height'#2#244#9'Font.Name'#6#13'MS '
+'Order'#2#1#4'Left'#3#183#0#6'Height'#2#26#3'Top'#2' '#5'Width'#2#26#0#0#7'T' +'Sans Serif'#10'Font.Style'#11#6'fsBold'#0#7'OnClick'#7#14'IncAllBtnClick'#8
+'Button'#9'IncAllBtn'#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#2'>>'#10 +'TabOrder'#2#2#0#0#7'TButton'#7'ExclBtn'#4'Left'#3#183#0#6'Height'#2#26#3'To'
+'Font.Color'#7#7'clBlack'#11'Font.Height'#2#244#9'Font.Name'#6#13'MS Sans Se' +'p'#2'a'#5'Width'#2#26#7'Caption'#6#1'<'#10'Font.Color'#7#7'clBlack'#11'Font'
+'rif'#10'Font.Style'#11#6'fsBold'#0#7'OnClick'#7#14'IncAllBtnClick'#8'TabOrd' +'.Height'#2#244#9'Font.Name'#6#13'MS Sans Serif'#10'Font.Style'#11#6'fsBold'
+'er'#2#2#4'Left'#3#183#0#6'Height'#2#26#3'Top'#2'@'#5'Width'#2#26#0#0#7'TBut' +#0#7'OnClick'#7#12'ExclBtnClick'#8'TabOrder'#2#3#0#0#7'TButton'#10'ExclAllBt'
+'ton'#7'ExclBtn'#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#1'<'#10'Font' +'n'#4'Left'#3#183#0#6'Height'#2#26#3'Top'#3#129#0#5'Width'#2#26#7'Caption'#6
+'.Color'#7#7'clBlack'#11'Font.Height'#2#244#9'Font.Name'#6#13'MS Sans Serif' +#2'<<'#10'Font.Color'#7#7'clBlack'#11'Font.Height'#2#244#9'Font.Name'#6#13'M'
+#10'Font.Style'#11#6'fsBold'#0#7'OnClick'#7#12'ExclBtnClick'#8'TabOrder'#2#3 +'S Sans Serif'#10'Font.Style'#11#6'fsBold'#0#7'OnClick'#7#15'ExclAllBtnClick'
+#4'Left'#3#183#0#6'Height'#2#26#3'Top'#2'a'#5'Width'#2#26#0#0#7'TButton'#10 +#8'TabOrder'#2#4#0#0#7'TButton'#5'OkBtn'#4'Left'#3#138#0#6'Height'#2#25#3'To'
+'ExclAllBtn'#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#2'<<'#10'Font.Co' +'p'#3#239#0#5'Width'#2'M'#7'Caption'#6#2'OK'#7'Default'#9#11'ModalResult'#2#1
+'lor'#7#7'clBlack'#11'Font.Height'#2#244#9'Font.Name'#6#13'MS Sans Serif'#10 +#8'TabOrder'#2#6#0#0#7'TButton'#9'CancelBtn'#4'Left'#3#221#0#6'Height'#2#25#3
+'Font.Style'#11#6'fsBold'#0#7'OnClick'#7#15'ExclAllBtnClick'#8'TabOrder'#2#4 +'Top'#3#239#0#5'Width'#2'M'#6'Cancel'#9#7'Caption'#6#6'Cancel'#11'ModalResul'
+#4'Left'#3#183#0#6'Height'#2#26#3'Top'#3#129#0#5'Width'#2#26#0#0#7'TButton'#5 +'t'#2#2#8'TabOrder'#2#7#0#0#7'TButton'#7'HelpBtn'#4'Left'#3'6'#1#6'Height'#2
+'OkBtn'#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#2'OK'#7'Default'#9#11 +#25#3'Top'#3#239#0#5'Width'#2'M'#7'Caption'#6#4'Help'#7'OnClick'#7#12'HelpBt'
+'ModalResult'#2#1#8'TabOrder'#2#6#4'Left'#3#138#0#6'Height'#2#25#3'Top'#3#239 +'nClick'#8'TabOrder'#2#8#0#0#0
+#0#5'Width'#2'M'#0#0#7'TButton'#9'CancelBtn'#25'BorderSpacing.InnerBorder'#2
+#2#6'Cancel'#9#7'Caption'#6#6'Cancel'#11'ModalResult'#2#2#8'TabOrder'#2#7#4
+'Left'#3#221#0#6'Height'#2#25#3'Top'#3#239#0#5'Width'#2'M'#0#0#7'TButton'#7
+'HelpBtn'#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#4'Help'#7'OnClick'#7
+#12'HelpBtnClick'#8'TabOrder'#2#8#4'Left'#3'6'#1#6'Height'#2#25#3'Top'#3#239
+#0#5'Width'#2'M'#0#0#0
]); ]);

View File

@ -138,20 +138,20 @@ procedure TDualListForm.SrcListDragOver(Sender, Source: TObject; X,
Y: Integer; State: TDragState; var Accept: Boolean); Y: Integer; State: TDragState; var Accept: Boolean);
begin begin
BoxDragOver(SrcList, Source, X, Y, State, Accept, SrcList.Sorted); BoxDragOver(SrcList, Source, X, Y, State, Accept, SrcList.Sorted);
if State = dsDragLeave then { if State = dsDragLeave then
(Source as TListBox).DragCursor := crDrag; (Source as TListBox).DragCursor := crDrag;
if (State = dsDragEnter) and ((Source as TListBox).SelCount > 1) then if (State = dsDragEnter) and ((Source as TListBox).SelCount > 1) then
(Source as TListBox).DragCursor := crMultiDrag; (Source as TListBox).DragCursor := crMultiDrag;}
end; end;
procedure TDualListForm.DstListDragOver(Sender, Source: TObject; X, procedure TDualListForm.DstListDragOver(Sender, Source: TObject; X,
Y: Integer; State: TDragState; var Accept: Boolean); Y: Integer; State: TDragState; var Accept: Boolean);
begin begin
BoxDragOver(DstList, Source, X, Y, State, Accept, DstList.Sorted); BoxDragOver(DstList, Source, X, Y, State, Accept, DstList.Sorted);
if State = dsDragLeave then { if State = dsDragLeave then
(Source as TListBox).DragCursor := crDrag; (Source as TListBox).DragCursor := crDrag;
if (State = dsDragEnter) and ((Source as TListBox).SelCount > 1) then if (State = dsDragEnter) and ((Source as TListBox).SelCount > 1) then
(Source as TListBox).DragCursor := crMultiDrag; (Source as TListBox).DragCursor := crMultiDrag;}
end; end;
procedure TDualListForm.SrcListDragDrop(Sender, Source: TObject; X, procedure TDualListForm.SrcListDragDrop(Sender, Source: TObject; X,

View File

@ -18,7 +18,7 @@ type
FOnExecuteItem: TNotifyEvent; FOnExecuteItem: TNotifyEvent;
FFileFolder: string; FFileFolder: string;
FFileList:TStringList; FFileList:TStringList;
procedure DoFind(S:string; aMenuItem:TMenuItem); procedure DoFind(S:string; MenuItem:TMenuItem);
function GetCount: integer; function GetCount: integer;
function GetFiles(Item: integer): string; function GetFiles(Item: integer): string;
procedure SetMenuItem(const AValue: TMenuItem); procedure SetMenuItem(const AValue: TMenuItem);
@ -64,7 +64,7 @@ begin
end; end;
{ TCustomFolderLister } { TCustomFolderLister }
procedure TCustomFolderLister.DoFind(S: string; aMenuItem: TMenuItem); procedure TCustomFolderLister.DoFind(S: string; MenuItem: TMenuItem);
var var
Rec:TSearchRec; Rec:TSearchRec;
R:integer; R:integer;
@ -97,7 +97,7 @@ begin
begin begin
M:=TMenuItem.Create(Application.MainForm); M:=TMenuItem.Create(Application.MainForm);
M.Caption:=MenuItemStr(AFolderList[i]); M.Caption:=MenuItemStr(AFolderList[i]);
aMenuItem.Add(M); MenuItem.Add(M);
DoFind(AFolderList[i]+DirectorySeparator,M); DoFind(AFolderList[i]+DirectorySeparator,M);
end; end;
end; end;

Binary file not shown.

View File

@ -1,4 +1,4 @@
unit PageMngr; unit pagemngr;
{$mode objfpc}{$H+} {$mode objfpc}{$H+}
@ -47,13 +47,13 @@ type
protected protected
function GetPriorPageIndex(Page: Integer): Integer; virtual; function GetPriorPageIndex(Page: Integer): Integer; virtual;
function GetNextPageIndex(Page: Integer): Integer; virtual; function GetNextPageIndex(Page: Integer): Integer; virtual;
procedure PageChanged;virtual;
procedure Loaded; override; procedure Loaded; override;
public public
constructor Create(AOwner: TComponent); virtual; constructor Create(AOwner: TComponent); virtual;
procedure CheckBtnEnabled; procedure CheckBtnEnabled;
procedure NextPage; procedure NextPage;
procedure PriorPage; procedure PriorPage;
procedure PageChanged;virtual;
property PageCount: Integer read GetPageCount; property PageCount: Integer read GetPageCount;
property PageIndex: Integer read GetPageIndex write SetPageIndex; property PageIndex: Integer read GetPageIndex write SetPageIndex;
published published

View File

@ -12,7 +12,7 @@ procedure Register;
implementation implementation
uses PropEdits, dbdateedit, rxlookup, folderlister, rxdbgrid, rxmemds, duallist, uses PropEdits, dbdateedit, rxlookup, folderlister, rxdbgrid, rxmemds, duallist,
curredit, rxswitch, rxdice, rxdbcomb, rxtoolbar, rxxpman, PageMngr, RxAppIcon, curredit, rxswitch, rxdice, rxdbcomb, rxtoolbar, rxxpman, PageMngr, RxAppIcon,
Dialogs, ComponentEditors, seldsfrm, DBPropEdits, DB, rxctrls, RxLogin; Dialogs, ComponentEditors, seldsfrm, DBPropEdits, DB, rxctrls, RxLogin, RxCustomChartPanel;
type type
@ -204,6 +204,10 @@ begin
RegisterComponents('RX',[TRxLoginDialog]); RegisterComponents('RX',[TRxLoginDialog]);
end; end;
procedure RegisterChartPanel;
begin
RegisterComponents('RX',[TRxChart]);
end;
procedure Register; procedure Register;
@ -220,6 +224,7 @@ begin
RegisterUnit('rxappicon', @RegisterRxAppIcon); RegisterUnit('rxappicon', @RegisterRxAppIcon);
RegisterUnit('rxctrls', @RegisterRxCtrls); RegisterUnit('rxctrls', @RegisterRxCtrls);
RegisterUnit('RxLogin', @RegisterRxLogin); RegisterUnit('RxLogin', @RegisterRxLogin);
RegisterUnit('RxCustomChartPanel', @RegisterChartPanel);
//RX DBAware //RX DBAware
RegisterUnit('dbdateedit', @RegisterUnitDBDateEdit); RegisterUnit('dbdateedit', @RegisterUnitDBDateEdit);
RegisterUnit('rxlookup', @RegisterRXLookup); RegisterUnit('rxlookup', @RegisterRXLookup);

View File

@ -4,3 +4,4 @@
{$DEFINE RX_D3} {$DEFINE RX_D3}
{$DEFINE HASVARIANT} {$DEFINE HASVARIANT}
{.$DEFINE ENABLE_Child_Defs} {.$DEFINE ENABLE_Child_Defs}
{$DEFINE NEW_STYLE_TITLE_ALIGNMENT_RXDBGRID}

View File

@ -7,7 +7,7 @@
{ } { }
{*******************************************************} {*******************************************************}
unit RXConst; unit rxconst;
interface interface

View File

@ -576,7 +576,8 @@ type
procedure LinesChanged(Sender: TObject); procedure LinesChanged(Sender: TObject);
procedure CMFontChanged(var Message: TLMessage); message CM_FONTCHANGED; procedure CMFontChanged(var Message: TLMessage); message CM_FONTCHANGED;
procedure CMColorChanged(var Message: TLMessage); message CM_COLORCHANGED; procedure CMColorChanged(var Message: TLMessage); message CM_COLORCHANGED;
procedure WMSize(var Message: TLMessage); message LM_SIZE; // procedure WMSize(var Message: TLMessage); message LM_SIZE;
procedure WMSize(var Message: TLMSize); message LM_SIZE;
protected protected
procedure AlignControls(AControl: TControl; var Rect: TRect); override; procedure AlignControls(AControl: TControl; var Rect: TRect); override;
procedure Paint; override; procedure Paint; override;
@ -3111,7 +3112,8 @@ begin
if Active then UpdateMemoryImage; if Active then UpdateMemoryImage;
end; end;
procedure TSecretPanel.WMSize(var Message: TLMessage); //procedure TSecretPanel.WMSize(var Message: TLMessage);
procedure TSecretPanel.WMSize(var Message: TLMSize);
begin begin
inherited; inherited;
if Active then begin if Active then begin

View File

@ -0,0 +1,287 @@
unit rxcustomchartpanel;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, ExtCtrls;
type
TRxCustomChart = class;
TRxChartSeriesItem = class;
{ TRxChartValuesItem }
TRxChartValuesItem = class(TCollectionItem)
private
FCaption: string;
FColor: TColor;
FVisible: boolean;
FLabel:double;
procedure SetCaption(const AValue: string);
procedure SetColor(const AValue: TColor);
procedure SetVisible(const AValue: boolean);
protected
function GetDisplayName: string; override;
public
constructor Create(ACollection: TCollection); override;
destructor Destroy; override;
published
property Caption:string read FCaption write SetCaption;
property Color:TColor read FColor write SetColor;
property Visible:boolean read FVisible write SetVisible;
property LabelAsFloat:double read FLabel write FLabel;
property LabelAsDateTime:TDateTime read FLabel write FLabel;
end;
{ TRxChartValues }
TRxChartValues = class(TCollection)
private
FRxChartSeriesItem:TRxChartSeriesItem;
public
constructor Create(ARxChartSeriesItem:TRxChartSeriesItem);
end;
{ TRxChartSeriesItem }
TRxChartSeriesItem = class(TCollectionItem)
private
FCaption: string;
FColor: TColor;
FVisible: boolean;
FChartValues:TRxChartValues;
function GetItems: TRxChartValues;
procedure SetCaption(const AValue: string);
procedure SetColor(const AValue: TColor);
procedure SetItems(const AValue: TRxChartValues);
procedure SetVisible(const AValue: boolean);
protected
function GetDisplayName: string; override;
public
constructor Create(ACollection: TCollection); override;
destructor Destroy; override;
published
property Values:TRxChartValues read GetItems write SetItems;
property Caption:string read FCaption write SetCaption;
property Color:TColor read FColor write SetColor;
property Visible:boolean read FVisible write SetVisible;
end;
{ TRxChartSeries }
TRxChartSeries = class(TCollection)
private
FChart:TRxCustomChart;
function GetToolbarItem(Index: Integer): TRxChartSeriesItem;
procedure SetToolbarItem(Index: Integer; const AValue: TRxChartSeriesItem);
public
constructor Create(AChart:TRxCustomChart);
property Items[Index: Integer]: TRxChartSeriesItem read GetToolbarItem write SetToolbarItem; default;
published
end;
{ TRxCustomChart }
TRxCustomChart = class(TCustomPanel)
private
FChartSeries:TRxChartSeries;
function GetItems: TRxChartSeries;
procedure SetItems(const AValue: TRxChartSeries);
{ Private declarations }
protected
property ChartSeries:TRxChartSeries read GetItems write SetItems;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
published
{ Published declarations }
end;
TRxChart = class(TRxCustomChart)
published
property ChartSeries;
property Align;
property Alignment;
property Anchors;
property AutoSize;
property BorderSpacing;
property BevelInner;
property BevelOuter;
property BevelWidth;
property BorderWidth;
property BorderStyle;
property Caption;
property Constraints;
property DragMode;
property Enabled;
property Font;
property FullRepaint;
property ParentColor;
property ParentFont;
property ParentShowHint;
property PopupMenu;
property ShowHint;
property TabOrder;
property TabStop;
property Visible;
property OnClick;
property OnDblClick;
property OnDragDrop;
property OnDragOver;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnResize;
property OnStartDrag;
end;
implementation
{ TRxChartSeriesItem }
procedure TRxChartSeriesItem.SetCaption(const AValue: string);
begin
if FCaption=AValue then exit;
FCaption:=AValue;
end;
function TRxChartSeriesItem.GetItems: TRxChartValues;
begin
Result:=FChartValues;
end;
procedure TRxChartSeriesItem.SetColor(const AValue: TColor);
begin
if FColor=AValue then exit;
FColor:=AValue;
end;
procedure TRxChartSeriesItem.SetItems(const AValue: TRxChartValues);
begin
FChartValues.Assign(AValue);
end;
procedure TRxChartSeriesItem.SetVisible(const AValue: boolean);
begin
if FVisible=AValue then exit;
FVisible:=AValue;
end;
function TRxChartSeriesItem.GetDisplayName: string;
begin
if FCaption<>'' then
Result:=FCaption
else
Result:=inherited GetDisplayName;
end;
constructor TRxChartSeriesItem.Create(ACollection: TCollection);
begin
inherited Create(ACollection);
FChartValues:=TRxChartValues.Create(Self);
end;
destructor TRxChartSeriesItem.Destroy;
begin
FreeAndNil(FChartValues);
inherited Destroy;
end;
{ TRxChartSeries }
function TRxChartSeries.GetToolbarItem(Index: Integer): TRxChartSeriesItem;
begin
result := TRxChartSeriesItem( inherited Items[Index] );
end;
procedure TRxChartSeries.SetToolbarItem(Index: Integer;
const AValue: TRxChartSeriesItem);
begin
Items[Index].Assign( AValue );
end;
constructor TRxChartSeries.Create(AChart: TRxCustomChart);
begin
inherited Create(TRxChartSeriesItem);
FChart:=AChart;
end;
{ TRxCustomChart }
function TRxCustomChart.GetItems: TRxChartSeries;
begin
Result:=FChartSeries;
end;
procedure TRxCustomChart.SetItems(const AValue: TRxChartSeries);
begin
FChartSeries.Assign(AValue);
end;
constructor TRxCustomChart.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FChartSeries:=TRxChartSeries.Create(Self);
end;
destructor TRxCustomChart.Destroy;
begin
FreeAndNil(FChartSeries);
inherited Destroy;
end;
{ TRxChartValues }
constructor TRxChartValues.Create(ARxChartSeriesItem: TRxChartSeriesItem);
begin
inherited Create(TRxChartValuesItem);
FRxChartSeriesItem := ARxChartSeriesItem;
end;
{ TRxChartValuesItem }
procedure TRxChartValuesItem.SetCaption(const AValue: string);
begin
if FCaption=AValue then exit;
FCaption:=AValue;
end;
procedure TRxChartValuesItem.SetColor(const AValue: TColor);
begin
if FColor=AValue then exit;
FColor:=AValue;
end;
procedure TRxChartValuesItem.SetVisible(const AValue: boolean);
begin
if FVisible=AValue then exit;
FVisible:=AValue;
end;
function TRxChartValuesItem.GetDisplayName: string;
begin
if FCaption<>'' then
Result:=FCaption
else
Result:=inherited GetDisplayName;
end;
constructor TRxChartValuesItem.Create(ACollection: TCollection);
begin
inherited Create(ACollection);
end;
destructor TRxChartValuesItem.Destroy;
begin
inherited Destroy;
end;
end.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,91 @@
object rxDBGridColumsForm: TrxDBGridColumsForm
Left = 492
Height = 296
Top = 264
Width = 355
HorzScrollBar.Page = 354
VertScrollBar.Page = 295
Caption = 'Grid colums'
ClientHeight = 296
ClientWidth = 355
PixelsPerInch = 96
object SpeedButton1: TSpeedButton
Left = 8
Height = 22
Top = 260
Width = 23
Color = clBtnFace
Glyph.Data = {
9B0100002F2A2058504D202A2F0A7374617469632063686172202A506F696E74
55505B5D3D7B0A22313620313620332031222C0A222E2063204E6F6E65222C0A
222320632023303030303030222C0A226120632023303038303830222C0A222E
2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E222C0A222E2E2E2E2E2E2E2E2E2E2E2E2E
2E2E2E222C0A222E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E222C0A222E2E2E2E2E
2E2E2E232E2E2E2E2E2E2E222C0A222E2E2E2E2E2E2E2361232E2E2E2E2E2E22
2C0A222E2E2E2E2E2E23616161232E2E2E2E2E222C0A222E2E2E2E2E23616161
6161232E2E2E2E222C0A222E2E2E2E2361616161616161232E2E2E222C0A222E
2E2E23232323616161232323232E2E222C0A222E2E2E2E2E2E23616161232E2E
2E2E2E222C0A222E2E2E2E2E2E23616161232E2E2E2E2E222C0A222E2E2E2E2E
2E23616161232E2E2E2E2E222C0A222E2E2E2E2E2E23232323232E2E2E2E2E22
2C0A222E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E222C0A222E2E2E2E2E2E2E2E2E
2E2E2E2E2E2E2E222C0A222E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E227D3B0A
}
NumGlyphs = 0
end
object SpeedButton2: TSpeedButton
Left = 40
Height = 22
Top = 260
Width = 23
Color = clBtnFace
Glyph.Data = {
9D0100002F2A2058504D202A2F0A7374617469632063686172202A506F696E74
446F776E5B5D3D7B0A22313620313620332031222C0A222E2063204E6F6E6522
2C0A222320632023303030303030222C0A226120632023303038303830222C0A
222E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E222C0A222E2E2E2E2E2E2E2E2E2E2E
2E2E2E2E2E222C0A222E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E222C0A222E2E2E
2E2E2E23232323232E2E2E2E2E222C0A222E2E2E2E2E2E23616161232E2E2E2E
2E222C0A222E2E2E2E2E2E23616161232E2E2E2E2E222C0A222E2E2E2E2E2E23
616161232E2E2E2E2E222C0A222E2E2E23232323616161232323232E2E222C0A
222E2E2E2E2361616161616161232E2E2E222C0A222E2E2E2E2E236161616161
232E2E2E2E222C0A222E2E2E2E2E2E23616161232E2E2E2E2E222C0A222E2E2E
2E2E2E2E2361232E2E2E2E2E2E222C0A222E2E2E2E2E2E2E2E232E2E2E2E2E2E
2E222C0A222E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E222C0A222E2E2E2E2E2E2E
2E2E2E2E2E2E2E2E2E222C0A222E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2E227D3B
0A
}
NumGlyphs = 0
end
object CheckListBox1: TCheckListBox
Left = 8
Height = 238
Top = 8
Width = 340
Anchors = [akTop, akLeft, akRight]
TabOrder = 0
end
object Button1: TButton
Left = 195
Height = 30
Top = 258
Width = 75
Anchors = [akRight, akBottom]
BorderSpacing.InnerBorder = 2
Caption = 'OK'
Default = True
ModalResult = 1
TabOrder = 1
end
object Button2: TButton
Left = 273
Height = 30
Top = 258
Width = 75
Anchors = [akRight, akBottom]
BorderSpacing.InnerBorder = 2
Cancel = True
Caption = 'Cancel'
ModalResult = 2
TabOrder = 2
end
end

View File

@ -0,0 +1,34 @@
{ ��� - ���� ��������, ������������� ��������� lazarus }
LazarusResources.Add('TrxDBGridColumsForm','FORMDATA',[
'TPF0'#19'TrxDBGridColumsForm'#18'rxDBGridColumsForm'#4'Left'#3#236#1#6'Heigh'
+'t'#3'('#1#3'Top'#3#8#1#5'Width'#3'c'#1#18'HorzScrollBar.Page'#3'b'#1#18'Ver'
+'tScrollBar.Page'#3''''#1#7'Caption'#6#11'Grid colums'#12'ClientHeight'#3'('
+#1#11'ClientWidth'#3'c'#1#13'PixelsPerInch'#2'`'#0#12'TSpeedButton'#12'Speed'
+'Button1'#4'Left'#2#8#6'Height'#2#22#3'Top'#3#4#1#5'Width'#2#23#5'Color'#7#9
+'clBtnFace'#10'Glyph.Data'#10#159#1#0#0#155#1#0#0'/* XPM */'#10'static char '
+'*PointUP[]={'#10'"16 16 3 1",'#10'". c None",'#10'"# c #000000",'#10'"a c #'
+'008080",'#10'"................",'#10'"................",'#10'".............'
+'...",'#10'"........#.......",'#10'".......#a#......",'#10'"......#aaa#.....'
+'",'#10'".....#aaaaa#....",'#10'"....#aaaaaaa#...",'#10'"...####aaa####..",'
+#10'"......#aaa#.....",'#10'"......#aaa#.....",'#10'"......#aaa#.....",'#10
+'"......#####.....",'#10'"................",'#10'"................",'#10'"..'
+'.............."};'#10#9'NumGlyphs'#2#0#0#0#12'TSpeedButton'#12'SpeedButton2'
+#4'Left'#2'('#6'Height'#2#22#3'Top'#3#4#1#5'Width'#2#23#5'Color'#7#9'clBtnFa'
+'ce'#10'Glyph.Data'#10#161#1#0#0#157#1#0#0'/* XPM */'#10'static char *PointD'
+'own[]={'#10'"16 16 3 1",'#10'". c None",'#10'"# c #000000",'#10'"a c #00808'
+'0",'#10'"................",'#10'"................",'#10'"................",'
+#10'"......#####.....",'#10'"......#aaa#.....",'#10'"......#aaa#.....",'#10
+'"......#aaa#.....",'#10'"...####aaa####..",'#10'"....#aaaaaaa#...",'#10'"..'
+'...#aaaaa#....",'#10'"......#aaa#.....",'#10'".......#a#......",'#10'".....'
+'...#.......",'#10'"................",'#10'"................",'#10'"........'
+'........"};'#10#9'NumGlyphs'#2#0#0#0#13'TCheckListBox'#13'CheckListBox1'#4
+'Left'#2#8#6'Height'#3#238#0#3'Top'#2#8#5'Width'#3'T'#1#7'Anchors'#11#5'akTo'
+'p'#6'akLeft'#7'akRight'#0#8'TabOrder'#2#0#0#0#7'TButton'#7'Button1'#4'Left'
+#3#195#0#6'Height'#2#30#3'Top'#3#2#1#5'Width'#2'K'#7'Anchors'#11#7'akRight'#8
+'akBottom'#0#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#2'OK'#7'Default'
+#9#11'ModalResult'#2#1#8'TabOrder'#2#1#0#0#7'TButton'#7'Button2'#4'Left'#3#17
+#1#6'Height'#2#30#3'Top'#3#2#1#5'Width'#2'K'#7'Anchors'#11#7'akRight'#8'akBo'
+'ttom'#0#25'BorderSpacing.InnerBorder'#2#2#6'Cancel'#9#7'Caption'#6#6'Cancel'
+#11'ModalResult'#2#2#8'TabOrder'#2#2#0#0#0
]);

View File

@ -0,0 +1,78 @@
unit rxdbgrid_columsunit;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, CheckLst,
StdCtrls, Buttons, rxdbgrid;
type
{ TrxDBGridColumsForm }
TrxDBGridColumsForm = class(TForm)
Button1: TButton;
Button2: TButton;
CheckListBox1: TCheckListBox;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
private
FGrid:TRxDBGrid;
procedure SetGrid(AGrid:TRxDBGrid);
procedure SetGridColumnsVisible;
public
{ public declarations }
end;
procedure ShowRxDBGridColumsForm(Grid:TRxDBGrid);
implementation
procedure ShowRxDBGridColumsForm(Grid: TRxDBGrid);
var
rxDBGridColumsForm: TrxDBGridColumsForm;
begin
rxDBGridColumsForm:=TrxDBGridColumsForm.Create(Application);
rxDBGridColumsForm.SetGrid(Grid);
if rxDBGridColumsForm.ShowModal = mrOk then
rxDBGridColumsForm.SetGridColumnsVisible;
rxDBGridColumsForm.Free;
end;
{ TrxDBGridColumsForm }
procedure TrxDBGridColumsForm.SetGrid(AGrid: TRxDBGrid);
var
i:integer;
begin
if AGrid=FGrid then exit;
FGrid:=AGrid;
CheckListBox1.Items.Clear;
if Assigned(AGrid) then
begin
for i:=0 to AGrid.Columns.Count-1 do
begin
CheckListBox1.Items.Add(AGrid.Columns[i].Title.Caption);
CheckListBox1.Checked[i]:=AGrid.Columns[i].Visible;
end;
end;
end;
procedure TrxDBGridColumsForm.SetGridColumnsVisible;
var
i:integer;
begin
if Assigned(FGrid) then
begin
for i:=0 to CheckListBox1.Items.Count-1 do
FGrid.Columns[i].Visible:=CheckListBox1.Checked[i];
end;
end;
initialization
{$I rxdbgrid_columsunit.lrs}
end.

View File

@ -0,0 +1,114 @@
object rxDBGridFindForm: TrxDBGridFindForm
Left = 436
Height = 99
Top = 423
Width = 434
HorzScrollBar.Page = 433
VertScrollBar.Page = 98
ActiveControl = BtnFind
Caption = 'Find'
ClientHeight = 99
ClientWidth = 434
OnShow = FormShow
PixelsPerInch = 96
object Label1: TLabel
Left = 6
Height = 14
Top = 19
Width = 57
Caption = 'Text to find'
Color = clNone
FocusControl = Edit1
ParentColor = False
end
object Label2: TLabel
Left = 8
Height = 14
Top = 48
Width = 57
Caption = 'Find at filed'
Color = clNone
ParentColor = False
end
object BtnFind: TButton
Left = 346
Height = 25
Top = 8
Width = 83
Anchors = [akTop, akRight]
BorderSpacing.InnerBorder = 2
Caption = 'Find more'
Default = True
OnClick = BtnFindClick
TabOrder = 4
end
object Button2: TButton
Left = 346
Height = 25
Top = 41
Width = 83
Anchors = [akTop, akRight]
BorderSpacing.InnerBorder = 2
Cancel = True
Caption = 'Close'
OnClick = Button2Click
TabOrder = 5
end
object Edit1: TEdit
Left = 80
Height = 23
Top = 8
Width = 258
Anchors = [akTop, akLeft, akRight]
TabOrder = 0
end
object ComboBox1: TComboBox
Left = 80
Height = 21
Top = 36
Width = 256
AutoCompleteText = [cbactEndOfLineComplete, cbactSearchAscending]
MaxLength = 0
Style = csDropDownList
TabOrder = 1
end
object CheckBox1: TCheckBox
Left = 8
Height = 13
Top = 72
Width = 92
Caption = 'Case sensetive'
TabOrder = 2
end
object RadioGroup1: TRadioGroup
Left = 232
Height = 76
Top = 72
Width = 150
AutoFill = True
Caption = 'Direction'
ChildSizing.LeftRightSpacing = 6
ChildSizing.TopBottomSpacing = 6
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
ChildSizing.EnlargeVertical = crsHomogenousChildResize
ChildSizing.ShrinkHorizontal = crsScaleChilds
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
Items.Strings = (
'All'
'Forward'
'Backward'
)
TabOrder = 6
Visible = False
end
object CheckBox2: TCheckBox
Left = 128
Height = 13
Top = 70
Width = 69
Caption = 'Partial key'
TabOrder = 3
end
end

View File

@ -0,0 +1,36 @@
{ ��� - ���� ��������, ������������� ��������� lazarus }
LazarusResources.Add('TrxDBGridFindForm','FORMDATA',[
'TPF0'#17'TrxDBGridFindForm'#16'rxDBGridFindForm'#4'Left'#3#180#1#6'Height'#2
+'c'#3'Top'#3#167#1#5'Width'#3#178#1#18'HorzScrollBar.Page'#3#177#1#18'VertSc'
+'rollBar.Page'#2'b'#13'ActiveControl'#7#7'BtnFind'#7'Caption'#6#4'Find'#12'C'
+'lientHeight'#2'c'#11'ClientWidth'#3#178#1#6'OnShow'#7#8'FormShow'#13'Pixels'
+'PerInch'#2'`'#0#6'TLabel'#6'Label1'#4'Left'#2#6#6'Height'#2#14#3'Top'#2#19#5
+'Width'#2'9'#7'Caption'#6#12'Text to find'#5'Color'#7#6'clNone'#12'FocusCont'
+'rol'#7#5'Edit1'#11'ParentColor'#8#0#0#6'TLabel'#6'Label2'#4'Left'#2#8#6'Hei'
+'ght'#2#14#3'Top'#2'0'#5'Width'#2'9'#7'Caption'#6#13'Find at filed'#5'Color'
+#7#6'clNone'#11'ParentColor'#8#0#0#7'TButton'#7'BtnFind'#4'Left'#3'Z'#1#6'He'
+'ight'#2#25#3'Top'#2#8#5'Width'#2'S'#7'Anchors'#11#5'akTop'#7'akRight'#0#25
+'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#9'Find more'#7'Default'#9#7'OnC'
+'lick'#7#12'BtnFindClick'#8'TabOrder'#2#4#0#0#7'TButton'#7'Button2'#4'Left'#3
+'Z'#1#6'Height'#2#25#3'Top'#2')'#5'Width'#2'S'#7'Anchors'#11#5'akTop'#7'akRi'
+'ght'#0#25'BorderSpacing.InnerBorder'#2#2#6'Cancel'#9#7'Caption'#6#5'Close'#7
+'OnClick'#7#12'Button2Click'#8'TabOrder'#2#5#0#0#5'TEdit'#5'Edit1'#4'Left'#2
+'P'#6'Height'#2#23#3'Top'#2#8#5'Width'#3#2#1#7'Anchors'#11#5'akTop'#6'akLeft'
+#7'akRight'#0#8'TabOrder'#2#0#0#0#9'TComboBox'#9'ComboBox1'#4'Left'#2'P'#6'H'
+'eight'#2#21#3'Top'#2'$'#5'Width'#3#0#1#16'AutoCompleteText'#11#22'cbactEndO'
+'fLineComplete'#20'cbactSearchAscending'#0#9'MaxLength'#2#0#5'Style'#7#14'cs'
+'DropDownList'#8'TabOrder'#2#1#0#0#9'TCheckBox'#9'CheckBox1'#4'Left'#2#8#6'H'
+'eight'#2#13#3'Top'#2'H'#5'Width'#2'\'#7'Caption'#6#14'Case sensetive'#8'Tab'
+'Order'#2#2#0#0#11'TRadioGroup'#11'RadioGroup1'#4'Left'#3#232#0#6'Height'#2
+'L'#3'Top'#2'H'#5'Width'#3#150#0#8'AutoFill'#9#7'Caption'#6#9'Direction'#28
+'ChildSizing.LeftRightSpacing'#2#6#28'ChildSizing.TopBottomSpacing'#2#6#29'C'
+'hildSizing.EnlargeHorizontal'#7#24'crsHomogenousChildResize'#27'ChildSizing'
+'.EnlargeVertical'#7#24'crsHomogenousChildResize'#28'ChildSizing.ShrinkHoriz'
+'ontal'#7#14'crsScaleChilds'#26'ChildSizing.ShrinkVertical'#7#14'crsScaleChi'
+'lds'#18'ChildSizing.Layout'#7#29'cclLeftToRightThenTopToBottom'#27'ChildSiz'
+'ing.ControlsPerLine'#2#1#13'Items.Strings'#1#6#3'All'#6#7'Forward'#6#8'Back'
+'ward'#0#8'TabOrder'#2#6#7'Visible'#8#0#0#9'TCheckBox'#9'CheckBox2'#4'Left'#3
+#128#0#6'Height'#2#13#3'Top'#2'F'#5'Width'#2'E'#7'Caption'#6#11'Partial key'
+#8'TabOrder'#2#3#0#0#0
]);

View File

@ -0,0 +1,106 @@
unit rxdbgrid_findunit;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, Buttons,
StdCtrls, ExtCtrls, rxdbgrid, DB;
type
{ TrxDBGridFindForm }
TrxDBGridFindForm = class(TForm)
BtnFind: TButton;
Button2: TButton;
CheckBox1: TCheckBox;
CheckBox2: TCheckBox;
ComboBox1: TComboBox;
Edit1: TEdit;
Label1: TLabel;
Label2: TLabel;
RadioGroup1: TRadioGroup;
procedure BtnFindClick(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FormShow(Sender: TObject);
private
FGrid:TRxDBGrid;
FDataSet:TDataSet;
procedure SetGrid(AGrid:TRxDBGrid);
public
{ public declarations }
end;
procedure ShowRxDBGridFindForm(Grid:TRxDBGrid);
implementation
uses dbutils, DBGrids;
procedure ShowRxDBGridFindForm(Grid: TRxDBGrid);
var
rxDBGridFindForm: TrxDBGridFindForm;
begin
rxDBGridFindForm:=TrxDBGridFindForm.Create(Application);
rxDBGridFindForm.SetGrid(Grid);
rxDBGridFindForm.ShowModal;
rxDBGridFindForm.Free;
end;
{ TrxDBGridFindForm }
procedure TrxDBGridFindForm.Button2Click(Sender: TObject);
begin
Close;
end;
procedure TrxDBGridFindForm.FormShow(Sender: TObject);
begin
Edit1.SetFocus;
end;
procedure TrxDBGridFindForm.BtnFindClick(Sender: TObject);
var
FieldName:string;
LOptions: TLocateOptions;
begin
FieldName:=FGrid.Columns[ComboBox1.ItemIndex].FieldName;
LOptions:=[];
if not CheckBox1.Checked then
LOptions:=LOptions+[loCaseInsensitive];
if CheckBox2.Checked then
LOptions:=LOptions+[loPartialKey];
DataSetLocateThrough(FDataSet, FieldName, Edit1.Text, LOptions);
end;
type
THckGrid = class(TCustomDBGrid)
end;
procedure TrxDBGridFindForm.SetGrid(AGrid: TRxDBGrid);
var
i:integer;
begin
if AGrid=FGrid then exit;
FGrid:=AGrid;
ComboBox1.Items.Clear;
if Assigned(AGrid) then
begin
for i:=0 to AGrid.Columns.Count-1 do
ComboBox1.Items.Add(AGrid.Columns[i].Title.Caption);
ComboBox1.ItemIndex:=ComboBox1.Items.IndexOf(AGrid.SelectedColumn.Title.Caption);
end;
FDataSet:=nil;
if Assigned(FGrid) and Assigned(THckGrid(FGrid).DataSource) then
FDataSet:=THckGrid(FGrid).DataSource.DataSet;
BtnFind.Enabled:=Assigned(FDataSet) and FDataSet.Active
end;
initialization
{$I rxdbgrid_findunit.lrs}
end.

View File

@ -176,6 +176,7 @@ const
sShowHint = '.ShowHint'; sShowHint = '.ShowHint';
sShowCaption = '.ShowCaption'; sShowCaption = '.ShowCaption';
sToolBarStyle = '.ToolBarStyle'; sToolBarStyle = '.ToolBarStyle';
sButtonAllign = '.ButtonAllign';
sOptions = '.Options'; sOptions = '.Options';
sCaption = '.Caption'; sCaption = '.Caption';

View File

@ -40,11 +40,11 @@ type
procedure CMFocusChanged(var Message: TLMessage); message CM_FOCUSCHANGED; procedure CMFocusChanged(var Message: TLMessage); message CM_FOCUSCHANGED;
procedure WMSize(var Message: TLMSize); message LM_SIZE; procedure WMSize(var Message: TLMSize); message LM_SIZE;
procedure CreateBitmap; procedure CreateBitmap;
procedure SetAutoSize(aValue: Boolean); procedure SetAutoSize(Value: Boolean);
procedure SetInterval(aValue: Cardinal); procedure SetInterval(Value: Cardinal);
procedure SetRotate(AValue: Boolean); procedure SetRotate(AValue: Boolean);
procedure SetShowFocus(AValue: Boolean); procedure SetShowFocus(AValue: Boolean);
procedure SetValue(aValue: TRxDiceValue); procedure SetValue(Value: TRxDiceValue);
procedure TimerExpired(Sender: TObject); procedure TimerExpired(Sender: TObject);
protected protected
{ Protected declarations } { Protected declarations }
@ -238,11 +238,7 @@ var
TmpImage.Width := IWidth; TmpImage.Width := IWidth;
TmpImage.Height := IHeight; TmpImage.Height := IHeight;
TmpImage.Canvas.Brush.Color := Self.Brush.Color; TmpImage.Canvas.Brush.Color := Self.Brush.Color;
// Changes by MJW. Start ++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Replacing BrushCopy() by CopyRect. As BrushCopy is not defined in FPC/Laz
TmpImage.Canvas.CopyRect(IRect, FBitmap.Canvas, IRect);
// TmpImage.Canvas.BrushCopy(IRect, FBitmap, IRect, FBitmap.TransparentColor); // TmpImage.Canvas.BrushCopy(IRect, FBitmap, IRect, FBitmap.TransparentColor);
// Changes by MJW. Eind +++++++++++++++++++++++++++++++++++++++++++++++++++++++
InflateRect(ARect, -1, -1); InflateRect(ARect, -1, -1);
// Canvas.StretchDraw(ARect, TmpImage); // Canvas.StretchDraw(ARect, TmpImage);
Canvas.StretchDraw(ARect, FBitmap); Canvas.StretchDraw(ARect, FBitmap);
@ -292,32 +288,32 @@ begin
if Assigned(FOnChange) then FOnChange(Self); if Assigned(FOnChange) then FOnChange(Self);
end; end;
procedure TRxDice.SetValue(aValue: TRxDiceValue); procedure TRxDice.SetValue(Value: TRxDiceValue);
begin begin
if FValue <> aValue then if FValue <> Value then
begin begin
FValue := aValue; FValue := Value;
CreateBitmap; CreateBitmap;
Invalidate; Invalidate;
Change; Change;
end; end;
end; end;
procedure TRxDice.SetAutoSize(aValue: Boolean); procedure TRxDice.SetAutoSize(Value: Boolean);
begin begin
if aValue <> FAutoSize then if Value <> FAutoSize then
begin begin
FAutoSize := aValue; FAutoSize := Value;
AdjustSize; AdjustSize;
Invalidate; Invalidate;
end; end;
end; end;
procedure TRxDice.SetInterval(aValue: Cardinal); procedure TRxDice.SetInterval(Value: Cardinal);
begin begin
if FInterval <> aValue then if FInterval <> Value then
begin begin
FInterval := aValue; FInterval := Value;
if FTimer <> nil then FTimer.Interval := FInterval; if FTimer <> nil then FTimer.Interval := FInterval;
end; end;
end; end;

View File

@ -1,4 +1,11 @@
object RxLoginForm: TRxLoginForm object RxLoginForm: TRxLoginForm
Cursor = crArrow
Left = 213
Height = 159
Top = 102
Width = 442
HorzScrollBar.Page = 441
VertScrollBar.Page = 158
BorderIcons = [] BorderIcons = []
BorderStyle = bsDialog BorderStyle = bsDialog
Caption = 'RxLoginForm' Caption = 'RxLoginForm'
@ -12,25 +19,20 @@ object RxLoginForm: TRxLoginForm
PixelsPerInch = 96 PixelsPerInch = 96
Position = poScreenCenter Position = poScreenCenter
TextHeight = 13 TextHeight = 13
HorzScrollBar.Page = 441
VertScrollBar.Page = 158
Cursor = crArrow
Left = 213
Height = 159
Top = 102
Width = 442
object AppIcon: TImage object AppIcon: TImage
AutoSize = True
BorderSpacing.OnChange = nil
Transparent = True
Left = 14 Left = 14
Height = 32 Height = 32
Top = 12 Top = 12
Width = 32 Width = 32
AutoSize = True
Transparent = True
end end
object KeyImage: TImage object KeyImage: TImage
Left = 10
Height = 32
Top = 15
Width = 32
AutoSize = True AutoSize = True
BorderSpacing.OnChange = nil
Picture.Data = { Picture.Data = {
055449636F6EFE0200000000010001002020100000000000E802000016000000 055449636F6EFE0200000000010001002020100000000000E802000016000000
2800000020000000400000000100040000000000800200000000000000000000 2800000020000000400000000100040000000000800200000000000000000000
@ -59,114 +61,106 @@ object RxLoginForm: TRxLoginForm
FFFFFFFFFFFFFFFF FFFFFFFFFFFFFFFF
} }
Transparent = True Transparent = True
Left = 10
Height = 32
Top = 15
Width = 32
end end
object HintLabel: TLabel object HintLabel: TLabel
AutoSize = False
BorderSpacing.OnChange = nil
Color = clNone
ShowAccelChar = False
Left = 64 Left = 64
Height = 13 Height = 13
Top = 31 Top = 31
Width = 285 Width = 285
AutoSize = False
Color = clNone
ParentColor = False
ShowAccelChar = False
end end
object UserNameLabel: TLabel object UserNameLabel: TLabel
AutoSize = False
BorderSpacing.OnChange = nil
Color = clNone
FocusControl = UserNameEdit
Left = 64 Left = 64
Height = 13 Height = 13
Top = 64 Top = 64
Width = 105 Width = 105
AutoSize = False
Color = clNone
FocusControl = UserNameEdit
ParentColor = False
end end
object PasswordLabel: TLabel object PasswordLabel: TLabel
AutoSize = False
BorderSpacing.OnChange = nil
Color = clNone
FocusControl = PasswordEdit
Left = 64 Left = 64
Height = 13 Height = 13
Top = 96 Top = 96
Width = 105 Width = 105
AutoSize = False
Color = clNone
FocusControl = PasswordEdit
ParentColor = False
end end
object AppTitleLabel: TLabel object AppTitleLabel: TLabel
AutoSize = False
BorderSpacing.OnChange = nil
Color = clNone
ShowAccelChar = False
Left = 64 Left = 64
Height = 13 Height = 13
Top = 12 Top = 12
Width = 285 Width = 285
AutoSize = False
Color = clNone
ParentColor = False
ShowAccelChar = False
end end
object CustomLabel: TLabel object CustomLabel: TLabel
AutoSize = False
BorderSpacing.OnChange = nil
Color = clNone
FocusControl = CustomCombo
Left = 64 Left = 64
Height = 13 Height = 13
Top = 128 Top = 128
Width = 105 Width = 105
AutoSize = False
Color = clNone
FocusControl = CustomCombo
ParentColor = False
end end
object UserNameEdit: TEdit object UserNameEdit: TEdit
BorderSpacing.OnChange = nil
TabOrder = 0
Cursor = crIBeam Cursor = crIBeam
Left = 172 Left = 172
Height = 21 Height = 21
Top = 60 Top = 60
Width = 169 Width = 169
TabOrder = 0
end end
object PasswordEdit: TEdit object PasswordEdit: TEdit
BorderSpacing.OnChange = nil
PasswordChar = '*'
TabOrder = 1
Cursor = crIBeam Cursor = crIBeam
Left = 172 Left = 172
Height = 21 Height = 21
Top = 92 Top = 92
Width = 169 Width = 169
PasswordChar = '*'
TabOrder = 1
end end
object OkBtn: TButton object OkBtn: TButton
BorderSpacing.OnChange = nil Left = 356
Height = 25
Top = 12
Width = 77
BorderSpacing.InnerBorder = 2 BorderSpacing.InnerBorder = 2
Caption = 'OK' Caption = 'OK'
Default = True Default = True
OnClick = OkBtnClick OnClick = OkBtnClick
TabOrder = 3 TabOrder = 3
Left = 356
Height = 25
Top = 12
Width = 77
end end
object CancelBtn: TButton object CancelBtn: TButton
BorderSpacing.OnChange = nil Left = 356
Height = 25
Top = 44
Width = 77
BorderSpacing.InnerBorder = 2 BorderSpacing.InnerBorder = 2
Cancel = True Cancel = True
Caption = 'Cancel' Caption = 'Cancel'
ModalResult = 2 ModalResult = 2
TabOrder = 4 TabOrder = 4
Left = 356
Height = 25
Top = 44
Width = 77
end end
object CustomCombo: TComboBox object CustomCombo: TComboBox
BorderSpacing.OnChange = nil Left = 172
Height = 21
Top = 124
Width = 169
AutoCompleteText = [cbactEndOfLineComplete, cbactSearchAscending]
ItemHeight = 13 ItemHeight = 13
MaxLength = 0 MaxLength = 0
Sorted = True Sorted = True
Style = csDropDownList Style = csDropDownList
TabOrder = 2 TabOrder = 2
Left = 172
Height = 21
Top = 124
Width = 169
end end
end end

View File

@ -1,28 +1,28 @@
{ ��� - ���� ��������, ������������� ��������� lazarus } { ��� - ���� ��������, ������������� ��������� lazarus }
LazarusResources.Add('TRxLoginForm','FORMDATA',[ LazarusResources.Add('TRxLoginForm','FORMDATA',[
'TPF0'#12'TRxLoginForm'#11'RxLoginForm'#11'BorderIcons'#11#0#11'BorderStyle'#7 'TPF0'#12'TRxLoginForm'#11'RxLoginForm'#6'Cursor'#7#7'crArrow'#4'Left'#3#213#0
+#8'bsDialog'#7'Caption'#6#11'RxLoginForm'#12'ClientHeight'#3#159#0#11'Client' +#6'Height'#3#159#0#3'Top'#2'f'#5'Width'#3#186#1#18'HorzScrollBar.Page'#3#185
+'Width'#3#186#1#11'Font.Height'#2#245#9'Font.Name'#6#13'MS Sans Serif'#9'For' +#1#18'VertScrollBar.Page'#3#158#0#11'BorderIcons'#11#0#11'BorderStyle'#7#8'b'
+'mStyle'#7#11'fsStayOnTop'#8'OnCreate'#7#10'FormCreate'#6'OnShow'#7#8'FormSh' +'sDialog'#7'Caption'#6#11'RxLoginForm'#12'ClientHeight'#3#159#0#11'ClientWid'
+'ow'#13'PixelsPerInch'#2'`'#8'Position'#7#14'poScreenCenter'#10'TextHeight'#2 +'th'#3#186#1#11'Font.Height'#2#245#9'Font.Name'#6#13'MS Sans Serif'#9'FormSt'
+#13#18'HorzScrollBar.Page'#3#185#1#18'VertScrollBar.Page'#3#158#0#6'Cursor'#7 +'yle'#7#11'fsStayOnTop'#8'OnCreate'#7#10'FormCreate'#6'OnShow'#7#8'FormShow'
+#7'crArrow'#4'Left'#3#213#0#6'Height'#3#159#0#3'Top'#2'f'#5'Width'#3#186#1#0 +#13'PixelsPerInch'#2'`'#8'Position'#7#14'poScreenCenter'#10'TextHeight'#2#13
+#6'TImage'#7'AppIcon'#8'AutoSize'#9#22'BorderSpacing.OnChange'#13#11'Transpa' +#0#6'TImage'#7'AppIcon'#4'Left'#2#14#6'Height'#2' '#3'Top'#2#12#5'Width'#2' '
+'rent'#9#4'Left'#2#14#6'Height'#2' '#3'Top'#2#12#5'Width'#2' '#0#0#6'TImage' +#8'AutoSize'#9#11'Transparent'#9#0#0#6'TImage'#8'KeyImage'#4'Left'#2#10#6'He'
+#8'KeyImage'#8'AutoSize'#9#22'BorderSpacing.OnChange'#13#12'Picture.Data'#10 +'ight'#2' '#3'Top'#2#15#5'Width'#2' '#8'AutoSize'#9#12'Picture.Data'#10#8#3#0
+#8#3#0#0#5'TIcon'#254#2#0#0#0#0#1#0#1#0' '#16#0#0#0#0#0#232#2#0#0#22#0#0#0 +#0#5'TIcon'#254#2#0#0#0#0#1#0#1#0' '#16#0#0#0#0#0#232#2#0#0#22#0#0#0'('#0#0
+'('#0#0#0' '#0#0#0'@'#0#0#0#1#0#4#0#0#0#0#0#128#2#0#0#0#0#0#0#0#0#0#0#0#0#0#0 +#0' '#0#0#0'@'#0#0#0#1#0#4#0#0#0#0#0#128#2#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+#0#0#0#0#0#0#0#0#0#0#128#0#0#128#0#0#0#128#128#0#128#0#0#0#128#0#128#0#128 +#0#0#0#0#0#0#0#128#0#0#128#0#0#0#128#128#0#128#0#0#0#128#0#128#0#128#128#0#0
+#128#0#0#192#192#192#0#128#128#128#0#0#0#255#0#0#255#0#0#0#255#255#0#255#0#0 +#192#192#192#0#128#128#128#0#0#0#255#0#0#255#0#0#0#255#255#0#255#0#0#0#255#0
+#0#255#0#255#0#255#255#0#0#255#255#255#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#143 +#255#0#255#255#0#0#255#255#255#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#143#255#255
+#255#255#255#255#255#255#255#255#0#0#0#0#0#0#0#143#255#255#255#255#255#255 +#255#255#255#255#255#255#0#0#0#0#0#0#0#143#255#255#255#255#255#255#255#255#0
+#255#255#0#0#0#0#0#0#0#143#255#255#255#255#240#15#0#255#0#0#0#0#0#0#0#143#248 +#0#0#0#0#0#0#143#255#255#255#255#240#15#0#255#0#0#0#0#0#0#0#143#248#0#255#255
+#0#255#255#240#15#0#255#0#0#0#0#0#0#0#143#128#128#15#255#240#15#0#255#0#0#0#0 +#240#15#0#255#0#0#0#0#0#0#0#143#128#128#15#255#240#15#0#255#0#0#0#0#0#0#0#143
+#0#0#0#143#0#255#0#0#0#0#0#15#0#0#0#0#0#0#0#143#0#255#0#0#0#0#0#15#0#0#0#0#0 +#0#255#0#0#0#0#0#15#0#0#0#0#0#0#0#143#0#255#0#0#0#0#0#15#0#0#0#0#0#0#0#143
+#0#0#143#128#128#15#255#255#255#255#255#0#0#0#0#0#0#0#143#248#0#255#255#255 +#128#128#15#255#255#255#255#255#0#0#0#0#0#0#0#143#248#0#255#255#255#255#255
+#255#255#255#0#0#0#0#0#0#0#143#255#255#255#255#255#255#255#255#0#0#0#0#0#0#0 +#255#0#0#0#0#0#0#0#143#255#255#255#255#255#255#255#255#0#0#0#0#0#0#0#136#136
+#136#136#136#136#136#136#136#136#136#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0 +#136#136#136#136#136#136#136#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0 +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0 +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0 +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
@ -31,37 +31,34 @@ LazarusResources.Add('TRxLoginForm','FORMDATA',[
+#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0 +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0 +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0 +#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0#0
+#0#0#0#0#0#31#255#0#0#31#255#0#0#31#255#0#0#31#255#0#0#31#255#0#0#31#255#0#0 +#0#31#255#0#0#31#255#0#0#31#255#0#0#31#255#0#0#31#255#0#0#31#255#0#0#31#255#0
+#31#255#0#0#31#255#0#0#31#255#0#0#31#255#0#0#31#255#0#0#31#255#255#255#255 +#0#31#255#0#0#31#255#0#0#31#255#0#0#31#255#0#0#31#255#255#255#255#255#255#255
+#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255 +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255 +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255 +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255
+#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255 +#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#255#11'Tran'
+#255#11'Transparent'#9#4'Left'#2#10#6'Height'#2' '#3'Top'#2#15#5'Width'#2' ' +'sparent'#9#0#0#6'TLabel'#9'HintLabel'#4'Left'#2'@'#6'Height'#2#13#3'Top'#2
+#0#0#6'TLabel'#9'HintLabel'#8'AutoSize'#8#22'BorderSpacing.OnChange'#13#5'Co' +#31#5'Width'#3#29#1#8'AutoSize'#8#5'Color'#7#6'clNone'#11'ParentColor'#8#13
+'lor'#7#6'clNone'#13'ShowAccelChar'#8#4'Left'#2'@'#6'Height'#2#13#3'Top'#2#31 +'ShowAccelChar'#8#0#0#6'TLabel'#13'UserNameLabel'#4'Left'#2'@'#6'Height'#2#13
+#5'Width'#3#29#1#0#0#6'TLabel'#13'UserNameLabel'#8'AutoSize'#8#22'BorderSpac' +#3'Top'#2'@'#5'Width'#2'i'#8'AutoSize'#8#5'Color'#7#6'clNone'#12'FocusContro'
+'ing.OnChange'#13#5'Color'#7#6'clNone'#12'FocusControl'#7#12'UserNameEdit'#4 +'l'#7#12'UserNameEdit'#11'ParentColor'#8#0#0#6'TLabel'#13'PasswordLabel'#4'L'
+'Left'#2'@'#6'Height'#2#13#3'Top'#2'@'#5'Width'#2'i'#0#0#6'TLabel'#13'Passwo' +'eft'#2'@'#6'Height'#2#13#3'Top'#2'`'#5'Width'#2'i'#8'AutoSize'#8#5'Color'#7
+'rdLabel'#8'AutoSize'#8#22'BorderSpacing.OnChange'#13#5'Color'#7#6'clNone'#12 +#6'clNone'#12'FocusControl'#7#12'PasswordEdit'#11'ParentColor'#8#0#0#6'TLabe'
+'FocusControl'#7#12'PasswordEdit'#4'Left'#2'@'#6'Height'#2#13#3'Top'#2'`'#5 +'l'#13'AppTitleLabel'#4'Left'#2'@'#6'Height'#2#13#3'Top'#2#12#5'Width'#3#29#1
+'Width'#2'i'#0#0#6'TLabel'#13'AppTitleLabel'#8'AutoSize'#8#22'BorderSpacing.' +#8'AutoSize'#8#5'Color'#7#6'clNone'#11'ParentColor'#8#13'ShowAccelChar'#8#0#0
+'OnChange'#13#5'Color'#7#6'clNone'#13'ShowAccelChar'#8#4'Left'#2'@'#6'Height' +#6'TLabel'#11'CustomLabel'#4'Left'#2'@'#6'Height'#2#13#3'Top'#3#128#0#5'Widt'
+#2#13#3'Top'#2#12#5'Width'#3#29#1#0#0#6'TLabel'#11'CustomLabel'#8'AutoSize'#8 +'h'#2'i'#8'AutoSize'#8#5'Color'#7#6'clNone'#12'FocusControl'#7#11'CustomComb'
+#22'BorderSpacing.OnChange'#13#5'Color'#7#6'clNone'#12'FocusControl'#7#11'Cu' +'o'#11'ParentColor'#8#0#0#5'TEdit'#12'UserNameEdit'#6'Cursor'#7#7'crIBeam'#4
+'stomCombo'#4'Left'#2'@'#6'Height'#2#13#3'Top'#3#128#0#5'Width'#2'i'#0#0#5'T' +'Left'#3#172#0#6'Height'#2#21#3'Top'#2'<'#5'Width'#3#169#0#8'TabOrder'#2#0#0
+'Edit'#12'UserNameEdit'#22'BorderSpacing.OnChange'#13#8'TabOrder'#2#0#6'Curs' +#0#5'TEdit'#12'PasswordEdit'#6'Cursor'#7#7'crIBeam'#4'Left'#3#172#0#6'Height'
+'or'#7#7'crIBeam'#4'Left'#3#172#0#6'Height'#2#21#3'Top'#2'<'#5'Width'#3#169#0 +#2#21#3'Top'#2'\'#5'Width'#3#169#0#12'PasswordChar'#6#1'*'#8'TabOrder'#2#1#0
+#0#0#5'TEdit'#12'PasswordEdit'#22'BorderSpacing.OnChange'#13#12'PasswordChar' +#0#7'TButton'#5'OkBtn'#4'Left'#3'd'#1#6'Height'#2#25#3'Top'#2#12#5'Width'#2
+#6#1'*'#8'TabOrder'#2#1#6'Cursor'#7#7'crIBeam'#4'Left'#3#172#0#6'Height'#2#21 +'M'#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#2'OK'#7'Default'#9#7'OnCl'
+#3'Top'#2'\'#5'Width'#3#169#0#0#0#7'TButton'#5'OkBtn'#22'BorderSpacing.OnCha' +'ick'#7#10'OkBtnClick'#8'TabOrder'#2#3#0#0#7'TButton'#9'CancelBtn'#4'Left'#3
+'nge'#13#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#2'OK'#7'Default'#9#7 +'d'#1#6'Height'#2#25#3'Top'#2','#5'Width'#2'M'#25'BorderSpacing.InnerBorder'
+'OnClick'#7#10'OkBtnClick'#8'TabOrder'#2#3#4'Left'#3'd'#1#6'Height'#2#25#3'T' +#2#2#6'Cancel'#9#7'Caption'#6#6'Cancel'#11'ModalResult'#2#2#8'TabOrder'#2#4#0
+'op'#2#12#5'Width'#2'M'#0#0#7'TButton'#9'CancelBtn'#22'BorderSpacing.OnChang' +#0#9'TComboBox'#11'CustomCombo'#4'Left'#3#172#0#6'Height'#2#21#3'Top'#2'|'#5
+'e'#13#25'BorderSpacing.InnerBorder'#2#2#6'Cancel'#9#7'Caption'#6#6'Cancel' +'Width'#3#169#0#16'AutoCompleteText'#11#22'cbactEndOfLineComplete'#20'cbactS'
+#11'ModalResult'#2#2#8'TabOrder'#2#4#4'Left'#3'd'#1#6'Height'#2#25#3'Top'#2 +'earchAscending'#0#10'ItemHeight'#2#13#9'MaxLength'#2#0#6'Sorted'#9#5'Style'
+','#5'Width'#2'M'#0#0#9'TComboBox'#11'CustomCombo'#22'BorderSpacing.OnChange' +#7#14'csDropDownList'#8'TabOrder'#2#2#0#0#0
+#13#10'ItemHeight'#2#13#9'MaxLength'#2#0#6'Sorted'#9#5'Style'#7#14'csDropDow'
+'nList'#8'TabOrder'#2#2#4'Left'#3#172#0#6'Height'#2#21#3'Top'#2'|'#5'Width'#3
+#169#0#0#0#0
]); ]);

View File

@ -7,7 +7,7 @@
{ } { }
{*******************************************************} {*******************************************************}
unit RxLogin; unit rxlogin;
{$I RX.INC} {$I RX.INC}
@ -454,22 +454,24 @@ end;
procedure TRxLoginDialog.OkButtonClick(Sender: TObject); procedure TRxLoginDialog.OkButtonClick(Sender: TObject);
var var
ChangeCursor: Boolean; SC: Boolean;
begin
with TRxLoginForm(Sender) do
begin begin
with TRxLoginForm(Sender) do begin
{$IFDEF WIN32} {$IFDEF WIN32}
ChangeCursor := GetCurrentThreadID = MainThreadID; SC := GetCurrentThreadID = MainThreadID;
{$ELSE} {$ELSE}
ChangeCursor := True; SC := True;
{$ENDIF} {$ENDIF}
try try
if ChangeCursor then Screen.Cursor := crHourGlass; if SC then Screen.Cursor := crHourGlass;
try try
if DoCheckUser(UserNameEdit.Text, PasswordEdit.Text) then if DoCheckUser(UserNameEdit.Text, PasswordEdit.Text) then
ModalResult := mrOk ModalResult := mrOk
else ModalResult := mrNone; else
ModalResult := mrNone;
finally finally
if ChangeCursor then Screen.Cursor := crDefault; if SC then Screen.Cursor := crDefault;
end; end;
except except
Application.HandleException(Self); Application.HandleException(Self);

View File

@ -8,7 +8,7 @@ uses
LCLType, LCLProc, LCLIntf, LCLType, LCLProc, LCLIntf,
Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs,
DB, EditBtn, DBGrids, StdCtrls, Buttons, LMessages, DbCtrls, GraphType, DB, EditBtn, DBGrids, StdCtrls, Buttons, LMessages, DbCtrls, GraphType,
dbutils, RxDbGrid; dbutils, RxDbGrid, rxpopupunit;
type type
TRxCustomDBLookupCombo = class; TRxCustomDBLookupCombo = class;
@ -116,16 +116,12 @@ type
FLookupDisplayIndex: Integer; FLookupDisplayIndex: Integer;
FListActive:boolean; FListActive:boolean;
// //
FDropDownCount: Integer;
FDropDownWidth: Integer;
FEmptyItemColor: TColor; FEmptyItemColor: TColor;
FEmptyValue: string; FEmptyValue: string;
FOnChange: TNotifyEvent; FOnChange: TNotifyEvent;
FPopUpFormOptions: TPopUpFormOptions;
// //
FPopupWindow:TPopupWindow; FRxPopUpForm:TPopUpForm;
FList:TDBGrid;
FPopupVisible:boolean;
FSaveAfterScroll:TDataSetNotifyEvent;
FFieldList:TStringList; FFieldList:TStringList;
FValuesList:TStringList; FValuesList:TStringList;
FValue:string; FValue:string;
@ -138,6 +134,8 @@ type
FDisplayAll: boolean; FDisplayAll: boolean;
function GetDataSource: TDataSource; function GetDataSource: TDataSource;
function GetDisplayAll: Boolean; function GetDisplayAll: Boolean;
function GetDropDownCount: Integer;
function GetDropDownWidth: Integer;
function GetLookupSource: TDataSource; function GetLookupSource: TDataSource;
function GetMinHeight: Integer; function GetMinHeight: Integer;
function GetBorderSize: Integer; function GetBorderSize: Integer;
@ -146,12 +144,14 @@ type
function GetFlat: Boolean; function GetFlat: Boolean;
function GetGlyph: TBitmap; function GetGlyph: TBitmap;
function GetNumGlyphs: Integer; function GetNumGlyphs: Integer;
function GetPopupVisible: boolean;
procedure SetButtonNeedsFocus(const AValue: Boolean); procedure SetButtonNeedsFocus(const AValue: Boolean);
procedure SetButtonWidth(const AValue: Integer); procedure SetButtonWidth(const AValue: Integer);
procedure SetDataFieldName(const AValue: string); procedure SetDataFieldName(const AValue: string);
procedure SetDataSource(const AValue: TDataSource); procedure SetDataSource(const AValue: TDataSource);
procedure SetDisplayAll(const AValue: Boolean); procedure SetDisplayAll(const AValue: Boolean);
procedure SetDropDownCount(const AValue: Integer); procedure SetDropDownCount(const AValue: Integer);
procedure SetDropDownWidth(const AValue: Integer);
procedure SetEmptyItemColor(const AValue: TColor); procedure SetEmptyItemColor(const AValue: TColor);
procedure SetEmptyValue(const AValue: string); procedure SetEmptyValue(const AValue: string);
procedure SetFlat(const AValue: Boolean); procedure SetFlat(const AValue: Boolean);
@ -161,6 +161,7 @@ type
procedure SetLookupField(const AValue: string); procedure SetLookupField(const AValue: string);
procedure SetLookupSource(const AValue: TDataSource); procedure SetLookupSource(const AValue: TDataSource);
procedure SetNumGlyphs(const AValue: Integer); procedure SetNumGlyphs(const AValue: Integer);
procedure SetPopUpFormOptions(const AValue: TPopUpFormOptions);
procedure SetReadOnly(const AValue: boolean); procedure SetReadOnly(const AValue: boolean);
function StoreEmpty: boolean; function StoreEmpty: boolean;
procedure WMSetFocus(var Message: TLMSetFocus); message LM_SETFOCUS; procedure WMSetFocus(var Message: TLMSetFocus); message LM_SETFOCUS;
@ -173,24 +174,18 @@ type
procedure DataLinkRecordChanged(Field: TField); procedure DataLinkRecordChanged(Field: TField);
procedure UpdateFieldValues; procedure UpdateFieldValues;
procedure ShowList; procedure ShowList;
procedure HideList;
procedure ShowPopUp;
procedure DoPopupWindowMouseDown(Sender: TOBject; aButton: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure DoMouseUp(Sender: TOBject; AButton: TMouseButton; Shift: TShiftState; X, Y: Integer);
procedure DoPopupWindowDeactivate(Sender: TObject);
procedure DoPopupWindowKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure DoPopupWindowShow(Sender: TObject);
procedure SetValueKey(const Value: string); procedure SetValueKey(const Value: string);
procedure UpdateKeyValue; procedure UpdateKeyValue;
procedure KeyValueChanged; procedure KeyValueChanged;
procedure UpdateData; procedure UpdateData;
procedure OnClosePopup(AResult:boolean);
protected protected
procedure KeyDown(var Key: Word; Shift: TShiftState); override; procedure KeyDown(var Key: Word; Shift: TShiftState); override;
procedure KeyPress(var Key: char); dynamic;
procedure SetParent(AParent: TWinControl); override; procedure SetParent(AParent: TWinControl); override;
procedure DoSetBounds(ALeft, ATop, AWidth, AHeight: Integer); override; procedure DoSetBounds(ALeft, ATop, AWidth, AHeight: Integer); override;
procedure DoPositionButton; virtual; procedure DoPositionButton; virtual;
procedure DoChange; virtual;
procedure DoButtonClick(Sender: TObject); virtual; procedure DoButtonClick(Sender: TObject); virtual;
Procedure Loaded; override; Procedure Loaded; override;
procedure Notification(AComponent: TComponent; Operation: TOperation); override; procedure Notification(AComponent: TComponent; Operation: TOperation); override;
@ -216,10 +211,11 @@ type
property EmptyValue: string read FEmptyValue write SetEmptyValue stored StoreEmpty; property EmptyValue: string read FEmptyValue write SetEmptyValue stored StoreEmpty;
property EmptyItemColor: TColor read FEmptyItemColor write SetEmptyItemColor default clWindow; property EmptyItemColor: TColor read FEmptyItemColor write SetEmptyItemColor default clWindow;
//data //data
property PopUpFormOptions:TPopUpFormOptions read FPopUpFormOptions write SetPopUpFormOptions;
property DataField: string read FDataFieldName write SetDataFieldName; property DataField: string read FDataFieldName write SetDataFieldName;
property DataSource: TDataSource read GetDataSource write SetDataSource; property DataSource: TDataSource read GetDataSource write SetDataSource;
property DropDownCount: Integer read FDropDownCount write SetDropDownCount default 8; property DropDownCount: Integer read GetDropDownCount write SetDropDownCount default 8;
property DropDownWidth: Integer read FDropDownWidth write FDropDownWidth default 0; property DropDownWidth: Integer read GetDropDownWidth write SetDropDownWidth default 0;
property LookupDisplay: string read FLookupDisplay write SetLookupDisplay; property LookupDisplay: string read FLookupDisplay write SetLookupDisplay;
property LookupDisplayIndex: Integer read FLookupDisplayIndex write SetLookupDisplayIndex default 0; property LookupDisplayIndex: Integer read FLookupDisplayIndex write SetLookupDisplayIndex default 0;
property LookupField: string read FLookupField write SetLookupField; property LookupField: string read FLookupField write SetLookupField;
@ -227,7 +223,7 @@ type
public public
constructor Create(AOwner: TComponent); override; constructor Create(AOwner: TComponent); override;
destructor Destroy; override; destructor Destroy; override;
property PopupVisible:boolean read FPopupVisible; property PopupVisible:boolean read GetPopupVisible;
end; end;
{ TRxDBLookupCombo } { TRxDBLookupCombo }
@ -247,6 +243,7 @@ type
property DragCursor; property DragCursor;
property DragMode; property DragMode;
property Enabled; property Enabled;
property PopUpFormOptions;
Property Flat; Property Flat;
property Font; property Font;
property Glyph; property Glyph;
@ -544,6 +541,16 @@ begin
Result := FDisplayAll; Result := FDisplayAll;
end; end;
function TRxCustomDBLookupCombo.GetDropDownCount: Integer;
begin
Result:=FPopUpFormOptions.DropDownCount
end;
function TRxCustomDBLookupCombo.GetDropDownWidth: Integer;
begin
Result:=FPopUpFormOptions.DropDownWidth;
end;
function TRxCustomDBLookupCombo.GetDataSource: TDataSource; function TRxCustomDBLookupCombo.GetDataSource: TDataSource;
begin begin
Result := FDataLink.DataSource; Result := FDataLink.DataSource;
@ -597,6 +604,11 @@ begin
else Result:=0; else Result:=0;
end; end;
function TRxCustomDBLookupCombo.GetPopupVisible: boolean;
begin
Result:=Assigned(FRxPopUpForm);
end;
procedure TRxCustomDBLookupCombo.SetButtonNeedsFocus(const AValue: Boolean); procedure TRxCustomDBLookupCombo.SetButtonNeedsFocus(const AValue: Boolean);
begin begin
if FButtonNeedsFocus<>AValue then if FButtonNeedsFocus<>AValue then
@ -638,7 +650,12 @@ end;
procedure TRxCustomDBLookupCombo.SetDropDownCount(const AValue: Integer); procedure TRxCustomDBLookupCombo.SetDropDownCount(const AValue: Integer);
begin begin
FDropDownCount:=AValue; FPopUpFormOptions.DropDownCount:=AValue;
end;
procedure TRxCustomDBLookupCombo.SetDropDownWidth(const AValue: Integer);
begin
FPopUpFormOptions.DropDownWidth:=AValue;
end; end;
procedure TRxCustomDBLookupCombo.SetEmptyItemColor(const AValue: TColor); procedure TRxCustomDBLookupCombo.SetEmptyItemColor(const AValue: TColor);
@ -718,6 +735,12 @@ begin
FButton.NumGlyphs:=AValue; FButton.NumGlyphs:=AValue;
end; end;
procedure TRxCustomDBLookupCombo.SetPopUpFormOptions(
const AValue: TPopUpFormOptions);
begin
FPopUpFormOptions.Assign(AValue);
end;
procedure TRxCustomDBLookupCombo.SetReadOnly(const AValue: boolean); procedure TRxCustomDBLookupCombo.SetReadOnly(const AValue: boolean);
begin begin
if FReadOnly=AValue then exit; if FReadOnly=AValue then exit;
@ -771,11 +794,18 @@ begin
begin begin
F:=LookupSource.DataSet.FieldByName(FFieldList[i]); F:=LookupSource.DataSet.FieldByName(FFieldList[i]);
S := FValuesList[i];// F.DisplayText; S := FValuesList[i];// F.DisplayText;
if FPopUpFormOptions.Columns.Count>i then
W := FPopUpFormOptions.Columns[i].Width
else
begin
W := F.DisplayWidth; W := F.DisplayWidth;
if I < LastIndex then if I < LastIndex then
W := W * TxtWidth + 4 W := W * TxtWidth + 4
else else
W := ARight - R.Left; W := ARight - R.Left;
end;
X := 2; X := 2;
R.Right := R.Left + W; R.Right := R.Left + W;
case F.AlignMent of case F.AlignMent of
@ -808,7 +838,7 @@ begin
if FLookupDataLink.Active and (FLookupDisplay <> '') then if FLookupDataLink.Active and (FLookupDisplay <> '') then
begin begin
FDisplayField := FLookupDataLink.DataSet.FieldByName(FFieldList[FLookupDisplayIndex]); FDisplayField := FLookupDataLink.DataSet.FieldByName(FFieldList[FLookupDisplayIndex]);
if FPopupVisible then if PopupVisible then
begin begin
// UpdateData; // UpdateData;
UpdateFieldValues; UpdateFieldValues;
@ -872,84 +902,10 @@ var
GC:TColumn; GC:TColumn;
F, F1:TField; F, F1:TField;
begin begin
if Assigned(FLookupDataLink.DataSet) and if Assigned(FLookupDataLink.DataSet) and (FLookupDataLink.DataSet.Active) then
FLookupDataLink.DataSet.Active then if not PopupVisible then
if not FPopupVisible then
begin begin
if not Assigned(FList) then
FList:=TDBGrid.Create(Owner);
{ if not Assigned(FList) then
FList:=TDBGrid.Create(FPopupWindow);}
FList.Columns.BeginUpdate;
if FList.Columns.Count>0 then
FList.Columns.Clear;
C:=FList.Columns.Count - 1;
W:=16;
for I:=0 to FFieldList.Count-1 do
begin;
GC:=TDbGridColumns(FList.Columns).Add;
F:=FLookupDataLink.DataSet.FieldByName(FFieldList[i]);
GC.Field:=F;
F1:=GC.Field;
if (W+F.DisplayWidth * {FList.}Canvas.TextWidth('W')) > FList.Width then
GC.Width:=FList.Width - W
else
GC.Width:=F.DisplayWidth * {FList.}Canvas.TextWidth('W');
W:=W+GC.Width + 4;
end;
FList.Columns.EndUpdate;
FPopupVisible:=true;
ShowPopUp;
end;
end;
procedure TRxCustomDBLookupCombo.HideList;
begin
if Assigned(FPopupWindow) then
begin
FPopupVisible:=false;
// FreeAndNil(FList);
FList.Parent:=nil;
FPopupWindow.Close;
FList.DataSource:=nil;
FPopupWindow:=nil;
FList.OnMouseUp:=nil;
FList.Columns.Clear;
end;
end;
procedure TRxCustomDBLookupCombo.ShowPopUp;
var
R:TPoint;
begin
{ if not Assigned(FList) then
FList:=TDBGrid.Create(Owner);
if not Assigned(FList) then
FList:=TDBGrid.Create(FPopupWindow);}
FPopupWindow:=TPopupWindow.Create(Application);
FList.Parent:=FPopupWindow;
FList.Align:=alClient;
FList.OnMouseUp:=@DoMouseUp;
FList.DataSource:=FLookupDataLink.DataSource;
FList.ReadOnly:=true;
FList.Options:=FList.Options -
[dgTabs, dgEditing, dgTitles, dgIndicator, dgColumnResize, dgRowLines] + [dgRowSelect];
R.X:=Left;
R.Y:=Top+Height;
R:=Parent.ClientToScreen(R);
FPopupWindow.Top:=R.Y;
FPopupWindow.Left:=R.X;
FPopupWindow.Width:=Width+Button.Width;
FPopupWindow.OnDeactivate:=@DoPopupWindowDeactivate;
FPopupWindow.OnKeyDown:=@DoPopupWindowKeyDown;
FPopupWindow.OnShow:=@DoPopupWindowShow;
if FDropDownCount>0 then
FPopupWindow.Height:=FList.DefaultRowHeight*Max(FDropDownCount + 1, 2)
else
FPopupWindow.Height:=FList.DefaultRowHeight*8;
if FDataField <> nil then FValue := FDataField.AsString if FDataField <> nil then FValue := FDataField.AsString
else FValue := FEmptyValue; else FValue := FEmptyValue;
if Assigned(FDataField) and not FDataField.IsNull then if Assigned(FDataField) and not FDataField.IsNull then
@ -958,61 +914,11 @@ begin
if FLookupDataLink.Active then if FLookupDataLink.Active then
FLookupDataLink.DataSet.First; FLookupDataLink.DataSet.First;
// Mouse.Capture:=FPopupWindow.Handle; FRxPopUpForm:=ShowRxDBPopUpForm(Self, FLookupDataLink.DataSet, @OnClosePopup,
FPopupWindow.ShowModal; FPopUpFormOptions, FLookupDisplay, LookupDisplayIndex, ButtonWidth);
HideList;
SetFocus;
end;
procedure TRxCustomDBLookupCombo.DoPopupWindowMouseDown(Sender: TOBject;
aButton: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
if (X<0) or (Y<0) or (X>FPopupWindow.Width) or (Y<FPopupWindow.Height) then
FPopupWindow.ModalResult:=mrCancel;
end;
procedure TRxCustomDBLookupCombo.DoMouseUp(Sender: TOBject;
AButton: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
if (X>0) and (Y>0) and (X<FList.ClientWidth) and (Y<FList.ClientHeight) then
begin
FDataLink.Edit;
UpdateData;
// HideList;
FPopupWindow.ModalResult:=mrOk;
end end
end; end;
procedure TRxCustomDBLookupCombo.DoPopupWindowDeactivate(Sender: TObject);
begin
if FPopupWindow.ModalResult = mrNone then
FPopupWindow.ModalResult:=mrCancel;
Mouse.Capture:=0;
// HideList;
end;
procedure TRxCustomDBLookupCombo.DoPopupWindowKeyDown(Sender: TObject;
var Key: Word; Shift: TShiftState);
begin
case Key of
vk_Return:begin
FDataLink.Edit;
UpdateData;
HideList;
SetFocus;
end;
VK_ESCAPE:HideList;
else
FList.KeyDown(Key, Shift);
exit;
end;
Key:=0;
end;
procedure TRxCustomDBLookupCombo.DoPopupWindowShow(Sender: TObject);
begin
Mouse.Capture:=FPopupWindow.Handle;
end;
procedure TRxCustomDBLookupCombo.SetValueKey(const Value: string); procedure TRxCustomDBLookupCombo.SetValueKey(const Value: string);
begin begin
@ -1037,6 +943,7 @@ procedure TRxCustomDBLookupCombo.KeyValueChanged;
begin begin
UpdateFieldValues; UpdateFieldValues;
Invalidate; Invalidate;
DoChange;
end; end;
procedure TRxCustomDBLookupCombo.UpdateData; procedure TRxCustomDBLookupCombo.UpdateData;
@ -1048,15 +955,34 @@ begin
end; end;
end; end;
procedure TRxCustomDBLookupCombo.OnClosePopup(AResult: boolean);
begin
if Assigned(FRxPopUpForm) and AResult and (pfgColumnResize in FPopUpFormOptions.Options) then
FillPopupWidth(FPopUpFormOptions, FRxPopUpForm);
FRxPopUpForm:=nil;
if AResult then
begin
FDataLink.Edit;
UpdateData;
end;
SetFocus;
if (Owner is TWinControl) then
TWinControl(Owner).Repaint
else
Parent.Repaint;
end;
procedure TRxCustomDBLookupCombo.KeyDown(var Key: Word; Shift: TShiftState); procedure TRxCustomDBLookupCombo.KeyDown(var Key: Word; Shift: TShiftState);
begin begin
if (Key in [VK_PRIOR, VK_NEXT, VK_UP, VK_DOWN, VK_RETURN, VK_HOME, VK_END]) and PopupVisible then if (Key in [VK_PRIOR, VK_NEXT, VK_UP, VK_DOWN, VK_RETURN, VK_HOME, VK_END]) and PopupVisible then
begin begin
if Key=VK_RETURN then FRxPopUpForm.KeyDown(Key, Shift);
{ if Key=VK_RETURN then
HideList HideList
else else
Flist.KeyDown(Key, Shift); Flist.KeyDown(Key, Shift);
Key := 0; Key := 0;}
end end
else else
if not PopupVisible then if not PopupVisible then
@ -1065,6 +991,13 @@ begin
begin begin
ShowList; ShowList;
Key := 0; Key := 0;
end
else
if (Key = VK_ESCAPE) and (not FDataField.IsNull) then
begin
FDataField.Clear;
UpdateKeyValue;
Key:=0;
end; end;
end; end;
inherited KeyDown(Key, Shift); inherited KeyDown(Key, Shift);
@ -1081,17 +1014,18 @@ begin
VK_DOWN: if not FLookupDataLink.DataSet.EOF then VK_DOWN: if not FLookupDataLink.DataSet.EOF then
FLookupDataLink.DataSet.Next; FLookupDataLink.DataSet.Next;
end; end;
KeyValueChanged;
FDataLink.UpdateRecord; FDataLink.UpdateRecord;
KeyValueChanged;
Key:=0; Key:=0;
end end
else end;
if Key = VK_ESCAPE then end;
procedure TRxCustomDBLookupCombo.KeyPress(var Key: char);
begin begin
FDataField.Clear; inherited KeyPress(Key);
UpdateKeyValue; if PopupVisible then
end; FRxPopUpForm.KeyPress(Key);
end;
end; end;
procedure TRxCustomDBLookupCombo.SetParent(AParent: TWinControl); procedure TRxCustomDBLookupCombo.SetParent(AParent: TWinControl);
@ -1126,6 +1060,12 @@ begin
FButton.SetBounds(Left+Width, Top, FButton.Width, Height); FButton.SetBounds(Left+Width, Top, FButton.Width, Height);
end; end;
procedure TRxCustomDBLookupCombo.DoChange;
begin
if Assigned(FOnChange) then
FOnChange(Self);
end;
procedure TRxCustomDBLookupCombo.DoButtonClick(Sender: TObject); procedure TRxCustomDBLookupCombo.DoButtonClick(Sender: TObject);
begin begin
if not FReadOnly then if not FReadOnly then
@ -1175,7 +1115,7 @@ var
begin begin
Canvas.Font := Font; Canvas.Font := Font;
Canvas.Brush.Color := Color; Canvas.Brush.Color := Color;
Selected := Focused and (not (csPaintCopy in ControlState)) and (not FPopupVisible); Selected := Focused and (not (csPaintCopy in ControlState)) and (not PopupVisible);
if Selected then if Selected then
begin begin
Canvas.Font.Color := clHighlightText; Canvas.Font.Color := clHighlightText;
@ -1288,6 +1228,7 @@ begin
FFieldList := TStringList.Create; FFieldList := TStringList.Create;
FValuesList:= TStringList.Create; FValuesList:= TStringList.Create;
FLocateObject:=CreateLocate(nil); FLocateObject:=CreateLocate(nil);
FPopUpFormOptions:=TPopUpFormOptions.Create;
//Lookup //Lookup
FLookupDataLink:=TLookupSourceLink.Create; FLookupDataLink:=TLookupSourceLink.Create;
@ -1315,6 +1256,7 @@ begin
Glyph:=CreateArrowBitmap; Glyph:=CreateArrowBitmap;
ButtonWidth:=15; ButtonWidth:=15;
Ctl3D:=true; Ctl3D:=true;
TabStop:=true;
end; end;
destructor TRxCustomDBLookupCombo.Destroy; destructor TRxCustomDBLookupCombo.Destroy;
@ -1326,6 +1268,7 @@ begin
FFieldList.Clear; FFieldList.Clear;
FreeAndNil(FFieldList); FreeAndNil(FFieldList);
FreeAndNil(FValuesList); FreeAndNil(FValuesList);
FreeAndNil(FPopUpFormOptions);
inherited Destroy; inherited Destroy;
end; end;

View File

@ -118,10 +118,12 @@ type
procedure SortOnFields(const FieldNames: string; procedure SortOnFields(const FieldNames: string;
CaseInsensitive: Boolean = True; Descending: Boolean = False); CaseInsensitive: Boolean = True; Descending: Boolean = False);
procedure EmptyTable; procedure EmptyTable;
procedure CloseOpen;
procedure CopyStructure(Source: TDataSet); procedure CopyStructure(Source: TDataSet);
function LoadFromDataSet(Source: TDataSet; ARecordCount: Integer; function LoadFromDataSet(Source: TDataSet; ARecordCount: Integer;
Mode: TLoadMode): Integer; Mode: TLoadMode): Integer;
function SaveToDataSet(Dest: TDataSet; ARecordCount: Integer): Integer; function SaveToDataSet(Dest: TDataSet; ARecordCount: Integer): Integer;
procedure AppendRecord(const Values: array of const);
published published
property Capacity: Integer read GetCapacity write SetCapacity default 0; property Capacity: Integer read GetCapacity write SetCapacity default 0;
property Active; property Active;
@ -190,8 +192,8 @@ type
protected protected
procedure SetIndex(Value: Integer); virtual; procedure SetIndex(Value: Integer); virtual;
public public
constructor Create(aMemoryData: TRxMemoryData); virtual; constructor Create(MemoryData: TRxMemoryData); virtual;
constructor CreateEx(aMemoryData: TRxMemoryData; UpdateParent: Boolean); virtual; constructor CreateEx(MemoryData: TRxMemoryData; UpdateParent: Boolean); virtual;
destructor Destroy; override; destructor Destroy; override;
property MemoryData: TRxMemoryData read FMemoryData; property MemoryData: TRxMemoryData read FMemoryData;
property ID: Integer read FID write FID; property ID: Integer read FID write FID;
@ -342,16 +344,16 @@ type
{ TMemoryRecord } { TMemoryRecord }
constructor TMemoryRecord.Create(aMemoryData: TRxMemoryData); constructor TMemoryRecord.Create(MemoryData: TRxMemoryData);
begin begin
CreateEx(aMemoryData, True); CreateEx(MemoryData, True);
end; end;
constructor TMemoryRecord.CreateEx(aMemoryData: TRxMemoryData; constructor TMemoryRecord.CreateEx(MemoryData: TRxMemoryData;
UpdateParent: Boolean); UpdateParent: Boolean);
begin begin
inherited Create; inherited Create;
SetMemoryData(aMemoryData, UpdateParent); SetMemoryData(MemoryData, UpdateParent);
end; end;
destructor TMemoryRecord.Destroy; destructor TMemoryRecord.Destroy;
@ -510,7 +512,7 @@ begin
for I := 0 to FieldCount - 1 do for I := 0 to FieldCount - 1 do
begin begin
FD:=FieldDefs.AddFieldDef; FD:=FieldDefs.AddFieldDef;
FD.DisplayName:=Fields[I].DisplayName; // FD.DisplayName:=Fields[I].DisplayName;
FD.Name:=Fields[I].FieldName; FD.Name:=Fields[I].FieldName;
FD.Size:=Fields[I].Size; FD.Size:=Fields[I].Size;
FD.DataType:=Fields[I].DataType; FD.DataType:=Fields[I].DataType;
@ -1094,7 +1096,7 @@ begin
BindFields(True); BindFields(True);
InitBufferPointers(True); InitBufferPointers(True);
InternalFirst; InternalFirst;
OpenCursor(false); // OpenCursor(false);
// ������ ����� ����������� ���� � �������� ������ ���������� � ������ FieldDefs // ������ ����� ����������� ���� � �������� ������ ���������� � ������ FieldDefs
{ Fields.Clear; { Fields.Clear;
CreateFields; CreateFields;
@ -1181,6 +1183,12 @@ begin
end; end;
end; end;
procedure TRxMemoryData.CloseOpen;
begin
Close;
Open;
end;
procedure TRxMemoryData.CopyStructure(Source: TDataSet); procedure TRxMemoryData.CopyStructure(Source: TDataSet);
procedure CheckDataTypes(FieldDefs: TFieldDefs); procedure CheckDataTypes(FieldDefs: TFieldDefs);
@ -1307,6 +1315,16 @@ begin
end; end;
end; end;
procedure TRxMemoryData.AppendRecord(const Values: array of const);
var
I: Integer;
begin
if State <> dsInsert then
Append;
for I := 0 to High(Values) do Fields[I].AssignValue(Values[I]);
Post;
end;
{ Index Related } { Index Related }
procedure TRxMemoryData.SortOnFields(const FieldNames: string; procedure TRxMemoryData.SortOnFields(const FieldNames: string;
@ -1327,14 +1345,16 @@ procedure TRxMemoryData.Sort;
var var
Pos: TBookmarkStr; Pos: TBookmarkStr;
begin begin
if Active and (FRecords <> nil) and (FRecords.Count > 0) then begin if Active and (FRecords <> nil) and (FRecords.Count > 0) then
begin
Pos := Bookmark; Pos := Bookmark;
try try
QuickSort(0, FRecords.Count - 1, @CompareRecords); QuickSort(0, FRecords.Count - 1, @CompareRecords);
SetBufListSize(0); SetBufListSize(0);
InitBufferPointers(False); InitBufferPointers(False);
try try
SetBufListSize(BufferCount + 1); RecalcBufListSize;
// SetBufListSize(BufferCount + 1);
except except
SetState(dsInactive); SetState(dsInactive);
CloseCursor; CloseCursor;

View File

@ -8,7 +8,7 @@
<Version Value="5"/> <Version Value="5"/>
<PathDelim Value="\"/> <PathDelim Value="\"/>
<SearchPaths> <SearchPaths>
<UnitOutputDirectory Value="lib\"/> <UnitOutputDirectory Value="lib"/>
</SearchPaths> </SearchPaths>
<CodeGeneration> <CodeGeneration>
<Generate Value="Faster"/> <Generate Value="Faster"/>
@ -19,12 +19,12 @@
</CompilerOptions> </CompilerOptions>
<Description Value="Delphi VCL Extensions (RX) <Description Value="Delphi VCL Extensions (RX)
Copyright (c) 1998 Master-Bank Copyright (c) 1998 Master-Bank
translate to Lazarus by alexs in 2005 translate to Lazarus by alexs in 2005 - 2007
"/> "/>
<License Value="free ware <License Value="free ware
"/> "/>
<Version Major="1" Release="12" Build="38"/> <Version Major="1" Minor="1" Release="3" Build="86"/>
<Files Count="32"> <Files Count="37">
<Item1> <Item1>
<Filename Value="rxlookup.pas"/> <Filename Value="rxlookup.pas"/>
<UnitName Value="rxlookup"/> <UnitName Value="rxlookup"/>
@ -132,7 +132,7 @@ translate to Lazarus by alexs in 2005
</Item26> </Item26>
<Item27> <Item27>
<Filename Value="pagemngr.pas"/> <Filename Value="pagemngr.pas"/>
<UnitName Value="PageMngr"/> <UnitName Value="pagemngr"/>
</Item27> </Item27>
<Item28> <Item28>
<Filename Value="rxappicon.pas"/> <Filename Value="rxappicon.pas"/>
@ -152,8 +152,28 @@ translate to Lazarus by alexs in 2005
</Item31> </Item31>
<Item32> <Item32>
<Filename Value="rxlogin.pas"/> <Filename Value="rxlogin.pas"/>
<UnitName Value="RxLogin"/> <UnitName Value="rxlogin"/>
</Item32> </Item32>
<Item33>
<Filename Value="rxdbgrid_findunit.pas"/>
<UnitName Value="rxdbgrid_findunit"/>
</Item33>
<Item34>
<Filename Value="rxdbgrid_columsunit.pas"/>
<UnitName Value="rxdbgrid_columsunit"/>
</Item34>
<Item35>
<Filename Value="rxpopupunit.pas"/>
<UnitName Value="rxpopupunit"/>
</Item35>
<Item36>
<Filename Value="rxcustomchartpanel.pas"/>
<UnitName Value="rxcustomchartpanel"/>
</Item36>
<Item37>
<Filename Value="rxsortmemds.pas"/>
<UnitName Value="rxsortmemds"/>
</Item37>
</Files> </Files>
<Type Value="RunAndDesignTime"/> <Type Value="RunAndDesignTime"/>
<RequiredPkgs Count="4"> <RequiredPkgs Count="4">

View File

@ -1,5 +1,5 @@
{ This file was automatically created by Lazarus. Do not edit! { ���� ���� ��� ������������� ������ Lazarus. �� �������������!
This source is only used to compile and install the package. �������� ��� ������������ ������ ��� ���������� � ��������� ������.
} }
unit rxnew; unit rxnew;
@ -10,8 +10,9 @@ uses
rxlookup, vclutils, dateutil, dbutils, rxapputils, rxdconst, rxstrutils, rxlookup, vclutils, dateutil, dbutils, rxapputils, rxdconst, rxstrutils,
dbdateedit, registerrx, curredit, folderlister, rxdbgrid, rxmemds, dbdateedit, registerrx, curredit, folderlister, rxdbgrid, rxmemds,
duallist, boxprocs, tooledit, rxswitch, rxdice, rxdbcomb, rxtoolbar, duallist, boxprocs, tooledit, rxswitch, rxdice, rxdbcomb, rxtoolbar,
rxtbrsetup, fduallst, rxxpman, PageMngr, rxappicon, seldsfrm, rxctrls, rxtbrsetup, fduallst, rxxpman, pagemngr, rxappicon, seldsfrm, rxctrls,
RxLogin, LazarusPackageIntf; rxlogin, rxdbgrid_findunit, rxdbgrid_columsunit, rxpopupunit,
rxcustomchartpanel, rxsortmemds, LazarusPackageIntf;
implementation implementation

View File

@ -0,0 +1,778 @@
unit rxpopupunit;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, DB, Forms, DBGrids, rxdbgrid, LCLType, Controls, ComCtrls,
Buttons, Grids, Graphics, vclutils;
type
TPopUpCloseEvent = procedure(AResult:boolean) of object;
{ TPopUpGrid }
TPopUpGrid = class(TRxDBGrid)
private
FFindLine:string;
FLookupDisplayIndex: integer;
FLookupDisplayField:string;
procedure ClearFind;
procedure FindNextChar(AChar:Char);
procedure FindPriorChar;
procedure SetLookupDisplayIndex(const AValue: integer);
protected
procedure KeyPress(var Key: char); dynamic;
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
property LookupDisplayIndex:integer read FLookupDisplayIndex write SetLookupDisplayIndex;
end;
TPopUpGridOption = (pfgIndicator, pfgColLines, pfgRowLines, pfgColumnResize,
pfgColumnMove);
TPopUpGridOptions = set of TPopUpGridOption;
{ TPopUpColumnTitle }
TPopUpColumnTitle = class(TPersistent)
private
FAlignment: TAlignment;
FCaption: string;
FColor: TColor;
FLayout: TTextLayout;
FOrientation: TTextOrientation;
procedure SetAlignment(const AValue: TAlignment);
procedure SetCaption(const AValue: string);
procedure SetColor(const AValue: TColor);
procedure SetLayout(const AValue: TTextLayout);
procedure SetOrientation(const AValue: TTextOrientation);
public
constructor Create;
procedure Assign(Source: TPersistent); override;
published
property Orientation:TTextOrientation read FOrientation write SetOrientation;
property Alignment: TAlignment read FAlignment write SetAlignment;
property Layout: TTextLayout read FLayout write SetLayout;
property Caption: string read FCaption write SetCaption;
property Color: TColor read FColor write SetColor;
end;
TPopUpColumn = class(TCollectionItem)
private
FAlignment: TAlignment;
FColor: TColor;
FDisplayFormat: string;
FFieldName: string;
FFont: TFont;
FImageList: TImageList;
FTitle: TPopUpColumnTitle;
FValueChecked: string;
FValueUnchecked: string;
FWidth: Integer;
procedure SetAlignment(const AValue: TAlignment);
procedure SetColor(const AValue: TColor);
procedure SetDisplayFormat(const AValue: string);
procedure SetFieldName(const AValue: string);
procedure SetFont(const AValue: TFont);
procedure SetImageList(const AValue: TImageList);
procedure SetTitle(const AValue: TPopUpColumnTitle);
procedure SetValueChecked(const AValue: string);
procedure SetValueUnchecked(const AValue: string);
procedure SetWidth(const AValue: Integer);
protected
function GetDisplayName: string; override;
public
constructor Create(ACollection: TCollection); override;
destructor Destroy; override;
published
property Alignment: TAlignment read FAlignment write SetAlignment;
property Color: TColor read FColor write SetColor;
property DisplayFormat: string read FDisplayFormat write SetDisplayFormat;
property Font: TFont read FFont write SetFont;
property FieldName:string read FFieldName write SetFieldName;
property ImageList:TImageList read FImageList write SetImageList;
property ValueChecked: string read FValueChecked write SetValueChecked;
property ValueUnchecked: string read FValueUnchecked write SetValueUnchecked;
property Title:TPopUpColumnTitle read FTitle write SetTitle;
property Width: Integer read FWidth write SetWidth;
end;
{ TPopUpFormColumns }
TPopUpFormColumns = class(TCollection)
private
function GetPopUpColumn(Index: Integer): TPopUpColumn;
procedure SetPopUpColumn(Index: Integer; const AValue: TPopUpColumn);
public
property Items[Index: Integer]: TPopUpColumn read GetPopUpColumn write SetPopUpColumn; default;
end;
{ TPopUpFormOptions }
TPopUpFormOptions = class(TPersistent)
private
FAutoSort: boolean;
FBorderStyle: TBorderStyle;
FColumns: TPopUpFormColumns;
FDropDownCount: integer;
FDropDownWidth: integer;
FOptions: TPopUpGridOptions;
FShowTitles: boolean;
FTitleButtons: boolean;
FTitleStyle: TTitleStyle;
function GetColumns: TPopUpFormColumns;
procedure SetAutoSort(const AValue: boolean);
procedure SetColumns(const AValue: TPopUpFormColumns);
procedure SetDropDownCount(const AValue: integer);
procedure SetDropDownWidth(const AValue: integer);
procedure SetOptions(const AValue: TPopUpGridOptions);
procedure SetShowTitles(const AValue: boolean);
procedure SetTitleButtons(const AValue: boolean);
procedure SetTitleStyle(const AValue: TTitleStyle);
public
constructor Create;
destructor Destroy; override;
procedure Assign(Source: TPersistent); override;
published
property AutoSort:boolean read FAutoSort write SetAutoSort default false;
property BorderStyle: TBorderStyle read FBorderStyle write FBorderStyle default bsNone;
property Columns:TPopUpFormColumns read GetColumns write SetColumns;
property DropDownCount:integer read FDropDownCount write SetDropDownCount default 8;
property DropDownWidth:integer read FDropDownWidth write SetDropDownWidth default 0;
property Options:TPopUpGridOptions read FOptions write SetOptions default [pfgColLines, pfgRowLines];
property ShowTitles:boolean read FShowTitles write SetShowTitles default false;
property TitleButtons:boolean read FTitleButtons write SetTitleButtons default false;
property TitleStyle:TTitleStyle read FTitleStyle write SetTitleStyle default tsLazarus;
end;
{ TPopUpForm }
TPopUpForm = class(TForm)
private
CloseBtn: TBitBtn;
FFindResult:boolean;
FGrid:TPopUpGrid;
FDataSource:TDataSource;
FOnPopUpCloseEvent:TPopUpCloseEvent;
FPopUpFormOptions:TPopUpFormOptions;
function GetDataSet: TDataSet;
function GetLookupDisplayIndex: integer;
procedure SetDataSet(const AValue: TDataSet);
procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
procedure SetLookupDisplayIndex(const AValue: integer);
protected
FFieldList:string;
procedure Deactivate; override;
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
procedure GridDblClick(Sender: TObject);
procedure GridClickEvent(Column: TColumn);
procedure CloseOk;
procedure Paint;override;
//
procedure DoSetFieldsFromString(FL:string);
procedure DoSetFieldsFromColList;
public
procedure KeyPress(var Key: char); override;
constructor CreatePopUp(AOwner: TComponent;
APopUpFormOptions:TPopUpFormOptions; AFieldList:string; BtnWidtn:integer);
property DataSet:TDataSet read GetDataSet write SetDataSet;
property LookupDisplayIndex:integer read GetLookupDisplayIndex write SetLookupDisplayIndex;
end;
function ShowRxDBPopUpForm(AControl:TWinControl; ADataSet:TDataSet;
AOnPopUpCloseEvent:TPopUpCloseEvent; APopUpFormOptions:TPopUpFormOptions;
AFieldList:string; ALookupDisplayIndex, BtnWidtn: integer):TPopUpForm;
procedure FillPopupWidth(APopUpFormOptions:TPopUpFormOptions; ARxPopUpForm:TPopUpForm);
implementation
uses dbutils, math;
{.$DEFINE LINUX}
function ShowRxDBPopUpForm(AControl:TWinControl; ADataSet:TDataSet;
AOnPopUpCloseEvent:TPopUpCloseEvent; APopUpFormOptions:TPopUpFormOptions;
AFieldList:string; ALookupDisplayIndex, BtnWidtn: integer):TPopUpForm;
begin
Result:=TPopUpForm.CreatePopUp(AControl, APopUpFormOptions, AFieldList, BtnWidtn);
Result.FOnPopUpCloseEvent:=AOnPopUpCloseEvent;
Result.DataSet:=ADataSet;
Result.LookupDisplayIndex:=ALookupDisplayIndex;
{$IFDEF LINUX}
if Result.ShowModal = mrOk then
if Assigned(AOnPopUpCloseEvent) then
AOnPopUpCloseEvent(true);
Result.Free;
Result:=nil;
{$ELSE LINUX}
Result.Show;
Result.FGrid.UpdateActive;
{$ENDIF LINUX}
end;
procedure FillPopupWidth(APopUpFormOptions: TPopUpFormOptions;
ARxPopUpForm: TPopUpForm);
var
i, w:integer;
begin
w:=Min(APopUpFormOptions.Columns.Count, ARxPopUpForm.FGrid.Columns.Count);
for i:=0 to w-1 do
begin
APopUpFormOptions.Columns[i].Width:=ARxPopUpForm.FGrid.Columns[i].Width;
end;
end;
{ TPopUpForm }
procedure TPopUpForm.SetDataSet(const AValue: TDataSet);
begin
if FDataSource.DataSet=AValue then exit;
FDataSource.DataSet:=AValue;
if FPopUpFormOptions.Columns.Count>0 then
DoSetFieldsFromColList
else
DoSetFieldsFromString(FFieldList);
end;
procedure TPopUpForm.FormClose(Sender: TObject; var CloseAction: TCloseAction);
begin
CloseAction:=caFree;
if Assigned(FOnPopUpCloseEvent) then
FOnPopUpCloseEvent(FFindResult);
end;
procedure TPopUpForm.SetLookupDisplayIndex(const AValue: integer);
begin
FGrid.LookupDisplayIndex:=AValue;
end;
function TPopUpForm.GetDataSet: TDataSet;
begin
Result:=FDataSource.DataSet;
end;
function TPopUpForm.GetLookupDisplayIndex: integer;
begin
Result:=FGrid.FLookupDisplayIndex;
end;
procedure TPopUpForm.Deactivate;
begin
inherited Deactivate;
if Assigned(FOnPopUpCloseEvent) then
FOnPopUpCloseEvent(FFindResult);
Close;
end;
procedure TPopUpForm.KeyDown(var Key: Word; Shift: TShiftState);
begin
case Key of
VK_ESCAPE:Deactivate;
VK_RETURN:CloseOk;
else
inherited KeyDown(Key, Shift);
end;
FGrid.KeyDown(Key, Shift);
Key:=0;
Invalidate;
end;
procedure TPopUpForm.KeyPress(var Key: char);
begin
inherited KeyPress(Key);
FGrid.KeyPress(Key);
end;
procedure TPopUpForm.GridDblClick(Sender: TObject);
begin
CloseOk;
end;
procedure TPopUpForm.GridClickEvent(Column: TColumn);
begin
CloseOk;
end;
procedure TPopUpForm.CloseOk;
begin
FFindResult:=true;
{$IFDEF LINUX}
ModalResult:=mrOk;
{$ELSE LINUX}
Deactivate;
{$ENDIF LINUX}
end;
procedure TPopUpForm.Paint;
var
CR:TRect;
begin
inherited Paint;
if FPopUpFormOptions.BorderStyle<>bsNone then
begin
CR:=ClientRect;
RxFrame3D(Canvas, CR, clBtnHighlight, clWindowFrame, 1);
RxFrame3D(Canvas, CR, clBtnFace, clBtnShadow, 1);
end
else
begin
Canvas.Pen.Color:=clWindowText;
Canvas.Pen.Style := psSolid;
Canvas.Rectangle(0, 0, Width-1, Height-1)
end;
end;
procedure TPopUpForm.DoSetFieldsFromString(FL: string);
var
FieldName:string;
GK:TRxColumn;
K:integer;
begin
while (FL<>'') do
begin
K:=Pos(';', FL);
if K<>0 then
begin
FieldName:=Copy(FL, 1, K-1);
Delete(FL, 1, K);
end
else
begin
FieldName:=FL;
FL:='';
end;
GK:=FGrid.Columns.Add as TRxColumn;
GK.Field:=FGrid.DataSource.DataSet.FieldByName(FieldName);
end;
end;
procedure TPopUpForm.DoSetFieldsFromColList;
var
GK:TRxColumn;
i:integer;
Column:TPopUpColumn;
begin
for i:=0 to FPopUpFormOptions.Columns.Count - 1 do
begin
GK:=FGrid.Columns.Add as TRxColumn;
Column:=FPopUpFormOptions.Columns[i];
GK.Field:=FGrid.DataSource.DataSet.FieldByName(Column.FieldName);
GK.Alignment:=Column.Alignment;
GK.Color:=Column.Color;
GK.DisplayFormat:=Column.DisplayFormat;
// GK.Font:=Column.Font;
GK.ImageList:=Column.ImageList;
GK.ValueChecked:=Column.ValueChecked;
GK.ValueUnchecked:=Column.ValueUnchecked;
if Column.Width<>0 then
GK.Width:=Column.Width;
GK.Title.Color:=Column.Title.Color;
(GK.Title as TRxColumnTitle).Orientation:=Column.Title.Orientation;
GK.Title.Alignment:=Column.Title.Alignment;
GK.Title.Layout:=Column.Title.Layout;
GK.Title.Caption:=Column.Title.Caption;
end;
end;
constructor TPopUpForm.CreatePopUp(AOwner: TComponent;
APopUpFormOptions:TPopUpFormOptions; AFieldList:string; BtnWidtn:integer);
var
PopupOrigin:TPoint;
begin
inherited Create(nil);
// inherited Create(AOwner);
BorderStyle := bsNone;
Caption:='RxPopUp';
KeyPreview:=true;
Visible := false;
FDataSource:=TDataSource.Create(Self);
FPopUpFormOptions:=APopUpFormOptions;
FFieldList:=AFieldList;
{$IFDEF LINUX}
PopupOrigin:=TCustomControl(AOwner).Parent.ControlToScreen(Point(TCustomControl(AOwner).Left, TCustomControl(AOwner).Height + TCustomControl(AOwner).Top));
{$ELSE}
PopupOrigin:=TCustomControl(AOwner).ControlToScreen(Point(0, TCustomControl(AOwner).Height));
{$ENDIF}
Top:=PopupOrigin.y;
Left:=PopupOrigin.x;
if FPopUpFormOptions.DropDownWidth = 0 then
Width:=TCustomControl(AOwner).Width + BtnWidtn
else
Width:=FPopUpFormOptions.DropDownWidth;
{$IFDEF LINUX}
CloseBtn:=TBitBtn.Create(Self);
CloseBtn.Parent:=Self;
CloseBtn.Align:=alBottom;
CloseBtn.Kind:=bkCancel;
{$ENDIF}
FGrid:=TPopUpGrid.Create(Self);
FGrid.Parent:=Self;
FGrid.ReadOnly:=true;
FGrid.Options:=FGrid.Options - [dgEditing];
FGrid.DataSource:=FDataSource;
FGrid.OnDblClick:=@GridDblClick;
FGrid.OnCellClick:=@GridClickEvent;
if FPopUpFormOptions.BorderStyle = bsSingle then
begin
FGrid.Top:=2;
FGrid.Left:=2;
FGrid.Width:=Width - 4;
{$IFDEF LINUX}
FGrid.Height:=Height - CloseBtn.Height - 2;
{$ELSE}
FGrid.Height:=Height - 4;
{$ENDIF}
FGrid.Anchors:=[akLeft, akRight, akTop, akBottom];
end
else
begin
FGrid.Top:=1;
FGrid.Left:=1;
FGrid.Width:=Width - 3;
{$IFDEF LINUX}
FGrid.Height:=Height - CloseBtn.Height - 2;
{$ELSE}
FGrid.Height:=Height - 3;
{$ENDIF}
FGrid.Anchors:=[akLeft, akRight, akTop, akBottom];
end;
//Set options
if not (pfgIndicator in FPopUpFormOptions.FOptions) then
FGrid.Options:=FGrid.Options - [dgIndicator];
if not (pfgColLines in FPopUpFormOptions.FOptions) then
FGrid.Options:=FGrid.Options - [dgColLines];
if not (pfgRowLines in FPopUpFormOptions.FOptions) then
FGrid.Options:=FGrid.Options - [dgRowLines];
if not (pfgColumnResize in FPopUpFormOptions.FOptions) then
FGrid.Options:=FGrid.Options - [dgColumnResize];
if not (pfgColumnMove in FPopUpFormOptions.FOptions) then
FGrid.Options:=FGrid.Options - [dgColumnMove];
if FPopUpFormOptions.ShowTitles then
FGrid.Options:=FGrid.Options + [dgTitles]
else
FGrid.Options:=FGrid.Options - [dgTitles];
FGrid.AutoSort:=FPopUpFormOptions.AutoSort;
FGrid.TitleButtons:=FPopUpFormOptions.TitleButtons;
FGrid.TitleStyle:=FPopUpFormOptions.TitleStyle;
FGrid.BorderStyle:=FPopUpFormOptions.BorderStyle;
end;
{ TPopUpFormOptions }
procedure TPopUpFormOptions.SetAutoSort(const AValue: boolean);
begin
if FAutoSort=AValue then exit;
FAutoSort:=AValue;
end;
function TPopUpFormOptions.GetColumns: TPopUpFormColumns;
begin
Result:=FColumns;
end;
procedure TPopUpFormOptions.SetColumns(const AValue: TPopUpFormColumns);
begin
FColumns.Assign(AValue);
end;
procedure TPopUpFormOptions.SetDropDownCount(const AValue: integer);
begin
if FDropDownCount=AValue then exit;
FDropDownCount:=AValue;
end;
procedure TPopUpFormOptions.SetDropDownWidth(const AValue: integer);
begin
if FDropDownWidth=AValue then exit;
FDropDownWidth:=AValue;
end;
procedure TPopUpFormOptions.SetOptions(const AValue: TPopUpGridOptions);
begin
if FOptions=AValue then exit;
FOptions:=AValue;
end;
procedure TPopUpFormOptions.SetShowTitles(const AValue: boolean);
begin
if FShowTitles=AValue then exit;
FShowTitles:=AValue;
end;
procedure TPopUpFormOptions.SetTitleButtons(const AValue: boolean);
begin
if FTitleButtons=AValue then exit;
FTitleButtons:=AValue;
end;
procedure TPopUpFormOptions.SetTitleStyle(const AValue: TTitleStyle);
begin
if FTitleStyle=AValue then exit;
FTitleStyle:=AValue;
end;
constructor TPopUpFormOptions.Create;
begin
inherited Create;
FAutoSort:=false;
FDropDownCount:=8;
FDropDownWidth:=0;
FOptions:=[pfgColLines, pfgRowLines];
FShowTitles:=false;
FTitleButtons:=false;
FTitleStyle:=tsLazarus;
FBorderStyle:=bsNone;
FColumns:=TPopUpFormColumns.Create(TPopUpColumn);
end;
destructor TPopUpFormOptions.Destroy;
begin
FreeAndNil(FColumns);
inherited Destroy;
end;
procedure TPopUpFormOptions.Assign(Source: TPersistent);
begin
if Source is TPopUpFormOptions then
begin
FAutoSort:=TPopUpFormOptions(Source).FAutoSort;
FDropDownCount:=TPopUpFormOptions(Source).FDropDownCount;
FDropDownWidth:=TPopUpFormOptions(Source).FDropDownWidth;
FOptions:=TPopUpFormOptions(Source).FOptions;
FShowTitles:=TPopUpFormOptions(Source).FShowTitles;
FTitleButtons:=TPopUpFormOptions(Source).FTitleButtons;
FTitleStyle:=TPopUpFormOptions(Source).FTitleStyle;
FBorderStyle:=TPopUpFormOptions(Source).FBorderStyle;
end
else
inherited Assign(Source);
end;
{ TPopUpColumnTitle }
procedure TPopUpColumnTitle.SetAlignment(const AValue: TAlignment);
begin
FAlignment:=AValue;
end;
procedure TPopUpColumnTitle.SetCaption(const AValue: string);
begin
FCaption:=AValue;
end;
procedure TPopUpColumnTitle.SetColor(const AValue: TColor);
begin
FColor:=AValue;
end;
procedure TPopUpColumnTitle.SetLayout(const AValue: TTextLayout);
begin
FLayout:=AValue;
end;
procedure TPopUpColumnTitle.SetOrientation(const AValue: TTextOrientation);
begin
if FOrientation=AValue then exit;
FOrientation:=AValue;
end;
constructor TPopUpColumnTitle.Create;
begin
inherited Create;
FColor:=clBtnFace;
end;
procedure TPopUpColumnTitle.Assign(Source: TPersistent);
begin
if Source is TPopUpColumnTitle then
begin
FAlignment:=TPopUpColumnTitle(Source).FAlignment;
FCaption:=TPopUpColumnTitle(Source).FCaption;
FColor:=TPopUpColumnTitle(Source).FColor;
FLayout:=TPopUpColumnTitle(Source).FLayout;
FOrientation:=TPopUpColumnTitle(Source).FOrientation;
end
else
inherited Assign(Source);
end;
{ TPopUpColumn }
procedure TPopUpColumn.SetAlignment(const AValue: TAlignment);
begin
if FAlignment=AValue then exit;
FAlignment:=AValue;
end;
procedure TPopUpColumn.SetColor(const AValue: TColor);
begin
if FColor=AValue then exit;
FColor:=AValue;
end;
procedure TPopUpColumn.SetDisplayFormat(const AValue: string);
begin
if FDisplayFormat=AValue then exit;
FDisplayFormat:=AValue;
end;
procedure TPopUpColumn.SetFieldName(const AValue: string);
begin
if FFieldName=AValue then exit;
if (FTitle.Caption = '') or (FTitle.Caption = FFieldName) then
FTitle.Caption:=AValue;
FFieldName:=AValue;
end;
procedure TPopUpColumn.SetFont(const AValue: TFont);
begin
if FFont=AValue then exit;
FFont:=AValue;
end;
procedure TPopUpColumn.SetImageList(const AValue: TImageList);
begin
if FImageList=AValue then exit;
FImageList:=AValue;
end;
procedure TPopUpColumn.SetTitle(const AValue: TPopUpColumnTitle);
begin
FTitle.Assign(AValue);
end;
procedure TPopUpColumn.SetValueChecked(const AValue: string);
begin
if FValueChecked=AValue then exit;
FValueChecked:=AValue;
end;
procedure TPopUpColumn.SetValueUnchecked(const AValue: string);
begin
if FValueUnchecked=AValue then exit;
FValueUnchecked:=AValue;
end;
procedure TPopUpColumn.SetWidth(const AValue: Integer);
begin
if FWidth=AValue then exit;
FWidth:=AValue;
end;
function TPopUpColumn.GetDisplayName: string;
begin
if FFieldName<>'' then
begin
Result:=FFieldName;
if FTitle.Caption<>'' then
Result:=FTitle.Caption+' -> '+FFieldName;
end
else
Result:=inherited GetDisplayName;
end;
constructor TPopUpColumn.Create(ACollection: TCollection);
begin
inherited Create(ACollection);
FTitle:=TPopUpColumnTitle.Create;
FColor:=clWindow;
FWidth:=65;
end;
destructor TPopUpColumn.Destroy;
begin
FreeAndNil(FTitle);
inherited Destroy;
end;
{ TPopUpFormColumns }
function TPopUpFormColumns.GetPopUpColumn(Index: Integer): TPopUpColumn;
begin
Result := TPopUpColumn( inherited Items[Index] );
end;
procedure TPopUpFormColumns.SetPopUpColumn(Index: Integer;
const AValue: TPopUpColumn);
begin
Items[Index].Assign( AValue );
end;
{ TPopUpGrid }
procedure TPopUpGrid.ClearFind;
begin
FFindLine:='';
if DatalinkActive then
DataSource.DataSet.First;
end;
procedure TPopUpGrid.FindNextChar(AChar: Char);
begin
FFindLine:=FFindLine + AChar;
if DatalinkActive then
DataSetLocateThrough(DataSource.DataSet, FLookupDisplayField, FFindLine, [loCaseInsensitive, loPartialKey]);
end;
procedure TPopUpGrid.FindPriorChar;
begin
if FFindLine = '' then exit;
Delete(FFindLine, Length(FFindLine), 1);
if DatalinkActive then
if (FFindLine<>'') then
DataSetLocateThrough(DataSource.DataSet, FLookupDisplayField, FFindLine, [loCaseInsensitive, loPartialKey])
else
DataSource.DataSet.First;
end;
procedure TPopUpGrid.SetLookupDisplayIndex(const AValue: integer);
begin
FLookupDisplayIndex:=AValue;
FLookupDisplayField:=Columns[FLookupDisplayIndex].FieldName;
end;
procedure TPopUpGrid.KeyPress(var Key: char);
begin
inherited KeyPress(Key);
if Key>#32 then
FindNextChar(Key)
else
if Key = #8 then
ClearFind;
end;
procedure TPopUpGrid.KeyDown(var Key: Word; Shift: TShiftState);
begin
if (Key>=Ord('0')) and (Key<=Ord('9')) then
FindNextChar(Char(Key))
else
if (Key>=VK_NUMPAD0) and (Key<=VK_NUMPAD9) then
FindNextChar(Char(Key - VK_NUMPAD0 + Ord('0')))
else
if Key = VK_DELETE then
ClearFind
else
if Key = VK_BACK then
FindPriorChar
else
begin
inherited KeyDown(Key, Shift);
exit;
end;
Key:=0;
end;
end.

View File

@ -0,0 +1,34 @@
unit rxsortmemds;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, DB,
{$IFDEF FPC}
RxDBGrid
{$ELSE}
exDBGrid
{$ENDIF}
;
type
TRxMemoryDataSortEngine = class(TExDBGridSortEngine)
public
procedure Sort(Field:TField; ADataSet:TDataSet; Asc:boolean);override;
end;
implementation
uses rxmemds;
procedure TRxMemoryDataSortEngine.Sort(Field:TField; ADataSet:TDataSet; Asc:boolean);
begin
if Assigned(ADataSet) then
(ADataSet as TRxMemoryData).SortOnFields(Field.FieldName, Asc);
end;
initialization
RegisterExDBGridSortEngine(TRxMemoryDataSortEngine, TRxMemoryData);
end.

View File

@ -360,11 +360,7 @@ var
TmpImage.Width := IWidth; TmpImage.Width := IWidth;
TmpImage.Height := IHeight; TmpImage.Height := IHeight;
TmpImage.Canvas.Brush.Color := Self.Brush.Color; TmpImage.Canvas.Brush.Color := Self.Brush.Color;
// Changes by MJW. Start ++++++++++++++++++++++++++++++++++++++++++++++++++++++
// Replacing BrushCopy() by CopyRect. As BrushCopy is not defined in FPC/Laz
TmpImage.Canvas.CopyRect(IRect, Bmp.Canvas, IRect);
// TmpImage.Canvas.BrushCopy(IRect, Bmp, IRect, Bmp.TransparentColor); // TmpImage.Canvas.BrushCopy(IRect, Bmp, IRect, Bmp.TransparentColor);
// Changes by MJW. Eind +++++++++++++++++++++++++++++++++++++++++++++++++++++++
X := 0; Y := 0; X := 0; Y := 0;
case FTextPosition of case FTextPosition of
tpNone: tpNone:

View File

@ -1,126 +1,127 @@
object ToolPanelSetupForm: TToolPanelSetupForm object ToolPanelSetupForm: TToolPanelSetupForm
Left = 289
Height = 404
Top = 169
Width = 442
HorzScrollBar.Page = 441
VertScrollBar.Page = 403
ActiveControl = BitBtn1 ActiveControl = BitBtn1
Caption = 'Tool panel setup' Caption = 'Tool panel setup'
ClientHeight = 396 ClientHeight = 404
ClientWidth = 442 ClientWidth = 442
FormStyle = fsStayOnTop FormStyle = fsStayOnTop
OnClose = FormClose OnClose = FormClose
OnDestroy = FormDestroy OnDestroy = FormDestroy
OnResize = FormResize OnResize = FormResize
PixelsPerInch = 96
HorzScrollBar.Page = 441
VertScrollBar.Page = 395
Left = 289
Height = 396
Top = 169
Width = 442
object BitBtn1: TBitBtn object BitBtn1: TBitBtn
Left = 266
Height = 38
Top = 360
Width = 83
Anchors = [akRight, akBottom] Anchors = [akRight, akBottom]
BorderSpacing.InnerBorder = 2 BorderSpacing.InnerBorder = 2
Caption = '&�������' Caption = '&Close'
Kind = bkClose Kind = bkClose
NumGlyphs = 0 NumGlyphs = 0
TabOrder = 0 TabOrder = 0
Left = 266
Height = 30
Top = 360
Width = 83
end end
object BitBtn2: TBitBtn object BitBtn2: TBitBtn
Left = 354
Height = 38
Top = 360
Width = 83
Anchors = [akRight, akBottom] Anchors = [akRight, akBottom]
BorderSpacing.InnerBorder = 2 BorderSpacing.InnerBorder = 2
Caption = '&�������' Caption = '&Help'
Kind = bkHelp Kind = bkHelp
NumGlyphs = 0 NumGlyphs = 0
TabOrder = 1 TabOrder = 1
Left = 354
Height = 30
Top = 360
Width = 83
end end
object PageControl1: TPageControl object PageControl1: TPageControl
ActivePage = TabSheet1
Align = alTop
Anchors = [akTop, akLeft, akRight, akBottom]
TabIndex = 0
TabOrder = 2
Height = 353 Height = 353
Width = 442 Width = 442
ActivePage = TabSheet2
Align = alTop
Anchors = [akTop, akLeft, akRight, akBottom]
TabIndex = 1
TabOrder = 2
object TabSheet1: TTabSheet object TabSheet1: TTabSheet
Caption = 'Visible buttons' Caption = 'Visible buttons'
ClientHeight = 327 ClientHeight = 353
ClientWidth = 434 ClientWidth = 442
Height = 327
Width = 434
object Label1: TLabel object Label1: TLabel
Caption = 'Avaliable buttons'
Color = clNone
FocusControl = ListBtnAvaliable
ParentColor = False
Left = 263 Left = 263
Height = 14 Height = 14
Top = 5 Top = 5
Width = 84 Width = 84
Caption = 'Avaliable buttons'
Color = clNone
FocusControl = ListBtnAvaliable
ParentColor = False
end end
object Label2: TLabel object Label2: TLabel
Caption = 'Visible buttons'
Color = clNone
FocusControl = ListBtnVisible
ParentColor = False
Left = 8 Left = 8
Height = 14 Height = 14
Top = 7 Top = 7
Width = 70 Width = 70
Caption = 'Visible buttons'
Color = clNone
FocusControl = ListBtnVisible
ParentColor = False
end end
object BitBtn3: TBitBtn object BitBtn3: TBitBtn
Left = 206
Height = 30
Top = 157
Width = 30
Anchors = [akTop] Anchors = [akTop]
BorderSpacing.InnerBorder = 2 BorderSpacing.InnerBorder = 2
Caption = '<<' Caption = '<<'
NumGlyphs = 0 NumGlyphs = 0
OnClick = BitBtn3Click OnClick = BitBtn3Click
TabOrder = 0 TabOrder = 0
Left = 202
Height = 30
Top = 157
Width = 30
end end
object BitBtn4: TBitBtn object BitBtn4: TBitBtn
Left = 206
Height = 30
Top = 115
Width = 30
Anchors = [akTop] Anchors = [akTop]
BorderSpacing.InnerBorder = 2 BorderSpacing.InnerBorder = 2
Caption = '<' Caption = '<'
NumGlyphs = 0 NumGlyphs = 0
OnClick = BitBtn4Click OnClick = BitBtn4Click
TabOrder = 1 TabOrder = 1
Left = 202
Height = 30
Top = 115
Width = 30
end end
object BitBtn5: TBitBtn object BitBtn5: TBitBtn
Left = 206
Height = 30
Top = 74
Width = 30
Anchors = [akTop] Anchors = [akTop]
BorderSpacing.InnerBorder = 2 BorderSpacing.InnerBorder = 2
Caption = '>' Caption = '>'
NumGlyphs = 0 NumGlyphs = 0
OnClick = BitBtn5Click OnClick = BitBtn5Click
TabOrder = 2 TabOrder = 2
Left = 202
Height = 30
Top = 74
Width = 30
end end
object BitBtn6: TBitBtn object BitBtn6: TBitBtn
Left = 206
Height = 30
Top = 40
Width = 30
Anchors = [akTop] Anchors = [akTop]
BorderSpacing.InnerBorder = 2 BorderSpacing.InnerBorder = 2
Caption = '>>' Caption = '>>'
NumGlyphs = 0 NumGlyphs = 0
OnClick = BitBtn6Click OnClick = BitBtn6Click
TabOrder = 3 TabOrder = 3
Left = 202
Height = 30
Top = 40
Width = 30
end end
object ListBtnAvaliable: TListBox object ListBtnAvaliable: TListBox
Left = 259
Height = 234
Top = 24
Width = 172
Anchors = [akTop, akLeft, akBottom] Anchors = [akTop, akLeft, akBottom]
Items.Strings = ( Items.Strings = (
'111' '111'
@ -135,92 +136,110 @@ object ToolPanelSetupForm: TToolPanelSetupForm
OnDrawItem = ListBox1DrawItem OnDrawItem = ListBox1DrawItem
Style = lbOwnerDrawFixed Style = lbOwnerDrawFixed
TabOrder = 4 TabOrder = 4
Left = 259
Height = 234
Top = 24
Width = 172
end end
object ListBtnVisible: TListBox object ListBtnVisible: TListBox
Left = 8
Height = 234
Top = 24
Width = 168
Anchors = [akTop, akLeft, akBottom] Anchors = [akTop, akLeft, akBottom]
OnClick = ListBtnAvaliableClick OnClick = ListBtnAvaliableClick
OnDrawItem = ListBox1DrawItem OnDrawItem = ListBox1DrawItem
Style = lbOwnerDrawFixed Style = lbOwnerDrawFixed
TabOrder = 5 TabOrder = 5
Left = 8 TopIndex = -1
Height = 234
Top = 24
Width = 168
end end
object Panel1: TPanel object Panel1: TPanel
Alignment = taLeftJustify
Anchors = [akLeft, akRight, akBottom]
BevelOuter = bvLowered
ClientHeight = 43
ClientWidth = 430
FullRepaint = False
TabOrder = 6
Left = 3 Left = 3
Height = 43 Height = 43
Top = 282 Top = 282
Width = 430 Width = 430
Alignment = taLeftJustify
Anchors = [akLeft, akRight, akBottom]
BevelOuter = bvLowered
FullRepaint = False
TabOrder = 6
end end
object cbShowCaption: TCheckBox object cbShowCaption: TCheckBox
Left = 8
Height = 13
Top = 264
Width = 85
Anchors = [akLeft, akBottom] Anchors = [akLeft, akBottom]
Caption = 'Show caption' Caption = 'Show caption'
OnChange = cbShowCaptionChange OnChange = cbShowCaptionChange
TabOrder = 7 TabOrder = 7
UseOnChange = True UseOnChange = True
Left = 8
Height = 13
Top = 264
Width = 85
end end
end end
object TabSheet2: TTabSheet object TabSheet2: TTabSheet
Caption = 'Options' Caption = 'Options'
ClientHeight = 327 ClientHeight = 323
ClientWidth = 434 ClientWidth = 438
Height = 327
Width = 434
object cbShowHint: TCheckBox object cbShowHint: TCheckBox
Left = 9
Height = 20
Top = 58
Width = 82
Caption = 'Show hint' Caption = 'Show hint'
OnClick = CheckBox1Change OnClick = CheckBox1Change
TabOrder = 0 TabOrder = 0
UseOnChange = True UseOnChange = True
Left = 9
Height = 13
Top = 58
Width = 67
end end
object cbTransp: TCheckBox object cbTransp: TCheckBox
Left = 9
Height = 20
Top = 34
Width = 93
Caption = 'Transparent' Caption = 'Transparent'
OnClick = CheckBox1Change OnClick = CheckBox1Change
TabOrder = 1 TabOrder = 1
UseOnChange = True UseOnChange = True
Left = 9
Height = 13
Top = 34
Width = 77
end end
object cbFlatBtn: TCheckBox object cbFlatBtn: TCheckBox
Left = 9
Height = 20
Top = 10
Width = 92
Caption = 'Flat buttons' Caption = 'Flat buttons'
OnClick = CheckBox1Change OnClick = CheckBox1Change
TabOrder = 2 TabOrder = 2
UseOnChange = True UseOnChange = True
Left = 9
Height = 13
Top = 10
Width = 75
end end
object cbsBarStyle: TCheckBox object cbsBarStyle: TCheckBox
Left = 9
Height = 20
Top = 79
Width = 74
Caption = 'XP style' Caption = 'XP style'
OnClick = CheckBox1Change OnClick = CheckBox1Change
TabOrder = 3 TabOrder = 3
UseOnChange = True UseOnChange = True
end
object RadioGroup1: TRadioGroup
Left = 9 Left = 9
Height = 13 Height = 98
Top = 79 Top = 106
Width = 58 Width = 176
AutoFill = True
Caption = 'Button align'
ChildSizing.LeftRightSpacing = 6
ChildSizing.TopBottomSpacing = 6
ChildSizing.EnlargeHorizontal = crsHomogenousChildResize
ChildSizing.EnlargeVertical = crsHomogenousChildResize
ChildSizing.ShrinkHorizontal = crsScaleChilds
ChildSizing.ShrinkVertical = crsScaleChilds
ChildSizing.Layout = cclLeftToRightThenTopToBottom
ChildSizing.ControlsPerLine = 1
ClientHeight = 81
ClientWidth = 172
Items.Strings = (
'None'
'Left'
'Rignt'
)
OnClick = CheckBox1Change
TabOrder = 4
end end
end end
end end

View File

@ -1,65 +1,72 @@
{ ��� - ���� ��������, ������������� ��������� lazarus } { ��� - ���� ��������, ������������� ��������� lazarus }
LazarusResources.Add('TToolPanelSetupForm','FORMDATA',[ LazarusResources.Add('TToolPanelSetupForm','FORMDATA',[
'TPF0'#19'TToolPanelSetupForm'#18'ToolPanelSetupForm'#13'ActiveControl'#7#7'B' 'TPF0'#19'TToolPanelSetupForm'#18'ToolPanelSetupForm'#4'Left'#3'!'#1#6'Height'
+'itBtn1'#7'Caption'#6#16'Tool panel setup'#12'ClientHeight'#3#140#1#11'Clien' +#3#148#1#3'Top'#3#169#0#5'Width'#3#186#1#18'HorzScrollBar.Page'#3#185#1#18'V'
+'tWidth'#3#186#1#9'FormStyle'#7#11'fsStayOnTop'#7'OnClose'#7#9'FormClose'#9 +'ertScrollBar.Page'#3#147#1#13'ActiveControl'#7#7'BitBtn1'#7'Caption'#6#16'T'
+'OnDestroy'#7#11'FormDestroy'#8'OnResize'#7#10'FormResize'#13'PixelsPerInch' +'ool panel setup'#12'ClientHeight'#3#148#1#11'ClientWidth'#3#186#1#9'FormSty'
+#2'`'#18'HorzScrollBar.Page'#3#185#1#18'VertScrollBar.Page'#3#139#1#4'Left'#3 +'le'#7#11'fsStayOnTop'#7'OnClose'#7#9'FormClose'#9'OnDestroy'#7#11'FormDestr'
+'!'#1#6'Height'#3#140#1#3'Top'#3#169#0#5'Width'#3#186#1#0#7'TBitBtn'#7'BitBt' +'oy'#8'OnResize'#7#10'FormResize'#0#7'TBitBtn'#7'BitBtn1'#4'Left'#3#10#1#6'H'
+'n1'#7'Anchors'#11#7'akRight'#8'akBottom'#0#25'BorderSpacing.InnerBorder'#2#2 +'eight'#2'&'#3'Top'#3'h'#1#5'Width'#2'S'#7'Anchors'#11#7'akRight'#8'akBottom'
+#7'Caption'#6#8'&'#199#224#234#240#251#242#252#4'Kind'#7#7'bkClose'#9'NumGly' +#0#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#6'&Close'#4'Kind'#7#7'bkCl'
+'phs'#2#0#8'TabOrder'#2#0#4'Left'#3#10#1#6'Height'#2#30#3'Top'#3'h'#1#5'Widt' +'ose'#9'NumGlyphs'#2#0#8'TabOrder'#2#0#0#0#7'TBitBtn'#7'BitBtn2'#4'Left'#3'b'
+'h'#2'S'#0#0#7'TBitBtn'#7'BitBtn2'#7'Anchors'#11#7'akRight'#8'akBottom'#0#25 +#1#6'Height'#2'&'#3'Top'#3'h'#1#5'Width'#2'S'#7'Anchors'#11#7'akRight'#8'akB'
+'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#8'&'#209#239#240#224#226#234#224 +'ottom'#0#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#5'&Help'#4'Kind'#7#6
+#4'Kind'#7#6'bkHelp'#9'NumGlyphs'#2#0#8'TabOrder'#2#1#4'Left'#3'b'#1#6'Heigh' +'bkHelp'#9'NumGlyphs'#2#0#8'TabOrder'#2#1#0#0#12'TPageControl'#12'PageContro'
+'t'#2#30#3'Top'#3'h'#1#5'Width'#2'S'#0#0#12'TPageControl'#12'PageControl1'#10 +'l1'#6'Height'#3'a'#1#5'Width'#3#186#1#10'ActivePage'#7#9'TabSheet2'#5'Align'
+'ActivePage'#7#9'TabSheet1'#5'Align'#7#5'alTop'#7'Anchors'#11#5'akTop'#6'akL' +#7#5'alTop'#7'Anchors'#11#5'akTop'#6'akLeft'#7'akRight'#8'akBottom'#0#8'TabI'
+'eft'#7'akRight'#8'akBottom'#0#8'TabIndex'#2#0#8'TabOrder'#2#2#6'Height'#3'a' +'ndex'#2#1#8'TabOrder'#2#2#0#9'TTabSheet'#9'TabSheet1'#7'Caption'#6#15'Visib'
+#1#5'Width'#3#186#1#0#9'TTabSheet'#9'TabSheet1'#7'Caption'#6#15'Visible butt' +'le buttons'#12'ClientHeight'#3'a'#1#11'ClientWidth'#3#186#1#0#6'TLabel'#6'L'
+'ons'#12'ClientHeight'#3'G'#1#11'ClientWidth'#3#178#1#6'Height'#3'G'#1#5'Wid' +'abel1'#4'Left'#3#7#1#6'Height'#2#14#3'Top'#2#5#5'Width'#2'T'#7'Caption'#6#17
+'th'#3#178#1#0#6'TLabel'#6'Label1'#7'Caption'#6#17'Avaliable buttons'#5'Colo' +'Avaliable buttons'#5'Color'#7#6'clNone'#12'FocusControl'#7#16'ListBtnAvalia'
+'r'#7#6'clNone'#12'FocusControl'#7#16'ListBtnAvaliable'#11'ParentColor'#8#4 +'ble'#11'ParentColor'#8#0#0#6'TLabel'#6'Label2'#4'Left'#2#8#6'Height'#2#14#3
+'Left'#3#7#1#6'Height'#2#14#3'Top'#2#5#5'Width'#2'T'#0#0#6'TLabel'#6'Label2' +'Top'#2#7#5'Width'#2'F'#7'Caption'#6#15'Visible buttons'#5'Color'#7#6'clNone'
+#7'Caption'#6#15'Visible buttons'#5'Color'#7#6'clNone'#12'FocusControl'#7#14 +#12'FocusControl'#7#14'ListBtnVisible'#11'ParentColor'#8#0#0#7'TBitBtn'#7'Bi'
+'ListBtnVisible'#11'ParentColor'#8#4'Left'#2#8#6'Height'#2#14#3'Top'#2#7#5'W' +'tBtn3'#4'Left'#3#206#0#6'Height'#2#30#3'Top'#3#157#0#5'Width'#2#30#7'Anchor'
+'idth'#2'F'#0#0#7'TBitBtn'#7'BitBtn3'#7'Anchors'#11#5'akTop'#0#25'BorderSpac' +'s'#11#5'akTop'#0#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#2'<<'#9'Num'
+'ing.InnerBorder'#2#2#7'Caption'#6#2'<<'#9'NumGlyphs'#2#0#7'OnClick'#7#12'Bi' +'Glyphs'#2#0#7'OnClick'#7#12'BitBtn3Click'#8'TabOrder'#2#0#0#0#7'TBitBtn'#7
+'tBtn3Click'#8'TabOrder'#2#0#4'Left'#3#202#0#6'Height'#2#30#3'Top'#3#157#0#5 +'BitBtn4'#4'Left'#3#206#0#6'Height'#2#30#3'Top'#2's'#5'Width'#2#30#7'Anchors'
+'Width'#2#30#0#0#7'TBitBtn'#7'BitBtn4'#7'Anchors'#11#5'akTop'#0#25'BorderSpa' +#11#5'akTop'#0#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#1'<'#9'NumGlyp'
+'cing.InnerBorder'#2#2#7'Caption'#6#1'<'#9'NumGlyphs'#2#0#7'OnClick'#7#12'Bi' +'hs'#2#0#7'OnClick'#7#12'BitBtn4Click'#8'TabOrder'#2#1#0#0#7'TBitBtn'#7'BitB'
+'tBtn4Click'#8'TabOrder'#2#1#4'Left'#3#202#0#6'Height'#2#30#3'Top'#2's'#5'Wi' +'tn5'#4'Left'#3#206#0#6'Height'#2#30#3'Top'#2'J'#5'Width'#2#30#7'Anchors'#11
+'dth'#2#30#0#0#7'TBitBtn'#7'BitBtn5'#7'Anchors'#11#5'akTop'#0#25'BorderSpaci' +#5'akTop'#0#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#1'>'#9'NumGlyphs'
+'ng.InnerBorder'#2#2#7'Caption'#6#1'>'#9'NumGlyphs'#2#0#7'OnClick'#7#12'BitB' +#2#0#7'OnClick'#7#12'BitBtn5Click'#8'TabOrder'#2#2#0#0#7'TBitBtn'#7'BitBtn6'
+'tn5Click'#8'TabOrder'#2#2#4'Left'#3#202#0#6'Height'#2#30#3'Top'#2'J'#5'Widt' +#4'Left'#3#206#0#6'Height'#2#30#3'Top'#2'('#5'Width'#2#30#7'Anchors'#11#5'ak'
+'h'#2#30#0#0#7'TBitBtn'#7'BitBtn6'#7'Anchors'#11#5'akTop'#0#25'BorderSpacing' +'Top'#0#25'BorderSpacing.InnerBorder'#2#2#7'Caption'#6#2'>>'#9'NumGlyphs'#2#0
+'.InnerBorder'#2#2#7'Caption'#6#2'>>'#9'NumGlyphs'#2#0#7'OnClick'#7#12'BitBt' +#7'OnClick'#7#12'BitBtn6Click'#8'TabOrder'#2#3#0#0#8'TListBox'#16'ListBtnAva'
+'n6Click'#8'TabOrder'#2#3#4'Left'#3#202#0#6'Height'#2#30#3'Top'#2'('#5'Width' +'liable'#4'Left'#3#3#1#6'Height'#3#234#0#3'Top'#2#24#5'Width'#3#172#0#7'Anch'
+#2#30#0#0#8'TListBox'#16'ListBtnAvaliable'#7'Anchors'#11#5'akTop'#6'akLeft'#8 +'ors'#11#5'akTop'#6'akLeft'#8'akBottom'#0#13'Items.Strings'#1#6#3'111'#6#3'2'
+'akBottom'#0#13'Items.Strings'#1#6#3'111'#6#3'222'#6#3'333'#6#2'44'#6#3'555' +'22'#6#3'333'#6#2'44'#6#3'555'#6#3'666'#6#3'777'#0#7'OnClick'#7#21'ListBtnAv'
+#6#3'666'#6#3'777'#0#7'OnClick'#7#21'ListBtnAvaliableClick'#10'OnDrawItem'#7 +'aliableClick'#10'OnDrawItem'#7#16'ListBox1DrawItem'#5'Style'#7#16'lbOwnerDr'
+#16'ListBox1DrawItem'#5'Style'#7#16'lbOwnerDrawFixed'#8'TabOrder'#2#4#4'Left' +'awFixed'#8'TabOrder'#2#4#0#0#8'TListBox'#14'ListBtnVisible'#4'Left'#2#8#6'H'
+#3#3#1#6'Height'#3#234#0#3'Top'#2#24#5'Width'#3#172#0#0#0#8'TListBox'#14'Lis' +'eight'#3#234#0#3'Top'#2#24#5'Width'#3#168#0#7'Anchors'#11#5'akTop'#6'akLeft'
+'tBtnVisible'#7'Anchors'#11#5'akTop'#6'akLeft'#8'akBottom'#0#7'OnClick'#7#21 +#8'akBottom'#0#7'OnClick'#7#21'ListBtnAvaliableClick'#10'OnDrawItem'#7#16'Li'
+'ListBtnAvaliableClick'#10'OnDrawItem'#7#16'ListBox1DrawItem'#5'Style'#7#16 +'stBox1DrawItem'#5'Style'#7#16'lbOwnerDrawFixed'#8'TabOrder'#2#5#8'TopIndex'
+'lbOwnerDrawFixed'#8'TabOrder'#2#5#4'Left'#2#8#6'Height'#3#234#0#3'Top'#2#24 +#2#255#0#0#6'TPanel'#6'Panel1'#4'Left'#2#3#6'Height'#2'+'#3'Top'#3#26#1#5'Wi'
+#5'Width'#3#168#0#0#0#6'TPanel'#6'Panel1'#9'Alignment'#7#13'taLeftJustify'#7 +'dth'#3#174#1#9'Alignment'#7#13'taLeftJustify'#7'Anchors'#11#6'akLeft'#7'akR'
+'Anchors'#11#6'akLeft'#7'akRight'#8'akBottom'#0#10'BevelOuter'#7#9'bvLowered' +'ight'#8'akBottom'#0#10'BevelOuter'#7#9'bvLowered'#11'FullRepaint'#8#8'TabOr'
+#12'ClientHeight'#2'+'#11'ClientWidth'#3#174#1#11'FullRepaint'#8#8'TabOrder' +'der'#2#6#0#0#9'TCheckBox'#13'cbShowCaption'#4'Left'#2#8#6'Height'#2#13#3'To'
+#2#6#4'Left'#2#3#6'Height'#2'+'#3'Top'#3#26#1#5'Width'#3#174#1#0#0#9'TCheckB' +'p'#3#8#1#5'Width'#2'U'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#7'Caption'#6#12
+'ox'#13'cbShowCaption'#7'Anchors'#11#6'akLeft'#8'akBottom'#0#7'Caption'#6#12
+'Show caption'#8'OnChange'#7#19'cbShowCaptionChange'#8'TabOrder'#2#7#11'UseO' +'Show caption'#8'OnChange'#7#19'cbShowCaptionChange'#8'TabOrder'#2#7#11'UseO'
+'nChange'#9#4'Left'#2#8#6'Height'#2#13#3'Top'#3#8#1#5'Width'#2'U'#0#0#0#9'TT' +'nChange'#9#0#0#0#9'TTabSheet'#9'TabSheet2'#7'Caption'#6#7'Options'#12'Clien'
+'abSheet'#9'TabSheet2'#7'Caption'#6#7'Options'#12'ClientHeight'#3'G'#1#11'Cl' +'tHeight'#3'C'#1#11'ClientWidth'#3#182#1#0#9'TCheckBox'#10'cbShowHint'#4'Lef'
+'ientWidth'#3#178#1#6'Height'#3'G'#1#5'Width'#3#178#1#0#9'TCheckBox'#10'cbSh' +'t'#2#9#6'Height'#2#20#3'Top'#2':'#5'Width'#2'R'#7'Caption'#6#9'Show hint'#7
+'owHint'#7'Caption'#6#9'Show hint'#7'OnClick'#7#15'CheckBox1Change'#8'TabOrd' +'OnClick'#7#15'CheckBox1Change'#8'TabOrder'#2#0#11'UseOnChange'#9#0#0#9'TChe'
+'er'#2#0#11'UseOnChange'#9#4'Left'#2#9#6'Height'#2#13#3'Top'#2':'#5'Width'#2 +'ckBox'#8'cbTransp'#4'Left'#2#9#6'Height'#2#20#3'Top'#2'"'#5'Width'#2']'#7'C'
+'C'#0#0#9'TCheckBox'#8'cbTransp'#7'Caption'#6#11'Transparent'#7'OnClick'#7#15 +'aption'#6#11'Transparent'#7'OnClick'#7#15'CheckBox1Change'#8'TabOrder'#2#1
+'CheckBox1Change'#8'TabOrder'#2#1#11'UseOnChange'#9#4'Left'#2#9#6'Height'#2 +#11'UseOnChange'#9#0#0#9'TCheckBox'#9'cbFlatBtn'#4'Left'#2#9#6'Height'#2#20#3
+#13#3'Top'#2'"'#5'Width'#2'M'#0#0#9'TCheckBox'#9'cbFlatBtn'#7'Caption'#6#12 +'Top'#2#10#5'Width'#2'\'#7'Caption'#6#12'Flat buttons'#7'OnClick'#7#15'Check'
+'Flat buttons'#7'OnClick'#7#15'CheckBox1Change'#8'TabOrder'#2#2#11'UseOnChan' +'Box1Change'#8'TabOrder'#2#2#11'UseOnChange'#9#0#0#9'TCheckBox'#11'cbsBarSty'
+'ge'#9#4'Left'#2#9#6'Height'#2#13#3'Top'#2#10#5'Width'#2'K'#0#0#9'TCheckBox' +'le'#4'Left'#2#9#6'Height'#2#20#3'Top'#2'O'#5'Width'#2'J'#7'Caption'#6#8'XP '
+#11'cbsBarStyle'#7'Caption'#6#8'XP style'#7'OnClick'#7#15'CheckBox1Change'#8 +'style'#7'OnClick'#7#15'CheckBox1Change'#8'TabOrder'#2#3#11'UseOnChange'#9#0
+'TabOrder'#2#3#11'UseOnChange'#9#4'Left'#2#9#6'Height'#2#13#3'Top'#2'O'#5'Wi' +#0#11'TRadioGroup'#11'RadioGroup1'#4'Left'#2#9#6'Height'#2'b'#3'Top'#2'j'#5
+'dth'#2':'#0#0#0#0#0 +'Width'#3#176#0#8'AutoFill'#9#7'Caption'#6#12'Button align'#28'ChildSizing.L'
+'eftRightSpacing'#2#6#28'ChildSizing.TopBottomSpacing'#2#6#29'ChildSizing.En'
+'largeHorizontal'#7#24'crsHomogenousChildResize'#27'ChildSizing.EnlargeVerti'
+'cal'#7#24'crsHomogenousChildResize'#28'ChildSizing.ShrinkHorizontal'#7#14'c'
+'rsScaleChilds'#26'ChildSizing.ShrinkVertical'#7#14'crsScaleChilds'#18'Child'
,'Sizing.Layout'#7#29'cclLeftToRightThenTopToBottom'#27'ChildSizing.ControlsP'
+'erLine'#2#1#12'ClientHeight'#2'Q'#11'ClientWidth'#3#172#0#13'Items.Strings'
+#1#6#4'None'#6#4'Left'#6#5'Rignt'#0#7'OnClick'#7#15'CheckBox1Change'#8'TabOr'
+'der'#2#4#0#0#0#0#0
]); ]);

View File

@ -30,6 +30,7 @@ type
ListBtnVisible: TListBox; ListBtnVisible: TListBox;
PageControl1: TPageControl; PageControl1: TPageControl;
Panel1: TPanel; Panel1: TPanel;
RadioGroup1: TRadioGroup;
TabSheet1: TTabSheet; TabSheet1: TTabSheet;
TabSheet2: TTabSheet; TabSheet2: TTabSheet;
procedure BitBtn3Click(Sender: TObject); procedure BitBtn3Click(Sender: TObject);
@ -143,7 +144,7 @@ begin
List.Clear; List.Clear;
for i:=0 to FToolPanel.Items.Count - 1 do for i:=0 to FToolPanel.Items.Count - 1 do
begin begin
if FToolPanel.Items[i].Visible = AVisible then if (FToolPanel.Items[i].Visible = AVisible) and Assigned(FToolPanel.Items[i].Action) then
begin begin
P:=List.Add(FToolPanel.Items[i].Action.Name); P:=List.Add(FToolPanel.Items[i].Action.Name);
List.Objects[P]:=FToolPanel.Items[i]; List.Objects[P]:=FToolPanel.Items[i];
@ -201,6 +202,8 @@ begin
FToolPanel.ShowHint:=cbShowHint.Checked; FToolPanel.ShowHint:=cbShowHint.Checked;
FToolPanel.Options:=tpo; FToolPanel.Options:=tpo;
FToolPanel.ButtonAllign:=TToolButtonAllign(RadioGroup1.ItemIndex);
end; end;
procedure TToolPanelSetupForm.BitBtn4Click(Sender: TObject); procedure TToolPanelSetupForm.BitBtn4Click(Sender: TObject);
@ -240,6 +243,7 @@ begin
ListBtnVisible.ItemHeight:=FToolPanel.BtnHeight + 4; ListBtnVisible.ItemHeight:=FToolPanel.BtnHeight + 4;
FillItems(ListBtnVisible.Items, true); FillItems(ListBtnVisible.Items, true);
FillItems(ListBtnAvaliable.Items, false); FillItems(ListBtnAvaliable.Items, false);
RadioGroup1.ItemIndex:=Ord(FToolPanel.ButtonAllign);
UpdateStates; UpdateStates;
end; end;

View File

@ -5,8 +5,8 @@ unit rxtoolbar;
interface interface
uses uses
Classes, SysUtils, Types, LCLType, LCLIntf, Buttons, Controls, ExtCtrls, ActnList, Classes, SysUtils, LCLType, LCLIntf, Buttons, Controls, ExtCtrls, ActnList,
PropertyStorage, Menus, Forms; PropertyStorage, Menus, Forms, types;
const const
DefButtonWidth = 24; DefButtonWidth = 24;
@ -17,6 +17,7 @@ type
TToolbarItem = class; TToolbarItem = class;
TToolbarButtonStyle = (tbrButton, tbrCheck, tbrDropDown, tbrSeparator, tbrDivider); TToolbarButtonStyle = (tbrButton, tbrCheck, tbrDropDown, tbrSeparator, tbrDivider);
TToolBarStyle = (tbsStandart, tbsWindowsXP); TToolBarStyle = (tbsStandart, tbsWindowsXP);
TToolButtonAllign = (tbaNone, tbaLeft, tbaRignt);
TToolPanelOption = (tpFlatBtns, tpTransparentBtns, tpStretchBitmap, TToolPanelOption = (tpFlatBtns, tpTransparentBtns, tpStretchBitmap,
tpCustomizable, tpGlyphPopup, tpCaptionPopup); tpCustomizable, tpGlyphPopup, tpCaptionPopup);
@ -28,6 +29,8 @@ type
protected protected
procedure SetImageIndex(Value: Integer); override; procedure SetImageIndex(Value: Integer); override;
function IsImageIndexLinked: Boolean; override; function IsImageIndexLinked: Boolean; override;
procedure SetEnabled(Value: Boolean); override;
procedure SetCaption(const Value: string); override;
end; end;
TToolbarButtonActionLinkClass = class of TToolbarButtonActionLink; TToolbarButtonActionLinkClass = class of TToolbarButtonActionLink;
@ -40,6 +43,7 @@ type
FDesignY:integer; FDesignY:integer;
FDrag:boolean; FDrag:boolean;
FImageList:TImageList; FImageList:TImageList;
FImageListSelected:TImageList;
FDropDownMenu:TPopupMenu; FDropDownMenu:TPopupMenu;
FShowCaption:boolean; FShowCaption:boolean;
FToolbarButtonStyle:TToolbarButtonStyle; FToolbarButtonStyle:TToolbarButtonStyle;
@ -47,6 +51,7 @@ type
FAutoSize:boolean; FAutoSize:boolean;
FOwnerItem:TToolbarItem; FOwnerItem:TToolbarItem;
function IsDesignMode:boolean; function IsDesignMode:boolean;
procedure PaintSeparator;
protected protected
procedure MouseDown(Button: TMouseButton; Shift: TShiftState; procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
X, Y: Integer); override; X, Y: Integer); override;
@ -61,7 +66,7 @@ type
procedure UpdateSize; procedure UpdateSize;
procedure SetEnabled(NewEnabled: boolean); override; procedure SetEnabled(NewEnabled: boolean); override;
function GetActionLinkClass: TControlActionLinkClass; override; function GetActionLinkClass: TControlActionLinkClass; override;
function GetDrawFlags: integer; virtual; function GetDrawFlagsA: integer;
public public
procedure SetBounds(aLeft, aTop, aWidth, aHeight: integer); override; procedure SetBounds(aLeft, aTop, aWidth, aHeight: integer); override;
destructor Destroy; override; destructor Destroy; override;
@ -72,6 +77,7 @@ type
TToolbarItem = class(TCollectionItem) TToolbarItem = class(TCollectionItem)
private private
FButton: TToolbarButton; FButton: TToolbarButton;
FSaveLeft:integer;
// FActionLink:TActionLink; // FActionLink:TActionLink;
function GetAction: TBasicAction; function GetAction: TBasicAction;
function GetAutoSize: boolean; function GetAutoSize: boolean;
@ -100,6 +106,8 @@ type
procedure SetTop(const AValue: Integer); procedure SetTop(const AValue: Integer);
procedure SetVisible(const AValue: boolean); procedure SetVisible(const AValue: boolean);
procedure SetWidth(const AValue: Integer); procedure SetWidth(const AValue: Integer);
procedure UpdateLeftAfterLoad;
protected protected
function GetDisplayName: string; override; function GetDisplayName: string; override;
public public
@ -139,7 +147,9 @@ type
TToolPanel = class(TCustomPanel) TToolPanel = class(TCustomPanel)
private private
FButtonAllign: TToolButtonAllign;
FImageList: TImageList; FImageList: TImageList;
FImageListSelected: TImageList;
FOptions: TToolPanelOptions; FOptions: TToolPanelOptions;
FPropertyStorageLink:TPropertyStorageLink; FPropertyStorageLink:TPropertyStorageLink;
FToolbarItems:TToolbarItems; FToolbarItems:TToolbarItems;
@ -153,7 +163,9 @@ type
function GetPropertyStorage: TCustomPropertyStorage; function GetPropertyStorage: TCustomPropertyStorage;
procedure SetBtnHeight(const AValue: Integer); procedure SetBtnHeight(const AValue: Integer);
procedure SetBtnWidth(const AValue: Integer); procedure SetBtnWidth(const AValue: Integer);
procedure SetButtonAllign(const AValue: TToolButtonAllign);
procedure SetImageList(const AValue: TImageList); procedure SetImageList(const AValue: TImageList);
procedure SetImageListSelected(const AValue: TImageList);
procedure SetItems(const AValue: TToolbarItems); procedure SetItems(const AValue: TToolbarItems);
procedure SetOptions(const AValue: TToolPanelOptions); procedure SetOptions(const AValue: TToolPanelOptions);
procedure SetPropertyStorage(const AValue: TCustomPropertyStorage); procedure SetPropertyStorage(const AValue: TCustomPropertyStorage);
@ -168,6 +180,7 @@ type
procedure DoAutoSize; Override; procedure DoAutoSize; Override;
procedure MouseUp(Button: TMouseButton; Shift: TShiftState; procedure MouseUp(Button: TMouseButton; Shift: TShiftState;
X, Y: Integer); override; X, Y: Integer); override;
procedure Loaded; override;
public public
constructor Create(AOwner: TComponent); override; constructor Create(AOwner: TComponent); override;
destructor Destroy; override; destructor Destroy; override;
@ -175,12 +188,14 @@ type
published published
property Items:TToolbarItems read GetItems write SetItems; property Items:TToolbarItems read GetItems write SetItems;
property ImageList:TImageList read FImageList write SetImageList; property ImageList:TImageList read FImageList write SetImageList;
property ImageListSelected:TImageList read FImageListSelected write SetImageListSelected;
property PropertyStorage:TCustomPropertyStorage read GetPropertyStorage write SetPropertyStorage; property PropertyStorage:TCustomPropertyStorage read GetPropertyStorage write SetPropertyStorage;
property BtnWidth: Integer read GetBtnWidth write SetBtnWidth default DefButtonWidth; property BtnWidth: Integer read GetBtnWidth write SetBtnWidth default DefButtonWidth;
property BtnHeight: Integer read GetBtnHeight write SetBtnHeight default DefButtonHeight; property BtnHeight: Integer read GetBtnHeight write SetBtnHeight default DefButtonHeight;
property ToolBarStyle:TToolBarStyle read FToolBarStyle write SetToolBarStyle default tbsStandart; property ToolBarStyle:TToolBarStyle read FToolBarStyle write SetToolBarStyle default tbsStandart;
property Options:TToolPanelOptions read FOptions write SetOptions; property Options:TToolPanelOptions read FOptions write SetOptions;
property Version: Integer read FVersion write FVersion default 0; property Version: Integer read FVersion write FVersion default 0;
property ButtonAllign:TToolButtonAllign read FButtonAllign write SetButtonAllign;
property Align; property Align;
property Alignment; property Alignment;
@ -226,6 +241,9 @@ type
implementation implementation
uses Math, Graphics, RxTBRSetup, LCLProc, vclutils, Dialogs, typinfo, rxdconst; uses Math, Graphics, RxTBRSetup, LCLProc, vclutils, Dialogs, typinfo, rxdconst;
const
BtnAl2Align:array [TToolButtonAllign] of TAlign = (alNone, alLeft, alRight);
{ TToolbarButton } { TToolbarButton }
function TToolbarButton.IsDesignMode: boolean; function TToolbarButton.IsDesignMode: boolean;
@ -233,6 +251,25 @@ begin
Result:=(Assigned(Parent) and (csDesigning in Parent.ComponentState)) or (FDesign); Result:=(Assigned(Parent) and (csDesigning in Parent.ComponentState)) or (FDesign);
end; end;
procedure TToolbarButton.PaintSeparator;
var
PaintRect: TRect;
X, H:integer;
begin
PaintRect:=ClientRect;
Canvas.Brush.Color := Color;
Canvas.FillRect(PaintRect);
X:=Width div 2 - 1;
H:=TToolPanel(Parent).Height;
if X>0 then
begin
Canvas.Pen.Color:=clBtnShadow;
Canvas.Line(X, 1, X, H);
Canvas.Pen.Color:=clWindow;
Canvas.Line(X+1, 1, X+1, H);
end;
end;
procedure TToolbarButton.MouseDown(Button: TMouseButton; Shift: TShiftState; X, procedure TToolbarButton.MouseDown(Button: TMouseButton; Shift: TShiftState; X,
Y: Integer); Y: Integer);
begin begin
@ -281,6 +318,13 @@ var
SIndex : Longint; SIndex : Longint;
TMP : String; TMP : String;
begin begin
if FToolbarButtonStyle = tbrSeparator then
begin
PaintSeparator;
exit;
end;
inherited Paint;
UpdateState(false); UpdateState(false);
if not Assigned(Action) then exit; if not Assigned(Action) then exit;
PaintRect:=ClientRect; PaintRect:=ClientRect;
@ -289,7 +333,8 @@ begin
(TCustomAction(Action).ImageIndex < FImageList.Count) then (TCustomAction(Action).ImageIndex < FImageList.Count) then
begin begin
FLastDrawFlagsA:=GetDrawFlags; FLastDrawFlagsA:=GetDrawFlagsA;
// FLastDrawFlagsA:=GetDrawDetails;
if not Transparent then if not Transparent then
begin begin
@ -317,11 +362,11 @@ begin
TMP := Caption; TMP := Caption;
SIndex := DeleteAmpersands(TMP); SIndex := DeleteAmpersands(TMP);
TextSize:= Canvas.TextExtent(TMP); TextSize:= Canvas.TextExtent(TMP);
{ If SIndex > 0 then (* If SIndex > 0 then
If SIndex <= Length(TMP) then If SIndex <= Length(TMP) then
begin begin
FShortcut := Ord(TMP[SIndex]); FShortcut := Ord(TMP[SIndex]);
end;} end;*)
end end
else else
begin begin
@ -407,6 +452,11 @@ begin
Dec(Offset.X, 2); Dec(Offset.X, 2);
Dec(Offset.Y, 2); Dec(Offset.Y, 2);
end; end;
if Assigned(FImageListSelected) and (FImageListSelected.Count>TCustomAction(Action).ImageIndex) and
((FLastDrawFlagsA and DFCS_FLAT) <> 0) and ((FLastDrawFlagsA and DFCS_PUSHED) = 0) then
FImageListSelected.Draw(Canvas, Offset.X, Offset.Y, TCustomAction(Action).ImageIndex, TCustomAction(Action).Enabled)
else
FImageList.Draw(Canvas, Offset.X, Offset.Y, TCustomAction(Action).ImageIndex, TCustomAction(Action).Enabled); FImageList.Draw(Canvas, Offset.X, Offset.Y, TCustomAction(Action).ImageIndex, TCustomAction(Action).Enabled);
end; end;
if (Caption <> '') and FShowCaption then if (Caption <> '') and FShowCaption then
@ -467,7 +517,7 @@ var
begin begin
OldState:=FState; OldState:=FState;
inherited UpdateState(InvalidateOnChange); inherited UpdateState(InvalidateOnChange);
if InvalidateOnChange and ((FState<>OldState) or (FLastDrawFlagsA<>GetDrawFlags)) then if InvalidateOnChange and ((FState<>OldState) or (FLastDrawFlagsA<>GetDrawFlagsA)) then
Invalidate; Invalidate;
end; end;
@ -503,6 +553,12 @@ procedure TToolbarButton.SetEnabled(NewEnabled: boolean);
begin begin
if FToolbarButtonStyle = tbrDropDown then if FToolbarButtonStyle = tbrDropDown then
NewEnabled :=true; NewEnabled :=true;
if (not NewEnabled) and Enabled then
begin
FState := bsDisabled;
MouseLeave;
// Flat:=false;
end;
inherited SetEnabled(NewEnabled); inherited SetEnabled(NewEnabled);
end; end;
@ -511,10 +567,10 @@ begin
Result:=TToolbarButtonActionLink; Result:=TToolbarButtonActionLink;
end; end;
function TToolbarButton.GetDrawFlags: integer; function TToolbarButton.GetDrawFlagsA: integer;
begin begin
// if flat and not mouse in control and not down, don't draw anything // if flat and not mouse in control and not down, don't draw anything
if Flat and not MouseInControl and not (FState in [bsDown, bsExclusive]) then if (Flat and not MouseInControl and not (FState in [bsDown, bsExclusive])) or (not Enabled) then
begin begin
Result := 0; Result := 0;
end end
@ -538,6 +594,15 @@ var
begin begin
if Assigned(Parent) and not (csLoading in TToolPanel(Parent).ComponentState) then if Assigned(Parent) and not (csLoading in TToolPanel(Parent).ComponentState) then
begin begin
if FToolbarButtonStyle = tbrSeparator then
begin
aWidth:=7;
if Assigned(FImageList) then
aHeight:=FImageList.Height+8
else
aHeight:=TToolPanel(Parent).BtnHeight;
end
else
if FAutoSize and Assigned(Canvas) then if FAutoSize and Assigned(Canvas) then
begin begin
if Assigned(FImageList) then if Assigned(FImageList) then
@ -602,7 +667,7 @@ var
begin begin
Result:=nil; Result:=nil;
for i:=0 to Count-1 do for i:=0 to Count-1 do
if Items[i].Action.Name = ActionName then if Assigned(Items[i].Action) and (Items[i].Action.Name = ActionName) then
begin begin
Result:=Items[i]; Result:=Items[i];
end; end;
@ -666,6 +731,18 @@ begin
end; end;
end; end;
procedure TToolPanel.SetButtonAllign(const AValue: TToolButtonAllign);
var
i:integer;
begin
if FButtonAllign=AValue then exit;
FButtonAllign:=AValue;
if not (csLoading in ComponentState) then
for i:=0 to FToolbarItems.Count - 1 do
FToolbarItems[i].FButton.Align:=BtnAl2Align[AValue];
end;
procedure TToolPanel.SetImageList(const AValue: TImageList); procedure TToolPanel.SetImageList(const AValue: TImageList);
var var
i:integer; i:integer;
@ -676,6 +753,16 @@ begin
FToolbarItems[i].FButton.FImageList:=AValue; FToolbarItems[i].FButton.FImageList:=AValue;
end; end;
procedure TToolPanel.SetImageListSelected(const AValue: TImageList);
var
i:integer;
begin
if FImageListSelected=AValue then exit;
FImageListSelected:=AValue;
for i:=0 to FToolbarItems.Count - 1 do
FToolbarItems[i].FButton.FImageListSelected:=AValue;
end;
procedure TToolPanel.SetItems(const AValue: TToolbarItems); procedure TToolPanel.SetItems(const AValue: TToolbarItems);
begin begin
FToolbarItems.Assign(AValue); FToolbarItems.Assign(AValue);
@ -716,11 +803,14 @@ begin
tpo:=FOptions; tpo:=FOptions;
FPropertyStorageLink.Storage.WriteString(S+sOptions, SetToString(GetPropInfo(Self, 'Options'), tpo1)); FPropertyStorageLink.Storage.WriteString(S+sOptions, SetToString(GetPropInfo(Self, 'Options'), tpo1));
FPropertyStorageLink.Storage.WriteString(S+sToolBarStyle, GetEnumProp(Self, 'ToolBarStyle')); FPropertyStorageLink.Storage.WriteString(S+sToolBarStyle, GetEnumProp(Self, 'ToolBarStyle'));
FPropertyStorageLink.Storage.WriteString(S+sButtonAllign, GetEnumProp(Self, 'ButtonAllign'));
FPropertyStorageLink.Storage.WriteInteger(S+sCount, FToolbarItems.Count); FPropertyStorageLink.Storage.WriteInteger(S+sCount, FToolbarItems.Count);
S:=S+sItem; S:=S+sItem;
for i:=0 to FToolbarItems.Count-1 do for i:=0 to FToolbarItems.Count-1 do
begin begin
S1:=S+IntToStr(i); S1:=S+IntToStr(i);
if Assigned(FToolbarItems[i].Action) then
begin
FPropertyStorageLink.Storage.WriteString(S1+sAction, FToolbarItems[i].Action.Name); FPropertyStorageLink.Storage.WriteString(S1+sAction, FToolbarItems[i].Action.Name);
FPropertyStorageLink.Storage.WriteInteger(S1+sVisible, ord(FToolbarItems[i].Visible)); FPropertyStorageLink.Storage.WriteInteger(S1+sVisible, ord(FToolbarItems[i].Visible));
FPropertyStorageLink.Storage.WriteInteger(S1+sShowCaption, ord(FToolbarItems[i].ShowCaption)); FPropertyStorageLink.Storage.WriteInteger(S1+sShowCaption, ord(FToolbarItems[i].ShowCaption));
@ -729,6 +819,7 @@ begin
FPropertyStorageLink.Storage.WriteInteger(S1+sWidth, FToolbarItems[i].Width); FPropertyStorageLink.Storage.WriteInteger(S1+sWidth, FToolbarItems[i].Width);
end; end;
end; end;
end;
procedure TToolPanel.OnIniLoad(Sender: TObject); procedure TToolPanel.OnIniLoad(Sender: TObject);
var var
@ -749,6 +840,7 @@ begin
SetOptions(tpo); SetOptions(tpo);
SetEnumProp(Self, 'ToolBarStyle', FPropertyStorageLink.Storage.ReadString(S+sToolBarStyle, GetEnumProp(Self, 'ToolBarStyle'))); SetEnumProp(Self, 'ToolBarStyle', FPropertyStorageLink.Storage.ReadString(S+sToolBarStyle, GetEnumProp(Self, 'ToolBarStyle')));
SetEnumProp(Self, 'ButtonAllign', FPropertyStorageLink.Storage.ReadString(S+sButtonAllign, GetEnumProp(Self, 'ButtonAllign')));
ACount:=FPropertyStorageLink.Storage.ReadInteger(S+sCount, 0); ACount:=FPropertyStorageLink.Storage.ReadInteger(S+sCount, 0);
S:=S+sItem; S:=S+sItem;
@ -846,9 +938,35 @@ begin
Customize(HelpContext); Customize(HelpContext);
end; end;
procedure TToolPanel.Loaded;
var
i, L:integer;
begin
inherited Loaded;
L:=0;
for i:=0 to FToolbarItems.Count - 1 do
begin
if ButtonAllign = tbaLeft then
begin
FToolbarItems[i].FSaveLeft:=L;
FToolbarItems[i].UpdateLeftAfterLoad;
Inc(L, FToolbarItems[i].Left + FToolbarItems[i].Width);
end
else
FToolbarItems[i].UpdateLeftAfterLoad;
end;
for i:=0 to FToolbarItems.Count - 1 do
begin
FToolbarItems[i].FButton.Align:=BtnAl2Align[FButtonAllign];
end;
end;
constructor TToolPanel.Create(AOwner: TComponent); constructor TToolPanel.Create(AOwner: TComponent);
begin begin
inherited Create(AOwner); inherited Create(AOwner);
AutoSize:=true;
FToolbarItems:=TToolbarItems.Create(Self); FToolbarItems:=TToolbarItems.Create(Self);
Align:=alTop; Align:=alTop;
Height:=DefButtonHeight; Height:=DefButtonHeight;
@ -944,6 +1062,9 @@ end;
procedure TToolbarItem.SetLeft(const AValue: Integer); procedure TToolbarItem.SetLeft(const AValue: Integer);
begin begin
if csLoading in TToolbarItems(Collection).FToolPanel.ComponentState then
FSaveLeft:=AValue
else
FButton.Left:=AValue; FButton.Left:=AValue;
end; end;
@ -1046,8 +1167,18 @@ begin
FButton.Width:=AValue; FButton.Width:=AValue;
end; end;
procedure TToolbarItem.UpdateLeftAfterLoad;
begin
FButton.Left:=FSaveLeft;
end;
function TToolbarItem.GetDisplayName: string; function TToolbarItem.GetDisplayName: string;
begin begin
if ButtonStyle = tbrSeparator then
begin
Result:='Separator' //inherited GetDisplayName;
end
else
if Assigned(Action) then if Assigned(Action) then
begin begin
if (Action is TCustomAction) then if (Action is TCustomAction) then
@ -1060,6 +1191,8 @@ begin
end; end;
constructor TToolbarItem.Create(ACollection: TCollection); constructor TToolbarItem.Create(ACollection: TCollection);
var
i, W:integer;
begin begin
inherited Create(ACollection); inherited Create(ACollection);
FButton:=TToolbarButton.Create(TToolbarItems(ACollection).FToolPanel); FButton:=TToolbarButton.Create(TToolbarItems(ACollection).FToolPanel);
@ -1070,6 +1203,17 @@ begin
FButton.FShowCaption:=false; FButton.FShowCaption:=false;
FButton.FAutoSize:=true; FButton.FAutoSize:=true;
FButton.FOwnerItem:=Self; FButton.FOwnerItem:=Self;
if not (csLoading in TToolbarItems(ACollection).FToolPanel.ComponentState) then
FButton.Align:=BtnAl2Align[TToolbarItems(ACollection).FToolPanel.ButtonAllign];
{ if TToolbarItems(ACollection).FToolPanel.ButtonAllign = tbaLeft then
begin
W:=0;
for i:=0 to ACollection.Count - 1 do
begin
W:=Max(W, TToolbarItems(ACollection).Items[I].Width + TToolbarItems(ACollection).Items[I].Left);
end;
Left:=W+1;
end;}
end; end;
destructor TToolbarItem.Destroy; destructor TToolbarItem.Destroy;
@ -1091,5 +1235,19 @@ begin
Result:=true; Result:=true;
end; end;
procedure TToolbarButtonActionLink.SetEnabled(Value: Boolean);
begin
if (FClient as TToolbarButton).FToolbarButtonStyle = tbrDropDown then
FClient.Enabled:=true
else
inherited SetEnabled(Value);
end;
procedure TToolbarButtonActionLink.SetCaption(const Value: string);
begin
inherited SetCaption(Value);
(FClient as TToolbarButton).UpdateSize;
end;
end. end.

View File

@ -114,7 +114,7 @@ begin
ACanvas.Control := Editor; ACanvas.Control := Editor;
end; end;
DC := Message.DC; DC := Message.DC;
// if DC = 0 then DC := BeginPaint(Handle, PS); if DC = 0 then DC := BeginPaint(Handle, PS);
ACanvas.Handle := DC; ACanvas.Handle := DC;
try try
ACanvas.Font := Font; ACanvas.Font := Font;
@ -128,8 +128,8 @@ begin
if not (NewStyleControls {and Ctl3D}) and (BorderStyle = bsSingle) then if not (NewStyleControls {and Ctl3D}) and (BorderStyle = bsSingle) then
begin begin
Brush.Color := clWindowFrame; Brush.Color := clWindowFrame;
FrameRect(R); { FrameRect(R);
InflateRect(R, -1, -1); InflateRect(R, -1, -1);}
end; end;
Brush.Color := Color; Brush.Color := Color;
S := AText; S := AText;
@ -152,6 +152,7 @@ begin
{$IFDEF RX_D4} {$IFDEF RX_D4}
if SysLocale.MiddleEast then UpdateTextFlags; if SysLocale.MiddleEast then UpdateTextFlags;
{$ENDIF} {$ENDIF}
Brush.Style := bsClear;
TextRect(R, ALeft, Margins.Y, S); TextRect(R, ALeft, Margins.Y, S);
end; end;
finally finally