Using SYSTEM.MOUSE_ITEM In Oracle Forms
2016-12-25 18:19
507 查看
If the mouse is in an item, SYSTEM.MOUSE_ITEM represents the name of that item as a CHAR value.
For example, if the mouse is in Item1 in Block2, the value for SYSTEM.MOUSE_ITEM is :BLOCK2.ITEM1.
SYSTEM.MOUSE_ITEM is NULL if:
· the mouse is not in an item
· the operator presses the left mouse button, then moves the mouse
· the platform is not a GUI platform
SYSTEM.MOUSE_ITEM examples
/*
Example: Dynamically repositions an item if:
1) the operator clicks mouse button 2 on an item and
2) the operator subsequently clicks mouse button 2 on an area of the canvas that is not directly on top of another item.
*/
DECLARE
item_to_move VARCHAR(50);
the_button_pressed VARCHAR(50);
target_x_position NUMBER(3);
target_y_position NUMBER(3);
the_button_pressed VARCHAR(1);
BEGIN
/* Get the name of the item that was clicked.
*/
item_to_move := :System.Mouse_Item;
the_button_pressed := :System.Mouse_Button_Pressed;
/*
If the mouse was clicked on an area of a canvas that is not directly on top of another item, move the item to the new mouse location.
*/
IF item_to_move IS NOT NULL AND the_button_pressed = ’2’
THEN
target_x_position := To_Number(:System.Mouse_X_Pos);
target_y_position := To_Number(:System.Mouse_Y_Pos);
Set_Item_Property(item_to_move,position,
target_x_position,target_y_position);
target_x_position := NULL;
target_y_position := NULL;
item_to_move := NULL;
END IF;
END;
See also: http://www.foxinfotech.in/2015/01/create-xo-checker-game-with-oracle-forms.html
For example, if the mouse is in Item1 in Block2, the value for SYSTEM.MOUSE_ITEM is :BLOCK2.ITEM1.
SYSTEM.MOUSE_ITEM is NULL if:
· the mouse is not in an item
· the operator presses the left mouse button, then moves the mouse
· the platform is not a GUI platform
SYSTEM.MOUSE_ITEM examples
/*
Example: Dynamically repositions an item if:
1) the operator clicks mouse button 2 on an item and
2) the operator subsequently clicks mouse button 2 on an area of the canvas that is not directly on top of another item.
*/
DECLARE
item_to_move VARCHAR(50);
the_button_pressed VARCHAR(50);
target_x_position NUMBER(3);
target_y_position NUMBER(3);
the_button_pressed VARCHAR(1);
BEGIN
/* Get the name of the item that was clicked.
*/
item_to_move := :System.Mouse_Item;
the_button_pressed := :System.Mouse_Button_Pressed;
/*
If the mouse was clicked on an area of a canvas that is not directly on top of another item, move the item to the new mouse location.
*/
IF item_to_move IS NOT NULL AND the_button_pressed = ’2’
THEN
target_x_position := To_Number(:System.Mouse_X_Pos);
target_y_position := To_Number(:System.Mouse_Y_Pos);
Set_Item_Property(item_to_move,position,
target_x_position,target_y_position);
target_x_position := NULL;
target_y_position := NULL;
item_to_move := NULL;
END IF;
END;
See also: http://www.foxinfotech.in/2015/01/create-xo-checker-game-with-oracle-forms.html
相关文章推荐
- Change An Item Property Using Set_Item_Property In Oracle Forms
- An Example Of Validating Text Item In Oracle Forms Using When-Validate-Item Trigger
- Populate A List Item With Record Group In Oracle Forms Using Populate_List And Create_Group_From_Query Command
- Populate A List Item With Record Group In Oracle Forms Using Populate_List And Create_Group_From_Query Command
- An Example of Pre-Query and Post-Query Triggers in Oracle Forms With Using Display_Item to Highlight Dynamically
- Shifting List Item Values From One List To Another In Oracle Forms
- Populating Tabular Data Block Manually Using Cursor in Oracle Forms
- Set Font Properties On Mouse Hover Of Push Button And Text Items At Run time In Oracle Forms
- Display LOV (List Of Values) Using Show_Lov In Oracle Forms
- Determining Current Block and Current Item in Oracle Forms
- Define Custom Data Filter Using Pre-Query Trigger In Oracle Forms
- Populating Display Item Value On Query In Oracle Forms
- Using Single Alert For Messages And Confirmation Messages In Oracle Forms With Set_Alert_Button_Property
- Enter Query Mode Search Tricks Using Enter_Query Built-in in Oracle Forms
- Populating Tree Item With Record Group In Oracle Forms
- Using Post_Query Trigger in Oracle Forms
- Know How And When To Use System.Message_Level To Control Messages In Oracle Forms
- Displaying Modal Window Messages in Oracle Forms Using Show_Alert
- Perform Cut Copy Paste Operations Using Cut_Region Copy_Region Paste_Region Commands In Oracle Forms
- Adding List Item Element At Runtime In Oracle Forms