Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

Text output functions
[GDI functions]

Data Structures

Defines

Typedefs

Functions


Define Documentation

#define DrawText hdc,
text,
n,
rc,
format   )     DrawTextEx2 (hdc, text, n, rc, 0, format, NULL)
 

Draws a formatted text in a rectangle.

Defined as a macro calling DrawTextEx2 passing nIndent as 0 and firstline as NULL.

See also:
DrawTextEx2

Definition at line 6593 of file gdi.h.

#define DrawTextEx hdc,
text,
n,
rc,
indent,
format   )     DrawTextEx2 (hdc, text, n, rc, indent, format, NULL)
 

Draws a formatted text in a rectangle.

Defined as a macro calling DrawTextEx2 passing firstline as NULL.

See also:
DrawTextEx2

Definition at line 6604 of file gdi.h.

#define GetTextAboveLineExtra hdc   )     (int)GetDCAttr (hdc, DC_ATTR_ALINE_EXTRA)
 

Retrives the current spacing above line for the DC.

Note:
Defined as a macro calling GetDCAttr for _USE_NEWGAL. If _USE_NEWGAL is not defined, GetTextAboveLineExtra is defined as a function, and have the same semantics as this macro.
See also:
SetTextAboveLineExtra

Definition at line 6303 of file gdi.h.

#define GetTextBellowLineExtra hdc   )     (int)GetDCAttr (hdc, DC_ATTR_BLINE_EXTRA)
 

Retrives the current spacing bellow line for the DC.

Note:
Defined as a macro calling GetDCAttr for _USE_NEWGAL. If _USE_NEWGAL is not defined, GetTextBellowLineExtra is defined as a function, and have the same semantics as this macro.
See also:
SetTextBellowLineExtra

Definition at line 6315 of file gdi.h.

#define GetTextCharacterExtra hdc   )     (int)GetDCAttr (hdc, DC_ATTR_CHAR_EXTRA)
 

Retrives the current intercharacter spacing for the DC.

Note:
Defined as a macro calling GetDCAttr for _USE_NEWGAL. If _USE_NEWGAL is not defined, GetTextCharacterExtra is defined as a function, and have the same semantics as this macro.
See also:
SetTextCharacterExtra

Definition at line 6291 of file gdi.h.

#define SetTextAboveLineExtra hdc,
extra   )     (int)SetDCAttr (hdc, DC_ATTR_ALINE_EXTRA, (DWORD) extra)
 

Sets the spacing above line for the DC and returns the old value.

Note:
Defined as a macro calling SetDCAttr for _USE_NEWGAL. If _USE_NEWGAL is not defined, SetTextAboveLineExtra is defined as a function, and have the same semantics as this macro.
See also:
GetTextAboveLineExtra

Definition at line 6341 of file gdi.h.

#define SetTextBellowLineExtra hdc,
extra   )     (int)SetDCAttr (hdc, DC_ATTR_BLINE_EXTRA, (DWORD) extra)
 

Sets the spacing bellow line for the DC and returns the old value.

Note:
Defined as a macro calling SetDCAttr for _USE_NEWGAL. If _USE_NEWGAL is not defined, SetTextBellowLineExtra is defined as a function, and have the same semantics as this macro.
See also:
GetTextBellowLineExtra

Definition at line 6354 of file gdi.h.

#define SetTextCharacterExtra hdc,
extra   )     (int)SetDCAttr (hdc, DC_ATTR_CHAR_EXTRA, (DWORD) extra)
 

Sets the intercharacter spacing for the DC and returns the old spacing value.

Note:
Defined as a macro calling SetDCAttr for _USE_NEWGAL. If _USE_NEWGAL is not defined, SetTextCharacterExtra is defined as a function, and have the same semantics as this macro.
See also:
GetTextCharacterExtra

Definition at line 6328 of file gdi.h.

#define TabbedTextOut hdc,
x,
y,
text   )     TabbedTextOutLen (hdc, x, y, text, -1)
 

Outputs formatted text.

Defined as a macro calling TabbedTextOutLen passing len as -1.

See also:
TextOutLen

Definition at line 6470 of file gdi.h.

#define TextOut hdc,
x,
y,
text   )     TextOutLen (hdc, x, y, text, -1)
 

Outputs text.

Defined as a macro calling TextOutLen passing len as -1.

See also:
TextOutLen

Definition at line 6460 of file gdi.h.


Typedef Documentation

typedef struct _DTFIRSTLINE DTFIRSTLINE
 

First line information of DrawTextEx2


Function Documentation

int GUIAPI DrawTextEx2 HDC  hdc,
const char *  pText,
int  nCount,
RECT pRect,
int  nIndent,
UINT  nFormat,
DTFIRSTLINE firstline
 

Draws a formatted text in a rectangle.

This function draws formatted text (pText) in the specified rectangle (pRect). It formats the text according to the specified method (through nFormat, including expanding tabs, justifying characters, breaking lines, and so forth).

Parameters:
hdc The device context.
pText The formatted text.
nCount The length of the text. If it is less than 0, MiniGUI will treat it as a null-terminated string.
pRect The output rectangle.
nIndent The indent value of the first line.
nFormat The methods used to format the text. MiniGUI support the following method to format text so far:
  • DT_TOP
    Top-justifies text (single line only).
  • DT_LEFT
    Aligns text to the left.
  • DT_CENTER
    Centers text horizontally in the rectangle.
  • DT_RIGHT
    Aligns text to the right.
  • DT_VCENTER
    Centers text vertically (single line only).
  • DT_BOTTOM
    Justify the text to the bottom of the rectangle. This value must be combined with DT_SINGLELINE.
  • DT_WORDBREAK
    Break words. Lines are automatically broken beteween words if a word would extend past the edge of the rectangle specified by the the pRect parameter. A carriage return or linefeed also breaks the line.
  • DT_CHARBREAK
    Break characters. Lines are automatically broken beteween characters if a character would extend past the edge of the rectangle specified by the the pRect parameter. A carriage return or linefeed also breaks the line. DT_CHARBREAK will override DT_WORDBREAK.
  • DT_SINGLELINE
    Display text ont the single line only. Carriage returns and linefeeds do not break the line.
  • DT_EXPANDTABS
    Expands tab characters. The default number of character per tab is eight.
  • DT_TABSTOP
    Set tab stops. Bits 15-8 (hight-order byte of the low-order word) of the uForma parameter specify the number of characters for each tab. The default number of characters per tab is eight.
  • DT_NOCLIP
    Draws without clipping. DrawText is somewhat faster when DT_NOCLIP is used.
  • DT_CALCRECT
    Determines the width and the height of the rectangle. If there are multiple lines of text, DrawText uses the width of the rectangle pointed to by the lpRect parameter and extends the base of the rectangle to bound the last line of text. If there is only one line of text, DrawText modifies the right side of the rectangle so that it bounds the last character in the line. In either case, DrawText returns the height of the formatted text but does not draw the text.

Parameters:
firstline If not null, DrawTextEx2 will only calculate the first line will be output in the rectangle, and return the number of the characters and the output width.
Returns:
The output height of the formatted text.
See also:
DrawText
Example:

void OnModeDrawText (HDC hdc)
{
    RECT rc1, rc2, rc3, rc4;
    const char* szBuff1 = "This is a good day. \n"
            "This text is drawn by calling DrawText.";
    const char* szBuff2 = "This is a good day. \n"
            "This text is drawn by calling DrawText.";
    const char* szBuff3 = "Single line text, center.";
    const char* szBuff4 = 
            "This text is drawn by calling DrawText.";

    rc1.left = 1; rc1.top  = 1; rc1.right = 401; rc1.bottom = 101;
    rc2.left = 0; rc2.top  = 110; rc2.right = 401; rc2.bottom = 351;
    rc3.left = 0; rc3.top  = 361; rc3.right = 401; rc3.bottom = 451;
    rc4.left = 0; rc4.top  = 461; rc4.right = 401; rc4.bottom = 551;

    SetBkColor (hdc, COLOR_lightwhite);

    Rectangle (hdc, rc1.left, rc1.top, rc1.right, rc1.bottom);
    Rectangle (hdc, rc2.left, rc2.top, rc2.right, rc2.bottom);
    Rectangle (hdc, rc3.left, rc3.top, rc3.right, rc3.bottom);
    Rectangle (hdc, rc4.left, rc4.top, rc4.right, rc4.bottom);

    InflateRect (&rc1, -1, -1);
    InflateRect (&rc2, -1, -1);
    InflateRect (&rc3, -1, -1);
    InflateRect (&rc4, -1, -1);

    SelectFont (hdc, logfontgb12);
    DrawText (hdc, szBuff1, -1, &rc1, DT_NOCLIP | DT_CENTER | DT_WORDBREAK);

    SelectFont (hdc, logfontgb16);
    DrawText (hdc, szBuff2, -1, &rc2, DT_NOCLIP | DT_RIGHT | DT_WORDBREAK);

    SelectFont (hdc, logfontgb24);
    DrawText (hdc, szBuff3, -1, &rc3, DT_NOCLIP | DT_SINGLELINE | DT_CENTER | DT_VCENTER);

    SelectFont (hdc, logfontgb16);
    DrawTextEx (hdc, szBuff4, -1, &rc4, 32, DT_NOCLIP | DT_LEFT | DT_WORDBREAK);
}

int GUIAPI GetFontHeight HDC  hdc  ) 
 

Retrives the height of the current logical font in a DC.

This function retrives the height of the current logical font in the DC hdc.

Parameters:
hdc The device context.
Returns:
The height of the current logical font.
See also:
GetMaxFontWidth

void GUIAPI GetLastTextOutPos HDC  hdc,
POINT pt
 

Retrives the last text output position.

Parameters:
hdc The device context.
pt The last text output position will be returned through this pointer.

int GUIAPI GetMaxFontWidth HDC  hdc  ) 
 

Retrives the maximal character width of the current logical font in a DC.

This function retrives the maximal character width of the current logical font in the DC hdc.

Parameters:
hdc The device context.
Returns:
The maximal character width of the current logical font.
See also:
GetFontHeight

void GUIAPI GetTabbedTextExtent HDC  hdc,
const char *  spText,
int  len,
SIZE pSize
 

Computes the output extent of a formatted text.

This function computes the output extent of the formatted text (spText) with length of len. This function returns the extent in a SIZE struct pointed to by pSize and the width of text as the return value. The output extent will be affected by the default tab size if there are some TAB characters in the text.

Parameters:
hdc The device context.
spText The pointer to the string of text.
len The length of the text.
pSize The output extent will be returned through this buffer.
See also:
GetTextExtent

void GUIAPI GetTextExtent HDC  hdc,
const char *  spText,
int  len,
SIZE pSize
 

Computes the output extent of a string of text.

This function computes the output extent of the text (spText) with length of len. This function returns the extent in a SIZE struct pointed to by pSize and the width of text as the return value.

Parameters:
hdc The device context.
spText The pointer to the string of text.
len The length of the text.
pSize The output extent will be returned through this buffer.
See also:
GetTabbedTextExtent

int GUIAPI TabbedTextOutEx HDC  hdc,
int  x,
int  y,
const char *  spText,
int  nCount,
int  nTabPositions,
int *  pTabPositions,
int  nTabOrigin
 

Writes a character string at a specified location, expanding tabs to the values specified in an anrry of tab-stop positions.

This function writes the string spText with length of nCount at a specified locations, expanding tabs to the value spcified in the array pTabPositions of tab-stop positions.

Parameters:
hdc The device context.
x x,y: The output start position.
y x,y: The output start position.
spText The formatted text.
nCount The length of the text. If it is less than 0, MiniGUI will treat it as a null-terminated string.
nTabPositions The length of the array of the tab-stop positions.
pTabPositions The array of the tab-stop positions.
nTabOrigin The origin of the tab-stops.
Returns:
The output width of the text.
See also:
TabbedTextOutLen

int GUIAPI TabbedTextOutLen HDC  hdc,
int  x,
int  y,
const char *  spText,
int  len
 

Outputs a formatted text.

This function outputs the formatted text spText with length of len at (x,y). This function returns the width of text. The output will be affected by the default tab size if there are some TAB characters in the text.

Parameters:
hdc The device context.
x x,y: The output start position.
y x,y: The output start position.
spText The formatted text.
len The length of the text. If it is less than 0, MiniGUI will treat it as a null-terminated string.
Returns:
The output width of the text.
See also:
TextOutLen

int GUIAPI TextOutLen HDC  hdc,
int  x,
int  y,
const char *  spText,
int  len
 

Outputs a string of text.

This function outputs the text spText with length of len at a (x,y). This function returns the width of text.

Parameters:
hdc The device context.
x x,y: The output start position.
y x,y: The output start position.
spText The string of the text.
len The length of the text. If it is less than 0, MiniGUI will treat it as a null-terminated string.
Returns:
The output width of the text.
See also:
TabbedTextOutLen


Generated on Mon Jun 26 13:54:31 2006 for MiniGUI V1.6.9 API Reference by  doxygen 1.4.2