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 » How to get and set window placement information?
Re: How to get and set window placement information? [message #14659 is a reply to message #14658] Thu, 06 March 2008 12:30 Go to previous messageGo to previous message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
I see, I'd never noticed that before. It seems that Upp doesn't retain this information, rather it is done by the operating system.

But you can add the functionality easily enough:
class CtrlLibTest : public TopWindow {
public:
    typedef CtrlLibTest CLASSNAME;
    Rect normal;
    
    CtrlLibTest()
    {
        SetRect(0, 0, 308, 344);
        CenterScreen();
        normal = GetRect();
       	Sizeable().MaximizeBox(true).MinimizeBox(true);
       
       	FileIn in(GetDataFile("window.pos"));
       	if (in.IsOpen()) {
       		in % normal;
       		SetRect(normal);
       		SerializePlacement(in, true);
       	}
    }

    virtual void Layout() {
     	if (!IsMaximized() && !IsMinimized() && IsShown())
     		normal = GetRect();
    }

    virtual void Close()
    {
       	FileOut out(GetDataFile("window.pos"));
       	if (out.IsOpen()) {
       		out % normal;
       		SerializePlacement(out);   
       	}
       	TopWindow::Close();     
    }
};

[Updated on: Thu, 06 March 2008 12:31]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Toggling between FullScreen and not
Next Topic: Transparent TopWindow
Goto Forum:
  


Current Time: Wed May 15 02:52:22 CEST 2024

Total time taken to generate the page: 0.25278 seconds