Hi,
I think it would be cool to have a Number option for a default InputBox, because currently it is available only in Gui.Edit which means one needs to code a customer input box.
I can only assume this wasn't implemented originally is because of the limitation of a windows API?
InputBox with a Number option (type only numbers)
Re: InputBox with a Number option (type only numbers)
There are probably many options that could have been added to InputBox. As I see it, InputBox is good because it is simple and achieves its purpose in a fairly direct manner, even though it doesn't do anything unique. If we add just anything that could be useful, we then have more redundant code and documentation, and a more complex function.
If you want to fine-tune a dialog box, use Gui.
Personally, I would prefer to have a GUI system that facilitates making input dialog boxes that are scalable, not just a single input field, but without having to micro-manage like with Gui. It's just not a priority for me.
If you want to fine-tune a dialog box, use Gui.
Personally, I would prefer to have a GUI system that facilitates making input dialog boxes that are scalable, not just a single input field, but without having to micro-manage like with Gui. It's just not a priority for me.
Re: InputBox with a Number option (type only numbers)
Seems that it would be simple to implement, one way or another.
There are several other Gui Edit options that could be applicable, but duplicating these options doesn't seem worthwhile as is. The current implementation is not conducive to sharing code between Gui and InputBox. Future revision to the Gui code may reduce the cost of such features.
Code: Select all
MsgBox DigitBox("Type a number").Value
DigitBox(Prompt?, Title?, Options?, Default?) {
static WM_INITDIALOG := 0x0110
OnMessage WM_INITDIALOG, init
try
return InputBox(Prompt?, Title?, Options?, Default?)
finally
OnMessage WM_INITDIALOG, init, false
init(w,l,m, hwnd) {
static ES_NUMBER := 0x2000
ControlSetStyle '+' ES_NUMBER, 'Edit1', hwnd
}
}
Who is online
Users browsing this forum: No registered users and 13 guests