PureBasic Gadget Numbering System

Share your advanced PureBasic knowledge/code with the community.
walbus
Addict
Addict
Posts: 929
Joined: Sat Mar 02, 2013 9:17 am

Re: PureBasic Gadget Numbering System

Post by walbus »

Common is a nice feature,
but with many common, i can also use procedures, not modules, i think.

And a other are User DLL´s

But, everyone can do what he wants,
Important is whether it works or not :wink:
User avatar
Kukulkan
Addict
Addict
Posts: 1396
Joined: Mon Jun 06, 2005 2:35 pm
Location: germany
Contact:

Re: PureBasic Gadget Numbering System

Post by Kukulkan »

Kukulkan wrote:But if you try to re-use a module in another program, how do you know what enumerations you have to add to your CommonConstants module?
Still wondering about that... Can you please clarify?
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: PureBasic Gadget Numbering System

Post by ts-soft »

I don't understand? I use always the same enumeration-names. So what is the problem?
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
Kukulkan
Addict
Addict
Posts: 1396
Joined: Mon Jun 06, 2005 2:35 pm
Location: germany
Contact:

Re: PureBasic Gadget Numbering System

Post by Kukulkan »

I don't understand? I use always the same enumeration-names. So what is the problem?
Hm. How do you do if you decide to use a .pbi-file containing, for example, a proxy selection dialogue. If it was done using your technique, you have to add the enumerations (constants) needed for that include to your CommonConstants module. I assume that this module does not contain all enumerations for all includes and modules you ever did by default. And also not for third party modules and includes (eg from forum). Therefore, you need to add the enumerations (windows, files etc) to your CommonConstants module. How do you know what constants to add?
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: PureBasic Gadget Numbering System

Post by ts-soft »

I don't understand you. The CommonConstants is finished, no more Code come in there. All pb-objects a included
with an empty named enumeration. Unused Enumerationen in your source don't generate any Code.
You have to XIncludeFile "CommonConstants.pbi" on top of your file or files and that is it.

If i have you not understand, tell me in german per pm.
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
Demivec
Addict
Addict
Posts: 4260
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: PureBasic Gadget Numbering System

Post by Demivec »

Kukulkan wrote:
I don't understand? I use always the same enumeration-names. So what is the problem?
Hm. How do you do if you decide to use a .pbi-file containing, for example, a proxy selection dialogue. If it was done using your technique, you have to add the enumerations (constants) needed for that include to your CommonConstants module. I assume that this module does not contain all enumerations for all includes and modules you ever did by default. And also not for third party modules and includes (eg from forum). Therefore, you need to add the enumerations (windows, files etc) to your CommonConstants module. How do you know what constants to add?
@Kulkulkan: ts-soft uses the named enumerations from the 'commons' moduleeach of the other includes (or modules) to add to the list of constants for a particular named enumeration.

In this way the individual modules don'the have to reserve a specific range of constants or know what other ranges are RESERVED, they just get the next available constant value in the named enumeration.
User avatar
Kukulkan
Addict
Addict
Posts: 1396
Joined: Mon Jun 06, 2005 2:35 pm
Location: germany
Contact:

Re: PureBasic Gadget Numbering System

Post by Kukulkan »

Hello Demivec,

thanks, now I understand. I still prefer #PB_Any, but if this works it is also a valid solution. Great :-)
infratec
Always Here
Always Here
Posts: 7584
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: PureBasic Gadget Numbering System

Post by infratec »

Hi, hi,

in the case of #PB_Event_FirstCustomValue and #PB_EventType_FirstCustomValue there is no #PB_Any.

The 'trick' of ts-soft is the only possible way to avoid the same custom events when you use different includes with own defined cutsom events (used for BindGadgetEvent() or similar).

Bernd
Post Reply