Includefile for creating real Gadgets in PB

Share your advanced PureBasic knowledge/code with the community.
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 »

Test this:

Code: Select all

Procedure OB_AddGadgetItem3   (*gadget.PB_Gadget, Position, Texte.s, bla.l, blub.l)
  ;code here
EndProcedure
Procedure OB_AddGadgetItem2   (*gadget.PB_Gadget, Position, Texte.s, dummy.l = -1)
  ProcedureReturn OB_AddGadgetItem3   (*gadget.PB_Gadget, Position, Texte.s, dummy, -1)
EndProcedure
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
Progi1984
Addict
Addict
Posts: 806
Joined: Fri Feb 25, 2005 1:01 am
Location: France > Rennes
Contact:

Post by Progi1984 »

No result !

I send you my code by PM !
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 »

Progi1984 wrote:No result !

I send you my code by PM !
You don't use the pbosl lib, you use the source!
Sorry, i have in the moment no time to check this

greetings
thomas
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
Progi1984
Addict
Addict
Posts: 806
Joined: Fri Feb 25, 2005 1:01 am
Location: France > Rennes
Contact:

Post by Progi1984 »

ts-soft wrote:Test this:

Code: Select all

Procedure OB_AddGadgetItem3   (*gadget.PB_Gadget, Position, Texte.s, bla.l, blub.l)
  ;code here
EndProcedure
Procedure OB_AddGadgetItem2   (*gadget.PB_Gadget, Position, Texte.s, dummy.l = -1)
  ProcedureReturn OB_AddGadgetItem3   (*gadget.PB_Gadget, Position, Texte.s, dummy, -1)
EndProcedure
Small question : where can i have some better information about each field of structure PB_GadgetVT ? Because i search in the lib sdk and i find no true informations !
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 have only the information from the examples in the pb sdk
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
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

The default values passed to the function are 0, not -1 if the parameter is not used.
You should only implement one of the two functions (depending on your need for the flags parameter)
The AddGadgetItem3 will be called if present and else the AddGadgetItem2, no matter
wich parameters the coder actually used.
quidquid Latine dictum sit altum videtur
User avatar
Progi1984
Addict
Addict
Posts: 806
Joined: Fri Feb 25, 2005 1:01 am
Location: France > Rennes
Contact:

Post by Progi1984 »

Thank you very much freak and ts-soft ! These informations are very useful !!!!
byo
Enthusiast
Enthusiast
Posts: 635
Joined: Mon Apr 02, 2007 1:43 am
Location: Brazil

Post by byo »

Amazing work, ts-soft.

Do you think you can provide an example that would show how to create an ImageButton but like Delphi's one (with a caption under/over/beside the image) ?

I have a great interest in this component and I love your examples. :)
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 »

@byo
You should use the PBOSL lib, is more up to date :)
In the PBOSL examples is a menubutton example, i think this is that what
you like.
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
byo
Enthusiast
Enthusiast
Posts: 635
Joined: Mon Apr 02, 2007 1:43 am
Location: Brazil

Post by byo »

Thanks for the amazing PBOSL (to its authors too).
I can't seem to find any examples on the website or the zip file like the one you mentioned. Is there somewhere else I should look at? :D
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 »

Load the PBOSL_Examples.zip
"PBOSL_EXAMPLES\PBOSL4\EXAMPLES\PBOSL_CreateGadget\MenuButton\"
here is the one that i mentioned

greetings
Thomas
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
Post Reply