From 9f3afe93b0760eec14cbd005e95d05797534fc2d Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Thu, 23 Jul 2015 12:15:53 +0000 Subject: [PATCH] Eolite: move paste action into one place git-svn-id: svn://kolibrios.org@5608 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/eolite/Eolite.c | 23 +++++++++-------------- programs/cmm/eolite/include/copy.h | 8 +++++++- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/programs/cmm/eolite/Eolite.c b/programs/cmm/eolite/Eolite.c index 050dbd7a9e..a1493cac27 100644 --- a/programs/cmm/eolite/Eolite.c +++ b/programs/cmm/eolite/Eolite.c @@ -146,6 +146,8 @@ byte dword eolite_ini_path; +dword menu_stak,about_stak,properties_stak,settings_stak,copy_stak; + proc_info Form; system_colors sc; mouse m; @@ -178,7 +180,6 @@ byte cmd_free; #include "include\settings.h" #include "include\properties.h" -dword menu_stak,about_stak,properties_stak,settings_stak,copy_stak; void main() { @@ -377,18 +378,17 @@ void main() Open_Dir(#path,WITH_REDRAW); } break; - case 23: //up! + case 23: Dir_Up(); break; - case 24: //cut + case 24: Copy(#file_path, CUT); break; - case 25: //copy + case 25: Copy(#file_path, NOCUT); break; - case 26: //paste - copy_stak = malloc(4096); - CreateThread(#Paste,copy_stak+4092); + case 26: + Paste(); break; case 31...33: //sort if(sort_num==1) DrawFilledBar(sorting_arrow_x,42,6,10); @@ -461,8 +461,7 @@ void main() Copy(#file_path, NOCUT); break; case 022: //Ctrl+V - copy_stak = malloc(4096); - CreateThread(#Paste,copy_stak+4092); + Paste(); break; case 001: //Ctrl+A debugln("press Ctrl+A"); @@ -601,11 +600,7 @@ void menu_action(dword id) if (id==203) FnProcess(4); //F4 if (id==104) Copy(#file_path, NOCUT); if (id==105) Copy(#file_path, CUT); - if (id==106) - { - copy_stak = malloc(4096); - CreateThread(#Paste,copy_stak+4092); - } + if (id==106) Paste(); if (id==207) FnProcess(2); if (id==108) Del_Form(); if (id==109) FnProcess(5); diff --git a/programs/cmm/eolite/include/copy.h b/programs/cmm/eolite/include/copy.h index 94636c787b..921b21a630 100644 --- a/programs/cmm/eolite/include/copy.h +++ b/programs/cmm/eolite/include/copy.h @@ -1,4 +1,10 @@ +void Paste() { + copy_stak = malloc(4096); + CreateThread(#PasteThread,copy_stak+4092); +} + + byte copy_to[4096]; byte copy_from[4096]; byte cut_active=0; @@ -46,7 +52,7 @@ void Copy(dword pcth, char cut) } -void Paste() +void PasteThread() { char copy_rezult; int j;