New topic: 

Blank Modal Dialog Remains on Screen

<http://forums.realsoftware.com/viewtopic.php?t=34281>

         Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic          Author  
Message        GordonD3          Post subject: Blank Modal Dialog Remains on 
ScreenPosted: Tue Jun 15, 2010 10:13 am                         
Joined: Thu Nov 08, 2007 3:39 pm
Posts: 16                I am having a problem with RS2010r1 that is leaving a 
blank modal dialog on the screen above the main application window. The modal 
dialog is displayed in response to a simple button click in the application's 
window. A timer in the modal dialog window checks for the reception of data 
from a serial port. If the data was received, the timer's action event closes 
the modal dialog. Here is the code for the button's action event in the 
application's main window:

Code:ErasingPgmr.ShowModal

Here is the code for the Open event in the modal dialog window:

Code:  TimeoutCnt = 0
  if (ProgSP.SendCommand("er") <> True) then
  Self.Close
  return
  end if

Here is the code for the timer's action event:

 Code: Dim EraseErrorStr as String
  
  ProgSP.NewDataAvail = False
  TimeoutCnt = TimeoutCnt + 1
  if (TimeoutCnt < 600) then
  ProgSP.poll
  if (InStr(ProgSP.LookAhead, Prompt) <> 0) then
  me.Mode = 0
  EraseErrorStr = ProgSP.ReadAll
  if (Debug) then
    DebugOutFile.Write("Rcvd Data: " + EraseErrorStr)
  end if
  DisplayErrMsg(CheckPgmrError(EraseErrorStr))
  Self.Close
  end if
  else
  me.Mode = 0
  EraseErrorStr = ProgSP.ReadAll
  if (Debug) then
  DebugOutFile.Write("Rcvd Data: " + EraseErrorStr)
  end if
  DisplayErrMsg(CheckPgmrError(EraseErrorStr))
  Self.Close
  end if
  

If the serial device being communicated with responds quickly enough that the 
proper data is returned the first time the timer fires, the dialog box is left 
on the screen, off to the side and blank. If I place the following code:

Code:  if (TimeoutCnt < 2) then
  return
  end if
  
 just after the if (TimeoutCnt < 600) then statement so that the timer action 
event fires twice, the modal dialog appears on the screen very briefly and is 
then closed properly as expected.

Any ideas on what's going on here? Having to add the code to ensure the timer's 
action event fires twice seems like a bit of a kludge.

Thanks in advance for any help on this.

Regards,
Gordon   
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to