Recent

Author Topic: Closebutton (X) in codeeditor tabs, How?  (Read 363 times)

cdbc

  • Sr. Member
  • ****
  • Posts: 413
    • http://www.cdbc.dk
Closebutton (X) in codeeditor tabs, How?
« on: October 19, 2022, 12:50:51 pm »
Hi
Quick question: How do they put a close button on each tab in the codeeditor?
Regards Benny
If it ain't broke, don't fix it ;)

KodeZwerg

  • Hero Member
  • *****
  • Posts: 866
  • Fifty shades of code.
    • Delphi & FreePascal
Re: Closebutton (X) in codeeditor tabs, How?
« Reply #1 on: October 19, 2022, 04:03:44 pm »
Can you be a little more specific or show a small image of what you mean.
« Last Edit: Tomorrow at 31:76:97 by KodeZwerg »

dsiders

  • Hero Member
  • *****
  • Posts: 748
Re: Closebutton (X) in codeeditor tabs, How?
« Reply #2 on: October 19, 2022, 04:21:09 pm »
Hi
Quick question: How do they put a close button on each tab in the codeeditor?
Regards Benny

In general, include nboShowCloseButton in the Options property for the tab control.

It should work for GTK and QT. It doesn't work on Windows... M$ decided people do not really need close buttons on Tabs in Vista.

EDIT:

After reading again, I see this is about SynEdit... so it probably doesn't apply.
« Last Edit: October 19, 2022, 04:26:47 pm by dsiders »
Preview Lazarus 2.3.0 documentation at: https://dsiders.gitlab.io/lazdocsnext

wp

  • Hero Member
  • *****
  • Posts: 10454
Re: Closebutton (X) in codeeditor tabs, How?
« Reply #3 on: October 19, 2022, 06:44:24 pm »
Go to "Tools" > "Options" > "Editor" > "Pages and Windows" > "Notebook Tabs": Check the box "Show close buttons in notebook". But note that this may not work depending on your operating system. It definitely does not work on Windows (and here that checkbox even is disabled).

Another way to quickly close an editor tab is to click on the tab with the mouse-wheel. This works even on Windows.

cdbc

  • Sr. Member
  • ****
  • Posts: 413
    • http://www.cdbc.dk
Re: Closebutton (X) in codeeditor tabs, How?
« Reply #4 on: October 19, 2022, 06:58:52 pm »
Hi
@dsiders: You hit the hammer exactly on the nail...
Your tip
Quote
In general, include nboShowCloseButton in the Options property for the tab control.
along with the codesnippet just did the trick, Thank you  :)
Code: Pascal  [Select][+][-]
  1. procedure TForm1.pctMainCloseTabClicked(Sender: TObject);
  2. begin
  3.   (Sender as TTabSheet).Free;
  4. end;
@wp: I'm on QT so it works with the above...
Thank you
Regards Benny
If it ain't broke, don't fix it ;)

 

TinyPortal © 2005-2018