Shared Samples

Try out source code samples stored in Bitbucket repositories.
Showing results for 
Search instead for 
Do you mean 

Application textViewMulti

by Technical Evangelist on ‎09-09-2015 07:25 AM - edited on ‎03-29-2016 11:25 AM by Anonymous (385 Views)

Example Type




To demonstrate how to write an application with Multiple Document Interface architecture (similar to that of the  IMAGINE Viewer) using ERDAS IMAGINE 8.5 Developers´ Toolkit.



textViewMulti.c (C source code)

textViewMulti.eml (EML script)

textViewMulti.rc (Resource script) (Windows Only)

resource.h (Resource header) (Windows Only)

eml.ico (ERDAS icon) (Windows Only)

textViewMulti.dsp (Visual C++ Project)(Windows Only)





The textViewMulti programming example is intended to be a ‘look-up’ example for writing applications that want to implement the multiple document interface similar to that used by the   IMAGINE Viewer and IMAGINE ImageInfo. The Multiple Document Interface allows an application to open more than one instance of itself, with each instance functionally independent of the others.  Multiple Document Interface functionality is essentially achieved by duplicating the main frame of the application using eeml_PartDup and then setting a new application context for the duplicated frame using eeml_FrameContextSet each time a new instance of the application is requested.


Additionally, this example demonstrates how an application can respond to commands sent to it by the IMAGINE Session Manager. These commands can either be typed in the command history window or passed from an associated EML script. The command processing is done using the following loop in the application’s main function:




** Start the EML Main Loop.
while (!theRoot->doneFlag)
eeml_GetNextCommand(theRoot, &context, &nargc, &nargv, &lclerr);
EERR_CHECK(lclerr, EERR_FATAL_SET_0(__LINE__, "Unable to get next command"));
** Check if this command is a recognized command
** and take appropriate action




TextViewMultiCommand((TextViewMultiClass *)context, nargc, nargv, &lclerr);

eeml_FreeCommand(nargc, nargv, &lclerr);

EERR_CHECK(lclerr, EERR_WARNING_SET_0(__LINE__,"Unable to free command"));




Finally, this example demonstrates how a developer can merge her own HTML-based help (documentation) with the existing IMAGINE documentation and refer to it from the EML script by using the showhelp EML command.


 For more information on this, please refer to EML Script portion of the Help on Help manual.



Application Function Arguments


textviewmulti [new] [loadfile <filename>]



 Open a new textviewmulti instance. No file is loaded.



 Opens a new textviewmulti instance and loads <filename> in it.


The new and loadfile options are mutually exclusive options, i.e. they cannot be used together on the same command line.








Source Code