You've already forked lazarus-ccr
for all rx lookup controls - in PopUpForm add property SizePriority for better calc columns width
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2385 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -37,7 +37,7 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
LCLType, LCLProc, LCLIntf, Classes, SysUtils, LResources, Forms, types,
|
LCLType, LCLProc, LCLIntf, Classes, SysUtils, LResources, Forms, types,
|
||||||
Controls, Graphics, Dialogs, DB, EditBtn, DBGrids, {StdCtrls,} Buttons,
|
Controls, Graphics, Dialogs, DB, EditBtn, DBGrids, Buttons,
|
||||||
LMessages, DbCtrls, GraphType, dbutils, RxDbGrid, rxpopupunit, Themes;
|
LMessages, DbCtrls, GraphType, dbutils, RxDbGrid, rxpopupunit, Themes;
|
||||||
|
|
||||||
const
|
const
|
||||||
|
@ -52,11 +52,9 @@ type
|
|||||||
FLookupDisplayField:string;
|
FLookupDisplayField:string;
|
||||||
procedure ClearFind;
|
procedure ClearFind;
|
||||||
procedure FindNextChar(var UTF8Key: TUTF8Char);
|
procedure FindNextChar(var UTF8Key: TUTF8Char);
|
||||||
// procedure FindNextUTF8Char(UTF8Key: TUTF8Char);
|
|
||||||
procedure FindPriorChar;
|
procedure FindPriorChar;
|
||||||
procedure SetLookupDisplayIndex(const AValue: integer);
|
procedure SetLookupDisplayIndex(const AValue: integer);
|
||||||
protected
|
protected
|
||||||
// procedure KeyPress(var Key: char); override;
|
|
||||||
procedure UTF8KeyPress(var UTF8Key: TUTF8Char); override;
|
procedure UTF8KeyPress(var UTF8Key: TUTF8Char); override;
|
||||||
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
|
procedure KeyDown(var Key: Word; Shift: TShiftState); override;
|
||||||
property LookupDisplayIndex:integer read FLookupDisplayIndex write SetLookupDisplayIndex;
|
property LookupDisplayIndex:integer read FLookupDisplayIndex write SetLookupDisplayIndex;
|
||||||
@ -100,6 +98,7 @@ type
|
|||||||
FFieldName: string;
|
FFieldName: string;
|
||||||
FFont: TFont;
|
FFont: TFont;
|
||||||
FImageList: TImageList;
|
FImageList: TImageList;
|
||||||
|
FSizePriority: Integer;
|
||||||
FTitle: TPopUpColumnTitle;
|
FTitle: TPopUpColumnTitle;
|
||||||
FValueChecked: string;
|
FValueChecked: string;
|
||||||
FValueUnchecked: string;
|
FValueUnchecked: string;
|
||||||
@ -110,6 +109,7 @@ type
|
|||||||
procedure SetFieldName(const AValue: string);
|
procedure SetFieldName(const AValue: string);
|
||||||
procedure SetFont(const AValue: TFont);
|
procedure SetFont(const AValue: TFont);
|
||||||
procedure SetImageList(const AValue: TImageList);
|
procedure SetImageList(const AValue: TImageList);
|
||||||
|
procedure SetSizePriority(AValue: Integer);
|
||||||
procedure SetTitle(const AValue: TPopUpColumnTitle);
|
procedure SetTitle(const AValue: TPopUpColumnTitle);
|
||||||
procedure SetValueChecked(const AValue: string);
|
procedure SetValueChecked(const AValue: string);
|
||||||
procedure SetValueUnchecked(const AValue: string);
|
procedure SetValueUnchecked(const AValue: string);
|
||||||
@ -128,6 +128,7 @@ type
|
|||||||
property ImageList:TImageList read FImageList write SetImageList;
|
property ImageList:TImageList read FImageList write SetImageList;
|
||||||
property ValueChecked: string read FValueChecked write SetValueChecked;
|
property ValueChecked: string read FValueChecked write SetValueChecked;
|
||||||
property ValueUnchecked: string read FValueUnchecked write SetValueUnchecked;
|
property ValueUnchecked: string read FValueUnchecked write SetValueUnchecked;
|
||||||
|
property SizePriority: Integer read FSizePriority write SetSizePriority default 1;
|
||||||
property Title:TPopUpColumnTitle read FTitle write SetTitle;
|
property Title:TPopUpColumnTitle read FTitle write SetTitle;
|
||||||
property Width: Integer read FWidth write SetWidth;
|
property Width: Integer read FWidth write SetWidth;
|
||||||
end;
|
end;
|
||||||
@ -416,6 +417,7 @@ var
|
|||||||
i:integer;
|
i:integer;
|
||||||
Column:TPopUpColumn;
|
Column:TPopUpColumn;
|
||||||
begin
|
begin
|
||||||
|
FGrid.BeginUpdate;
|
||||||
for i:=0 to FPopUpFormOptions.Columns.Count - 1 do
|
for i:=0 to FPopUpFormOptions.Columns.Count - 1 do
|
||||||
begin
|
begin
|
||||||
GK:=FGrid.Columns.Add as TRxColumn;
|
GK:=FGrid.Columns.Add as TRxColumn;
|
||||||
@ -426,6 +428,7 @@ begin
|
|||||||
GK.DisplayFormat:=Column.DisplayFormat;
|
GK.DisplayFormat:=Column.DisplayFormat;
|
||||||
// GK.Font:=Column.Font;
|
// GK.Font:=Column.Font;
|
||||||
GK.ImageList:=Column.ImageList;
|
GK.ImageList:=Column.ImageList;
|
||||||
|
GK.SizePriority:=Column.SizePriority;
|
||||||
GK.ValueChecked:=Column.ValueChecked;
|
GK.ValueChecked:=Column.ValueChecked;
|
||||||
GK.ValueUnchecked:=Column.ValueUnchecked;
|
GK.ValueUnchecked:=Column.ValueUnchecked;
|
||||||
|
|
||||||
@ -438,6 +441,7 @@ begin
|
|||||||
GK.Title.Layout:=Column.Title.Layout;
|
GK.Title.Layout:=Column.Title.Layout;
|
||||||
GK.Title.Caption:=Column.Title.Caption;
|
GK.Title.Caption:=Column.Title.Caption;
|
||||||
end;
|
end;
|
||||||
|
FGrid.EndUpdate;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
constructor TPopUpForm.CreatePopUp(AOwner: TComponent;
|
constructor TPopUpForm.CreatePopUp(AOwner: TComponent;
|
||||||
@ -738,6 +742,12 @@ begin
|
|||||||
FImageList:=AValue;
|
FImageList:=AValue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TPopUpColumn.SetSizePriority(AValue: Integer);
|
||||||
|
begin
|
||||||
|
if FSizePriority=AValue then Exit;
|
||||||
|
FSizePriority:=AValue;
|
||||||
|
end;
|
||||||
|
|
||||||
procedure TPopUpColumn.SetTitle(const AValue: TPopUpColumnTitle);
|
procedure TPopUpColumn.SetTitle(const AValue: TPopUpColumnTitle);
|
||||||
begin
|
begin
|
||||||
FTitle.Assign(AValue);
|
FTitle.Assign(AValue);
|
||||||
@ -779,6 +789,7 @@ begin
|
|||||||
FTitle:=TPopUpColumnTitle.Create;
|
FTitle:=TPopUpColumnTitle.Create;
|
||||||
FColor:=clWindow;
|
FColor:=clWindow;
|
||||||
FWidth:=65;
|
FWidth:=65;
|
||||||
|
FSizePriority:=1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
destructor TPopUpColumn.Destroy;
|
destructor TPopUpColumn.Destroy;
|
||||||
|
Reference in New Issue
Block a user