FOCUS CONTROL AND INSERTROW (OpenInsight 16-Bit Specific)
At 01 AUG 2002 12:20:01PM S Bell wrote:
Hi All,
I have this problem …
When a record is read, focus goes to an Agent# prompt.
If the the control=', this is a new record. If an Agent#
is present, the user needs to key in the same agent# agin. Then
enter a new line of stuff into a edit_table. The new line needs to
go at the end of the table. How do I do that?
This is for data entry people who don't want to have to look up
at the screen as they are typing in ranges of returned tickets
from books of tickets.
This system was in Arev where when they got to the Agent# prompt,
the first number they typed cleared out the prompt then they just
keyed in the agent# agin and hit enter. The next prompt was the edit table for the book ranges. The cursor just went to the end of the table for them.
Hope this makes since.
When I run this what happens is the cursor sets at the beginning of the Agent# and when they type in the number agin, well things get ugly.
In Arev there was no problem because of the mode you were in when you reached the prompt.
Any ideas?
At 01 AUG 2002 12:46PM Don Miller - C3 Inc. wrote:
The easiest way, not necessarily the most elegant, is to disable the ability to insert rows into the table and to use a push-button to add the information. Typically, I use a non-bound dialog box window to capture the data which allows easier validation of the information than is available in an edit table. When the data is returned from the table (assuming it is not null), the data elements are added to the edit-table at the end. In general, I use this procedure to handle changes as well. In this case, grab the existing data from the edit table, store it into a parameter which is processed by the create event for the dialog box. On return, you can check for changes and update accordingly.
Don Miller
C3 Inc.
At 01 AUG 2002 01:43PM Richard Hunt wrote:
Hi,
For you request…
When I run this what happens is the cursor sets at the beginning of the Agent# and when they type in the number again, well things get ugly.
Try this… use the "SELECTION" option of the "SET_PROPERTY".
RESULT=SET_PROPERTY(AGENT_FOCUS,'SELECTION',1:@FM:-1)
This will highlight the whole entry for agent# and if a key is pressed then the whole entry is erased.
At 01 AUG 2002 01:44PM Richard Hunt wrote:
Oops…
Forgot to mention to put that in the "GOTFOCUS" event of "AGENT".
At 01 AUG 2002 04:29PM Robert Lee wrote:
Hopefully Richard answered the problem with Agent #
]The new line needs to go at the end of the table. How do I do that?
How about putting some code like this into the GOTFOCUS event of the Edittable.
FirstCol=Get_Property(CtrlEntId, 'ARRAY')
No.Cols=COUNT(FirstCol, @VM) + (FirstCol
) x=Set_Property(CtrlEntId, 'POSCHANGED', 1 : @FM : No.Cols + 1) Is that what you are looking for? Robert Lee </QUOTE> —- === At 02 AUG 2002 09:14AM S Bell wrote: === <QUOTE>Thanks Robert. Yes that's it I've probably done it befor but my memory seems to be shot. </QUOTE> —- === At 02 AUG 2002 12:01PM S Bell wrote: === <QUOTE>Wait? I've got this so far but somethings not working. FirstCol=GET_PROPERTY(@WINDOW:".TABLE_1",'ARRAY') No.Col=COUNT(FirstCol,@FM) + (FirstCol
)*void3=SET_PROPERTY(@WINDOW:".AGENT_NUMBER","FOCUS",1)
x=SET_PROPERTY(@WINDOW:"TABLE_1", 'ARRAY', "FOCUS", @FM:No.Col+1)
Focus stays at the first row.
Any ideas?
At 02 AUG 2002 03:30PM Oystein Reigem wrote:
S,
The statement
x=SET_PROPERTY(@WINDOW:"TABLE_1", 'ARRAY', "FOCUS", @FM:No.Col+1)
got several errors.
The first parameter @WINDOW:"TABLE_1" should be @WINDOW:".TABLE_1" .
The second parameter must be the property you want to set. Is it "ARRAY" or "FOCUS"? I assume it is "FOCUS".
The last parameter seems to be missing a row number. I assume with @FM:No.Col+1 you mean somerownumber:@FM:No.Col+1 . I haven't followed the thread so I don't know what somerownumber should be in your case. Anyway - the two parts should probably be switched around: No.Col+1:@FM:somerownumber
Anyway - "FOCUS" can be set to a control, e.g, an edit table, but not so precise as to a specific cell in the edit table. To set "FOCUS" to your edit table you can do
x=SET_PROPERTY(@WINDOW:".TABLE_1", "FOCUS", 1)
(1=true$)
But it is safer to use
x=SET_PROPERTY("SYSTEM", "FOCUS", @WINDOW:".TABLE_1")
Afterwards, to make a specific cell in the edit table the current cell, you must use the "SELPOS" property. Try with
x=SET_PROPERTY(@WINDOW:".TABLE_1", "SELPOS", No.Col+1:@FM:somerownumber)
- Oystein -
At 04 AUG 2002 10:07PM Robert Lee wrote:
Sorry, I must have been really tired when I posted my message.
Oystein quite rightly pointed you in the direction of:
x=SET_PROPERTY(@WINDOW:".TABLE_1", "SELPOS", Col.No:@FM:Row.No)
The problem you still have to overcome is writing some code to figure out what row number you want to appear at. You can use Get_Property(@window : '.TABLE_1', 'ARRAY') to get you the first column of data. Then you can write a quick loop to find the first blank entry, which then becomes Row.No in the above SELPOS line.
Hope that makes more sense than my last effort.
Robert Lee
At 05 AUG 2002 08:01AM S Bell wrote:
Thanks Guys
This seems to work …
LOC=GET_PROPERTY(@WINDOW:".TABLE_1","SELPOS")
ROW=LOC
COL=LOC
LOC=1:@FM:ROW + 1
x=SET_PROPERTY(@WINDOW:".TABLE_1","SELPOS",LOC)
Thanks agin
Steve