LoadLocalizedPanel
- Updated2023-02-21
- 3 minute(s) read
int LoadLocalizedPanel (int parentPanel, const char *panelResourceFile, int panelResourceID, const char *languageResourceFile, int *panelHandle);
Purpose
This function is similar to LoadPanel, except that it applies the translated strings in the language resource file (*.lwl) to the specified panel.
Refer to LoadPanel help for more information.
Use the Windows SDK function GetLocaleInfo to get the system or user default language.
Parameters
| Input | ||
| Name | Type | Description |
| parentPanel | int | The handle of the panel into which the new child panel is loaded. To make the panel a top-level panel, enter 0. You can obtain this handle from functions such as LoadPanel and NewPanel. |
| panelResourceFile | const char * | The name of the User Interface Resource file (*.uir) or the Text Format User Interface file (*.tui) that contains the panel. You can use a complete pathname or a simple filename. If the name is a simple filename (i.e., contains no directory path) and the file is listed in the project, then the file is loaded using the pathname from the project. If the name is a simple filename but the file is not listed in the project, then the file is loaded from the directory containing the project. |
| panelResourceID | int | If the specified file is a User Interface Resource (*.uir) file, the panelResourceID is the defined constant that was assigned to the panel in the User Interface Editor. The panel resource ID can be found in the UIR header file. If the file is a Text Format User Interface (*.tui) file, the panelResourceID is the header number of the .tui file section in which the panel is defined. For example, if the section header for the desired panel is [Panel003], then the panelResourceID is 3. This function loads all of the controls in the .tui file whose section headers are of the form [PanelNNN_ControlYYY], where NNN is the panelResourceID, and YYY is 001 or greater. The control numbers must be consecutive and start at 001. To pass a controlID to other User Interface Library functions, pass YYY + 1. For instance, if the section header for a control is [Panel003_Control001], pass 2 as the controlID parameter. If you save a .tui file in the User Interface Editor in LabWindows/CVI 5.0 or later, and you have an up-to-date include (.h) file generated by the User Interface Editor, you can use the panel, control, menu bar, menu, and menu item constants in the include file as parameters to User Interface Library functions. Use panelResourceID only once to load the panel into memory. In subsequent function calls, refer to this panel with the panelHandle returned by this function. |
| languageResourceFile | const char * | This file contains translated strings of the strings in the panel resource file. |
| Output | ||
| Name | Type | Description |
| panelHandle | int | The value that you must use in subsequent function calls to specify this panel. Zero is not a valid panel handle. Use DiscardPanel to discard. |
Return Value
| Name | Type | Description | ||||||||||||||||||
| status | int | Indicates whether the function was successful. A zero indicates success. A negative value indicates an error. If the value is from –1 to –999, it is one of the error values defined in userint.h. Otherwise, it is one of the error values defined in toolbox.h. Use GetGeneralErrorString in the toolbox to get a description. Among the more commonly encountered errors are:
|
Additional Information
Library: UI Localization Tools
Include file: localui\localui.h
LabWindows/CVI compatibility: LabWindows/CVI 5.5 and later
Example
Refer to apps\localui\intgraph.cws for an example of using the LoadLocalizedPanel function.