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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Message box and window locations
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

kmcelroy

USA
13 Posts

Posted - 03/07/2006 :  11:25:48 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7SR4
Operating System: XP

Is there any way to control where the message box pops up? What about controlling where a graph window is located?

I am plotting data, asking the user a question, then re-plotting based on the user's answer. Right now, everytime the message box pops up, it is covering part of the plot, so the user must move the message box in order to answer the question.

-kathryn

Deanna

China
Posts

Posted - 04/02/2006 :  10:13:39 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Dear Kathryn,

It seems that it is not easy to control where the message box pops up. However, the location and the size of an existing graph window can be set through simple Origin C codes, using the MoveWindow function in Window class.

The prototype is as follows:
void MoveWindow(const RECT * lpRect, BOOL bRepaint = TRUE);

Suppose the graph window is currently activated. Executing the following function will change the upper-left position to (200, 100) without resizing the window.


void ChangeGraphPos()
{
// Create and attach a graph layer from current Graph:
GraphLayer gl = Project.ActiveLayer();
GraphPage gp = gl.GetPage();

Window testWin = gp.GetWindow();
testWin.ShowWindow(SW_NORMAL);

RECT rect;
testWin.GetWindowRect(&rect);

int iWidth = rect.right - rect.left;
int iHeight = rect.bottom - rect.top;

rect.left = 200;
rect.top = 100;
rect.right = rect.left + iWidth;
rect.bottom = rect.top + iHeight;

testWin.MoveWindow(&rect);

}


I hope this will help.

Deanna
OriginLab GZ Office

Edited by - Deanna on 04/09/2006 10:37:58 PM

Edited by - Deanna on 04/09/2006 10:38:20 PM
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000