Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » DropGrid improvement proposals
DropGrid improvement proposals [message #31879] Mon, 04 April 2011 11:34 Go to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Hello Daniel

I like DropGrid control. To make it a little more standard I propose you a couple of changes in DropGrid.cpp:

- Now if control is not editable, it appears with white background as editable
To fix it the change would be:

void DropGrid::Paint(Draw& w)
...
Color bg = !IsEnabled() || !IsEditable() ? ... // Added || !IsEditable()

- When doing a SetData(Null) or just clearing the value in ClearValue() or DoClearValue(), SetFocus() is called Smile.
As in my program a WhenAction function in an EditString is calling droplist.SetData(Null), the EditString loses the focus Smile. However when inserting non Null data, focus is not lost. Smile
To fix it just remove SetFocus() in both methods.


I would like to get a derived DropGrid control but editable at the same time that drop list is shown. Where in the code drop list is cleared when control loses the focus?


Best regards
Iñaki
Re: DropGrid improvement proposals [message #31880 is a reply to message #31879] Mon, 04 April 2011 12:49 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

koldo wrote on Mon, 04 April 2011 05:34

Hello Daniel

I like DropGrid control. To make it a little more standard I propose you a couple of changes in DropGrid.cpp:

- Now if control is not editable, it appears with white background as editable
To fix it the change would be:

void DropGrid::Paint(Draw& w)
...
Color bg = !IsEnabled() || !IsEditable() ? ... // Added || !IsEditable()

- When doing a SetData(Null) or just clearing the value in ClearValue() or DoClearValue(), SetFocus() is called Smile.
As in my program a WhenAction function in an EditString is calling droplist.SetData(Null), the EditString loses the focus Smile. However when inserting non Null data, focus is not lost. Smile
To fix it just remove SetFocus() in both methods.


I would like to get a derived DropGrid control but editable at the same time that drop list is shown. Where in the code drop list is cleared when control loses the focus?

You're right. Calling SetFocus is a mistake and this should be fixed. I only wonder why I did this Smile. I'll check it in the evening.
Re: DropGrid improvement proposals [message #31881 is a reply to message #31880] Mon, 04 April 2011 13:14 Go to previous message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Hello Daniel

Great!

In addition, by default null_action var is set to true, so doing a SetData(Null) forces a call to WhenAction.

As in U++ WhenAction is used AFAIK only when there is direct user interaction (mouse or keyboard), could you check it? Smile


Best regards
Iñaki
Previous Topic: GridCtrl questions
Next Topic: FIX: ArrayCtrl to support Style
Goto Forum:
  


Current Time: Thu Mar 28 17:26:22 CET 2024

Total time taken to generate the page: 0.01034 seconds