forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

%gr works differently in child window

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Thu Dec 08, 2022 4:34 am    Post subject: %gr works differently in child window Reply with quote

I have a test program at the link below that operates differently in a normal %ww window versus a %ch child window.

This little program is designed to test the capabilities of creating a %gr drawing then manipulate it in its enclosing window. The "X" position is to remain fixed, while the "Y" position can be changed.

For testing purposes, and mouse motion on the graphic with a left button down should cause the graphic to move up or down by one pixel, regardless of the actual range of motion.

The %gr item inside the child window responds appropriately, while the %gr inside the main window does not. In the latter case, it will move in both X and Y.

It would appear that the position of the graphic in the main window is returned relative to the full window, yet setting the location of the %gr is made relative to the client portion of the window. Thus, selecting the main window %gr with the mouse and moving it up or down by 1 pixel will cause the object to move down and to the right.

NOTE: On my system, as I move the main window graphic, there appears above the graphic a white space. It can be seen when the graphic moves across the child window (grey) area. I do not see a similar effect when the child %gr is moved.

Link to DropBox: https://www.dropbox.com/s/cmpf7gzi8e9vg6j/BoreHoleWindow.zip?dl=0
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7916
Location: Salford, UK

PostPosted: Thu Dec 08, 2022 9:18 am    Post subject: Reply with quote

Bill

For a child window GET_WINDOW_LOCATION@ gets the location relative to the parent using two calls to the Windows API GetWindowRect.

MOVE_WINDOW@ simply calls SetWindowPos using the given hWnd and (x,y).

So when using GET_WINDOW_LOCATION@ with MOVE_WINDOW@ in your program it is necessary to allow for this.
Back to top
View user's profile Send private message AIM Address
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Thu Dec 08, 2022 2:39 pm    Post subject: Reply with quote

Thanks, Paul.
Back to top
View user's profile Send private message Visit poster's website
wahorger



Joined: 13 Oct 2014
Posts: 1217
Location: Morrison, CO, USA

PostPosted: Thu Dec 08, 2022 3:44 pm    Post subject: Reply with quote

Looks like %gr won't work for my particular application (dimension limitations) anyway.

%gr has a lot of nice features to simplify the interfaces/callbacks, though. I'll remember it for later use.

Thankfully, on to the next option!!
Bill
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group