home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
x
/
volume10
/
contool
/
part01
/
window_misc.c
< prev
Wrap
C/C++ Source or Header
|
1990-10-30
|
3KB
|
102 lines
/************************************************************************/
/* Copyright 1988-1990 by Chuck Musciano and Harris Corporation */
/* */
/* Permission to use, copy, modify, and distribute this software */
/* and its documentation for any purpose and without fee is */
/* hereby granted, provided that the above copyright notice */
/* appear in all copies and that both that copyright notice and */
/* this permission notice appear in supporting documentation, and */
/* that the name of Chuck Musciano and Harris Corporation not be */
/* used in advertising or publicity pertaining to distribution */
/* of the software without specific, written prior permission. */
/* Chuck Musciano and Harris Corporation make no representations */
/* about the suitability of this software for any purpose. It is */
/* provided "as is" without express or implied warranty. This */
/* software may not be sold without the prior explicit permission */
/* of Harris Corporation. */
/************************************************************************/
/************************************************************************/
/* */
/* window_misc.c miscellaneous window management functions */
/* */
/************************************************************************/
#include <stdio.h>
#include <sys/param.h>
#include <sys/types.h>
#include <xview/xview.h>
#include <xview/panel.h>
#include <xview/xv_xrect.h>
#include "manifest.h"
#include "contool_ui.h"
/************************************************************************/
EXPORT void pinned_menu_notify(menu, item)
Menu menu;
Menu_item item;
{ Xv_opaque pin_window = (Xv_opaque) xv_get(menu, MENU_PIN_WINDOW);
void (*menu_notify)() = (void (*)()) xv_get(menu, MENU_GEN_PROC);
void (*item_notify)() = (void (*)()) xv_get(item, MENU_GEN_PROC);
if (pin_window && xv_get(pin_window, XV_SHOW)) {
if (menu_notify)
(*menu_notify)(menu, MENU_NOTIFY);
if (item_notify)
(*item_notify)(item, MENU_NOTIFY);
if (item_notify)
(*item_notify)(item, MENU_NOTIFY_DONE);
if (menu_notify)
(*menu_notify)(menu, MENU_NOTIFY_DONE);
}
}
/************************************************************************/
EXPORT Panel_setting file_completion(item, event)
Panel_item item;
Event *event;
{ char *p, *expand_filename();
switch (event_action(event)) {
case '\n' :
case '\r' :
case ' ' : if ((p = expand_filename(xv_get(item, PANEL_VALUE))) == NULL)
window_bell(xv_get(item, XV_OWNER));
else
xv_set(item, PANEL_VALUE, p, 0);
return(PANEL_NONE);
default : return(panel_text_notify(item, event));
}
}
/************************************************************************/
EXPORT void place_dialog(base, dialog)
Xv_opaque base;
Xv_opaque dialog;
{ Rect br, dr, sr;
sr = *((Rect *) xv_get(base, WIN_SCREEN_RECT));
frame_get_rect(base, &br);
frame_get_rect(dialog, &dr);
if (rect_right(&br) + dr.r_width < sr.r_width) {
dr.r_left = rect_right(&br);
dr.r_top = br.r_top;
}
else if (dr.r_width <= br.r_left) {
dr.r_left = br.r_left - dr.r_width;
dr.r_top = br.r_top;
}
else {
dr.r_left = br.r_left + 32;
dr.r_top = br.r_top + 32;
}
frame_set_rect(dialog, &dr);
}