PDA

View Full Version : InputBox and MsgBox windowclass objects



MeepoSose
October 9th, 2009, 20:23
Has anyone built windowclass objects to represent these two common programming objects from the VB and .NET world?

I think the windowclass would be easy to implement and open the window to collect the data, but I can't think of a way to cleanly simulate the modal property.

One thought would be to do something like this:

1. Split the calling function into two separate functions fnStep1 and fnStep2
2. Process everything up to the point where you need the input within fnStep1
3. open the InputBox windowclass
4. assign fnStep2 as the handler for the InputBox.enterButton.onClick event
5. Have fnStep2 inspect the value of the InputBox.TextBox and store the value locally
6. fnStep2 then closes the InputBox window and resumes processing

MsgBox could be basically done the same way. It's all theory and I'm not sure how practical it is... but there could be a use for it I imagine.

Moon Wizard
October 11th, 2009, 07:59
I've thought about doing something like this as well. It seems like it would be possible, with two exceptions: no modal dialogs, and the dialogs would not always be on top.

Those have been the main reason why I haven't built them so far, because they would be so easy to lose in the window crowd on the FG desktop. I always try to find another way to do the same thing.

Cheers,
JPG

MeepoSose
October 12th, 2009, 14:43
I was thinking of using an approach common on web pages. You basically set the background width and height to 100% with a semi-transparent background and then center your InputBox or MsgBox within that background. As long as you can guarantee that it pops to the top of the z-order initially, the end user is essentially unable to click on anything else to cause a loss of focus.

I'm not sure exactly how I'd use it at the moment, but I mostly just want to build up my toolbag of options.

Tenian
October 12th, 2009, 16:22
The user would still be able to open windows over it via hot keys.

MeepoSose
October 12th, 2009, 16:34
Good point.