#1
|
|||
|
|||
icons in a graphical browser
Hi,
How is it possible to get the little icons next to a browsernode in a graphical browser. I can't find a command to do this, but it should be possible, because the structure browser has all kinds of icons in to it. thanks in advance greetings Ruben |
#2
|
|||
|
|||
Re: icons in a graphical browser
After a bit of searching in google I found a solution with interrogators. So now I can place an icon next to the browsernodes in my new browser. But I still have a little problem, the icon is next to all the browsernodes instead of next to the selected one. How can I do this? My code is here below.
Code:
(in-package :mat) (use-package :oli) (defvar *dirbrowser* "Materials") (defun dirbrowser-build-tree () (setf parent (sd-create-browsernode :tree *dirbrowser* :parent nil :objPname "Materials") ) (sd-create-browsernode :tree *dirbrowser* :parent parent :objPname "Plate") (setf profile (sd-create-browsernode :tree *dirbrowser* :parent parent :objPname "Profile") ) (sd-create-browsernode :tree *dirbrowser* :parent parent :objPname "Round Bar") (sd-create-browsernode :tree *dirbrowser* :parent parent :objPname "Square") ) (defun dirbrowser-create () (sd-destroy-browser-tree *dirbrowser*) (sd-create-browser-tree *dirbrowser* :update-func 'dirbrowser-build-tree) (sd-destroy-graphical-browser *dirbrowser*) (sd-create-graphical-browser *dirbrowser* :tree *dirbrowser* :createAsTab nil :tabname "Materials" :topLabel "Materials" :minHeight 400 :maxWidth 200 :maxHeight 1000 :tabImage "C:/Users/rvn/Dropbox/Programming/1-lisps/bmp/create.bmp") (sd-show-graphical-browser *dirbrowser* :position '("task-ds" :lefbottom)) ) (dirbrowser-create) (dirbrowser-build-tree) (sd-browser-add-interrogator *dirbrowser* :interrogator-type :primary-pixmap :interrogator-func 'functie) (defun functie (node name) (setf node (sd-get-browsernode-struct *dirbrowser* parent)) (setf name (sd-browser-register-image *dirbrowser* :image "create" :filename "C:/Users/rvn/Dropbox/Programming/1-lisps/bmp/create.bmp" :type :primary-image)) ) |
#3
|
|||
|
|||
Re: icons in a graphical browser
Hi Ruben,
As I indicated in email, the reason you're seeing icons for all items is that the interrogator isn't actually checking anything -- it's just returning the name of the image to use. So you need to update that function. I've fixed that, and made a few other changes to clean up the code, and I have also added a few comments. I think this will do what you need: Code:
(in-package :mat) (use-package :oli) (defvar *dirbrowser* "Materials") ;; create a couple of variables to hold our parent node and profile node (defvar *parent-node* nil) (defvar *profile-node* nil) (defun dirbrowser-build-tree () (setf *parent-node* (sd-create-browsernode :tree *dirbrowser* :parent nil :objPname "Materials")) (sd-create-browsernode :tree *dirbrowser* :parent *parent-node* :objPname "Plate") (setf *profile-node* (sd-create-browsernode :tree *dirbrowser* :parent *parent-node* :objPname "Profile")) (sd-create-browsernode :tree *dirbrowser* :parent *parent-node* :objPname "Round Bar") (sd-create-browsernode :tree *dirbrowser* :parent *parent-node* :objPname "Square") ) (defun dirbrowser-create () (sd-destroy-browser-tree *dirbrowser*) (sd-create-browser-tree *dirbrowser* :update-func 'dirbrowser-build-tree) (sd-destroy-graphical-browser *dirbrowser*) (sd-create-graphical-browser *dirbrowser* :tree *dirbrowser* :createAsTab nil :tabname "Materials" :topLabel "Materials" :minHeight 400 :maxWidth 200 :maxHeight 1000 :tabImage "C:/Users/rvn/Dropbox/Programming/1-lisps/bmp/create.bmp") (sd-show-graphical-browser *dirbrowser* :position '("task-ds" :lefbottom)) ) (dirbrowser-create) (dirbrowser-build-tree) ;; register the image when this file is loaded. Then we can use it any time. (sd-browser-register-image *dirbrowser* :image "create" :filename "C:/Users/rvn/Dropbox/Programming/1-lisps/bmp/create.bmp" :type :primary-image) (defun functie (node name) ;; only return "create" when the node is the parent node (when (string= (browsernode-nodeid node) *parent-node*) "create")) (sd-browser-add-interrogator *dirbrowser* :interrogator-type :primary-pixmap :interrogator-func 'functie) andy
__________________
Andy Poulsen AI MAXTools: Dream. Design. Done. It's that easy! Add-ins bringing new functionality and speed to Creo Elements/Direct and CoCreate products. Now available for v17-v20+! See them in action at www.ai-maxtools.com and then try them for yourself -- FREE! |
#4
|
|||
|
|||
Re: icons in a graphical browser
Hi Andy,
Thanks again for this, works great! Greetings Ruben |
#5
|
|||
|
|||
Re: icons in a graphical browser
Is it possible to associate to these icons a "change color part and density" command?
So if I click them and then click on the piece in the 3D window, will I change the color and density of the part? |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|