PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Content of Static control
  • Equivalence
  • Caption associated with a window or with a page
  • Caption associated with a Static control, an Edit control, a Combo box, a List box or a Listview
  • Caption associated with a table column
  • Caption of Check Box or Radio Button control
  • Caption of a Check Box column in a Treeview Table control
  • Caption associated with an Image control
  • Caption associated with a button
  • Caption of a Tab control
  • Differences between WINDEV and WINDEV Mobile: Managing the menu options
  • Limits
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
In a database, ..Caption is used to:
  • Find out the caption associated with a file item.
    Note: The item was created in the data model editor or by programming.
  • Find out the caption associated with a data file.
    Note: The data file may have been created in the data model editor or by programming.
  • Find out and modify the connection caption. The connection can correspond to:
In a report, ..Caption is used to find out or modify the text:
  • of a Static control.
  • of a Link control.
  • Versions 17 and later
    of a Chart control.
    New in version 17
    of a Chart control.
    of a Chart control.
In a window or in a page, ..Caption is used to:
  • Find out and modify the caption of a control in a window or in a page.
  • Find out and modify the caption of a menu option.
  • Find out and modify the title of a window or page.
Reminder: The initial caption of a control, window, page or menu option is defined in the editor during the object description.
Versions 16 and later
Universal Windows 10 App This property is now available for the Windows Phone applications.
New in version 16
Universal Windows 10 App This property is now available for the Windows Phone applications.
Universal Windows 10 App This property is now available for the Windows Phone applications.
Versions 18 and later
Universal Windows 10 App This property is now available in Windows Store Apps mode.
New in version 18
Universal Windows 10 App This property is now available in Windows Store Apps mode.
Universal Windows 10 App This property is now available in Windows Store Apps mode.
Versions 21 and later
Universal Windows 10 App This property is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This property is now available in Universal Windows 10 App mode.
Universal Windows 10 App This property is now available in Universal Windows 10 App mode.
Example
WINDEVUniversal Windows 10 AppJavaUser code (UMC)
// Find out the caption associated with the Customer.Title item
ResCaption = Customer.Title..Caption
// Modify the text in the "STC_IntroControl" Static control
STC_IntroControl..Caption = "Dear Sir" + Customer.Name
// Equivalent to: STC_IntroControl..Caption = "Dear Sir [%Customer.Name%]"
WINDEVUniversal Windows 10 AppJavaUser code (UMC)
// Change the button caption
IF WIN_Window1..Modified = True THEN
BTN_Add..Caption = "Save"
ELSE
BTN_Add..Caption = "Close"
END
Syntax
WINDEVUniversal Windows 10 AppJavaUser code (UMC)

Finding out the caption associated with an item Hide the details

<Result> = <File name>.<Item name>..Caption
<Result>: Integer
Caption of item.
<File name>: Character string (with or without quotes)
Logical name of data file used.
<Item name>: Character string (with or without quotes)
Name of item used.

Finding out the text of caption associated with an element Hide the details

<Result> = <Element name>..Caption
<Result>: Character string
Text displayed in the specified element.
<Element name>: Character string (with or without quotes)
Name of element to use.

Modifying the text of caption associated with an element Hide the details

<Element name>..Caption = <New text>
<Element name>: Character string (with or without quotes)
Name of element to use.
<New text>: Character string
New text displayed in the specified element.
Remarks

Content of Static control

To retrieve the value of a control or the value of an item in a Static control:
  • In the report editor: insert [%<Control name>%] or [%<Item name>%] into the control caption.
  • In programming: two syntaxes are available with ..Caption:
    • use [%<Control name>%] or [%<Item name>%] in the string corresponding to the caption. For example:
      STC_IntroControl..Caption = "Dear Sir [%Customer.Name%]"
    • use the name of the control or the name of the item in the caption. For example:
      STC_IntroControl..Caption = "Dear Sir" + Customer.Name

Equivalence

..Caption is equivalent to ..Value.
To retrieve the text of a Static control, the following syntaxes are equivalent:
ResCaption = <Name of Static control>..Caption

ResCaption = <Name of Static control>..Value

ResCaption = <Name of Static control>
To modify the text displayed in a Static control, the following syntaxes are equivalent:
<Name of Static control>..Caption = <New text>

<Name of Static control>..Value = <New text>

<Name of Static control> = <New text>
WINDEVUniversal Windows 10 AppJavaUser code (UMC)

Caption associated with a window or with a page

The caption associated with a window or with a page corresponds to the title of the window or to the title of the page. This title is returned by ..Title.
WINDEVUniversal Windows 10 AppJavaUser code (UMC)

Caption associated with a Static control, an Edit control, a Combo box, a List box or a Listview

The control caption corresponds to the text of caption.
For a Static control, this text is returned by ..Value.
WINDEVJavaUser code (UMC)

Caption associated with a table column

The caption of a table column corresponds to the title of the column and it is returned by ..Title.
WINDEVUniversal Windows 10 AppJavaUser code (UMC)

Caption of Check Box or Radio Button control

..Caption is used to find out and modify:
  • the caption of Check Box or Radio Button control,
  • the caption of an option found in the Check Box or Radio Button control.
To modify the caption of an option found in a Check box or Radio Button control:
<Control name>[<Subscript>]..Caption = <New caption>
For example:
RADIO_RadioButton[2]..Caption = "Option #2"
To modify the caption associated with a Check box or Radio Button control:
<Control name>..Caption = <New caption>
For example:
RADIO_RadioButton..Caption = "Age of participants"
To retrieve the caption of an option:
<Control>[Subscript]..Caption
WINDEVUser code (UMC)

Caption of a Check Box column in a Treeview Table control

..Caption applied to a Check Box column found in a TreeView Table control is used to find out and modify the caption displayed beside the check box.
WINDEVUniversal Windows 10 AppJavaUser code (UMC)

Caption associated with an Image control

..Caption returns or replaces the current image by the image whose name is passed in parameter.
..Caption is equivalent to a direct assignment of the control with the name of the image (Control = Image_Name).
The Image control includes a caption: therefore, ..Caption is used to modify this caption. If the new caption does not correspond to a valid image, the caption of the Image control is modified.
WINDEVUniversal Windows 10 AppJavaUser code (UMC)

Caption associated with a button

..Caption can have two actions:
  • replace the image of the button (the name passed in parameter corresponds to an image file),
  • return or replace the caption associated with the button (the text passed in parameter does not correspond to an image file).
For example:
// Modify the image of a graphic button
BTN_Button1..Caption = "Help.BMP"

// Modify the caption of a text button
BTN_Button1..Caption = "New caption"
Note: If the specified control contains the & character, the letter that follows the & character is considered as being the shortcut of the control.
Versions 20 and later
WINDEV Note: The caption of a Button control can be in RTF or not ("RTF" checked in the "General" tab of the control description).
  • The caption may contain RTF tags when it is retrieved. To get the caption without the RTF tags, use RTFToText. For example:
    MyCaption is string
    MyCaption = RTFToText(BTN_Button..Caption)
  • In modification, the text associated with the caption of the control can be a RTF text or not. The Button control will adapt automatically.
New in version 20
WINDEV Note: The caption of a Button control can be in RTF or not ("RTF" checked in the "General" tab of the control description).
  • The caption may contain RTF tags when it is retrieved. To get the caption without the RTF tags, use RTFToText. For example:
    MyCaption is string
    MyCaption = RTFToText(BTN_Button..Caption)
  • In modification, the text associated with the caption of the control can be a RTF text or not. The Button control will adapt automatically.
WINDEV Note: The caption of a Button control can be in RTF or not ("RTF" checked in the "General" tab of the control description).
  • The caption may contain RTF tags when it is retrieved. To get the caption without the RTF tags, use RTFToText. For example:
    MyCaption is string
    MyCaption = RTFToText(BTN_Button..Caption)
  • In modification, the text associated with the caption of the control can be a RTF text or not. The Button control will adapt automatically.
WINDEVJavaUser code (UMC)

Caption of a Tab control

The caption of a Tab control corresponds to the text of the button that is used to select the tab pane.
WINDEV

Differences between WINDEV and WINDEV Mobile: Managing the menu options

WINDEV: The menu options (in main menus or in popup menus) can be managed by the Menuxxx functions and by the corresponding properties.
WINDEV Mobile: To optimize the size of the WINDEV framework installed on the Pocket PC, the menu options can only be managed by the properties.
The equivalence table is as follows:
Available functions
in WINDEV
Equivalent properties
MenuUnmark
MenuIsMarked
MenuMark
Checked
MenuStateState
MenuInvisibleVisible
MenuSelectMinusState
MenuSelectPlusState
MenuLabelCaption

Limits

WINDEVUniversal Windows 10 App In a report, ..Caption only applies to the "Static" controls and to the "Link" controls.
WINDEV In a window, ..Caption cannot be used on the following types of controls:
  • Spin
  • Scrollbar
Versions 22 and later
WINDEV ..Caption can be used on the automatic calculation lines to modify the caption of calculation. See Programming automatic calculations in the columns of a Table control for more details.
New in version 22
WINDEV ..Caption can be used on the automatic calculation lines to modify the caption of calculation. See Programming automatic calculations in the columns of a Table control for more details.
WINDEV ..Caption can be used on the automatic calculation lines to modify the caption of calculation. See Programming automatic calculations in the columns of a Table control for more details.
Java ..Caption only applies to the following elements:
  • Button.
  • Static control.
  • Edit control.
  • Image.
  • Check box.
  • Radio button.
  • List box.
  • Combo box.
  • TreeView.
  • Tab.
  • Window.
  • Table.
  • Table column.
Minimum version required
  • Version 9
This page is also available for…
Comments
Exemplo Relatorio - Alterar Caption
Exemplo Relatorio - Alterar Caption


HReadSeek(empresa,id_empresa,gnEmpresacodigo)

IF empresa.cnpj<>"" THEN
STC_cnpj_cpf..Caption="Cnpj"
STC_EMP_CGC=empresa.cnpj
ELSE
STC_cnpj_cpf..Caption="Cpf"
STC_EMP_CGC=empresa.cpf

END

//Blog com Video e Exemplo

http://windevdesenvolvimento.blogspot.com.br/2016/10/aula-946-windev-curso-relatorio-31.html

https://www.youtube.com/watch?v=G3e59Zvu_fw

De matos
20 Oct. 2016