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 do you use PopUp
Re: How do you use PopUp [message #2959 is a reply to message #2951] Mon, 01 May 2006 14:18 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13976
Registered: November 2005
Ultimate Member
    MyAppWindow() {
          p.x = p.y = 0;
        Add(c1.SetPos(c1.PosLeft(5, 15), c1.PosTop(20, 5)));


You cannot have your PopUp at the same time to be a child.

This works (more or less, just your code with that Add removed):

#include <CtrlLib/CtrlLib.h>

struct MyAppWindow : TopWindow {
	typedef MyAppWindow CLASSNAME;
    Point  p;
    String text;
    //StaticRect s1;
    StaticRect c1;
    Button button;
    virtual void LeftDown(Point pos, dword flags) {
		c1.SetRect(20,30,80,50);
		c1.Add(button.SetLabel("Button").LeftPosZ(10, 64).TopPosZ(10, 24));
        c1.PopUp(this,false,true,false,true);
        p = pos;
        Refresh();
    }

    virtual void MouseMove(Point pos, dword flags) {
        text = Format("[%d:%d]", pos.x, pos.y);
        Refresh();
    }

    virtual void Paint(Draw& w) {
        w.DrawRect(GetSize(), SWhite);
        w.DrawText(p.x, p.y, text, Arial(20), Magenta);
    }

	void finish()
	{
	    c1.Close();
	}
	
	MyAppWindow() {
		p.x = p.y = 0;
		button <<= THISBACK(finish);
    }
};

GUI_APP_MAIN
{
	MyAppWindow w;
	w.Run();
}


Mirek

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: One Main TopWindow and several others TopWindows, how? [SOLVED...]
Next Topic: Splash Screen
Goto Forum:
  


Current Time: Sat May 11 20:55:15 CEST 2024

Total time taken to generate the page: 0.02183 seconds