Text selection in Forms 6.0 in character environment

From: Matt B. <mcb_at_fightspam.sd.znet.com>
Date: 2000/05/11
Message-ID: <shmqj89fkcp167_at_corp.supernews.com>#1/1


We're running Developer 2000 with Forms 6.0 (although we had this problem in 5.0 too) and we are FTP-ing the .fmb files to a UNIX box (DG/UX) and generating the .fmx on the server because our application is running in character mode
(please don't ask/laugh - I hate it but it's not my decision - I'd like to go
client-server but we aren't ready for that yet and neither are our customers).

Anyway, ever since we converted from Forms 3.0 to 5.0 and beyond, we have the problem where the entire value in a text item is highlighted when you land in it.

In a client-server application, it's essentially the same thing as the field's value being highlighted in blue (selected) when you navigate to the field and the selection/highlight goes away if you use your right or left arrow to scroll right or left at least one position either way or if you click a second time in the field with your mouse.

This is a problem for us in character mode because the automatic selection that Oracle Form, when you land in a field, is doing isn't visible (nothing visible indicates the field's entire value is "selected") so the user really has no idea that their first keystroke (any alphanumeric, space, backspace, etc.) will wipe out the entire value in the field if they don't do something to unselect the entire value. In a character environment, the only reasonable way to do this (no mouse) is to do a right arrow or a left arrow.

We've accepted that as "that's how it is" in most of our application, but in this one module, it affects a 76-character field. So, if the user just navigates to the field and types *anything*, their first keystroke wipes it out
(because Oracle selected the whole thing unbeknownst to the user) and they have
to retype the whole field, which they won't remember the value of to begin with anyway.

For those of you that have worked with Powerbuilder, there's a property of an item on a datawindow called "Auto-selection" and it can be turned on or off. This is basically the same thing. Oracle however seems to always be doing an auto-select by default (acceptable Windows behavior) but not good for character mode (not obvious to the user it's auto-selected). Is there any way to turn this off, either in Developer or dynamically at runtime? I can't find anything in the property palette or any kind of built in to do this.

We've played with it in a Windows environment so we could actually see the auto-selection. So far we've tried on WHEN-NEW-ITEM-INSTANCE to copy the value to a control item, null out the "real" field, and then copy it back in, but it still leaves the user with input focus that has the field selected.

We've also done this in WHEN-NEW-ITEM-INSTANCE in an attempt to fake it:

if :SYSTEM.CURSOR_ITEM is not null then
  select_all;
  synchronize;
  cut_region;
  synchronize;
  paste_region;
  synchronize;
end if;

Unfortunately, it still leaves the value selected when control is returned to the user.

However (!!!), if we do this (take out paste_region);

if :SYSTEM.CURSOR_ITEM is not null then
  select_all;
  synchronize;
  cut_region;
  synchronize;
-- paste_region;
-- synchronize;
end if;

And when the form runs I press CTRL-V and paste it manually myself, it's fine. It pastes in the value for me and it's not selected anymore at all. The paste_region built-in and the CTRL+V keystroke behave slightly differently in this manner. If I could simulate the CTRL+V exactly somehow in the code, that'd be fine as a workaround.

Or, in WHEN-NEW-ITEM-INSTANCE if I could just force a DO_KEY('RIGHT') and then a DO_KEY('LEFT') to simulate the user pressing the right arrow and then left arrow, that'd work too, because it would un-select the value (works when I manually do it on the keyboard but I want to do it behind the scenes for the user). Unfortunately I don't think there's such a key in DO_KEY. I see DO_KEY('UP') and DO_KEY('DOWN') but nothing for right or left arrows that I could programatically force to happen.

Any help would greatly be appreciated!

Thanks,

Matt Received on Thu May 11 2000 - 00:00:00 CEST

Original text of this message