11.01.2013 Views

Oracle Forms Developer – Form Builder Reference, Volume 1

Oracle Forms Developer – Form Builder Reference, Volume 1

Oracle Forms Developer – Form Builder Reference, Volume 1

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

SYSTEM.MOUSE_ITEM system variable<br />

Syntax<br />

SYSTEM.MOUSE_ITEM<br />

Description<br />

If the mouse is in an item, SYSTEM.MOUSE_ITEM represents the name of that item as a CHAR value.<br />

For example, if the mouse is in Item1 in Block2, the value for SYSTEM.MOUSE_ITEM is<br />

:BLOCK2.ITEM1.<br />

SYSTEM.MOUSE_ITEM is NULL if:<br />

• the mouse is not in an item<br />

• the operator presses the left mouse button, then moves the mouse<br />

• the platform is not a GUI platform<br />

SYSTEM.MOUSE_ITEM examples<br />

404<br />

/* trigger: When-Mouse-Click<br />

** Example: Dynamically repositions an item if:<br />

** 1) the operator clicks mouse button 2<br />

** on an item and<br />

** 2) the operator subsequently clicks mouse button<br />

** 2 on an area of the canvas that is<br />

** not directly on top of another item.<br />

*/<br />

DECLARE<br />

item_to_move VARCHAR(50);<br />

the_button_pressed VARCHAR(50);<br />

target_x_position NUMBER(3);<br />

target_y_position NUMBER(3);<br />

the_button_pressed VARCHAR(1);<br />

BEGIN<br />

/* Get the name of the item that was clicked.<br />

*/<br />

item_to_move := :System.Mouse_Item;<br />

the_button_pressed := :System.Mouse_Button_Pressed;<br />

/*<br />

** If the mouse was clicked on an area of a canvas that is<br />

** not directly on top of another item, move the item to<br />

** the new mouse location.<br />

*/<br />

IF item_to_move IS NOT NULL AND the_button_pressed = ’2’<br />

THEN<br />

target_x_position := To_Number(:System.Mouse_X_Pos);<br />

target_y_position := To_Number(:System.Mouse_Y_Pos);<br />

Set_Item_Property(item_to_move,position,<br />

target_x_position,target_y_position);<br />

target_x_position := NULL;<br />

target_y_position := NULL;<br />

item_to_move := NULL;<br />

END IF;<br />

END;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!