Lazarus

Programming => Packages and Libraries => Topic started by: Alextp on May 21, 2014, 04:56:55 pm

Title: ATTabs: lite tab control
Post by: Alextp on May 21, 2014, 04:56:55 pm
I want to make such nice TabControl, maybe like ST2 editor.
I don't want OS themed control, only my custom painted with nice look. 

I start at https://github.com/Alexey-T/ATTabs
Sample attached
 
Title: Re: TabControl: my attempt needed?
Post by: kapibara on May 22, 2014, 04:20:25 am
Nice!

I'm interested in such a control. Can it be used borderless? Or maybe thats just an issue with PageControls.

Some thoughts:

Associating an object with a tab (using Tabs.Objects) is something that Lazarus page/tab controls dont do at this time. Maybe your control will?

Tabs.Object[idx]:=MyControl

Flipping the page could then switch to the associated control stored in the Tabs.Objects[idx]

Or simpler, switching visible control could be done programmatically in the OnChange event. At the moment I'm using a separate list for storing the controls that will be shown when a tab is selected. But storing them as an object in the tab list feels more optimal.
Title: Re: TabControl: my attempt needed?
Post by: r_1gm on May 22, 2014, 07:41:19 am
Hi Alex,

Maybe you can improve Lazarus CustomDrawn control component.
Title: Re: TabControl: my attempt needed?
Post by: Alextp on May 22, 2014, 05:28:20 pm
Of course: each tab will have it's data, which is
- Caption
- Hilite color (default clNone - change to show colored label on tab)
- TObject
- Modified (bool for future, maybe I show some mark ltr)

EARLY early!! alpha is here: https://github.com/Alexey-T/ATTabs
I start with Delphi: NO Lazarus yet!
I port it later

Title: Re: TabControl: my attempt needed?
Post by: kapibara on May 22, 2014, 06:45:06 pm
Tried the alpha, it looks fine. Good balance between custom look and standard.

It would be useful if the control supports BorderStyle = bsNone. Lazarus TabControl dont do that.

You probably already planned to have a
TabPosition property, tpBottom etc.

Looking forward to the next version. :)
Title: Re: TabControl: my attempt needed?
Post by: Alextp on May 22, 2014, 07:41:06 pm
What do u mean (BorderStyle bsNone)? i don't paint any border. You may add "Issue" at Github. better discuss border-style there.
Title: Re: atTabs: TabControl in Sublime style
Post by: Alextp on May 22, 2014, 11:14:17 pm
1st version OK for Lazarus, if you open Demo.dpr file, add Interfaces unit (as IDE tells! do it.) and run, you ll see working tab app.
I tested on Win. Of coz, I test later on M+L
Title: Re: atTabs: TabControl in Sublime style
Post by: andersonscinfo on May 23, 2014, 12:51:26 am
Tested on Linux using Lazarus with FPC 2.6.2 RC1 1.2, ran cool, just seemed a bit slow, but it works perfect.

Att
Anderson Junior
Title: Re: atTabs: TabControl in Sublime style
Post by: Alextp on May 23, 2014, 01:23:06 am
Good- tkx! I test Lin later. No even Linux here
I ll add  buttons <<, >> to scroll Long list.
Title: Re: atTabs: TabControl in Sublime style
Post by: andersonscinfo on May 23, 2014, 02:43:16 am
Getting this Very beautiful, congratulations.

Att.
Anderson Junior
Title: Re: atTabs: TabControl in Sublime style
Post by: kapibara on May 23, 2014, 05:58:07 am
Alex22: Ah, there is no border. sorry I missed that.

Seems to work fine under Windows 7 and FPC 2.7.1 - Lazarus SVN 44339





Title: Re: atTabs: TabControl in Sublime style
Post by: Alextp on May 24, 2014, 01:19:49 am
Im near beta.Updated. Buttons < > don't work yet (and scrollin)
Anyone may test it on Mac?? Please. Does it work, slow or not
Title: Re: atTabs: TabControl in Sublime style
Post by: kapibara on May 24, 2014, 06:37:07 am
Good progress. However I should report that in the latest version, the TabControl as a whole flickers when the mouse moves over it. (here: Lazarus/fpc 2.7.1/win7)
Title: Re: atTabs: TabControl in Sublime style
Post by: zeljko on May 24, 2014, 05:10:16 pm
Works nice with Qt LCL under linux, mswin and mac.
Title: -
Post by: Alextp on May 24, 2014, 05:12:13 pm
Thanks for testin (I don't have a mac) :)
Title: -
Post by: Alextp on May 24, 2014, 06:15:38 pm
Any way to make OnMouseLeave for a TPanel?? so i can remove hilite color if need.
How?
Title: Re: atTabs: TabControl in Sublime style
Post by: BigChimp on May 24, 2014, 07:02:54 pm
Have the same here:
Good progress. However I should report that in the latest version, the TabControl as a whole flickers when the mouse moves over it. (here: Lazarus/fpc 2.7.1/win7)
when I tried
Lazarus1.2.0 http://yadi.sk/d/oa39BEOwRAg2w

Windows 7 x64, disabled as much eye candy as possible (no aero/glass/whatever it's called)
Title: -
Post by: Alextp on May 24, 2014, 07:33:41 pm
Flicker on Win CLASSIC theme fixd.
Title: Re: atTabs: TabControl in Sublime style
Post by: kapibara on May 25, 2014, 02:25:00 pm
Right, no flicker anymore.
Title: Re: atTabs: TabControl in Sublime style
Post by: Alextp on May 25, 2014, 05:06:26 pm
Almost ready; made tab autosize, scrolling like ST2 not wanted now.
Can use in real app.
Title: Re: ATTabs: lite tab control
Post by: Alextp on May 27, 2014, 05:29:56 am
Drag-drop added
(colored move point is shown)
TinyPortal © 2005-2018