TOPIC: Readonly for DateControl and SpinnerControl
#207
Readonly for DateControl and SpinnerControl 4 Years, 3 Months ago
Hello,

DateControl and SpinnerControl does not support readonly. Changing the New method of DateControl
Code:


New(mandatory = false, width = 10, checkCurrent = false, checkValid = false, readonly = false)
{
super(Object('Date' width: width, checkCurrent: checkCurrent,
checkValid: checkValid, readonly:readonly), mandatory: mandatory)
}



and New method of SpinnerControl
Code:


New(rangefrom = 0, rangeto = 99999, width = false, set = false,
mask = "##,###", justify = 'RIGHT', status = "", mandatory = false,
euro = false, increase = 1, rollover = false,readonly= false)
{
super(Object(SpinnerWndProc rangefrom, rangeto, width, mask,
justify, status, mandatory, euro, increase, rollover, readonly))



and that of SpinnerWndProc
Code:


New(rangefrom, rangeto, width, mask, justify, status, mandatory,
euro, increase, rollover, readonly)
{
.CreateWindow("SuWhiteArrow", "", WS.VISIBLE | WS.TABSTOP, w: 1, h: 1);
.number = .Construct((euro ? 'EuroNumber' : 'Number'),
name: .Name
rangefrom: rangefrom, rangeto: rangeto, width: width, mask: mask,
status: status, justify: justify, mandatory: mandatory, readonly:readonly)



makes the fields greyed out, but still the data is modiiable using the butons. :(
What more has to be done?

ajith
 
 
#212
Re:Readonly for DateControl and SpinnerControl 4 Years, 3 Months ago
Hi Ajith,

Not all controls support the readOnly option. Instead of adding a readOnly option, you could just call the SetReadOnly method of the control.
 
 
Jeff Ferguson
Suneido Software
 
#217
Re:Readonly for DateControl and SpinnerControl 4 Years, 3 Months ago
Hello Jeff,
Thanks for the information,
ajith