add to TreeNode the name of the active graph page and the active layer number
set the given layer to be active layer, if page not open, will open it to be active page as well
bool set_active_layer( TreeNode & trNode )
bool set_active_layer( Layer & layr )
TRUE if the active layer is a graphic layer, FALSE if no active graph layer available
true if successful
EX1
//This example show the info. of the curve. //For this sample to work, active layer should exist and is graphLayer. void set_active_layer_ex1() { GraphLayer gl = Project.ActiveLayer(); if(gl) { Tree trNode; bool bOK = set_active_layer(trNode); if(bOK) { out_tree(trNode); } } }
EX2
void set_active_layer_ex2() { GraphPage gp; gp.Create(); printf("Active layer is :%s\n", Project.ActiveLayer().GetName()); WorksheetPage wksPage; wksPage.Create("Origin"); printf("Active layer is :%s\n", Project.ActiveLayer().GetName()); GraphLayer gl = gp.Layers(0); set_active_layer(gl); printf("Active layer is :%s\n", Project.ActiveLayer().GetName()); }
get_graph_layer
origin.h