home *** CD-ROM | disk | FTP | other *** search
- /************************************************************************/
- /* Copyright 1988, 1989 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. */
- /************************************************************************/
-
- #include <stdio.h>
-
- #include <suntool/sunview.h>
- #include <suntool/panel.h>
- #include <suntool/scrollbar.h>
-
- #include "contool.h"
- #include "entry.h"
-
- #define shift(item, amt) panel_set(item, PANEL_ITEM_X, (int) panel_get(item, PANEL_ITEM_X) + amt, 0)
-
- PUBLIC Panel other;
-
- PRIVATE e_rec defaults = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, FALSE};
-
- /************************************************************************/
- EXPORT update_defaults()
-
- { int x, y, amt;
- Pixrect *image;
- Scrollbar temp;
-
- if (!defaults.created) {
- create_entry(other, &defaults, 0);
- panel_set(other, WIN_VERTICAL_SCROLLBAR, temp = scrollbar_create(0), 0);
- if ((Scrollbar_setting) scrollbar_get(temp, SCROLL_PLACEMENT) == SCROLL_WEST) {
- amt = (int) scrollbar_get(temp, SCROLL_WIDTH);
- shift(defaults.handle, amt);
- shift(defaults.save, amt);
- shift(defaults.stamp, amt);
- shift(defaults.open, amt);
- shift(defaults.flash, amt);
- shift(defaults.beep, amt);
- shift(defaults.lines, amt);
- shift(defaults.start, amt);
- shift(defaults.end, amt);
- }
- panel_set(other, WIN_VERTICAL_SCROLLBAR, NULL, 0);
- scrollbar_destroy(temp);
- eliminate(defaults.handle);
- eliminate(defaults.lines);
- eliminate(defaults.end);
- x = (int) panel_get(defaults.save, PANEL_ITEM_X);
- y = (int) panel_get(defaults.save, PANEL_ITEM_Y);
- eliminate(defaults.save);
- defaults.save = panel_create_item(other, PANEL_MESSAGE,
- PANEL_LABEL_IMAGE, &save_pix,
- PANEL_ITEM_X, x,
- PANEL_ITEM_Y, y,
- 0);
- x = (int) panel_get(defaults.start, PANEL_ITEM_X);
- y = (int) panel_get(defaults.start, PANEL_ITEM_Y);
- eliminate(defaults.start);
- defaults.start = panel_create_item(other, PANEL_MESSAGE,
- PANEL_LABEL_STRING, "All other messages",
- PANEL_LABEL_FONT, bold,
- PANEL_ITEM_X, x,
- PANEL_ITEM_Y, y,
- 0);
- defaults.created = TRUE;
- }
- panel_set(defaults.beep, PANEL_VALUE, beep_amount, 0);
- panel_set(defaults.flash, PANEL_VALUE, blink_icon, 0);
- panel_set(defaults.open, PANEL_VALUE, pop_open, 0);
- panel_set(defaults.stamp, PANEL_VALUE, do_time_stamp, 0);
- }
-
- /************************************************************************/
- EXPORT install_defaults()
-
- {
- beep_amount = (int) panel_get(defaults.beep, PANEL_VALUE);
- blink_icon = (int) panel_get(defaults.flash, PANEL_VALUE);
- pop_open = (int) panel_get(defaults.open, PANEL_VALUE);
- do_time_stamp = (int) panel_get(defaults.stamp, PANEL_VALUE);
- }
-