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 associated with an Image control
  • Caption associated with a button
  • Caption of a Site Map Path control
  • 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.
  • WEBDEV - Server code Find out the content of a site map path.
Reminder: The initial caption of a control, window, page or menu option is defined in the editor during the object description.
WEBDEV - Server code The modification is available for the "Automatic" or "Dynamic" controls only ("Details" tab of control description).
WEBDEV - Server code The modification is available for the "Automatic" or "Dynamic" controls only ("GUI" tab of control description).
Versions 23 and later
WEBDEV - Browser code This property is now available in browser code.
New in version 23
WEBDEV - Browser code This property is now available in browser code.
WEBDEV - Browser code This property is now available in browser code.
Example
WEBDEV - Server codeAjax
// 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%]"
Syntax
WEBDEV - Server codeAjax

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>
WEBDEV - Server codePHPAjax

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.
WEBDEV - Server codePHPAjax

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.
WEBDEV - Server codeAjax

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.
WEBDEV - Server codeAjax

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
WEBDEV - Server codeAjax

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.
WEBDEV - Server codeAjax

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.
WEBDEV - Server code ..Caption operates on the Text buttons only. To modify the image of a fixed-image button, you have the ability to use ..Image in browser code.
WEBDEV - Server codeAjax

Caption of a Site Map Path control

..Caption is used to:
  • find out and modify the caption used to identify an element in the site map path. This caption was defined:
    • in the page editor, during the control description.
    • by programming, when adding, inserting or modifying an element (BreadcrumbAddLink, BreadcrumbInsertLink, BreadcrumbModifyLink).
      For example, if the site map path contains "Digital >> Photos", ..Caption is used to find out and modify each element of the path:
      SMP_MyPath[1]..Caption = "Photographs"
  • find out the full content of a site map path. For example:
    SMP_MyPath..Caption = "Digital >>Photographs"

Limits

WEBDEV - Server code In a report, ..Caption only applies to the "Static" controls and to the "Link" controls.
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