Page 1 of 1

Problems with editor controls

Posted: 1 Mar 2015 9:10
by ludieter
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?

Posted: 2 Mar 2015 9:30
by Thomas Linder Puls
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:

Code: Select all

clauses     new(...) :-         ...         addShowListener({ :-             %This will happen when the controls "are about to be shown"             myEdit_ctl:doSomething(...)         }).

Posted: 2 Mar 2015 14:23
by Thomas Linder Puls
We have not been able to reproduce a problem with editControl::setReadOnly, are you using build 7501?

IDE: Web -> Check for updates....

Posted: 2 Mar 2015 17:29
by ludieter
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)...

Posted: 2 Mar 2015 17:30
by ludieter
will try adding showlistener with the scilexer control and get back to you
Thx
Dieter

Re:

Posted: 2 Mar 2015 18:43
by Thomas Linder Puls
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)...
Could you show the code?

Posted: 2 Mar 2015 19:20
by ludieter
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

Posted: 3 Mar 2015 9:41
by Thomas Linder Puls
Thank you!

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.
You will most likely need to start the IDE in Administrator mode to edit the file (if you have installed in the default location).

Posted: 4 Mar 2015 7:06
by ludieter
Thanks Thomas! Works like a charm.