This Question is Answered

14 "helpful" answers available (3 pts)
6 Replies Last post: May 14, 2008 10:54 AM by friedger

How to change the default selection color for records in RecordGrid.

May 14, 2008 2:35 AM

Click to view mannusanghi's profile Level 1 mannusanghi 16 posts since
Feb 27, 2008
Hi...

I want to change the default selection color for records in RecordGrid.
As default color is blue when select any records in RecordGrid.I think it is internal bydefault setting for Record Grid selection that gives the blue color.
So, my requirement is to change this blue color to other color. Is there any setting in IDE or through code.
Please help me...

Regards,
Akash Jain
Click to view Kamal's profile Curl Kamal 46 posts since
Oct 17, 2007
1. Re: How to change the default selection color for records in RecordGrid. May 14, 2008 5:33 AM
The Selection color comes from your system preferences. I do not think that there is a published public API to do that. However you can use the following code to change these preference. But this is going to effect all the Gui objects in the process.




{do 
    set {prefs}["selected-ui-background"] = "pink"
    set {prefs}["selected-ui-color"] = "lime" 
}



Message was edited by: Kamal
Click to view friedger's profile MVP friedger 87 posts since
Jan 13, 2008
2. Re: How to change the default selection color for records in RecordGrid. May 14, 2008 6:19 AM
in response to: Kamal

{prefs}! That is an interesting feature. The debugger shows what else is available in the preferences.

Friedger

Click to view mannusanghi's profile Level 1 mannusanghi 16 posts since
Feb 27, 2008
3. Re: How to change the default selection color for records in RecordGrid. May 14, 2008 6:25 AM
in response to: Kamal
Hi...
Thanks Kamal!!
I did not know this thing to hack the system preferences and it helped me to achieve my problem.
but I tried to get more preferences informations like above from the curl documentation but i did not found anything like the keyword prefs .
Can you please give me more pointer on this ?

Regards,
Akash Jain


Oh!! i found all this preferences by the debugger.
Thanks Friedger For important and Useful Reply :)
Click to view fukuta's profile Level 4 fukuta 47 posts since
Oct 17, 2007
4. Re: How to change the default selection color for records in RecordGrid. May 14, 2008 6:42 AM
in response to: mannusanghi
{prefs} is probably for internal use only.
So we cannot find about it from the documents, but some examples of use are found in the open source of COM.CURL.OPEN.GUI.CONTROLS.
Click to view Kamal's profile Curl Kamal 46 posts since
Oct 17, 2007
5. Re: How to change the default selection color for records in RecordGrid. May 14, 2008 7:09 AM
in response to: fukuta
"prefs" is in gui-toolkit base. It maintains all the system preferences and if there is not one, it uses some defaults. It is not a good idea to change things in it. Curl should probably have non local options for selection color and selection background. By the way, if you set preferences in prefs and then change your system preferences for selection, you will notice that your set color is changed back to the system preferences. So probably you will have to observe the "prefs" object and take appropriate actions to set the color back to the one that your application wants. However, doing the last step may not be necessary for your application as the user actually went and changed the system preferences.
Click to view friedger's profile MVP friedger 87 posts since
Jan 13, 2008
6. Re: How to change the default selection color for records in RecordGrid. May 14, 2008 10:54 AM
in response to: Kamal

I vote for the new option for selection and menu highlight.

Friedger