Dear guest !

Welcome to Team Developer Community Forum. A place created by the community, for the community !

This is a resource for Q & A and discussion about everything related to OpenText Gupta Team Developer, SqlBase, TD Mobile and Report Builder.
It is the alternative for the OpenText customer forums which can only be accessed with an active support contract.

Please register your account now. It will make you part of the active community.
Also, this guest message will not be displayed for registered users.

As a bonus, registered users have access to the 'Newsgroups' subforum, holding 10 years worth of posts from the good old Gupta newsgroups.

Having an account gives you the opportunity to ask questions and get help from others.
We hope this free gathering will help you and the community getting forward!

Best regards,
The forum site admins.

Solved Combo Boxes: Block value change while collapsed

General discussion forum about all things Team Developer 5.x
Post Reply
Charlie
Canada
Posts: 34
Joined: 07 Mar 2017, 18:52
Location: Fredericton, New Brunswick, Canada

Combo Boxes: Block value change while collapsed

Post by Charlie » 19 Jun 2017, 20:05

Is there a way to block "Home", "End", "Page Up", and "Page Down" from having any effect on the value of a Combo Box ?

Although I've figured out how to block the up and down arrow keys by processing, in the message actions of a combo box, the WM_GETDLGCODE message and returning 0, that doesn't do anything for those other keys.
Last edited by Charlie on 20 Jun 2017, 10:59, edited 1 time in total.
A little trick to help direct folk from old Gupta forum to this one: Link to post

EwaldP
Austria
Posts: 31
Joined: 07 Mar 2017, 08:00
Location: Austria

Re: Combo Boxes

Post by EwaldP » 20 Jun 2017, 06:22

Hi Charlie,

Visual Toolchest will help you ( I can test the behaviour only in TD 6.1/6.3)
!!CB!! 173
On VTM_KeyDown
If wParam = VK_PageDown OR wParam = VK_PageUp
Return 0


Regards
Ewald
Ewald P. Palmetshofer
EDV-Hausleitner GmbH
4020 Linz
www.edv-hausleitner.at

Charlie
Canada
Posts: 34
Joined: 07 Mar 2017, 18:52
Location: Fredericton, New Brunswick, Canada

Combo Boxes: Block value change while collapsed

Post by Charlie » 20 Jun 2017, 10:56

G'day Ewald,

Thanks for the suggestion, however that does not work.

Users of our application find it much too easy to unintentionally alter values in combo boxes (when they have the focus) with:
  • Mouse Scroll Wheel
  • Any key on the keyboard
In the attached sample, I've found a way to prevent a mouse scroll wheel from working until the combo box is expanded. I've also found a way of preventing any key having any impact on the combo box until expanded, except for those four keys (Home, End, Page Up, Page Down).

*Edit* You'll find in the sample commented code that either did not work at all, or only partially helped. *Edit Done*

As an alternative to all of this, I could take the combo boxes out of the tab order, which would force users to mouse-click on a combo box, but I keep that as a last resort.

Cheers !
Attachments
TestComboBoxes.zip
(250.49 KiB) Downloaded 2 times
A little trick to help direct folk from old Gupta forum to this one: Link to post

EwaldP
Austria
Posts: 31
Joined: 07 Mar 2017, 08:00
Location: Austria

Re: Combo Boxes: Block value change while collapsed

Post by EwaldP » 20 Jun 2017, 14:26

Hi Charlie,

the reason why my sample works is that my combo box is editable. If the combobox is not editable, the focus is on the arrow to open the combo box and not on the datafield. If you set the combo box to editable you can prevent the keysstroke in the the VTM_KeyDown section.

!!CB!! 173
On WM_MOUSEWHEEL
If NOT VisListGetDropdownState( hWndItem )
Return 0
On WM_CHAR
Return 0
On VTM_KeyDown
If wParam = VK_PageDown OR wParam = VK_PageUp
Return 0
If wParam = VK_Home OR VK_End
Return 0

Regards
Ewald
TestComboBoxes.zip
(77.54 KiB) Downloaded 1 time
Ewald P. Palmetshofer
EDV-Hausleitner GmbH
4020 Linz
www.edv-hausleitner.at

Charlie
Canada
Posts: 34
Joined: 07 Mar 2017, 18:52
Location: Fredericton, New Brunswick, Canada

Re: Combo Boxes: Block value change while collapsed

Post by Charlie » 20 Jun 2017, 17:54

G'day Ewald,

EDIT: Ugh, I missed that bit about disabling the keystrokes. Excellent stuff, Ewald. THANKS !!!


Although that makes sense, I can't set that sort of thing up because none of our combo boxes are editable.



Much appreciated, and Happy Tuesday ! (I'm just a hop skip and a jump away from Happy Wednesday Eve...)
A little trick to help direct folk from old Gupta forum to this one: Link to post

Post Reply

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest