The FileSelector Object: 4.3 File Selector Use: Rescanning Directories

Up: GEOS SDK TechDocs | Up | Prev: 4.2 The Current Selection | Next: 4.4 Setting Scalable UI Data
MSG_GEN_FILE_SELECTOR_RESCAN, MSG_GEN_FILE_SELECTOR_SUSPEND, MSG_GEN_FILE_SELECTOR_END_SUSPEND

Each time the File Selector changes directories, it scans that directory and displays only the files it is supposed to. It looks into each file briefly to check the file against each criterion set in the File Selector. You can force the GenFileSelector to rescan the current directory with the message MSG_GEN_FILE_SELECTOR_RESCAN .

Occasionally you will want to scan the current directory only once after changing many parameters instead of rescanning after each change (search limitations, current volume, current selection, etc.). To optimize redrawing and rescanning, you can temporarily keep the GenFileSelector from scanning each time a MSG_GEN_FILE_SELECTOR_SET_... message is sent. To do this, send the following messages (both must be used, though not at the same time):

MSG_GEN_FILE_SELECTOR_SUSPEND
Notifies the File Selector that several operations in a row are coming and that it should suspend scanning the disk until the counterpart to this message (below) is received.
MSG_GEN_FILE_SELECTOR_END_SUSPEND
Indicates to the File Selector that directories may now be rescanned and displayed.

MSG_GEN_FILE_SELECTOR_RESCAN

void	MSG_GEN_FILE_SELECTOR_RESCAN();

This message causes the File Selector to rescan its current directory. The File Selector will re-build and re-display its entire file list. This message will only work when the File Selector is visible on the screen.

Source: Unrestricted.

Destination: Any GenFileSelector object that is on the screen.

Interception: Generally not intercepted.

MSG_GEN_FILE_SELECTOR_SUSPEND

Boolean	MSG_GEN_FILE_SELECTOR_SUSPEND();

This message causes the File Selector to suspend directory scans until a MSG_GEN_FILE_SELECTOR_END_SUSPEND is received. This provides the ability to avoid unnecessary directory rescans when several different attributes are being changed in succession (e.g. volume, mask, and file types).

No user action is affected by this message; only the following attribute-setting messages will be affected (their normal automatic rescan will not happen). Note that all messages have the prefix MSG_GEN_FILE_SELECTOR_ :

SET_SELECTION SET_FULL_SELECTION_PATH
SET_MASK SET_FILE_ATTRS
SET_TOKEN SET_CREATOR
SET_GEODE_ATTRS SET_ATTRS
SET_FILE_CRITERIA

In addition to the above messages, the GenClass message MSG_GEN_PATH_SET will also be suspended.

Source: Unrestricted.

Destination: Any non-suspended GenFileSelector object.

Parameters: None.

Return: An error flag: true if the File Selector is already suspended, false if the suspension is successful.

Interception: Generally not intercepted.

Warnings: After suspending a File Selector with this message, be sure to unsuspend it with MSG_GEN_FILE_SELECTOR_END_SUSPEND .

MSG_GEN_FILE_SELECTOR_END_SUSPEND

Boolean	MSG_GEN_FILE_SELECTOR_END_SUSPEND();

This message unsuspends a File Selector that had previously been suspended with MSG_GEN_FILE_SELECTOR_SUSPEND . This message automatically causes a directory rescan. Because multiple suspension attempts are disallowed, this message only needs to be sent once to unsuspend the File Selector.

Source: Unrestricted.

Destination: Any suspended GenFileSelector object.

Parameters: None.

Return: An error flag: true if the File Selector was not previously suspended, false if the File Selector is successfully unsuspended.

Interception: Generally not intercepted.


Up: GEOS SDK TechDocs | Up | Prev: 4.2 The Current Selection | Next: 4.4 Setting Scalable UI Data