kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #05046
Re: pcbnew module editor toolbar items now in menubar -- patch
On 7/23/2010 1:31 PM, Dick Hollenbeck wrote:
> On 07/23/2010 10:19 AM, Wayne Stambaugh wrote:
>>>> I would
>>>> rather avoid adding new IDs unless there is a good reason to do so.
>>>
>>> Yeah I didn't know why there are mixed IDs but now I understand, and this a
>>> good choice. So the TODO's can be forgotten.
>>
>> When I get some time I would like to do some additional ID clean up. Creating
>> a common ID like ID_ADD_LINE used by all of the apps that draw a line is the
>> same as using wxID_OPEN for opening files. I don't see how ID_PCB_ADD_LINE,
>> ID_MODEDIT_ADD_LINE, ID_EESCHEMA_ADD_LINE make the code any more readable and
>> just add to already large number of IDs Kicad uses.
>
>
> Taking that to the extreme, in the layer panel I think there were a couple of cases
> where I never even put the control ID's in a header file, since that information was
> private to the implementing *.cpp file and all that mattered was uniqueness (within
> any given panel) and clarity.
That's an even better idea. I've used it in a few places myself for private
IDs. It prevents a lot of unnecessary compiling when you only add new private
IDs. If you really want to get extreme, you could allocate IDs dynamically
using ::wxGetID() which guarantees all IDs in a given application will be
unique. I almost always use ::wxGetID() when using wxPython.
Wayne
>
>
> Dick
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help : https://help.launchpad.net/ListHelp
>
References