⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 badctrls.h

📁 SEAL是DOS 下的32位保护模式的GUI程序
💻 H
📖 第 1 页 / 共 2 页
字号:
/******************************************************************
 * SEAL 2.0                                                       *
 * Copyright (c) 1999-2002 SEAL Developers. All Rights Reserved.  *
 *                                                                *
 * Web site: http://sealsystem.sourceforge.net/                   *
 * E-mail (current maintainer): orudge@users.sourceforge.net      *
 ******************************************************************/

/*
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

   This program 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 General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

/****************************************************************/
/*                                                              */
/*                          badctrls.h                          */
/*                     Bad Controls for SEAL                    */
/*                            v0.4.2                            */
/*                                                              */
/*      (c) 2000, 2001 Kostas Michalopoulos aka Bad Sector      */
/*         first version for Bad Seal | www.badseal.org         */
/*                                                              */
/* ============================================================ */
/*  Controls included:                                          */
/*    t_bad_checkbox                          Checkbox control  */
/*    t_bad_button                        t_button replacement  */
/*    t_bad_vtrackbar                        vertical trackbar  */
/*    t_bad_tabbook                                   tab book  */
/*    t_bad_iconbox                         box with icons :-)  */
/*    t_bad_vscrollbar                      vertical scrollbar  */
/* ============================================================ */
/*                                                              */
/*                Seal - free desktop environment               */
/*                                                              */
/*                    Copyright (c) 1999,2000                   */
/*                         Michal Stencl                        */
/*                     All Rights Reserved                      */
/*                                                              */
/* mail : stenclpmd@ba.telecom.sk                               */
/* web  : http://www.home.sk/public/seal/                       */
/*                                                              */
/* This file is part of Seal.                                   */
/*                                                              */
/* Seal is free software; you can redistribute it and/or        */
/* modify it under the terms of the GNU General Public License  */
/* as published by the Free Software Foundation; either version */
/* 2, or (at your option) any later version.                    */
/*                                                              */
/* Seal 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 General Public License for more details.             */
/*                                                              */
/* You should have received a copy of the GNU General Public    */
/* License along with Seal; see the file COPYING.  If not,      */
/* write to the Free Software Foundation, 675 Mass Ave,         */
/* Cambridge, MA 02139, USA.                                    */
/*                                                              */
/****************************************************************/

#ifndef __BADCTRL_H_INCLUDED__
#define __BADCTRL_H_INCLUDED__

#ifdef __cplusplus
extern "C" {
#endif

/* common palette for Bad Controls
 0 3d face
 1 3d light
 2 3d shadow
 3 3d dark
 4 3d border
 5 text color
 6 flat color
 7 flat border
 8 highlight
 9 highlight text
10 iconbox text
11 filebox background
12 filebox text
*/

extern l_color pal_bad_common[];

/* this draws a bevel with upper left color "c1" and bottom right color "c2" */
void draw_bevel(BITMAP *out, int x1, int y1, int x2, int y2, int c1, int c2);

#define BCB_UNCHECKED 0
#define BCB_CHECKED 1
#define BCB_GRAYED 2

#define BBS_SEAL 0
#define BBS_BADSEAL 1
#define BBS_KDE 2
#define BBS_WIN95 3
#define BBS_WIN31 4
#define BBS_MODERN 5
#define BBS_LIQUID 6

/* makes iconbox to place icons in horizontal order (default is vertical) */
#define BIB_PLACE_HORIZONTAL  0x00000001
/* iconbox contains a background image */
#define BIB_BACKGROUND_IMAGE  0x00000002
/* place background image like desktop */
#define BIB_DESKTOP_PLACEMENT 0x00000004
/* add a 3d border around the iconbox */
#define BIB_3D_BORDER         0x00000008
/* add a vertical scrollbar to the iconbox */
#define BIB_VER_SCROLLBAR     0x00000010

/* doesn't draw the 3D border around the scrollbar */
#define BSB_NO_3D_BORDER      0x00000001

/* standard bad scrollbar width and bar minimum size */
#define BAD_SCROLLBAR_WIDTH     15
#define BAD_SCROLLBAR_MIN_SIZE  25

typedef struct t_bad_checkbox *p_bad_checkbox;
typedef struct t_bad_button *p_bad_button;
typedef struct t_bad_vtrackbar *p_bad_vtrackbar;
typedef struct t_bad_tabbook *p_bad_tabbook;
typedef struct t_bad_iconbox *p_bad_iconbox;
typedef struct t_bad_vscrollbar *p_bad_vscrollbar;

/* t_bad_checkbox */
typedef struct t_bad_checkbox
{
  struct t_view obclass;

  l_int state;                  /* 0=unchecked, 1=checked, 2=disabled */
  l_bool grayed;                /* 0=no, 1=yes */
  l_text caption;               /* Checkbox's caption */

  l_dword message;              /* if checkbox checked or unchecked then
                                  this message occurs */

  void (*draw_state)(p_bad_checkbox o, l_int astate);
  void (*change_state)(p_bad_checkbox o, l_int newstate);
  void (*change_caption)(p_bad_checkbox o, l_text newcap);
} t_bad_checkbox;

#define BAD_CHECKBOX(o) ((p_bad_checkbox)(o))

/* functions for bad_checkbox */

/* destroys the control */
l_bool bad_checkbox_done(p_object o);

/* changes control's state and redraws the control */
void bad_checkbox_set_state(p_object o, l_dword st, l_bool set);

/* handles events for checkbox */
void bad_checkbox_translate_event(p_object o, t_event *event);

/* draws the checkbox */
void bad_checkbox_draw(p_view o);

/* draws the checkbox's state (checked, unchecked, disabled/grayed) */
void bad_checkbox_draw_state(p_bad_checkbox o, l_int astate);

/* changes checkbox's state (0=unchecked, 1=checked, 2=grayed) */
void bad_checkbox_change_state(p_bad_checkbox o, l_int newstate);

/* changes checkbox's caption (you don't need to allocate memory here) */
void bad_checkbox_change_caption(p_bad_checkbox o, l_text newcap);

/* creates a t_bad_checkbox object in area defined by "r", using caption "cap",
  message "msg" and state "st".

  this automatically allocates memory for the caption.
*/

p_bad_checkbox _bad_checkbox_init(p_bad_checkbox o, t_rect r, l_text cap, l_dword msg, l_int st);
extern p_bad_checkbox (*bad_checkbox_init)(p_bad_checkbox o, t_rect r, l_text cap, l_dword msg, l_int st);


/* t_bad_button */
typedef struct t_bad_button
{
  struct t_view obclass;

  l_int state;                  /* 0=normal, 1=pressed, 2=disabled */
  l_int style;                  /* Button's style (look BBS_xx values) */
  l_text caption;               /* Button's caption */
  l_bool switch_button;         /* if True then button acts like a checkbox */

  l_dword message;              /* if button is pressed then this message occurs */

  void (*draw_state)(p_bad_button o, l_int astate);
  void (*change_state)(p_bad_button o, l_int newstate);
  void (*change_style)(p_bad_button o, l_int newstyle);
  void (*change_caption)(p_bad_button o, l_text newcap);
} t_bad_button;

#define BAD_BUTTON(o) ((p_bad_button)(o))

/* functions for bad_button */

/* destroys the control */
l_bool bad_button_done(p_object o);

/* changes control's state and redraws the control */
void bad_button_set_state(p_object o, l_dword st, l_bool set);

/* handles events for the button */
void bad_button_translate_event(p_object o, t_event *event);

/* draws the button */
void bad_button_draw(p_view o);

/* draws the button's state */
void bad_button_draw_state(p_bad_button o, l_int astate);

/* changes button's state (0=normal, 1=pressed) */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -