ImageGear for C and C++ on Linux v18.8 - Updated
LPFNIG_ART_TEXTOVERFLOWNOTIFYFUNC
API Reference Guide > ART Component API Reference > ART Component Callback Functions Reference > LPFNIG_ART_TEXTOVERFLOWNOTIFYFUNC

This callback function is called after the text mark is resized by mouse dragging and before the mark is repainted.

Declaration:

 
Copy Code
typedef AT_BOOL (ACCUAPI *LPFNIG_ART_TEXTOVERFLOWNOTIFYFUNC)(
        HIGEAR hIGear,    
        LPVOID lpPrivate, 
        ART_MARK_INDEX hMarkIndex,
        DWORD dwMarkType,  
        const LPAT_RECT lprcPreferableBounds,    
        DWORD dwTextLength, 
        DWORD dwReserved 
);

Arguments:

Name Type Description
hIGear HIGEAR HIGEAR handle of an image.
lpPrivate LPVOID A pointer to the private callback data.
hMarkIndex ART_MARK_INDEX The index for the selected mark.
dwMarkType DWORD The type of selected mark. Currently it can be ART_MARK_TYPED_TEXT, ART_MARK_ATTACH_A_NOTE, ART_MARK_TEXT_FROM_FILE.
lprcPreferableBounds const LPAT_RECT Preferable mark bounds to draw whole mark text (cut to clip bounds).
dwTextLength DWORD The length of overflowed text (the last NULL is not included). If the text is not overflowed must be set to 0.
dwReserved DWORD Reserved for future use. Currently should be set to 0.

Return Value:

Returns FALSE for the mark's selection state to remain unchanged; returns TRUE to allow the mark's selection state to change.

Supported Raster Image Formats:

All pixel formats supported by ImageGear for C and C++.

Example:

 
Copy Code
HIGEAR hIGear;
HWND hWnd;
ART_MARK_INDEX markIndexes[3]; /* array of processed mark indexes*/
/* ... */
/* Initialize the markIndexes array anywhere*/
/* and call */
/* ART_callback_register(hIGear,ART_CALLBACK_TEXT_OVERFLOW_NOTIFY, TextOverflowNotify,
lpPrivate);*/
/* to register TextOverflowNotify callback function*/
/* ... */
HIGEAR hIGear;
HWND hWnd;
ART_MARK_INDEX markIndexes[3]; /* array of processed mark indexes*/
/* ... */
/* Initialize the markIndexes array anywhere*/
/* and call */
/* ART_callback_register(hIGear,ART_CALLBACK_TEXT_OVERFLOW_NOTIFY, TextOverflowNotify,
lpPrivate);*/
/* to register TextOverflowNotify callback function*/
/* ... */
AT_BOOL ACCUAPI TextOverflowNotify1(
HIGEAR hIGear,
LPVOID lpPrivate,
ART_MARK_INDEX hMarkIndex,
DWORD dwMarkType,
const LPAT_RECT lprcPreferedBounds,
DWORD dwOverflowedTextLength,
DWORD dwReserved
)
{
AT_ERRCOUNT nErrCount;
ART_MARK_ATTRIBUTES ma;
UNREFERENCED_PARAMETER(lpPrivate);
UNREFERENCED_PARAMETER(lprcPreferedBounds);
UNREFERENCED_PARAMETER(dwOverflowedTextLength);
UNREFERENCED_PARAMETER(dwReserved);
if (dwMarkType != ART_MARK_TYPED_TEXT &&
dwMarkType != ART_MARK_ATTACH_A_NOTE)
return FALSE;
if ( hMarkIndex != markIndexes[2])
{
ART_GUI_mark_paint( hIGear, IG_GRP_DEFAULT, markIndexes[2], hWnd,FALSE );
nErrCount = ART_mark_query( hIGear, markIndexes[2], &ma );
if ( nErrCount == 0 )
{
// Change the bounds if needed...
// For example, ma.rcBounds.right = ma.rcBounds.right / 2;
ma.rcBounds.right = ma.rcBounds.right / 2;
ART_mark_modify( hIGear, markIndexes[2], &ma );
//Repaint the mark
ART_GUI_mark_paint( hIGear, IG_GRP_DEFAULT, markIndexes[2], hWnd, TRUE );
return TRUE;
}
}
return FALSE;
}

Remarks:

This callback function is called independently on whether the text overflows the mark bounds or not. It is applied for ART_MARK_TYPED_TEXT, ART_MARK_ATTACH_A_NOTE and ART_MARK_TEXT_FROM_FILE marks.

The return value is ignored at this time. Using this callback function, the customer can possibly change the mark bounds after resizing of the text mark bounds.

In order to use this callback, it must be registered with ART using the function ART_callback_register().