Danilo's toolbar Pro -converted to PB source! (Updated.)

Developed or developing a new product in PureBasic? Tell the world about it.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Tailbite cannot cope with optional parameters as in something like :

Code: Select all

ProcedureDLL test(a,b=1)
  MessageRequester("",Str(b))
EndProcedure
This will tailbite fine, but then you will not be able to issue the command test(10) without getting a 'missing parameter' error.

For this you need to create two separate functions; test(a) and test2(a, b) etc. but this is not something new, I think Tailbite has always coped with this.

Anyhow, the problem with the toolbar source was a slightly different one. :)
I may look like a mule, but I'm not a complete ass.
User avatar
Tomi
Enthusiast
Enthusiast
Posts: 270
Joined: Wed Sep 03, 2008 9:29 am

Post by Tomi »

Hello
firstly must be i make a Thanksful for this useful plugin,ty :)
I have 2 questions about plugin:
1- Can i do make a window in XP Style optino + nxToolbar + SetWindowColor ?
without XP Style optino,it work very nice, but when i add XP Style optino + nxToolbar + SetWindowColor it has wrong with coloring.
2- Is there a help file for it ?

ty

Tomi

Code: Select all

;===>>> Enable XP skin support <<<====;

OpenWindow(0,0,0,200,150,"",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
SetWindowColor(0,#Blue)
DataSection
pop: IncludeBinary "c:\toolbar.bmp"
pop2: IncludeBinary "c:\toolbarmask.bmp"
EndDataSection
hTb=nxCreateTB(WindowID(0),24,24)
CatchImage(1, ?pop)
CatchImage(2, ?pop2)
      nxSetTBImage(hTb, ImageID(1), ImageID(2), #nxTB_NORMAL)  ;Default, main image list.
      nxSetTBImage(hTb, 0, 0, #nxTB_HOT)  ;Remove the comment if you wish.
      nxSetTBImage(hTb, 0, 0, #nxTB_DISABLED) ;Remove the comment if you wish.
nxAddTBsysIcons(hTb)  
      nxAddTBbutton(hTb, 1, 1 , #nxTB_PushBUTTON)
        nxSetTBbuttonText(hTb, 1, "push button")
        nxSetTBbuttonTooltip(hTb, 1, "Tooltip 1!")
      nxAddTBSeparator(hTb,-1)
      nxAddTBbutton(hTb, 2, 2 , #nxTB_CheckBUTTON )
        nxCheckTBbutton(hTb, 2, 1) ;Check the button.
        nxSetTBbuttonTooltip(hTb, 2, "Tooltip 2!")
      nxAddTBbutton(hTb, 3, 3 , #nxTB_CheckBUTTON)
      nxAddTBbutton(hTb, 4, #nxTB_PRINT, #nxTB_BUTTON)
      nxAddTBtextButton(hTb, 5, "A text button!", #nxTB_BUTTON)
      nxAddTBSeparator(hTb,-1)

Repeat 
EventID = WaitWindowEvent()

Until EventID = #WM_CLOSE
End
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Tomi wrote:Hello
firstly must be i make a Thanksful for this useful plugin,ty :)
I have 2 questions about plugin:
1- Can i do make a window in XP Style optino + nxToolbar + SetWindowColor ?
without XP Style optino,it work very nice, but when i add XP Style optino + nxToolbar + SetWindowColor it has wrong with coloring.
2- Is there a help file for it ?
Question 2 first. Download the PBOSL package and use the ToolBarPro section of the help manual inside. nx_ToolBar functions in exactly the same way as ToolBarPro and so you should get by with this.

Question 1. You're talking about the highlighting color right? This is an xp thing and I've not seen any cheat which completely eradicates this. You could try a 'hot' image list or we could simply remove the xp theming from the toolbar?
I may look like a mule, but I'm not a complete ass.
User avatar
Tomi
Enthusiast
Enthusiast
Posts: 270
Joined: Wed Sep 03, 2008 9:29 am

Post by Tomi »

Hello srod
oh,then Is help file of ToolBarPro = nxToolBar ?
but when i try to test by a flag ToolBarPro in nxToolBar ,it error occured:

Image

I attaches a image in about coloring, i hope it is elucidate:

Image

I need Enable XP skin support option be selected and full coloring be like without Enable XP skin support.
if is possible it.

Tomi
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Post by Fluid Byte »

I think you must remove the #TBSTYLE_TRANSPARENT for classic look.
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
User avatar
Thorsten1867
Addict
Addict
Posts: 1372
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Post by Thorsten1867 »

Tomi wrote:Hello srod
oh,then Is help file of ToolBarPro = nxToolBar ?
but when i try to test by a flag ToolBarPro in nxToolBar ,it error occured:
Tomi
Rename #TBpro_BOTTOM to #nxTB_TBstyleBOTTOM

All constants are renamed, too. (-> nxResidents.pbi)
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
Tomi
Enthusiast
Enthusiast
Posts: 270
Joined: Wed Sep 03, 2008 9:29 am

Post by Tomi »

@Thorsten1867 ; very well, ty.

@srod;i make a project in directly by TBpro, it has a like uphill.

@Fluid Byte ; hello, where is "#TBSTYLE_TRANSPARENT" for removing, please more info.



if it has't skin color supporting by original, i've not tenacity for it, any trick is in handy
if your mastring by API and other.
however i'm tanksfull to all dear
User avatar
Tomi
Enthusiast
Enthusiast
Posts: 270
Joined: Wed Sep 03, 2008 9:29 am

Post by Tomi »

very stupendous, if mixing flags:#TBpro_TRANSPARENT | :D #TBpro_BORDER
result is full color, combine other flags has't full color .
However this trick has constrain a black line in throughout bottom toolbar
but it is useful for my work.
ty all.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Strange, those flags do not cure the problem here!

Tomi, you don't have to use the library. At the end of the day it is just a bunch of api calls and nxToolbars suffer exatly the same issues as any other where xp-themes are concerned.
I may look like a mule, but I'm not a complete ass.
User avatar
Tomi
Enthusiast
Enthusiast
Posts: 270
Joined: Wed Sep 03, 2008 9:29 am

Post by Tomi »

srod, sorry i don't understand you mean in exactly,Since text has complex.
my english is poor like my programming! i don't must use flags? :cry:

Ok Utterly,Therefore that i have believe to power of your programming in completely, i do listen what you say to me.
if perhaps have a sulotion for this my problem , please put here.

Regards
Tomi
walker
Enthusiast
Enthusiast
Posts: 634
Joined: Wed May 05, 2004 4:04 pm
Location: Germany

Post by walker »

Another question ...

if I use the

Code: Select all

#nxTB_DROPDOWNBUTTON 
flag... HOW can I add menu entries to this button?

thanks in advance...

EDIT; and which event is fired if I click the little dropdown arrow?
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

A #TBN_DROPDOWN notification is sent to your main window (or the parent of the toolbar).

You have to create your own popup menu and then position it yourself. Use the nxGetTBbuttonRect() function to get the screen coordinates of the underlying toolbar button etc.

Sorry I have no example but it should be simple enough.
I may look like a mule, but I'm not a complete ass.
walker
Enthusiast
Enthusiast
Posts: 634
Joined: Wed May 05, 2004 4:04 pm
Location: Germany

Post by walker »

thanks a lot.. yes, these informations are enough ... the word "notification" was the missing link :wink:

I've updated your example_1.pb to reflect this type of Button (and adapted the code for 4.30 too)

if you want it to include it in your distribution, download it from here: http://home.arcor.de/x-linux/pure/Example_1.pb

thanks again for your help :!:
Post Reply