scroll.h

来自「模糊聚类的算法实现程序」· C头文件 代码 · 共 98 行

H
98
字号
//**************************************************************//*   filename: scroll.h                                       *//*                                                            *//**************************************************************//* programmed by: Thomas Wagner                               *//* last change:  (XXX: not updated)                           *//**************************************************************#include <stdio.h>#include <stdlib.h>#include <X11/Xlib.h>class ScrollWindow;class Scrollbar;#ifndef SCROLL_H#define SCROLL_H#include "window.h"#include "textbox.h"#include "actionicon.h"#define STATUS_SCROLLPRESSED  (1<<0)#define SCROLL_BORDERWIDTH     2#define SCROLL_ARROWSIZE      12#define SCROLL_MINWIDTH       24#define SCROLL_MINLENGTH       5#define DEFAULT_SCROLLBARBDWIDTH 1#define SCROLL_DEFAULT_OPTION           0#define SCROLL_BORDER_OPTION        (1<<0)#define SCROLL_COUNTERWINDOW_OPTION (1<<1)enum SCROLL_ACTION {  SCROLL_COUNTDOWN_ACTION,  SCROLL_COUNTUP_ACTION,  SCROLL_SETVALUE_ACTION};class ScrollWindow:  public BigWindow{  BigWindow *parent;  Pixmap pixmap;  ActionIcon *Actionicon[2];  TextBox *textbox;  Scrollbar *scrollbar;  int counter, minvalue, maxvalue;  int actionnumber;    public:    ScrollWindow (Display * initdisplay,	// the display		   GC initgc,	// the gc		   BigWindow * Parentwindow,	// the parentwindow		   XFontStruct * fontstruct,	// the fontstruct		   short initx, short inity,	// X-Pos, Y-Pos		   short initwidth, short initheight,	// width, height		   int initminvalue, int initmaxvalue,		  unsigned int options,		  int initactionnumber);    virtual ~ ScrollWindow ();  virtual void HandleEvent (XEvent * Event);  void Action (int value1, int value2);  void SetValue (int newvalue);  inline int GetMinValue () {    return minvalue;  } inline int GetMaxValue () {    return maxvalue;  } inline int GetValue () {    return counter;  } char SetMinMax (int min, int max);};class Scrollbar:  public Window_Info{  friend class ScrollWindow;  Pixmap pixmap_up, pixmap_down;  int maxpixel, minpixel;  ScrollWindow *parent;    public:    Scrollbar (Display * initdisplay,	       GC initgc,	       ScrollWindow * Parentwindow,	       XFontStruct * fontstruct,	       short initx,	       short inity,	       short initwidth,	       short initheight);    virtual ~ Scrollbar ();  virtual void HandleEvent (XEvent * Event);  void SetValue (int newvalue);  void MinMaxChanged ();};#endif

⌨️ 快捷键说明

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