Home » Developer & Programmer » Forms » Setting LINE ITEM (graphics object) dynamically (Merged)
Setting LINE ITEM (graphics object) dynamically (Merged) [message #124422] Sat, 18 June 2005 05:46 Go to next message
wael890610
Messages: 17
Registered: June 2005
Location: Egypt-Ismaelia
Junior Member

Hi all this is my 1st tobic in ur forum
I want to ask 3 questions.

1-i have an IMAGE item , I whant hide this item when the event mouse move(using WHEN_MOUSE_MOVE & SET_ITEM_PROPERTY) .i have error frm-41016 . there is no reason for this error .

2-I have LINE item , am traying to use FIND_ITEM (‘line name’) to set its color property at run time . but I have error couldn’t find item id ( line item appear in graphic not in data block)

3-I group 3 LINE item in group N and I want to affect all of them as one related item (change the color of group N affect all 3 lines
Thnx all[/FONT][/FONT][/FONT]
change LINE item property [message #124509 is a reply to message #124422] Sun, 19 June 2005 15:34 Go to previous messageGo to next message
wael890610
Messages: 17
Registered: June 2005
Location: Egypt-Ismaelia
Junior Member

i want to change line item property using set_item_property but i couldn't use FIND_ITEM
Re: problem with SET_ITEM_PROPERTY [message #124521 is a reply to message #124422] Sun, 19 June 2005 19:52 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
I'll answer point 3 first and come back to the others later.

Quote:

3-I group 3 LINE item in group N and I want to affect all of them as one related item (change the color of group N affect all 3 lines


The current_record visual atribute only affects the current line, and only while it is the active line.

To set three (3) lines to a different colour you need to use set_item_instance_property on each item on each on the lines about which you are interested. That is, go to the first line of interest, change each item one after the other, then go to the next line and do the same again.

Quote:

2-I have LINE item , am traying to use FIND_ITEM (‘line name’) to set its color property at run time . but I have error couldn’t find item id ( line item appear in graphic not in data block)


If _YOU_ can't see the item in the Forms Builder Object Navigator then the find_item command will not be able to find it either. If is _DOES_ exist in the Object Navigator then please paste the code you are using in your reply.

David

[Updated on: Sun, 19 June 2005 19:55]

Report message to a moderator

Re: change LINE item property [message #124528 is a reply to message #124509] Sun, 19 June 2005 20:25 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
A line is actually a 'record' or a set of 'items'. Set_item_property only works on one item at a time.

Approach it this way, using one command per item and you should be okay.

David
Re: problem with SET_ITEM_PROPERTY [message #124530 is a reply to message #124422] Sun, 19 June 2005 20:38 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Quote:

1-i have an IMAGE item , I whant hide this item when the event mouse move(using WHEN_MOUSE_MOVE & SET_ITEM_PROPERTY) .i have error frm-41016 . there is no reason for this error .



I know it was a typo, but it is When-Mouse-Move (hyphens, not underscores).

I found this googling.

"FRM-41016 cannot set displayed attribute of the current item"

Please supply the code that is giving the error. Have you proved that it is this 'set_item_property' that is giving the error (by putting "message; pause;" pairs both before and after the offending statement)?

What version of Forms are you using?

David
Re: problem with SET_ITEM_PROPERTY [message #124644 is a reply to message #124530] Mon, 20 June 2005 13:33 Go to previous messageGo to next message
wael890610
Messages: 17
Registered: June 2005
Location: Egypt-Ismaelia
Junior Member

am using forms 6
i draw line in layout editor and it apear in under its canvas
, am using this code to affect its property for example visiable.

DECLARE
it_id Item:=find_item('LINE15');
BEGIN
Set_Item_Property(it_id,VISIBLE,property_false);
END;


i think am using wrong code(Set_Item_Property is for data block items only. but what can i use)
please give me sample code.
Re: change LINE item property [message #124663 is a reply to message #124528] Mon, 20 June 2005 17:22 Go to previous messageGo to next message
wael890610
Messages: 17
Registered: June 2005
Location: Egypt-Ismaelia
Junior Member

would u please give me sample code to change LINE or any other graphic property(color,visibla,.............)
Re: problem with SET_ITEM_PROPERTY [message #124672 is a reply to message #124644] Mon, 20 June 2005 20:15 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
I believe that you can't address a graphic item directly, but if you did it would be 'canvas.graphic' not just 'graphic'.

Put the line on a separate stacked canvas which just contains that line. You can then manipulate the canvas as a whole using hide_view, show_view, and set_view_property.

David
Re: change LINE item property [message #124680 is a reply to message #124663] Mon, 20 June 2005 21:09 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
From the reference manual:

/*
** Built-in: SET_ITEM_INSTANCE_PROPERTY
** Example: Change the visual attribute of each item instance in the
** current record
*/

DECLARE
   cur_itm     VARCHAR2 (80);
   cur_block   VARCHAR2 (80) := :System.Cursor_Block;
BEGIN
   cur_itm := Get_Block_Property (cur_block, FIRST_ITEM);

   WHILE (cur_itm IS NOT NULL)
   LOOP
      cur_itm := cur_block || '.' || cur_itm;
      Set_Item_Instance_Property (cur_itm,
                                  CURRENT_RECORD,
                                  VISUAL_ATTRIBUTE,
                                  'My_Favorite_Named_Attribute');
      cur_itm := Get_Item_Property (cur_itm, NEXTITEM);
   END LOOP;
END;


David
Re: problem with SET_ITEM_PROPERTY [message #124768 is a reply to message #124672] Tue, 21 June 2005 06:41 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
You could place the graphic on a stacked canvas and play around with show_view and hide_view.

I've made a small example.

[EDIT: sorry David, you were first Wink]
MHE

[Updated on: Tue, 21 June 2005 06:42]

Report message to a moderator

Re: problem with SET_ITEM_PROPERTY [message #124832 is a reply to message #124768] Tue, 21 June 2005 14:04 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Topics merged.

MHE
Re: problem with SET_ITEM_PROPERTY [message #124844 is a reply to message #124832] Tue, 21 June 2005 16:04 Go to previous messageGo to next message
wael890610
Messages: 17
Registered: June 2005
Location: Egypt-Ismaelia
Junior Member

Cool
mr maheer : u set the visiual property but not all the property (color,length,........)

mr david : please explain the use of loop in ur code
and please give me actual example

>>>>>>>>>>>>>i am so sory i know that u are tired of my many questions but i want to be agood developer this mean i can do what ever i want to do even there are limits of may resources i must find alternative solutions<<<<<<<<<<<<<<<<<
Re: problem with SET_ITEM_PROPERTY [message #124888 is a reply to message #124844] Wed, 22 June 2005 02:14 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
wael890610,

Please confirm what others questions you need answered as I believe the quoted code gives a full example of how to 'loop' through all the items of a record.

David
Previous Topic: Time
Next Topic: Forms Application
Goto Forum:
  


Current Time: Fri Sep 20 10:33:06 CDT 2024