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 » Community » Newbie corner » 2 questions on ArrayCtrl and tray
icon5.gif  2 questions on ArrayCtrl and tray [message #33430] Fri, 05 August 2011 07:35 Go to next message
Assargadon is currently offline  Assargadon
Messages: 11
Registered: August 2011
Location: Russia, Vladimir
Promising Member

Hello.
I have started study u++. And faced with 2 problems.
1. When I sorted column in ArrayCtrl pressing heading - numbers are sorted by increase/decrease. But when I sorted russian letters - its sorted not by an order.Have solved a problem or not?
index.php?t=getfile&id=3405&private=0

2. For closing of my program I cause function
void PB::Exit() //при выходе
{	
	if(PromptOKCancel("Выйти?"))
	{
		SaveXML();	
		Close();
	}
}

But when I cause this function from tray:
void PB::trayMenu(Bar& bar) //right click
{
	bar.Add(t_("Показать"), THISBACK(Maximize));
	bar.Add(t_("Скрыть"), THISBACK(Minimize));
	bar.Add(t_("О программе..."), THISBACK(About));
	bar.Add(t_("Выход"), THISBACK(Exit));
}

The program keeps the data
SaveXML();
, but isn't closed
Close();

When I close the form the program is closed correctly.
I don't understand in what a difference
P.S. Sorry for my English.
  • Attachment: sorted.jpg
    (Size: 3.27KB, Downloaded 651 times)

[Updated on: Fri, 05 August 2011 07:45]

Report message to a moderator

Re: 2 questions on ArrayCtrl and tray [message #33431 is a reply to message #33430] Fri, 05 August 2011 07:51 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

This problem with russian letters not solved yet Crying or Very Sad .

Засада словом.


SergeyNikitin<U++>( linux, wine )
{
В В В В under( Ubuntu || Debian || Raspbian );
}
Re: 2 questions on ArrayCtrl and tray [message #33432 is a reply to message #33431] Fri, 05 August 2011 08:31 Go to previous messageGo to next message
Assargadon is currently offline  Assargadon
Messages: 11
Registered: August 2011
Location: Russia, Vladimir
Promising Member

sergeynikitin wrote on Fri, 05 August 2011 09:51

This problem with russian letters not solved yet Crying or Very Sad .

Засада словом.

Да, жалко.
Re: 2 questions on ArrayCtrl and tray [message #33437 is a reply to message #33432] Fri, 05 August 2011 13:12 Go to previous messageGo to next message
nlneilson is currently offline  nlneilson
Messages: 644
Registered: January 2010
Location: U.S. California. Mojave &...
Contributor
Exiting the app from the tray or by clicking the red X just exits the app.

I had a problem with this as threads were not terminated and ports/receivers were not closed.

Here are a few lines of code that I used:
		while(!inF.IsEof()){
			if(endApp){if(inF) inF.Close(); break;}



void endX(){
	endApp = true;	
	snd("clear", 0);	
	Sleep(2000);
}	

GUI_APP_MAIN{
	TrackReplay().Run();
	endX();
}


The bool endapp was checked in each thread and closed the open file and then shutdown the thread with "break".

Working with GPS receivers was a real pain if the receivers and the ports were not closed properly.

Re: 2 questions on ArrayCtrl and tray [message #33478 is a reply to message #33437] Fri, 12 August 2011 07:30 Go to previous messageGo to next message
Assargadon is currently offline  Assargadon
Messages: 11
Registered: August 2011
Location: Russia, Vladimir
Promising Member

Hello, nlneilson.
But I don't use threads.Or I don't understand that you mean?
Is it necessary for me to close the basic threads of the program a separate command?

[Updated on: Fri, 12 August 2011 07:30]

Report message to a moderator

Re: 2 questions on ArrayCtrl and tray [message #33479 is a reply to message #33478] Fri, 12 August 2011 08:40 Go to previous messageGo to next message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

Hi!

I would swear that I answered your second question a while ago, but it seems like I never sent it Rolling Eyes

Anyway: The problem is that you call Close() in your Exit() method which just closes a window, while you should call Break() which closes the main execution loop which causes the app to exit. That's it, it is really simple Wink As for the threads, don't worry about them if your application is singlethreaded.

You might also want to look at the GUI tutorial, example 7 clearly shows what you're trying to achieve Wink

Best regards,
Honza
Re: 2 questions on ArrayCtrl and tray [message #33494 is a reply to message #33479] Sat, 13 August 2011 08:27 Go to previous message
Assargadon is currently offline  Assargadon
Messages: 11
Registered: August 2011
Location: Russia, Vladimir
Promising Member

Thank you very much, Honza.
It likely was a deja vu Smile
And as usual all was covered in nuances))
Previous Topic: Data Transfer
Next Topic: How do i create tabs without using .lay??
Goto Forum:
  


Current Time: Mon Apr 29 00:40:56 CEST 2024

Total time taken to generate the page: 0.04100 seconds