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 » Problem with DropList and FlatSpin
Problem with DropList and FlatSpin [message #14189] Mon, 18 February 2008 21:28 Go to next message
Alex is currently offline  Alex
Messages: 18
Registered: October 2007
Location: Germany
Promising Member
Hello,
I have a problem with the droplist.

The list will not open when in the parentwindow a Ctrl with a FlatSpin in the Paint event is used.
When I use a the DropList in a childwindow (Dialog), the same error appears.
I can see no connection there, but the error is repeatable.

I have make a program with the minimum requirements as a test case for confirmation.
In the main window, try to open the DropList.
The error can be eliminated by comment out line 16 in MyCal.cpp.

Tested with MSC8 and MSC71.

Hope someone can help.
Regards Alex
  • Attachment: Test.zip
    (Size: 2.22KB, Downloaded 453 times)
Re: Problem with DropList and FlatSpin [message #14190 is a reply to message #14189] Mon, 18 February 2008 22:25 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1091
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.
Wink



[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 Go to previous message
Alex is currently offline  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
Previous Topic: Printing using RichEditWithToolBar and PrinterJob on the same sheep of paper?
Next Topic: Two questions on U++
Goto Forum:
  


Current Time: Fri Mar 29 14:46:29 CET 2024

Total time taken to generate the page: 0.01209 seconds