Docked form (BorderStyle=bsNone) suddenly gets border

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #35480
    ralfiii
    Participant

    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.

    #49467
    Hamilton
    Participant

    blink.gif I'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

    #49468
    mol
    Participant

    I know this doesn't resolve the bug, but still (out of curiosity): why do you guys use forms and not TFrames?

    #49469
    Hamilton
    Participant

    Hi 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

    #49470
    ralfiii
    Participant
    '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

    #49472
    ralfiii
    Participant

    A workaround seems to be to put a SkinProvider-Component on the docked form and sert SkinData.SkinSection to “CHECKBOX”.

    #49473
    ralfiii
    Participant
    '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!!!

    #49474
    Support
    Keymaster

    Hello ralfiii and thank you for the demo, I'll look it very soon. 🙂

    #49477
    mol
    Participant
    '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

    #49478
    Hamilton
    Participant
    '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).

    #49584
    Support
    Keymaster

    Hello Ralfiii

    I'm sorry for a delay, I'll try to fix an error in the demo with the nearest release.

    #49610
    ralfiii
    Participant
    '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

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.