Get DocViewsArea rectangle/coordinates inside its MainView/MainFrame (for Drag'n'Drop implementation) SOLVED
Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan
Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.
When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
-
- User
- Posts: 1370
- Joined: Thu Sep 05, 2019 12:35 pm
Get DocViewsArea rectangle/coordinates inside its MainView/MainFrame (for Drag'n'Drop implementation)
Hi support,
I'm implementing my Drag&Drop functionality for the pxv_Control.
Is there a way to get the coordinates / rectangle of (IPXV_Control.Frame.View.) DocViewsArea ?
Why: when accepting files (my OnDragOver event) I want to accept only if the mouse cursor is above the DocViewsArea and not above CommandPanes (or alike) of the MainView.
-žarko
I'm implementing my Drag&Drop functionality for the pxv_Control.
Is there a way to get the coordinates / rectangle of (IPXV_Control.Frame.View.) DocViewsArea ?
Why: when accepting files (my OnDragOver event) I want to accept only if the mouse cursor is above the DocViewsArea and not above CommandPanes (or alike) of the MainView.
-žarko
-
- User
- Posts: 1370
- Joined: Thu Sep 05, 2019 12:35 pm
Re: Get DocViewsArea rectangle/coordinates inside its MainView/MainFrame (for Drag'n'Drop implementation)
For info:
IUIX_Obj has ClientRectToScreen which I thought I could use.
However,
After the above mvRectScreen is the same (Top, Left, Bottom, Right) as dvaRectScreen.
I would expect dvaRectScreen is "inside" mvRectScreen as there are some CommanPanes above the DocViewsArea within the MainView - so at least the Top of dvaRectScreen should be > mvRectScreen.Top,
...
Trying with pxv.Frame.Obj ... and yes, we have an offset .. so case closed (kind of)!
However, according to SDK help for IPXV_MainFrame MainFrame and MainView should have the same (transferred to screen) coordinates ?!
-žarko
IUIX_Obj has ClientRectToScreen which I thought I could use.
However,
Code: Select all
mvObj, dcvObj :IUIX_Obj;
stClient, mvRectScreen, dvaRectScreen : tagRect;
... //pxv is pxv_Control
mvObj := pxv.Frame.View.Obj;
dcvObj := pxv.Frame.View.DocViewsArea.Obj;
stClient := mvObj.ClientRect;
mvObj.ClientRectToScreen(stClient, mvRectScreen);
stClient := dcvObj.ClientRect;
dcvObj.ClientRectToScreen(stClient, dvaRectScreen);
I would expect dvaRectScreen is "inside" mvRectScreen as there are some CommanPanes above the DocViewsArea within the MainView - so at least the Top of dvaRectScreen should be > mvRectScreen.Top,
...
Trying with pxv.Frame.Obj ... and yes, we have an offset .. so case closed (kind of)!
However, according to SDK help for IPXV_MainFrame MainFrame and MainView should have the same (transferred to screen) coordinates ?!
-žarko
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: Get DocViewsArea rectangle/coordinates inside its MainView/MainFrame (for Drag'n'Drop implementation)
Hello žarko,
That illustration is for basic understanding purposes - the Frame/View/DocViewsArea coordinates would be the same if no command bars are shown. If you have shown them then here's what you will get (for example): Cheers,
Alex
That illustration is for basic understanding purposes - the Frame/View/DocViewsArea coordinates would be the same if no command bars are shown. If you have shown them then here's what you will get (for example): Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 1370
- Joined: Thu Sep 05, 2019 12:35 pm
Re: Get DocViewsArea rectangle/coordinates inside its MainView/MainFrame (for Drag'n'Drop implementation)
Hi Alex,
Thanks. Can you double check this
I have commandPane visible.
Here's the code:
And here's the result:
-žarko
Thanks. Can you double check this
I have commandPane visible.
Here's the code:
Code: Select all
var
mf : IPXV_MainFrame;
mv : IPXV_MainView;
dva : IPXV_DocumentViewsArea;
cr, sr : tagRect;
begin
mf := PDFXHelper.Inst.MainFrm[0];
mv := mf.View;
dva := mv.DocViewsArea;
cr := mf.Obj.ClientRect;
mf.Obj.ClientRectToScreen(cr, sr);
memog.Lines.Add(Format('MainFrame.Top:%d', [sr.top]));
cr := mv.Obj.ClientRect;
mv.Obj.ClientRectToScreen(cr, sr);
memog.Lines.Add(Format('MainView.Top:%d', [sr.top]));
cr := dva.Obj.ClientRect;
dva.Obj.ClientRectToScreen(cr, sr);
memog.Lines.Add(Format('DocViewsArea.Top:%d', [sr.top]));
end;
And here's the result:
Note that MainView and DocViewssArea have the same Top value.MainFrame.Top:285
MainView.Top:345
DocViewsArea.Top:345
-žarko
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: Get DocViewsArea rectangle/coordinates inside its MainView/MainFrame (for Drag'n'Drop implementation)
Hello žarko,
Yup that is the same result that i'm getting so it is correct.
Cheers,
Alex
Yup that is the same result that i'm getting so it is correct.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 1370
- Joined: Thu Sep 05, 2019 12:35 pm
Re: Get DocViewsArea rectangle/coordinates inside its MainView/MainFrame (for Drag'n'Drop implementation)
Thanks Alex,
But then this image is not correct: https://sdkhelp.pdf-xchange.com/vi ... nFrame.PNG
Main View is not MainFrame in terms of rectangle.
-ž
But then this image is not correct: https://sdkhelp.pdf-xchange.com/vi ... nFrame.PNG
Main View is not MainFrame in terms of rectangle.
-ž
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: Get DocViewsArea rectangle/coordinates inside its MainView/MainFrame (for Drag'n'Drop implementation) SOLVED
Hello žarko,
In terms of rectangles - no, but in terms of visualization, understanding and structure this can be drawn like so - you are the first dev. who got this deep into our control tweaking, thus nobody even asked about such things before.
Cheers,
Alex
In terms of rectangles - no, but in terms of visualization, understanding and structure this can be drawn like so - you are the first dev. who got this deep into our control tweaking, thus nobody even asked about such things before.
Cheers,
Alex
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
-
- User
- Posts: 1370
- Joined: Thu Sep 05, 2019 12:35 pm
Re: Get DocViewsArea rectangle/coordinates inside its MainView/MainFrame (for Drag'n'Drop implementation)
Hi Alex,
p.s.
I'm actually not tweaking anything yet - only a few custom commands / bars. All the tweaking so far is related to working with multiple pxv_instances ... and slowly we are progressing ...
-ž
Omg! And I'm just starting to (believing that I am able to) control this magnificent and untamed beast of your Editor SDK So expect some real questions coming up ...you are the first dev. who got this deep into our control tweaking, thus nobody even asked about such things before.
p.s.
I'm actually not tweaking anything yet - only a few custom commands / bars. All the tweaking so far is related to working with multiple pxv_instances ... and slowly we are progressing ...
-ž
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
Re: Get DocViewsArea rectangle/coordinates inside its MainView/MainFrame (for Drag'n'Drop implementation)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ