Page 1 of 2

Treeview and XML

Posted: Mon Jan 22, 2024 6:57 pm
by papiosaur
Hello,

is there functions to load a XML file in a window with Treeview class, do modifications then save the XML file?

Thanks for your answer.

Re: Treeview and XML

Posted: Mon Jan 22, 2024 7:57 pm
by plouf
yes, there is XML plugin who can parse xml documents

however you then manually insert data to treeview or anywhere else

Re: Treeview and XML

Posted: Mon Jan 22, 2024 8:52 pm
by papiosaur
Thanks plouf, i will investigate about this XML plugin.

Re: Treeview and XML

Posted: Fri Jan 26, 2024 10:12 am
by papiosaur
Hello,

i read documentation of XML plugin but unfortunnaly i understand how to edit a value in a treeview...

My colums are editable (editablenodes="true") but when double-clicking, nothing append... (under MorphOS).

it work in listview mode.

Thanks for your help.

Re: Treeview and XML

Posted: Fri Jan 26, 2024 12:34 pm
by papiosaur
New question, is it possible to have a selection gadget in a treeview (and listview)?

Thanks for your answer.

Re: Treeview and XML

Posted: Fri Jan 26, 2024 1:50 pm
by papiosaur
i have a strange thing:

When i click on a button 'Edit', i get the entries of a line in "textentry" cases.

If the same lines of code by clicling on the line of the treeview with:

Case "Active"
Switch msg.id
Case "treeview"
...

I get "Cannot find MOAI object "Off"!"

What is this object "Off"?

Re: Treeview and XML

Posted: Fri Jan 26, 2024 2:00 pm
by plouf
papiosaur wrote: Fri Jan 26, 2024 10:12 am i read documentation of XML plugin but unfortunnaly i understand how to edit a value in a treeview...
XML plugin is there to help you read XML files and save them back, has nothing to do with treeview or any RapaGUI,
data you import from XML are there for your code to do it manually
papiosaur wrote: Fri Jan 26, 2024 10:12 am My colums are editable (editablenodes="true") but when double-clicking, nothing append... (under MorphOS).
example ?
papiosaur wrote: Fri Jan 26, 2024 12:34 pm New question, is it possible to have a selection gadget in a treeview (and listview)?
what is a "selection gadget" ? , if you mean to have some kind of excel style "blue border" i think not,

papiosaur wrote: Fri Jan 26, 2024 1:50 pm i have a strange thing:

When i click on a button 'Edit', i get the entries of a line in "textentry" cases.

If the same lines of code by clicling on the line of the treeview with:

Case "Active"
Switch msg.id
Case "treeview"
...

I get "Cannot find MOAI object "Off"!"

What is this object "Off"?
Example... most probably you have a typograph error and you have create an object "off" , while you think you set an option off somewhere.. womehow

Re: Treeview and XML

Posted: Fri Jan 26, 2024 2:26 pm
by papiosaur
XML plugin is there to help you read XML files and save them back, has nothing to do with treeview or any RapaGUI,
data you import from XML are there for your code to do it manually
Yes, but how to edit data in a treeview please?
its editable , not editablenodes
it's "editable" for colums option but "editablenodes" for treeview class
what is a "selection gadget" ?
i speak about the choice class, sorry.
Example... most probably you have a typograph error and you have create an object "off" , while you think you set an option off somewhere.. womehow
i will search... but bizarre it work with "Edit" button and not when i click on the row...

Re: Treeview and XML

Posted: Fri Jan 26, 2024 2:43 pm
by plouf
papiosaur wrote: Fri Jan 26, 2024 2:26 pm
XML plugin is there to help you read XML files and save them back, has nothing to do with treeview or any RapaGUI,
data you import from XML are there for your code to do it manually
Yes, but how to edit data in a treeview please?
its editable , not editablenodes
it's "editable" for colums option but "editablenodes" for treeview class
in the past, i have confuse this query again :)
btw is this not selecteable in Morphos ? i double click My tasts or Open tast and it does
(ps i manualy enable editing in "Tasks" to see if it works

Code: Select all

xml$ = [[
<?xml version="1.0" encoding="iso-8859-1"?>
<application id="app">
					
	<window id="win" title="Tasks" height="400" width="400">
		<vgroup>
			<treeview id="tv" height="250" notify="active" EditableNodes="true">
				<column title="first "/>
				<column title="Second"/>
				
				<node id="tasks" name="My Tasks" >
					<node id="open" name="Open Tasks" >
			
					</node>	
				</node>
			</treeview>
	
		</vgroup>
	</window>
</application>
]]

@REQUIRE "RapaGUI"

moai.CreateApp(xml$)


InstallEventHandler({RapaGUI = p_EventFunc})

moai.DoMethod("tv", "open", "root", True)
;Open Tasks
moai.DoMethod("tv", "insertleaf", 0 , "open", "Tail", "1-1", "1-2" )
moai.DoMethod("tv", "insertleaf", 1 , "open", "Tail", "1-2","2-2")
moai.DoMethod("tasks", "Edit")

; main loop!
Repeat
	WaitEvent
Forever

Re: Treeview and XML

Posted: Fri Jan 26, 2024 2:55 pm
by papiosaur
When i execute your code, it write: Cannot find MOAI object "tasks"' error line 34

I have tried to change object name but he don't find any object...

Maybe Edit mode is "Off" on MorphOS :-)