1.18.1 Dialog

A graphic user interface(GUI) is one important part of your customized application in Origin. Creating GUI is associated with generating dialog in the Origin environment. This section demonstrates several ways to bring up dialog in Origin:

  • The simplest dialog can be generated using the Built-in dialog boxes function in Origin C (OC). the method supports several basic functionalities such as showing messages, opening files, saving files, etc.
  • If you need more controls of the dialog elements and also have some experience with OC, GetN Macros and GetNBox function in OC would be the right choice. More or less like C++, this method grants the access to each element in dialog to which you can add your own application script. GetN dialog provides an easier way to access and output data in Origin's worksheet.
  • A more automatic way to build dialog is probably using X-function builder. With this method, Origin generates dialog automatically for you and your task is merely defining the inputs and filling out spaces where your application logic is required. X-Function dialog can support Recalculate feature.
  • Python is embedded in Origin since Origin 2015. By calling Python in Origin, interactive dialog can also be generated with Python modules such as tkinter. It is very easy to learn how to build a Python dialog.
  • An even more sophisticated way would be to use Microsoft Visual C++ generated resource DLL for building floating tools, dialog boxes, and wizards in Origin. All elements in Origin, e.g. windows, worksheets, graphs can be accessed and controlled by this method. Using Visual C++ DLL dialog, you can build a very complex GUI.
  • Lastly, starting from Origin 2017, we add support for dialogs using HTML and JavaScript which adds more flexibility to making dialog that interacts with Origin. There are hundreds of third party libraries to call for HTML dialog. Using HTML dialog, you can build a very nice and complex GUI.

This section covers the following topics: