📄 bcscrollbar.h
字号:
#ifndef BCSCROLLBAR_H#define BCSCROLLBAR_Hclass BC_ScrollBar;class BC_XScrollBar;class BC_YScrollBar;#include "bccolors.h"#include "bckeys.h"#include "bctool.h"#include "bcwindow.h"class BC_ScrollBar : public BC_Tool // scrollbar base class{public: BC_ScrollBar(int x_, int y_, int w_, int h_, long length_, long position_, long handlelength_); create_tool_objects(); virtual cursor_left_() {}; virtual button_press_() {}; virtual cursor_motion_() {}; button_release_(); virtual test_highlight() {};// redraw everything resize(int x_, int y_, int w_, int h_, long length_, long position_, long handlelength_);// resize the tool set_size(int x_, int y_, int w_, int h_);// rescale scroll bar handles set_position(long length_, long position_, long handlelength_); long get_position(); // position of scrollbar long get_distance(); // get distance moved in_use(); // scrollbar is in use// ================================================================== // handle resize call from subwindow resize(int w, int h); get_positions(int boxlength); // get positions for the generic box virtual draw() = 0; handle_arrows(); // subset of events for arrows repeat_(); // for handle_arrows// ========================================== data long length, position, handlelength; // handle position and size long distance; int buttondown; // if button is down int backarrow, forwardarrow, box, backpage, forwardpage; // which is active int backhi, forwardhi, boxhi; // which is highlighted int boxlength, handlew, handlex; // pixel dimensions long init_repeat, sustain_repeat, next_repeat; // give scrollbar a delay when first pressed};class BC_XScrollBar : public BC_ScrollBar{public: BC_XScrollBar(int x_, int y_, int w_, int h_, long length_, long position_, long handlelength_); cursor_left_(); button_press_(); cursor_motion_(); test_highlight(); draw(); int relativex, oldx; long oldposition; int result;};class BC_YScrollBar : public BC_ScrollBar{public: BC_YScrollBar(int x_, int y_, int w_, int h_, long length_, long position_, long handlelength_); // return 1 if the position has changed cursor_left_(); button_press_(); cursor_motion_(); test_highlight(); draw(); int relativey, oldy; long oldposition; int result;};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -