LabWindows/CVI

Content Type
Programming Language
Current manual
Table of Contents

LoadMovableCtrlSettings

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.
Return Values:
0 Success
–1 The Interface Manager could not be opened.
–2 The system font could not be loaded.
–3 The operation attempted cannot be performed while a pop-up menu is active.
–4 Panel, pop-up, menu bar, or plot ID is invalid.
–5 Attempted to position panel at an invalid location.
–6 Attempted to make an inoperable control the active control.
–7 The operation requires that a panel be loaded.
–8 The operation requires that a pop-up menu be active.
–9 The operation requires that a menu bar be loaded.
–10 The control is not the type expected by the function.
–11 Invalid menu item ID.
–12 Out of memory.
–13 Invalid control ID.
–14 Value is invalid or out of range.
–15 File is not a User Interface file or has been corrupted.
–16 File format is out-of-date.
–17 PCX image is corrupted or incompatible with current display type.
–18 No user event possible in current configuration.
–19 Unable to open UIR file.
–20 Error reading UIR file.
–21 Error writing UIR file.
–22 Error closing UIR file.
–23 Panel state file has invalid format.
–24 Invalid panel ID or menu bar ID in resource file.
–25 Error occurred during hardcopy output.
–26 Invalid default directory specified in FileSelectPopup or FileSelectPopupEx function.
–27 Operation is invalid for specified object.
–28 Unable to find specified string in menu.
–29 Palette menu items can only be added to the end of the menu.
–30 Too many menus in the menu bar.
–31 Separators cannot have checkmarks.
–32 Separators cannot have submenus.
–33 The menu item must be a separator.
–34 The menu item cannot be a separator.
–35 The menu item already has a submenu.
–36 The menu item does not have a submenu.
–37 The control ID passed must be a menu ID, a menu item ID, or NULL.
–38 The control ID passed must be a menu ID, or a menu item ID.
–39 The control ID passed was not a submenu ID.
–40 The control ID passed was not a valid ID.
–41 The ID is not a menu bar ID.
–42 The ID is not a panel ID.
–43 This operation cannot be performed while this pop-up panel is active.
–44 This control/panel/menu/ does not have the specified attribute.
–45 The control type passed was not a valid type.
–46 The attribute passed is invalid.
–47 The fill option must be set to fill above or fill below to paint ring slide's fill color.
–48 The fill option must be set to fill above or fill below to paint numeric slide's fill color.
–49 The control passed is not a ring slide.
–50 The control passed is not a numeric slide.
–51 The control passed is not a ring slide with inc/dec arrows.
–52 The control passed is not a numeric slide with inc/dec arrows.
–53 The data type passed in is not a valid data type for the control.
–54 The attribute passed is not valid for the data type of the control.
–55 The index passed is out of range.
–56 There are no items in the list control.
–57 The buffer passed was too small for the operation.
–58 The control does not have a value.
–59 The value passed is not in the list control.
–60 The control passed must be a list control.
–61 The control passed must be a list control or a binary switch.
–62 The data type of the control passed must be set to a string.
–63 That attribute is not a settable attribute.
–64 The value passed is not a valid mode for this control.
–65 A NULL pointer was passed when a non-NULL pointer was expected.
–66 The text background color on a menu ring cannot be set or gotten.
–67 The ring control passed must be one of the menu ring styles.
–68 Text cannot be colored transparent.
–69 A value cannot be converted to the specified data type.
–70 Invalid tab order position for control.
–71 The tab order position of an indicator-only control cannot be set.
–72 Invalid number.
–73 There is no menu bar installed for the panel.
–74 The control passed is not a text box.
–75 Invalid scroll mode for chart.
–76 Invalid image type for picture.
–77 The attribute is valid for child panels only. Some attributes of top level panels are determined by the host operating system.
–78 The list control passed is not in check mode.
–79 The control values could not be completely loaded into the panel because the panel has changed.
–80 Maximum value must be greater than minimum value.
–81 Graph does not have that many cursors.
–82 Invalid plot.
–83 New cursor position is outside plot area.
–84 The length of the string exceeds the limit.
–85 The specified callback function does not have the required prototype.
–86 The specified callback function is not a known function.
–87 Graph cannot be in this mode without cursors.
–88 Invalid axis scaling mode for chart.
–89 The font passed is not in font table.
–90 The attribute value passed is not valid.
–91 Too many files are open.
–92 Unexpectedly reached end of file.
–93 Input/Output error.
–94 File not found.
–95 File access permission denied.
–96 File access is not enabled.
–97 Disk is full.
–98 File already exists.
–99 File already open.
–100 Badly formed pathname.
–101 File is damaged.
–102 The format of the resource file is too old to read.
–103 File is corrupted.
–104 The operation could not be performed.
–105 The control passed is not a ring knob, dial, or gauge.
–106 The control passed is not a numeric knob, dial, or gauge.
–107 The count passed is out of range.
–108 The keycode is not valid.
–109 The control passed is not a ring slide with a frame.
–110 Panel background cannot be colored transparent.
–111 Title background cannot be colored transparent.
–112 Not enough memory for printing.
–113 The shortcut key passed is reserved.
–114 The format of the file is newer than this version of CVI.
–115 System printing error.
–116 Driver printing error.
–117 The deferred callback queue is full.
–118 The mouse cursor passed is invalid.
–119 Printing functions are not reentrant.
–120 Out of Windows GDI space.
–121 The panel must be visible.
–122 The control must be visible.
–123 The attribute is not valid for the type of plot.
–124 Intensity plots cannot use transparent colors.
–125 Color is invalid.

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.

Was this information helpful?