 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Peter Venis Guest
|
Posted: Fri Mar 25, 2005 5:37 pm Post subject: Weird behaviour on the order of left aligned panels |
|
|
Hi
I have three panels (Panel1, Panel2, Panel3) inside one larger panel
(MainPanel). All three panel's alignment proprties are set to 'Left' and the
three panels are seperated using splitters (splitter1, splitter2)
Now I have a button on a form, when I press the button panel, Panel1 and
Splitter1 are set to Hide(), when I press again they both are set to Show().
Weird thing is, I works the first couple of times I press the button, they
dissapear and reapear just as they suppose to. But the third time or so when
they reapear, the order of the Panels is not right. I get Panel2, Panel1,
Panel3.
I've been trying for ages trying to figure out the cause and how to prevent
this. The best I could find in the documentation was something about ZOrder,
but trying to call SetZOrder() didn't work because the compiler claims that
method isn't accessible. I also tried BringToFront() but that obviously
wasn't it.
Any idea what might cause this and how to prevent those panels from getting
mixed up?
Peter
|
|
| Back to top |
|
 |
Vladimir Stefanovic Guest
|
Posted: Fri Mar 25, 2005 5:57 pm Post subject: Re: Weird behaviour on the order of left aligned panels |
|
|
I had a similar problem. I solved that (somehow) by
temporarily assigning the alignment of static panels
to alNone, instead of alLeft, then Show() your affected
panel, and after showing it, assign it alLeft again.
In other words, in critical Show/Hide operations, I
setted other panels' alignment temporarily to alNone.
--
Best regards,
Vladimir Stefanovic
"Peter Venis" <petervenis (AT) zonnet (DOT) nl> wrote
| Quote: | Hi
I have three panels (Panel1, Panel2, Panel3) inside one larger panel
(MainPanel). All three panel's alignment proprties are set to 'Left' and
the three panels are seperated using splitters (splitter1, splitter2)
Now I have a button on a form, when I press the button panel, Panel1 and
Splitter1 are set to Hide(), when I press again they both are set to
Show().
Weird thing is, I works the first couple of times I press the button, they
dissapear and reapear just as they suppose to. But the third time or so
when they reapear, the order of the Panels is not right. I get Panel2,
Panel1, Panel3.
I've been trying for ages trying to figure out the cause and how to
prevent this. The best I could find in the documentation was something
about ZOrder, but trying to call SetZOrder() didn't work because the
compiler claims that method isn't accessible. I also tried BringToFront()
but that obviously wasn't it.
Any idea what might cause this and how to prevent those panels from
getting mixed up?
Peter
|
|
|
| Back to top |
|
 |
Damon Chandler (TeamB) Guest
|
Posted: Sat Mar 26, 2005 7:26 am Post subject: Re: Weird behaviour on the order of left aligned panels |
|
|
Hi Peter,
You can change the relative alignment of controls by adjusting the
controls' position (via code) as you would via drag-and-drop if you were
to perform the same operation at design-time. So, try setting the Left
property of Pane1 to 0. There's a brief example (for alTop-aligned
panels) here...
http://tinyurl.com/5cg7f
Good luck,
--
Damon (TeamB)
C++Builder Developer's Journal
http://bcbjournal.com
BCB Commonly Asked Questions
http://bcbjournal.com/bcbcaq
Peter Venis wrote:
| Quote: | Hi
I have three panels (Panel1, Panel2, Panel3) inside one larger panel
(MainPanel). All three panel's alignment proprties are set to 'Left' and the
three panels are seperated using splitters (splitter1, splitter2)
Now I have a button on a form, when I press the button panel, Panel1 and
Splitter1 are set to Hide(), when I press again they both are set to Show().
Weird thing is, I works the first couple of times I press the button, they
dissapear and reapear just as they suppose to. But the third time or so when
they reapear, the order of the Panels is not right. I get Panel2, Panel1,
Panel3.
I've been trying for ages trying to figure out the cause and how to prevent
this. The best I could find in the documentation was something about ZOrder,
but trying to call SetZOrder() didn't work because the compiler claims that
method isn't accessible. I also tried BringToFront() but that obviously
wasn't it.
Any idea what might cause this and how to prevent those panels from getting
mixed up?
Peter
|
|
|
| Back to top |
|
 |
Damon Chandler (TeamB) Guest
|
Posted: Sat Mar 26, 2005 7:28 am Post subject: Re: Weird behaviour on the order of left aligned panels |
|
|
Hi Vladimir,
You might have already tried this, but it sounds like you might be
better-served by using the DisableAlign() method of the parent control.
Cheers,
--
Damon (TeamB)
C++Builder Developer's Journal
http://bcbjournal.com
BCB Commonly Asked Questions
http://bcbjournal.com/bcbcaq
Vladimir Stefanovic wrote:
| Quote: | I had a similar problem. I solved that (somehow) by
temporarily assigning the alignment of static panels
to alNone, instead of alLeft, then Show() your affected
panel, and after showing it, assign it alLeft again.
In other words, in critical Show/Hide operations, I
setted other panels' alignment temporarily to alNone.
|
|
|
| Back to top |
|
 |
Vladimir Stefanovic Guest
|
Posted: Sat Mar 26, 2005 7:31 am Post subject: Re: Weird behaviour on the order of left aligned panels |
|
|
| Quote: | Hi Vladimir,
You might have already tried this, but it sounds like
you might be better-served by using the DisableAlign()
method of the parent control.
|
No, I have never tried DisableAlign() before, and I should
try it definitely. Thanks.
--
Best regards,
Vladimir Stefanovic
|
|
| Back to top |
|
 |
Peter Venis Guest
|
Posted: Sat Mar 26, 2005 8:26 am Post subject: Re: Weird behaviour on the order of left aligned panels |
|
|
Thanks, that did the trick
Peter
"Damon Chandler (TeamB)" <editor (AT) _REMOVE_THIS_SPAM_GUARD_bcbjournal (DOT) com>
schreef in bericht news:42450e86$1 (AT) newsgroups (DOT) borland.com...
| Quote: | Hi Peter,
You can change the relative alignment of controls by adjusting the
controls' position (via code) as you would via drag-and-drop if you were
to perform the same operation at design-time. So, try setting the Left
property of Pane1 to 0. There's a brief example (for alTop-aligned
panels) here...
http://tinyurl.com/5cg7f
Good luck,
--
Damon (TeamB)
C++Builder Developer's Journal
http://bcbjournal.com
BCB Commonly Asked Questions
http://bcbjournal.com/bcbcaq
Peter Venis wrote:
Hi
I have three panels (Panel1, Panel2, Panel3) inside one larger panel
(MainPanel). All three panel's alignment proprties are set to 'Left' and
the three panels are seperated using splitters (splitter1, splitter2)
Now I have a button on a form, when I press the button panel, Panel1 and
Splitter1 are set to Hide(), when I press again they both are set to
Show().
Weird thing is, I works the first couple of times I press the button,
they dissapear and reapear just as they suppose to. But the third time or
so when they reapear, the order of the Panels is not right. I get Panel2,
Panel1, Panel3.
I've been trying for ages trying to figure out the cause and how to
prevent this. The best I could find in the documentation was something
about ZOrder, but trying to call SetZOrder() didn't work because the
compiler claims that method isn't accessible. I also tried BringToFront()
but that obviously wasn't it.
Any idea what might cause this and how to prevent those panels from
getting mixed up?
Peter
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|