Simplicty and flexibility!


tree structure


Started by afonso santos
Search
You will need to Sign In to be able to add or comment on the forum!

tree structure

Download: producaoAS.zip

Hi all,

I would like to make a tree structure as an windows explorer.

The tree structure is only due to become the visual aspect more friendly.

In fact, the main purpose is create a dynamic structure without a toolbar.

Attached please find our small application . PASS & ID are blank.

In the form t_PRODUCTS are written the guidelines concerning the “construction “ of our product based in the parts defined into form t_parts.

A product is also a record of t_parts.

Any ideas how can it be done?

Thanks all


Written by afonso santos 18/07/15 at 23:37:42 Dataease [{8}]FIVE

Re:tree structure

Hi all,

No ideas?

AS


Written by afonso santos 17/08/15 at 22:13:11 Dataease [{8}]FIVE

Re:Re:tree structure - and expectations..

Hi Afonso.

There is no limit for what you can ask for on here, but I think there need to be "realistic" expectations to how much time people can set aside to "help". Quick problems where someone is in the know, and can point you in the right direction is quick to get replies but complex problems where people have to invest time to understand what you try to accomplish will realistically "never" get a reply.

This forum is a no-obligations/no-guarantees place for exchange of ideas and knowledge but nothing more.

Our team does monitor the Forum and will offer general guidance and samples where applicable but we would never solve a specific problem for a specific customer. Our replies will always be generic and we will only do so when we think a wider population of users will benefit.

If one want to find an independent consultant or a one of our partners would like to help out for a fee, that is completely acceptable.


Written by DataEase 18/08/15 at 09:37:30 Dataease [{8}]FIVE

Re:tree structure - MoveObject() will solve this.

Download Sample!

We have been looking through our samples/tutorial database and found a Sample that might be an inspiration to what you try to accomplish.

It is basically the start of an Addressbook with company, Departments and Contacts which is organized in a three structure.

It is not a finished sample, but that might be to your benefit here.

In this sample we use a MultiRecord Form (i.e. not a form with a subform but simply a form on top of a table with a number of record objects like a table view).

In the table we have a virtual field that will calculate the indent (Position) with the following Derivation:

if (AddressType=Department,50,if (addresstype=contact, if (parrenttype=department,100,50),0))

This can of course be much more advanced.

In The AddressBook View we insert a virtual field called CurrRow in the MultiRecordObject so it get repeated for each record.

The derivation is:

GetCurrent("RowNumber")-1 

This is a new function that will read out the actual row number in the Record Grid where the Clone finds itself. We detract -1 because in a MultiRecord form the first record gets reported as 2 due to some internal design stuff. It is constant so just check out that you get the correct value.

GetCurrent("RowNumber") will not give a correct reading if read directly in OML due to another design "feature" so it need to read in a visual object, and can then be referenced in OML with CurrRow.Value.

NB! Remember that OML references GUI objects so a column need to be present in the active record to be accessible. You don't read the COLUMN from the table but the actual visible object.

In the ValueLoaded event on CurrRow we insert the following code:

define "retval" text .

define "vPosition" number .

hide() .

vPosition := Position.value .

retval := MoveObject(concat("AddressTypeImg#",CurrRow.value),vPosition,"+0") .

vPosition := vPosition+25 .

retval := MoveObject(concat("AddressListing#",CurrRow.value),vPosition,"+0") .

end 

We have now inserted the Position field from the table in the record and hidden it, but we can access the value in each clone. OML will reference objects on same "level" which is nice.

We read the value from the Position field into vPosition and then we move the two objects in the record we want to reposition to the new position with MoveObject. 

MoveObject is a general GUI function so need to know the number of the Clone it will be moving and here we pick up on the value from CurrRow. 

The reason we use "+0" in the Y-axis position is due to the fact that MoveObject can move an object relative or absolute. if you insert + and - in front of the value it is relative, if not absolute so to retain the current Y-Postion of the object we insert +0 relative. If we had left it empty it would have been read as 0 and moved the object to top.

PS! You can not move an object outside the active record, so make sure there is enough space behind the object you want to move so it don't "crash" into the end of the Record Object. If there is no room, the object won't move. Neither the field object or the record object will change size automatically, but you can change the size of both with MoveObject Size option

Look here to find out more about MoveObject and MoveObject Size option 


Written by DataEase Tech Sup 18/08/15 at 09:44:55 Dataease [{8}]FIVE
DG3_ForumList