It is currently Wed Sep 30, 2020 5:26 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 168 posts ]  Go to page Previous  1 ... 8, 9, 10, 11, 12  Next
Author Message
 Post subject: Re: TabBarGadget - Tabs like in a browser
PostPosted: Wed Jan 08, 2020 3:16 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Dec 23, 2003 3:54 am
Posts: 1849
Quote:
No. Only Freak did some changes for the DPI compatibility during his implementation into the PB IDE.

Oh interesting. I will compare and see what they changed for the IDE.

Quote:
What do I have to do if i "host" the TabBarGadget code on GitHub?

If the TabBarGadget file never changes, then there's not much benefit. It's just a place to host open source code, documentation, demos. Free account, simple to use. I have hosted PB includefiles there for a while.

But it's best for collaboration, people can write bugfixes and new features, submit them, you and others can review them, merge the changes into the latest "master" version. The PB IDE project is starting to get some contributions.

Maybe it's worth discussing later, if some TabBarGadget changes are made in the IDE project. :)

_________________
On GitHub: PB Includes - IDE Tools - Color Themes - IDE Branches - TabBarGadget Mods


Top
 Profile  
Reply with quote  
 Post subject: Re: TabBarGadget - Tabs like in a browser
PostPosted: Thu Jan 09, 2020 5:29 am 
Offline
Addict
Addict
User avatar

Joined: Tue Dec 23, 2003 3:54 am
Posts: 1849
It looks like the IDE is using your "1.5 Beta 2" (2014) but your latest "1.5 Beta 2a" (2019) has some bugfixes.

The IDE should probably use your latest version (I will handle that).

_________________
On GitHub: PB Includes - IDE Tools - Color Themes - IDE Branches - TabBarGadget Mods


Top
 Profile  
Reply with quote  
 Post subject: Re: TabBarGadget - Tabs like in a browser
PostPosted: Fri Feb 21, 2020 6:16 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Dec 23, 2003 3:54 am
Posts: 1849
Quote:
Quote:
1. Do you have any TabBarGadget changes since v1.5 beta 2?

No. Only Freak did some changes for the DPI compatibility during his implementation into the PB IDE.

You know, I have compared the TabBarGadget files in the open source IDE and your releases, and I don't see any DPI changes by the PB team. :?:


Any plans to make version "1.5 Beta 2a" an official release? It looks like you improved the layout functions.


Also, back to GitHub, would you be OK with me hosting a copy of the "1.5 Beta 2a" PBI on GitHub with cosmetic changes? So that it matches the rules of the IDE project:

- convert file from ASCII to UTF-8 with BOM
- remove IDE settings appended to bottom
- reformat via the IDE's "Format indentation" function
- remove trailing whitespace on code lines

All code and comments would remain as you wrote them, all credit to you.

_________________
On GitHub: PB Includes - IDE Tools - Color Themes - IDE Branches - TabBarGadget Mods


Top
 Profile  
Reply with quote  
 Post subject: Re: TabBarGadget - Tabs like in a browser
PostPosted: Fri Feb 21, 2020 6:44 pm 
Offline
Enthusiast
Enthusiast

Joined: Mon Dec 21, 2015 8:12 pm
Posts: 167
kenmo wrote:
You know, I have compared the TabBarGadget files in the open source IDE and your releases, and I don't see any DPI changes by the PB team. :?:
There aren't any, else you would see some DesktopScaledX/Y() and DesktopUnScaledX/Y() lines, like:

Code:
\PaddingX                     = DesktopScaledX(6)  ; Space from tab border to text
\PaddingY                     = DesktopScaledX(5)  ; Space from tab border to text
\Margin                       = DesktopScaledX(4)  ; Space from tab to border
\ImageSpace                   = DesktopScaledX(3)  ; Space from image zu text
\ImageSize                    = DesktopScaledX(16)
\CloseButtonSize              = DesktopScaledX(13) ; Size of the close cross
\CheckBoxSize                 = DesktopScaledX(10)
\ArrowSize                    = DesktopScaledX(5)  ; Size of the Arrow in the button in navigation
\ArrowWidth                   = DesktopScaledX(12) ; Width of the Arrow-Button in navigation
\ArrowHeight                  = DesktopScaledX(18) ; Height of the Arrow-Button in navigation
\Radius                       = DesktopScaledX(3)  ; Radius of the edge of the tab

...

ResizeGadget(\Number, #PB_Ignore, #PB_Ignore, #PB_Ignore, DesktopUnscaledY(Rows*\TabSize+TabBarGadgetInclude\Margin))


Top
 Profile  
Reply with quote  
 Post subject: Re: TabBarGadget - Tabs like in a browser
PostPosted: Fri Feb 21, 2020 9:47 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jan 10, 2008 1:30 pm
Posts: 1296
Location: Germany, Glienicke
Quote:
Any plans to make version "1.5 Beta 2a" an official release? It looks like you improved the layout functions.

Also, back to GitHub, would you be OK with me hosting a copy of the "1.5 Beta 2a" PBI on GitHub with cosmetic changes?

My plan was to convert the last version (1.5 Beta 2a) to a PB Module and than call it version 1.6, but I never come to this work.
Now, because of the open source project of the IDE, it is more important to help the community with a module version of the TabBarGadget. If you give me roughly one week I try to do this step.

In any case, yes, I agree if you host the last version (perhaps the module version) on GitHub.

_________________
ImageImage


Top
 Profile  
Reply with quote  
 Post subject: Re: TabBarGadget - Tabs like in a browser
PostPosted: Fri Feb 21, 2020 10:24 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Dec 23, 2003 3:54 am
Posts: 1849
Great! Thanks again for it, it's one of the best PB includes of all time. :mrgreen:

Before the Module version, which would be a large code change, would you release a "final" version 1.5? For existing projects which use it as an IncludeFile?

_________________
On GitHub: PB Includes - IDE Tools - Color Themes - IDE Branches - TabBarGadget Mods


Top
 Profile  
Reply with quote  
 Post subject: Re: TabBarGadget - Tabs like in a browser
PostPosted: Sun Feb 23, 2020 4:33 pm 
Offline
User
User

Joined: Sun Feb 23, 2020 4:28 pm
Posts: 15
Hi

I think i found a bug with the function GetTabBarGadgetItemColor. I doesn't get the same color as set by SetTabBarGadgetItemColor.
The color I get is something like black instead of the color of the tab.

Or am i using it wrong ? I'am still a new user to purebasic ;)

Here is the code I'm using:
Code:
  Define color = GetTabBarGadgetItemColor(#Gadget_TabBar, GetTabBarGadgetState(#Gadget_TabBar), #PB_Gadget_BackColor)
  color = ColorRequester(color)
  If color > -1
    SetTabBarGadgetItemColor(#Gadget_TabBar, GetTabBarGadgetState(#Gadget_TabBar), #PB_Gadget_BackColor, color)
  EndIf


Last edited by cyril on Sun Feb 23, 2020 4:46 pm, edited 2 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: TabBarGadget - Tabs like in a browser
PostPosted: Sun Feb 23, 2020 4:41 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jan 10, 2008 1:30 pm
Posts: 1296
Location: Germany, Glienicke
Welcome to the PB board.
Without the full code I can not test it.
But from your code snippet it looks like, if not item is selected, GetTabBarGadgetState(#Gadget_TabBar) returns #TabBarGadgetItem_None and with no valid position GetTabBarGadgetItemColor returns 0 -> black.

_________________
ImageImage


Top
 Profile  
Reply with quote  
 Post subject: Re: TabBarGadget - Tabs like in a browser
PostPosted: Sun Feb 23, 2020 4:45 pm 
Offline
User
User

Joined: Sun Feb 23, 2020 4:28 pm
Posts: 15
Thanks

The library code that is called is:
Code:
; Ändert die Farbe der angegebenen Registerkarte.
Procedure SetTabBarGadgetItemColor(Gadget.i, Tab.i, Type.i, Color.i) ; Code OK, Hilfe OK
   
   Protected *Item.TabBarGadgetItem = TabBarGadgetItemID(Gadget, Tab)
   
   If *Item
      Select Type
         Case #PB_Gadget_FrontColor
            If Color = #PB_Default
               Color = TabBarGadgetInclude\TextColor
            EndIf
            *Item\Color\Text = Color | $FF<<24
         Case #PB_Gadget_BackColor
            If Color = #PB_Default
               Color = TabBarGadgetInclude\FaceColor
            EndIf
            *Item\Color\Background = Color | $FF<<24
      EndSelect
      TabBarGadget_PostUpdate(GetGadgetData(Gadget))
   EndIf
   
EndProcedure



; Gibt die Farbe der angegebenen Registerkarte zurück.
Procedure.i GetTabBarGadgetItemColor(Gadget.i, Tab.i, Type.i) ; Code OK, Hilfe OK
   
   Protected *Item.TabBarGadgetItem = TabBarGadgetItemID(Gadget, Tab)
   
   If *Item
      Select Type
         Case #PB_Gadget_FrontColor
            ProcedureReturn *Item\Color\Text
         Case #PB_Gadget_BackColor
            ProcedureReturn *Item\Color\Background
      EndSelect
   EndIf
   
EndProcedure


I can see | $FF<<24 as a difference between the getter and the setter. Must be the problem. How do I do the reverse operation ?

I added a saveguard to my code, just in case ;) Thanks STARGÅTE !
The problem however doesn't come from this but from the value of the getter.


Last edited by cyril on Sun Feb 23, 2020 4:54 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: TabBarGadget - Tabs like in a browser
PostPosted: Sun Feb 23, 2020 4:53 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jan 10, 2008 1:30 pm
Posts: 1296
Location: Germany, Glienicke
You are right.
The internal color format is 32bit (with alpha channel). Therefore "| $FF<<24" is important.
And since Set only requires a 24 bit color, Get should only return 24 bit.
You can change the lines:
Code:
         Case #PB_Gadget_FrontColor
            ProcedureReturn *Item\Color\Text
         Case #PB_Gadget_BackColor
            ProcedureReturn *Item\Color\Background

into
Code:
         Case #PB_Gadget_FrontColor
            ProcedureReturn *Item\Color\Text & $FFFFFF
         Case #PB_Gadget_BackColor
            ProcedureReturn *Item\Color\Background & $FFFFFF

_________________
ImageImage


Top
 Profile  
Reply with quote  
 Post subject: Re: TabBarGadget - Tabs like in a browser
PostPosted: Sun Feb 23, 2020 4:55 pm 
Offline
User
User

Joined: Sun Feb 23, 2020 4:28 pm
Posts: 15
With your suggestion it's working great now !

Thanks :)


Top
 Profile  
Reply with quote  
 Post subject: Re: TabBarGadget - Tabs like in a browser
PostPosted: Sun Mar 22, 2020 6:51 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Dec 23, 2003 3:54 am
Posts: 1849
STARGÅTE wrote:
You are right.
The internal color format is 32bit (with alpha channel). Therefore "| $FF<<24" is important.
And since Set only requires a 24 bit color, Get should only return 24 bit.
You can change the lines:


A change for v1.5 Final ? :wink:

PS. Last month I put the TabBarGadget on GitHub here
https://github.com/kenmo-pb/TabBarGadget
You can see the list of small changes I made, to make it compatible with the IDE project.

_________________
On GitHub: PB Includes - IDE Tools - Color Themes - IDE Branches - TabBarGadget Mods


Top
 Profile  
Reply with quote  
 Post subject: Re: TabBarGadget - Tabs like in a browser
PostPosted: Mon Apr 13, 2020 8:53 pm 
Offline
Enthusiast
Enthusiast

Joined: Thu Dec 29, 2011 5:03 pm
Posts: 587
I'm experiencing a couple of problems with the TabBarGadget.

I use it in one part of my project inside a ContainerGadget. It's on a tab, so when the tab is closed, I unbind all of the TabBarGadget's events and free it. However, often, when the tab is reopened, I get a Pointer is null error on the last If StartDrawing(CanvasOutput(*TabBarGadget\Number)) line of TabBarGadget_Callback(). Could events for the freed TabBarGadget still be in the event queue?

Secondly - and this only seems to happen on Windows - sometimes the TabBarGadget seems to receive events the #TabBarGadge_EventType_Change event when a ButtonGadget is clicked. So when I click a ButtonGadget, the event for it happens, but the TabBarGadget changes its state so that no tab is selected. I have been wondering if it's because when I use BindGadgetEvent with a ButtonGadget, there are no specific events to bind it to, so what does PB actually bind the event to? This doesn't happen all the time - it happens once and then goes away when I recompile.


Top
 Profile  
Reply with quote  
 Post subject: Re: TabBarGadget - Tabs like in a browser
PostPosted: Mon Apr 13, 2020 9:40 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jan 10, 2008 1:30 pm
Posts: 1296
Location: Germany, Glienicke
Dear wombats,

thanks for using my TabBarGadget include.
To your first questions:
wombats wrote:
However, often, when the tab is reopened, I get a Pointer is null error on the last If StartDrawing(CanvasOutput(*TabBarGadget\Number)) line of TabBarGadget_Callback(). Could events for the freed TabBarGadget still be in the event queue?
So you receive no error during the free of the gadget and also some time after it? The error occurs during the creation?
I'm not exactly sure, how the BindEvents will handled, if you free a Gadget, but to my knowledge, all bind events should be also erased.
I think it is the same problem posted here:
https://www.purebasic.fr/english/viewtopic.php?p=437543#p437543

Can you try to change the procedure FreeTabBarGadget() with this code:
(I added an unbind and free the gadget before releasing the memory)
Code:
Procedure FreeTabBarGadget(Gadget.i) ; Code OK, Hilfe OK
   
   Protected *TabBarGadget.TabBarGadget = GetGadgetData(Gadget)
   
   UnbindGadgetEvent(*TabBarGadget\Number, @TabBarGadget_Callback())
   FreeGadget(Gadget)
   ForEach *TabBarGadget\Item()
      TabBarGadget_ClearItem(*TabBarGadget, *TabBarGadget\Item())
   Next
   ClearStructure(*TabBarGadget, TabBarGadget)
   FreeMemory(*TabBarGadget)
   
EndProcedure

____________________________

To your second question:
Do you use fixed numbers for your gadgets or all gadget are created with #PB_Any?

_________________
ImageImage


Top
 Profile  
Reply with quote  
 Post subject: Re: TabBarGadget - Tabs like in a browser
PostPosted: Mon Apr 13, 2020 11:04 pm 
Offline
Enthusiast
Enthusiast

Joined: Thu Dec 29, 2011 5:03 pm
Posts: 587
STARGÅTE wrote:
Dear wombats,

thanks for using my TabBarGadget include.
Of course! Thank you for making it. Aside from the problems I have, it's incredible.

STARGÅTE wrote:
To your first questions:
wombats wrote:
However, often, when the tab is reopened, I get a Pointer is null error on the last If StartDrawing(CanvasOutput(*TabBarGadget\Number)) line of TabBarGadget_Callback(). Could events for the freed TabBarGadget still be in the event queue?
So you receive no error during the free of the gadget and also some time after it? The error occurs during the creation?
I'm not exactly sure, how the BindEvents will handled, if you free a Gadget, but to my knowledge, all bind events should be also erased.
I think it is the same problem posted here:
https://www.purebasic.fr/english/viewtopic.php?p=437543#p437543

Can you try to change the procedure FreeTabBarGadget() with this code:
(I added an unbind and free the gadget before releasing the memory)
Code:
Procedure FreeTabBarGadget(Gadget.i) ; Code OK, Hilfe OK
   
   Protected *TabBarGadget.TabBarGadget = GetGadgetData(Gadget)
   
   UnbindGadgetEvent(*TabBarGadget\Number, @TabBarGadget_Callback())
   FreeGadget(Gadget)
   ForEach *TabBarGadget\Item()
      TabBarGadget_ClearItem(*TabBarGadget, *TabBarGadget\Item())
   Next
   ClearStructure(*TabBarGadget, TabBarGadget)
   FreeMemory(*TabBarGadget)
   
EndProcedure
I changed it to that and the problem went away. However, now I'm experiencing a complete freeze (with no report from PB's debugger) after reopening the tab after a few times, which seems to vary. I will have to check my code thoroughly to see if I'm doing something wrong. The Purifier doesn't tell me anything, but I don't know how that thing works anyway. It never tells me anything.

STARGÅTE wrote:
To your second question:
Do you use fixed numbers for your gadgets or all gadget are created with #PB_Any?
They are all created with #PB_Any. It's a very strange problem that only occurs sometimes and only on Windows.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 168 posts ]  Go to page Previous  1 ... 8, 9, 10, 11, 12  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: LiK137 and 15 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye