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 » U++ Widgets - General questions or Mixed problems » changing Ctr pos, react on mouse evnt
Re: changing Ctr pos, react on mouse evnt [message #3381 is a reply to message #3376] Mon, 22 May 2006 17:37 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14267
Registered: November 2005
Ultimate Member
qwerty wrote on Mon, 22 May 2006 08:02

greetings

how to get position of some Ctrl on TopWindow, compare it with mouse pointer position a do some stuff...

Specificaly something like this:

inside TopWindow
virtual void LeftDown(Point pos, dword flags) {
    if(pos.x >= someCtrl.GetPos().x.GetA() && pos.x <= someCtrl.GetPos().x.GetA() &&
       pos.y >= someCtrl.GetPos().y.GetA() && pos.y <= someCtrl.GetPos().y.GetA()) {

                PromptOK("clicked inside");
    }
}


...it's wrong, but how?




Actually, is these cases it is often best to "go absolute".

There is "GetScreenRect" or "GetScreenView" methods that return position is screen coordinates and also GetMousePos funtions, that returns absolute mouse position.

Mirek
 
Read Message
Read Message
Read Message
Previous Topic: how to add runtime StaticText and hook mouse events for it
Next Topic: ak math funcs on Ctrls
Goto Forum:
  


Current Time: Thu Aug 07 07:14:48 CEST 2025

Total time taken to generate the page: 0.04832 seconds