Upon switching from 7.4 to 7.5 I find that the command
myedit_ctl:setReadOnly(false)
does not work anymore (does not let me edit...)
After trying various things I decided to do use the scilexer control. Switching to/from readonly works as expected. On setting the proprerty of horzontal scroll bar to false, however, I get an error:
Exception: singleFactHasNoValue (runtime_exception)
Single fact has no value
error code = 329
ExtraInfo = Single fact 'native' from internal database 'sciLexer::sciLexer@objectDB' has no value
How can I fix this?
- Thomas Linder Puls
- VIP Member
- Posts: 1424
- Joined: 28 Feb 2000 0:01
We will investigate the edit control problem.
Exceptions like that comes when trying to manipulate a control that have not really been created yet.
In PFC GUI you have objects representing the widows on the screen, but the objects exist before and after the actual windows. The real windows are created on "show". For some things in some controls we have implemented things, so that it works before the control is really created.
The simplest way to postpone control manipulation to after control creation is to attach a "show" listener:
Exceptions like that comes when trying to manipulate a control that have not really been created yet.
In PFC GUI you have objects representing the widows on the screen, but the objects exist before and after the actual windows. The real windows are created on "show". For some things in some controls we have implemented things, so that it works before the control is really created.
The simplest way to postpone control manipulation to after control creation is to attach a "show" listener:
Code: Select all
clauses
new(...) :-
...
addShowListener({ :-
%This will happen when the controls "are about to be shown"
myEdit_ctl:doSomething(...)
}).
Regards Thomas Linder Puls
PDC
PDC
- Thomas Linder Puls
- VIP Member
- Posts: 1424
- Joined: 28 Feb 2000 0:01
- Thomas Linder Puls
- VIP Member
- Posts: 1424
- Joined: 28 Feb 2000 0:01
Re:
Could you show the code?ludieter wrote:build is 7501 commercial. The program worked in 74, not in 75.
To make sure I wasn't doing something I wasn't aware of, I made a program only opening a window with one edit control and two buttons, one to set readonly one setting readonly(false)...
Regards Thomas Linder Puls
PDC
PDC
I tried to upload a zip file (6mB) with the whole project, but I get an error "tried to upload an empty file". I saw the upload on the status bar though. Is the file too large?
Here files except folders deb / obj / exe
Here files except folders deb / obj / exe
- Attachments
-
- readonly.zip
- (21.33 KiB) Downloaded 480 times
- Thomas Linder Puls
- VIP Member
- Posts: 1424
- Joined: 28 Feb 2000 0:01
Thank you!
You can solve the problem if you change the implementation of editControl::setReadOnly like this:
You will most likely need to start the IDE in Administrator mode to edit the file (if you have installed in the default location).
You can solve the problem if you change the implementation of editControl::setReadOnly like this:
Code: Select all
clauses
setReadOnly(B) :-
if isShown() then
_ = sendMessage(em_setreadonly, if true = B then gui_api::wTrue else gui_api::wFalse end if)
else
setStyleBoolean(es_readonly, B)
end if.
Regards Thomas Linder Puls
PDC
PDC