Recent

Author Topic: Stacked Panel Visibilty  (Read 1790 times)

Zath

  • Sr. Member
  • ****
  • Posts: 391
Stacked Panel Visibilty
« on: September 19, 2017, 01:00:58 am »
I'm creating a text editor for some game files.
There are multiple files that will each be openable in TMemo boxes set within a Panel containing a few other buttons etc.

Is it best practise to have all panels visible and simply bring a panel to the front using Z order or should they all be hidden and use visibility instead ?

This brings me to my next question. Should I allow a user to move between panels without closing / saving files or force the user to close / save ?
If they remain open, I'd need a check for open files before closing the program.

fred

  • Full Member
  • ***
  • Posts: 201
Re: Stacked Panel Visibilty
« Reply #1 on: September 19, 2017, 08:06:13 am »
Some of my thoughts...
You could use a TPageControl then you have one at a time visible.
If you want to show 2 at a time you can use a T(Pair)Splitter.
About saving, I would say ask on Close, sometimes you make changes that you don't want to save :)

Thaddy

  • Hero Member
  • *****
  • Posts: 14203
  • Probably until I exterminate Putin.
Re: Stacked Panel Visibilty
« Reply #2 on: September 19, 2017, 09:18:42 am »
I would also go with the PageControl.
I would check memoX.modified, memoY.modified etc in the mainform's OnCloseQuery and ask to save on a per memo basis or through a single dialog with checkboxes for each memo..
E.g. Geany asks on a per editor (memo) basis, but some other programs present all editors modified in one go. I like the last one, but that is personal.


Note: don't forget to set modified for each memo to false after loading the files...Otherwise the memo's will always have modified = true  :D

Note2: if you go for my approach, make the checkboxes for unmodified memo's (unchecked, well that should be the case anyway)  and disabled or hide them.
I would go for disabled if you have a fixed number of files and hide them if you have a variable number of files..
« Last Edit: September 19, 2017, 09:27:36 am by Thaddy »
Specialize a type, not a var.

Zath

  • Sr. Member
  • ****
  • Posts: 391
Re: Stacked Panel Visibilty
« Reply #3 on: September 23, 2017, 10:52:07 am »
Thanks for the replies.
I have several menu options each with multiple sub menus so multiple pages might look odd. I'll give it a go, see how it feels.

 

TinyPortal © 2005-2018