Focus Cell shows color and Make Edittable Behavior Like Arev (OpenInsight Specific)
At 08 MAY 2000 01:53:11PM Ray Chan wrote:
In an EditTable, I want to highlight the cell that has focus with a color background and when the cursor moves to the next cell restore the cell with original color. The code at Poschanged is shown below. The problems are:
1) When I initially enter the EditTable, the first cell doesn't show the new color.
2) On subsequent cells, I see the new color, but the original color is not restored to the previous cell until we move to the next row. In other words, each cell in a row acquires the new color and the color is not changed back to the original until we move out of that row.
—-Code for Color
* add color
BackColor="
ForeColor="
BackSelColor=SIS_LYel$
ForeSelColor='
rv=Send_Message(@Window:".TABLE_1","COLOR_BY_POS",Col,Row,BackColor:@fm:ForeColor:@fm:BackSelColor:@fm:ForeSelColor)
* Position of last cell
val=Get_Property(CtrlEntId,"PREVSELPOS")
* Value in last cell
prevcelval=Get_Property(CtrlEntId,"CELLPOS",val)
PrevCol=val
PrevRow=val
/* Restore Color back to White */
BackSelColor=White$
* rv=Send_Message(@Window:".TABLE_1","COLOR_BY_POS",PrevCol,PrevRow,BackColor:@fm:ForeColor:@fm:BackSelColor:@fm:ForeSelColor)
—-End of Color section —
When I leave the EditTable, I would the EditTable to automatically position itself to the top of the EditTable similar to AREV. For example, if the EditTable shows two rows, but has three items, I want the items in row 1 and row 2 to show. To emulate this function, the below code is also called from POSCHANGED. The TOPPOS works fine. However, if I come back to the EditTable, the cursor is positioned where it was last located and not at the TOP of the EditTable.
How do I change this behavior?
—-EditTable Code for Moving
If prevcol eq '1' and (prevcelval eq '' or prevcelval eq ' ') then
NextPrompt=Get_Property(CtrlEntId,"NEXT")
TOPPOS is top most item in ETSet_Property(CtrlEntId,"TOPPOS",1:@FM:1)Set_Property(NextPrompt,"FOCUS",1)End Else
.
.
.
End
Although the code above jump out of the EditTable earlier than otherwisw, it doesn't exit the EditTable until I hit the end of the row. I would like to exit the EditTable as soon as I detect that there is no data in the first column of that row.
Any suggestions would be appreciated.
[email protected] onmouseover=window.status=imagine … ;return(true)"
Ray Chan ~ Symmetry Info
At 08 MAY 2000 06:18PM [email protected] wrote:
Ray,
1) Try sending a 'poschange' event to the table when you enter the table. This does not happen automatically. When you get focus just do a send event.
2) Looks okay but will have to play with to see what is going on. Sure that one of the Gurus will see the problem right off.
3) When you leave the table you can set the SelPos property so it is back to 1,1. This should take care of the problem
[email protected] onmouseover=window.status=imagine … a company that supports their product from pride not extortion;return(true)"
David Tod Sigafoos ~ SigSolutions
[email protected] Cell:503-341-2983