I''d like to be able to set an individual FXTable cell to uneditable. I tried using disableItem() but this didn''t seem to have any affect on whether you could select or change things. I''ve also tried various things like registering handlers for SEL_COMMAND, SEL_CHANGED, and SEL_SELECTED but that was getting annoying and it still doesn''t account for someone just pressing a key and changing a value. I saw I could also handle SEL_KEYPRESS but since that returns a FXEvent rather than a FXTablePos it looked like it was going to be a lot of work to figure out where I was in the table when the keypress occurred. I''d also like to know if there is any way to set the background of my uneditable cell gray. I saw the stipple variable which I set but FXTable renders the stipple color as bright red. That is the opposite of the grey color I''d like to make it to indicate my value is uneditable. Thanks, Jason This message and any enclosures are intended only for the addressee. Please notify the sender by email if you are not the intended recipient. If you are not the intended recipient, you may not use, copy, disclose, or distribute this message or its contents or enclosures to any other person and any such actions may be unlawful. Ball reserves the right to monitor and review all messages and enclosures sent to or from this email address. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/fxruby-users/attachments/20070817/c1ae9d89/attachment.html
On Aug 17, 2007, at 3:12 PM, Thomas, Jason M ((Software)) wrote:> I''d like to be able to set an individual FXTable cell to > uneditable. I tried using disableItem() but this didn''t seem to > have any affect on whether you could select or change things. I''ve > also tried various things like registering handlers for > SEL_COMMAND, SEL_CHANGED, and SEL_SELECTED but that was getting > annoying and it still doesn''t account for someone just pressing a > key and changing a value. I saw I could also handle SEL_KEYPRESS > but since that returns a FXEvent rather than a FXTablePos it looked > like it was going to be a lot of work to figure out where I was in > the table when the keypress occurred.You''re right; this looks like a bug in FOX. FOX doesn''t respond to keypress events or single mouse button clicks on disabled table cells, but it does allow you to (among other things) double-click in a disabled cell and edit its contents. I am Cc''ing Jeroen on this to see if this can be fixed in FOX 1.6. Don''t know if he has fixed this in FOX 1.7 yet.> I''d also like to know if there is any way to set the background of > my uneditable cell gray. I saw the stipple variable which I set but > FXTable renders the stipple color as bright red. That is the > opposite of the grey color I''d like to make it to indicate my value > is uneditable.Yep, the default stipple color for FXTable is red (not sure why that was the choice). How does it look for you if you use the STIPPLE_GREY pattern and set the table''s stipple color to, say, black? table.stippleColor = "black" table.getItem(3, 4).stipple = STIPPLE_GREY Let''s see if that works any better for you. Hope this helps, Lyle -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/fxruby-users/attachments/20070818/fb17162a/attachment-0001.html
I''d like to be able to set an individual FXTable cell to uneditable. I tried using disableItem() but this didn''t seem to have any affect on whether you could select or change things. - Jason You''re right; this looks like a bug in FOX. FOX doesn''t respond to keypress events or single mouse button clicks on disabled table cells, but it does allow you to (among other things) double-click in a disabled cell and edit its contents. I am Cc''ing Jeroen on this to see if this can be fixed in FOX 1.6. Don''t know if he has fixed this in FOX 1.7 yet. - Lyle Actually it looks like it is responding to keypress events and double clicks. Ideally what I''d like is to be able to prevent all user input on a disabled (not editable) cell. - Jason Yep, the default stipple color for FXTable is red (not sure why that was the choice). How does it look for you if you use the STIPPLE_GRAY pattern and set the table''s stipple color to, say, black? table.stippleColor = "black" table.getItem(3, 4).stipple = STIPPLE_GRAY - Lyle This worked, thanks. However, stipple isn''t the nicest looking thing to apply to a table cell. It makes the text barely readable. What I was really looking for is a way to change the background color to gray similar to the table row and column headers. It didn''t look like there was an option to set an individual cell a particular background color. - Jason This message and any enclosures are intended only for the addressee. Please notify the sender by email if you are not the intended recipient. If you are not the intended recipient, you may not use, copy, disclose, or distribute this message or its contents or enclosures to any other person and any such actions may be unlawful. Ball reserves the right to monitor and review all messages and enclosures sent to or from this email address.
On Aug 20, 2007, at 9:42 AM, Thomas, Jason M ((Software)) wrote:> This worked, thanks. However, stipple isn''t the nicest looking > thing to > apply to a table cell. It makes the text barely readable. What I was > really looking for is a way to change the background color to gray > similar to the table row and column headers. It didn''t look like there > was an option to set an individual cell a particular background color.No, there isn''t an easy way to set the individual cells'' background colors.