Component index
Section index

Component framework


	    This shows how a multi-document editor can resume operation
	    from one session to the other. The trick is to use setdocumentid
	    to record a meaningful info about the document and getdocumentids()
	    to learn about all active document at the end of the session.
	    We will show a simple multi document editor. Note it can't save
	    anything to disk.
	static void sample_docid(int argc, char *argv[])
	    <obj FRAMEWORK frm>("restart documents");
	    <f area1>
	        SSTRING *name = (SSTRING*);
	        setdocumentid (name->get());
	        DIALOG dia;
	        info.msgs.waitfor (dia);
	        glocal SSTRING tmp;
	        <call loadfile>(name->get(),false);
	        <f oneline>
	            glocal.tmp.append (line);
	        dia.newf_textarea (NULL,glocal.tmp,60,20);
	        int nof = 0;
	        while (1){
	            MENU_STATUS code = dia.edit (name->get(),"",help_none,nof,0);
	            if (code == MENU_MESSAGE){
	                if (info.msgs.is_ending()){
	                }else if (info.msgs.is_mayend()){
	        delete name;
	    if (argc == 0){
	        // We reload all the documents
	        SSTRINGS tb;
	        linuxconf_getall ("document","list",tb,false);
	        for (int i=0; i<tb.getnb(); i++){
	            frm.newdocument (new SSTRING(tb.getitem(i)));
	        // we load the documents from the command line
	        for (int i=0; i<argc; i++){
	            frm.newdocument (new SSTRING(argv[i]));
	        // We save the list for the next session
	        SSTRINGS tb;
	        linuxconf_replace ("document","list",tb);