TabBarGadget - Tabs like in a browser

Share your advanced PureBasic knowledge/code with the community.
staringfrog
User
User
Posts: 58
Joined: Wed Feb 27, 2013 9:36 am

Re: TabBarGadget - Tabs like in a browser

Post by staringfrog »

oh, the pleasure is all mine!

yes, I am testing your marvelous gadget at the moment, among other things, against "clickable text labels" (that I use instead of standard win panel gadget, due to irksome flicker effect on old Windows). See, when you've got a set number of tabs (say, three or five) and your form's resizable (and so are your tabs, with #TabBarGadget_MinTabLength flag, right), those tabs can get really wide, so that text labels need some alignment.

All in all, I can state your library is jolly well shaped, as it is! I hope no one would get hurt if I say that somehow German people seem to be the best in that old gadget-crafting business :D (as I judge from my humble experience).
Coding's men's knitwork.
Poshu
Enthusiast
Enthusiast
Posts: 459
Joined: Tue Jan 25, 2005 7:01 pm
Location: Canada

Re: TabBarGadget - Tabs like in a browser

Post by Poshu »

For the record, I'm using it too and I love it. Never had anything to complain so I did not post here, but it is, imho, one of the very best gadget out there.
User avatar
STARGÅTE
Addict
Addict
Posts: 2067
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: TabBarGadget - Tabs like in a browser

Post by STARGÅTE »

Short feedback from my side.
I'm working at the moment on the next beta version of 1.5 and I add this featurs:
  • Individual attributes for tabs: close button, check box (@staringfrog, and many more users)
  • new attribute: #TabBarGadget_SelectedCloseButton to display only on the selected tab a close button (@kenmo)
  • alignment (left, center, right) for tab text (@staringfrog)
    Image
    Is this right staringfrog?
Please post more featurs for the next beta, before I publish. Thx.
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
User avatar
STARGÅTE
Addict
Addict
Posts: 2067
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: TabBarGadget - Tabs like in a browser

Post by STARGÅTE »

thx Louise
  • "1- pin and unpin tab. like firefox 30.0"
    This feature is for a future version.
  • "RightToLeft Property"
    Yes, an attribute to inverse the tab order.
  • "DrawFocusRect Property"
    You mean the focus rectangle from the canvas gadget (#PB_Canvas_DrawFocus)?
  • "Appearance Property"
    I think, this can be a copyright issue!
    But I had the idea to define the appearance with XML (optional).
    SetTabBarGadgetAppearance(), and in the XML fiel you can define paddings, margins, positions, borders, and images for normal, active, hovered, ... tabs.
    But this featurs is also for a future version.
  • "BoldSelected Property"
    See previous point.
  • "English help"
    Really right, and I work at the moment on the translation.
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
staringfrog
User
User
Posts: 58
Joined: Wed Feb 27, 2013 9:36 am

Re: TabBarGadget - Tabs like in a browser

Post by staringfrog »

STARGÅTE,

precisely so. Individual attributes for tabs, to make do with just a single TabBarGadget in most cases. And text alignment, as soon as you enable us to draw wide tabs.

By the way, Stargate, do you use any "intelligent double buffering" (as Chris put it) in your gadget? I have noticed that active resizing of 5 TabBar tabs in a row (that is, resizing of tab widths themselves, with #TabBarGadget_MinTabLength flag, proportionally to the overall form width) isn't quite flicker-free on my themed WinXP. Again, I'm just wondering, as all those flicker-on-resize tricks appear to be my major headache on Windows (and probably these problems are not that common).
Last edited by staringfrog on Sun Jul 20, 2014 1:23 am, edited 1 time in total.
Coding's men's knitwork.
User avatar
STARGÅTE
Addict
Addict
Posts: 2067
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: TabBarGadget - Tabs like in a browser

Post by STARGÅTE »

staringfrog wrote:By the way, Stargate, do you use any "intelligent double buffering" (as Chris put it) in your gadget? I have noticed that active resizing of 5 TabBar tabs in a row (that is, resizing of tab widths themselves, with #TabBarGadget_MinTabLength flag, proportionally to the overall form width) isn't quite flicker-free on my themed WinXP.
I have testing this code:

Code: Select all

IncludeFile "TabBarGadget.pbi"


Enumeration
	#Window
	#Gadget
EndEnumeration

Procedure Callback()
	ResizeGadget(#Gadget, 0, 0, WindowWidth(#Window), 25)
	SetTabBarGadgetAttribute(#Gadget, #TabBarGadget_MinTabLength, Int((WindowWidth(#Window)-TabBarGadgetInclude\Margin)/CountTabBarGadgetItems(#Gadget)))
EndProcedure


OpenWindow(#Window, 0, 0, 800, 600, "WindowTitle", #PB_Window_MinimizeGadget|#PB_Window_ScreenCentered|#PB_Window_SizeGadget)
TabBarGadget(#Gadget, 0, 0, 800, 25, #Null, #Window)
AddTabBarGadgetItem(#Gadget, 0, "tab 1")
AddTabBarGadgetItem(#Gadget, 1, "tab 2")
AddTabBarGadgetItem(#Gadget, 2, "tab 3")
AddTabBarGadgetItem(#Gadget, 3, "tab 4")
AddTabBarGadgetItem(#Gadget, 4, "tab 5")

BindEvent(#PB_Event_SizeWindow, @Callback())
Callback()

Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
I can't see any flicker.
Node: If you set a min tab width (depending on the gadget width) you have to subtract the tab bar margin and rounding down.
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
staringfrog
User
User
Posts: 58
Joined: Wed Feb 27, 2013 9:36 am

Re: TabBarGadget - Tabs like in a browser

Post by staringfrog »

I can't see any flicker.
Me neither. Thanks for your example and advice. It might be that my project form is too overloaded with resizable controls and splitters, and some are not coded/calculated correctly. Thank you for your quick reply, and hope to see your new version soon!
Coding's men's knitwork.
User avatar
STARGÅTE
Addict
Addict
Posts: 2067
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: TabBarGadget - Tabs like in a browser

Post by STARGÅTE »

I am very happy to present you the new beta (but hopefully soon final) version:

Here the download with the new include and my demo:
TabBarGadget - 1.5 Beta 2

Update 1.5 Beta 2 (6. August 2014)
  • SetTabBarGadgetItemAttribute() and GetTabBarGadgetItemAttribute(): Changes or returns the attribute of a tab.
    So you can add a checkbox or a close button on a single tab.
  • #TabBarGadget_TabTextAlignment: Changes the alignment of the text in a tab with more space.
  • #TabBarGadget_SelectedCloseButton: Add a close button only on selected tabs.
  • #TabBarGadget_ReverseOrdering: Reverses the ordering of the tabs (to "right to left").
    The feature is for example for arabic tab bars.
  • A first version of a new online documentation in english: http://help.unionbytes.de/tbg/
Image
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
User avatar
kenmo
Addict
Addict
Posts: 1967
Joined: Tue Dec 23, 2003 3:54 am

Re: TabBarGadget - Tabs like in a browser

Post by kenmo »

Thank you STARGATE ("the legend") :)

I will definitely try it out and report any issues. I feel bad for not giving a lot of feedback on Beta 1 - but in my projects I mostly use the basic features (not Editable tabs, Checkboxes, etc.).

We all appreciate it!!
Fred
Administrator
Administrator
Posts: 16623
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: TabBarGadget - Tabs like in a browser

Post by Fred »

That's really a cool component.
Fred
Administrator
Administrator
Posts: 16623
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: TabBarGadget - Tabs like in a browser

Post by Fred »

The beta 2 doesn't compile on OS X or Linux, as TextGadget() in line 2543 is missing a parameter.
User avatar
STARGÅTE
Addict
Addict
Posts: 2067
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: TabBarGadget - Tabs like in a browser

Post by STARGÅTE »

oh, I don't know why, but I have forget the "text" for the dummy TextGadget().

Code: Select all

DummyGadget = TextGadget(#PB_Any, 0, 0, 10, 10, "Dummy")
I have updated the download link.
TabBarGadget - 1.5 Beta 2
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4747
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Re: TabBarGadget - Tabs like in a browser

Post by Fangbeast »

I really wish STARGÅTE's TabBarGadget and Kenmo's IconBarGadget were part of PureBasic (and all visual designers) because they are so damned cool and useful!

Would it help if I beg and sacrifice some fresh sheep to srod??
Amateur Radio, D-STAR/VK3HAF
User avatar
Bisonte
Addict
Addict
Posts: 1226
Joined: Tue Oct 09, 2007 2:15 am

Re: TabBarGadget - Tabs like in a browser

Post by Bisonte »

STARGÅTE's TabBarGadget is a part of PureBasic IDE !
PureBasic 6.04 LTS (Windows x86/x64) | Windows10 Pro x64 | Asus TUF X570 Gaming Plus | R9 5900X | 64GB RAM | GeForce RTX 3080 TI iChill X4 | HAF XF Evo | build by vannicom​​
English is not my native language... (I often use DeepL to translate my texts.)
User avatar
Fangbeast
PureBasic Protozoa
PureBasic Protozoa
Posts: 4747
Joined: Fri Apr 25, 2003 3:08 pm
Location: Not Sydney!!! (Bad water, no goats)

Re: TabBarGadget - Tabs like in a browser

Post by Fangbeast »

Bisonte wrote:STARGÅTE's TabBarGadget is a part of PureBasic IDE !
Gee, just what a need, a comedian.
Amateur Radio, D-STAR/VK3HAF
Post Reply