Recent

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

cdbc

  • Hero Member
  • *****
  • Posts: 1497
    • 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 ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 2.2.6 up until Jan 2024 from then on it's: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 3.0

KodeZwerg

  • Hero Member
  • *****
  • Posts: 2269
  • 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 xm by KodeZwerg »

dsiders

  • Hero Member
  • *****
  • Posts: 1216
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 3.99 documentation at: https://dsiders.gitlab.io/lazdocsnext

wp

  • Hero Member
  • *****
  • Posts: 12297
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

  • Hero Member
  • *****
  • Posts: 1497
    • 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 ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 2.2.6 up until Jan 2024 from then on it's: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 3.0

 

TinyPortal © 2005-2018