TabBarGadget - Tabs like in a browser
Re: TabBarGadget - Tabs like in a browser
D'oh! I won't bother using it for this current project, then. Too many gadgets involved to be re-coded. Thanks for clarifying, anyway.
Re: TabBarGadget - Tabs like in a browser
This is a good idea, I think I will implement that.GenRabbit wrote:This is awesome. Any chance of getting a Module version of it?
Right. I saw, that we have a new constant (#PB_EventType_Resize), I will try it to implement this, that you haven't call UpdateTabBarGadget().Niffo wrote:You can resize the gadget then call UpdateTabBarGadget()
The TabBarGadget is no direct replacement for the PanelGadget. The TabBarGadget tabs have no own conainer.Dude wrote:Do you mean I have to put a ContainerGadget inside each TabBarGadget tab, with all gadgets inside those containers?
Typically, when you use a TabBarGadget you have only one container for all tabs and you just change the content (like in an editor or a browser)
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 more ― Typeface - Sprite-based font include/module
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Re: TabBarGadget - Tabs like in a browser
Hi,
Is this a bug? I cannot move tab 0 to position 1. It seems to expect a 1-based position, but the documentation says it starts at 0. Am I missing something?
Is this a bug? I cannot move tab 0 to position 1. It seems to expect a 1-based position, but the documentation says it starts at 0. Am I missing something?
Code: Select all
XIncludeFile "TabBarGadget.pbi"
Enumeration
#Window
#TabGadget
#MoveButton
EndEnumeration
OpenWindow(#Window, 0, 0, 320, 240, "TabBarGadget", #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
TabBarGadget(#TabGadget, 0, 0, WindowWidth(#Window), 32, #TabBarGadget_None, #Window)
AddTabBarGadgetItem(#TabGadget, #PB_Default, "One")
AddTabBarGadgetItem(#TabGadget, #PB_Default, "Two")
AddTabBarGadgetItem(#TabGadget, #PB_Default, "Three")
ButtonGadget(#MoveButton, 10, 45, 90, 25, "Move")
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
End
Case #PB_Event_Gadget
If EventGadget() = #MoveButton
SetTabBarGadgetItemPosition(#TabGadget, 0, 1)
EndIf
EndSelect
ForEver
Re: TabBarGadget - Tabs like in a browser
Thanks for the bug report.
You are right, it is a bug in the procedure.
Please replace this procedure in the include and check whether is works.
You are right, it is a bug in the procedure.
Please replace this procedure in the include and check whether is works.
Code: Select all
Procedure SetTabBarGadgetItemPosition(Gadget.i, Tab.i, Position.i)
Protected *TabBarGadget.TabBarGadget = GetGadgetData(Gadget)
Protected *NewItem.TabBarGadgetItem = TabBarGadget_ItemID(*TabBarGadget, Position)
Protected *Item.TabBarGadgetItem = TabBarGadget_ItemID(*TabBarGadget, Tab)
If *Item And *Item <> *TabBarGadget\NewTabItem
If *NewItem And *NewItem <> *TabBarGadget\NewTabItem
If Position > Tab
MoveElement(*TabBarGadget\Item(), #PB_List_After, *NewItem)
Else
MoveElement(*TabBarGadget\Item(), #PB_List_Before, *NewItem)
EndIf
Else
MoveElement(*TabBarGadget\Item(), #PB_List_Last)
EndIf
TabBarGadget_PostUpdate(*TabBarGadget)
EndIf
EndProcedure
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 more ― Typeface - Sprite-based font include/module
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Re: TabBarGadget - Tabs like in a browser
That seems to fix it.
Thanks for the fast response and fix!
Thanks for the fast response and fix!
Re: TabBarGadget - Tabs like in a browser
Are the download links in the first post fixed?wombats wrote:That seems to fix it.
Re: TabBarGadget - Tabs like in a browser
I have replaced the Include in the Link (only for the Version 1.5)
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 more ― Typeface - Sprite-based font include/module
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Re: TabBarGadget - Tabs like in a browser
Hi STARGÅTE,
a feature request:
Allow rectangle images, not only square ones.
We 'abuse' the entry to show an additional status icon.
(a circle with a number inside)
Now we have to show 2 status values. Instead of 16 by 16 it would be nice if we can use 32 by 16.
I also looked in the source code. Adding/changing ImageSize to ImageWidth and ImageHeight is not a big deal,
but I don't know where I have to make the changes to size the tab accordingly.
Tal'ma'te
a feature request:
Allow rectangle images, not only square ones.
We 'abuse' the entry to show an additional status icon.
(a circle with a number inside)
Now we have to show 2 status values. Instead of 16 by 16 it would be nice if we can use 32 by 16.
I also looked in the source code. Adding/changing ImageSize to ImageWidth and ImageHeight is not a big deal,
but I don't know where I have to make the changes to size the tab accordingly.
Tal'ma'te
Re: TabBarGadget - Tabs like in a browser
Ok,
for our personal use I changed NewImageID to NewImage. (TabBarGadget_ReplaceImage())
So it is possible to get the size via ImageWidth() and ImageHeight().
And in TabBarGadget_RotateImage():
Ok, it is a bit difficult since man applications are already using the TabBarGadget.
But maybe in V2.0
for our personal use I changed NewImageID to NewImage. (TabBarGadget_ReplaceImage())
So it is possible to get the size via ImageWidth() and ImageHeight().
Code: Select all
*Item\Image = CreateImage(#PB_Any, ImageWidth(NewImage), ImageHeight(NewImage), 32, #PB_Image_Transparent)
Code: Select all
*Item\DrawedImage = CreateImage(#PB_Any, ImageHeight(*Item\Image), ImageWidth(*Item\Image), 32, #PB_Image_Transparent)
But maybe in V2.0
Re: TabBarGadget - Tabs like in a browser
I am very interested in a screenshot of your application with my TabBarGadget and your status icon, can you show me?
To your feature request:
Fun fact: the constant #TabBarGadget_ImageSize is already declared but never used ^^
I can implement this attribute as follows?:
To your feature request:
Fun fact: the constant #TabBarGadget_ImageSize is already declared but never used ^^
I can implement this attribute as follows?:
- By default the image is scaled to the value set in TabBarGadgetInclude\ImageSize, as it is already implemented.
- You can set the image size with SetTabBarGadgetAttribute(Gadget, #TabBarGadget_ImageSize, Size)
- With Size = #PB_Default, the TabBarGadget uses the original size of each 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 more ― Typeface - Sprite-based font include/module
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Re: TabBarGadget - Tabs like in a browser
Hi,
we use it as a part of our CTI solution.
In this case we use it to show the state of the scheduled calls.
Red for calls where the time is exited and blue for calls which should be done in the next 2 hours.
Also for our english speakers
we use it as a part of our CTI solution.
In this case we use it to show the state of the scheduled calls.
Red for calls where the time is exited and blue for calls which should be done in the next 2 hours.
Also for our english speakers
- StarBootics
- Addict
- Posts: 984
- Joined: Sun Jul 07, 2013 11:35 am
- Location: Canada
Re: TabBarGadget - Tabs like in a browser
Hello Stargate,
I have some "Invalid Memory Access" on all DrawingFont(\FontID) lines (Line 1613, Line 1937 , Line 2189 and Line 2268). I'm under Ubuntu 19.10 x64 and I'm using PB 5.71 LTS.
If I comment these lines everything work except the text is draw using the default font.
Best regards
StarBootics
I have some "Invalid Memory Access" on all DrawingFont(\FontID) lines (Line 1613, Line 1937 , Line 2189 and Line 2268). I'm under Ubuntu 19.10 x64 and I'm using PB 5.71 LTS.
If I comment these lines everything work except the text is draw using the default font.
Best regards
StarBootics
The Stone Age did not end due to a shortage of stones !
Re: TabBarGadget - Tabs like in a browser
This \FontID comes from this code part (Line 2581-2588):
On non-Windows system, I create a dummy gadget to get the standard gadget font of the system.
My idea is that this part does not work on your system.
You can modify the code and use your one font like this:
Code: Select all
CompilerSelect #PB_Compiler_OS
CompilerCase #PB_OS_Windows
\FontID = GetGadgetFont(#PB_Default)
CompilerDefault
DummyGadget = TextGadget(#PB_Any, 0, 0, 10, 10, "Dummy")
\FontID = GetGadgetFont(DummyGadget)
FreeGadget(DummyGadget)
CompilerEndSelect
My idea is that this part does not work on your system.
You can modify the code and use your one font like this:
Code: Select all
\FontID = FontID(LoadFont(#PB_Any, ...))
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 more ― Typeface - Sprite-based font include/module
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module
Re: TabBarGadget - Tabs like in a browser
Hi STARGATE, I am wondering:
1. Do you have any TabBarGadget changes since v1.5 beta 2?
2. Do you use GitHub?
3. Would you be interested in hosting the TabBarGadget on GitHub?
Over the years, I have made changes to the TabBarGadget which have never been shared, but I would be happy to share.
And with the PB IDE going open-source, it looks very likely there will be edits to the TabBarGadget, and it would be nice to track and maintain bugfixes and new features in a public place like GitHub.
Thanks for all your hard work, by the way!
1. Do you have any TabBarGadget changes since v1.5 beta 2?
2. Do you use GitHub?
3. Would you be interested in hosting the TabBarGadget on GitHub?
Over the years, I have made changes to the TabBarGadget which have never been shared, but I would be happy to share.
And with the PB IDE going open-source, it looks very likely there will be edits to the TabBarGadget, and it would be nice to track and maintain bugfixes and new features in a public place like GitHub.
Thanks for all your hard work, by the way!
Re: TabBarGadget - Tabs like in a browser
No. Only Freak did some changes for the DPI compatibility during his implementation into the PB IDE.kenmo wrote:1. Do you have any TabBarGadget changes since v1.5 beta 2?
No.kenmo wrote:2. Do you use GitHub?
What do I have to do if i "host" the TabBarGadget code on GitHub?kenmo wrote:3. Would you be interested in hosting the TabBarGadget on GitHub?
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 more ― Typeface - Sprite-based font include/module
Lizard - Script language for symbolic calculations and more ― Typeface - Sprite-based font include/module