# Path Control

toolslib\custctrl\pathctrl.fp

This instrument driver contains functions for creating and modifying a path control. Use path control attributes to specify the type of files that appear in the path control. For example, you can specify that only directories can appear.

You can use the path control to enter file and directory paths. As you type in the path control, the control displays matching files and directories in a list box. You can navigate the items in the path control list box using the up arrow and down arrow keys. You can select an item from the list box by navigating to it and pressing ‹Enter› or by clicking on the item. Clicking on an item only works if the path control is on a non–modal panel. The current item in the list box also is selected when you click outside the list box. You can press the right arrow key to perform completion in the path control; on completion, the path control's value is set to the first matching item from the list. The path control list box is dismissed when you select an item. You can dismiss the list box without selecting an item by pressing ‹Esc›.

The path control keeps a history of the paths you enter in the control. The history stores paths that you have selected. You can access the items in the history by pressing the up arrow or down arrow keys when the list box is not visible. When the list box is visible you cannot access the history; the up arrow and down arrow keys will change the current item in the list box.

Due to interactions between the path control list box and your string control, many events occurring on your string control are not sent to your callback function. Do not rely on getting events in your callback function but instead programmatically get the value in the control when required. In most cases, your callback function receives an EVENT_VAL_CHANGED event when the value of the path control changes. Your callback function receives an EVENT_COMMIT event when a new value is committed in the path control. This can occur when you dismiss the path control list box by selecting a path or when you type a new path and press ‹Enter›. You might not get EVENT_COMMIT events in many other situations handled by a normal string control.

| Note The path control does not recognize network share names. For example, when you type \\remoteComputer\, the path control does not display any matches because it does not recognize the network shares in \\remoteComputer\. However, when you type \\remoteComputer\remoteShare\, the path control displays the files and directories in \\remoteComputer\remoteShare\.