Forum > Editor

IDE - Panel hide away!

(1/3) > >>

Nicole:
Some functions are to display and to hide away. These functions I group on an invisible panel. A button allows at runtime to display the panel with its functions. The second click hides the panel away again.

This is a fine solution at runtime. But how to work with it at design time? The elements BELOW these panel are complicated to work with. So I shift the panel and on next run its position is lost. I found a thing called "z-order". I am not sure how it works and it never does what I want.

As everybody has this topic, there shall be better ways to handle this. Please be so kind to share them with me.

KodeZwerg:
I am unsure what you talk about, it sound like a component but wait, we are in the IDE/Editor forum...

Please explain it better, in best case with screenshots.

VisualLab:

--- Quote from: Nicole on February 23, 2024, 05:08:49 pm ---Some functions are to display and to hide away. These functions I group on an invisible panel. A button allows at runtime to display the panel with its functions. The second click hides the panel away again.

This is a fine solution at runtime. But how to work with it at design time? The elements BELOW these panel are complicated to work with. So I shift the panel and on next run its position is lost. I found a thing called "z-order". I am not sure how it works and it never does what I want.

As everybody has this topic, there shall be better ways to handle this. Please be so kind to share them with me.

--- End quote ---

This is useful when you need to change the order in which sibling window controls overlap with each other. To move controls programmatically you can use: BrignTo Front and SendToBack.

You can also use TNotebook or TPageControl controls. They both have pages. Except that TPageControl has tabs (they can be hidden).

Josh:
If it were me,I would move it out the way.
then in the form onactivate or form onshow or the code that the button runs move it back where needed.

you could send the panel to back in object inspector of the panel, but then its out of sight,i like things to be in sight even if not in right location.

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---....  mypanel.top:=mybutton.top+mybutton.height+4;//or absolute address if only one widgetset   mypanel.left:=mybutton.left;//or absolute address if only one widgetset...// code for button...  mypanel.visible:=not mypanel.visible;  if mypanel.visible then  begin    mypanel.bringtofront;    mypanel.invalidate;  end;.....

TRon:
At designtime use two panels: one for your 'shift' panel and one for your client area. Align the shift panel to the left and the other panel to the client rectangle of the form. On formcreate event remove the alignment of the shift panel and change the z-order as suggested by VisualLab.

That should be able to make things workable for you at designtime. Perhaps you also need to change the size (width) of the window at form creation (form.width := formwidth - shiftpanel.width to not make it too obvious there is space reserved for your shifting panel.

Navigation

[0] Message Index

[#] Next page

Go to full version