I've probably written well over 20 different types or styles of text
editors over the last couple of years, some hooked up to dB tables, some
not, but never having done more than play around with the RTF controls I
decided to use the demo application that comes with Delphi as a sort of
template for a combined Rich and Plain text editor I'm working on now.
        I seem to have two major problems.  The first being that when I run
the demo and/or my version based on it, the paste button and the Undo
buttons on the toolbar both tend to start flickering the moment I click on
and set focus to the rtf control.  Both of these buttons are merely hooked
up to the standard actions provided for these events.
        The second problem has nothing to do with the rtf control itself,
but with handling the form it is on.  In this particular case I am creating
the form at runtime using the following:

If Myrtfform <> nil then
begin
      MyrtfForm := TMyrtfform.create(self);
      Myrtfform.Show
End
Else
Begin
      Myrtfform.Show;
End;

        And as I do with a number of other forms without any problems, I
then access a global inifile and read the values for the form's Top, Left,
Height, and Width settings as the very first lines in it's OnCreate method.
I set them based on current settings in the form's OnClosequery or OnClose
methods depending upon other matters.
        As I said this has always worked before, and as a matter of fact in
this same application works just fine on a number of other forms as well!
But on this one form, I keep getting an AV error when the form's OnCreate is
called.  It's always for whatever of the four position settings I set first,
such as with top := MyInifile.ReadInteger(MyUserName, 'Myrtfformtop', 20);
The error will say that I have an access violation in Top = 0 on line such
and such.
        The form is set to 'Design' for position, and everything else is as
per the default form settings.  I tried moving this into the form's Onshow
method and got the same results!  The ONLY way I get it to run is by setting
the positions in the method that calls the form's OnCreate, and before the
call to form.Show!  
        Normally this would seem to indicate that instance of the Inifile is
not properly scoped to this form, but is to the form calling it's OnCreate
method, but this isn't the case.  Any ideas?  

from Robert Meek dba Tangentals Design  CCopyright 2006

"When I examine myself and my methods of thought, I come to the conclusion
that the gift of Fantasy has meant more to me then my talent for absorbing
positive knowledge!"
                                                    Albert Einstein



_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to