1 | /*--------------------------------*-C-*---------------------------------* |
1 | /*--------------------------------*-C-*---------------------------------* |
2 | * File: scrollbar-xterm.c |
2 | * File: scrollbar-xterm.c |
3 | *----------------------------------------------------------------------* |
3 | *----------------------------------------------------------------------* |
4 | * $Id: scrollbar-xterm.C,v 1.1 2003/11/24 17:28:08 pcg Exp $ |
4 | * $Id: scrollbar-xterm.C,v 1.3 2003/11/25 11:52:42 pcg Exp $ |
5 | * |
5 | * |
6 | * Copyright (c) 1997,1998 mj olesen <olesen@me.QueensU.CA> |
6 | * Copyright (c) 1997,1998 mj olesen <olesen@me.QueensU.CA> |
7 | * Copyright (c) 1999-2001 Geoff Wing <gcw@pobox.com> |
7 | * Copyright (c) 1999-2001 Geoff Wing <gcw@pobox.com> |
8 | * |
8 | * |
9 | * This program is free software; you can redistribute it and/or modify |
9 | * This program is free software; you can redistribute it and/or modify |
… | |
… | |
52 | } |
52 | } |
53 | gcvalue.fill_style = FillOpaqueStippled; |
53 | gcvalue.fill_style = FillOpaqueStippled; |
54 | gcvalue.foreground = R->PixColors[Color_fg]; |
54 | gcvalue.foreground = R->PixColors[Color_fg]; |
55 | gcvalue.background = R->PixColors[Color_bg]; |
55 | gcvalue.background = R->PixColors[Color_bg]; |
56 | |
56 | |
57 | R->h->xscrollbarGC = XCreateGC(R->Xdisplay, R->scrollBar.win, |
57 | R->xscrollbarGC = XCreateGC(R->Xdisplay, R->scrollBar.win, |
58 | GCForeground | GCBackground |
58 | GCForeground | GCBackground |
59 | | GCFillStyle | GCStipple, &gcvalue); |
59 | | GCFillStyle | GCStipple, &gcvalue); |
60 | gcvalue.foreground = R->PixColors[Color_border]; |
60 | gcvalue.foreground = R->PixColors[Color_border]; |
61 | R->h->ShadowGC = XCreateGC(R->Xdisplay, R->scrollBar.win, GCForeground, |
61 | R->ShadowGC = XCreateGC(R->Xdisplay, R->scrollBar.win, GCForeground, |
62 | &gcvalue); |
62 | &gcvalue); |
63 | } |
63 | } |
64 | /* instead of XClearWindow (R->Xdisplay, R->scrollBar.win); */ |
64 | /* instead of XClearWindow (R->Xdisplay, R->scrollBar.win); */ |
65 | xsb = (R->Options & Opt_scrollBar_right) ? 1 : 0; |
65 | xsb = (R->Options & Opt_scrollBar_right) ? 1 : 0; |
66 | if (last_top < R->scrollBar.top) |
66 | if (last_top < R->scrollBar.top) |
… | |
… | |
72 | XClearArea(R->Xdisplay, R->scrollBar.win, |
72 | XClearArea(R->Xdisplay, R->scrollBar.win, |
73 | R->sb_shadow + xsb, R->scrollBar.bot, |
73 | R->sb_shadow + xsb, R->scrollBar.bot, |
74 | sbwidth + 1, (last_bot - R->scrollBar.bot), False); |
74 | sbwidth + 1, (last_bot - R->scrollBar.bot), False); |
75 | |
75 | |
76 | /* scrollbar slider */ |
76 | /* scrollbar slider */ |
77 | XFillRectangle(R->Xdisplay, R->scrollBar.win, R->h->xscrollbarGC, |
77 | XFillRectangle(R->Xdisplay, R->scrollBar.win, R->xscrollbarGC, |
78 | xsb + 1, R->scrollBar.top, sbwidth, scrollbar_len); |
78 | xsb + 1, R->scrollBar.top, sbwidth, scrollbar_len); |
79 | |
79 | |
80 | /*XDrawLine(R->Xdisplay, R->scrollBar.win, R->h->ShadowGC, |
80 | /*XDrawLine(R->Xdisplay, R->scrollBar.win, R->ShadowGC, |
81 | xsb ? 0 : sbwidth, R->scrollBar.beg, |
81 | xsb ? 0 : sbwidth, R->scrollBar.beg, |
82 | xsb ? 0 : sbwidth, R->scrollBar.end);*/ |
82 | xsb ? 0 : sbwidth, R->scrollBar.end);*/ |
83 | return 1; |
83 | return 1; |
84 | } |
84 | } |
85 | #endif /* XTERM_SCROLLBAR */ |
85 | #endif /* XTERM_SCROLLBAR */ |