Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
Databases
»
OnMouseWheel event in dbgrid
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
IRC channel
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
How to: create DLL file f...
by
paule32
[
Today
at 02:41:34 pm]
Surf Units in Text Mode I...
by
mosquito
[
Today
at 01:58:21 pm]
Ho Ho Ho IntraWeb in Laza...
by
Thaddy
[
Today
at 01:55:52 pm]
Generics - correct syntax
by
Thaddy
[
Today
at 01:48:32 pm]
FpDebug questions
by
440bx
[
Today
at 01:22:53 pm]
leetcode doesn’t support ...
by
codeninja
[
Today
at 01:16:43 pm]
Can function be used for ...
by
Joanna
[
Today
at 12:48:19 pm]
Parameter passing odditie...
by
Nitorami
[
Today
at 12:42:09 pm]
Access violation when ope...
by
Чебурашка
[
Today
at 12:14:30 pm]
Lazarus features in a non...
by
jollytall
[
Today
at 11:53:17 am]
Access violation when re-...
by
Chris Osborne
[
Today
at 11:43:49 am]
splitting an image
by
Dzandaa
[
Today
at 11:15:40 am]
how to tweek fpmake to co...
by
marcov
[
Today
at 10:35:11 am]
Why isn't TTIRadioGroup's...
by
egsuh
[
Today
at 08:09:35 am]
Lazarus for Windows on aa...
by
Wallaby
[April 23, 2024, 11:46:56 pm]
(Solved) TIndexedAVLTree ...
by
lainz
[April 23, 2024, 10:49:03 pm]
Demo Scene Picture sinwav...
by
KodeZwerg
[April 23, 2024, 10:26:21 pm]
fkInternalCalc
by
zraja
[April 23, 2024, 09:31:07 pm]
A fairly simple sound sol...
by
KodeZwerg
[April 23, 2024, 09:23:37 pm]
add new targets to make
by
marcov
[April 23, 2024, 08:38:42 pm]
Quirky windows
by
ASerge
[April 23, 2024, 07:07:16 pm]
[Request] Demo Scene Sub ...
by
Gigatron
[April 23, 2024, 06:29:39 pm]
Unlocking Files
by
KodeZwerg
[April 23, 2024, 06:03:08 pm]
[SOLVED] trunk bug for mi...
by
Key-Real
[April 23, 2024, 05:56:32 pm]
Demo Scene Bitmap Font Sc...
by
Gigatron
[April 23, 2024, 05:56:27 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: OnMouseWheel event in dbgrid (Read 10394 times)
JanRoza
Hero Member
Posts: 672
OnMouseWheel event in dbgrid
«
on:
May 18, 2007, 04:29:35 pm »
In my application which has a dbgrid (based on a dbf table) I show the current record number and total number of records in the stausbar.
As long as I use the keyboard to scroll through the dbgrid everything works fine and if I click on a cell with the mouse the correct info is shown as well but nothing happens when I scroll using the mouse wheel.
Any chance dbgrid will get a OnMousewheel event (like in Delphi) in the near future?
Or is there another way to tackle this?
(I'm using Lazarus 0.9.23 on Windows Vista)
Thanks for looking into this.
Jan Roza
Logged
OS: Windows 10 (64 bit) / Linux Mint (64 bit)
Lazarus 3.2 FPC 3.2.2
CodeTyphon 8.40 FPC 3.3.1
jesusr
Sr. Member
Posts: 484
RE: OnMouseWheel event in dbgrid
«
Reply #1 on:
May 18, 2007, 06:45:59 pm »
What events do you use to detect that something has changed?
Logged
JanRoza
Hero Member
Posts: 672
OnMouseWheel event in dbgrid
«
Reply #2 on:
May 18, 2007, 09:36:33 pm »
I don't, the grid is readonly and only meant to browse through a table.
To the right of the grid the content of the selected record is shown in dbedit fields so there is no need for editing in the dbgrid itself.
All I'm looking for is a means to keep the current record number updated while scrolling through the dbgrid using the mouse wheel.
I like a challenge but I'm stuck with this one.
Logged
OS: Windows 10 (64 bit) / Linux Mint (64 bit)
Lazarus 3.2 FPC 3.2.2
CodeTyphon 8.40 FPC 3.3.1
jesusr
Sr. Member
Posts: 484
OnMouseWheel event in dbgrid
«
Reply #3 on:
May 18, 2007, 10:04:15 pm »
does using the mousewheel have any effect in the grid?
Logged
JanRoza
Hero Member
Posts: 672
OnMouseWheel event in dbgrid
«
Reply #4 on:
May 19, 2007, 01:21:51 am »
Oh yes it has, rolling the wheel makes the selector scrolling up and down the grid nicely and the details of the record under the selector bar are shown in the dbedit fields on the right.
For now I manage the current record number via OnkeyUp, OnMouseMove and OnMouseUp but those events don't cover scrolling via the mouse wheel.
Logged
OS: Windows 10 (64 bit) / Linux Mint (64 bit)
Lazarus 3.2 FPC 3.2.2
CodeTyphon 8.40 FPC 3.3.1
jesusr
Sr. Member
Posts: 484
OnMouseWheel event in dbgrid
«
Reply #5 on:
May 19, 2007, 04:36:56 am »
I think you better use datasource.OnDataChange event to detect when the active record has changed, because if you later put a dbnavigator for example neither of OnKeyUp, OnMouseDown, OnMouseUp or OnMouseWheel will help you.
Logged
JanRoza
Hero Member
Posts: 672
OnMouseWheel event in dbgrid
«
Reply #6 on:
May 19, 2007, 05:15:54 pm »
Thanks JesusR!
That's what I was looking for but missed it.
Your'e absolutely right your way is much better, I'll try it out as soon as I'm home again.
Jan
Logged
OS: Windows 10 (64 bit) / Linux Mint (64 bit)
Lazarus 3.2 FPC 3.2.2
CodeTyphon 8.40 FPC 3.3.1
JanRoza
Hero Member
Posts: 672
OnMouseWheel event in dbgrid
«
Reply #7 on:
May 20, 2007, 11:37:57 pm »
Yep, that datasource.OnDataChange suggestion was the solution I needed.
Works like a charm, so many thanks for pointing me in the right direction.
Jan
Logged
OS: Windows 10 (64 bit) / Linux Mint (64 bit)
Lazarus 3.2 FPC 3.2.2
CodeTyphon 8.40 FPC 3.3.1
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
Databases
»
OnMouseWheel event in dbgrid
TinyPortal
© 2005-2018