Something about the way Delphi implements the TFrame class doesn't
seem right.  I DID solve the problem by going back to the methods I used
when frames first came out way back when, but perhaps someone can explain
why it works as it does...or perhaps I should say doesn't work as they
should when added via the frames component!
        Read the copy below to understand the problem I was having.  What I
did to solve it was take the Frames out of the form class properties and add
them back in as variable instances in the interface section of the form
carrying the tabSheet on which the frames were to be displayed.  I also had
to delete the frames from the Tabsheet and then in my form's OnCreate I
created instances of all the frames, making them owned and parented by the
TabSheet.  
        As soon as I did this everything worked correctly as it should have
before.  But what really makes no sense to me at all is the fact that these
problems I was having with methods on the individual frames getting fired
properly was that you would think this would occur in all frames, as I used
each of them in exactly the same way.  But that wasn't the case.  Only
frames 3 and 4 didn't work correctly while frames 1 and 2 worked as they
should have!  Frame one was brought to the front upon the Form and Tabsheet
being shown, which may have accounted for some difference, although I can't
imagine what...but frame 2 was used exactly as frames 3 and 4 were, so why
did 3 and 4 not work!
        If anyone can explain this I'd like to hear about it. 

from Robert Meek dba Tangentals Design  CCopyright 2006
Proud to be a moderator of "The Delphi Lists" at elists.org

"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


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf
Of Robert Meek
Sent: Monday, October 09, 2006 2:28 PM
To: [email protected]
Subject: Frames problem D2006

        Here's a strange problem I can't figure out!
        I have a form with a Tabcontrol on it, and the tabcontrol parents 4
different frames I've created and which are part of the project.  I added
these frames to the tabsheet by dropping the TFramePicker component on it
and selecting them to be added one at a time.
        In the tabcontrol's OnChange event I have a case statement which
brings to the front the frame associated with the selected tab.
        On all of these frames I have Raize buttonedits that are DB-aware,
and they are hooked into the proper datasource and field of my tables.  When
a tab is changed and the frame comes to the front, the table in question is
placed into edit mode so the user can information via keystrokes, drag &
drop, or via an openFileDialog that executes upon an edit's button click.
        Frame number one is set to be opened and visible in the foreground
when the tabsheet's form is created and shown.  It works fine.  Frame number
two when moved to also works fine allowing the user to edit a table by any
of these methods.  But frames three and four although allowing the user to
edit via the keyboard does not accept drag & drop nor will their edits react
to their buttons being clicked to display the open file dialog.  The strange
thing is that all the code and all edit properties are exactly the same on
frames two and three, and they also share the same datasource although
hooked to different fields.  I've checked everything a number of times and
the table is in edit mode, the components and table fields are all enabled,
the very same open file dialog which is parented by the form the tabsheet is
on is being used by all frames and is called in exactly the same way, and
even the individual buttons are working and enabled!
        I thought at first perhaps my button click events had to be created
via the edits as they appear on each frame instance on the form, instead of
on the original frames themselves, but if that were the case then Frame two
would exhibit the same kinds of problems.  I even tried setting the events
for the open file dialog and drag and drop components in code in case they
were somehow becoming disconnected at runtime, but no go!  I'm completely
baffled by this one as I've used these same techniques and components in the
past without trouble.  So any ideas would be appreciated!  

from Robert Meek dba Tangentals Design  CCopyright 2006
Proud to be a moderator of "The Delphi Lists" at elists.org

"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

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

Reply via email to