- This topic has 11 replies, 4 voices, and was last updated 11 years, 11 months ago by ralfiii.
-
AuthorPosts
-
November 27, 2012 at 4:34 pm #35480ralfiiiParticipant
Hello!
I want to dock a form that was created with BorderStyle=bsNone into a panel.
Without AlphaSkins this works nice, with AC the docked form suddenly gets a frame. (see attached image)
I suppose this is a bug.
Attached is a little demo project.
November 28, 2012 at 1:56 am #49467HamiltonParticipantI'm amazed I hadn't noticed this before as I'm using docked forms in all my main apps; to the point now I'm so used to seeing my apps look like they do that when that this is fixed I may need to add borders to my docked forms to maintain the current appearance.
Anyway can confirm this behaviour exists in 8.04 with all skins and has been around for a long time.
Regards,
Hamilton
November 28, 2012 at 4:39 am #49468molParticipantI know this doesn't resolve the bug, but still (out of curiosity): why do you guys use forms and not TFrames?
November 28, 2012 at 7:59 am #49469HamiltonParticipantHi mol, good question! It is probably just habit on my part. I was originally excited when TFrame first appeared and learned the hard way that the original implementation was incredibly buggy and tended to mess with form layout and then save those changes without you realizing. Using descendent frames was a big part of the problem in my case but IIRC I stopped using them altogether when it seemed that even the most basic TFrame could not be relied upon. Your post prompted me to look at some other newsgroups to see how people are using frames these days and it appears that many of the issues have been fixed so I could probably reinvestigate the technology – but tbh I'm hesitant because I've lost a lot of time on this in the past, whereas forms work perfectly every time (border issues aside). The presence of form events is possibly another consideration (though with proper OO code it is an easily surmounted hurdle).
TLDR: habit!
Regards,
Hamilton
November 28, 2012 at 8:47 am #49470ralfiiiParticipant'mol' wrote:I know this doesn't resolve the bug, but still (out of curiosity): why do you guys use forms and not TFrames?
I use frames whenever I need “component-like” functionality, i.e. a couple of components+code instanced a couple of times.
In this case I use Forms because the module can be docked (without border), or the module can “live free” as normal free floating Forms (with Border). And a TFrame is missing the OnPaint-event which I need.
Ralf
November 28, 2012 at 11:23 am #49472ralfiiiParticipantA workaround seems to be to put a SkinProvider-Component on the docked form and sert SkinData.SkinSection to “CHECKBOX”.
November 28, 2012 at 2:50 pm #49473ralfiiiParticipant'ralfiii' wrote:A workaround seems to be to put a SkinProvider-Component on the docked form and sert SkinData.SkinSection to “CHECKBOX”.
But that leads to a real CATASTROPHIC bug.
I create such a form (in a panel) – see 01_Ok.png.
Then I maximize the parent form. As a result the new area of the docked form is not skinned at all. (see 02_Maximized_Fail.png).
Very irritating: The sequence of OnResize and OnPaint is inverted for the docked form.
So when I maximize the Mainform this is the sequence of events:
DockedForm.OnPaint
DockedForm.OnResize <- this should be called BEFORE the paint, not after it. I suppose this is the cause for that bug. MainForm.OnResize MainForm.OnPaint A little app demonstrating this is attached. Tested with V8.10 – reproducable. Help!!!
November 28, 2012 at 3:55 pm #49474SupportKeymasterHello ralfiii and thank you for the demo, I'll look it very soon. 🙂
November 28, 2012 at 5:11 pm #49477molParticipant'ralfiii' wrote:And a TFrame is missing the OnPaint-event which I need.I usually use this approach: http://www.delphipages.com/forum/showthread.php?t=118316
November 28, 2012 at 5:35 pm #49478HamiltonParticipant'ralfiii' wrote:or the module can “live free” as normal free floating Forms (with Border).
If I understand this correctly, you can of course achieve this with frames by just creating the form dynamically and docking the frame into it. Still, I understand where you're coming from and in those cases where I have used frames it has been much as you describe, for grouping controls for things such as font properties (and I absolutely avoid visual inheritence).
'mol' wrote:I usually use this approach: http://www.delphipag…ad.php?t=118316
Unfortunately TFrame doesn't contain OnPaint so this approach won't apply.
EDIT: Handling WM_PAINT might work though. As would client-aligning a control that does support OnPaint, such as this nifty approach using a paintbox (http://www.delphigro…/28/415014.html).
December 6, 2012 at 6:48 pm #49584SupportKeymasterHello Ralfiii
I'm sorry for a delay, I'll try to fix an error in the demo with the nearest release.
December 13, 2012 at 10:44 am #49610ralfiiiParticipant'Support' wrote:Hello Ralfiii
I'm sorry for a delay, I'll try to fix an error in the demo with the nearest release.
Super, solved in 8.11
-
AuthorPosts
- You must be logged in to reply to this topic.