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 » TopWindow&PopUp, TrayIcon » TopWindow not closed on Escape
TopWindow not closed on Escape [message #20009] Mon, 09 February 2009 14:56 Go to next message
idaho is currently offline  idaho
Messages: 6
Registered: April 2007
Location: Frankfurt-am-Main
Promising Member

Hi all,

I have sortof a problem in here. I added a popup window to a project the following way:

WithPopupLayout<TopWindow> popup;
CtrlLayout(popup, t_("Translation"));
popup.entryShow.SetData("Some String"); //an edit control
popup.CenterScreen();
popup.RunAppModal();


The problem is that I don't know how to close the resulting window on escape. For other dialogs, I reimplemented the virtual Key method but how can I do something like this here? Is there another way about it?

Thanks in advance.
Re: TopWindow not closed on Escape [message #20010 is a reply to message #20009] Mon, 09 February 2009 15:41 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

Exactely the same way:
struct TopWindowEsc : TopWindow
{
   virtual bool Key(...)
   {
      if(key == K_ESC)
      {
         Close();
         return true;
      }
   }
}

WithPopupLayout<TopWindowEsc> popup;

[Updated on: Mon, 09 February 2009 15:47]

Report message to a moderator

icon14.gif  Re: TopWindow not closed on Escape [message #20013 is a reply to message #20010] Mon, 09 February 2009 19:46 Go to previous message
idaho is currently offline  idaho
Messages: 6
Registered: April 2007
Location: Frankfurt-am-Main
Promising Member

Thanks a lot! It works! Laughing
Previous Topic: PromptOKCancel error;
Next Topic: Tranparent TopWindow
Goto Forum:
  


Current Time: Thu Mar 28 15:07:04 CET 2024

Total time taken to generate the page: 0.01717 seconds