Edittable / 'Enabled' Property Enabled Bug? (OpenInsight Specific)
At 18 JAN 2000 08:31:49PM Robert Lee wrote:
We have developed a lovely generic mdi system in tandem with a security system which allows our customers to decide which mdi children their various staff have access to. The three access levels are full, read only & none.
The problem is in the Read Only Access level. We can't disable just the screen because that stops us from being able to scroll edittables - very important to us. So we read the control map and disable each control. We started by setting the 'ENABLED' property to false$. When we did this we discovered that some controls go "grey" (combobox & radiobutton), but others don't (eg editlines and tables). So we tried using the following approach.
hwndEdit=Get_Property(CtrlMap[i], "HANDLE" )
Call SendMessage(hwndEdit, WM_SETREADONLY$, True$, 0 )
This works well except for edittables-it seems to have no effect at all! So we revert to using Set_Property(Ctrl, 'ENABLED', False$) for edittables. This has two major flaws. Firstly, we can't use the scroll bar, but more importantly it causes a very nasty problem which is the next Start_Window doesn't work??? So the current mdi child closes and the next one doesn't open when the user tries to move on to the next child window.
So we thought we would try using Send_Message 'COLSTYLE' for each of the columns. Works great except the user can delete/insert rows. Big no no. We can't go through the whole system and put deleterow & insertrow events into every table on the system. Too messy. Yuk. Has to be a better way…
At 19 JAN 2000 03:37AM Colin Rule wrote:
The More button on the edit table properties screen allows the 'Protection' of the table so that insertion and deletion of rows is disabled. Not sure which Style this relates to but a quick check of the style property with it set/not set will indicate.
This combined with your other suggestions would resolve, hopefully.
At 19 JAN 2000 08:26AM Oystein Reigem wrote:
Robert,
You presumably want to make your controls read-only, not disable them completely. See .
For special problems with symbolics see .
- Oystein -
At 19 JAN 2000 07:02PM Robert Lee wrote:
1. The problem with the next Start_Window failing to start the window occurs in conjunction with :-
Set_Property(CtrlMap[i], 'ENABLED', False$).
This is not restricted to CtrlMap[i] being of type EDITTABLE as I previously suggested. So by using the following code for the majority of Control types, the problem with Start_Window went away:-
Equ WM_USER$ To 1024
Equ WM_SETREADONLY$ To WM_USER$ + 31
hwndEdit=Get_Property(CtrlMap[i], "HANDLE" )
Call SendMessage(hwndEdit, WM_SETREADONLY$, True$, 0)
As previously stated this code does not work for edit tables. For them I used the following code incorporating Colins suggestion.
Style=Get_Property(DCtrlMap[i], 'STYLE')
IF Style1,2 _eqc "0x" THEN
convert @lower.case to @upper.case in StyleMX")
END
New.Style=bitand(Style, bitnot(4))
x=Set_Property(DCtrlMap[i], 'STYLE', New.Style)
This code stopped the user from being able to insert/delete rows, but it didn't stop them editing them. Thus I also used the COLSTYLE message across each column to disable each column.
array=Get_Property(DctrlMap[i], 'ARRAY')
no.columns=count(array, @fm) + (array '')
for j=1 to no.columns
ColStyle=Send_message(CtrlMap[i],'COLSTYLE',j)ColStyle=BitOr(ColStyle,8)OldStyle=Send_Message(CtrlMap[i],'COLSTYLE',j,ColStyle)next j
Using this appoach, the user can still use the scroll bar, can't change the data and cant add or delete rows from the table.
Thanks for your help guys.
Robert Lee
At 19 JAN 2000 09:15PM Robert Lee wrote:
I have found that radio buttons and combo boxes do not respond to the Send_Message approach. It only only seems to work for EDITLINE AND EDITBOX. I can use Set_Property(Ctrl, 'ENABLED', False$) and it does work - so my program is now fully functioning.
The only minor nuisance is that the combo boxes and radio button turn "light grey" (indicating they are disabled) whereas the other controls aren't. Perhaps if someone knows how to use Send_Message for disabling the other control types, they might not go grey.
Rob