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
 Setting label for worksheet description
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

hajo_old

Germany
141 Posts

Posted - 01/30/2003 :  04:15:45 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hello, all

while reading out some specific formatted ASCII file I want to import some comments into the label field shown in the following picture by OriginC or LabTalk.



Any hints or code to solve this
Thanks

HJKoch
SVDO_Origin1


-- --
Dipl.-Ing. Hans-Joerg Koch
Siemens VDO, Regensburg

SVDO_Origin1

Mike Buess

USA
3037 Posts

Posted - 01/30/2003 :  08:37:07 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Your picture doesn't show up, so I'll guess what kind of label you want.

%Z="My comments"; //imported from file

page.label$=%Z; //Window label (title bar of active window)
wks.col$(n).label$=%Z; //Column label (nth column of active wks)
labelname.text$=%Z; //Text box label

Hope that helps.

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 01/30/2003 08:39:40 AM
Go to Top of Page

hajo_old

Germany
141 Posts

Posted - 01/30/2003 :  08:54:47 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hallo, all

thanks for your help till now!

Mike Buess - I meant the title bar of the active window (or the label, I fill in in the shown dialog box!)

This is the OriginC / LabTalk code I solved the problem so far:

PageBase pb;
pb = Project.Pages(); // get active worksheet from project
string str = strInj + "_FUP" + strFUP + "_tm" + strTihpt;
out_str(str);
string windowName;
pb.GetName(windowName); // read out the worksheet name
string LTexec = "win -rl \"" + windowName + "\" \"" + str + "\"";
LT_execute(LTexec);



This works, but is there a native OriginC solution without the LT_execute call?

Thanks


-- --
Dipl.-Ing. Hans-Joerg Koch
Siemens VDO, Regensburg

SVDO_Origin1

Edited by - SVDO_Origin1 on 01/30/2003 08:56:10 AM
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 01/30/2003 :  2:46:20 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Actually, there is a native Origin C method. The following function is based on an example in Page.h. It creates a worksheet and labels the window strLabel.

void test(string strLabel)
{
WorksheetPage wp;
if( wp.Create("origin.otw", CREATE_VISIBLE_SAME) )
{
wp.Label = strLabel;
printf("Worksheet '%s' has label '%s'\n", wp.GetName(), wp.Label);
}
else
printf("Failed to create worksheet page.\n");
}

Unfortunately, in order to see the label you need to add this to the function above...

LT_execute("page.title=3;");

Always something...

...Of course here is the easy way out
1) Open Origin.otw (or whatever template you use)
2) Window...Rename
3) Select "Both name and label", leave label blank, click OK
4) Save template

Now the label for this template will always be visible.

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 01/30/2003 3:41:03 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