The R Project SVN R

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4394 ripley 1
/*
2
 *  R : A Computer Language for Statistical Data Analysis
3
 *  Copyright (C) 1999  Guido Masarotto
4
 *
5
 *  This program is free software; you can redistribute it and/or modify
6
 *  it under the terms of the GNU General Public License as published by
7
 *  the Free Software Foundation; either version 2 of the License, or
8
 *  (at your option) any later version.
9
 *
10
 *  This program is distributed in the hope that it will be useful,
11
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 *  GNU General Public License for more details.
14
 *
15
 *  You should have received a copy of the GNU General Public License
16
 *  along with this program; if not, write to the Free Software
5458 ripley 17
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
4394 ripley 18
 */
19
 
20
/*
21
 *  int addstatusbar()  - add a simple status bar to the mdi frame
22
 *  void setstatus(char *text) - set text
23
 */
24
 
25
/*
26
   This file is an add-on  to GraphApp, a cross-platform C graphics library.
27
 */
28
 
29
#include "internal.h"
30
 
31
static char MDIStatusText[256] = "" ;
5429 ripley 32
#ifndef SBARS_SIZEGRIP
33
#include "commctrl.h"
34
#endif
4394 ripley 35
 
36
int addstatusbar() {
37
  int a[1]={-1};
38
  if (!MDIFrame) return 0;
39
  if (MDIStatus) return 1;
40
  InitCommonControls();
41
  MDIStatus = CreateStatusWindow(WS_CHILD|SBARS_SIZEGRIP|WS_VISIBLE,
42
	"",hwndFrame,121);
43
  if (!MDIStatus) return 0;
44
  SendMessage(MDIStatus,SB_SETPARTS,(WPARAM)1,(LPARAM)a);
45
  return 1;
46
}
47
 
48
 
49
 
50
PROTECTED void updatestatus(char *text) {
51
  if (!MDIStatus) return;
52
  strncpy(MDIStatusText,text,255);
53
  SendMessage(MDIStatus,SB_SETTEXT,
54
            (WPARAM) 0|0,(LPARAM)MDIStatusText);
55
  SendMessage(MDIStatus,WM_PAINT,(WPARAM)0,(LPARAM)0);
56
}
57
 
58
void setstatus(char *text) {
59
  if (!MDIStatus || !current_window) return;
60
  strncpy(current_window->status,text,255);
61
  updatestatus(text);
62
}
63
 
64
 
65
 
66
 
67
 
68
 
69
 
70
 
71
 
72
 
73
 
74
 
75