PC SOFT

ONLINE HELP
FOR WINDEV, WEBDEV AND WINDEV MOBILE

Home | Sign in | English US
  • Aligning a text between two shapes (a circle and a rectangle)
  • Vertically centered
  • Checking the display
  • Background color
  • Component
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
Builds a sequence of characters containing an aligned text or an aligned image.
WINDEVWindows MobileUniversal Windows 10 App This sequence of characters is used to align a text or an image:
  • in an element found in a List Box or Combo Box control.
  • in the title bar and/or status bar of a window.
  • in a Static control.
Note: gAlignment only operates on the display of images (gImage) and on the display of text.
Versions 21 and later
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
New in version 21
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Universal Windows 10 App This function is now available in Universal Windows 10 App mode.
Versions 22 and later
Stored procedures This function is now available in the code of stored procedures.
WINDEVLinux This function is now available for the WINDEV applications in Linux.
WEBDEV - Server codeLinux This function is now available for the WEBDEV sites in Linux.
WEBDEV - Server codeWindows This function is now available for the WEBDEV sites in Windows.
New in version 22
Stored procedures This function is now available in the code of stored procedures.
WINDEVLinux This function is now available for the WINDEV applications in Linux.
WEBDEV - Server codeLinux This function is now available for the WEBDEV sites in Linux.
WEBDEV - Server codeWindows This function is now available for the WEBDEV sites in Windows.
Stored procedures This function is now available in the code of stored procedures.
WINDEVLinux This function is now available for the WINDEV applications in Linux.
WEBDEV - Server codeLinux This function is now available for the WEBDEV sites in Linux.
WEBDEV - Server codeWindows This function is now available for the WEBDEV sites in Windows.
Example
WINDEVWindows Mobile
// Align the 20 first elements found in "LIST_CustomerList" to the right
FOR Subscript = 1 to 20
ListAdd(LIST_CustomerList, gAlignment("D", Name[Subscript]))
END
WINDEVWindows MobileUniversal Windows 10 App
// Horizontal and vertical alignment in a Static control
STC_Caption1 = gAlignment("GV", "BOB")
STC_Caption1 = gAlignment("GB", "BOB")
Syntax
<Result> = gAlignment(<Type of Alignment> , <String to Align> [, <X1> [, <X2>]])
<Result>: Character string
Sequence of characters defining the alignment of a text or image.
WINDEVWindows MobileUniversal Windows 10 App This sequence of characters can be:
WEBDEV - Server code This sequence of characters is not interpreted by the controls in WEBDEV. This function can be used to format the string returned by a WEBDEV Webservice consumed by a WINDEV or WINDEV Mobile application.
<Type of Alignment>: Character
Type of alignment for the elements to align. The vertical alignment must necessarily be specified after the horizontal alignment.
"D"Right-aligned.
"C"Centered.
"G"Left-aligned.
Versions 21 and later
"X"
New in version 21
"X"
"X"
Same horizontal alignment as the previous element.
"H"Vertical alignment at the top.
"V"Vertical alignment in the middle.
"B"Vertical alignment at the bottom.
Versions 21 and later
"Y"
New in version 21
"Y"
"Y"
Same vertical alignment as the previous element.
<String to Align>: Character string
Elements to align. This parameter can contain functions for graphic formatting (starting with the letter "g") used to:
  • add drawings to the text,
  • modify the text formatting (background color, text color, etc.).
<X1>: Optional real
Horizontal position of the left corner for the reference rectangle of the alignment area. If this parameter is not specified, the vertical position will be set to 0 (see the Notes).
<X2>: Optional real
Horizontal position of the right corner for the reference rectangle of the alignment area. If this parameter is not specified, the vertical position will be equal to the right border of the element where the string will be displayed (see the Notes).
Remarks

Aligning a text between two shapes (a circle and a rectangle)

To perform this operation, all you have to do is specify <x1> and <x2>. For example:
WINDEVWindows Mobile Example for a List Box control:
ListInsert(LIST_CityList, gCircle(0, 0, 15, 15, LightBlue) + ...
gCoord(15, 0) + gAlignment("C", "Avignon", 15, 80) + ...
gRectangle(80, 0, 115, 15, LightRed))

ListInsert(LIST_CityList, gCircle(0, 0, 15, 15, LightBlue) + ...
gCoord(15, 0) + gAlignment("C", "Lyon", 15, 80) + ...
gRectangle(80, 0, 115, 15, LightRed))

ListInsert(LIST_CityList, gCircle(0, 0, 15, 15, LightBlue) + ...
gCoord(15, 0) + gAlignment("C", "Montpellier", 15, 80) + ...
gRectangle(80, 0, 115, 15, LightRed))

Vertically centered

The elements displayed in the reference rectangle of the alignment area are vertically centered in relation to the height of the element that displays the sequence of characters (in relation to the height of the row found in the List Box or Combo Box control for example).
WINDEVWindows Mobile Reminder: For a List Box or Combo Box control, the height of the control row is defined in the "Details" window of control.

Checking the display

gAlignment checks the display in the specified area. Any image or text that is displayed outside the alignment area will be truncated.

Background color

The reference rectangle where the alignment is performed is filled with the current background color.

Component

Until version 21, gAlignment was available in the wdxxxobj component. From version 22, this function is now available in the wdxxxmdl component.
Components
WINDEVWEBDEV - Server codeReports and Queries wd230mdl.dll
Windows Mobile wp230mdl.dll
Linux wd230mdl.so
Minimum required version
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment