Adsense Ad

Tuesday 9 May 2017

Oracle Forms: Set Window Property

SET_WINDOW_PROPERTY built-in

Description

Sets a property for the indicated window.

Syntax

SET_WINDOW_PROPERTY (window_id Window, property NUMBER, value VARCHAR2);

SET_WINDOW_PROPERTY (window_id Window, property NUMBER, x NUMBER);
SET_WINDOW_PROPERTY (window_id Window, property NUMBER,
x                 NUMBER,
y                 NUMBER);
SET_WINDOW_PROPERTY (window_name VARCHAR2, property NUMBER, value VARCHAR2);
SET_WINDOW_PROPERTY (window_name VARCHAR2,
property             NUMBER,
x                                NUMBER);
SET_WINDOW_PROPERTY
(window_name     VARCHAR2,
property             NUMBER,
x                    NUMBER,
y                    NUMBER);

Built-in Type  unrestricted procedure

Enter Query Mode  yes

Parameters

window_id                               Specifies the unique ID that Form Builder assigns the window when

created.  Use the FIND_WINDOW built-in to return the ID to an

appropriately typed variable.  The data type of the ID is Window.

window_name                         Specifies the name that you gave the window  when creating it.  The data

type of the name is VARCHAR2.

property                                    Specify one of the following window properties:


                                                      BACKGROUND_COLOR  The color of the object’s background region.

DIRECTION    Specifies the layout direction for bidirectional objects.

Valid values are DIRECTION_DEFAULT, RIGHT_TO_LEFT,

LEFT_TO_RIGHT.



FILL_PATTERN The pattern to be used for the object’s fill region.

Patterns are rendered in the two colors specified by Background Color and

Foreground Color.

FONT_NAME The font family, or typeface, that should be used for text in the object. The list of fonts available is system-dependent.

FONT_SIZE The size of the font, specified in points.

FONT_SPACING The width of the font, that is, the amount of space

between characters (kerning).

FONT_STYLE The style of the font.

FONT_WEIGHT The weight of the font.

FOREGROUND_COLOR  The color of the object’s foreground region.

For items, the Foreground Color attribute defines the color of text displayed

in the item.

HEIGHT Specifies the height of the window.

HIDE_ON_EXIT Specifies whether Form Builder hides the current

window automatically when the operator navigates to an item in another

window.  Valid values are PROPERTY_TRUE and PROPERTY_FALSE.

ICON_NAME  Specifies the file name of the icon resource associated with

a window item when the window is minimized.

POSITION Specifies an x, y pair indicating the location for the window

on the screen.

TITLE Sets the title of the window.

VISIBLE Specifies whether the window is to be displayed.  Valid values

are PROPERTY_TRUE and PROPERTY_FALSE.

WHITE_ON_BLACK  Specifies that the object is to appear on a

monochrome bitmap display device as white text on a black background.

WINDOW_SIZE Specifies a width, height pair indicating the size of the

window on the screen.

WINDOW_STATE Specifies the current display state of the window.

Valid values are NORMAL, MAXIMIZE, or MINIMIZE.

WIDTH Specifies the width of the window.

X_POS  Sets the x coordinate for the window’s upper left corner on the

screen.

Y_POS  Sets the y coordinate for the window’s upper left corner on the

screen.

value                                          The following constants can be passed as arguments to the property values

described earlier:

PROPERTY_TRUE Specifies that the property is to be set to the TRUE

state.  This applies specifically to the VISIBLE property.

PROPERTY_FALSE Specifies that the property is to be set to the

FALSE state.   This applies specifically to the VISIBLE property.

The following constants can be passed as arguments for use with the

WINDOW_STATE property:

NORMAL  Specifies that the window is displayed normally according to

the current Width, Height, X Position, and Y Position property settings.

MAXIMIZE Specifies that the window is enlarged to fill the screen

according to the display style of the window manager.

MINIMIZE Specifies that the window is minimized, or iconified.

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.

Usage Notes

On Microsoft Windows, forms run inside the MDI application window. You can use SET_WINDOW_PROPERTY to set the following properties of the MDI application window:

·         TITLE

·         POSITION

·         WIDTH, HEIGHT

·         WINDOW_SIZE

·         WINDOW_STATE

·         X_POS, Y_POS

To reference the MDI application window in a call to SET_WINDOW_PROPERTY, use the constant

FORMS_MDI_WINDOW:

Set_Window_Property(FORMS_MDI_WINDOW, POSITION, 5,10)
Set_Window_Property(FORMS_MDI_WINDOW, WINDOW_STATE, MINIMIZE)


SET_WINDOW_PROPERTY restrictions
·         If you change the size or position of a window, the change remains in effect for as long as the form is running, or until you explicitly change the window’s size or position again. Closing the window and reopening it does not reset the window to its design-time defaults. You must assign the design-time defaults to variables if you intend to set the window back to those defaults.

SET_WINDOW_PROPERTY examples
/*

**  Built-in:  SET_WINDOW_PROPERTY
**  Example:   See FIND_WINDOW
*/

3 comments:

Usman said...

Dear Jawad,
Kindly, guide me how to change window title at run time like ..when we change
Prompt text same i want to change my window .please guid me.

set_item_property('emp.name',prompt_text,'new_prompt');

Anonymous said...

abc

Unknown said...

SET_WINDOW_PROPERTY(FORMS_MDI_WINDOW, TITLE, 'Opening and Closing Windows Programmatically');