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
 user created visual object questions
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

couturier

France
291 Posts

Posted - 01/21/2005 :  08:15:55 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.5 pro
Operating System: XP pro

Hi,
I've got a few questions related to user created visual objects:
- I use moveable lines. When they are selected, they change their color (blue becomes pink, red becomes green ..). I would prefer them not to. I've had been able to do this in Origin 6.1 (with the revvideo property as far as I can remember) but can't find how to do this in Origin 7.5. Anyone has an idea ?

- I use a moveable rectangle. I've disabled vertical movement but the rectangle can be resized vertically, so it can still be moved vertically. Anyone knows how to prevent vertical resizing (but not horizontal resizing) ?3

- in multi-panel graph, I use a clickable button to run a script on the active layer. The problem is that the active layer always becomes the one where the button was created (even if attached to the page). How can I know which layer was active before clicking this button ? (there was no such problem in 6.1)

Mike Buess

USA
3037 Posts

Posted - 01/21/2005 :  10:12:21 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
>Disable vertical resizing.
I've always done that dynamically by attaching the following script to the rectangle and running it on Moved or Sized...

Rect.dy = fixed height;
Rect.y = fixed position;

Height and position are in plot coordinates and position is center of rectangle.

Mike Buess
Origin WebRing Member
Go to Top of Page

couturier

France
291 Posts

Posted - 01/21/2005 :  10:45:29 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Mike,
thanks for the tip.
Concerning the moveable rectangle, the fixed position works well but the fixed height prints out an error (Error: Failed to execute script)
Where did you get that tip. I couldn't find it anywhere on the help files ?

Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 01/21/2005 :  11:04:34 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Those properties are described in the User-Created Visual Objects section of the (LabTalk) Programming Guide...

object.dx, object.dy - Width and height (of the object) in axes units.
object.x, object.y - Axes X Y coordinates of the center of the object.

Of course object must be the name shown in the object's label control. Not sure why Rect.dy is giving you an error unless you are trying to give it an undefined or negative value.

Mike Buess
Origin WebRing Member
Go to Top of Page

couturier

France
291 Posts

Posted - 01/21/2005 :  11:12:01 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I knew these properties but just thought (dumb me) the "fixed height" and "fixed position" were words you could type in :-)
I now wonder why the "Rect.y = fixed position;" didn't print out an error !!!

Still looking for answers for the others points...


Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 01/21/2005 :  11:52:41 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The layer selection (panel graph) problem is rather tricky but there is a workaround if the user selects a panel by clicking its layer.

1. Create an invisible text label in each layer. (Doesn't matter what text is displayed.)

2. Set the label control script for each label to this...

LastLayerSelected=page.active;

3. Set each label script to run after New Selection.

When user selects a panel by clicking inside its layer the variable LastLayerSelected is set to that layer number. Clicking your button will not activate the hidden text labels (at least it didn't in my tests) so the button's scripts can use LastLayerSelected to identify the requested panel.

The hidden text labels are not activated when panels are selected with their layer icons so you might want to hide those icons.

Mike Buess
Origin WebRing Member
Go to Top of Page

couturier

France
291 Posts

Posted - 01/21/2005 :  12:04:52 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
thanx a lot for the workaround (I assume users select panels by clicking their layer).


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