Home » Developer & Programmer » Forms » Help with ImageList and Treeview in comctl32.ocx (Forms 6i 6.0.8.27.0)
Help with ImageList and Treeview in comctl32.ocx [message #387539] Thu, 19 February 2009 16:13 Go to next message
Gasper
Messages: 1
Registered: February 2009
Location: Costa Rica
Junior Member
I Need to implement Microsoft Tree View (comctl32.ocx) in a form, i follow up an example that i found in this forum but the example doesn't show how to implement the images in the tree, Anybody know how to do this?. I already create a new object with Microsoft Image List (comctl32.ocx) but i don't know how to use the procedures and functions of the library and how to add images to the Image List.

Now the form is getting me this error "TypeMismatch - Code 13".

The code im using to initialize the Image list is this:

PROCEDURE **** IS 
   ListImage        Oleobj;  
   Images           ComctlLib_Constants.IImages;
   Image            ComctlLib_Constants.IImage; 
   errCode          pls_integer;
   errSrc           varchar2(200);
   errDescription   varchar2(2000);
   errHelpfile      varchar2(200);
   errHelpContext   pls_integer;  
BEGIN	 
   ListImage := :item('LIST.IMAGE_LIST').interface; 
		 
   Images := COMCTL_IImageList10.ListImages(ListImage);	 
	 
   Image := COMCTL_IImages.Ole_Add (interface    => Images,
		                    zIndex       => to_variant ('1'),
		                    Key          => to_variant ('Pr1'),
		                    Picture      => to_variant ('C:\*****.jpg'));   
Exception
   When Form_Ole_Failure then 
      ErrCode := Last_Ole_Exception ( errSrc,
                                      errDescription,
                                      errHelpfile,
                                      errHelpContext);
                                      
      Gen_Error ('Error: '||errSrc||': '||errDescription); 	  
END;

Pd. Then i need to assing the images in the Image List to the nodes in the Tree View.

Re: Help with ImageList and Treeview in comctl32.ocx [message #388733 is a reply to message #387539] Thu, 26 February 2009 00:44 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
What is the error number associated with the message "TypeMismatch - Code 13"?

Place 'message;pause;' pairs between each statement and tell us exactly which statement is causing the error.

David
Re: Help with ImageList and Treeview in comctl32.ocx [message #410596 is a reply to message #387539] Mon, 29 June 2009 03:47 Go to previous message
snao00
Messages: 14
Registered: June 2009
Location: Magdeburgo, Alemania
Junior Member

i already had the same problem let me tell how to solve it.

1.-where do you have your tree i dont see it.

2.- You dont need to add the images with code with right click in the image list object > properties and then you search the option for add the icons and then you will be able to add the images one by one selecting the filediectory and putting the key for each one. If you want diferent resolutions for your icons you have to add one image list for each resolution and use your imagination for swtitching from one to another.

3.- you are not telling to the tree that that image list belongs to the tree.

4.- Complete code how i did it:

x_tree oleobj;
x_imli oleobj;
x_nodes MSComctlLib_CONSTANTS.INodes;
x_node MSComctlLib_CONSTANTS.INode;

begin

here you obtain the interface of a tree for your object
x_tree:= GET_INTERFACE_POINTER ('BL_TREE.TREE');

in this one you tell that you want the interface of the image list for attaching the images to the nodes
x_imli:= GET_INTERFACE_POINTER ('BL_TREE.IMAGES');

In this part you asign the image list to the tree
MSCOMCTLLIB_ITREEVIEW.IMAGELIST(x_tree,x_imli);

MSCOMCTLLIB_ITREEVIEW.Style(x_tree,7);

x_nodes:= MSComctlLib_ITreeView.Nodes(x_tree);

MSComctlLib_INodes.clear(x_nodes);

This is an example of one parent node
x_node := MSCOMCTLLIB_iNodes.ole_add(x_nodes, OleVar_empty, to_variant(1), to_variant('A1'), to_variant('Auftrag'),to_variant(3));<-- this is the variable for the image, in this one you tell to the tree that the image with the index # belongs the that node.
release_obj(x_node);

i hope that this can help you.





[Updated on: Mon, 29 June 2009 03:49]

Report message to a moderator

Previous Topic: its possible to call??????????????
Next Topic: Changing Color of a push button when mouse over
Goto Forum:
  


Current Time: Fri Sep 20 08:27:20 CDT 2024