[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lmi] Re: allocating consecutive ids in XRC (was: UpdateUI problems
From: |
Vaclav Slavik |
Subject: |
Re: [lmi] Re: allocating consecutive ids in XRC (was: UpdateUI problems in main_wx.cpp) |
Date: |
Thu, 18 Sep 2008 20:35:43 +0200 |
On Thu, 2008-09-18 at 15:49 +0200, Vadim Zeitlin wrote:
> The obvious problem with this approach is that if you now add a
> fourth item to the range you have to rename all the existing ids (this
> doesn't need any changes at the code level, just in the XRC, but is
> still painful).
What about adding support for defining named ID ranges in XRC files?
Something along the lines of:
<ids-range name="edit-cmd" size="10"/>
...
<object name="main-menu" class="wxMenuBar">
...
<object class="wxMenuItem" name="edit-cmd[0]">
<label>Edit _foo</label>
</object>
<object class="wxMenuItem" name="edit-cmd[1]">
<label>Edit _bar</label>
</object>
...
</object>
I dislike the idea of interpreting names like "edit_3_of_3" ("_" is a
common delimiter, it's not immediately obvious it has special meaning
when reading the code) as much as I dislike the need to rename
everything when extending the range.
Regards,
Vaclav