jvcllaz: Add new component TDBLookupTreeView with demo.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6870 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2019-04-27 17:15:09 +00:00
parent 0d39fd7dfd
commit 0bd361c6e9
20 changed files with 2228 additions and 16 deletions

View File

@ -336,6 +336,11 @@ function StrToBool(const S: string): Boolean;
function Var2Type(V: Variant; const DestVarType: Integer): Variant;
function VarToInt(V: Variant): Integer;
function VarToFloat(V: Variant): Double;
*************)
function VarIsNullEmpty(const V: Variant): Boolean;
(****************************** NOT CONVERTED ****
{ following functions are not documented
because they do not work properly sometimes, so do not use them }
@ -1255,7 +1260,7 @@ function FindUnusedFileName(FileName: string; const FileExt: string; NumberPrefi
implementation
uses
Math, LazFileUtils, LclStrConsts,
Math, Variants, LazFileUtils, LclStrConsts,
JvConsts;
(******************** NOT CONVERTED
@ -2959,6 +2964,14 @@ function VarToFloat(V: Variant): Double;
begin
Result := Var2Type(V, varDouble);
end;
*********)
function VarIsNullEmpty(const V: Variant): Boolean;
begin
Result := VarIsNull(V) or VarIsEmpty(V);
end;
(************************** NOT CONVERTED ***
function CopyDir(const SourceDir, DestDir: TFileName): Boolean;
var

View File

@ -307,6 +307,7 @@ type
ckID: TJvFourCC;
ckSize: Longint;
end;
****************************)
TJvAniHeader = packed record
dwSizeof: Longint;
@ -322,7 +323,6 @@ type
TJvChangeColorEvent = procedure(Sender: TObject; Foreground, Background: TColor) of object;
***********)
TJvLayout = (lTop, lCenter, lBottom);
TJvBevelStyle = (bsShape, bsLowered, bsRaised);

View File

@ -48,6 +48,19 @@ Usage:
- The text to be displayed as node text is taken from field "ItemField"
- Optionally, there can ba an "IconField" from which the icon index into the
ImageList is taken.
From http://wiki.delphi-jedi.org/wiki/JVCL_Help:TJvDBTreeView:
- MasterField: is equivalent to the absoluteIndex of the TreeView, a unique
ID for each TreeNode or record in the table.
- DetailField: is the hierachical link to the parent item, a foreing key
to the master filed in a self relation table
- ItemField: is the field that contain the display name or the caption of
a treeNode.
- IconField: is a integer field that point to a image index on a TImageList
object that contains the icons for the treeView.
- StartMasterValue: is the begining level to start build the TreeView,
0 = start from the root itens, 1 = start from the second level,
and so on.
-----------------------------------------------------------------------------}
// $Id$
@ -201,9 +214,6 @@ type
property MasterValue: Variant read FMasterValue;
end;
{$IFDEF RTL230_UP}
[ComponentPlatformsAttribute(pidWin32 or pidWin64)]
{$ENDIF RTL230_UP}
TJvDBTreeView = class(TJvCustomDBTreeView)
published
property DataSource;

View File

@ -0,0 +1,17 @@
unit JvDBConst;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils;
resourcestring
SPropDefByLookup = 'Property already defined by lookup field.';
SDataSourceFixed = 'Operation is not allowed with DataSource.';
implementation
end.

File diff suppressed because it is too large Load Diff

View File

@ -132,6 +132,9 @@ procedure CheckRequiredField(Field: TField);
procedure CheckRequiredFields(const Fields: array of TField);
procedure GotoBookmarkEx(DataSet: TDataSet; const Bookmark: TBookmark; Mode: TResyncMode = [rmExact, rmCenter]; ForceScrollEvents: Boolean = False);
function GetFieldProperty(ADataSet: TDataSet; AControl: TComponent;
const AFieldName: string): TField;
{ SQL expressions }
function DateToSQL(Value: TDateTime): string;
@ -264,6 +267,15 @@ begin
end;
end;
function GetFieldProperty(ADataSet: TDataSet; AControl: TComponent;
const AFieldName: string): TField;
begin
Result := ADataSet.FindField(AFieldName);
if Result = nil then
DatabaseErrorFmt(SFieldNotFound, [AFieldName], AControl);
end;
{ Refresh Query procedure }
procedure RefreshQuery(Query: TDataSet);