Page 2 of 2

Re: PureBasic Gadget Numbering System

Posted: Thu Oct 13, 2016 1:57 pm
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:

Re: PureBasic Gadget Numbering System

Posted: Thu Oct 13, 2016 2:24 pm
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?

Re: PureBasic Gadget Numbering System

Posted: Thu Oct 13, 2016 2:47 pm
by ts-soft
I don't understand? I use always the same enumeration-names. So what is the problem?

Re: PureBasic Gadget Numbering System

Posted: Thu Oct 13, 2016 3:07 pm
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?

Re: PureBasic Gadget Numbering System

Posted: Thu Oct 13, 2016 4:04 pm
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.

Re: PureBasic Gadget Numbering System

Posted: Thu Oct 13, 2016 7:01 pm
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.

Re: PureBasic Gadget Numbering System

Posted: Fri Oct 14, 2016 7:38 am
by Kukulkan
Hello Demivec,

thanks, now I understand. I still prefer #PB_Any, but if this works it is also a valid solution. Great :-)

Re: PureBasic Gadget Numbering System

Posted: Thu Oct 20, 2016 8:32 am
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