The R Project SVN R

Rev

Rev 42521 | Rev 84952 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 42521 Rev 45017
Line 33... Line 33...
33
#include "commctrl.h"
33
#include "commctrl.h"
34
#endif
34
#endif
35
 
35
 
36
static HWND intMDIStatus=0;
36
static HWND intMDIStatus=0;
37
 
37
 
38
int addstatusbar() {
38
int addstatusbar()
-
 
39
{
39
  int a[1] = {-1};
40
    int a[1] = {-1};
40
  if (!MDIFrame) return 0;
41
    if (!MDIFrame) return 0;
41
  if (MDIStatus) return 1;
42
    if (MDIStatus) return 1;
42
  if(!intMDIStatus) {
43
    if(!intMDIStatus) {
43
      InitCommonControls();
44
	InitCommonControls();
44
      intMDIStatus = CreateStatusWindow(WS_CHILD|SBARS_SIZEGRIP|WS_VISIBLE,
45
	intMDIStatus = CreateStatusWindow(WS_CHILD|SBARS_SIZEGRIP|WS_VISIBLE,
45
					"", hwndFrame, 121);
46
					  "", hwndFrame, 121);
46
      if (!intMDIStatus) return 0;
47
	if (!intMDIStatus) return 0;
47
      SendMessage(intMDIStatus,SB_SETPARTS,(WPARAM)1,(LPARAM)a);
48
	SendMessage(intMDIStatus,SB_SETPARTS,(WPARAM)1,(LPARAM)a);
48
      SendMessage(intMDIStatus,SB_SETTEXT,
49
	SendMessage(intMDIStatus,SB_SETTEXT,
49
		  (WPARAM) 0|0, (LPARAM)MDIStatusText);
50
		    (WPARAM) 0|0, (LPARAM)MDIStatusText);
50
  }
51
    }
51
  MDIStatus = intMDIStatus;
52
    MDIStatus = intMDIStatus;
52
  SendMessage(hwndFrame,WM_PAINT,(WPARAM) 0,(LPARAM) 0);
53
    SendMessage(hwndFrame,WM_PAINT,(WPARAM) 0,(LPARAM) 0);
53
  return 1;
54
    return 1;
54
}
55
}
55
 
56
 
56
int delstatusbar() {
57
int delstatusbar()
-
 
58
{
57
  if (!MDIFrame) return 0;
59
    if (!MDIFrame) return 0;
58
  MDIStatus = 0; /* handle_mdiframeresize notices this */
60
    MDIStatus = 0; /* handle_mdiframeresize notices this */
59
  SendMessage(hwndFrame,WM_PAINT,(WPARAM) 0,(LPARAM) 0);
61
    SendMessage(hwndFrame,WM_PAINT,(WPARAM) 0,(LPARAM) 0);
60
  return 1;
62
    return 1;
61
}
63
}
62
 
64
 
63
PROTECTED void updatestatus(const char *text) {
65
PROTECTED void updatestatus(const char *text)
-
 
66
{
64
    /* strncpy(MDIStatusText, text, 255); */
67
    /* strncpy(MDIStatusText, text, 255); */
65
  if (!MDIStatus) return;
68
    if (!MDIStatus) return;
66
  SendMessage(MDIStatus,SB_SETTEXT,
69
    SendMessage(MDIStatus,SB_SETTEXT,
67
	      (WPARAM) 0|0, (LPARAM)MDIStatusText);
70
		(WPARAM) 0|0, (LPARAM)MDIStatusText);
68
  SendMessage(MDIStatus, WM_PAINT, (WPARAM)0, (LPARAM)0);
71
    SendMessage(MDIStatus, WM_PAINT, (WPARAM)0, (LPARAM)0);
69
}
72
}
70
 
73
 
71
void setstatus(const char *text) {
74
void setstatus(const char *text)
-
 
75
{
72
  strncpy(MDIStatusText, text, 255);
76
    strncpy(MDIStatusText, text, 255);
73
  if (!MDIStatus || !current_window) return;
77
    if (!MDIStatus || !current_window) return;
74
  strncpy(current_window->status, text, 255);
78
    strncpy(current_window->status, text, 255);
75
  updatestatus(text);
79
    updatestatus(text);
76
}
80
}