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
 Worksheet background color
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

illysam

Canada
13 Posts

Posted - 01/04/2006 :  12:54:42 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin7 SR4
Windows XP Professional

Hi,

in order to distinguish between several worksheet templates for one of my Origin add-ons, I customized the Origin color palette ('Format' menu -> 'Color Palette...') and used these custom colors as background colors for the worksheet templates. The background colors were changed from the 'Worksheet Display Control' dialog (accessible by hitting F4 when a worksheet is active), then the templates were saved.

My problem is that the worksheets do not show up with the desired colors if the color palette had been modified prior to my adding custom colors. This is because the color of a worksheet is determined by the index of that color in the Origin color palette, not the color name. And adding colors to a customized palette is not the same as adding to the default palette as far as color indices are concerned.

However, it is easy enough to determine the index of a given (custom) color in the color palette from the Origin.ini file.

Is there a way in OriginC/LabTalk to use this index to change the background color of a worksheet programmatically so that I can ensure that the worksheets show up with the 'correct' color?

Thank you, Rolf.


Mike Buess

USA
3037 Posts

Posted - 01/04/2006 :  3:00:20 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Rolf,

I'm not sure this is exactly what you want but you might try the LabTalk property page.basecolor=index;

Mike Buess
Origin WebRing Member
Go to Top of Page

illysam

Canada
13 Posts

Posted - 01/04/2006 :  4:23:11 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Mike,

the 'page.basecolor' command changes the background of the whole worksheet which is a useful thing to know, but unfortunately not what I want to do.

I need a command that changes the background color of the headers (and rows), not the worksheet (sorry, I wasn't clear enough in my initial post).

You can manually change this color in the 'Worksheet Display Control'dialog (access as described above): simply change the 'Background' color in the 'Heading Options' and click 'OK' to observe the effect.

I just need a way to achieve this programmatically (OriginC or LabTalk).

Thanks, Rolf.

Go to Top of Page

greg

USA
1379 Posts

Posted - 01/04/2006 :  5:01:34 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You cannot access these properties programmatically and you cannot use a custom color other than one you add to the Origin Color Palette.

Also, changing your Origin Color Palette will only affect your computer and will not be portable to other computers. (Unless you write code to overwrite another user's ORIGIN.INI file.)

Go to Top of Page

easwar

USA
1965 Posts

Posted - 01/04/2006 :  5:15:53 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Rolf,

If the main intent is to distinguish between different worksheets, you could try the following instead:

1> bring up Worksheet Display Control
2> change Gap From Top from 0 to say 30
3> add text label to top area that describes/distinguishes worksheet
4> save as a custom template
5> create as many such custom templates as needed

Then programmatically you can create instances of the appropriate template for different needs.

Easwar
OriginLab

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