From 9fce5f24165c22028bd96ca4f42c5f076d2167fa Mon Sep 17 00:00:00 2001 From: Fabien Bodard Date: Tue, 20 Dec 2016 14:26:08 +0000 Subject: [PATCH] [GB.FORM] * BUG: DocumentView: WorkAround to lock scrolling on mouseWheel git-svn-id: svn://localhost/gambas/trunk@8018 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- comp/src/gb.form/.info | 4 ++++ comp/src/gb.form/.project | 2 +- .../gb.form/.src/DocumentView/DocumentView.class | 15 ++++++++++++++- comp/src/gb.form/.src/Test/FDocumentView.class | 2 +- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/comp/src/gb.form/.info b/comp/src/gb.form/.info index a19131e15..7fcbb65b6 100644 --- a/comp/src/gb.form/.info +++ b/comp/src/gb.form/.info @@ -1170,6 +1170,10 @@ View_MouseWheel m +Obs_MouseWheel +m + + _GetItemWidth m i diff --git a/comp/src/gb.form/.project b/comp/src/gb.form/.project index 4b9a5aa44..5e217d534 100644 --- a/comp/src/gb.form/.project +++ b/comp/src/gb.form/.project @@ -1,7 +1,7 @@ # Gambas Project File 3.0 # Compiled with Gambas 3.9.90 Title=More controls for graphical components -Startup=FTestFileView +Startup=FDocumentView Version=3.9.90 VersionFile=1 Component=gb.image diff --git a/comp/src/gb.form/.src/DocumentView/DocumentView.class b/comp/src/gb.form/.src/DocumentView/DocumentView.class index 64aa2a8db..1f1d5a558 100644 --- a/comp/src/gb.form/.src/DocumentView/DocumentView.class +++ b/comp/src/gb.form/.src/DocumentView/DocumentView.class @@ -72,6 +72,7 @@ Private $iSX As Integer Private $iSY As Integer Private $MX As Integer Private $MY As Integer +Private $hObs As Observer Event Layout(Page As Integer) Event Draw(Page As Integer, Width As Integer, Height As Integer) @@ -85,7 +86,7 @@ Public Sub _new() $tmrLoad.Delay = 1 Me.Proxy = $hView $hDocItem = New _DocumentItem As "Doc" - + $hObs = New Observer($hView.View) As "Obs" End Public Sub tmrLoad_Timer() @@ -704,6 +705,18 @@ Public Sub View_MouseWheel() End +'WorkAround to lock Scrolling when contol key is pressed +Public Sub Obs_MouseWheel() + + If Mouse.Control Then + $hView.UseMouse = False + Else + $hView.UseMouse = True + Endif + +End + + Public Function Find(X As Integer, Y As Integer) As Integer Dim iRow, iCol As Integer diff --git a/comp/src/gb.form/.src/Test/FDocumentView.class b/comp/src/gb.form/.src/Test/FDocumentView.class index 5a2ab34ea..d09486658 100644 --- a/comp/src/gb.form/.src/Test/FDocumentView.class +++ b/comp/src/gb.form/.src/Test/FDocumentView.class @@ -13,7 +13,7 @@ End Public Sub Form_Open() - hpdf.Open("/home/fabien/Downloads/Tuto, doc et RFC/05-005_Web_Map_Context_Documents_Implementation_Specification.pdf") + hpdf.Open("/home/fabien/Downloads/cerfa_14952-01.pdf") 'hpdf.Open("~/René Guénon - 1945 - Caïn et Abel (Le Règne de la Quantité et les Signes des Temps).pdf") DV.Count = hpdf.Count DV2.Count = 0