<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://communities.bentley.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>[CONNECT C++] mdlWindow_globalPointToScreen(). Is there an C++ API equivalent?</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/174401/connect-c-mdlwindow_globalpointtoscreen-is-there-an-c-api-equivalent</link><description>Is there a method on a DgnButtonEvent to accomplish the same thing? 
 
 
 Bruce</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: [CONNECT C++] mdlWindow_globalPointToScreen(). Is there an C++ API equivalent?</title><link>https://communities.bentley.com/thread/504230?ContentTypeID=1</link><pubDate>Mon, 04 Feb 2019 12:51:15 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:6d61e1bf-42bb-4d86-b6c7-79d972e10a9c</guid><dc:creator>Bruce Reeves SRNS</dc:creator><description>&lt;p&gt;That is what I&amp;#39;m currently doing. You have confirmed my suspicions:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="442403" url="~/products/programming/microstation_programming/f/microstation-programming---forum/174401/connect-c-mdlwindow_globalpointtoscreen-is-there-an-c-api-equivalent/503919"]I don&amp;#39;t think there is equivalent C++ method in DgnButtonEvent or other class[/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks !!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [CONNECT C++] mdlWindow_globalPointToScreen(). Is there an C++ API equivalent?</title><link>https://communities.bentley.com/thread/503919?ContentTypeID=1</link><pubDate>Fri, 01 Feb 2019 03:06:12 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:a46a608f-e6b1-4b5b-ac2c-1f07ead5f069</guid><dc:creator>dorlig na</dc:creator><description>&lt;p&gt;// note: you can use the following corrected code piece to get pure windows screen point for the button event.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // both pointInMDLclient and globlePoint are in a window coordinates which is relative to a window rect.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // as you said, Viewport::ViewToScreen don&amp;#39;t return screen point in fact.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // please focus on the using of mdlWindow_globalPointConversionIncrease which is the key point here.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // other changes just rename the variable names to make it&amp;#39;s meaning more accurate.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // ev.GetViewPoint returns the mouse position of client area of the view window,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Viewport::ViewToScreen returns the point which is relative to left-up corner of a special client window which&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // is the gray area to contain the 8 view windows. The special client window is like the Win32&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // MDClient for multi-document program.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DPoint3d&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pointInMDLclient3D = { 0 };&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ev.GetViewport ()-&amp;gt;ViewToScreen (&amp;amp;pointInMDLclient3D, ev.GetViewPoint (), 1);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Point2d&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pointInMDLclient = { (int)pointInMDLclient3D.x, (int)pointInMDLclient3D.y };&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // in CE, because there is ribbon bar, we must convert the pointInMDLclient to global point which is relative to&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // the left-up corner of the main frame window.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Point2d&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; globlePoint = { 0 };&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MSDialogP viewWindow = mdlWindow_viewWindowGet (ev.GetViewNum ());&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (mdlWindow_isGlobalPointConversionRequired (viewWindow-&amp;gt;GetScreenNumber ()))&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mdlWindow_globalPointConversionIncrease (&amp;amp;globlePoint, viewWindow, &amp;amp;pointInMDLclient);&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; globlePoint = pointInMDLclient;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // now use mdlWindow_globalPointToScreen to convert the global point to screen point which is pure windows concept&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // but not the Microstation concept, and I don&amp;#39;t think there is equivalent C++ method in DgnButtonEvent or other class&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Point2d&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; screenPt2d = { 0 };&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mdlWindow_globalPointToScreen (&amp;amp;screenPt2d, mdlWindow_viewWindowGet (ev.GetViewNum ()), &amp;amp;globlePoint);&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [CONNECT C++] mdlWindow_globalPointToScreen(). Is there an C++ API equivalent?</title><link>https://communities.bentley.com/thread/503583?ContentTypeID=1</link><pubDate>Wed, 30 Jan 2019 12:19:42 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:3111c4e8-d087-4fed-914d-b32eb47a33d7</guid><dc:creator>Bruce Reeves SRNS</dc:creator><description>[quote userid="2269" url="~/products/programming/microstation_programming/f/microstation-programming---forum/174401/connect-c-mdlwindow_globalpointtoscreen-is-there-an-c-api-equivalent/503465"]How about &lt;code&gt;ViewPort::ViewToScreen()&lt;/code&gt;?[/quote]
&lt;p&gt;That&amp;#39;s the first call I make, which converts the cursor location from DGN units to a &amp;quot;window&amp;quot; location. The second call (&amp;nbsp; mdlWindow_globalPointToScreen() ) coverts that &amp;quot;window&amp;quot; location to a &amp;quot;screen&amp;quot; location (I have three monitors), so I think the MDL call return the position relative to the collection/arrangement of monitors, not the &amp;quot;window&amp;quot;. I&amp;#39;m wondering if the API has a method to do that so I can skip calling the MDL function. Ultimately, I&amp;#39;m using a WIndows API function, so it needs the position in what I&amp;#39;m calling &amp;quot;screen&amp;quot; coordinates (which is not the definition of &amp;quot;screen&amp;quot; that MicroStation is using).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;It would be helpful to have a summary of the concept of&amp;nbsp; &amp;quot;location&amp;quot; types used by MicroStation (Screen, Global, NPT?, etc) and how they relate to the concept of Windows positioning.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Bruce&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [CONNECT C++] mdlWindow_globalPointToScreen(). Is there an C++ API equivalent?</title><link>https://communities.bentley.com/thread/503465?ContentTypeID=1</link><pubDate>Tue, 29 Jan 2019 22:01:20 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:a438bb78-dac5-4ec8-87a6-c6b0ef765b09</guid><dc:creator>Jon Summers</dc:creator><description>&lt;p&gt;How about &lt;code&gt;ViewPort::ViewToScreen()&lt;/code&gt;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>