#35 UnTimedMessage

3.2.0
closed
None
5
2012-08-14
2007-08-13
Lee Peedin
No

This patch adds a new dialog to the group of "Standard Dialogs". It's purpose is to allow the programmer a simple means to display a message on the screen while "time consuming activity" is occurring.

Attached are 2 files:
oodplain.cls with the code added for the UnTimedMessage environment, method, and class

unTimedMessage.rex is a program demonstrating its use.

Discussion

  • Lee Peedin

    Lee Peedin - 2007-08-13
     
  • Lee Peedin

    Lee Peedin - 2007-08-13

    Logged In: YES
    user_id=1223125
    Originator: YES

    File Added: unTimedMessage.rex

     
  • Lee Peedin

    Lee Peedin - 2007-08-13

    Logged In: YES
    user_id=1223125
    Originator: YES

    Note: The additional code in oodplain.cls is based on an additional class originally written by Gil Barmwater and used within Safe Data for several years.

     
  • Lee Peedin

    Lee Peedin - 2007-08-13

    Logged In: YES
    user_id=1223125
    Originator: YES

    The example program unTimedMessage.rex is my original work. Lee Peedin (lee AT safedatausa DOT com)

     
  • Lee Peedin

    Lee Peedin - 2007-08-14

    Logged In: YES
    user_id=1223125
    Originator: YES

    The documentation for "OODialog External Functions" states the following: "A more convenient way to call these functions is provided by the Public Routines"; however, 3 of these external functions are missing in the Public Routines, 1) GetScreenSize, 2) SleepMS, & 3) WinTimer. I am in the process of adding GetScreenSize & SleepMS to the public routines (will work on WinTimer once I figure out what it is).

    Since these changes will affect oodplain.cls, I ask that no action on this patch be taken at this time.

    Lee

     
  • Lee Peedin

    Lee Peedin - 2007-08-25

    Logged In: YES
    user_id=1223125
    Originator: YES

    Added getScreenSize (public name ScreenSize) & SleepMS (public name MSSleep) along with the already added "new" routine "unTimedMessage" to the oodPlain.cls

    There's a "Catch-22" situation with getScreenSize. It is available if the programmer creates a dialog, BUT if the programmer wants the size of the dialog to be based on the user's screen resolution it is not yet available. The only solution is to add this code at the beginning of the program:

    call RxFuncAdd InstMMFuncs, "OODialog", InstMMFuncs
    call InstMMFuncs

    If this patch is accepted, the programmer would use the "public" routine "screensize" which returns an array of values. It would already be available via any of the ::requires directives that are already necessary to code a dialog program.

    Usage:
    ss = ScreenSize()
    dialog_units_x = ss[1]
    dialog_units_y = ss[2]
    pixels_x = ss[3]
    pixels_y = ss[4]

    Consideration appreciated
    Lee

    File Added: OODPLAIN.CLS

     
  • Lee Peedin

    Lee Peedin - 2007-08-25
     
  • Mark Miesfeld

    Mark Miesfeld - 2007-09-23

    Logged In: YES
    user_id=191588
    Originator: NO

    Lee,

    For some reason I am not getting the patches e-mail so I didn't notice that you had added to this patch and had it ready.

    I like the spirit of the patch, but I have these reservations.

    The UnTimedMessage class is line for line the TimedMessage class with the addition of 1 if statement. In the TimedMessage class you have this:

    self~startit
    self~show("SHOWTOP")
    ret = sleepms(sleeping)
    self~stopit

    In the UnTimedMessage class you have this:

    self~startit
    self~show("SHOWTOP")
    if sleeping >= 0 then
    do
    reply
    ret = sleepms(sleeping)
    self~stopit
    end

    Every other line of the 2 classes is exactly the same. <grin>

    I propse that we do this instead: Simply add the if statement to the existing class, and document the new additional behavior.

    Then if you use the TimedMessage class with a -1 it behaves as you want the UnTimeMessage class too and the behavior of existing programs won't change. If you think the early reply is really necessary, I think we should add a fourth opitional argument to the init that allows the early reply when the sleeping argument is >= 0.

    That seems like a better addition to ooRexx to me.

    The changed TimedMessage init would look like:

    ::method init
    expose message title sleeping earlyReply
    use arg message, title, sleeping
    if arg(4, 'E'), arg(4)~datatype('O') then
    earlyReply = arg(4)
    else
    earlyReply = .false
    self~init:super("")

    The execute method would change to:

    ::method execute
    expose message title sleeping earlyRepy sx sy
    ...
    if sleeping >= 0 then
    do
    if earlyReply then reply
    ret = sleepms(sleeping)
    self~stopit
    end

    I think that will do everything you want.

    The ScreenSize and MMSleep are good additions.

    Let me know what you think about the TimedMessage / UnTimedMessage.

     
  • Lee Peedin

    Lee Peedin - 2007-09-23

    Logged In: YES
    user_id=1223125
    Originator: YES

    You're correct Mark in that unTimedMessage is the TimeMessage with the "if" section added. I had actually forgot that it was the same since we'd been using it for years as a separate class and I just copied the code to oodPlain.

    I'd have no problem with this functionality being a "modification" of TimedMessage. The documentation change would also need to reflect that it is up to the programmer to "~stopit" to "take down" the dialog.

    Lee

     
  • Mark Miesfeld

    Mark Miesfeld - 2007-09-24

    Logged In: YES
    user_id=191588
    Originator: NO

    Committed revision 796.

    This commit added Lee's two new public routines to ooDialog and merged his idea for an "UnTimedMessage" class into the existing TimedMessage class.

     
  • Mark Miesfeld

    Mark Miesfeld - 2007-10-10

    Logged In: YES
    user_id=191588
    Originator: NO

    This patch is sort of a new feature in 3.2.0 which is why I put it into pending and not closed. It should probably make its way into the change log, but I'm not sure exactly how it will be picked up.

    Changing the group to 3.2.0

     


Anonymous

Cancel  Add attachments