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

Developed or developing a new product in PureBasic? Tell the world about it.
Anden
Enthusiast
Enthusiast
Posts: 135
Joined: Mon Jul 21, 2003 7:23 am
Contact:

Post by Anden »

Any volunteers who tailbite this into a PB 4.10 userlib?
User avatar
DoubleDutch
Addict
Addict
Posts: 3219
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

Why? it works great as an include.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Anden wrote:Any volunteers who tailbite this into a PB 4.10 userlib?
It's easy enough to Tailbite; flype did it earlier on before I made several updates.

Personally, like DoubleDutch, I only ever use this in source code form. There's enough user libraries floating around already without me adding yet more when one is not really needed in this case. :)

If you wish to tailbite it then you only need to beware of optional parameters in procedures because Tailbite cannot cope with those. In such cases, you just need to supply multiple versions of the same procedure etc. But, thanks to flype, this work has already been done.

Tailbite away! But if it doesn't work then I'm afraid that I have no time to help out with this. :wink:
I may look like a mule, but I'm not a complete ass.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Anden wrote:Any volunteers who tailbite this into a PB 4.10 userlib?
1. Download latest version of jaPBe V3 and start it
2. Open "nxResidents.pbi"
3. Main menu -> Project -> Compile manually (Resident) ; Press OK ; -> Resident is done
4. Open "nxToolbar.pbi" ; adjust IncludePath !!!
5. Main menu -> Project -> Tailbite ; Press OK ; -> Userlibrary is done
Ready !
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Karbon
PureBasic Expert
PureBasic Expert
Posts: 2010
Joined: Mon Jun 02, 2003 1:42 am
Location: Ashland, KY
Contact:

Post by Karbon »

I was just getting ready to post about this library and somehow missed your updates! Thanks for the single-image function, it's *exactly* what I needed!

I noticed something odd in the 1.3 update text file - it says "Created with Purebasic 4.2 for Windows". Did you mean 4.1? I only ask because I want to know of any incompatibility issues before I update what I'm using.

Thanks again!
-Mitchell
Check out kBilling for all your billing software needs!
http://www.k-billing.com
Code Signing / Authenticode Certificates (Get rid of those Unknown Publisher warnings!)
http://codesigning.ksoftware.net
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Hi Mitch,

I probably meant PB 4.02! :)

I haven't tried the library with PB 4.2, but I see no reason why it shouldn't run fine.
I may look like a mule, but I'm not a complete ass.
User avatar
DoubleDutch
Addict
Addict
Posts: 3219
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

There is a problem with tooltips if you hide a button - it shows the wrong tooltip sometimes.

Here is a fix that seems to work ok:

Code: Select all

ProcedureDLL nxUpdateTBtooltips(hTb); Updates the ToolbarTooltips ( resize Tooltips to actual ButtonSize )
  Protected count, i
  Protected *nxTB._nxToolbar, btn.TBBUTTON, ti.TOOLINFO
  *nxTB = GetProp_(hTb, #PROP$)
  If hTb And *nxTB
    count = SendMessage_(hTb, #TB_BUTTONCOUNT,0,0)
    If count
      For i = 0 To (count-1)
        If SendMessage_(hTb, #TB_GETBUTTON, i, btn);
          If btn\idCommand ;Separators have no index.  Hence the reason why button indexes must be > 0.
            ti\cbSize = SizeOf(TOOLINFO)
            ti\uId    = btn\idCommand
            ti\hwnd   = hTb
          ;Get new rect from TB button
          	If SendMessage_(hTb,#TB_ISBUTTONHIDDEN,btn\idCommand,0)
          		ti\rect\left=0
          		ti\rect\right=0
          	Else
	            SendMessage_(hTb, #TB_GETITEMRECT, i, @ti\rect)
	          ;Set new rect for tooltip.
	         	EndIf
						SendMessage_(*nxTB\hTt, #TTM_NEWTOOLRECT, 0, ti)
          EndIf        
        EndIf
      Next
    EndIf
  EndIf
EndProcedure
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

That'll do nicely. Thanks. 8)
I may look like a mule, but I'm not a complete ass.
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Post by Thorsten1867 »

If I create a library, I always get an error:
NxToolbar.desc
Error at line 26: '] Long' is not a valid argument type

Code: Select all

ASM
;
4
COMCTL32
GDI32
KERNEL32
USER32
;
LIB
;
5
Memory
Image
Object
SimpleList
ImagePlugin
;
nxToolbar.chm
;
nxUpdateTBtooltips, Long (hTb) - Updates the ToolbarTooltips ( resize Tooltips to actual ButtonSize )
None | StdCall
;
nxSetTBbuttonWidth, Long, Long, Long (hTb, buttonid, width) - Set a new Width for a TB-Button.
Long | StdCall
;
nxCreateTB,[] Long, Long, Long, ([ hWndParent, buttonx, buttony]) - This Command creates a Toolbar and assigns the TB to the Window with the Handle hwnd.
Long | StdCall
;
nxSetTBImage,[] Long, Long, Long, ([ hTb, hImage, hMask]) - Set the Button-Images and the Button-Masks for the Toolbar-Buttons.
Long | StdCall
.....
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

Thorsten1867 wrote:Error at line 26: '] Long' is not a valid argument type
In line 26 is missing a , (german: Komma)
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Post by Thorsten1867 »

This file is created by tailbite. I can't change it.
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Post by ts-soft »

> I can't change it.
change the options with tailbite-manager:
keep source, build batch and compile by hand, no problem but i'm not shure
with the "komma"
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

The problem is because I modified the library to make it easier to use as a source code include file. It is with the functions using optional parameters.

The source will need a few modifications before it will compile as a user library.

I'll post an update later.
I may look like a mule, but I'm not a complete ass.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Post by srod »

Fixed.


16th June 2008 - Update.
Whilst the library is intended for use as a source code include, it is now compatible with Tailbite. There were problems with those functions taking optional parameters etc.

An important change is that any program using the nxToolbar library in the form of a source code include file must now declare the constant:

Code: Select all

#nxToolbar_USESOURCE
before including the main nxToolbar source file. (See the example program.) This meant that I could keep the optional parameters when using the lib either in source code form or as a Tailbitten library without making any changes to the host program etc.

The download link is in the first post.
I may look like a mule, but I'm not a complete ass.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8433
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

I use an optional parameter for the flags in ManagedMessageBox and Tailbite doesn't have a problem with it. I thought optional parameters were solved in Tailbite? Or am I wrong?
BERESHEIT
Post Reply