[Module] Extended ToolBar-Gadget (all OS / DPI)
Re: [Module] Extended ToolBar-Gadget (all OS / DPI)
The icon "help" is not visible but it reappears when i comment this line
; ToolBar::TrackBar(#ToolBar, 100, 34, 0, 10, #TrackBar, "trackID", #PB_TrackBar_Ticks)
May i say, if you have the idea to use the tabgadget from STARGÅTE here
http://www.purebasic.fr/english/viewtop ... 12&t=47588
with you toolbar gadget, you should create a ribbongadget like that
https://docs.microsoft.com/en-us/window ... md-ribbons
M.
; ToolBar::TrackBar(#ToolBar, 100, 34, 0, 10, #TrackBar, "trackID", #PB_TrackBar_Ticks)
May i say, if you have the idea to use the tabgadget from STARGÅTE here
http://www.purebasic.fr/english/viewtop ... 12&t=47588
with you toolbar gadget, you should create a ribbongadget like that
https://docs.microsoft.com/en-us/window ... md-ribbons
M.
Re: [Module] Extended ToolBar-Gadget (all OS / DPI)
The help icon gets overwritten by the trackbar, change line 405 fromMesa wrote:The icon "help" is not visible but it reappears when i comment this line
; ToolBar::TrackBar(#ToolBar, 100, 34, 0, 10, #TrackBar, "trackID", #PB_TrackBar_Ticks)
Code: Select all
Case #SpinGadget
Code: Select all
Case #SpinGadget, #TrackBar
{Home}.:|:.{Dialog Design0R}.:|:.{Codes}.:|:.{Downloads}.:|:.{History Viewer Online}
- Thorsten1867
- Addict
- Posts: 1366
- Joined: Wed Aug 24, 2005 4:02 pm
- Location: Germany
Re: [Module] Extended ToolBar-Gadget (all OS / DPI)
Bugfixes
Translated with http://www.DeepL.com/Translator
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Re: [Module] Extended ToolBar-Gadget (all OS / DPI)
Sorry it's me again
A small change should me made concerning the buttons :
When you push down a button, behaviour is ok (background changes color and image shift a little) but when you release the button (_LeftButtonUpHandler()) it doesn't revert back the look of the button.
A small change should me made concerning the buttons :
When you push down a button, behaviour is ok (background changes color and image shift a little) but when you release the button (_LeftButtonUpHandler()) it doesn't revert back the look of the button.
Windows 10 Pro x64
PureBasic 6.04 x64
PureBasic 6.04 x64
- Thorsten1867
- Addict
- Posts: 1366
- Joined: Wed Aug 24, 2005 4:02 pm
- Location: Germany
Re: [Module] Extended ToolBar-Gadget (all OS / DPI)
Bugfix
Translated with http://www.DeepL.com/Translator
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Re: [Module] Extended ToolBar-Gadget (all OS / DPI)
Thank you.
I found a weird one :
The imagebutton tooltip follow the cursor when a spacer is inserted before the imagebutton. All following ImageButton tooltip get the bug.
You can test it in your example by replacing the "Cut" button by a spacer
Question : Is it possible to disable the entire toolbar and all the gadgets inside (to grey all of them) ?
I found a weird one :
The imagebutton tooltip follow the cursor when a spacer is inserted before the imagebutton. All following ImageButton tooltip get the bug.
You can test it in your example by replacing the "Cut" button by a spacer
Code: Select all
ToolBar::Spacer(#ToolBar)
;ToolBar::ImageButton(#ToolBar, #IMG_Cut, #TB_Cut, "Cut", "cutID")
Question : Is it possible to disable the entire toolbar and all the gadgets inside (to grey all of them) ?
Windows 10 Pro x64
PureBasic 6.04 x64
PureBasic 6.04 x64
- Thorsten1867
- Addict
- Posts: 1366
- Joined: Wed Aug 24, 2005 4:02 pm
- Location: Germany
Re: [Module] Extended ToolBar-Gadget (all OS / DPI)
Try it again!
Translated with http://www.DeepL.com/Translator
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Re: [Module] Extended ToolBar-Gadget (all OS / DPI)
Sorry, i've got the same problem. And I suspect it generates a event triggering problem with the ImageButton too with 2 spacers.
In your example (with or without ToolBar::SetPostEvent(#ToolBar, #PB_Event_Menu)) :
In your example (with or without ToolBar::SetPostEvent(#ToolBar, #PB_Event_Menu)) :
Code: Select all
;ToolBar::ImageButton(#ToolBar, #IMG_New, #TB_New, "New", "newID")
ToolBar::TextButton(#ToolBar, "New", #TB_New, "newID")
ToolBar::ImageButton(#ToolBar, #IMG_Save, #TB_Save, "Save", "saveID")
; ToolBar::Separator(#ToolBar)
ToolBar::Spacer(#ToolBar)
ToolBar::ImageButton(#ToolBar, #IMG_Copy, #TB_Copy, "Copy", "copyID")
; ToolBar::ImageButton(#ToolBar, #IMG_Cut, #TB_Cut, "Cut", "cutID")
ToolBar::Spacer(#ToolBar)
ToolBar::ImageButton(#ToolBar, #IMG_Paste, #TB_Paste, "Paste", "pasteID")
Windows 10 Pro x64
PureBasic 6.04 x64
PureBasic 6.04 x64
- Thorsten1867
- Addict
- Posts: 1366
- Joined: Wed Aug 24, 2005 4:02 pm
- Location: Germany
Re: [Module] Extended ToolBar-Gadget (all OS / DPI)
Can't understand the problem. Both examples seem to work for me.
Translated with http://www.DeepL.com/Translator
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Re: [Module] Extended ToolBar-Gadget (all OS / DPI)
Weird...
I'm using PB 5.73 64bits on win10.
I can see in _MouseMoveHandler() that the ImageButtons before the spacer are drawn only once when the mouse is hovering them (and stand on it).
But the ImageButtons after the spacer are redrawn continuously. It is passing in the "Default" case at each iteration.
EDIT : I added a "Case #Spacer" in _MouseMoveHandler() and it seems to work correctly now.
I'm using PB 5.73 64bits on win10.
I can see in _MouseMoveHandler() that the ImageButtons before the spacer are drawn only once when the mouse is hovering them (and stand on it).
But the ImageButtons after the spacer are redrawn continuously. It is passing in the "Default" case at each iteration.
EDIT : I added a "Case #Spacer" in _MouseMoveHandler() and it seems to work correctly now.
Windows 10 Pro x64
PureBasic 6.04 x64
PureBasic 6.04 x64
Re: [Module] Extended ToolBar-Gadget (all OS / DPI)
Concerning the button event not triggered, it seems the ImageButton next to the spacer got a wrong "Type".
I can see it in _LeftButtonDownHandler() because it got the #spacer value "6" instead of "1" (#imagebutton).
Could it be a problem with the "If X > TBEx()\Items()\X And X < TBEx()\Items()\X + TBEx()\Items()\Width" and "If Y > ..." test ? The position of the ImageButtons seems wrong because of the spacers (even if they are well displayed).
I can see it in _LeftButtonDownHandler() because it got the #spacer value "6" instead of "1" (#imagebutton).
Could it be a problem with the "If X > TBEx()\Items()\X And X < TBEx()\Items()\X + TBEx()\Items()\Width" and "If Y > ..." test ? The position of the ImageButtons seems wrong because of the spacers (even if they are well displayed).
Windows 10 Pro x64
PureBasic 6.04 x64
PureBasic 6.04 x64
- Thorsten1867
- Addict
- Posts: 1366
- Joined: Wed Aug 24, 2005 4:02 pm
- Location: Germany
Re: [Module] Extended ToolBar-Gadget (all OS / DPI)
Update:
- Bugfixes
- DPI-Handling
- MouseEvents reworked
Translated with http://www.DeepL.com/Translator
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Re: [Module] Extended ToolBar-Gadget (all OS / DPI)
Sorry. Same test as before, bug's still present (modified example below) :
The Paste Button is only triggered when the mouse Y is between 40 and 43.
The tooltip is following the mouse on every ImageButton (on your unmodified example).
EDIT : I think I got it. The position of the spacer is overlapping the position of the button, so it break the loop inside _LeftButtonDownHandler() before processing the button. (in black, the draws of the spacers)
EDIT 2 : Adding inside _LeftButtonUpHandler() and _LeftButtonDownHandler() seems to fix the problem
Code: Select all
ToolBar::TextButton(#ToolBar, "New", #TB_New, "newID")
ToolBar::ImageButton(#ToolBar, #IMG_Save, #TB_Save, "Save", "saveID")
ToolBar::Spacer(#ToolBar)
; ToolBar::Separator(#ToolBar)
ToolBar::ImageButton(#ToolBar, #IMG_Copy, #TB_Copy, "Copy", "copyID")
ToolBar::Spacer(#ToolBar)
; ToolBar::ImageButton(#ToolBar, #IMG_Cut, #TB_Cut, "Cut", "cutID")
ToolBar::ImageButton(#ToolBar, #IMG_Paste, #TB_Paste, "Paste", "pasteID")
ToolBar::Separator(#ToolBar)
CompilerIf ToolBar::#EnableToolBarGadgets
The tooltip is following the mouse on every ImageButton (on your unmodified example).
EDIT : I think I got it. The position of the spacer is overlapping the position of the button, so it break the loop inside _LeftButtonDownHandler() before processing the button. (in black, the draws of the spacers)
EDIT 2 : Adding
Code: Select all
If TBEx()\Items()\Type = #Spacer : Continue : EndIf
Windows 10 Pro x64
PureBasic 6.04 x64
PureBasic 6.04 x64
- Thorsten1867
- Addict
- Posts: 1366
- Joined: Wed Aug 24, 2005 4:02 pm
- Location: Germany
Re: [Module] Extended ToolBar-Gadget (all OS / DPI)
The problem with overlapping should now be solved. Does this also solve your problem?
Translated with http://www.DeepL.com/Translator
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Download of PureBasic - Modules
Download of PureBasic - Programs
[Windows 11 x64] [PB V5.7x]
Re: [Module] Extended ToolBar-Gadget (all OS / DPI)
It seems Ok.
Thank you very much !
I added a DisableToolBar() procedure too :
Thank you very much !
I added a DisableToolBar() procedure too :
Code: Select all
Procedure DisableToolBar(GNum.i, State.i)
If FindMapElement(TBEx(), Str(GNum))
ForEach TBEx()\Items()
If State
TBEx()\Items()\Flags | #Disable
Else
TBEx()\Items()\Flags & ~#Disable
EndIf
Next
If TBEx()\ReDraw : Draw_() : EndIf
EndIf
EndProcedure
Windows 10 Pro x64
PureBasic 6.04 x64
PureBasic 6.04 x64