The R Project SVN R

Rev

Rev 5429 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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