Rev 5640 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5640 | Rev 5642 | ||
---|---|---|---|
Line 21... | Line 21... | ||
21 | ?define CHECK_MOUSE_2 "¤«ï ¯à®¢¥àª¨ ª®¯®ª ¬ëè¨" |
21 | ?define CHECK_MOUSE_2 "¤«ï ¯à®¢¥àª¨ ª®¯®ª ¬ëè¨" |
22 | ?define POINTER_SPEED "ª®à®áâì 㪠§ â¥«ï ¬ëè¨" |
22 | ?define POINTER_SPEED "ª®à®áâì 㪠§ â¥«ï ¬ëè¨" |
23 | ?define POINTER_DELAY " ¤¥à¦ª 㪠§ â¥«ï ¬ëè¨" |
23 | ?define POINTER_DELAY " ¤¥à¦ª 㪠§ â¥«ï ¬ëè¨" |
24 | ?define MOUSE_EMULATION "¬ã«ïæ¨ï ã¯à ¢«¥¨ï 㪠§ ⥫¥¬ ç¥à¥§ ª« ¢¨ âãàã" |
24 | ?define MOUSE_EMULATION "¬ã«ïæ¨ï ã¯à ¢«¥¨ï 㪠§ ⥫¥¬ ç¥à¥§ ª« ¢¨ âãàã" |
25 | ?define MADMOUSE "ªà®§ë¥ ¤«ï ªãàá®à áâ®à®ë íªà " |
25 | ?define MADMOUSE "ªà®§ë¥ ¤«ï ªãàá®à áâ®à®ë íªà " |
26 | //?define MADMOUSE_DESCRIPTION "'When cursor reaches screen side switch it to inverce side' -I" |
- | |
27 | #else |
26 | #else |
28 | ?define WINDOW_TITLE "Mouse testing and configuration" |
27 | ?define WINDOW_TITLE "Mouse testing and configuration" |
29 | ?define CHECK_MOUSE_1 "Click on this area to" |
28 | ?define CHECK_MOUSE_1 "Click on this area to" |
30 | ?define CHECK_MOUSE_2 "check your mouse buttons" |
29 | ?define CHECK_MOUSE_2 "check your mouse buttons" |
31 | ?define POINTER_SPEED "Mouse pointer speed" |
30 | ?define POINTER_SPEED "Mouse pointer speed" |
32 | ?define POINTER_DELAY "Mouse pointer delay" |
31 | ?define POINTER_DELAY "Mouse pointer delay" |
33 | ?define MOUSE_EMULATION "Enable mouse emulation using keyboard NumPad" |
32 | ?define MOUSE_EMULATION "Enable mouse emulation using keyboard NumPad" |
34 | ?define MADMOUSE "Through screen sides for pointer" |
33 | ?define MADMOUSE "Through screen sides for pointer" |
35 | //?define MADMOUSE_DESCRIPTION "'When cursor reaches screen side switch it to inverce side' -I" |
- | |
36 | #endif |
34 | #endif |
Line 37... | Line 35... | ||
37 | 35 | ||
- | 36 | frame mouse_frame = { 0, 000, 14, 130, 14, 0x000111, 0xFFFfff, 0, 0, 0, 0, 6, 0x000111, 0xCCCccc }; |
|
Line 38... | Line 37... | ||
38 | frame mouse_frame = { 0, 000, 14, 130, 14, 0x000111, 0xFFFfff, 0, 0, 0, 0, 6, 0x000111, 0xCCCccc }; |
37 | char pos_x = 22; |
39 | 38 | ||
Line 119... | Line 118... | ||
119 | if (id==123) && (mouse_cfg.pointer_delay>0) |
118 | if (id==123) && (mouse_cfg.pointer_delay>0) |
120 | { |
119 | { |
121 | mouse_cfg.pointer_delay--; |
120 | mouse_cfg.pointer_delay--; |
122 | SetMouseDelay(mouse_cfg.pointer_delay); |
121 | SetMouseDelay(mouse_cfg.pointer_delay); |
123 | } |
122 | } |
124 | DrawWindowContent(); |
123 | DrawControls(); |
125 | break; |
124 | break; |
Line 126... | Line 125... | ||
126 | 125 | ||
127 | case evKey: |
126 | case evKey: |
128 | if (GetKey()==27) ExitProcess(); |
127 | if (GetKey()==27) ExitProcess(); |
Line 131... | Line 130... | ||
131 | case evReDraw: |
130 | case evReDraw: |
132 | sc.get(); |
131 | sc.get(); |
133 | DefineAndDrawWindow(430, 150, 360, 280+GetSkinHeight(),0x34,sc.work,WINDOW_TITLE); |
132 | DefineAndDrawWindow(430, 150, 360, 280+GetSkinHeight(),0x34,sc.work,WINDOW_TITLE); |
134 | GetProcessInfo(#Form, SelfInfo); |
133 | GetProcessInfo(#Form, SelfInfo); |
135 | if (Form.status_window>2) break; |
134 | if (Form.status_window>2) break; |
136 | mouse_frame.size_x = - mouse_frame.start_x * 2 + Form.cwidth; |
- | |
137 | mouse_frame.font_color = sc.work_text; |
135 | SetFrameColors(); |
138 | mouse_frame.font_backgr_color = sc.work; |
136 | DefineButton(mouse_frame.start_x+2, mouse_frame.start_y+2, mouse_frame.size_x-4, |
139 | mouse_frame.ext_col = sc.work_graph; |
- | |
140 | DrawWindowContent(); |
- | |
141 | } |
- | |
142 | } |
- | |
143 | - | ||
144 | - | ||
145 | void DrawWindowContent() { |
- | |
146 | char pos_x = 22; |
- | |
147 | - | ||
148 | DefineButton(mouse_frame.start_x, mouse_frame.start_y, mouse_frame.size_x, mouse_frame.size_y, 99+BT_NOFRAME, 0xF0F2F3); //needed to handle mouse_up and refresh mouse image |
137 | mouse_frame.size_y-4, 99+BT_NOFRAME, 0xF0F2F3); //needed to handle mouse_up and refresh mouse image |
149 | frame_draw stdcall (#mouse_frame); |
138 | frame_draw stdcall (#mouse_frame); |
150 | DrawMouseImage(); |
- | |
151 | WriteTextB(pos_x + 110, mouse_frame.start_y + 25, 0x90, 0x2C343C, CHECK_MOUSE_1); |
139 | WriteTextB(pos_x + 110, mouse_frame.start_y + 25, 0x90, 0x2C343C, CHECK_MOUSE_1); |
152 | WriteTextB(pos_x + 110, mouse_frame.start_y + 45, 0x90, 0x2C343C, CHECK_MOUSE_2); |
140 | WriteTextB(pos_x + 110, mouse_frame.start_y + 45, 0x90, 0x2C343C, CHECK_MOUSE_2); |
153 | - | ||
154 | PanelCfg_MoreLessBox(pos_x, mouse_frame.start_y + 142, 120, 121, mouse_cfg.pointer_speed, POINTER_SPEED); |
141 | DrawMouseImage(); |
155 | PanelCfg_MoreLessBox(pos_x, mouse_frame.start_y + 170, 122, 123, mouse_cfg.pointer_delay, POINTER_DELAY); |
142 | DrawControls(); |
156 | 143 | } |
|
157 | PanelCfg_CheckBox(pos_x, mouse_frame.start_y + 202, 100, MOUSE_EMULATION, mouse_cfg.emulation); |
- | |
158 | PanelCfg_CheckBox(pos_x, mouse_frame.start_y + 226, 101, MADMOUSE, mouse_cfg.madmouse); |
- | |
159 | } |
144 | } |
160 | - | ||
Line 161... | Line 145... | ||
161 | 145 | ||
162 | void PanelCfg_CheckBox(dword x, y, id, text, byte value) { |
146 | void PanelCfg_CheckBox(dword x, y, id, text, byte value) { |
163 | CheckBox(x, y, 14, 14, id, text, sc.work_graph, sc.work_text, value); |
147 | CheckBox(x, y, 14, 14, id, text, sc.work_graph, sc.work_text, value); |
Line 167... | Line 151... | ||
167 | void PanelCfg_MoreLessBox(dword x, y, id_more, id_less; byte value; dword text) { |
151 | void PanelCfg_MoreLessBox(dword x, y, id_more, id_less; byte value; dword text) { |
168 | MoreLessBox(x, y, 18, id_more, id_less, #sc, value, text); |
152 | MoreLessBox(x, y, 18, id_more, id_less, #sc, value, text); |
169 | } |
153 | } |
Line 170... | Line 154... | ||
170 | 154 | ||
171 | void DrawMouseImage() { |
155 | void DrawMouseImage() { |
- | 156 | _PutImage(mouse_frame.start_x+30, mouse_frame.start_y + 15, panels_img.w, panels_img.h, |
|
- | 157 | mouse_cfg.button_clicked * panels_img.w * panels_img.h * 3 + panels_img.data); |
|
- | 158 | } |
|
- | 159 | ||
- | 160 | void DrawControls() { |
|
- | 161 | PanelCfg_MoreLessBox(pos_x, mouse_frame.start_y + 142, 120, 121, mouse_cfg.pointer_speed, POINTER_SPEED); |
|
- | 162 | PanelCfg_MoreLessBox(pos_x, mouse_frame.start_y + 170, 122, 123, mouse_cfg.pointer_delay, POINTER_DELAY); |
|
- | 163 | PanelCfg_CheckBox(pos_x, mouse_frame.start_y + 202, 100, MOUSE_EMULATION, mouse_cfg.emulation); |
|
- | 164 | PanelCfg_CheckBox(pos_x, mouse_frame.start_y + 226, 101, MADMOUSE, mouse_cfg.madmouse); |
|
- | 165 | } |
|
- | 166 | ||
- | 167 | void SetFrameColors() { |
|
- | 168 | mouse_frame.size_x = - mouse_frame.start_x * 2 + Form.cwidth; |
|
- | 169 | mouse_frame.font_color = sc.work_text; |
|
- | 170 | mouse_frame.font_backgr_color = sc.work; |
|
172 | _PutImage(mouse_frame.start_x+30, mouse_frame.start_y + 15, panels_img.w, panels_img.h, mouse_cfg.button_clicked * panels_img.w * panels_img.h * 3 + panels_img.data); |
171 | mouse_frame.ext_col = sc.work_graph; |
Line 173... | Line 172... | ||
173 | } |
172 | } |
174 | 173 | ||
175 | void LoadCfg() { |
174 | void LoadCfg() { |