From 26b4327f5251e10c09490818c6ae9ed314ccfd5f Mon Sep 17 00:00:00 2001 From: gambas Date: Fri, 21 Feb 2020 02:52:31 +0100 Subject: [PATCH] DataView: Add SelectAll() and UnselectAll() methods. [GB.DB.FORM] * NEW: DataView: Add SelectAll() and UnselectAll() methods. --- comp/src/gb.db.form/.component | 2 +- comp/src/gb.db.form/.project | 2 +- comp/src/gb.db.form/.src/DataView.class | 19 +++++++++++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/comp/src/gb.db.form/.component b/comp/src/gb.db.form/.component index cabb88e2d..17dbc2582 100644 --- a/comp/src/gb.db.form/.component +++ b/comp/src/gb.db.form/.component @@ -1,6 +1,6 @@ [Component] Key=gb.db.form -Version=3.13.90 +Version=3.14.90 Authors=BenoƮt Minisini Needs=Form Requires=gb.db,gb.form diff --git a/comp/src/gb.db.form/.project b/comp/src/gb.db.form/.project index f86d30c8e..63b200630 100644 --- a/comp/src/gb.db.form/.project +++ b/comp/src/gb.db.form/.project @@ -2,7 +2,7 @@ Title=Data bound controls Startup=FMain2 Icon=.hidden/control/datasource.png -Version=3.13.90 +Version=3.14.90 VersionFile=1 Component=gb.image Component=gb.gui diff --git a/comp/src/gb.db.form/.src/DataView.class b/comp/src/gb.db.form/.src/DataView.class index 78733e6c1..b9b931e07 100644 --- a/comp/src/gb.db.form/.src/DataView.class +++ b/comp/src/gb.db.form/.src/DataView.class @@ -1277,3 +1277,22 @@ Public Sub ButtonBox_DblClick() ButtonBox_Click End + +Public Sub SelectAll() + + Dim N As Integer + + N = $hCtrl.Rows.Count + If HasNewRecord() Then + Dec N + SetCreate(False) + Endif + If N >= 1 Then $hCtrl.Select(0, N) + +End + +Public Sub UnselectAll() + + $hCtrl.UnSelectAll + +End