Home » Developer & Programmer » Forms » Visual Attributes Run time
Visual Attributes Run time [message #80309] |
Thu, 05 September 2002 08:49 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
harley
Messages: 5 Registered: September 2002
|
Junior Member |
|
|
Hi
I want to know how i can set up the background color
Visual Attribute property of a tet box in the run time
|
|
|
Re: Visual Attributes Run time [message #80378 is a reply to message #80309] |
Sun, 15 September 2002 18:28 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
LALA
Messages: 18 Registered: August 2002
|
Junior Member |
|
|
Hi,
Hope this helps..
1. In the Object Navigator, create a named visual attribute. To this..
1.1 Click on the Visual Attribute node, then click Create button on the toolbar(a button with + sign)
1.2 set the background color on the property pallete, you may change "named visual attribute" name property in descriptive manner.
2. Heres sample code...changes text item background when record updated, or when theres new record. Those text item only where the cursor is positioned will change.
DECLARE
it_id ITEM;
cur_rec NUMBER;
bk_id Block;
cur_blk VARCHAR2(40) := :System.Cursor_Block;
BEGIN
bk_id := Find_Block(cur_blk );
cur_rec := Get_Block_Property( bk_id, CURRENT_RECORD);
it_id := Find_Item('MACHINES.MACH_DESC');
IF :SYSTEM.RECORD_STATUS IN ('CHANGED','INSERT') THEN
COMMIT;
SET_ITEM_INSTANCE_PROPERTY (it_id,cur_rec,VISUAL_ATTRIBUTE,'UPDATE_INDICATOR');
NEXT_RECORD;
ELSE
NEXT_RECORD;
END IF;
END;
If you want to change the background of the whole text item if you display one or more text item in your form. Use set item_property....
SET_ITEM_PROPERTY
(item_id ITEM,
property NUMBER,
value VARCHAR2);
Parameters
item_id The unique ID that Form Builder assigned to the object when it created it. Use the FIND_ITEM built-in to return the ID to a variable with datatype of ITEM.
item_name The name you gave the item when you created it. Datatype is VARCHAR2.
property The property you want to set for the given item. Possible properties are:
AUTO_HINT Determines if Form Builder will display help hints on the status line automatically when input focus is in the specified item. Valid values are PROPERTY_TRUE and PROPERTY_FALSE.
AUTO_SKIP Specifies whether the cursor should skip to the next item automatically when the operator enters the last character in a text item. Valid only for a text item. Valid values are PROPERTY_TRUE and PROPERTY_FALSE.
BORDER_BEVEL Specifies the item border bevel for the specified item instance. Valid values are RAISED, LOWERED, or NONE.
CASE_INSENSITIVE_QUERY
Specifies whether query conditions entered in the item should be case-sensitive. Valid values are PROPERTY_TRUE and PROPERTY_FALSE.
CASE_RESTRICTION Specifies the case restriction applied to any text entered in the indicated text item. Valid values are UPPERCASE, LOWERCASE, or NONE.
COMPRESS[[Under Construction]]
CONCEAL_DATA Specify the constant PROPERTY_TRUE if you want the item to remain blank or otherwise obscured when the operator enters a value. Specify the constant PROPERTY_FALSE if you want any value that is typed into the text item to be visible.
CURRENT_RECORD_ATTRIBUTE
Specifies the VARCHAR2 name of a named visual attribute to be associated with the given item. If the named visual attribute does not exist, you will get an error message.
DIRECTION Specifies the layout direction for bidirectional objects. Valid values are DIRECTION_DEFAULT, RIGHT_TO_LEFT, LEFT_TO_RIGHT.
ECHO Specifies whether characters an operator types into a text item should be visible. When Echo is No, the characters typed are hidden. Used for password protection. Valid values are PROPERTY_TRUE and PROPERTY_FALSE.
ENABLED Specifies whether operators should be able to manipulate an item. Valid values are PROPERTY_TRUE and PROPERTY_FALSE.
Note: Setting Enabled to No will cause other item property settings to change. Consult the "Propagation of Property Changes" section for details.
FIXED_LENGTH Specifies whether the item's value should be validated against the setting of the item's Max Length property. When FIXED_LENGTH is True, the item is valid only if the number of characters in its value equals the Max Length setting. Valid values are PROPERTY_TRUE and PROPERTY_FALSE.
FORMAT_MASK Specifies the display format and input accepted for data in text items.
HEIGHT Specifies the height of the item.
ICON_NAME Specifies the file name of the icon resource associated with a button item having the iconic property set to ON.
IMAGE_DEPTH Specifies the depth of color to be applied to an image item.
INSERT_ALLOWED In a new record, allows operator to insert items normally when set to PROPERTY_TRUE. Specify PROPERTY_FALSE to specify that the item does not accept modification, but is displayed normally (not grayed out). (Insert_Allowed does not propagate changes to the Enabled property.)
ITEM_IS_VALID Specifies whether the current item should be considered valid. Set to PROPERTY_TRUE or PROPERTY_FALSE.
ITEM_SIZE Specifies a width and height for the item as two numbers separated by a comma. Use the syntax that includes x, y.
JUSTIFICATION The text alignment (text and display items only). Valid values are ALIGNMENT_START, ALIGNMENT_END, ALIGNMENT_LEFT, ALIGNMENT_ CENTER, ALIGNMENT_RIGHT.
KEEP_POSITION Specifies whether the Keep Cursor Position property should be Yes or No. When Keep Cursor Position is Yes, the cursor returns to the same position it was in when it left the text item. When Keep Cursor Position is No, the cursor returns to the default position in the text item. Valid values are PROPERTY_TRUE and PROPERTY_FALSE.
LABEL Specifies the VARCHAR2 string that you want displayed as the label of the item. This property is only valid for items that have labels, such as buttons.
LOCK_RECORD_ON_CHANGE
Specify the constant PROPERTY_TRUE if you want the record to be locked when this item is changed. Specify the constant PROPERTY_FALSE if you do not want the record locked when this item is changed. Use primarily when connecting to a non-ORACLE data source that does not have row-level locking.
LOV_NAME Specify the VARCHAR2 name of an LOV to be associated with the given item. If the LOV name does not exist, you will get an error message.
MOUSE_NAVIGATE Specifies whether Form Builder should navigate and set focus to the item when the operator activates the item with the mouse. Specify the constant PROPERTY_TRUE if you want the operator to be able to navigate to the item using the mouse. Specify the constant PROPERTY_FALSE if you want a mouse click to keep the input focus in the current item.
NAVIGABLE Specify the constant PROPERTY_TRUE if you want the operator to be able to navigate to the item using default keyboard navigation. Specify the constant PROPERTY_FALSE if you want to disable default keyboard navigation to the item. (Keyboard Navigable does not propagate changes to the Enabled property.)
NEXT_NAVIGATION_ITEM
Returns the name of the item that is defined as the "next navigation item" with respect to this current item.
POPUPMENU_CONTENT_ITEM
Specifies the setting for any of the OLE popup menu item properties:
n
POPUPMENU_COPY_ITEM
n
POPUPMENU_CUT_ITEM
n
POPUPMENU_DELOBJ_ITEM
n
POPUPMENU_INSOBJ_ITEM
n
POPUPMENU_LINKS_ITEM
n
POPUPMENU_OBJECT_ITEM
n
POPUPMENU_PASTE_ITEM
n
POPUPEMNU_PASTESPEC_ITEM
Specify the character string HIDDEN for the OLE popup menu item not to be displayed on the OLE popup menu. Specify the character string ENABLED for the OLE popup menu item to be displayed and enabled. Specify the character string DISABLED for the OLE popup menu item to be displayed and not enabled.
POSITION Specify the x, y coordinates for the item as NUMBERs separated by a comma. Use the syntax that includes x, y.
PREVIOUS_NAVIGATION_ITEM
Specifies the name of the item that is defined as the "previous navigation item" with respect to this current item.
PRIMARY_KEY Specify the constant PROPERTY_TRUE to indicate that any record inserted or updated in the block must have a unique characteristic in order to be committed to the database. Otherwise, specify the constant PROPERTY_FALSE.
PROMPT_ALIGNMENT_OFFSET
Determines the distance between the item and its prompt.
PROMPT_DISPLAY_STYLE
Determines the prompt’s display style, either PROMPT_FIRST_RECORD, PROMPT_HIDDEN, or PROMPT_ALL_RECORDS.
PROMPT_TEXT Determines the text label that displays for an item.
PROMPT_EDGE Determines which edge the item’s prompt is attached to, either START_EDGE, END_EDGE, TOP_EDGE, or BOTTOM_EDGE.
PROMPT_EDGE_ALIGNMENT
Determines which edge the item’s prompt is aligned to, either ALIGNMENT_START, ALIGNMENT_END, or ALIGNMENT_CENTER.
PROMPT_EDGE_OFFSET Determines the distance between the item and its prompt as a VARCHAR2 value.
PROMPT_TEXT_ALIGNMENT
Determines how the prompt is justified, either ALIGNMENT_START, ALIGNMENT_LEFT, ALIGNMENT_RIGHT, ALIGNMENT_CENTER, or ALIGNMENT_END.
QUERYABLE Specify the constant PROPERTY_TRUE if you want the operator to be able to initiate a query against the item. Specify the constant PROPERTY_FALSE if you want to disallow the use of the item in a query.
QUERY_ONLY Specify an item to be queried, preventing that item from becoming part of insert or update statements. QUERY_ONLY is applicable to text items, radio groups, and check boxes. Enclose the fully-qualified item name in single quotes.
REQUIRED Specify the constant PROPERTY_TRUE if you want to force the operator to enter a value for the item. Specify the constant PROPERTY_FALSE if the item is not to be required.
SHOW_FAST_FORWARD_BUTTON
Specify the constant PROPERTY_TRUE to display on a sound item, PROPERTY_FALSE to hide it.
SHOW_PLAY_BUTTON Specify the constant PROPERTY_TRUE to display on a sound item, PROPERTY_FALSE to hide it. Note that Form Builder will hide either or , but not both.
SHOW_RECORD_BUTTON
Specify the constant PROPERTY_TRUE to display on a sound item, PROPERTY_FALSE to hide it. Note that Form Builder will hide either or , but not both.
SHOW_REWIND_BUTTON
Specify the constant PROPERTY_TRUE to display on a sound item, PROPERTY_FALSE to hide it.
SHOW_SLIDER Specify the constant PROPERTY_TRUE to display on a sound item, PROPERTY_FALSE to hide it.
SHOW_TIME_INDICATOR Specify the constant PROPERTY_TRUE to display button on a sound item, PROPERTY_FALSE to hide it.
SHOW_VOLUME_CONTROL
Specify the constant PROPERTY_TRUE to display on a sound item, PROPERTY_FALSE to hide it.
TOOLTIP_TEXT Determines the item’s tooltip text.
UPDATE_ALLOWED Specify the constant PROPERTY_TRUE if you want the operator to be able to update the item. Specify the constant PROPERTY_FALSE if you want the item protected from update.
UPDATE_COLUMN Specify the constant PROPERTY_TRUE if this column should be treated as updated, and included in the columns to be written to the database. Specify the constant PROPERTY_FALSE if this column should be treated as not updated, and not be included in the columns to be written to the database.
UPDATE_NULL Specify the constant PROPERTY_TRUE if you want the operator to be able to update the item only if its value is NULL. Specify the constant PROPERTY_FALSE if you want the operator to be able to update the value of the item regardless of whether the value is NULL.
UPDATE_PERMISSION Use UPDATE_ ALLOWED when you run against non-ORACLE data sources. Specify the constant PROPERTY_TRUE to turn on the item's UPDATEABLE and UPDATE_NULL properties. Specify the constant PROPERTY_FALSE to turn off the item's UPDATEABLE and UPDATE_NULL properties.
VALIDATE_FROM_LIST Specifies that Form Builder should validate the value of the text item against the values in the attached LOV when set to PROPERTY_TRUE. Specify PROPERTY_FALSE to specify that Form Builder should not use the LOV for validation.
VISIBLE Specifies whether the indicated item should be visible or hidden. Valid values are PROPERTY_TRUE and PROPERTY_FALSE.
Note: Setting Visible to No will cause other item property settings to change. Consult the "Propagation of Property Changes" section for details.
VISUAL_ATTRIBUTE Specify a valid named visual attribute that exists in the current form.
Note: You cannot set the visual attribute for an image item.
WIDTH Specify the width of the item as a NUMBER. The size of the units depends on how you set the Coordinate System property and default font scaling for the form.
X_POS Specify the x coordinate as a NUMBER.
Y_POS Specify the y coordinate as a NUMBER.
value Specify the value to be applied to the given property. The data type of the property determines the data type of the value you enter. For instance, if you want to set the VISIBLE property to True, you specify the constant PROPERTY_TRUE for the value. If you want to change the LABEL for the item, you specify the value, in other words, the label, as a VARCHAR2 string.
PROPERTY_TRUE Specifies that the property is to be set to the TRUE state.
PROPERTY_FALSE Specifies that the property is to be set to the FALSE state.
x Specifies the NUMBER value of the x coordinate or the width, depending on the property you specified. Specify the argument in form coordinate system units.
y Specifies the NUMBER value of the y coordinate or the height, depending on the property you specified. Specify the argument in form coordinate system units.
|
|
|
Goto Forum:
Current Time: Thu Sep 12 01:57:30 CDT 2024
|