From 7de65428def4abcbcc732dfcabb3f43da8bd95fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Sat, 3 Mar 2012 12:18:30 +0000 Subject: [PATCH] [GB.FORM] * NEW: Implement Title properties as synonymous of Text for row and column headers. * BUG: GridView.Rows[].Selected now works correctly when multiple selection is enabled. git-svn-id: svn://localhost/gambas/trunk@4529 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- comp/src/gb.form/.info | 8 +++++++ .../.src/GridView/_GridView_Column.class | 2 +- .../gb.form/.src/GridView/_GridView_Row.class | 22 ++++++++++--------- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/comp/src/gb.form/.info b/comp/src/gb.form/.info index 2a2f8f6f8..46b96b338 100644 --- a/comp/src/gb.form/.info +++ b/comp/src/gb.form/.info @@ -2835,6 +2835,10 @@ Text p s +Title +p +s + Resizable p b @@ -2984,6 +2988,10 @@ Text p s +Title +p +s + _Row v i diff --git a/comp/src/gb.form/.src/GridView/_GridView_Column.class b/comp/src/gb.form/.src/GridView/_GridView_Column.class index 72518c6e7..748102cc9 100644 --- a/comp/src/gb.form/.src/GridView/_GridView_Column.class +++ b/comp/src/gb.form/.src/GridView/_GridView_Column.class @@ -4,7 +4,7 @@ Export Property Read X As Integer Property Width, W As Integer -Property Text As String +Property Text, Title As String Property Resizable As Boolean Property Expand As Boolean diff --git a/comp/src/gb.form/.src/GridView/_GridView_Row.class b/comp/src/gb.form/.src/GridView/_GridView_Row.class index 5c264a21c..c3739bed0 100644 --- a/comp/src/gb.form/.src/GridView/_GridView_Row.class +++ b/comp/src/gb.form/.src/GridView/_GridView_Row.class @@ -2,20 +2,12 @@ Export -' GB_PROPERTY_READ("Top", "i", CGRIDITEM_y), -' GB_PROPERTY("Text", "s", CGRIDROWS_text), -' GB_PROPERTY("Title", "s", CGRIDROWS_text), -' GB_PROPERTY("Selected", "b", CGRIDROWS_selected), -' GB_METHOD("Refresh", NULL, CGRIDROWS_refresh, NULL), -' GB_PROPERTY("Resizable", "b", CGRIDROWS_resizable), -' - Event _Refresh Property Read Y As Integer Property Height, H As Integer Property Selected As Boolean -Property Text As String +Property Text, Title As String Public _Row As Integer @@ -57,7 +49,17 @@ End Private Sub Selected_Write(Value As Boolean) - GetView()._SelectRow(_Row, Value) + Dim hView As GridView = GetView() + + If hView.Mode = Select.Single Then + hView._SelectRow(_Row, Value) + Else If hView.Mode = Select.Multiple Then + If Value Then + GetRows().Select(_Row) + Else + GetRows().UnSelect(_Row) + Endif + Endif End