LoadMovableCtrlSettings
- Updated2023-02-21
- 6 minute(s) read
LoadMovableCtrlSettings
int LoadMovableCtrlSettings (int panelHandle, int controlID, const char *configurationName);
Purpose
Loads movable control settings from the configuration file. You can use this function to load settings for a particular control or for all controls on a panel.
If you specify a particular control, the settings will be loaded for only that control, and you must load a configuration which was previously saved for that control. The function can fail if you attempt to load settings from a different kind of control, or if you attempt to load a configuration which has multiple controls (an entire panel) onto a single control.
If you specify -1 for the control, settings for all the controls which are specified in the configuration will be loaded and applied to the controls on the panel. The control IDs of the panel controls must match the IDs in the configuration. The controls on the panel should match the controls that were present at the time the configuration was saved. This behavior is similar to the behavior of SavePanelState and RecallPanelState in the User Interface Library.
The settings that are loaded for a control are as follows:
- The value of all the Movable Control attributes
- The position of the control, label, and digital display
- The size of the control
Parameters
Input | ||
Name | Type | Description |
panelHandle | int | The specifier for a particular panel that is currently in memory. This handle will have been returned by the LoadPanel, NewPanel, or DuplicatePanel function. |
controlID | int | The ID of the control you wish to make movable at run-time. The ID is the defined constant that was assigned to the control or menu item in the User Interface Editor or the ID returned by NewCtrl or NewMenuItem. If -1, all controls on the panel are affected. |
configurationName | const char * | Pass the name of the configuration from which to load the Movable Control settings. If the configuration is not found, the default configuration will be used. Configurations are stored in a file called custctrl.ini located in the same directory as your project or executable. If you pass 0 or "", the configuration "Default" will be used. |
Return Value
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
status | int | Return value indicating whether the function was successful. A negative number indicates that an error occurred.
|
Additional Information
Library: Run-Time Movable Control
Include file: custctrl\movectrl.h
LabWindows/CVI compatibility: LabWindows/CVI 4.0 and later
Example
Refer to userint\custctrl\movectrl\movedemo.cws for an example of using the LoadMovableCtrlSettings function.