Home » U++ Library support » U++ Widgets - General questions or Mixed problems » Problem with DropList and FlatSpin
|
Re: Problem with DropList and FlatSpin [message #14190 is a reply to message #14189] |
Mon, 18 February 2008 22:25 |
Oblivion
Messages: 1094 Registered: August 2007
|
Senior Contributor |
|
|
Quote: |
The list will not open when in the parentwindow a Ctrl with a FlatSpin in the Paint event is used.
|
Why do you want to use a Flatspin in the Paint() method anyway?
When you Add() the flatspin to the parent Ctrl, it will be added to the Child Ctrl list. So, it's paint() method is already invoked and the flatspin gets refreshed when you manipulate its values (e.g. text).
In DateTimeCtrl.cpp it is defined as:
void FlatSpin::SetText(const String& s)
{
text = s;
tsz = GetTextSize(text, font);
Refresh();
}
That's probably why it won't work. It already gets refreshed when you set the thext of SpinCtrl.
Instead you should define it as,
MyCal::MyCal()
{
Add(spin_year);
String year = AsString(2008);
spin_year.SetText(year);
};
This will solve your problem. And you can use "spin_year.WhenAction = blabla()" or other custom Callbacks to handle it's events.
Github page: https://github.com/ismail-yilmaz
upp-components: https://github.com/ismail-yilmaz/upp-components
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
[Updated on: Mon, 18 February 2008 22:40] Report message to a moderator
|
|
|
Re: Problem with DropList and FlatSpin [message #14193 is a reply to message #14190] |
Tue, 19 February 2008 07:37 |
Alex
Messages: 18 Registered: October 2007 Location: Germany
|
Promising Member |
|
|
You are right. I will rebuild this.
I have copied some pieces of code from the Calendar in DateTimeCtrl of an older version. In the current version is this also removed from the Paint-Event.
Thank you, Alex
|
|
|
Goto Forum:
Current Time: Sat Jun 08 07:41:56 CEST 2024
Total time taken to generate the page: 0.01208 seconds
|