The new fxparsegeometry() function can be used to parse a string of the form "[=][<width>{xX}<height>][{+-}<xoffset>{+-}<yoffset>]" into x, y, width and height values. It returns an FXint that indicates which (if any) values were parsed. For example,
FXint x, y, w, h;
FXint retval;
// This should set w = 300, h = 200 and return retval = 4 | 8 = 12
fxparsegeometry("300x200", x, y, w, h);
// This should set x = 20, y = 30, w = 300, h = 200 and return retval = 1 | 2 | 4 | 8 = 15
fxparsegeometry("300x200+20+30", x, y, w, h); |
The new fxisconsole() function returns TRUE if the executable at the specified path is a console application.
Added the FXSEL() macro for constructing an FXSelector value from a message type and identifier.
Added the fxstripHotKey() function, for stripping hot key escape codes from a string. So for example, the call:
fxstripHotKey("Beans && &Franks") |
should return the string "Beans & Franks".
Added the fxdllOpen(), fxdllClose() and fxdllSymbol() functions for working with dynamically-loaded libraries.
Added the dupElms() function, which allocates an array of elements and initializes its contents with a bitwise copy of the passed-in array of source elements. For example,
FXdouble *makeCopy(const FXdouble *theOrig, unsigned long numOrig) {
FXdouble *theCopy;
dupElms(theCopy, theOrig, numOrig);
return theCopy;
}
|
The "polarity" of the SEL_CLOSE message return value has changed; now, returning 0 means "no objection" (i.e. proceed with the closing). The rationale is that when there is no target, or when the widget's target does not respond, closing the window should proceeed. For more information, see the discussion under Changes for Top-Level Windows.
Added the LAYOUT_FILL layout flag, which is just a combination of the frequently-used-together LAYOUT_FILL_X and LAYOUT_FILL_Y flags.
FXString::hash() and fxstrhash() now return FXuint instead of FXint.
Two new types, FXival and FXuval, provide platform-independent signed and unsigned integer types that should be the same size as a pointer for that platform. These are most often needed when sending or receiving message data via a void * pointer, e.g.
// Handle the SEL_COMMAND message from an FXList
long onListSelect(FXObject* sender, FXSelector, void* ptr) {
// The list sends the integer index of the selected list item as its message data
FXint selectedIndex = static_cast<FXint>( reinterpret_cast<FXival>(ptr) );
// Send this value on to some other object
otherObject->handle(this,
FXSEL(SEL_COMMAND, message),
reinterpret_cast<void *>( static_cast<FXival>(selectedIndex) ));
return 1;
}
|
In FOX 1.0, it was assumed that the platform's long and unsigned long types were guaranteed to be as big as a pointer, but this is not true for some 64-bit platforms (e.g. Win64).
Added the fxtoDOS() and fxfromDOS() functions for converting character strings from Unix to DOS and back again.