1,5 → 1,3 |
// Mouse Configuration Utility ver 1.3 |
|
#ifndef AUTOBUILD |
#include "lang.h--" |
#endif |
11,7 → 9,6 |
#include "..\lib\gui.h" |
#include "..\lib\obj\libio_lib.h" |
#include "..\lib\obj\box_lib.h" |
#include "..\lib\obj\libini.h" |
#include "..\lib\patterns\restart_process.h" |
|
#include "kos_mouse_functions.h" |
40,8 → 37,6 |
|
unsigned char panels_img_data[] = FROM "mouse_image.raw"; |
raw_image panels_img = { 59, 101, #panels_img_data }; |
char system_ini_path[] = "/sys/settings/system.ini"; |
char mouse_category[] = "mouse"; |
|
proc_info Form; |
|
58,7 → 53,6 |
void main() { |
char id, old_button_clicked; |
|
load_dll(libini, #lib_init,1); |
load_dll(boxlib, #box_lib_init,0); |
|
LoadCfg(); |
82,7 → 76,7 |
id=GetButtonID(); |
if (id==1) |
{ |
ExitApp(); |
ExitProcess(); |
} |
if (id==99) |
{ |
126,7 → 120,7 |
break; |
|
case evKey: |
if (GetKey()==27) ExitApp(); |
if (GetKey()==27) ExitProcess(); |
break; |
|
case evReDraw: |
138,8 → 132,8 |
DefineButton(mouse_frame.start_x+2, mouse_frame.start_y+2, mouse_frame.size_x-4, |
mouse_frame.size_y-4, 99+BT_NOFRAME, 0xF0F2F3); //needed to handle mouse_up and refresh mouse image |
frame_draw stdcall (#mouse_frame); |
WriteText(pos_x + 110, mouse_frame.start_y + 25, 0x90, 0x2C343C, CHECK_MOUSE_1); |
WriteText(pos_x + 110, mouse_frame.start_y + 45, 0x90, 0x2C343C, CHECK_MOUSE_2); |
WriteTextB(pos_x + 110, mouse_frame.start_y + 25, 0x90, 0x2C343C, CHECK_MOUSE_1); |
WriteTextB(pos_x + 110, mouse_frame.start_y + 45, 0x90, 0x2C343C, CHECK_MOUSE_2); |
DrawMouseImage(); |
DrawControls(); |
} |
149,6 → 143,7 |
CheckBox(x, y, 14, 14, id, text, system.color.work_graph, system.color.work_text, value); |
} |
|
|
void PanelCfg_MoreLessBox(dword x, y, id_more, id_less; byte value; dword text) { |
MoreLessBox(x, y, 18, id_more, id_less, #system.color, value, text); |
} |
159,7 → 154,6 |
} |
|
void DrawControls() { |
DrawBar(pos_x, mouse_frame.start_y + 142, Form.cwidth - pos_x, 120, system.color.work); |
PanelCfg_MoreLessBox(pos_x, mouse_frame.start_y + 142, 120, 121, mouse_cfg.pointer_speed, POINTER_SPEED); |
PanelCfg_MoreLessBox(pos_x, mouse_frame.start_y + 170, 122, 123, mouse_cfg.pointer_delay, POINTER_DELAY); |
PanelCfg_CheckBox(pos_x, mouse_frame.start_y + 202, 100, MOUSE_EMULATION, mouse_cfg.emulation); |
174,18 → 168,12 |
} |
|
void LoadCfg() { |
ini_get_int stdcall (#system_ini_path, #mouse_category, "delay", GetMouseDelay()); mouse_cfg.pointer_delay = EAX; |
ini_get_int stdcall (#system_ini_path, #mouse_category, "speed", GetMouseSpeed()); mouse_cfg.pointer_speed = EAX; |
mouse_cfg.pointer_delay = GetMouseDelay(); |
mouse_cfg.pointer_speed = GetMouseSpeed(); |
mouse_cfg.madmouse = CheckProcessExists("MADMOUSE"); |
mouse_cfg.emulation = CheckProcessExists("MOUSEMUL"); |
} |
|
void ExitApp() { |
ini_set_int stdcall (#system_ini_path, #mouse_category, "delay", mouse_cfg.pointer_delay); |
ini_set_int stdcall (#system_ini_path, #mouse_category, "speed", mouse_cfg.pointer_speed); |
ExitProcess(); |
} |
|
|
|
stop: |