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 » Developing U++ » UppHub » XMLMenu
Re: XMLMenu [message #56985 is a reply to message #56983] Fri, 07 May 2021 14:27 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
This works in Win32, but not yet in Gtk/Macos:

struct DragTest : TopWindow {
	Rect r;
	bool dragging = false;
	void Layout() override {
		r = GetRect();
	};

	void Paint(Draw& w) override {
		w.DrawRect(GetSize(), White());
		w.DrawText(100, 100, AsString(r));
		if(dragging)
			w.DrawText(100, 130, "Dragging");
	}
	
	TimeCallback tm;
	
	DragTest() {
		tm.Set(-10, [=] {
			Rect rr = GetRect();
			if(r != rr) {
				r = rr;
				if(GetMouseLeft())
					dragging = true;
				Refresh();
			}
			if(!GetMouseLeft()) {
				if(dragging) {
					dragging = false;
					Refresh();
				}
			}
		});
	}
};


But the problem is only that GetMouseLeft is not properly updated for timer proc; I think I can fix that and actually SHOULD fix that anyway.

I believe that above functionality is all that you need.

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: ScatterCtrl & Mac
Next Topic: Const in ScatterDraw
Goto Forum:
  


Current Time: Thu Apr 18 18:19:56 CEST 2024

Total time taken to generate the page: 0.01660 seconds