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 » U++ Widgets - General questions or Mixed problems » Changing Editbox background color (EditString)
Changing Editbox background color (EditString) [message #15108] Tue, 01 April 2008 12:22 Go to next message
alex100 is currently offline  alex100
Messages: 118
Registered: November 2007
Experienced Member
Hi,
I would like to change bk color of a EditString (edit) when the change event takes place. Is there any other way to do this appart from rewriting the Paint event?

Thank you,
Alex
Re: Changing Editbox background color (EditString) [message #15109 is a reply to message #15108] Tue, 01 April 2008 12:46 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Something like:
EditField::Style editstyle; // Member variable of owner window

void OnEditChange()
{
    editstyle = EditField::StyleDefault();
    editstyle.paper = SLtBlue();
    
    editfield.SetStyle(editstyle);
}

[Updated on: Tue, 01 April 2008 12:55]

Report message to a moderator

Re: Changing Editbox background color (EditString) [message #15116 is a reply to message #15109] Tue, 01 April 2008 16:15 Go to previous messageGo to next message
alex100 is currently offline  alex100
Messages: 118
Registered: November 2007
Experienced Member
Many thanks!

By the way, what is the name of the OnChange event (CALLBACK) of the EditString

Edit1.change <<= THISBACK(OnChange);

change does not exist.
Is there any doc, help or trick to know the name of all events a specific control supports?

Alex
Re: Changing Editbox background color (EditString) [message #15117 is a reply to message #15116] Tue, 01 April 2008 16:27 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
1. type the name of the ctrl then '.When'. As almost all callbacks are of the form WhenSomething this gives a list of the callbacks.
2. Check the source. Press Ctrl-Q, type EditField, then click on one of the options at the bottom of the screen to go to the header file.

In this case the action you want is default ctrl callback WhenAction, so:
editfield <<= THISBACK(OnChange);

or
editfield.WhenAction = THISBACK(OnChange);
will work.

James

[Updated on: Tue, 01 April 2008 16:28]

Report message to a moderator

Re: Changing Editbox background color (EditString) [message #15118 is a reply to message #15117] Tue, 01 April 2008 16:33 Go to previous messageGo to next message
alex100 is currently offline  alex100
Messages: 118
Registered: November 2007
Experienced Member
Understood!
Thank you so much!

NC
Re: Changing Editbox background color (EditString) [message #15119 is a reply to message #15118] Tue, 01 April 2008 17:05 Go to previous messageGo to next message
alex100 is currently offline  alex100
Messages: 118
Registered: November 2007
Experienced Member
Does EditField has a Style member? I cant see it Sad

Alex
Re: Changing Editbox background color (EditString) [message #15121 is a reply to message #15119] Tue, 01 April 2008 18:13 Go to previous message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
I'm very sure it does since I was the one who added it Smile. Are you using an older version of Upp? It's there in 2008.1, not sure about 2007 version.

[Updated on: Tue, 01 April 2008 18:14]

Report message to a moderator

Previous Topic: Linux RectTracker problem
Next Topic: thread, virtual class and exception
Goto Forum:
  


Current Time: Mon Apr 29 16:21:40 CEST 2024

Total time taken to generate the page: 0.02723 seconds