X-Function, Create Graph Browser Dialog
This example demonstrates how to add a button to open the Graph Browser dialog to pick a graph in the X-Function GetN dialog, and then how to customize the Graph Browser dialog by filter function.
The following three steps will show how to add a button in the X-Function dialog to open a Graph Browser dialog without the use of a filter function. This is the simplest process, and all settings in the Graph Browser dialog will be set to their defaults.
#include <..\Originlab\GraphFilter.h> // this is an Origin built-in file int GraphBrowserFilter(int nMsg, Page& pg = NULL) { switch(nMsg) { case GBFM_IS_USE_PAGE: // return 1 for true. if(!pg) return -1; // filter page including multiple layers return pg.Layers.Count() > 1? 0 : 1; case GBFM_SHOW_EMBED_PAGE_CHKBOX: // see other options in GraphFilter.h return EMBED_CHECKBOX_ENABLE; case GBFM_SHOW_SWITCH_MODE: // see other options in GraphFilter.h return VIEW_MODE_BOTH_WITH_TREE_DEFAULT; case GBFM_SORT_PAGES: return 1; // return 0 or 1 } return -1; // error }
//Case 1. if header file is located in the OriginC\Originlab\ folder //put additional include files here #include <..\Originlab\MyGraphFilter.h> //Case 2. if header file is NOT located in the OriginC\Originlab\ folder //put additional include files here #include "D:\MyFolder\MyGraphFilter.h"