home *** CD-ROM | disk | FTP | other *** search
- /*
- bdbar.c 8/02/88
-
- % border with scroll bar.
-
- OWL 1.2
- Copyright (c) 1988, by Oakland Group, Inc.
- ALL RIGHTS RESERVED.
-
- Revision History:
- -----------------
- 9/12/88 jmd Added in and out data
- 11/13/88 jmd Upgraded to new border stuff
- 11/20/88 jmd Added ID to obj struct
- 12/20/88 jmd removed SETSIZE msg
-
- 5/28/89 jmd added Shadow support
- 8/24/89 jmd chnaged some ints to booleans
-
- 11/06/89 jmd removed DoRaw macros
- 2/21/90 ted Added SetCharSize(TRUE) because border won't work otherwise.
- 3/28/90 jmd ansi-fied
- */
-
- #include "oakhead.h"
- #include "disppriv.h"
- #include "bordobj.h"
- #include "bordod.h"
-
- #define OUTER_BOX "\332\304\277\263\331\304\300\263"
-
- #ifdef BORDER_CHARS
- #define SCROLL_BAR "\261\261\261"
- #else
- #define SCROLL_BAR "XXX"
- #endif
-
- /* border object data */
-
- typedef struct _bdbarod {
- border_od bdd; /* border object super class */
- } bdbar_od;
-
- int bd_bar(VOID *objdata, int msg, VOID *indata, VOID *outdata)
- /*
- */
- {
- bdbar_od *bdbd;
- ocbox cbox;
- ptd_struct *ptd;
- boolean top, bottom; /* dummy values */
- byte attr;
-
- bdbd = (bdbar_od *)objdata;
-
- switch(msg) {
- case OBJM_GETDATASIZE:
- ((ogds_struct *) outdata)->odsize = sizeof(bdbar_od);
- ((ogds_struct *) outdata)->xdsize = sizeof(border_xd);
- ((ogds_struct *) outdata)->id = ID_BDBAR;
- break;
-
- case OBJM_OPEN:
- if (!border_Class(&bdbd->bdd, msg, indata, outdata)) {
- return(FALSE);
- }
- win_SetCharSize(bdbd->bdd.win, TRUE); /* This bord must be charsize */
- bord_SetSides(bdbd->bdd.win, -1, -1, 1, 1);
- break;
-
- case BDM_SCROLL:
- /* repaint the scroll bar */
- cbox.toprow = 0;
- cbox.leftcol = win_GetWidth(bdbd->bdd.win);
- cbox.botrow = win_GetHeight(bdbd->bdd.win) - 1;
- cbox.rightcol = cbox.leftcol;
- win_PaintBox(bdbd->bdd.win, &cbox);
- break;
-
- case BDM_SHADOW:
- case BDM_DRAW:
- /* draw the border */
- ptd = (ptd_struct *)indata;
-
- attr = (msg == BDM_DRAW) ?
- bord_GetAttr(bdbd->bdd.win) : win_GetShadowAttr(bdbd->bdd.win);
-
- /* draw the box */
- bord_GetBox(bdbd->bdd.win, &cbox);
- ptd_DrawCharBox(ptd, OUTER_BOX, &cbox, attr);
-
- /* draw the scroll bar */
- cbox.toprow = 0;
- cbox.leftcol = win_GetWidth(bdbd->bdd.win);
- cbox.botrow = win_GetHeight(bdbd->bdd.win) - 1;
- cbox.rightcol = cbox.leftcol;
-
- bord_GetVtBar(bdbd->bdd.win, &cbox.toprow, &cbox.botrow, &top, &bottom);
- ptd_DrawCharLine(ptd, SCROLL_BAR, &cbox, attr);
-
- /* else no break; pass message up to superclass */
-
- default:
- /* pass messages up to border super class */
- return(border_Class(&bdbd->bdd, msg, indata, outdata));
- }
- return(1);
- }
- /* -------------------------------------------------------------------------- */
-
-