Topic: Slide Panel

I couldn't get my head around to make it work.


What I wanted do is a kind of slide panel made visible on button click and not visible on mouse leave of the panel. It fails on when mouse moved over a button within the panel (in this example) then panel becomes not visible. Panel should be visible until mouse leaves the panel or a button in the panel clicked.


I have done accordion style, which works but in this case I like the panel becomes invisible once mouse leaves the panel rather than clicking again show/hide toggle button.


The purpose of it is to save space on the form.


Please see the attached sample project:

Post's attachments

Attachment icon Slide Panel.zip 5.82 kb, 357 downloads since 2017-12-08 

Adam
God... please help me become the person my dog thinks I am.

Re: Slide Panel

Instead this

procedure Form1_Panel1_OnMouseLeave (Sender: TObject);
begin
    Form1.btnSlide.Caption := '<<';
    Form1.Panel1.Visible := False;
end;

try to use this

procedure Form1_OnMouseEnter (Sender: TObject);
begin
    Form1.btnSlide.Caption := '<<';
    Form1.Panel1.Visible := False;
end;

procedure Form1_TableGrid1_OnMouseEnter (Sender: TObject);
begin
    Form1.btnSlide.Caption := '<<';
    Form1.Panel1.Visible := False;
end;
Dmitry.

3 (edited by derek 2017-12-08 18:35:36)

Re: Slide Panel

Hi Adam,
If you're interested in saving space on forms, a couple of alternative approaches (in the attachment) that I've used in the past might help.
Option 1 - keyboard short-cut (ALT+M) to toggle a menu off and on
Option 2 - use a 'bounce bar' - just take the mouse right to the bottom of the screen to display a menu (very much like the windows taskbar).
And the other option (not included in the attachment) would be to add items to the mouse 'right click'.
Obviously, you can do this with pretty much anything (although both examples I have attached just happen to be for menu options).
I'm sure any of the above can be used in conjunction with Dmitry's solution.
Regards,
Derek.

Post's attachments

Attachment icon slidepanel alternatives.zip 677.75 kb, 429 downloads since 2017-12-08 

Re: Slide Panel

Hi Dmitry,
Thank you very much..............
Looks like I wasn't able to think "Outside the box".


Hi Derek,
Thank you very much for alternatives..............
Especially for keyboard shortcut option. I learned something new.

Adam
God... please help me become the person my dog thinks I am.