![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
Динамически создать пункты Popup-меню
Phantom © (2003-11-24 19:34:00)Как динамически создать несколько (заранее неизвестно сколько именно) строк в Popup-меню и обрабатывать события выбора пользователем этих пунктов в KOL & MCK ?
Phantom (2003-11-26 20:11:00) [1]Сенкс большущий
=Sniper= (2003-11-25 23:15:00) [2]2Phantom:
Gandalf
имеет в виду эту ссылку :-)
http://www.delphimaster.ru/cgi-bin/forum.pl?id=1068482799&n=10
Phantom (2003-11-25 22:35:00) [3]а несложный пример (или толковую ссылку) ?
Gandalf (2003-11-25 21:18:00) [4]2Vladimir Kladov
Так вроде про динамику спрашивали.
Vladimir Kladov (2003-11-25 16:02:00) [5]In MCK project, name individual items as you wish. E.g. Edit|Copy -> mmEditCopy. Then, use thos name as ID of the item. E.g., MainMenu1.ItemEnabled[ mmEditCopy ], etc.
This works only in the unit where the menu is declared though. If it is necessary to get access to menu items from another form unit, I usually make a property for the form, containing menu:
property EditCopyChecked: boolean read GetEditCopyChecked write SetEditCopyChecked;
and provide a one-line methods to access it, using the same trick. This is enough to work with huge menu without problems even then those are modified a lot during developing a project.
The same feature exists for toolbar buttons and list view columns in the MCK.
SPeller (2003-11-25 15:20:00) [6]
> Boguslaw (25.11.03 14:20) [3]
Используйте идентификаторы, которые можно хранить в свойстве Tag.
Boguslaw (2003-11-25 14:20:00) [7]Do I find popup or main menu item by name ? This would be usefull I think, becouse finding by item index is incorrect when menu is dynamically modified.Just an idea.
Gandalf (2003-11-25 10:02:00) [8]AddItem,Insert... и т.д. Буквально на прошлой недели объяснял, поиск есть. Говорят MCK генерит код - смотреть не пробовали, для развития.
Vladimir Kladov (2003-11-24 21:42:00) [9]объясните здесь пожалуйста: что-то не устраивает в имеющихся методах, или вы их не смотрели?