AXForum  
Вернуться   AXForum > Microsoft Dynamics AX > DAX Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 25.01.2010, 17:05   #1  
Blog bot is offline
Blog bot
Участник
 
25,617 / 848 (80) +++++++
Регистрация: 28.10.2006
kamalblogs: Adding custom images for Treenode in Dynamics Ax
Источник: http://kamalblogs.wordpress.com/2008...n-dynamics-ax/
==============


 

Tree node and Icons for tree nodes are inseparable. Right icons can make your tree look lot different.. Here is one tweak for getting the difference.

This article deals with displaying external images as tree node icons.

Images used in Treenode should be passed as Imagelist. Ax has set a predefined set of classes starting with ImageListAppl that helps to manage different sorts of ImageLists. ImageListAppl is the base classes of all such classes.

The most appropriate way to enable a strong support for external images in tree node would be through modifying the ImageListAppl class to load external images. (Currently they can load only resource numbers). The following code below when added to the base class helps you load images externally or through resource nodes.

public void addImage(int _idNo, FilePath _filePath) { int imageNum; Image image = new Image(); try { if (_filePath) { image.loadImage(_filePath); imageNum = imagelist.add(image); imageConvert.insert(_idNo, imageNum); } } catch { warning(strfmt("@SYS85977")); } } Now let’s see the usage of the method we added. Take a class like ImageListAppl_Sales for example. Override the build method and implement in the way as you seen below.

this.I4C_addImage(#ImageNewPic, SysResource::getImagePath('myimage'));  Every Image loaded has to be identified through some resource numbers. Generally it is better if the new resource number you assign is greater than the system defined resource number.To identify the Highest resource number always refer to the  “SysImageResources” form. (4.0 users you can use the Tutorial_resources form).

Two things to note from the above line of code.

-> The new Resource numbers has to be defined as a macro in a new macro node or to an existing macro node like resappl (it contains the standard resource number).

-> In the above example i have used an image from the resource node, you can also use an external image which is stored in the computer. (Resource node is preferred, coz it is easy to distribute)

To use this image all you need to do is just load the same Image list class with your tree control and then just refer to the new resource number for the image that you wanted to display.

salesLineTree.setImagelist(imageList.imageList()); SysFormTreeControl::addTreeItem(salesLineTree, displaystring, 0, 0, #myImage); That’s what it takes to our new image to the tree node. So now you can widen your image space for tree icons with all kind of images you like…

Keep reading…




Источник: http://kamalblogs.wordpress.com/2008...n-dynamics-ax/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
emeadaxsupport: List of fixes that improve performance of certain features in Dynamics AX 2009 Blog bot DAX Blogs 0 13.10.2009 19:06
CRM DE LA CREME! Configuring Microsoft Dynamics CRM 4.0 for Internet-facing deployment Blog bot Dynamics CRM: Blogs 0 18.08.2009 11:05
Developer for Microsoft Dynamics AX Certification Roadmap Blog bot DAX Blogs 1 13.05.2009 16:17
axStart: Microsoft Dynamics AX 2009 Hot Topics Web Seminar Series Blog bot DAX Blogs 0 06.08.2008 12:05
casperkamal: Adding custom images for Treenode in Dynamics Ax Blog bot DAX Blogs 0 25.07.2008 03:08

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 03:51.