| **Navigation:**  [[introduction.htm|Language Reference]] > 9 -  Window and Report Attributes > Window and Report Attributes >====== IMM (set immediate event notification) ====== | [[iconize set window open as icon .htm|{{btn_prev_n.gif|Previous page}}]][[introduction.htm|{{btn_home_n.gif|Return to chapter overview}}]][[ins ovr set typing mode .htm|{{btn_next_n.gif|Next page}}]] | | || {{newc7.jpg|NewC7.jpg}} **IMM** {{blk2blue.jpg|blk2blue.jpg}} The **IMM** attribute (PROP:IMM) specifies immediate event generation. **Window Usage** {{black.jpg|black.jpg}} On a WINDOW or APPLICATION the IMM attribute specifies immediate event generation whenever the user moves or resizes the window. It generates one the following events before the action is executed: EVENT:Move EVENT:Size EVENT:Restore EVENT:Maximize EVENT:Iconize If the code that handles these events executes a CYCLE statement, the action is not performed. This allows you to prevent the user from moving or resizing the window. Once the action has been performed, one or more of the following events are generated: EVENT:Moved EVENT:Sized EVENT:Restored EVENT:Maximized EVENT:Iconized Multiple post-action events generate because some actions have multiple results. For example, if the user CLICKS on the maximize button, EVENT:Maximize generates. If there is no CYCLE statement executed for this event, the action is performed, then EVENT:Maximized, EVENT:Moved, and EVENT:Sized all generate. This occurs because the window was maximized, which also moves and resizes it at the same time. **Control Usage** {{black.jpg|black.jpg}} On a REGION control, the IMM attribute generates an event whenever the mouse enters (EVENT:MouseIn), moves within (EVENT:MouseMove), or leaves (EVENT:MouseOut) the area specified by the REGION's AT attribute. The exact position of the mouse can be determined by the MOUSEX and MOUSEY procedures. On a BUTTON control, the IMM attribute indicates the BUTTON generates EVENT:Accepted when the left mouse button is pressed down on the control, instead of on its release. EVENT:Accepted repeatedly generates as along as the user keeps the mouse button pressed. The DELAY and REPEAT attributes on the BUTTON can change the rate the events generate. The IMM attribute specifies immediate event generation each time the user presses any keystroke on a LIST or COMBO control, usually requiring the QUEUE to be re-filled. This means all keys are implicitly ALRTed for the control. When the user presses a character, EVENT:NewSelection generates. For an ENTRY or SPIN control, EVENT:NewSelection generates whenever the control's contents or the cursor position changes. To do something only when the content changes, you must save the previous contents then compare against the current contents (probably using PROP:ScreenText). For a SHEET control, EVENT:NewSelection generates whenever the user clicks on a TAB (even when that TAB is already the currently selected TAB). This can be useful when there are multiple SHEET controls on the same window. **Example:** Win2 WINDOW('Some Window'),AT(58,11,174,166),MDI,DOUBLE,MAX,IMM LIST,AT(109,48,50,50),USE(?List),FROM('Que'),IMM BUTTON('&Ok'),AT(111,108,,),USE(?Ok) BUTTON('&Cancel'),AT(111,130,,),USE(?Cancel) END CODE OPEN(Win2) ACCEPT CASE EVENT() OF EVENT:Move !Prevent user from moving window CYCLE OF EVENT:Maximized !When Maximized ?List{PROP:Height} = 100 ! resize the list OF EVENT:Restored !When Restored ?List{PROP:Height} = 50 ! resize the list END END **See Also:** [[resize set variable height text control .htm|RESIZE]] [[max set maximize control or total maximum .htm|MAX]] [[icon set icon .htm|ICON]] [[delay set repeat button delay .htm|DELAY]] [[repeat set repeat button rate .htm|REPEAT]] [[entry_declare_a_data_entry_control_.htm|ENTRY]]