PEARL Procedures rev-distro-3.1.0-0-gea838b3-dirty
Igor procedures for the analysis of PEARL data
Loading...
Searching...
No Matches
pearl-gui-tools.ipf
Go to the documentation of this file.
1#pragma TextEncoding = "UTF-8"
2#pragma rtGlobals=3 // Use modern global access method and strict wave access.
3#pragma IgorVersion = 6.1
4#pragma ModuleName = PearlGuiTools
5#pragma version = 1.01
6
7// Miscellaneous GUI tools
8// * progress bar
9
10// created: matthias.muntwiler@psi.ch, 2013-11-14
11// Copyright (c) 2013 Paul Scherrer Institut
12// $Id$
13
14// Licensed under the Apache License, Version 2.0 (the "License");
15// you may not use this file except in compliance with the License.
16// You may obtain a copy of the License at
17// http://www.apache.org/licenses/LICENSE-2.0
18
19function display_progress_panel(title, message, progress_max)
20 string title
21 string message
22 variable progress_max
23
24 NewPanel /K=1 /N=ProgressPanel /W=(200,200,402,260) as title
25 TitleBox t_message,pos={2,2},size={189,13},title=message
26 TitleBox t_message,frame=0
27 ValDisplay vd_progress,pos={2,20},size={198,13}
28 ValDisplay vd_progress,limits={0,progress_max,0},barmisc={0,0},mode= 3,value= _NUM:0
29 Button b_abort,pos={74,38},size={50,20},title="Abort"
30 DoUpdate /W=ProgressPanel /E=1
31end
32
33function update_progress_panel(progress, [message, progress_max])
34 // returns true if the user clicked the Abort button
35 variable progress
36 string message
37 variable progress_max
38
39 if (!ParamIsDefault(message))
40 TitleBox t_message,title=message,win=ProgressPanel
41 endif
42 if (ParamIsDefault(progress_max))
43 ValDisplay vd_progress,value=_NUM:progress,win=ProgressPanel
44 else
45 ValDisplay vd_progress,limits={0,progress_max,0},value=_NUM:progress,win=ProgressPanel
46 endif
47 DoUpdate /W=ProgressPanel
48 return (v_flag == 2)
49end
50
52 KillWindow ProgressPanel
53end
variable update_progress_panel(variable progress, string message=defaultValue, variable progress_max=defaultValue)
variable display_progress_panel(string title, string message, variable progress_max)
variable kill_progress_panel()