Modal dialog serving a thread.

I’ve been trying to wrap my head around threads and modal dialogs. I think I got it finally.

Click here to download my test harness project.

Would you comment please?

  1. I thought that I should have a declared a class interface for the SubmitJobDialogBox, but it only had one method. (Update)
  2. For some reason I thought that the methods that are called by the Run Event should also have been defined in a class interface.
  3. The modal dialog box seems always to appear as just a pull down panel on the web page. I thought setting the Type from Pallet, Modal or Panel would make some difference but I obviously must be missing something.
  4. I’m not sure I handled the cancel pressed and send email flags ‘properly’
  5. I’m using sleep to simulate what the actual application will be doing which is submitting records to a database. Does sleep behave as a blocking call to a database sql insert command?
  6. How does one interrupt the sleep? I see that sleep has an extra parameter to ‘wakeup’ but not sure how do use it. (It’s probably not relevant in the end product, but I thought I’d ask)
  7. The position of the text at the top of the dialog box appears underneath the progress bar… Quite accidentally but I like it. Why is that happening?

Thanks.
B.

What exactly is your goal with this? If the goal is to show a progress bar or wheel while doing some processing in a thread, then I think you’re over complicating it. Or maybe I’m just not understanding what you’re trying to do.

On #3 and #7, the reason is because the size and type properties for the subclassed dialog on the page are different than those of the base dialog object in the project. Once you subclass an object (and dropping it onto a page is doing just that), then it’s properties override those of the super. Changing the properties of the super won’t automatically apply to the subclass.

The goal is to do it right. :wink:
Every time I go near a thread I loose faith in my code that it is actually behaving and designed properly.
I also want to make sure I’ve understood OO, sub-classing, event handlers, computed properties, interfaces and aggregates, sleeping, blocking etc…