forked from KolibriOS/kolibrios
CMM: use updated more_less_box, dynamically get free button id
git-svn-id: svn://kolibrios.org@7243 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
3e7937bbbb
commit
02e3d16737
@ -26,7 +26,6 @@
|
||||
proc_info Form;
|
||||
|
||||
dword screenshot;
|
||||
|
||||
int screenshot_length;
|
||||
|
||||
enum {
|
||||
@ -118,9 +117,10 @@ char path_tmp[4096];
|
||||
dword mouse_dd1;
|
||||
edit_box edit_box_path = {270,10,70,0xffffff,0x94AECE,0xFFFfff,0xffffff,0x10000000,sizeof(path_tmp),#path_tmp,#mouse_dd1, 0b};
|
||||
|
||||
more_less_box delay = { 1, 0, 64, "Delay in seconds" };
|
||||
|
||||
void SettingsWindow()
|
||||
{
|
||||
#define x 15
|
||||
int id;
|
||||
SetEventMask(EVM_REDRAW+EVM_KEY+EVM_BUTTON+EVM_MOUSE+EVM_MOUSE_FILTER);
|
||||
loop() switch(WaitEvent())
|
||||
@ -136,18 +136,16 @@ void SettingsWindow()
|
||||
|
||||
case evButton:
|
||||
id = GetButtonID();
|
||||
delay.click(id);
|
||||
if (CLOSE_BTN == id) ExitProcess();
|
||||
if (10 == id) settings.delay++;
|
||||
if (11 == id) && (settings.delay>0) settings.delay--;
|
||||
if (12 == id) settings.minimise ^= 1;
|
||||
goto _DRAW_CONTENT;
|
||||
if (12 == id) { settings.minimise ^= 1; goto _DRAW_CONTENT; }
|
||||
break;
|
||||
|
||||
case evReDraw:
|
||||
DefineAndDrawWindow(Form.left+100, Form.top-40, 330, 170, 0x34, system.color.work, "Settings",0);
|
||||
_DRAW_CONTENT:
|
||||
CheckBox(x, 10, 12, "Minimize window", settings.minimise);
|
||||
MoreLessBox(x, 40, 10, 11, settings.delay, "Delay in seconds");
|
||||
CheckBox(15, 10, 12, "Minimize window", settings.minimise);
|
||||
delay.draw(15, 40);
|
||||
//DrawEditBox(#edit_box_path);
|
||||
}
|
||||
}
|
||||
|
@ -38,10 +38,16 @@ char path_start[4096]="\0";
|
||||
edit_box path_start_ed = {290,50,57,0xffffff,0x94AECE,0xffffff,0xffffff,0x10000000,4098,
|
||||
#path_start,#set_mouse_dd, 100000000000010b,0,0};
|
||||
|
||||
more_less_box font_size = { NULL, 9, 22, FONT_SIZE_LABEL };
|
||||
more_less_box line_height = { NULL, 16, 64, LIST_LINE_HEIGHT };
|
||||
|
||||
|
||||
void settings_dialog()
|
||||
{
|
||||
byte id;
|
||||
active_settings=1;
|
||||
font_size.value = kfont.size.pt;
|
||||
line_height.value = files.item_h;
|
||||
SetEventMask(0x27);
|
||||
loop(){
|
||||
switch(WaitEvent())
|
||||
@ -77,16 +83,20 @@ void settings_dialog()
|
||||
else if (id==22) info_after_copy ^= 1;
|
||||
else if (id==24) two_panels ^= true;
|
||||
else if (id==32) show_breadcrumb ^= true;
|
||||
else if (id==25) { files.item_h++; files_active.item_h = files_inactive.item_h = files.item_h; }
|
||||
else if (id==26) && (files.item_h>16) files_inactive.item_h = files.item_h = files.item_h-1;
|
||||
else if (id==27) show_status_bar ^= 1;
|
||||
else if (id==30) { kfont.size.pt++; IF(!kfont.changeSIZE()) kfont.size.pt--; BigFontsChange(); }
|
||||
else if (id==31) { kfont.size.pt--; IF(!kfont.changeSIZE()) kfont.size.pt++; BigFontsChange(); }
|
||||
else if (font_size.click(id)) {
|
||||
kfont.size.pt = font_size.value;
|
||||
kfont.changeSIZE();
|
||||
BigFontsChange();
|
||||
}
|
||||
else if (line_height.click(id)) {
|
||||
files.item_h = line_height.value;
|
||||
}
|
||||
else if (id==33) {
|
||||
big_icons ^= 1;
|
||||
if (big_icons) {
|
||||
icon_size=32;
|
||||
files.item_h=34;
|
||||
files.item_h = line_height.value = 34;
|
||||
if (!icons32_default.image)
|
||||
{
|
||||
Libimg_LoadImage(#icons32_default, "/sys/icons32.png");
|
||||
@ -99,7 +109,7 @@ void settings_dialog()
|
||||
}
|
||||
else {
|
||||
icon_size=16;
|
||||
files.item_h=18;
|
||||
files.item_h = line_height.value = 18;
|
||||
}
|
||||
}
|
||||
EventRedrawWindow(Form.left,Form.top);
|
||||
@ -140,8 +150,8 @@ void DrawSettingsCheckBoxes()
|
||||
CheckBox(x, y.inc(25), 32, SHOW_BREADCRUMBS, show_breadcrumb);
|
||||
CheckBox(x, y.inc(25), 33, BIG_ICONS, big_icons);
|
||||
CheckBox(x, y.inc(25), 24, USE_TWO_PANELS, two_panels);
|
||||
MoreLessBox(x, y.inc(31), 30, 31, kfont.size.pt, FONT_SIZE_LABEL);
|
||||
MoreLessBox(x, y.inc(31), 25, 26, files.item_h, LIST_LINE_HEIGHT);
|
||||
font_size.draw(x, y.inc(31));
|
||||
line_height.draw(x, y.inc(31));
|
||||
|
||||
DrawFrame(x, y.inc(37), 340, 95, START_PATH);
|
||||
// START_PATH {
|
||||
|
@ -67,15 +67,13 @@ enum {
|
||||
BTN_FILL,
|
||||
BTN_LINE,
|
||||
BTN_RECT,
|
||||
BTN_ZOOM_IN,
|
||||
BTN_ZOOM_OUT,
|
||||
BTNS_PALETTE_COLOR_MAS = 100,
|
||||
BTNS_LAST_USED_COLORS = 400
|
||||
};
|
||||
|
||||
proc_info Form;
|
||||
|
||||
more_less_box zoom = { PANEL_LEFT_W, -100, 11, 1, 40, BTN_ZOOM_IN, BTN_ZOOM_OUT, "Zoom" };
|
||||
more_less_box zoom = { 11, 1, 40, "Zoom" };
|
||||
|
||||
dword default_palette[] = {
|
||||
0x330000,0x331900,0x333300,0x193300,0x003300,0x003319,0x003333,0x001933,0x000033,0x190033,
|
||||
@ -378,8 +376,8 @@ void main()
|
||||
tools[currentTool].onMouseEvent(mouse.x, mouse.y, mouse.lkm, mouse.pkm);
|
||||
|
||||
if (mouse.vert) {
|
||||
if (mouse.vert==65535) zoom.click(BTN_ZOOM_IN);
|
||||
if (mouse.vert==1) zoom.click(BTN_ZOOM_OUT);
|
||||
if (mouse.vert==65535) zoom.inc();
|
||||
if (mouse.vert==1) zoom.dec();
|
||||
DrawEditArea();
|
||||
}
|
||||
|
||||
@ -396,6 +394,7 @@ void main()
|
||||
|
||||
case evButton:
|
||||
btn = GetButtonID();
|
||||
if (zoom.click(btn)) DrawEditArea();
|
||||
switch(btn)
|
||||
{
|
||||
case BTN_NEW:
|
||||
@ -449,14 +448,6 @@ void main()
|
||||
case BTN_RECT:
|
||||
setCurrentTool(TOOL_RECT);
|
||||
break;
|
||||
case BTN_ZOOM_IN:
|
||||
zoom.click(BTN_ZOOM_IN);
|
||||
DrawEditArea();
|
||||
break;
|
||||
case BTN_ZOOM_OUT:
|
||||
zoom.click(BTN_ZOOM_OUT);
|
||||
DrawEditArea();
|
||||
break;
|
||||
case CLOSE_BTN:
|
||||
ExitProcess();
|
||||
break;
|
||||
@ -475,8 +466,8 @@ void main()
|
||||
if (key_scancode == SCAN_CODE_KEY_S) actionsHistory.undoLastAction();
|
||||
if (key_scancode == SCAN_CODE_KEY_C) actionsHistory.redoLastAction();
|
||||
|
||||
if (key_scancode == SCAN_CODE_MINUS) {zoom.click(BTN_ZOOM_OUT); DrawEditArea();}
|
||||
if (key_scancode == SCAN_CODE_PLUS) {zoom.click(BTN_ZOOM_IN); DrawEditArea();}
|
||||
if (key_scancode == SCAN_CODE_MINUS) {zoom.inc(); DrawEditArea();}
|
||||
if (key_scancode == SCAN_CODE_PLUS) {zoom.dec(); DrawEditArea();}
|
||||
break;
|
||||
|
||||
case evReDraw:
|
||||
@ -502,9 +493,7 @@ void DrawLeftPanelButton(dword _id, _y, _icon_n)
|
||||
|
||||
void DrawStatusBar()
|
||||
{
|
||||
zoom.y = wrapper.y + wrapper.h + 6;
|
||||
zoom.x = wrapper.x;
|
||||
zoom.draw();
|
||||
zoom.draw(wrapper.x, wrapper.y + wrapper.h + 6);
|
||||
|
||||
sprintf(#param,"Canvas: %ix%i", image.rows, image.columns);
|
||||
WriteText(wrapper.x+wrapper.w-calc(strlen(#param)*8), zoom.y+2, 0x90, system.color.work_text, #param);
|
||||
@ -572,7 +561,7 @@ void DrawEditArea()
|
||||
canvas.w = image.columns * zoom.value;
|
||||
canvas.h = image.rows * zoom.value;
|
||||
if (canvas.w+2 > wrapper.w) || (canvas.h+2 > wrapper.h) {
|
||||
zoom.click(BTN_ZOOM_OUT);
|
||||
zoom.dec();
|
||||
DrawEditArea();
|
||||
return;
|
||||
}
|
||||
|
@ -19,6 +19,14 @@
|
||||
|
||||
#include "../lib/gui/tabs.h"
|
||||
#include "../lib/gui/more_less_box.h"
|
||||
#include "../lib/gui/checkbox.h"
|
||||
|
||||
int last_free_button_id = 1000;
|
||||
:int GetFreeButtonId()
|
||||
{
|
||||
last_free_button_id++;
|
||||
return last_free_button_id;
|
||||
}
|
||||
|
||||
:void DrawRectangle(dword x,y,w,h,color1)
|
||||
{
|
||||
@ -106,66 +114,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
:unsigned char checkbox_flag[507] = {
|
||||
0xFC, 0xD4, 0x04, 0xFC, 0xD4, 0x04, 0xFC, 0xD4, 0x04, 0xFC, 0xD4, 0x04, 0xFC, 0xD4, 0x04, 0xFC,
|
||||
0xD4, 0x04, 0xFC, 0xD4, 0x04, 0xFC, 0xD4, 0x04, 0xFC, 0xD4, 0x04, 0xFC, 0xD4, 0x04, 0xFC, 0xD4,
|
||||
0x04, 0xFC, 0xD4, 0x04, 0xFC, 0xC8, 0x04, 0xFC, 0xDC, 0x04, 0xFC, 0xC8, 0x04, 0xFC, 0xC8, 0x04,
|
||||
0xFC, 0xC8, 0x04, 0xFC, 0xC8, 0x04, 0xFC, 0xC8, 0x04, 0xFC, 0xC8, 0x04, 0xFC, 0xC8, 0x04, 0xFC,
|
||||
0xC8, 0x04, 0xFC, 0xC8, 0x04, 0xFC, 0xC8, 0x04, 0xFC, 0xC8, 0x04, 0xFC, 0xB4, 0x04, 0xFC, 0xDC,
|
||||
0x04, 0xFC, 0xC8, 0x04, 0xFC, 0xC8, 0x04, 0xFC, 0xC8, 0x04, 0xFC, 0xC8, 0x04, 0xFC, 0xBC, 0x04,
|
||||
0xFC, 0xBC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, 0x98, 0x04, 0xF9, 0x98, 0x04, 0xFA,
|
||||
0x9F, 0x04, 0xFC, 0xA9, 0x04, 0xFC, 0xA9, 0x04, 0xFC, 0xA9, 0x04, 0xFA, 0x9F, 0x04, 0xFA, 0x9F,
|
||||
0x04, 0xF9, 0x98, 0x04, 0xFC, 0xB4, 0x04, 0xF9, 0x98, 0x04, 0xF9, 0x98, 0x04, 0xF9, 0x98, 0x04,
|
||||
0xF9, 0x98, 0x04, 0xF9, 0x98, 0x04, 0xF9, 0x98, 0x04, 0xF9, 0x98, 0x04, 0xF9, 0x98, 0x04, 0xF9,
|
||||
0x98, 0x04, 0xF9, 0x98, 0x04, 0xF9, 0x98, 0x04, 0xF9, 0x98, 0x04
|
||||
};
|
||||
|
||||
:void CheckBox(dword x,y,bt_id, text, is_checked)
|
||||
{
|
||||
byte w=14, h=14;
|
||||
DefineButton(x-1, y-1, strlen(text)*8 + w + 17, h+2, bt_id+BT_HIDE+BT_NOFRAME, 0);
|
||||
EDI = system.color.work;
|
||||
WriteText(x+w+8, h / 2 + y -7, 0xD0, system.color.work_text, text);
|
||||
DrawRectangle(x, y, w, h, system.color.work_graph);
|
||||
if (is_checked == 0)
|
||||
{
|
||||
DrawRectangle3D(x+1, y+1, w-2, h-2, 0xDDDddd, 0xffffff);
|
||||
DrawBar(x+2, y+2, w-3, h-3, 0xffffff);
|
||||
}
|
||||
else if (is_checked == 1)
|
||||
{
|
||||
DrawWideRectangle(x+1, y+1, w-1, h-1, 2, 0xffffff);
|
||||
_PutImage(x+1, y+1, 13, 13, #checkbox_flag);
|
||||
}
|
||||
else if (is_checked == 2) //not active
|
||||
{
|
||||
DrawWideRectangle(x+1, y+1, w-1, h-1, 2, 0xffffff);
|
||||
DrawBar(x+3, y+3, w-5, h-5, 0x888888);
|
||||
}
|
||||
DrawRectangle3D(x-1,y-1,w+2,h+2,system.color.work_dark,system.color.work_light);
|
||||
}
|
||||
|
||||
:void DrawEditBox(dword edit_box_pointer)
|
||||
{
|
||||
dword x,y,w,h,bg;
|
||||
|
59
programs/cmm/lib/gui/checkbox.h
Normal file
59
programs/cmm/lib/gui/checkbox.h
Normal file
@ -0,0 +1,59 @@
|
||||
:unsigned char checkbox_flag[507] = {
|
||||
0xFC, 0xD4, 0x04, 0xFC, 0xD4, 0x04, 0xFC, 0xD4, 0x04, 0xFC, 0xD4, 0x04, 0xFC, 0xD4, 0x04, 0xFC,
|
||||
0xD4, 0x04, 0xFC, 0xD4, 0x04, 0xFC, 0xD4, 0x04, 0xFC, 0xD4, 0x04, 0xFC, 0xD4, 0x04, 0xFC, 0xD4,
|
||||
0x04, 0xFC, 0xD4, 0x04, 0xFC, 0xC8, 0x04, 0xFC, 0xDC, 0x04, 0xFC, 0xC8, 0x04, 0xFC, 0xC8, 0x04,
|
||||
0xFC, 0xC8, 0x04, 0xFC, 0xC8, 0x04, 0xFC, 0xC8, 0x04, 0xFC, 0xC8, 0x04, 0xFC, 0xC8, 0x04, 0xFC,
|
||||
0xC8, 0x04, 0xFC, 0xC8, 0x04, 0xFC, 0xC8, 0x04, 0xFC, 0xC8, 0x04, 0xFC, 0xB4, 0x04, 0xFC, 0xDC,
|
||||
0x04, 0xFC, 0xC8, 0x04, 0xFC, 0xC8, 0x04, 0xFC, 0xC8, 0x04, 0xFC, 0xC8, 0x04, 0xFC, 0xBC, 0x04,
|
||||
0xFC, 0xBC, 0x04, 0xFC, 0xBC, 0x04, 0xFC, 0xB4, 0x04, 0xFC, 0xA9, 0x04, 0xFC, 0xA9, 0x04, 0xFC,
|
||||
0xB4, 0x04, 0xFC, 0xB4, 0x04, 0xFC, 0xD4, 0x04, 0xFC, 0xC8, 0x04, 0xFC, 0xC8, 0x04, 0xFC, 0xC8,
|
||||
0x04, 0xFC, 0xBC, 0x04, 0xFC, 0xBC, 0x04, 0xFC, 0xB4, 0x04, 0xFC, 0xB4, 0x04, 0xF9, 0x98, 0x04,
|
||||
0xFC, 0xF2, 0xD2, 0xFC, 0xF2, 0xD2, 0xFA, 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x98, 0x04, 0xF9, 0x98, 0x04, 0xF9, 0x98, 0x04, 0xF9, 0x98, 0x04
|
||||
};
|
||||
|
||||
:void CheckBox(dword x,y,bt_id, text, is_checked)
|
||||
{
|
||||
byte w=14, h=14;
|
||||
DefineButton(x-1, y-1, strlen(text)*8 + w + 17, h+2, bt_id+BT_HIDE+BT_NOFRAME, 0);
|
||||
EDI = system.color.work;
|
||||
WriteText(x+w+8, h / 2 + y -7, 0xD0, system.color.work_text, text);
|
||||
DrawRectangle(x, y, w, h, system.color.work_graph);
|
||||
if (is_checked == 0)
|
||||
{
|
||||
DrawRectangle3D(x+1, y+1, w-2, h-2, 0xDDDddd, 0xffffff);
|
||||
DrawBar(x+2, y+2, w-3, h-3, 0xffffff);
|
||||
}
|
||||
else if (is_checked == 1)
|
||||
{
|
||||
DrawWideRectangle(x+1, y+1, w-1, h-1, 2, 0xffffff);
|
||||
_PutImage(x+1, y+1, 13, 13, #checkbox_flag);
|
||||
}
|
||||
else if (is_checked == 2) //not active
|
||||
{
|
||||
DrawWideRectangle(x+1, y+1, w-1, h-1, 2, 0xffffff);
|
||||
DrawBar(x+3, y+3, w-5, h-5, 0x888888);
|
||||
}
|
||||
DrawRectangle3D(x-1,y-1,w+2,h+2,system.color.work_dark,system.color.work_light);
|
||||
}
|
@ -1,55 +1,65 @@
|
||||
:struct more_less_box
|
||||
{
|
||||
signed x,y;
|
||||
unsigned value, min, max;
|
||||
unsigned bt_id_more, bt_id_less;
|
||||
dword text;
|
||||
int click_delta;
|
||||
int x,y;
|
||||
unsigned id_inc, id_dec;
|
||||
void check_values();
|
||||
bool click();
|
||||
bool inc();
|
||||
bool dec();
|
||||
void draw();
|
||||
void redraw();
|
||||
};
|
||||
|
||||
:void more_less_box::check_values()
|
||||
{
|
||||
if (!id_inc) id_inc = GetFreeButtonId();
|
||||
if (!id_dec) id_dec = GetFreeButtonId();
|
||||
if (!click_delta) click_delta = 1;
|
||||
}
|
||||
|
||||
:bool more_less_box::click(unsigned id)
|
||||
{
|
||||
if (!click_delta) click_delta = 1;
|
||||
if (id==bt_id_less) { value = math.max(value-click_delta, min); draw(); return 1; }
|
||||
if (id==bt_id_more) { value = math.min(value+click_delta, max); draw(); return 1; }
|
||||
if (id==id_dec) { value = math.max(value-click_delta, min); redraw(); return 1; }
|
||||
if (id==id_inc) { value = math.min(value+click_delta, max); redraw(); return 1; }
|
||||
return 0;
|
||||
}
|
||||
|
||||
:void more_less_box::draw()
|
||||
:bool more_less_box::inc()
|
||||
{
|
||||
click(id_inc);
|
||||
}
|
||||
|
||||
:bool more_less_box::dec()
|
||||
{
|
||||
click(id_dec);
|
||||
}
|
||||
|
||||
:void more_less_box::draw(dword _x,_y)
|
||||
{
|
||||
#define VALUE_FIELD_W 34
|
||||
#define SIZE 18
|
||||
dword value_text = itoa(value);
|
||||
|
||||
check_values();
|
||||
x=_x; y=_y;
|
||||
|
||||
DrawRectangle(x, y, VALUE_FIELD_W+1, SIZE, system.color.work_graph);
|
||||
DrawRectangle3D(x+1, y+1, VALUE_FIELD_W-2, SIZE-2, 0xDDDddd, 0xffffff);
|
||||
DrawBar(x+2, y+2, VALUE_FIELD_W-3, SIZE-3, 0xffffff);
|
||||
WriteText( -strlen(value_text)+3*8 + x+6, SIZE / 2 + y -6, 0x90, 0x333333, value_text);
|
||||
|
||||
DrawCaptButton(VALUE_FIELD_W + x + 1, y, SIZE, SIZE, bt_id_more, system.color.work_button, system.color.work_button_text, "+");
|
||||
DrawCaptButton(VALUE_FIELD_W + x + SIZE, y, SIZE, SIZE, bt_id_less, system.color.work_button, system.color.work_button_text, "-");
|
||||
DrawCaptButton(VALUE_FIELD_W + x + 1, y, SIZE, SIZE, id_inc, system.color.work_button, system.color.work_button_text, "+");
|
||||
DrawCaptButton(VALUE_FIELD_W + x + SIZE, y, SIZE, SIZE, id_dec, system.color.work_button, system.color.work_button_text, "-");
|
||||
EDI = system.color.work;
|
||||
WriteText(x+VALUE_FIELD_W+SIZE+SIZE+10, SIZE / 2 + y -7, 0xD0, system.color.work_text, text);
|
||||
DrawRectangle3D(x-1,y-1,VALUE_FIELD_W+SIZE+SIZE+2,SIZE+2,system.color.work_dark,system.color.work_light);
|
||||
}
|
||||
|
||||
//OUTDATED: to be removed
|
||||
:void MoreLessBox(dword x,y, bt_id_more, bt_id_less, value, text)
|
||||
:void more_less_box::redraw()
|
||||
{
|
||||
#define VALUE_FIELD_W 34
|
||||
#define SIZE 18
|
||||
dword value_text = itoa(value);
|
||||
|
||||
DrawRectangle(x, y, VALUE_FIELD_W+1, SIZE, system.color.work_graph);
|
||||
DrawRectangle3D(x+1, y+1, VALUE_FIELD_W-2, SIZE-2, 0xDDDddd, 0xffffff);
|
||||
DrawBar(x+2, y+2, VALUE_FIELD_W-3, SIZE-3, 0xffffff);
|
||||
WriteText( -strlen(value_text)+3*8 + x+6, SIZE / 2 + y -6, 0x90, 0x333333, value_text);
|
||||
|
||||
DrawCaptButton(VALUE_FIELD_W + x + 1, y, SIZE, SIZE, bt_id_more, system.color.work_button, system.color.work_button_text, "+");
|
||||
DrawCaptButton(VALUE_FIELD_W + x + SIZE, y, SIZE, SIZE, bt_id_less, system.color.work_button, system.color.work_button_text, "-");
|
||||
EDI = system.color.work;
|
||||
WriteText(x+VALUE_FIELD_W+SIZE+SIZE+10, SIZE / 2 + y -7, 0xD0, system.color.work_text, text);
|
||||
DrawRectangle3D(x-1,y-1,VALUE_FIELD_W+SIZE+SIZE+2,SIZE+2,system.color.work_dark,system.color.work_light);
|
||||
draw(x,y);
|
||||
}
|
||||
|
||||
|
@ -40,9 +40,9 @@ proc_info Form;
|
||||
#define PD 18 //padding
|
||||
block mouse_frame = { PD, PD, NULL, 130 };
|
||||
|
||||
more_less_box pointer_speed = { PD, PD+142, NULL, 0, 64, 120, 121, POINTER_SPEED };
|
||||
more_less_box acceleration = { PD, PD+172, NULL, 0, 64, 122, 123, ACCELERATION_TEXT };
|
||||
more_less_box double_click_delay = { PD, PD+202, NULL, 0, 999,124, 125, DOUBLE_CLICK_TEXT, 8 };
|
||||
more_less_box pointer_speed = { NULL, 0, 64, POINTER_SPEED };
|
||||
more_less_box acceleration = { NULL, 0, 64, ACCELERATION_TEXT };
|
||||
more_less_box double_click_delay = { NULL, 0, 999, DOUBLE_CLICK_TEXT, 8 };
|
||||
|
||||
unsigned char panels_img_data[] = FROM "mouse_image.raw";
|
||||
raw_image panels_img = { 59, 101, #panels_img_data };
|
||||
@ -134,9 +134,9 @@ void DrawMouseImage() {
|
||||
}
|
||||
|
||||
void DrawControls() {
|
||||
pointer_speed.draw();
|
||||
acceleration.draw();
|
||||
double_click_delay.draw();
|
||||
pointer_speed.draw(PD, PD+142);
|
||||
acceleration.draw(PD, PD+172);
|
||||
double_click_delay.draw(PD+202);
|
||||
CheckBox(mouse_frame.x, mouse_frame.y + 236, 100, MOUSE_EMULATION, mouse_cfg.emulation);
|
||||
CheckBox(mouse_frame.x, mouse_frame.y + 262, 101, MADMOUSE, mouse_cfg.madmouse);
|
||||
}
|
||||
|
@ -68,9 +68,8 @@ proc_info Form;
|
||||
word dkFsize;
|
||||
byte dkLocation, dkAshow;
|
||||
|
||||
byte tbAttachment, tbPanelHeight, tbSoftenHeight, tbButtonOffset,
|
||||
tbSoftenUp, tbSoftenDown, tbMinLeftButton, tbMinRightButton, tbMenuButton,
|
||||
tbRunApplButton, tbClnDeskButton, tbClock, tbCpuUsage, tbChangeLang;
|
||||
byte tbAttachment, tbSoftenUp, tbSoftenDown, tbMinLeftButton, tbMinRightButton,
|
||||
tbMenuButton, tbRunApplButton, tbClnDeskButton, tbClock, tbCpuUsage, tbChangeLang;
|
||||
|
||||
enum {
|
||||
TASKBAR,
|
||||
@ -78,6 +77,9 @@ enum {
|
||||
ALL
|
||||
};
|
||||
|
||||
more_less_box tbPanelHeight = { NULL, 6, 99, PANEL_HEIGHT };
|
||||
more_less_box tbSoftenHeight = { NULL, 0, 99, SOFTEN_HEIGHT };
|
||||
more_less_box tbButtonOffset = { NULL, 0, 99, BUTTON_OFFSET };
|
||||
|
||||
void main()
|
||||
{
|
||||
@ -107,12 +109,9 @@ void main()
|
||||
if (id==112) tbCpuUsage ^= 1;
|
||||
if (id==113) tbChangeLang ^= 1;
|
||||
if (id==114) tbMenuButton ^= 1;
|
||||
if (id==120) tbPanelHeight++;
|
||||
if (id==121) && (tbPanelHeight>6) tbPanelHeight--;
|
||||
if (id==122) tbSoftenHeight++;
|
||||
if (id==123) && (tbSoftenHeight>0) tbSoftenHeight--;
|
||||
if (id==124) tbButtonOffset++;
|
||||
if (id==125) && (tbButtonOffset>0) tbButtonOffset--;
|
||||
tbPanelHeight.click(id);
|
||||
tbSoftenHeight.click(id);
|
||||
tbButtonOffset.click(id);
|
||||
DrawWindowContent(TASKBAR);
|
||||
SaveCfg(TASKBAR);
|
||||
RestartProcess(TASKBAR);
|
||||
@ -147,7 +146,6 @@ void main()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void DrawWindowContent(byte panel_type)
|
||||
{
|
||||
#define PD 10
|
||||
@ -170,9 +168,9 @@ void DrawWindowContent(byte panel_type)
|
||||
CheckBox(win_center_x, y.n, 113, CHANGE_LANG, tbChangeLang);
|
||||
CheckBox(22, y.inc(24), 108, MIN_RIGHT_BUTTON, tbMinRightButton);
|
||||
CheckBox(win_center_x, y.n, 114, MENU_BUTTON, tbMenuButton);
|
||||
MoreLessBox(22, y.inc(28), 120, 121, tbPanelHeight, PANEL_HEIGHT);
|
||||
MoreLessBox(22, y.inc(32), 122, 123, tbSoftenHeight, SOFTEN_HEIGHT);
|
||||
MoreLessBox(22, y.inc(32), 124, 125, tbButtonOffset, BUTTON_OFFSET);
|
||||
tbPanelHeight.draw(22, y.inc(28));
|
||||
tbSoftenHeight.draw(22, y.inc(32));
|
||||
tbButtonOffset.draw(22, y.inc(32));
|
||||
DrawFrame(PD, frame_y, Form.cwidth-PD-PD, y.inc(32)-frame_y, TASK_FRAME_T);
|
||||
}
|
||||
if (panel_type==ALL) || (panel_type==DOCKY)
|
||||
@ -198,10 +196,10 @@ void LoadCfg()
|
||||
tbCpuUsage = taskbar_flags_ini.GetInt("CpuUsage", 1);
|
||||
tbChangeLang = taskbar_flags_ini.GetInt("ChangeLang", 1);
|
||||
tbMenuButton = taskbar_flags_ini.GetInt("MenuButton", 1);
|
||||
tbPanelHeight = taskbar_vars_ini.GetInt("PanelHeight", 18);
|
||||
tbSoftenHeight = taskbar_vars_ini.GetInt("SoftenHeight", 4);
|
||||
tbButtonOffset = taskbar_vars_ini.GetInt("ButtonTopOffset", 3);
|
||||
tbButtonOffset = taskbar_vars_ini.GetInt("ButtonBotOffset", 3);
|
||||
tbPanelHeight.value = taskbar_vars_ini.GetInt("PanelHeight", 28);
|
||||
tbSoftenHeight.value = taskbar_vars_ini.GetInt("SoftenHeight", 4);
|
||||
tbButtonOffset.value = taskbar_vars_ini.GetInt("ButtonTopOffset", 3);
|
||||
tbButtonOffset.value = taskbar_vars_ini.GetInt("ButtonBotOffset", 3);
|
||||
|
||||
dkLocation = docky_ini.GetInt("location", 0);
|
||||
dkFsize = docky_ini.GetInt("fsize", 0);
|
||||
@ -222,10 +220,10 @@ void SaveCfg(byte panel_type)
|
||||
taskbar_flags_ini.SetInt("CpuUsage", tbCpuUsage);
|
||||
taskbar_flags_ini.SetInt("ChangeLang", tbChangeLang);
|
||||
taskbar_flags_ini.SetInt("MenuButton", tbMenuButton);
|
||||
taskbar_vars_ini.SetInt("PanelHeight", tbPanelHeight);
|
||||
taskbar_vars_ini.SetInt("SoftenHeight", tbSoftenHeight);
|
||||
taskbar_vars_ini.SetInt("ButtonTopOffset", tbButtonOffset);
|
||||
taskbar_vars_ini.SetInt("ButtonBottOffset", tbButtonOffset);
|
||||
taskbar_vars_ini.SetInt("PanelHeight", tbPanelHeight.value);
|
||||
taskbar_vars_ini.SetInt("SoftenHeight", tbSoftenHeight.value);
|
||||
taskbar_vars_ini.SetInt("ButtonTopOffset", tbButtonOffset.value);
|
||||
taskbar_vars_ini.SetInt("ButtonBottOffset", tbButtonOffset.value);
|
||||
}
|
||||
if (panel_type==DOCKY) {
|
||||
docky_ini.SetInt("location", dkLocation);
|
||||
|
Loading…
Reference in New Issue
Block a user