📄 libfbx-box.c
字号:
/* * libfbx-box.c -- GUI box routines for libfbx * (C)opyright 2001 U4X Labs * * Written by: Michael Bourgeous <nitrogen@u4xlabs.com> * * $Id: libfbx-box.c,v 1.5 2001/01/22 07:04:08 nitroglycerine Exp $ * * This is the place for all the GUI functions responsible for * drawing boxes. * * See ChangeLog for modifications, CREDITS for credits. * * All source herein is copyright U4X Labs and its original author. * Any code modifications or additions are (C)opyright the original * author and U4X Labs respectively. * * libfbx is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * libfbx is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with libfbx; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA */#include <libfbx/libfbx.h>#include <libfbx/libfbx-gui.h>/* * Function: fb_box_proc() * Arguments: Message, dialog, argument * Returns: GUI status * Description: Draws a simple box with an outline * color and a fill color. Should never * be called by user, but instead * assigned to the behavior function * pointer in an fb_dialog struct. */int fb_box_proc(int msg, fb_dialog *d, int c){ int fg_r, fg_g, fg_b; switch(msg) { case FB_MSG_DRAW: /* TODO: handle disabled drawing */ fg_r = d->fg_r; fg_g = d->fg_g; fg_b = d->fg_g; fb_draw_box(d->x + 1, d->y + 1, d->x + d->width - 2, d->y + d->height - 2, d->bg_r, d->bg_g, d->bg_b, fb_screen); fb_rect(d->x, d->y, d->x + d->width - 1, d->y + d->height - 1, fg_r, fg_g, fg_b, fb_screen); break; } return FB_DIALOG_OK;}/* * Function: fb_shadow_box_proc() * Arguments: Message, dialog, argument * Returns: GUI status * Description: Draws a simple box, in the style of * fb_box_proc, with the addition of a * shadow. Should never be called by * the user. */int fb_shadow_box_proc(int msg, fb_dialog *d, int c){ int fg_r = 0, fg_g = 0, fg_b = 0; switch(msg) { case FB_MSG_DRAW: fb_fill_rect(d->x + 1, d->y + 1, d->x + d->width - 3, d->y + d->height - 3, d->bg_r, d->bg_g, d->bg_b, fb_screen); fb_rect(d->x, d->y, d->x + d->width - 2, d->y + d->height - 2, fg_r, fg_g, fg_b, fb_screen); fb_line(d->x + d->width - 1, d->y + 1, d->x + d->width - 1, d->y + d->height - 1, 0, 0, 0, fb_screen); fb_line(d->x + 1, d->y + d->height - 1, d->x + d->width - 1, d->y + d->height - 1, 0, 0, 0, fb_screen); break; } return FB_DIALOG_OK;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -