From: <mie...@us...> - 2012-03-10 02:33:04
|
Revision: 7641 http://oorexx.svn.sourceforge.net/oorexx/?rev=7641&view=rev Author: miesfeld Date: 2012-03-10 02:32:57 +0000 (Sat, 10 Mar 2012) Log Message: ----------- ooDialog - fix errors with install / change bitmap buttons; fix errors with connectbuttons option used for .rc files; add position argument to TimedMessage dialog and routine Modified Paths: -------------- main/trunk/extensions/platform/windows/oodialog/UtilityClasses.cls main/trunk/extensions/platform/windows/oodialog/oodDeviceGraphics.cpp main/trunk/extensions/platform/windows/oodialog/oodPackageEntry.cpp main/trunk/extensions/platform/windows/oodialog/oodUser.cpp main/trunk/extensions/platform/windows/oodialog/oodUtilities.cpp Modified: main/trunk/extensions/platform/windows/oodialog/UtilityClasses.cls =================================================================== --- main/trunk/extensions/platform/windows/oodialog/UtilityClasses.cls 2012-03-08 01:03:11 UTC (rev 7640) +++ main/trunk/extensions/platform/windows/oodialog/UtilityClasses.cls 2012-03-10 02:32:57 UTC (rev 7641) @@ -787,12 +787,7 @@ -- This class shows a message window for a defined duration ::class 'TimedMessage' subclass UserDialog public -::method init - expose message title sleeping earlyReply - use arg message, title, sleeping, earlyReply = .false - if \ earlyReply~datatype('O') then earlyReply = .false - if \ sleeping~datatype('W') then sleeping = 0 - self~init:super("") +::method init public external "LIBRARY oodialog timedmsg_init" ::method defineDialog expose message sx sy @@ -802,13 +797,14 @@ self~noAutoDetection ::method execute - expose message title sleeping earlyReply sx sy + expose message title sleeping earlyReply sx sy pos s = self~getTextSizeDu(message) sx = s~width sy = s~height self~createCenter(sx+20, sy + 20, title,"NOMENU", , , , 1) self~startIt + if pos \== .nil then self~moveTo(pos) self~show("SHOWTOP") if sleeping >= 0 then do if earlyReply then reply @@ -1346,10 +1342,10 @@ /*-------------------------- shortcut routines -------------------------------*/ ::routine TimedMessage public - use arg msg, title, duration, earlyReply = .false + use arg msg, title, duration, earlyReply = .false, pos = .nil if \ duration~datatype('W') then return -1 if \ earlyReply~datatype('O') then earlyReply = .false - dlg = .TimedMessage~new(msg,title,duration, earlyReply) + dlg = .TimedMessage~new(msg,title,duration, earlyReply, pos) dlg~execute if duration < 0 then return dlg if \ earlyReply then drop dlg Modified: main/trunk/extensions/platform/windows/oodialog/oodDeviceGraphics.cpp =================================================================== --- main/trunk/extensions/platform/windows/oodialog/oodDeviceGraphics.cpp 2012-03-08 01:03:11 UTC (rev 7640) +++ main/trunk/extensions/platform/windows/oodialog/oodDeviceGraphics.cpp 2012-03-10 02:32:57 UTC (rev 7641) @@ -1572,18 +1572,16 @@ void assignBitmap(pCPlainBaseDialog pcpbd, size_t index, CSTRING bmp, int32_t bmpID, PUSHBUTTON_STATES type, bool isInMemory, bool isIntResource) { - if ( ! (isInMemory || isIntResource) && strlen(bmp) == 0 ) - { - return; - } - HBITMAP hBmp = NULL; BITMAPTABLEENTRY *bitmapEntry = pcpbd->BmpTab + index; if ( isInMemory ) { - bitmapEntry->loaded = 2; hBmp = (HBITMAP)string2pointer(bmp); + if ( hBmp != NULL ) + { + bitmapEntry->loaded = 2; + } } else if ( isIntResource ) { @@ -1591,7 +1589,23 @@ } else { - hBmp = (HBITMAP)loadDIB(bmp, NULL); + if ( strlen(bmp) < 2 && (bmp[0] == '0' || bmp[0] == '\0') ) + { + // Purposefully do nothing. IBM Object Rexx whould check for a + // bitmap name of 0 (zero) or the empty string and then use loadDIB + // on it. Which in turn set the bitmapID field to NULL. This + // ultimately had the effect of no bitmap being drawn for that + // button state. At least one of the example programs depended on + // that. + // + // Since hBmp is already NULL, we don't do anything. + ; + } + else + { + hBmp = (HBITMAP)loadDIB(bmp, NULL); + } + if ( hBmp != NULL ) { bitmapEntry->loaded = 1; Modified: main/trunk/extensions/platform/windows/oodialog/oodPackageEntry.cpp =================================================================== --- main/trunk/extensions/platform/windows/oodialog/oodPackageEntry.cpp 2012-03-08 01:03:11 UTC (rev 7640) +++ main/trunk/extensions/platform/windows/oodialog/oodPackageEntry.cpp 2012-03-10 02:32:57 UTC (rev 7641) @@ -778,6 +778,9 @@ // UserPSPDialog REXX_METHOD_PROTOTYPE(userpspdlg_init); +// TimedMessage +REXX_METHOD_PROTOTYPE(timedmsg_init); + // WindowExtensions REXX_METHOD_PROTOTYPE(winex_initWindowExtensions); REXX_METHOD_PROTOTYPE(winex_getFont); @@ -1686,6 +1689,9 @@ // ResPSPDialog REXX_METHOD(respspdlg_init, respspdlg_init), + //TimedMessage + REXX_METHOD(timedmsg_init, timedmsg_init), + // WindowExtensions REXX_METHOD(winex_initWindowExtensions, winex_initWindowExtensions), REXX_METHOD(winex_getFont, winex_getFont), Modified: main/trunk/extensions/platform/windows/oodialog/oodUser.cpp =================================================================== --- main/trunk/extensions/platform/windows/oodialog/oodUser.cpp 2012-03-08 01:03:11 UTC (rev 7640) +++ main/trunk/extensions/platform/windows/oodialog/oodUser.cpp 2012-03-10 02:32:57 UTC (rev 7641) @@ -1815,6 +1815,29 @@ return false; } +/** + * Determines if one of the keyword options for loading the dialog template from + * a .rc file is contained in the specified string + * + * @param opts + * + * @return bool + */ +inline bool isRcLoadItemsArg(CSTRING opts) +{ + if ( opts != NULL ) + { + if ( StrStrI(opts, "CENTER") != NULL || + StrStrI(opts, "CONNECTBUTTONS") != NULL || + StrStrI(opts, "CONNECTCHECKS") != NULL || + StrStrI(opts, "CONNECTRADIOS") != NULL ) + { + return true; + } + } + return false; +} + /** DynamicDialog::createPushButton() * */ @@ -1868,7 +1891,7 @@ { methName = strdup_2methodName(label); } - else if ( argumentExists(8) ) + else if ( argumentExists(8) && ! isRcLoadItemsArg(loadOptions) ) { methName = strdup_nospace(msgToRaise); } @@ -2002,7 +2025,7 @@ free((void *)methName); free((void *)finalName); } - else + else if ( ! isRcLoadItemsArg(loadOptions) ) { result = addCommandMessage(pcpbd->enCSelf, context, id, UINTPTR_MAX, 0, 0, loadOptions, 0) ? 0 : 1; } Modified: main/trunk/extensions/platform/windows/oodialog/oodUtilities.cpp =================================================================== --- main/trunk/extensions/platform/windows/oodialog/oodUtilities.cpp 2012-03-08 01:03:11 UTC (rev 7640) +++ main/trunk/extensions/platform/windows/oodialog/oodUtilities.cpp 2012-03-10 02:32:57 UTC (rev 7641) @@ -2158,3 +2158,37 @@ } +/** + * Methods for the ooDialog .TimedMessage class. + */ +#define TIMEDMESSAGE_CLASS "TimedMessage" + + +RexxMethod7(RexxObjectPtr, timedmsg_init, RexxStringObject, msg, RexxStringObject, title, int32_t, duration, + OPTIONAL_logical_t, earlyReply, OPTIONAL_RexxObjectPtr, pos, SUPER, super, OSELF, self) +{ + if ( argumentExists(5) ) + { + if ( pos != TheNilObj && ! context->IsOfType(pos, "POINT")) + { + wrongArgValueException(context->threadContext, 5, "a Point object or the Nil object", pos); + return NULLOBJECT; + } + context->SetObjectVariable("POS", pos); + } + else + { + context->SetObjectVariable("POS", TheNilObj); + } + + RexxArrayObject args = context->NewArray(0); + RexxObjectPtr result = context->ForwardMessage(NULL, NULL, super, args); + + context->SetObjectVariable("MESSAGE", msg); + context->SetObjectVariable("TITLE", title); + context->SetObjectVariable("SLEEPING", context->Int32(duration)); + context->SetObjectVariable("EARLYREPLY", context->Logical(earlyReply)); + + return TheZeroObj; +} + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |