Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / qt / 2008-11

TabBar close buttons

7 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Paul Ishenin
to zeljko
zeljko wrote 13 lines
Hi all, I've created patch to get tabbar buttons for TCustomNotebook (custom paint). here are screenshoots: http://www.holobit.net/laztabbtnlinux.png http://www.holobit.net/laztabbtnxp.png http://www.holobit.net/laztabbtnmac.png Tab buttons are enabled on ide source editor. any clues ? should I commit ? ;)

Ofcource. Why not? Only ide have an option to show them in the source editor or not. Hope you've made them similar to gtk (I mean using the same WSClasses methods).

Best regards,
Paul Ishenin.

zeljko
to Paul Ishenin
Paul Ishenin wrote 17 lines
zeljko wrote: > Hi all, > > I've created patch to get tabbar buttons for TCustomNotebook (custom > paint). here are screenshoots: > > http://www.holobit.net/laztabbtnlinux.png > http://www.holobit.net/laztabbtnxp.png > http://www.holobit.net/laztabbtnmac.png > > Tab buttons are enabled on ide source editor. > > any clues ? should I commit ? ;) Ofcource. Why not? Only ide have an option to show them in the source editor or not. Hope you've made them similar to gtk (I mean using the same WSClasses methods).

AFAIK, TNotebook have property to enable close buttons or not , not ide only. I didn't use any WSClasses methods, just override paint method of tabbar, and ask PtInRect(point, drawedbuttonrect) when click with mouse :)

Show quoted text 7 lines
Best regards, Paul Ishenin. _______________________________________________ Qt mailing list http://www.lazarus.freepascal.org/mailman/listinfo/qt
Paul Ishenin
to zeljko
zeljko wrote
AFAIK, TNotebook have property to enable close buttons or not , not ide only. I didn't use any WSClasses methods, just override paint method of tabbar, and ask PtInRect(point, drawedbuttonrect) when click with mouse :)

Then you need to draw them only when TNotebook has this property enabled. I think you need to compare your implementation with gtk implementation to be sure you do it similar.

Best regards,
Paul Ishenin.

zeljko
to Paul Ishenin: Then you need to draw them only when TNotebook has this property enabled. I think you…
Paul Ishenin wrote 9 lines
zeljko wrote: > AFAIK, TNotebook have property to enable close buttons or not , not ide > only. I didn't use any WSClasses methods, just override paint method of > tabbar, and ask PtInRect(point, drawedbuttonrect) when click with mouse > :) Then you need to draw them only when TNotebook has this property enabled. I think you need to compare your implementation with gtk implementation to be sure you do it similar.

It is painted ONLY when that property is enabled :)

Show quoted text 7 lines
Best regards, Paul Ishenin. _______________________________________________ Qt mailing list http://www.lazarus.freepascal.org/mailman/listinfo/qt
zeljko
to Felipe Monteiro de Carvalho: I think it would be better if this was implemented in TPageControl instead. Remember that…
Felipe Monteiro de Carvalho wrote
I think it would be better if this was implemented in TPageControl instead.

it is implemented in TQtTabWidget, so I don't care is it TNotebook or TPageControl ... whatever, it's enabling custom tabs painting via new property in TQtTabWidget->ShowCloseButtons inside QtWSExtCtrls (TCustomPage.UpdateProperties) .... anyway, patch is still beta, before commiting, I'll post it here so you can try.