2 /**************************************************************************
3 ** (c) Copyright 1998, Andromeda Technology & Automation
4 ***************************************************************************
5 ** MODULE INFORMATION *
6 ***********************
7 ** FILE NAME : frame.cpp
8 ** SYSTEM NAME : AXE - Andromeda X-windows Encapsulation
9 ** VERSION NUMBER : $Revision: 1.1 $
11 ** DESCRIPTION : Implementation of class frame
16 ***************************************************************************
17 ** ADMINISTRATIVE INFORMATION *
18 ********************************
19 ** ORIGINAL AUTHOR : Arjen Baart - arjen@andromeda.nl
20 ** CREATION DATE : Mar 07, 1998
21 ** LAST UPDATE : Mar 07, 1998
23 **************************************************************************/
25 /*****************************
27 Revision 1.1 2002-07-25 08:01:27 arjen
28 First checkin, AXE release 0.2
30 *****************************/
32 static const char *RCSID = "$Id: frame.cpp,v 1.1 2002-07-25 08:01:27 arjen Exp $";
36 /*=========================================================================
37 ** NAME : EV_Expose - Handle Expose event.
49 **=========================================================================
52 int frame::EV_Expose(XExposeEvent ev)
60 /*=========================================================================
61 ** NAME : draw_effect - Draw the border effects in a frame
73 **=========================================================================
76 void frame::draw_effect(void)
78 gc *top_gc, *bottom_gc;
85 top_gc = &light_3D_gc;
86 bottom_gc = &dark_3D_gc;
92 bottom_gc = &light_3D_gc;
97 for (int i=0; i< thick; i++)
99 XDrawLine(stddpy, ID(), *top_gc, i, i, i, h-i);
100 XDrawLine(stddpy, ID(), *top_gc, i, i, w-i, i);
102 XDrawLine(stddpy, ID(), *bottom_gc, i, h-i, w-i, h-i);
103 XDrawLine(stddpy, ID(), *bottom_gc, w-i, i, w-i, h-i);
109 /*=========================================================================
110 ** NAME : place_text - Place aligned text in a frame
122 **=========================================================================
125 void frame::place_text(void)
140 x = (w - default_font.TextWidth(text)) / 2;
144 x = w - default_font.TextWidth(text) - strength;
154 y = default_font.ascent() + strength;
158 space = (h - (default_font.ascent() + default_font.descent())) / 2;
159 y = space + default_font.ascent();
163 y = h - default_font.descent() - strength;
168 XDrawString(stddpy, ID(), menu_normal_gc, x, y, text, strlen(text));