Home » Developer & Programmer » Forms » Treeview with images and checkboxes in forms with OLE-Container (Oracle Forms 6i)
icon12.gif  Treeview with images and checkboxes in forms with OLE-Container [message #406534] Thu, 04 June 2009 08:03 Go to next message
snao00
Messages: 14
Registered: June 2009
Location: Magdeburgo, Alemania
Junior Member

Hi

I have an issue with an OLE-Container (ITreeView).
I have already a form with the treeview (database no necessary) with some nodes added manually.

All this nodes have checkbox and style properties, drag and drop (drag automatic and drop manual).
I added also to the form an OLE-Container for the listImage and put into the container the images that i need.
I put checked the father and when it is true then a variable into the declaration of the check of the childrens change and the child nodes are checked too, but when i do it manually nothing happend.

What I want to do is the next thing:
I want to be able to drag and drop in every place of my tree to change the positition between the nodes of the node father and to change it also with childnodes of other parent.
To Put an Image next to each node (how to call the images that are inside of my imagelist)
When I checked the parent then check all the child nodes of it.

I hope that somebody can help, because I have some code but doesn't work. I don't even have any error, but also that part of code doen't do anything.

In advanced "thanks for the help"
Re: Treeview with images and checkboxes in forms with OLE-Container [message #407404 is a reply to message #406534] Wed, 10 June 2009 01:54 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Have you solved your problem?

Have you looked at the other entries in this forum by searching for 'tree' and 'hierarchy'?

David
Re: Treeview with images and checkboxes in forms with OLE-Container [message #407411 is a reply to message #407404] Wed, 10 June 2009 02:14 Go to previous messageGo to next message
snao00
Messages: 14
Registered: June 2009
Location: Magdeburgo, Alemania
Junior Member

i still dont resolve my problem.

I already have all my nodes with images. The ImageList is not a problem anymore.

but what i cant still do is the drag and drop and check all nodes if the parent is checked.
Re: Treeview with images and checkboxes in forms with OLE-Container [message #408568 is a reply to message #407411] Tue, 16 June 2009 21:00 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Concerning 'drag drop' have you contacted the OP of http://www.orafaq.com/forum/m/351010/67467/?srch=drag+drop#msg_351010 and http://www.orafaq.com/forum/m/346294/67467/?srch=drag+drop#msg_346294 and http://www.orafaq.com/forum/m/311036/67467/?srch=drag+drop#msg_311036

Can you detect when the 'parent' is cahnged? If yes, then can't you loop through the subordinate nodes to change their 'check' item?

David
Re: Treeview with images and checkboxes in forms with OLE-Container [message #409326 is a reply to message #408568] Mon, 22 June 2009 03:11 Go to previous messageGo to next message
snao00
Messages: 14
Registered: June 2009
Location: Magdeburgo, Alemania
Junior Member

thank you and let me check

because i already did it in visual basic 2008 express but oracle forms and visual basic are not similars at all
Re: Treeview with images and checkboxes in forms with OLE-Container [message #409337 is a reply to message #409326] Mon, 22 June 2009 03:39 Go to previous messageGo to next message
snao00
Messages: 14
Registered: June 2009
Location: Magdeburgo, Alemania
Junior Member

i already tried this:

PROCEDURE /* NodeCheck */ EVENT6(interface OleObj, Node IN MSComctlLib_CONSTANTS.Node) IS
	  x_nodes  MSComctlLib_CONSTANTS.INodes;
	  x_node   MSComctlLib_CONSTANTS.INode;
 	  x_node2  MSComctlLib_CONSTANTS.INode;
BEGIN
if MSComctlLib_INode.checked(x_node) = 0
then
MSComctlLib_INode.checked(x_node2,0);
else
MSComctlLib_INode.checked(x_node2,0);
end if;

END;

what i use to create the child-nodes is in when-new-forms instance and is:
for k in 1..10 loop
            x_node2 :=  MSCOMCTLLIB_iNodes.ole_add 
            (x_nodes,to_variant('A1'),to_variant(4),
            to_variant('B' || '' || LTRIM(k)), 
            to_variant('Teil_' || '' || LTRIM(k)), 
            to_variant(1),to_variant(2));
            MSComctlLib_INode.bold(x_node2,1);   
end loop;

[EDITED by DJM: applied [code] tags]

[Updated on: Tue, 23 June 2009 01:17] by Moderator

Report message to a moderator

Re: Treeview with images and checkboxes in forms with OLE-Container [message #409345 is a reply to message #409337] Mon, 22 June 2009 04:19 Go to previous messageGo to next message
snao00
Messages: 14
Registered: June 2009
Location: Magdeburgo, Alemania
Junior Member

sorry for replying in three different coments.

I cant with the drag and drop i already read what you have post me but that have nothing to do with what im doing.

and i already searched in the old pages and i couldnt find something that can help me.

this is my complete code:
Sorry but all the explanations are in german because im doing it in Germany.

-- Dieses Programm ermöglich der Aufbau eines TreeView 
-- mit den Eigenschaften "Drag and Drop", "Checkboxes", "ImageList"
-- ohne die Nutzung einer Datenbank.
-- Deklaration der Variabeln
declare
            
-- Variablen für die Aufbau des Baums
            x_tree   oleobj;
            x_nodes  MSComctlLib_CONSTANTS.INodes;
            x_node   MSComctlLib_CONSTANTS.INode;
            x_node2  MSComctlLib_CONSTANTS.INode;
            
-- Variable für die ImageList
   x_imli           Oleobj;  
  
begin

-- Diese Labeln sind für die temporale Objekte
   :Label1 := 'Knoten';
   :Label2 := 'Zielposition';
   :Label3 := 'Position im X';
   :Label4 := 'Position im Y';
 
-- Der Abruf des Interfaces des OcxObjektes
   x_tree:= GET_INTERFACE_POINTER ('BL_TREE.TREE');
 
-- ImageList
-- Hier setzen wir das ImageList-Objekt in x_imli
x_imli:= GET_INTERFACE_POINTER ('BL_TREE.IMAGES');
-- Wir müssen dieses Objekt in unseren Baum einsetzen.
MSCOMCTLLIB_ITREEVIEW.IMAGELIST(x_tree,x_imli);
 
-- Die Einsetzung der Eingenschaften für die Expandierung und das Unterstreichen des Knotens
   MSCOMCTLLIB_ITREEVIEW.Style(x_tree,7);
   
-- Die Einsetzung der Eingenschaften für die Editierung des Textes der Knoten
   MSCOMCTLLIB_ITREEVIEW.StartLabelEdit(x_tree);
   MSCOMCTLLIB_ITREEVIEW.LabelEdit(x_tree,0);
 
-- x_nodes haben die Eigenschaften aus den Knoten
   x_nodes:= MSComctlLib_ITreeView.Nodes(x_tree);
            
-- Um die Knoten zu aktualizieren
            MSComctlLib_INodes.clear(x_nodes);
            
-- Checkbox Eigenschaft einsetzen
   MSComctlLib_ITreeView.Checkboxes(x_tree, 1);
 
--  Add NODES, jeder Knoten muss verschiedene "Key" haben
--  und sollen nicht mit numeriches- sondern mit alpha Schriftzeichen beginnen.
/* 
Jeder Teil ist:
x_node := MSCOMCTLLIB_iNodes.ole_add
(Interface    => x_nodes,
 Angehörige   => olevar_empty,
 Verbindung   => to_variant(1), -> 1 Vater, 4 Kind
 Schlüssel    => to_variant('A1'),
 Text         => to_variant('Auftrag');
 Image        => to_variant(3));  <- # index in unserem ImageList-Objekt
 Image2       => to_variant(3));  <- # index in unserem ImageList-Objekt
*/
 
 
-- Das Einfügen des Vaterknotens
            x_node :=  MSCOMCTLLIB_iNodes.ole_add(x_nodes, OleVar_empty, to_variant(1),
                       to_variant('A1'), to_variant('Auftrag'),to_variant(3));
            MSComctlLib_INode.bold(x_node,1);
            MSComctlLib_INode.checked(x_node,1);
            
 
-- Das Einfügen der Kinderknoten
-- K ist Anzahl von Knoten
-- Achtung: es ist möglich bis zum 65,534 Knoten in das Objekt einfügen
-- Dieses Einfügen dauert 6 Minuten und 55 Sekunden.
for k in 1..10 loop
            x_node2 :=  MSCOMCTLLIB_iNodes.ole_add(x_nodes,to_variant('A1'),to_variant(4),
            to_variant('B' || '' || LTRIM(k)), 
            to_variant('Teil_' || '' || LTRIM(k)), 
            to_variant(1),to_variant(2));
            MSComctlLib_INode.bold(x_node2,1);    
end loop;
 
 
-- Expanded Eigenschaft für den Vaterknoten und die Kinderknoten
   MSComctlLib_INode.expanded(x_node,0);
--   MSComctlLib_INode.expanded(x_node2,0);
 
-- Selection Eigenschaft
   MSComctlLib_ITreeView.HotTracking(x_tree, 1);
 
-- Drag und Drop Verfahren
 MSComctlLib_ITreeView.OLEDragMode(x_tree, 1);  -- 1-Automatic
 MSComctlLib_ITreeView.OLEDropMode(x_tree, 1);  -- 1-Manual
 
 
end;


and the the other things that im doing are in the events of the treeview but there are also efects but i cant find it im already looking for it just like in visual there is a .move hier should be a move or something like that that can help.

these are all the events that i can use:

PACKAGE MSComctlLib_TreeCtrl_2_EVENTS IS

-- The Events Package:

PROCEDURE /* BeforeLabelEdit */ EVENT1(interface OleObj, Cancel IN NUMBER);

PROCEDURE /* AfterLabelEdit */ EVENT2(interface OleObj, Cancel IN NUMBER, NewString IN VARCHAR2);

PROCEDURE /* Collapse */ EVENT3(interface OleObj, Node IN MSComctlLib_CONSTANTS.Node);

PROCEDURE /* Expand */ EVENT4(interface OleObj, Node IN MSComctlLib_CONSTANTS.Node);

PROCEDURE /* NodeClick */ EVENT5(interface OleObj, Node IN MSComctlLib_CONSTANTS.Node);

PROCEDURE /* KeyDown */ EVENT4294966694(interface OleObj, KeyCode IN NUMBER, Shift IN NUMBER);

PROCEDURE /* KeyUp */ EVENT4294966692(interface OleObj, KeyCode IN NUMBER, Shift IN NUMBER);

PROCEDURE /* KeyPress */ EVENT4294966693(interface OleObj, KeyAscii IN NUMBER);

PROCEDURE /* MouseDown */ EVENT4294966691(interface OleObj, Button IN NUMBER, Shift IN NUMBER,
	x IN /* stdole_CONSTANTS.OLE_XPOS_PIXELS */ NUMBER, y IN /* stdole_CONSTANTS.OLE_YPOS_PIXELS */ NUMBER);


PROCEDURE /* MouseMove */ EVENT4294966690(interface OleObj, Button IN NUMBER, Shift IN NUMBER,
	x IN /* stdole_CONSTANTS.OLE_XPOS_PIXELS */ NUMBER, y IN /* stdole_CONSTANTS.OLE_YPOS_PIXELS */ NUMBER);

PROCEDURE /* MouseUp */ EVENT4294966689(interface OleObj, Button IN NUMBER, Shift IN NUMBER,
	x IN /* stdole_CONSTANTS.OLE_XPOS_PIXELS */ NUMBER, y IN /* stdole_CONSTANTS.OLE_YPOS_PIXELS */ NUMBER);

PROCEDURE /* Click */ EVENT4294966696(interface OleObj);

PROCEDURE /* DblClick */ EVENT4294966695(interface OleObj);

PROCEDURE /* NodeCheck */ EVENT6(interface OleObj, Node IN MSComctlLib_CONSTANTS.Node);

PROCEDURE /* OLEStartDrag */ EVENT1550(interface OleObj, Data IN OleVar, AllowedEffects IN NUMBER);

PROCEDURE /* OLEGiveFeedback */ EVENT1551(interface OleObj, Effect IN NUMBER, DefaultCursors IN NUMBER);

PROCEDURE /* OLESetData */ EVENT1552(interface OleObj, Data IN OleVar, DataFormat IN NUMBER);

PROCEDURE /* OLECompleteDrag */ EVENT1553(interface OleObj, Effect IN NUMBER);

PROCEDURE /* OLEDragOver */ EVENT1554(interface OleObj, Data IN OleVar, Effect IN NUMBER,
	Button IN NUMBER, Shift IN NUMBER, x IN NUMBER,
	y IN NUMBER, State IN NUMBER);

PROCEDURE /* OLEDragDrop */ EVENT1555(interface OleObj, Data IN OleVar, Effect IN NUMBER,
	Button IN NUMBER, Shift IN NUMBER, x IN NUMBER,
	y IN NUMBER);

END;

[EDITED by DJM: applied [code] tags]

[Updated on: Tue, 23 June 2009 01:20] by Moderator

Report message to a moderator

Re: Treeview with images and checkboxes in forms with OLE-Container [message #409535 is a reply to message #409345] Tue, 23 June 2009 01:23 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
'Moving' to me means changing the data values upon which the tree is based.

David
Re: Treeview with images and checkboxes in forms with OLE-Container [message #409558 is a reply to message #409535] Tue, 23 June 2009 02:03 Go to previous messageGo to next message
snao00
Messages: 14
Registered: June 2009
Location: Magdeburgo, Alemania
Junior Member

Of course that that is the intention but the question is how. all the manuals that i found are about visual basic and such that events i dont have idea how to declare them i cant even do a remove. Also there another but are with built-in-packages and with an Ole-Container is not allowed.

I already wrote some code in these move down and mouse move but with no succes. i still keep trying.

What i say also is this:
Effect IN NUMBER --> this automatic declaration in oledragdrop and other one obvioulsy means that there effects with .move like in visual basic but the help of Oracle Forms 6i doesnt help me at all.

All that i´ve done at this point is not much but i did it alone
and with manuals in visual basic is realy hard.

[Updated on: Tue, 23 June 2009 02:09]

Report message to a moderator

Re: Treeview with images and checkboxes in forms with OLE-Container [message #409561 is a reply to message #409558] Tue, 23 June 2009 02:09 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
The tree is based on a table, right? Which column in this table would you have to change to 'move' an entry in the tree?

David
Re: Treeview with images and checkboxes in forms with OLE-Container [message #409562 is a reply to message #409561] Tue, 23 June 2009 02:11 Go to previous messageGo to next message
snao00
Messages: 14
Registered: June 2009
Location: Magdeburgo, Alemania
Junior Member

the problem is that at this point iam not using the data base im working without that, until im able to do that drag and drop. If cant it really doesnt have any sense to connect with the data base.
Re: Treeview with images and checkboxes in forms with OLE-Container [message #409567 is a reply to message #409562] Tue, 23 June 2009 02:22 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
If you don't connect to the database, from where are you getting the data for the tree?

David
Re: Treeview with images and checkboxes in forms with OLE-Container [message #409568 is a reply to message #409567] Tue, 23 June 2009 02:25 Go to previous messageGo to next message
snao00
Messages: 14
Registered: June 2009
Location: Magdeburgo, Alemania
Junior Member

im generating each node with code:

-- Parent node
x_node :=  MSCOMCTLLIB_iNodes.ole_add(x_nodes, OleVar_empty, to_variant(1),to_variant('A1'),
           to_variant('Auftrag'),to_variant(3));
MSComctlLib_INode.bold(x_node,1);
            
-- Child Nodes
for k in 1..10 loop
            x_node2 :=  MSCOMCTLLIB_iNodes.ole_add(x_nodes,to_variant('A1'),to_variant(4),
            to_variant('B' || '' || LTRIM(k)), 
            to_variant('Teil_' || '' || LTRIM(k)), 
            to_variant(1),to_variant(2));
            MSComctlLib_INode.bold(x_node2,1);    
end loop;

[EDITED by DJM: applied [code] tags and cut a code line]

[Updated on: Wed, 01 July 2009 19:06] by Moderator

Report message to a moderator

Re: Treeview with images and checkboxes in forms with OLE-Container [message #409750 is a reply to message #409568] Tue, 23 June 2009 19:44 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
With the code that you supplied, what would a 'move' do?

David
Re: Treeview with images and checkboxes in forms with OLE-Container [message #409792 is a reply to message #409750] Wed, 24 June 2009 01:42 Go to previous messageGo to next message
snao00
Messages: 14
Registered: June 2009
Location: Magdeburgo, Alemania
Junior Member

a move i supposed that would do the effect of moving the node when somebody is dragging over the other nodes. but the problem is that i dont know how to declare such effects and somethings that are very necesary for this drag and drop. the help in Oracle Forms 6i for this Ole-Container with TreeView is not complete. when i say no complete is because there are just basics things like populating the tree and that is already done.

[Updated on: Wed, 24 June 2009 01:43]

Report message to a moderator

Re: Treeview with images and checkboxes in forms with OLE-Container [message #410022 is a reply to message #409792] Wed, 24 June 2009 21:05 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Have a look at forms.pjc.bean.over-blog.com/20-index.html

There would appear to be a Java thingy there that can move tree nodes.

David
Re: Treeview with images and checkboxes in forms with OLE-Container [message #410576 is a reply to message #410022] Mon, 29 June 2009 01:59 Go to previous messageGo to next message
snao00
Messages: 14
Registered: June 2009
Location: Magdeburgo, Alemania
Junior Member

i already saw what you've post it, but i was asked to do it with MSComctllib_ITreeView and im not using the web part of Oracle Forms. That's why i can not find so easily the information to use such effects for moving and the declarations of the variables or some procedures change a lot from visual to oracle, from oracle forms to oracle forms web, inclusive from oracle forms with hirechical tree to oracle forms with ole-container and there are a lot of examples for the other ones but for what im looking for i can not find anything.
Re: Treeview with images and checkboxes in forms with OLE-Container [message #410584 is a reply to message #406534] Mon, 29 June 2009 02:29 Go to previous messageGo to next message
snao00
Messages: 14
Registered: June 2009
Location: Magdeburgo, Alemania
Junior Member

in others words i have to use the MSComctlLib.TreeCtrl.2 in a ole container in oracle forms.
Re: Treeview with images and checkboxes in forms with OLE-Container [message #410585 is a reply to message #410576] Mon, 29 June 2009 02:31 Go to previous messageGo to next message
snao00
Messages: 14
Registered: June 2009
Location: Magdeburgo, Alemania
Junior Member

snao00 wrote on Mon, 29 June 2009 08:59
i already saw what you've post it, but i was asked to do it with MSComctlLib.TreeCtrl.2 and im not using the web part of Oracle Forms. That's why i can not find so easily the information to use such effects for moving and the declarations of the variables or some procedures change a lot from visual to oracle, from oracle forms to oracle forms web, inclusive from oracle forms with hirechical tree to oracle forms with ole-container and there are a lot of examples for the other ones but for what im looking for i can not find anything.

Re: Treeview with images and checkboxes in forms with OLE-Container [message #410711 is a reply to message #410585] Mon, 29 June 2009 20:59 Go to previous messageGo to next message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Did you have any success googling 'MSComctlLib.TreeCtrl move'?

David
Re: Treeview with images and checkboxes in forms with OLE-Container [message #410944 is a reply to message #410711] Wed, 01 July 2009 03:37 Go to previous messageGo to next message
snao00
Messages: 14
Registered: June 2009
Location: Magdeburgo, Alemania
Junior Member

I already searched inside the help of of forms and this effects for move, copy and etc are there but the declaration for these one is not clear i thought that was almost similar to the declaration to activate de drag drop and etc like i already done it but it was not true. Example:

MSComctlLib_ITreeView.OLEDropMode(x_tree, MSComctlLib_CONSTANTS.ccOLEDropManual);
Or the same but more simple:
MSComctlLib_ITreeView.OLEDropMode(x_tree, 1);-- 0-None 1-Manual

That is the way that i activate the Drag and drop and the help for Move says:
PACKAGE MSComctlLib_CONSTANTS IS
SUBTYPE OLEDropEffectConstants IS Number;
ccOLEDropEffectNone Constant Number := 0;
ccOLEDropEffectCopy Constant Number := 1;
ccOLEDropEffectMove Constant Number := 2;
ccOLEDropEffectScroll Constant Number := -2147483648;

i already tried to declare right this way:
MSComctlLib_ITreeView.OLEDropMode(interface,MSComctlLib_CONSTANTS.ccOLEDropEffectMove);
MSComctlLib_ITreeView.OLEDropEffect(interface,MSComctlLib_CONSTANTS.ccOLEDropEffectMove);
MSComctlLib_ITreeView.OLEDropEffect(interface,2);
These three ones with no succes.

Re: Treeview with images and checkboxes in forms with OLE-Container [message #468259 is a reply to message #410944] Thu, 29 July 2010 06:32 Go to previous messageGo to next message
rane_sarita333
Messages: 3
Registered: March 2008
Location: India
Junior Member
Can please tell me how to create tree with check boxes in oracle form10.

I tired to create it with PJC but idon't know swing , so i get struc.
Re: Treeview with images and checkboxes in forms with OLE-Container [message #470826 is a reply to message #468259] Wed, 11 August 2010 01:17 Go to previous message
usmanelahi
Messages: 53
Registered: July 2007
Location: Karachi
Member

could you please send me your fmb file
Previous Topic: Read data from excel and store it in blob
Next Topic: checking to see if a text item is empty
Goto Forum:
  


Current Time: Fri Dec 09 02:21:28 CST 2016

Total time taken to generate the page: 0.12344 seconds