Home » Developer & Programmer » Forms » How to move canvas items
How to move canvas items [message #180774] Wed, 05 July 2006 03:57 Go to next message
anna marie
Messages: 26
Registered: June 2006
Location: Philippines
Junior Member
Hi all,

I want to move canvas item together with it's text box item but
I can't do it. "FRM-41045 Invalid ID" appear.

This code works for the block item:
SET_ITEM_PROPERTY  ('BLOCK3.dataitem1',POSITION, 430, 144);


but this one doesn't.
SET_ITEM_PROPERTY  ('CANVAS2.TEXT16', POSITION, 388, 146);


Please help.
Re: How to move canvas items [message #180775 is a reply to message #180774] Wed, 05 July 2006 04:11 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
An Item is attached to a block, not a canvas. The notation is BLOCK.ITEM. You can catch these 'invalid id' messages by first issuing a find_item and using the returned ID if it is not null. You can use the ID_NULL built-in for that.

MHE
Re: How to move canvas items [message #180785 is a reply to message #180774] Wed, 05 July 2006 04:34 Go to previous messageGo to next message
anna marie
Messages: 26
Registered: June 2006
Location: Philippines
Junior Member
Thanks, but I'v already tried that.
Null id returned.
I can't figure why..
Re: How to move canvas items [message #180786 is a reply to message #180785] Wed, 05 July 2006 04:36 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
anna marie wrote on Wed, 05 July 2006 11:34

Thanks, but I'v already tried that.
Null id returned.
I can't figure why..
I do. Read my previous reply: the notation is: BLOCK.ITEM. Canvas items, like rectangulars, cannot be moved around runtime.

MHE
Re: How to move canvas items [message #180790 is a reply to message #180774] Wed, 05 July 2006 04:59 Go to previous messageGo to next message
anna marie
Messages: 26
Registered: June 2006
Location: Philippines
Junior Member
Yes, but even if I am not going to move it,why NULL id returned.
Is the following code still wrong? I'm using old version 2.1

Declare
it_id   Item; 
Begin
it_id := Find_Item('BLOCK3.LABEL2'); 

IF Id_Null(it_id) THEN     
message('Null ID returned');
ELSE 
SET_ITEM_PROPERTY  (it_id, ITEM_SIZE, 100, 44);
END IF;

End;

Re: How to move canvas items [message #180947 is a reply to message #180774] Wed, 05 July 2006 23:11 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Turn the text item into a 'real' item by defining it to a 'control' (non-database) block, assign it a value there instead of on the canvas and then you can move it.

In later versions of Forms there is a prompt associated with each item which will move when you move its item.

David
Re: How to move canvas items [message #180958 is a reply to message #180774] Thu, 06 July 2006 00:29 Go to previous messageGo to next message
anna marie
Messages: 26
Registered: June 2006
Location: Philippines
Junior Member
I use the prompt text instead and it works!
Thanks!
Re: How to move canvas items [message #180962 is a reply to message #180958] Thu, 06 July 2006 01:31 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
I thought you said you are using Version 2.1?

David
Re: How to move canvas items [message #180968 is a reply to message #180774] Thu, 06 July 2006 02:01 Go to previous message
anna marie
Messages: 26
Registered: June 2006
Location: Philippines
Junior Member
Yes, it's working as well

[Updated on: Thu, 06 July 2006 02:40]

Report message to a moderator

Previous Topic: rsf80.vrf(!): start block token ' End of File ' found
Next Topic: Widening and Shrinking fields in Forms and Auto size (merged)
Goto Forum:
  


Current Time: Fri Sep 20 08:30:57 CDT 2024