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
 LabTalk Forum
 HowTo: Move Windows
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

klasperstanze

2 Posts

Posted - 01/13/2016 :  02:37:25 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello,

I am using Origin 9.1 on Win7, 64 bit.
My question is: Is there a LabTalk command which allows re-arrangement of windows, e.g. graph windows? I want to have my newly created plot moved to the top left corner, for example.

I hope you can help me since excessive internet research lead to nothing.

Thanks in advance!

SeanMao

China
288 Posts

Posted - 01/14/2016 :  01:08:19 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

There is no LabTalk way to do it, but you can define an OC function and add this file to "User [AutoLoad]" folder in Code Builder so that every time you start Origin it will be available:


// This function will position given graph window with name 
// winName and position and resize it
void Window_MoveWindow_ex1( string winName, int wLeft, int wTop, int wRight, int wBottom)
{
    GraphPage gp = Project.GraphPages(winName);
    if (gp.IsValid())
    	{
    		Window gWin = gp.GetWindow();
    		gWin.ShowWindow(SW_NORMAL);
    		RECT RecNew;
    		RecNew.left = wLeft;
    		RecNew.top = wTop;
    		RecNew.right = wRight;
    		RecNew.bottom = wBottom;
			gWin.MoveWindow(&RecNew);
    	}
}


After that you can run the command below directly in Script Window:

Window_MoveWindow_ex1(Graph1, 100,300,600,1000);

Give it a try and see how it goes!

Regards!

Sean

OriginLab Tech.

Edited by - SeanMao on 01/14/2016 01:11:12 AM
Go to Top of Page

klasperstanze

2 Posts

Posted - 01/15/2016 :  03:53:01 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi SeanMao,

Thanks alot for the help.
I´m new to OriginC though and therefore tried to find out where to put the code-file, since there is no autoload folder in my Origin.

I tried to put it in Originlab/91/User Data/OriginC.
Didn´t work (as .ocw file).

Where exactly does the code need to be placed (and with what file ending)?
Go to Top of Page

SeanMao

China
288 Posts

Posted - 01/15/2016 :  04:59:31 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

My bad! I should have mentioned that User AutoLoad folder is implemented later on. But you can add it to "System" folder instead. For your reference, see figure below:



Regards!

Sean
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