@menu: return to orthodox flat design

git-svn-id: svn://kolibrios.org@7786 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2020-04-14 11:29:55 +00:00
parent a385ed42e0
commit 4ad25a75b3
18 changed files with 397 additions and 388 deletions

View File

@ -150,18 +150,22 @@ byte cmd_free=0;
#include "include\properties.h" #include "include\properties.h"
#include "include\breadcrumbs.h" #include "include\breadcrumbs.h"
void main() void load_libraries()
{ {
dword id;
byte count_sl = 0;
signed x_old, y_old, dif_x, dif_y, adif_x, adif_y;
char stats;
rand_n = random(40);
load_dll(boxlib, #box_lib_init,0); load_dll(boxlib, #box_lib_init,0);
load_dll(libini, #lib_init,1); load_dll(libini, #lib_init,1);
load_dll(libio, #libio_init,1); load_dll(libio, #libio_init,1);
load_dll(libimg, #libimg_init,1); load_dll(libimg, #libimg_init,1);
}
void main()
{
dword id;
byte count_sl = 0;
rand_n = random(40);
load_libraries();
SetAppColors(); SetAppColors();
LoadIniSettings(); LoadIniSettings();
@ -182,12 +186,9 @@ void main()
{ {
if (strlen(#param)>1) && (param[strlen(#param)-1]=='/') param[strlen(#param)-1]=NULL; //no "/" at the end if (strlen(#param)>1) && (param[strlen(#param)-1]=='/') param[strlen(#param)-1]=NULL; //no "/" at the end
if (dir_exists(#param)==true) if (dir_exists(#param)) {
{
strcpy(#path, #param); strcpy(#path, #param);
} } else {
else
{
notify(T_NOTIFY_APP_PARAM_WRONG); notify(T_NOTIFY_APP_PARAM_WRONG);
} }
} }
@ -196,355 +197,309 @@ void main()
strcpy(#inactive_path, #path); strcpy(#inactive_path, #path);
llist_copy(#files_inactive, #files); llist_copy(#files_inactive, #files);
SetEventMask(EVM_REDRAW+EVM_KEY+EVM_BUTTON+EVM_MOUSE+EVM_MOUSE_FILTER); SetEventMask(EVM_REDRAW+EVM_KEY+EVM_BUTTON+EVM_MOUSE+EVM_MOUSE_FILTER);
loop(){ loop() switch(WaitEventTimeout(50))
switch(WaitEventTimeout(50)) {
{ case evMouse:
case evMouse: if (del_active) || (Form.status_window>2) break;
if (del_active) || (Form.status_window>2) break; if (new_element_active)
{
edit_box_mouse stdcall(#new_file_ed);
break;
}
mouse.get();
ProceedMouseGestures();
if (files.MouseOver(mouse.x, mouse.y))
{
//select file
if (mouse.key&MOUSE_LEFT) && (mouse.up)
{
if (files.ProcessMouse(mouse.x, mouse.y)) List_ReDraw(); else {
if (mouse.y - files.y / files.item_h + files.first == files.cur_y) Open(0);
}
}
//file menu
if (mouse.key&MOUSE_RIGHT) && (mouse.up)
{
if (files.ProcessMouse(mouse.x, mouse.y)) List_ReDraw();
if (getElementSelectedFlag(files.cur_y) == false) selected_count = 0; //on redraw selection would be flashed, see [L001]
EventShowListMenu();
break;
}
}
if (mouse.vert)
{
if (files.MouseScroll(mouse.vert)) List_ReDraw();
break;
}
if (mouse.x>=files.x+files.w) && (mouse.x<=files.x+files.w+16) && (mouse.y>files.y-17) && (mouse.y<files.y)
{
if (mouse.lkm) DrawRectangle3D(files.x+files.w+1,files.y-16,14,14,system.color.work_dark,system.color.work_light);
WHILE (mouse.lkm) && (files.first>0)
{
pause(8);
files.first--;
List_ReDraw();
mouse.get();
}
DrawRectangle3D(files.x+files.w+1,files.y-16,14,14,system.color.work_light,system.color.work_dark);
}
if (mouse.x>=files.x+files.w) && (mouse.x<=files.x+files.w+16) && (mouse.y>files.y+files.h-16) && (mouse.y<files.y+files.h)
{
if (mouse.lkm) DrawRectangle3D(files.x+files.w+1,files.y+files.h-15,14,14,system.color.work_dark,system.color.work_light);
while (mouse.lkm) && (files.first<files.count-files.visible)
{
pause(8);
files.first++;
List_ReDraw();
mouse.get();
}
DrawRectangle3D(files.x+files.w+1,files.y+files.h-15,14,14,system.color.work_light,system.color.work_dark);
}
//Scrooll
if (mouse.x>=files.x+files.w) && (mouse.x<=files.x+files.w+18) && (mouse.y>files.y) && (mouse.y<files.y+files.h-18) && (mouse.lkm) && (!scroll_used) {scroll_used=true; Scroll();}
if (scroll_used) && (mouse.up) { scroll_used=false; Scroll(); }
if (scroll_used)
{
if (sc_slider_h/2+files.y>mouse.y) || (mouse.y<0) || (mouse.y>4000) mouse.y=sc_slider_h/2+files.y; //anee eo?ni? iaa ieiii
id = files.first;
files.first = -sc_slider_h / 2 + mouse.y -files.y * files.count;
files.first /= files.h - 18;
if (files.visible+files.first>files.count) files.first=files.count-files.visible;
if (files.first<0) files.first=0;
if (id!=files.first) List_ReDraw();
break;
}
if (two_panels.checked) && (mouse.y > files.y) && (mouse.down) {
if (mouse.x<Form.cwidth/2)
{
if (active_panel!=1)
{
active_panel = 1;
ChangeActivePanel();
}
}
else
{
if (active_panel!=2)
{
active_panel = 2;
ChangeActivePanel();
}
}
}
break;
//Button pressed-----------------------------------------------------------------------------
case evButton:
id=GetButtonID();
if (new_element_active) || (del_active) {
if(POPUP_BTN1==id) || (POPUP_BTN2==id) {
if (del_active) Del_File(id-POPUP_BTN2);
if (new_element_active) NewElement(id-POPUP_BTN2);
DeleteButton(POPUP_BTN1);
DeleteButton(POPUP_BTN2);
}
break;
}
switch(id)
{
case CLOSE_BTN:
KillProcess(about_thread_id);
SaveIniSettings();
ExitProcess();
case PATH_BTN:
notify(COPY_PATH_STR);
Clipboard__CopyText(#path);
break;
case 21: //Back
EventHistoryGoBack();
break;
case 22: //Forward
EventHistoryGoForward();
break;
case 23:
Dir_Up();
break;
case 24:
Copy(#file_path, CUT);
break;
case 25:
Copy(#file_path, NOCUT);
break;
case 26:
Paste();
break;
case 31...33:
EventSort(id-30);
break;
case 50...60: //Actions
FnProcess(id-50);
break;
case 61: // Set path as default
SetDefaultPath(#path);
break;
case 100...120:
SystemDiscs.Click(id-100);
break;
case BREADCRUMB_ID...360:
ClickOnBreadCrumb(id-BREADCRUMB_ID);
break;
}
break;
//Key pressed-----------------------------------------------------------------------------
case evKey:
GetKeys();
if (Form.status_window>2) break;
if (new_element_active) || (del_active)
{
if (del_active)
{
if (key_scancode == SCAN_CODE_ENTER) Del_File(true);
if (key_scancode == SCAN_CODE_ESC) Del_File(false);
}
if (new_element_active) if (new_element_active)
{ {
edit_box_mouse stdcall(#new_file_ed); if (key_scancode == SCAN_CODE_ENTER) NewElement(true);
break; if (key_scancode == SCAN_CODE_ESC) NewElement(false);
} EAX = key_editbox;
edit_box_key stdcall (#new_file_ed);
mouse.get();
if (!mouse.mkm) && (stats>0) stats = 0;
if (mouse.mkm) && (!stats)
{
x_old = mouse.x;
y_old = mouse.y;
stats = 1;
}
if (mouse.mkm) && (stats==1)
{
dif_x = mouse.x-x_old;
dif_y = mouse.y-y_old;
adif_x = fabs(dif_x);
adif_y = fabs(dif_y);
if (adif_x>adif_y)
{
if (dif_x > 150)
{
if (history.forward())
{
strcpy(#path, history.current());
files.KeyHome();
Open_Dir(#path,WITH_REDRAW);
}
stats = 0;
}
if (dif_x < -150)
{
GoBack();
stats = 0;
}
}
else
{
if (dif_y < -100)
{
Dir_Up();
stats = 0;
}
}
}
if (files.MouseOver(mouse.x, mouse.y))
{
//select file
if (mouse.key&MOUSE_LEFT) && (mouse.up)
{
if (files.ProcessMouse(mouse.x, mouse.y)) List_ReDraw(); else {
if (mouse.y - files.y / files.item_h + files.first == files.cur_y) Open(0);
}
}
//file menu
if (mouse.key&MOUSE_RIGHT) && (mouse.up)
{
if (files.ProcessMouse(mouse.x, mouse.y)) List_ReDraw();
if (getElementSelectedFlag(files.cur_y) == false) selected_count = 0; //on redraw selection would be flashed, see [L001]
EventShowListMenu();
break;
}
}
if (mouse.vert)
{
if (files.MouseScroll(mouse.vert)) List_ReDraw();
break;
}
if (mouse.x>=files.x+files.w) && (mouse.x<=files.x+files.w+16) && (mouse.y>files.y-17) && (mouse.y<files.y)
{
if (mouse.lkm) DrawRectangle3D(files.x+files.w+1,files.y-16,14,14,system.color.work_dark,system.color.work_light);
WHILE (mouse.lkm) && (files.first>0)
{
pause(8);
files.first--;
List_ReDraw();
mouse.get();
}
DrawRectangle3D(files.x+files.w+1,files.y-16,14,14,system.color.work_light,system.color.work_dark);
}
if (mouse.x>=files.x+files.w) && (mouse.x<=files.x+files.w+16) && (mouse.y>files.y+files.h-16) && (mouse.y<files.y+files.h)
{
if (mouse.lkm) DrawRectangle3D(files.x+files.w+1,files.y+files.h-15,14,14,system.color.work_dark,system.color.work_light);
while (mouse.lkm) && (files.first<files.count-files.visible)
{
pause(8);
files.first++;
List_ReDraw();
mouse.get();
}
DrawRectangle3D(files.x+files.w+1,files.y+files.h-15,14,14,system.color.work_light,system.color.work_dark);
}
//Scrooll
if (mouse.x>=files.x+files.w) && (mouse.x<=files.x+files.w+18) && (mouse.y>files.y) && (mouse.y<files.y+files.h-18) && (mouse.lkm) && (!scroll_used) {scroll_used=true; Scroll();}
if (scroll_used) && (mouse.up) { scroll_used=false; Scroll(); }
if (scroll_used)
{
if (sc_slider_h/2+files.y>mouse.y) || (mouse.y<0) || (mouse.y>4000) mouse.y=sc_slider_h/2+files.y; //anee eo?ni? iaa ieiii
id = files.first;
files.first = -sc_slider_h / 2 + mouse.y -files.y * files.count;
files.first /= files.h - 18;
if (files.visible+files.first>files.count) files.first=files.count-files.visible;
if (files.first<0) files.first=0;
if (id!=files.first) List_ReDraw();
break;
}
if (two_panels.checked) && (mouse.y > files.y) && (mouse.down) {
if (mouse.x<Form.cwidth/2)
{
if (active_panel!=1)
{
active_panel = 1;
ChangeActivePanel();
}
}
else
{
if (active_panel!=2)
{
active_panel = 2;
ChangeActivePanel();
}
}
} }
break; break;
//Button pressed----------------------------------------------------------------------------- }
case evButton:
id=GetButtonID();
if (new_element_active) || (del_active) { if (files.ProcessKey(key_scancode))
if(POPUP_BTN1==id) || (POPUP_BTN2==id) { {
if (del_active) Del_File(id-POPUP_BTN2); List_ReDraw();
if (new_element_active) NewElement(id-POPUP_BTN2); break;
DeleteButton(POPUP_BTN1); }
DeleteButton(POPUP_BTN2);
}
break;
}
switch(id) if (key_modifier&KEY_LCTRL) || (key_modifier&KEY_RCTRL)
{
switch(key_scancode)
{ {
case CLOSE_BTN: case SCAN_CODE_F1...SCAN_CODE_F3:
KillProcess(about_thread_id); EventSort(key_scancode - 58);
SaveIniSettings();
ExitProcess();
case PATH_BTN:
notify(COPY_PATH_STR);
Clipboard__CopyText(#path);
break; break;
case 21: //Back case SCAN_CODE_1...SCAN_CODE_10:
GoBack(); key_scancode-=2;
break; if (key_scancode >= SystemDiscs.list.count) break;
case 22: //Forward if (!two_panels.checked)
if (history.forward())
{ {
strcpy(#path, history.current()); DrawRectangle(17,key_scancode*16+74,159,16, 0); //display click
files.KeyHome(); pause(7);
Open_Dir(#path,WITH_REDRAW);
} }
SystemDiscs.Click(key_scancode);
break; break;
case 23: case SCAN_CODE_KEY_X:
Dir_Up();
break;
case 24:
Copy(#file_path, CUT); Copy(#file_path, CUT);
break; break;
case 25: case SCAN_CODE_KEY_C:
Copy(#file_path, NOCUT); Copy(#file_path, NOCUT);
break; break;
case 26: case SCAN_CODE_KEY_V:
Paste(); Paste();
break; break;
case 31...33: case SCAN_CODE_KEY_D: //set image as bg
EventSort(id-30); strlcpy(#temp, "\\S__",4);
strcat(#temp, #file_path);
RunProgram("/sys/media/kiv", #temp);
break; break;
case 50...60: //Actions case SCAN_CODE_KEY_N: //create new window
FnProcess(id-50); if (Form.left==98) MoveSize(Form.left-20,Form.top-20,OLD,OLD);
RunProgram(I_Path, #path);
break; break;
case 61: // Set path as default case SCAN_CODE_KEY_M:
SetDefaultPath(#path); Open_Dir(#inactive_path,WITH_REDRAW);
break;
case SCAN_CODE_ENTER:
if (!itdir) ShowOpenWithDialog();
else Open(1);
break;
case SCAN_CODE_KEY_A:
EventSelectAllFiles(true);
break;
case SCAN_CODE_KEY_U: //unselect all files
selected_count = 0;
EventSelectAllFiles(false);
break; break;
case 100...120:
SystemDiscs.Click(id-100);
break;
case BREADCRUMB_ID...360:
ClickOnBreadCrumb(id-BREADCRUMB_ID);
break;
} }
break; break;
}
//Key pressed----------------------------------------------------------------------------- switch (key_scancode)
case evKey: {
GetKeys(); case SCAN_CODE_BS:
//EventHistoryGoBack();
Dir_Up();
break;
case SCAN_CODE_ENTER:
Open(0);
break;
case SCAN_CODE_TAB:
if (!two_panels.checked) break;
if (active_panel==1) active_panel=2; else active_panel=1;
ChangeActivePanel();
DrawFilePanels();
break;
case SCAN_CODE_MENU:
mouse.x = files.x+15;
mouse.y = files.cur_y - files.first * files.item_h + files.y + 5;
EventShowListMenu();
break;
case SCAN_CODE_DEL:
Del_Form();
break;
case SCAN_CODE_INS:
if (getElementSelectedFlag(files.cur_y) == true) setElementSelectedFlag(files.cur_y, false);
else setElementSelectedFlag(files.cur_y, true);
files.KeyDown();
List_ReDraw();
DrawStatusBar();
break;
case SCAN_CODE_F1...SCAN_CODE_F10:
FnProcess(key_scancode-58);
break;
default:
EventSelectFileByKeyPress();
}
break;
case evIPC:
case evReDraw:
draw_window();
if (CheckActiveProcess(Form.ID)) && (GetMenuClick()) break;
if (action_buf==OPERATION_END)
{
FnProcess(5);
if (copy_stak) SelectFileByName(#copy_to+strrchr(#copy_to,'/'));
action_buf=0;
}
break;
default:
if (Form.status_window>2) break;
EventRefreshDisksAndFolders();
}
if (Form.status_window>2) break; if(cmd_free)
{
if (new_element_active) || (del_active) if(cmd_free==2) about_stak=free(about_stak);
{ else if(cmd_free==3) properties_stak=free(properties_stak);
if (del_active) else if(cmd_free==4) settings_stak=free(settings_stak);
{ else if(cmd_free==5) copy_stak=free(copy_stak);
if (key_scancode == SCAN_CODE_ENTER) Del_File(true); else if(cmd_free==6) delete_stak=free(delete_stak);
if (key_scancode == SCAN_CODE_ESC) Del_File(false); cmd_free = false;
}
if (new_element_active)
{
if (key_scancode == SCAN_CODE_ENTER) NewElement(true);
if (key_scancode == SCAN_CODE_ESC) NewElement(false);
EAX = key_editbox;
edit_box_key stdcall (#new_file_ed);
}
break;
}
if (files.ProcessKey(key_scancode))
{
List_ReDraw();
break;
}
if (key_modifier&KEY_LCTRL) || (key_modifier&KEY_RCTRL)
{
switch(key_scancode)
{
case SCAN_CODE_F1...SCAN_CODE_F3:
EventSort(key_scancode - 58);
break;
case SCAN_CODE_1...SCAN_CODE_10:
key_scancode-=2;
if (key_scancode >= SystemDiscs.list.count) break;
if (!two_panels.checked)
{
DrawRectangle(17,key_scancode*16+74,159,16, 0); //display click
pause(7);
}
SystemDiscs.Click(key_scancode);
break;
case SCAN_CODE_KEY_X:
Copy(#file_path, CUT);
break;
case SCAN_CODE_KEY_C:
Copy(#file_path, NOCUT);
break;
case SCAN_CODE_KEY_V:
Paste();
break;
case SCAN_CODE_KEY_D: //set image as bg
strlcpy(#temp, "\\S__",4);
strcat(#temp, #file_path);
RunProgram("/sys/media/kiv", #temp);
break;
case SCAN_CODE_KEY_N: //create new window
if (Form.left==98) MoveSize(Form.left-20,Form.top-20,OLD,OLD);
RunProgram(I_Path, #path);
break;
case SCAN_CODE_KEY_M:
Open_Dir(#inactive_path,WITH_REDRAW);
break;
case SCAN_CODE_ENTER:
if (!itdir) ShowOpenWithDialog();
else Open(1);
break;
case SCAN_CODE_KEY_A:
EventSelectAllFiles(true);
break;
case SCAN_CODE_KEY_U: //unselect all files
selected_count = 0;
EventSelectAllFiles(false);
break;
}
break;
}
switch (key_scancode)
{
case SCAN_CODE_BS:
//GoBack();
Dir_Up();
break;
case SCAN_CODE_ENTER:
Open(0);
break;
case SCAN_CODE_TAB:
if (!two_panels.checked) break;
if (active_panel==1) active_panel=2; else active_panel=1;
ChangeActivePanel();
DrawFilePanels();
break;
case SCAN_CODE_MENU:
mouse.x = files.x+15;
mouse.y = files.cur_y - files.first * files.item_h + files.y + 5;
EventShowListMenu();
break;
case SCAN_CODE_DEL:
Del_Form();
break;
case SCAN_CODE_INS:
if (getElementSelectedFlag(files.cur_y) == true) setElementSelectedFlag(files.cur_y, false);
else setElementSelectedFlag(files.cur_y, true);
files.KeyDown();
List_ReDraw();
DrawStatusBar();
break;
case SCAN_CODE_F1...SCAN_CODE_F10:
FnProcess(key_scancode-58);
break;
default:
EventSelectFileByKeyPress();
}
break;
case evIPC:
case evReDraw:
draw_window();
if (CheckActiveProcess(Form.ID)) && (GetMenuClick()) break;
if (action_buf==OPERATION_END)
{
FnProcess(5);
if (copy_stak) SelectFileByName(#copy_to+strrchr(#copy_to,'/'));
action_buf=0;
}
break;
default:
if (Form.status_window>2) break;
EventRefreshDisksAndFolders();
}
if(cmd_free)
{
if(cmd_free==2) about_stak=free(about_stak);
else if(cmd_free==3) properties_stak=free(properties_stak);
else if(cmd_free==4) settings_stak=free(settings_stak);
else if(cmd_free==5) copy_stak=free(copy_stak);
else if(cmd_free==6) delete_stak=free(delete_stak);
cmd_free = false;
}
} }
} }
@ -817,7 +772,7 @@ void Open_Dir(dword dir_path, redraw){
if (errornum) if (errornum)
{ {
history.add(#path); history.add(#path);
GoBack(); EventHistoryGoBack();
Write_Error(errornum); Write_Error(errornum);
return; return;
} }
@ -973,7 +928,7 @@ void Open(byte rez)
} }
} }
inline fastcall void GoBack() inline fastcall void EventHistoryGoBack()
{ {
char cur_folder[4096]; char cur_folder[4096];
strcpy(#cur_folder, #path); strcpy(#cur_folder, #path);
@ -1091,26 +1046,22 @@ void FnProcess(byte N)
switch(N) switch(N)
{ {
case 1: case 1:
if (!active_about) if (!active_about) {
{
about_stak = malloc(4096); about_stak = malloc(4096);
about_thread_id = CreateThread(#about_dialog,about_stak+4092); about_thread_id = CreateThread(#about_dialog,about_stak+4092);
break; break;
} } else {
else
{
ActivateWindow(GetProcessSlot(about_thread_id)); ActivateWindow(GetProcessSlot(about_thread_id));
} }
break; break;
case 2: case 2:
if (!files.count) break; if (files.count) NewElement_Form(RENAME_ITEM, #file_name);
NewElement_Form(RENAME_ITEM, #file_name);
break; break;
case 3: case 3:
if (!itdir) RunProgram("/sys/tinypad", #file_path); if (files.count) && (!itdir) RunProgram("/sys/tinypad", #file_path);
break; break;
case 4: case 4:
if (!itdir) RunProgram("/sys/develop/heed", #file_path); if (files.count) && (!itdir) RunProgram("/sys/develop/heed", #file_path);
break; break;
case 5: //refresh cur dir & devs case 5: //refresh cur dir & devs
if (two_panels.checked) if (two_panels.checked)
@ -1238,4 +1189,49 @@ void EventSort(dword id)
SelectFileByName(#selected_filename); SelectFileByName(#selected_filename);
} }
void EventHistoryGoForward()
{
if (history.forward()) {
strcpy(#path, history.current());
files.KeyHome();
Open_Dir(#path,WITH_REDRAW);
}
}
void ProceedMouseGestures()
{
char stats;
signed x_old, y_old, dif_x, dif_y, adif_x, adif_y;
if (!mouse.mkm) && (stats>0) stats = 0;
if (mouse.mkm) && (!stats)
{
x_old = mouse.x;
y_old = mouse.y;
stats = 1;
}
if (mouse.mkm) && (stats==1)
{
dif_x = mouse.x-x_old;
dif_y = mouse.y-y_old;
adif_x = fabs(dif_x);
adif_y = fabs(dif_y);
if (adif_x>adif_y) {
if (dif_x > 150) {
EventHistoryGoForward();
stats = 0;
}
if (dif_x < -150) {
EventHistoryGoBack();
stats = 0;
}
} else {
if (dif_y < -100) {
Dir_Up();
stats = 0;
}
}
}
}
stop: stop:

View File

@ -5,8 +5,8 @@ struc system_colors
{ {
.frame dd ? .frame dd ?
.grab dd ? .grab dd ?
.work_3d_dark dd ? .work_dark dd ?
.work_3d_light dd ? .work_light dd ?
.grab_text dd ? .grab_text dd ?
.work dd ? .work dd ?
.work_button dd ? .work_button dd ?

View File

@ -5,8 +5,8 @@ struc system_colors
{ {
.frame dd ? .frame dd ?
.grab dd ? .grab dd ?
.work_3d_dark dd ? .work_dark dd ?
.work_3d_light dd ? .work_light dd ?
.grab_text dd ? .grab_text dd ?
.work dd ? .work dd ?
.work_button dd ? .work_button dd ?

View File

@ -5,8 +5,8 @@ struc system_colors
{ {
.frame dd ? .frame dd ?
.grab dd ? .grab dd ?
.work_3d_dark dd ? .work_dark dd ?
.work_3d_light dd ? .work_light dd ?
.grab_text dd ? .grab_text dd ?
.work dd ? .work dd ?
.work_button dd ? .work_button dd ?

View File

@ -28,8 +28,8 @@ align 4
app_colours: app_colours:
w_frame dd ? w_frame dd ?
w_grab dd ? w_grab dd ?
w_work_3d_dark dd ? w_work_dark dd ?
w_work_3d_light dd ? w_work_light dd ?
w_grab_text dd ? w_grab_text dd ?
w_work dd ? w_work dd ?
w_work_button dd ? w_work_button dd ?

View File

@ -3207,8 +3207,8 @@ app_colours:
w_frame rd 1 w_frame rd 1
w_grab rd 1 w_grab rd 1
w_work_3d_dark rd 1 w_work_dark rd 1
w_work_3d_light rd 1 w_work_light rd 1
w_grab_text rd 1 w_grab_text rd 1
w_work rd 1 w_work rd 1
w_work_button rd 1 w_work_button rd 1

View File

@ -47,7 +47,7 @@ inline fastcall void GetProcessInfo(dword EBX, ECX)
} }
struct system_colors{ struct system_colors{
dword frame,grab,work_3d_dark,work_3d_light,grab_text,work,work_button,work_button_text,work_text,work_graph; dword frame,grab,work_dark,work_light,grab_text,work,work_button,work_button_text,work_text,work_graph;
void get(); void get();
}; };

View File

@ -73,8 +73,8 @@ struct SystemColours
{ {
dword nonset1, dword nonset1,
nonset2, nonset2,
work_3d_dark, work_dark,
work_3d_light, work_light,
w_title, w_title,
w_work, w_work,
w_work_button, w_work_button,

View File

@ -1,3 +1,12 @@
BT_DEL equ 0x80000000
BT_HIDE equ 0x40000000
BT_NOFRAME equ 0x20000000
macro DefineButton x, y, w, h, id, background_color
{
mcall 8, (x) shl 16 + (w), (y) shl 16 + (h), id, background_color
}
macro DrawBar x, y, width, height, color macro DrawBar x, y, width, height, color
{ {
mcall 13, (x) shl 16 + (width), (y) shl 16 + (height), color mcall 13, (x) shl 16 + (width), (y) shl 16 + (height), color
@ -39,11 +48,3 @@ macro WriteTextBold x, y, fontType, color, text
mcall mcall
} }
BT_DEL equ 0x80000000
BT_HIDE equ 0x40000000
BT_NOFRAME equ 0x20000000
macro DefineButton x, y, w, h, id, background_color
{
mcall 8, (x) shl 16 + (w), (y) shl 16 + (h), id, background_color
}

View File

@ -469,8 +469,8 @@ ends
struct system_colors struct system_colors
frame dd ? ;nonset1 frame dd ? ;nonset1
grab dd ? ;nonset2 grab dd ? ;nonset2
work_3d_dark dd ? work_dark dd ?
work_3d_light dd ? work_light dd ?
grab_text dd ? ;window_title grab_text dd ? ;window_title
work dd ? work dd ?
work_button dd ? work_button dd ?

View File

@ -224,8 +224,8 @@ struc sys_color_table
{ {
.frames: dd ? ;+0 .frames: dd ? ;+0
.grab: dd ? ;+4 .grab: dd ? ;+4
.work_3d_dark: dd ? ;+8 .work_dark: dd ? ;+8
.work_3d_light: dd ? ;+12 .work_light: dd ? ;+12
.grab_text: dd ? ;+16 .grab_text: dd ? ;+16
.work: dd ? ;+20 .work: dd ? ;+20
.work_button: dd ?;+24 .work_button: dd ?;+24

View File

@ -59,8 +59,8 @@ window:
sc: sc:
.frames dd 0 .frames dd 0
.grab dd 0 .grab dd 0
.work_3d_dark dd 0 .work_dark dd 0
.work_3d_light dd 0 .work_light dd 0
.grab_text dd 0 .grab_text dd 0
.work dd 0 .work dd 0
.work_button dd 0 .work_button dd 0

View File

@ -715,7 +715,7 @@ next_button:
cmp [edx], byte 'x' cmp [edx], byte 'x'
jne next_line jne next_line
DrawRectangle3D DISPLAY_X-1,DISPLAY_Y-1,DISPLAY_W+2,DISPLAY_H+2, [sc.work_3d_dark], [sc.work_3d_light] DrawRectangle3D DISPLAY_X-1,DISPLAY_Y-1,DISPLAY_W+2,DISPLAY_H+2, [sc.work_dark], [sc.work_light]
DrawRectangle DISPLAY_X,DISPLAY_Y,DISPLAY_W,DISPLAY_H, [sc.work_graph] DrawRectangle DISPLAY_X,DISPLAY_Y,DISPLAY_W,DISPLAY_H, [sc.work_graph]
mcall 38, < DISPLAY_X+1, DISPLAY_W+DISPLAY_X-1>, <DISPLAY_Y+1, DISPLAY_Y+1>, 0xE0E0E0 ; internal shadow mcall 38, < DISPLAY_X+1, DISPLAY_W+DISPLAY_X-1>, <DISPLAY_Y+1, DISPLAY_Y+1>, 0xE0E0E0 ; internal shadow
mcall , < DISPLAY_X+1, DISPLAY_X+1>, <DISPLAY_Y+2, DISPLAY_Y+DISPLAY_H-1>, ; internal shadow mcall , < DISPLAY_X+1, DISPLAY_X+1>, <DISPLAY_Y+2, DISPLAY_Y+DISPLAY_H-1>, ; internal shadow

View File

@ -1,6 +0,0 @@
@erase lang.inc
@echo lang fix ru >lang.inc
@fasm -m 16384 menu.asm @menu
@kpack @menu
@erase lang.inc
@pause

View File

@ -21,6 +21,7 @@
; Compile with FASM for Menuet ; Compile with FASM for Menuet
;****************************************************************************** ;******************************************************************************
BTN_HEIGHT = 22 BTN_HEIGHT = 22
BTN_WIDTH = 140
TXT_Y = (BTN_HEIGHT)/2-4 TXT_Y = (BTN_HEIGHT)/2-4
PANEL_HEIGHT = 20 PANEL_HEIGHT = 20
@ -39,8 +40,8 @@
dd bootparam ; boot parameters dd bootparam ; boot parameters
dd 0x0 ; path dd 0x0 ; path
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
include "lang.inc"
include "..\..\..\macros.inc" include "..\..\..\macros.inc"
include "..\..\..\gui_patterns.inc"
;include "../../../debug.inc" ; debug macros ;include "../../../debug.inc" ; debug macros
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
align 4 align 4
@ -475,7 +476,7 @@ mouse: ; MOUSE EVENT HANDLER
jnz click jnz click
mcall 37,1 mcall 37,1
ror eax,16 ; eax = [ Y | X ] relative to window ror eax,16 ; eax = [ Y | X ] relative to window
cmp ax,140 ; pointer in window? cmp ax,BTN_WIDTH ; pointer in window?
ja noinwindow ja noinwindow
; *** in window *** ; *** in window ***
shr eax,16 ; eax = [ 0 | Y ] shr eax,16 ; eax = [ 0 | Y ]
@ -722,10 +723,11 @@ align 4
.1: .1:
shl ecx,16 shl ecx,16
add ecx,eax ; ecx = [ Y_START | Y_SIZE ] add ecx,eax ; ecx = [ Y_START | Y_SIZE ]
dec ecx
movzx ebx,[edi + x_start] movzx ebx,[edi + x_start]
shl ebx,16 shl ebx,16
mov bx,140 ; ebx = [ X_START | X_SIZE ] mov bx,BTN_WIDTH ; ebx = [ X_START | X_SIZE ]
mov edx,0x01000000 ; color of work area RRGGBB,8->color gl mov edx,0x01000000 ; color of work area RRGGBB,8->color gl
mov esi,edx ; unmovable window mov esi,edx ; unmovable window
@ -788,9 +790,10 @@ draw_one_button:
; receives number of button in dl ; receives number of button in dl
push edx push edx
mov eax,8 mov eax,8
mov ebx,140 mov ebx,BTN_WIDTH
movzx ecx,dl movzx ecx,dl
imul ecx,BTN_HEIGHT imul ecx,BTN_HEIGHT
mov [draw_y], ecx
shl ecx,16 shl ecx,16
add ecx,BTN_HEIGHT add ecx,BTN_HEIGHT
; edx = button identifier ; edx = button identifier
@ -798,6 +801,7 @@ draw_one_button:
cmp esi,0xdfdfdf cmp esi,0xdfdfdf
jb nocorrect jb nocorrect
sub esi,0x1b1b1b sub esi,0x1b1b1b
;-------------------------------------- ;--------------------------------------
align 4 align 4
nocorrect: nocorrect:
@ -808,12 +812,24 @@ nocorrect:
;-------------------------------------- ;--------------------------------------
align 4 align 4
.nohighlight: .nohighlight:
or edx,0x20000000 or edx,BT_NOFRAME + BT_HIDE
; dunkaist[ ; dunkaist[
add edx,0xd1ff00 ; This makes first menu buttons differ add edx,0xd1ff00 ; This makes first menu buttons differ
; from system close button with 0x000001 id ; from system close button with 0x000001 id
; dunkaist] ; dunkaist]
mcall mcall
pusha
mov edx, esi
mcall 13
mcall , BTN_WIDTH, <[draw_y],1>, [sc.work_light]
mcall , 1, <[draw_y],BTN_HEIGHT>
mcall , <BTN_WIDTH,1>, <[draw_y],BTN_HEIGHT+1>, [sc.work_dark]
add [draw_y], BTN_HEIGHT-1
mcall , BTN_WIDTH, <[draw_y],1>
popa
movzx edx,dl movzx edx,dl
dec dl dec dl
imul ebx,edx,BTN_HEIGHT imul ebx,edx,BTN_HEIGHT
@ -911,6 +927,8 @@ screen_size:
.y dw ? .y dw ?
.x dw ? .x dw ?
;-------------------------------------- ;--------------------------------------
draw_y dd ?
;--------------------------------------
x_working_area: x_working_area:
.right: dw ? .right: dw ?
.left: dw ? .left: dw ?

View File

@ -359,7 +359,7 @@ draw_window:
m2m dword [frame_data.font_backgr_color],[sc.work] m2m dword [frame_data.font_backgr_color],[sc.work]
m2m dword [frame_data.font_color],[sc.work_text] m2m dword [frame_data.font_color],[sc.work_text]
m2m dword [frame_data.ext_fr_col],[sc.work_graph] m2m dword [frame_data.ext_fr_col],[sc.work_graph]
m2m dword [frame_data.int_fr_col],[sc.work_3d_light] m2m dword [frame_data.int_fr_col],[sc.work_light]
push dword frame_data push dword frame_data
call [Frame_draw] call [Frame_draw]

View File

@ -33,8 +33,8 @@ app_colours:
w_frame dd ? w_frame dd ?
w_grab dd ? w_grab dd ?
w_work_3d_dark dd ? w_work_dark dd ?
w_work_3d_light dd ? w_work_light dd ?
w_grab_text dd ? w_grab_text dd ?
w_work dd ? w_work dd ?
w_work_button dd ? w_work_button dd ?