Font changes when editing a cell with an Inline Text Control [message #1063207] |
Wed, 12 June 2013 11:55  |
Eclipse User |
|
|
|
I have created a grid and added a CellStyle configAttribute with my desired font and added it to the configRegistry with a unique cell label (and added it with DisplayMode EDIT, NORMAL, and SELECT). I have also added a CELL_EDITOR attribute with a TextCellEditor using the same cell label.
When I run my test, I see the values in the editable cells with the correct Font. When I select the cell, the value is still seen with the correct font. But as soon as I press a key that changes the text, the Font changes to the default font of the grid. Once I leave the cell, the Font changes back to the desired Font.
Should the Font be changing when the TextCellEditor goes into edit mode? Am I doing something incorrect?
Thanks
|
|
|
|
Re: Font changes when editing a cell with an Inline Text Control [message #1063212 is a reply to message #1063208] |
Wed, 12 June 2013 12:23   |
Eclipse User |
|
|
|
Thanks for the quick response Edwin. I really need this functionality (if possible), so I went ahead and created my own object implementing ICellEditor. This way I thought I could get control of the Text control.
I found doing it this way also produces the same result. I even implemented a VerifyListener on the Text object and when a valid Key is pressed, I tried to change the Font on the Text object to the desired Font.
What happens now is that when I type a valid character in an editable cell, the Font changes briefly to my desired Font and then back to the default font.
I was hoping by implementing an ICellEditor and controlling the Text object I could achieve what I wanted. Is this possible? If not, do you know if it possible to change the default font so that I can modify the Font Text object will display when in edit mode?
--------------------------
Just to update, in my own ICellEditor class, I had the some code as the TextCellEditor. I then modified my implementation by removing the code in the keyReleased KeyListener method. What I found is that, if the getCanonicalValue method is not called, the Font does not change. Of course I lose the validation that occurs by removing this logic. Not sure if this was intentional or a misuse on my part.
Thanks again.
[Updated on: Wed, 12 June 2013 12:38] by Moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.09943 seconds