The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Where to submit suspected bugs?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Frank_H Posted - 04/07/2005 : 10:54:23 AM
Hi!

Could not find a link on the OriginLab web site to submit a (suspected) bug. Where do I do it?
As some of the developers read this forum:
Executing the following code

Layer lay = Project.ActiveLayer();
Page pg = lay.GetPage();
Window win = pg.GetWindow();
RECT rect;
win.GetWindowRect(&rect);
win.MoveWindow(&rect);

shifts the active Window, although the coordinates in rect are not changed. My suspicion is: GetWindow calculates the coordinates with respect to the complete Origin window (including menus and toolbars), while MoveWindow interprets the coordinates with respect of the upper left corner of the workspace, without frame, menus and toolbars.

By the way, I implemented a routine to set the window size with an image inside to an optimal 1:1 pixel ratio. But as the GetWindowRect gives me the outer window dimensions including frame and header, I used LabTalk.page.width/height to get the inner dimensions. It works fine, but is there a OriginC possibility to get the usable window size?

Cheers,
Frank


Origin Version (Select Help-->About Origin): 7.5, SR5
Operating System:Win XP
2   L A T E S T    R E P L I E S    (Newest First)
Hideo Fujii Posted - 04/11/2005 : 3:31:19 PM
Hi Frank,

> Could not find a link on the OriginLab web site to
> submit a (suspected) bug. Where do I do it?

Please report a bug to:
http://www.originlab.com/www/company/qform.aspx?s=1&
in category of Origin Technical Support (or Product Suggestions/Feature Request)

--Hideo Fujii
OriginLab

Edited by - Hideo Fujii on 04/11/2005 3:31:47 PM
eparent Posted - 04/08/2005 : 11:16:12 AM
Hello Frank,

The GetWindowRect method will get a rectangle containing screen coordinates. The MoveWindow method expects a rectangle with coordinates relative to the parent window.

The following code snippet will show you how to convert coordinates. The code is similar to your code but the window will not move as you expected to see with your code.


// Get rectangle for active child window.
Page pg = Project.Pages();
Window winChild = pg.GetWindow();
RECT rectChild;
winChild.GetWindowRect(&rectChild);

// Get parent window of active page.
Window winParent = winChild.GetParent();

// Convert child's screen coordinates to coordinates
// relative to parent window.
winParent.ScreenToClient(&rectChild);

// Move child window.
winChild.MoveWindow(&rectChild);


You are correct. The GetWindowRect gets the rectangle for the entire window. This includes borders, caption, menu, etc. If you want just the area used for displaying data then you can call the GetClientRect method. Comparing the rectangles returned by GetClientRect and GetWindowRect will allow you to determine the size of a window's borders. You will also find the ClientToScreen method useful too.


Edited by - eparent on 04/08/2005 11:17:45 AM

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000