Select Git revision
Callbacks.cpp
Forked from
gmsh / gmsh
Source project has a limited visibility.
-
Christophe Geuzaine authored
typo
Christophe Geuzaine authoredtypo
Callbacks.cpp 30.31 KiB
// $Id: Callbacks.cpp,v 1.9 2001-01-10 10:40:23 geuzaine Exp $
#include "Gmsh.h"
#include "GmshUI.h"
#include "Geo.h"
#include "Mesh.h"
#include "Draw.h"
#include "Views.h"
#include "Timer.h"
#include "Visibility.h"
#include "CreateFile.h"
#include "OpenFile.h"
#include "Context.h"
#include "GUI.h"
#include "Callbacks.h"
#include <FL/fl_file_chooser.H>
extern GUI *WID;
extern Mesh M;
extern Context_T CTX;
// Compatibility routines
int AddViewInUI(int i, char *Name, int Num){
if(i > NB_BUTT_MAX -1) return 1;
if(WID->get_context() == 2)
WID->set_context(menu_post,0);
return 0;
}
void MarkAllViewsChanged(int action){
int i;
Post_View *v;
for(i = 0 ; i< List_Nbr(Post_ViewList) ; i++){
v = (Post_View*)List_Pointer(Post_ViewList, i);
switch(action){
case 1: // toggle drawing mode
if(v->IntervalsType == DRAW_POST_ISO)
v->IntervalsType = DRAW_POST_DISCRETE ;
else if(v->IntervalsType == DRAW_POST_DISCRETE)
v->IntervalsType = DRAW_POST_CONTINUOUS ;
else
v->IntervalsType = DRAW_POST_ISO ;
break;
case 2: // time step++
if(v->TimeStep < v->NbTimeStep-1)
v->TimeStep++ ;
else
v->TimeStep = 0 ;
break;
case 3: // time step--
if(v->TimeStep > 0)
v->TimeStep-- ;
else
v->TimeStep = v->NbTimeStep-1 ;
}
v->Changed = 1 ;
}
}
void CancelMeshThread(void){
}
// Common callbacks
void cancel_cb(CALLBACK_ARGS){
if(data) ((Fl_Window*)data)->hide();