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
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 GraphObjects - e.g. lines - jut out of layer

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
TreeNode Posted - 05/10/2011 : 07:00:14 AM
Origin Ver. and Service Release: Origin 8 SR6
Operating System: Win XP

Hi,

I am adding several GraphObjects to my Layer, like lines and labels.
The X-Axis of my Layer is representing time, shows data from 0 - 48 hours.

Lets imagine I added a horizontal line spanning from 0 - 24 h. When I set X-Axis to show only
a timeframe from 6 - 12h, my line jut out of the layer frame at the left.

Is there a possibility to avoid the overhanging?


|-- TreeNode
...|-- a??
...|-- ha!!
3   L A T E S T    R E P L I E S    (Newest First)
TreeNode Posted - 05/12/2011 : 10:19:00 AM
@Penn:
Thanks for the idea, but its much to complicated. I would have to check for example if the line I want to endup at
layer frame has arrows at the end. When true, I would have to remove the arrow at the side where it touches layer frame,
and later to add it again.
Why GraphObjects dont just behave like the data inside the layer? So that you can only see things lay in the frame?

@cpyang
Thanks for your idea. It works. Its not a complete satisfying solution, but it has to suffice for now...


|-- TreeNode
...|-- a??
...|-- ha!!
cpyang Posted - 05/11/2011 : 1:36:04 PM
You can try using the GOC_AUTOHIDE bit for graphic objects (see oc_const.h). This was added in 2006 so should be Origin 8. When this bit is set, Gr Object will become hidden once outside the layer frame.



From LT, you can do

line.states=hex(100)

and from OC, the following was the testing code I found when this was implemented:


void selected_grobj_autohide(BOOL bSet)
{
   GraphLayer gl = Project.ActiveLayer();
   GraphObject go;
   go = Selection.Objects();
   if( go )
   {
       Tree tr;
       tr.Root.States.nVal = bSet ? GOC_AUTOHIDE : 0;
       int iRet = go.UpdateThemeIDs(tr.Root, "Error", "Unknown tag");
       go.ApplyFormat(tr, true, true);
   }
} 




CP
Penn Posted - 05/11/2011 : 03:30:07 AM
Hi TreeNode,

I am afraid you cannot avoid this overhanging directly. If you are try to use Origin C to avoid this, you can change the line's properties manually for each time you change the axis scale. Firstly, you need to save the corresponding info. of the line to a tree by using PutBinaryStorage method. And then, when the axis scale is changed (by Origin C here), you can get the saved info. from the line object by using GetBinaryStorage method for calculating the new width and position of the line, so that the line will not jut out of the layer frame.

Penn

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000