Article View: comp.windows.interviews
Article #18Using pictures in a GraphicBlock
From: njs
Date: Wed, 28 Oct 1992 11:04
Date: Wed, 28 Oct 1992 11:04
1080 lines
48611 bytes
48611 bytes
Just to set the scene: In 2.6 a GraphicBlock in the Interactor interface to interacting with graphics. I am using one to create pictures of things ( suprise suprise ) with which I can interact using menus and such like.
What I do is put a very large picture into the block first which then defines its natural size. I then add further pictures containing stencils which contain bitmaps to represent the real world objects that I am manipulating. All well and good.
The unfortunate part is that I can transform the stencils outside the the natural size of the block (problem 1), and when I add labels to the stencils these can sometimes appear outside the size of the block as well. I call these pictures elements.
What happens is typified by adding a rectangle to the element. If I do the following:
BoxObj box;
GetBox (box);
SelectedRectangle = new Rect( box.left, box.bottom, box.right, box.top, this );
Append ( SelectedRectangle );
the SelectedRectangle would normally appear in the correct position unless the element has aquired a transformer or a element or a label in the picture are outside the size. What happens:
1) If a transformer is present then the rectangle is transformed by twice the transformation represented by the transformer. This is partly connected to the fact that that I am using the graphic context of the element in the constructor and that the element is doing the Appending. But if I try anything else I can't get it to work. This situation at least is predictable so I can hack a result. viz
if ( t )
{
float a00, a01, a10, a11, a20, a21;
t->GetEntries ( a00, a01, a10, a11, a20, a21 );
SelectedRectangle->Translate ( -2*(a20), -2*(a21) );
}
2) If any element or label is outside the size then, despite the hack, the SelectedRectangle will be shifted by the amount that the label or element is outside the size.
When it comes down to it I can't totally prevent the second problem, and I would dearly like to have a better solution to the first problem, or better still simply not have the first problem.
Help?
Ta
Nathan
From: njs@planet.bt.co.uk ()
Path: njs
Newsgroups: comp.windows.interviews
Distribution: planet
Followup-To:
Organization: DNM42, BT Labs, Martlesham Heath, Ipswich, UK.
Subject: Using pictures in a GraphicBlock
Keywords: libgraphic, IV2.6, GraphicBlock
Just to set the scene: In 2.6 a GraphicBlock in the Interactor interface to interacting with graphics. I am using one to create pictures of things ( suprise suprise ) with which I can interact using menus and such like.
What I do is put a very large picture into the block first which then defines its natural size. I then add further pictures containing stencils which contain bitmaps to represent the real world objects that I am manipulating. All well and good.
The unfortunate part is that I can transform the stencils outside the the natural size of the block (problem 1), and when I add labels to the stencils these can sometimes appear outside the size of the block as well. I call these pictures elements.
What happens is typified by adding a rectangle to the element. If I do the following:
BoxObj box;
GetBox (box);
SelectedRectangle = new Rect( box.left, box.bottom, box.right, box.top, this );
Append ( SelectedRectangle );
the SelectedRectangle would normally appear in the correct position unless the element has aquired a transformer or a element or a label in the picture are outside the size. What happens:
1) If a transformer is present then the rectangle is transformed by twice the transformation represented by the transformer. This is partly connected to the fact that that I am using the graphic context of the element in the constructor and that the element is doing the Appending. But if I try anything else I can't get it to work. This situation at least is predictable so I can hack a result. viz
if ( t )
{
float a00, a01, a10, a11, a20, a21;
t->GetEntries ( a00, a01, a10, a11, a20, a21 );
SelectedRectangle->Translate ( -2*(a20), -2*(a21) );
}
2) If any element or label is outside the size then, despite the hack, the SelectedRectangle will be shifted by the amount that the label or element is outside the size.
When it comes down to it I can't totally prevent the second problem, and I would dearly like to have a better solution to the first problem, or better still simply not have the first problem.
Help?
Ta
Nathan
From: njs@planet.bt.co.uk ()
Path: njs
Newsgroups: comp.windows.interviews
Distribution: planet
Followup-To:
Organization: DNM42, BT Labs, Martlesham Heath, Ipswich, UK.
Subject: Using pictures in a GraphicBlock
Keywords: libgraphic, IV2.6, GraphicBlock
Just to set the scene: In 2.6 a GraphicBlock in the Interactor interface to interacting with graphics. I am using one to create pictures of things ( suprise suprise ) with which I can interact using menus and such like.
What I do is put a very large picture into the block first which then defines its natural size. I then add further pictures containing stencils which contain bitmaps to represent the real world objects that I am manipulating. All well and good.
The unfortunate part is that I can transform the stencils outside the the natural size of the block (problem 1), and when I add labels to the stencils these can sometimes appear outside the size of the block as well. I call these pictures elements.
What happens is typified by adding a rectangle to the element. If I do the following:
BoxObj box;
GetBox (box);
SelectedRectangle = new Rect( box.left, box.bottom, box.right, box.top, this );
Append ( SelectedRectangle );
the SelectedRectangle would normally appear in the correct position unless the element has aquired a transformer or a element or a label in the picture are outside the size. What happens:
1) If a transformer is present then the rectangle is transformed by twice the transformation represented by the transformer. This is partly connected to the fact that that I am using the graphic context of the element in the constructor and that the element is doing the Appending. But if I try anything else I can't get it to work. This situation at least is predictable so I can hack a result. viz
if ( t )
{
float a00, a01, a10, a11, a20, a21;
t->GetEntries ( a00, a01, a10, a11, a20, a21 );
SelectedRectangle->Translate ( -2*(a20), -2*(a21) );
}
2) If any element or label is outside the size then, despite the hack, the SelectedRectangle will be shifted by the amount that the label or element is outside the size.
When it comes down to it I can't totally prevent the second problem, and I would dearly like to have a better solution to the first problem, or better still simply not have the first problem.
Help?
Ta
Nathan
From: njs@planet.bt.co.uk ()
Path: njs
Newsgroups: comp.windows.interviews
Distribution: planet
Followup-To:
Organization: DNM42, BT Labs, Martlesham Heath, Ipswich, UK.
Subject: Using pictures in a GraphicBlock
Keywords: libgraphic, IV2.6, GraphicBlock
Just to set the scene: In 2.6 a GraphicBlock in the Interactor interface to interacting with graphics. I am using one to create pictures of things ( suprise suprise ) with which I can interact using menus and such like.
What I do is put a very large picture into the block first which then defines its natural size. I then add further pictures containing stencils which contain bitmaps to represent the real world objects that I am manipulating. All well and good.
The unfortunate part is that I can transform the stencils outside the the natural size of the block (problem 1), and when I add labels to the stencils these can sometimes appear outside the size of the block as well. I call these pictures elements.
What happens is typified by adding a rectangle to the element. If I do the following:
BoxObj box;
GetBox (box);
SelectedRectangle = new Rect( box.left, box.bottom, box.right, box.top, this );
Append ( SelectedRectangle );
the SelectedRectangle would normally appear in the correct position unless the element has aquired a transformer or a element or a label in the picture are outside the size. What happens:
1) If a transformer is present then the rectangle is transformed by twice the transformation represented by the transformer. This is partly connected to the fact that that I am using the graphic context of the element in the constructor and that the element is doing the Appending. But if I try anything else I can't get it to work. This situation at least is predictable so I can hack a result. viz
if ( t )
{
float a00, a01, a10, a11, a20, a21;
t->GetEntries ( a00, a01, a10, a11, a20, a21 );
SelectedRectangle->Translate ( -2*(a20), -2*(a21) );
}
2) If any element or label is outside the size then, despite the hack, the SelectedRectangle will be shifted by the amount that the label or element is outside the size.
When it comes down to it I can't totally prevent the second problem, and I would dearly like to have a better solution to the first problem, or better still simply not have the first problem.
Help?
Ta
Nathan
Path: njs
Newsgroups: comp.windows.interviews
From: njs@planet.bt.co.uk ()
Path: njs
Newsgroups: comp.windows.interviews
Distribution: planet
Followup-To:
Organization: DNM42, BT Labs, Martlesham Heath, Ipswich, UK.
Subject: Using pictures in a GraphicBlock
Keywords: libgraphic, IV2.6, GraphicBlock
Just to set the scene: In 2.6 a GraphicBlock in the Interactor interface to interacting with graphics. I am using one to create pictures of things ( suprise suprise ) with which I can interact using menus and such like.
What I do is put a very large picture into the block first which then defines its natural size. I then add further pictures containing stencils which contain bitmaps to represent the real world objects that I am manipulating. All well and good.
The unfortunate part is that I can transform the stencils outside the the natural size of the block (problem 1), and when I add labels to the stencils these can sometimes appear outside the size of the block as well. I call these pictures elements.
What happens is typified by adding a rectangle to the element. If I do the following:
BoxObj box;
GetBox (box);
SelectedRectangle = new Rect( box.left, box.bottom, box.right, box.top, this );
Append ( SelectedRectangle );
the SelectedRectangle would normally appear in the correct position unless the element has aquired a transformer or a element or a label in the picture are outside the size. What happens:
1) If a transformer is present then the rectangle is transformed by twice the transformation represented by the transformer. This is partly connected to the fact that that I am using the graphic context of the element in the constructor and that the element is doing the Appending. But if I try anything else I can't get it to work. This situation at least is predictable so I can hack a result. viz
if ( t )
{
float a00, a01, a10, a11, a20, a21;
t->GetEntries ( a00, a01, a10, a11, a20, a21 );
SelectedRectangle->Translate ( -2*(a20), -2*(a21) );
}
2) If any element or label is outside the size then, despite the hack, the SelectedRectangle will be shifted by the amount that the label or element is outside the size.
When it comes down to it I can't totally prevent the second problem, and I would dearly like to have a better solution to the first problem, or better still simply not have the first problem.
Help?
Ta
Nathan
From: njs@planet.bt.co.uk ()
Path: njs
Newsgroups: comp.windows.interviews
Distribution: planet
Followup-To:
Organization: DNM42, BT Labs, Martlesham Heath, Ipswich, UK.
Subject: Using pictures in a GraphicBlock
Keywords: libgraphic, IV2.6, GraphicBlock
Just to set the scene: In 2.6 a GraphicBlock in the Interactor interface to interacting with graphics. I am using one to create pictures of things ( suprise suprise ) with which I can interact using menus and such like.
What I do is put a very large picture into the block first which then defines its natural size. I then add further pictures containing stencils which contain bitmaps to represent the real world objects that I am manipulating. All well and good.
The unfortunate part is that I can transform the stencils outside the the natural size of the block (problem 1), and when I add labels to the stencils these can sometimes appear outside the size of the block as well. I call these pictures elements.
What happens is typified by adding a rectangle to the element. If I do the following:
BoxObj box;
GetBox (box);
SelectedRectangle = new Rect( box.left, box.bottom, box.right, box.top, this );
Append ( SelectedRectangle );
the SelectedRectangle would normally appear in the correct position unless the element has aquired a transformer or a element or a label in the picture are outside the size. What happens:
1) If a transformer is present then the rectangle is transformed by twice the transformation represented by the transformer. This is partly connected to the fact that that I am using the graphic context of the element in the constructor and that the element is doing the Appending. But if I try anything else I can't get it to work. This situation at least is predictable so I can hack a result. viz
if ( t )
{
float a00, a01, a10, a11, a20, a21;
t->GetEntries ( a00, a01, a10, a11, a20, a21 );
SelectedRectangle->Translate ( -2*(a20), -2*(a21) );
}
2) If any element or label is outside the size then, despite the hack, the SelectedRectangle will be shifted by the amount that the label or element is outside the size.
When it comes down to it I can't totally prevent the second problem, and I would dearly like to have a better solution to the first problem, or better still simply not have the first problem.
Help?
Ta
Nathan
From: njs@planet.bt.co.uk ()
Path: njs
Newsgroups: comp.windows.interviews
Distribution: planet
Followup-To:
Organization: DNM42, BT Labs, Martlesham Heath, Ipswich, UK.
Subject: Using pictures in a GraphicBlock
Keywords: libgraphic, IV2.6, GraphicBlock
Just to set the scene: In 2.6 a GraphicBlock in the Interactor interface to interacting with graphics. I am using one to create pictures of things ( suprise suprise ) with which I can interact using menus and such like.
What I do is put a very large picture into the block first which then defines its natural size. I then add further pictures containing stencils which contain bitmaps to represent the real world objects that I am manipulating. All well and good.
The unfortunate part is that I can transform the stencils outside the the natural size of the block (problem 1), and when I add labels to the stencils these can sometimes appear outside the size of the block as well. I call these pictures elements.
What happens is typified by adding a rectangle to the element. If I do the following:
BoxObj box;
GetBox (box);
SelectedRectangle = new Rect( box.left, box.bottom, box.right, box.top, this );
Append ( SelectedRectangle );
the SelectedRectangle would normally appear in the correct position unless the element has aquired a transformer or a element or a label in the picture are outside the size. What happens:
1) If a transformer is present then the rectangle is transformed by twice the transformation represented by the transformer. This is partly connected to the fact that that I am using the graphic context of the element in the constructor and that the element is doing the Appending. But if I try anything else I can't get it to work. This situation at least is predictable so I can hack a result. viz
if ( t )
{
float a00, a01, a10, a11, a20, a21;
t->GetEntries ( a00, a01, a10, a11, a20, a21 );
SelectedRectangle->Translate ( -2*(a20), -2*(a21) );
}
2) If any element or label is outside the size then, despite the hack, the SelectedRectangle will be shifted by the amount that the label or element is outside the size.
When it comes down to it I can't totally prevent the second problem, and I would dearly like to have a better solution to the first problem, or better still simply not have the first problem.
Help?
Ta
Nathan
From: njs@planet.bt.co.uk ()
Path: njs
Newsgroups: comp.windows.interviews
Distribution: planet
Followup-To:
Organization: DNM42, BT Labs, Martlesham Heath, Ipswich, UK.
Subject: Using pictures in a GraphicBlock
Keywords: libgraphic, IV2.6, GraphicBlock
Just to set the scene: In 2.6 a GraphicBlock in the Interactor interface to interacting with graphics. I am using one to create pictures of things ( suprise suprise ) with which I can interact using menus and such like.
What I do is put a very large picture into the block first which then defines its natural size. I then add further pictures containing stencils which contain bitmaps to represent the real world objects that I am manipulating. All well and good.
The unfortunate part is that I can transform the stencils outside the the natural size of the block (problem 1), and when I add labels to the stencils these can sometimes appear outside the size of the block as well. I call these pictures elements.
What happens is typified by adding a rectangle to the element. If I do the following:
BoxObj box;
GetBox (box);
SelectedRectangle = new Rect( box.left, box.bottom, box.right, box.top, this );
Append ( SelectedRectangle );
the SelectedRectangle would normally appear in the correct position unless the element has aquired a transformer or a element or a label in the picture are outside the size. What happens:
1) If a transformer is present then the rectangle is transformed by twice the transformation represented by the transformer. This is partly connected to the fact that that I am using the graphic context of the element in the constructor and that the element is doing the Appending. But if I try anything else I can't get it to work. This situation at least is predictable so I can hack a result. viz
if ( t )
{
float a00, a01, a10, a11, a20, a21;
t->GetEntries ( a00, a01, a10, a11, a20, a21 );
SelectedRectangle->Translate ( -2*(a20), -2*(a21) );
}
2) If any element or label is outside the size then, despite the hack, the SelectedRectangle will be shifted by the amount that the label or element is outside the size.
When it comes down to it I can't totally prevent the second problem, and I would dearly like to have a better solution to the first problem, or better still simply not have the first problem.
Help?
Ta
Nathan
From: njs@planet.bt.co.uk ()
Path: njs
Newsgroups: comp.windows.interviews
Distribution: planet
Followup-To:
Organization: DNM42, BT Labs, Martlesham Heath, Ipswich, UK.
Subject: Using pictures in a GraphicBlock
Keywords: libgraphic, IV2.6, GraphicBlock
Just to set the scene: In 2.6 a GraphicBlock in the Interactor interface to interacting with graphics. I am using one to create pictures of things ( suprise suprise ) with which I can interact using menus and such like.
What I do is put a very large picture into the block first which then defines its natural size. I then add further pictures containing stencils which contain bitmaps to represent the real world objects that I am manipulating. All well and good.
The unfortunate part is that I can transform the stencils outside the the natural size of the block (problem 1), and when I add labels to the stencils these can sometimes appear outside the size of the block as well. I call these pictures elements.
What happens is typified by adding a rectangle to the element. If I do the following:
BoxObj box;
GetBox (box);
SelectedRectangle = new Rect( box.left, box.bottom, box.right, box.top, this );
Append ( SelectedRectangle );
the SelectedRectangle would normally appear in the correct position unless the element has aquired a transformer or a element or a label in the picture are outside the size. What happens:
1) If a transformer is present then the rectangle is transformed by twice the transformation represented by the transformer. This is partly connected to the fact that that I am using the graphic context of the element in the constructor and that the element is doing the Appending. But if I try anything else I can't get it to work. This situation at least is predictable so I can hack a result. viz
if ( t )
{
float a00, a01, a10, a11, a20, a21;
t->GetEntries ( a00, a01, a10, a11, a20, a21 );
SelectedRectangle->Translate ( -2*(a20), -2*(a21) );
}
2) If any element or label is outside the size then, despite the hack, the SelectedRectangle will be shifted by the amount that the label or element is outside the size.
When it comes down to it I can't totally prevent the second problem, and I would dearly like to have a better solution to the first problem, or better still simply not have the first problem.
Help?
Ta
Nathan
From: njs@planet.bt.co.uk ()
Path: njs
Newsgroups: comp.windows.interviews
Distribution: planet
Followup-To:
Organization: DNM42, BT Labs, Martlesham Heath, Ipswich, UK.
Subject: Using pictures in a GraphicBlock
Keywords: libgraphic, IV2.6, GraphicBlock
Just to set the scene: In 2.6 a GraphicBlock in the Interactor interface to interacting with graphics. I am using one to create pictures of things ( suprise suprise ) with which I can interact using menus and such like.
What I do is put a very large picture into the block first which then defines its natural size. I then add further pictures containing stencils which contain bitmaps to represent the real world objects that I am manipulating. All well and good.
The unfortunate part is that I can transform the stencils outside the the natural size of the block (problem 1), and when I add labels to the stencils these can sometimes appear outside the size of the block as well. I call these pictures elements.
What happens is typified by adding a rectangle to the element. If I do the following:
BoxObj box;
GetBox (box);
SelectedRectangle = new Rect( box.left, box.bottom, box.right, box.top, this );
Append ( SelectedRectangle );
the SelectedRectangle would normally appear in the correct position unless the element has aquired a transformer or a element or a label in the picture are outside the size. What happens:
1) If a transformer is present then the rectangle is transformed by twice the transformation represented by the transformer. This is partly connected to the fact that that I am using the graphic context of the element in the constructor and that the element is doing the Appending. But if I try anything else I can't get it to work. This situation at least is predictable so I can hack a result. viz
if ( t )
{
float a00, a01, a10, a11, a20, a21;
t->GetEntries ( a00, a01, a10, a11, a20, a21 );
SelectedRectangle->Translate ( -2*(a20), -2*(a21) );
}
2) If any element or label is outside the size then, despite the hack, the SelectedRectangle will be shifted by the amount that the label or element is outside the size.
When it comes down to it I can't totally prevent the second problem, and I would dearly like to have a better solution to the first problem, or better still simply not have the first problem.
Help?
Ta
Nathan
From: njs@planet.bt.co.uk ()
Path: njs
Newsgroups: comp.windows.interviews
Distribution: planet
Followup-To:
Organization: DNM42, BT Labs, Martlesham Heath, Ipswich, UK.
Subject: Using pictures in a GraphicBlock
Keywords: libgraphic, IV2.6, GraphicBlock
Just to set the scene: In 2.6 a GraphicBlock in the Interactor interface to interacting with graphics. I am using one to create pictures of things ( suprise suprise ) with which I can interact using menus and such like.
What I do is put a very large picture into the block first which then defines its natural size. I then add further pictures containing stencils which contain bitmaps to represent the real world objects that I am manipulating. All well and good.
The unfortunate part is that I can transform the stencils outside the the natural size of the block (problem 1), and when I add labels to the stencils these can sometimes appear outside the size of the block as well. I call these pictures elements.
What happens is typified by adding a rectangle to the element. If I do the following:
BoxObj box;
GetBox (box);
SelectedRectangle = new Rect( box.left, box.bottom, box.right, box.top, this );
Append ( SelectedRectangle );
the SelectedRectangle would normally appear in the correct position unless the element has aquired a transformer or a element or a label in the picture are outside the size. What happens:
1) If a transformer is present then the rectangle is transformed by twice the transformation represented by the transformer. This is partly connected to the fact that that I am using the graphic context of the element in the constructor and that the element is doing the Appending. But if I try anything else I can't get it to work. This situation at least is predictable so I can hack a result. viz
if ( t )
{
float a00, a01, a10, a11, a20, a21;
t->GetEntries ( a00, a01, a10, a11, a20, a21 );
SelectedRectangle->Translate ( -2*(a20), -2*(a21) );
}
2) If any element or label is outside the size then, despite the hack, the SelectedRectangle will be shifted by the amount that the label or element is outside the size.
When it comes down to it I can't totally prevent the second problem, and I would dearly like to have a better solution to the first problem, or better still simply not have the first problem.
Help?
Ta
Nathan
From: njs@planet.bt.co.uk ()
Path: njs
Newsgroups: comp.windows.interviews
Distribution: planet
Followup-To:
Organization: DNM42, BT Labs, Martlesham Heath, Ipswich, UK.
Subject: Using pictures in a GraphicBlock
Keywords: libgraphic, IV2.6, GraphicBlock
Just to set the scene: In 2.6 a GraphicBlock in the Interactor interface to interacting with graphics. I am using one to create pictures of things ( suprise suprise ) with which I can interact using menus and such like.
What I do is put a very large picture into the block first which then defines its natural size. I then add further pictures containing stencils which contain bitmaps to represent the real world objects that I am manipulating. All well and good.
The unfortunate part is that I can transform the stencils outside the the natural size of the block (problem 1), and when I add labels to the stencils these can sometimes appear outside the size of the block as well. I call these pictures elements.
What happens is typified by adding a rectangle to the element. If I do the following:
BoxObj box;
GetBox (box);
SelectedRectangle = new Rect( box.left, box.bottom, box.right, box.top, this );
Append ( SelectedRectangle );
the SelectedRectangle would normally appear in the correct position unless the element has aquired a transformer or a element or a label in the picture are outside the size. What happens:
1) If a transformer is present then the rectangle is transformed by twice the transformation represented by the transformer. This is partly connected to the fact that that I am using the graphic context of the element in the constructor and that the element is doing the Appending. But if I try anything else I can't get it to work. This situation at least is predictable so I can hack a result. viz
if ( t )
{
float a00, a01, a10, a11, a20, a21;
t->GetEntries ( a00, a01, a10, a11, a20, a21 );
SelectedRectangle->Translate ( -2*(a20), -2*(a21) );
}
2) If any element or label is outside the size then, despite the hack, the SelectedRectangle will be shifted by the amount that the label or element is outside the size.
When it comes down to it I can't totally prevent the second problem, and I would dearly like to have a better solution to the first problem, or better still simply not have the first problem.
Help?
Ta
Nathan
From: njs@planet.bt.co.uk ()
Path: njs
Newsgroups: comp.windows.interviews
Distribution: planet
Followup-To:
Organization: DNM42, BT Labs, Martlesham Heath, Ipswich, UK.
Subject: Using pictures in a GraphicBlock
Keywords: libgraphic, IV2.6, GraphicBlock
Just to set the scene: In 2.6 a GraphicBlock in the Interactor interface to interacting with graphics. I am using one to create pictures of things ( suprise suprise ) with which I can interact using menus and such like.
What I do is put a very large picture into the block first which then defines its natural size. I then add further pictures containing stencils which contain bitmaps to represent the real world objects that I am manipulating. All well and good.
The unfortunate part is that I can transform the stencils outside the the natural size of the block (problem 1), and when I add labels to the stencils these can sometimes appear outside the size of the block as well. I call these pictures elements.
What happens is typified by adding a rectangle to the element. If I do the following:
BoxObj box;
GetBox (box);
SelectedRectangle = new Rect( box.left, box.bottom, box.right, box.top, this );
Append ( SelectedRectangle );
the SelectedRectangle would normally appear in the correct position unless the element has aquired a transformer or a element or a label in the picture are outside the size. What happens:
1) If a transformer is present then the rectangle is transformed by twice the transformation represented by the transformer. This is partly connected to the fact that that I am using the graphic context of the element in the constructor and that the element is doing the Appending. But if I try anything else I can't get it to work. This situation at least is predictable so I can hack a result. viz
if ( t )
{
float a00, a01, a10, a11, a20, a21;
t->GetEntries ( a00, a01, a10, a11, a20, a21 );
SelectedRectangle->Translate ( -2*(a20), -2*(a21) );
}
2) If any element or label is outside the size then, despite the hack, the SelectedRectangle will be shifted by the amount that the label or element is outside the size.
When it comes down to it I can't totally prevent the second problem, and I would dearly like to have a better solution to the first problem, or better still simply not have the first problem.
Help?
Ta
Nathan
From: njs@planet.bt.co.uk ()
Path: njs
Newsgroups: comp.windows.interviews
Distribution: planet
Followup-To:
Organization: DNM42, BT Labs, Martlesham Heath, Ipswich, UK.
Subject: Using pictures in a GraphicBlock
Keywords: libgraphic, IV2.6, GraphicBlock
Just to set the scene: In 2.6 a GraphicBlock in the Interactor interface to interacting with graphics. I am using one to create pictures of things ( suprise suprise ) with which I can interact using menus and such like.
What I do is put a very large picture into the block first which then defines its natural size. I then add further pictures containing stencils which contain bitmaps to represent the real world objects that I am manipulating. All well and good.
The unfortunate part is that I can transform the stencils outside the the natural size of the block (problem 1), and when I add labels to the stencils these can sometimes appear outside the size of the block as well. I call these pictures elements.
What happens is typified by adding a rectangle to the element. If I do the following:
BoxObj box;
GetBox (box);
SelectedRectangle = new Rect( box.left, box.bottom, box.right, box.top, this );
Append ( SelectedRectangle );
the SelectedRectangle would normally appear in the correct position unless the element has aquired a transformer or a element or a label in the picture are outside the size. What happens:
1) If a transformer is present then the rectangle is transformed by twice the transformation represented by the transformer. This is partly connected to the fact that that I am using the graphic context of the element in the constructor and that the element is doing the Appending. But if I try anything else I can't get it to work. This situation at least is predictable so I can hack a result. viz
if ( t )
{
float a00, a01, a10, a11, a20, a21;
t->GetEntries ( a00, a01, a10, a11, a20, a21 );
SelectedRectangle->Translate ( -2*(a20), -2*(a21) );
}
2) If any element or label is outside the size then, despite the hack, the SelectedRectangle will be shifted by the amount that the label or element is outside the size.
When it comes down to it I can't totally prevent the second problem, and I would dearly like to have a better solution to the first problem, or better still simply not have the first problem.
Help?
Ta
Nathan
From: njs@planet.bt.co.uk ()
Path: njs
Newsgroups: comp.windows.interviews
Distribution: planet
Followup-To:
Organization: DNM42, BT Labs, Martlesham Heath, Ipswich, UK.
Subject: Using pictures in a GraphicBlock
Keywords: libgraphic, IV2.6, GraphicBlock
Just to set the scene: In 2.6 a GraphicBlock in the Interactor interface to interacting with graphics. I am using one to create pictures of things ( suprise suprise ) with which I can interact using menus and such like.
What I do is put a very large picture into the block first which then defines its natural size. I then add further pictures containing stencils which contain bitmaps to represent the real world objects that I am manipulating. All well and good.
The unfortunate part is that I can transform the stencils outside the the natural size of the block (problem 1), and when I add labels to the stencils these can sometimes appear outside the size of the block as well. I call these pictures elements.
What happens is typified by adding a rectangle to the element. If I do the following:
BoxObj box;
GetBox (box);
SelectedRectangle = new Rect( box.left, box.bottom, box.right, box.top, this );
Append ( SelectedRectangle );
the SelectedRectangle would normally appear in the correct position unless the element has aquired a transformer or a element or a label in the picture are outside the size. What happens:
1) If a transformer is present then the rectangle is transformed by twice the transformation represented by the transformer. This is partly connected to the fact that that I am using the graphic context of the element in the constructor and that the element is doing the Appending. But if I try anything else I can't get it to work. This situation at least is predictable so I can hack a result. viz
if ( t )
{
float a00, a01, a10, a11, a20, a21;
t->GetEntries ( a00, a01, a10, a11, a20, a21 );
SelectedRectangle->Translate ( -2*(a20), -2*(a21) );
}
2) If any element or label is outside the size then, despite the hack, the SelectedRectangle will be shifted by the amount that the label or element is outside the size.
When it comes down to it I can't totally prevent the second problem, and I would dearly like to have a better solution to the first problem, or better still simply not have the first problem.
Help?
Ta
Nathan
From: njs@planet.bt.co.uk ()
Path: njs
Newsgroups: comp.windows.interviews
Distribution: planet
Followup-To:
Organization: DNM42, BT Labs, Martlesham Heath, Ipswich, UK.
Subject: Using pictures in a GraphicBlock
Keywords: libgraphic, IV2.6, GraphicBlock
Just to set the scene: In 2.6 a GraphicBlock in the Interactor interface to interacting with graphics. I am using one to create pictures of things ( suprise suprise ) with which I can interact using menus and such like.
What I do is put a very large picture into the block first which then defines its natural size. I then add further pictures containing stencils which contain bitmaps to represent the real world objects that I am manipulating. All well and good.
The unfortunate part is that I can transform the stencils outside the the natural size of the block (problem 1), and when I add labels to the stencils these can sometimes appear outside the size of the block as well. I call these pictures elements.
What happens is typified by adding a rectangle to the element. If I do the following:
BoxObj box;
GetBox (box);
SelectedRectangle = new Rect( box.left, box.bottom, box.right, box.top, this );
Append ( SelectedRectangle );
the SelectedRectangle would normally appear in the correct position unless the element has aquired a transformer or a element or a label in the picture are outside the size. What happens:
1) If a transformer is present then the rectangle is transformed by twice the transformation represented by the transformer. This is partly connected to the fact that that I am using the graphic context of the element in the constructor and that the element is doing the Appending. But if I try anything else I can't get it to work. This situation at least is predictable so I can hack a result. viz
if ( t )
{
float a00, a01, a10, a11, a20, a21;
t->GetEntries ( a00, a01, a10, a11, a20, a21 );
SelectedRectangle->Translate ( -2*(a20), -2*(a21) );
}
2) If any element or label is outside the size then, despite the hack, the SelectedRectangle will be shifted by the amount that the label or element is outside the size.
When it comes down to it I can't totally prevent the second problem, and I would dearly like to have a better solution to the first problem, or better still simply not have the first problem.
Help?
Ta
Nathan
From: njs@planet.bt.co.uk ()
Path: njs
Newsgroups: comp.windows.interviews
Distribution: planet
Followup-To:
Organization: DNM42, BT Labs, Martlesham Heath, Ipswich, UK.
Subject: Using pictures in a GraphicBlock
Keywords: libgraphic, IV2.6, GraphicBlock
Just to set the scene: In 2.6 a GraphicBlock in the Interactor interface to interacting with graphics. I am using one to create pictures of things ( suprise suprise ) with which I can interact using menus and such like.
What I do is put a very large picture into the block first which then defines its natural size. I then add further pictures containing stencils which contain bitmaps to represent the real world objects that I am manipulating. All well and good.
The unfortunate part is that I can transform the stencils outside the the natural size of the block (problem 1), and when I add labels to the stencils these can sometimes appear outside the size of the block as well. I call these pictures elements.
What happens is typified by adding a rectangle to the element. If I do the following:
BoxObj box;
GetBox (box);
SelectedRectangle = new Rect( box.left, box.bottom, box.right, box.top, this );
Append ( SelectedRectangle );
the SelectedRectangle would normally appear in the correct position unless the element has aquired a transformer or a element or a label in the picture are outside the size. What happens:
1) If a transformer is present then the rectangle is transformed by twice the transformation represented by the transformer. This is partly connected to the fact that that I am using the graphic context of the element in the constructor and that the element is doing the Appending. But if I try anything else I can't get it to work. This situation at least is predictable so I can hack a result. viz
if ( t )
{
float a00, a01, a10, a11, a20, a21;
t->GetEntries ( a00, a01, a10, a11, a20, a21 );
SelectedRectangle->Translate ( -2*(a20), -2*(a21) );
}
2) If any element or label is outside the size then, despite the hack, the SelectedRectangle will be shifted by the amount that the label or element is outside the size.
When it comes down to it I can't totally prevent the second problem, and I would dearly like to have a better solution to the first problem, or better still simply not have the first problem.
Help?
Ta
Nathan
From: njs@planet.bt.co.uk ()
Path: njs
Newsgroups: comp.windows.interviews
Distribution: planet
Followup-To:
Organization: DNM42, BT Labs, Martlesham Heath, Ipswich, UK.
Subject: Using pictures in a GraphicBlock
Keywords: libgraphic, IV2.6, GraphicBlock
Just to set the scene: In 2.6 a GraphicBlock in the Interactor interface to interacting with graphics. I am using one to create pictures of things ( suprise suprise ) with which I can interact using menus and such like.
What I do is put a very large picture into the block first which then defines its natural size. I then add further pictures containing stencils which contain bitmaps to represent the real world objects that I am manipulating. All well and good.
The unfortunate part is that I can transform the stencils outside the the natural size of the block (problem 1), and when I add labels to the stencils these can sometimes appear outside the size of the block as well. I call these pictures elements.
What happens is typified by adding a rectangle to the element. If I do the following:
BoxObj box;
GetBox (box);
SelectedRectangle = new Rect( box.left, box.bottom, box.right, box.top, this );
Append ( SelectedRectangle );
the SelectedRectangle would normally appear in the correct position unless the element has aquired a transformer or a element or a label in the picture are outside the size. What happens:
1) If a transformer is present then the rectangle is transformed by twice the transformation represented by the transformer. This is partly connected to the fact that that I am using the graphic context of the element in the constructor and that the element is doing the Appending. But if I try anything else I can't get it to work. This situation at least is predictable so I can hack a result. viz
if ( t )
{
float a00, a01, a10, a11, a20, a21;
t->GetEntries ( a00, a01, a10, a11, a20, a21 );
SelectedRectangle->Translate ( -2*(a20), -2*(a21) );
}
2) If any element or label is outside the size then, despite the hack, the SelectedRectangle will be shifted by the amount that the label or element is outside the size.
When it comes down to it I can't totally prevent the second problem, and I would dearly like to have a better solution to the first problem, or better still simply not have the first problem.
Help?
Ta
Nathan
From: njs@planet.bt.co.uk ()
Path: njs
Newsgroups: comp.windows.interviews
Distribution: planet
Followup-To:
Organization: DNM42, BT Labs, Martlesham Heath, Ipswich, UK.
Subject: Using pictures in a GraphicBlock
Keywords: libgraphic, IV2.6, GraphicBlock
Just to set the scene: In 2.6 a GraphicBlock in the Interactor interface to interacting with graphics. I am using one to create pictures of things ( suprise suprise ) with which I can interact using menus and such like.
What I do is put a very large picture into the block first which then defines its natural size. I then add further pictures containing stencils which contain bitmaps to represent the real world objects that I am manipulating. All well and good.
The unfortunate part is that I can transform the stencils outside the the natural size of the block (problem 1), and when I add labels to the stencils these can sometimes appear outside the size of the block as well. I call these pictures elements.
What happens is typified by adding a rectangle to the element. If I do the following:
BoxObj box;
GetBox (box);
SelectedRectangle = new Rect( box.left, box.bottom, box.right, box.top, this );
Append ( SelectedRectangle );
the SelectedRectangle would normally appear in the correct position unless the element has aquired a transformer or a element or a label in the picture are outside the size. What happens:
1) If a transformer is present then the rectangle is transformed by twice the transformation represented by the transformer. This is partly connected to the fact that that I am using the graphic context of the element in the constructor and that the element is doing the Appending. But if I try anything else I can't get it to work. This situation at least is predictable so I can hack a result. viz
if ( t )
{
float a00, a01, a10, a11, a20, a21;
t->GetEntries ( a00, a01, a10, a11, a20, a21 );
SelectedRectangle->Translate ( -2*(a20), -2*(a21) );
}
2) If any element or label is outside the size then, despite the hack, the SelectedRectangle will be shifted by the amount that the label or element is outside the size.
When it comes down to it I can't totally prevent the second problem, and I would dearly like to have a better solution to the first problem, or better still simply not have the first problem.
Help?
Ta
Nathan
From: njs@planet.bt.co.uk ()
Path: njs
Newsgroups: comp.windows.interviews
Distribution: planet
Followup-To:
Organization: DNM42, BT Labs, Martlesham Heath, Ipswich, UK.
Subject: Using pictures in a GraphicBlock
Keywords: libgraphic, IV2.6, GraphicBlock
Just to set the scene: In 2.6 a GraphicBlock in the Interactor interface to interacting with graphics. I am using one to create pictures of things ( suprise suprise ) with which I can interact using menus and such like.
What I do is put a very large picture into the block first which then defines its natural size. I then add further pictures containing stencils which contain bitmaps to represent the real world objects that I am manipulating. All well and good.
The unfortunate part is that I can transform the stencils outside the the natural size of the block (problem 1), and when I add labels to the stencils these can sometimes appear outside the size of the block as well. I call these pictures elements.
What happens is typified by adding a rectangle to the element. If I do the following:
BoxObj box;
GetBox (box);
SelectedRectangle = new Rect( box.left, box.bottom, box.right, box.top, this );
Append ( SelectedRectangle );
the SelectedRectangle would normally appear in the correct position unless the element has aquired a transformer or a element or a label in the picture are outside the size. What happens:
1) If a transformer is present then the rectangle is transformed by twice the transformation represented by the transformer. This is partly connected to the fact that that I am using the graphic context of the element in the constructor and that the element is doing the Appending. But if I try anything else I can't get it to work. This situation at least is predictable so I can hack a result. viz
if ( t )
{
float a00, a01, a10, a11, a20, a21;
t->GetEntries ( a00, a01, a10, a11, a20, a21 );
SelectedRectangle->Translate ( -2*(a20), -2*(a21) );
}
2) If any element or label is outside the size then, despite the hack, the SelectedRectangle will be shifted by the amount that the label or element is outside the size.
When it comes down to it I can't totally prevent the second problem, and I would dearly like to have a better solution to the first problem, or better still simply not have the first problem.
Help?
Ta
Nathan
Technical Details
Message-ID:
<1992Oct28.110447.13719@planet.bt.co.uk>Path:
arc1-ca.pugleaf.net!sparky!uunet!kithrup!hoptoad!pacbell.com!ames!haven.umd.edu!darwin.sura.net!paladin.american.edu!news.univie.ac.at!hp4at!mcsun!uknet!axion!planet.bt.co.uk!njsShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!kithrup!hoptoad!pacbell.com!ames!haven.umd.edu!darwin.sura.net!paladin.american.edu!news.univie.ac.at!hp4at!mcsun!uknet!axion!planet.bt.co.uk!njs From: njs@planet.bt.co.uk Newsgroups: comp.windows.interviews Subject: Using pictures in a GraphicBlock Keywords: libgraphic, IV2.6, GraphicBlock Message-ID: <1992Oct28.110447.13719@planet.bt.co.uk> Date: 28 Oct 92 11:04:47 GMT Sender: news@planet.bt.co.uk Organization: DNM42, BT Labs, Martlesham Heath, Ipswich, UK. Lines: 1080 Originator: njs@andromeda