Eolite:Refresh window when changing settings.

Kpack:Fixed bag kpack wait event.

git-svn-id: svn://kolibrios.org@5582 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
pavelyakov 2015-07-19 23:09:56 +00:00
parent 48561dae7e
commit 48efeaf1fc
7 changed files with 132 additions and 39 deletions

View File

@ -50,7 +50,7 @@ int PANEL_X, PANEL_Y;
void main()
{
int key;
dword s1,s2, s3, s4, sides_w;
dword s1,s2, s3, s4, sides_w,i;
mem_Init();
WIN_SIZE_X=GetScreenWidth()+1;
@ -106,11 +106,15 @@ void main()
sc.get();
DefineAndDrawWindow(0,0,WIN_SIZE_X, WIN_SIZE_Y, 0x01, 0, 0, 0x01fffFFF);
//_PutImage(0,0,WIN_SIZE_X,WIN_SIZE_Y,shadow_buf);
if(!i){
_PutImage(0,0,WIN_SIZE_X, PANEL_Y,s1);
draw_main_area(PANEL_X, PANEL_Y, PANEL_SIZE_X, PANEL_SIZE_Y);
_PutImage(0,PANEL_Y,sides_w, PANEL_SIZE_Y+1,s2);
_PutImage(sides_w+PANEL_SIZE_X+1,PANEL_Y,sides_w-1, PANEL_SIZE_Y+1,s3);
_PutImage(0,PANEL_Y+PANEL_SIZE_Y+1,WIN_SIZE_X, PANEL_Y-1,s4);
//i = 1;
}
draw_main_area(PANEL_X, PANEL_Y, PANEL_SIZE_X, PANEL_SIZE_Y);
break;
default: _DRAW:
draw_stars();

View File

@ -35,16 +35,36 @@ void settings_dialog()
unsigned int key;
proc_info settings_form;
if (active_settings){cmd_free = 4;ExitProcess();}
dword save_show_dev_name,save_real_files_names_case, save_info_after_copy, save_use_big_fonts, save_files_h, save_DBLTime;
if (active_settings){
EXIT_SETTING:
show_dev_name = save_show_dev_name;
real_files_names_case = save_real_files_names_case;
info_after_copy = save_info_after_copy;
use_big_fonts = save_use_big_fonts;
files.line_h = save_files_h;
MOUSE_TIME = save_DBLTime;
cmd_free = 4;
ExitProcess();
}
active_settings=1;
SetEventMask(0x27);
save_show_dev_name = show_dev_name;
save_real_files_names_case = real_files_names_case;
save_info_after_copy = info_after_copy;
save_use_big_fonts = use_big_fonts;
save_files_h = files.line_h;
save_DBLTime = MOUSE_TIME;
//SetEventMask(0x27);
loop(){
switch(WaitEvent())
{
case evMouse:
/*case evMouse:
break;
break;*/
case evButton:
id=GetButtonID();
if (id==10)
@ -58,8 +78,7 @@ void settings_dialog()
if (id==1) || (id==11)
{
active_settings=0;
cmd_free = 4;
ExitProcess();
goto EXIT_SETTING;
}
if (id==5)
{
@ -74,6 +93,7 @@ void settings_dialog()
if (id==26) && (files.line_h>8) files.line_h--;
if (id==27) MOUSE_TIME++;
if (id==28) && (MOUSE_TIME>30) MOUSE_TIME--;
RefreshWindow(Form.ID,settings_form.ID);
DrawSettingsCheckBoxes();
break;
@ -83,8 +103,7 @@ void settings_dialog()
{
active_settings = 0;
action_buf = 300;
cmd_free = 4;
ExitProcess();
goto EXIT_SETTING;
}
break;

View File

@ -33,8 +33,8 @@
:void DrawDate(dword x, y, color, in_date)
{
//char text[10];
EDI = in_date;
char text[15];
/*EDI = in_date;
EAX = 47;
EBX = 2<<16;
EDX = x<<16+y;
@ -47,10 +47,10 @@
EDX += 18<<16;
EBX = 4<<16;
ECX = EDI.date.year;
$int 0x40;
$int 0x40;*/
//sprintf(#text,"%d.%d.%d",EDI.date.day,EDI.date.month,EDI.date.year);
//WriteText(x, y, 0x80, 0x80<<24+color, #text);
//sprintf(#text,"%s","ddf");
WriteText(x, y, 0x80, color, "adas\0");
}

View File

@ -1,6 +1,6 @@
//CODED by Veliant, Leency, Nable. GNU GPL licence.
#define LIB_KOLIBRI_H
#define INCLUDE_KOLIBRI_H
#startaddress 0
#code32 TRUE
@ -92,10 +92,10 @@ char program_path[4096];
* up - key release events
* move - event mouse movements
* click - when clicked
* dblclick - double-click the default 50 ms
* dblclick - double-click the default 50 (500 ms)
*/
dword __TMP_TIME,MOUSE_TIME;
:dword __TMP_TIME,MOUSE_TIME;
:struct mouse
{
signed x,y,xx,yy,lkm,mkm,pkm,key,tmp,tmp_time,hor,vert,down,up,move,click,dblclick,left,top;
@ -296,7 +296,7 @@ dword __TMP_TIME,MOUSE_TIME;
}
//------------------------------------------------------------------------------
dword wait_event_code;
:dword wait_event_code;
inline fastcall dword WaitEvent()
{
$mov eax,10
@ -375,6 +375,18 @@ inline fastcall dword GetFreeRAM()
//return eax = ðàçìåð ñâîáîäíîé ïàìÿòè â êèëîáàéòàõ
}
inline void draw_line(dword x1,y1,x2,y2,color)
{
x2--;y2--;y1--;
$mov EAX,38
EBX = x1<<16;
EBX |= x2;
ECX = y1<<16;
ECX |= y2;
$mov EDX,color
$int 0x40
}
inline fastcall dword LoadDriver(ECX) //ECX - èìÿ äðàéâåðà
{
$mov eax, 68
@ -761,6 +773,19 @@ void DefineButton(dword x,y,w,h,EDX,ESI)
$int 0x40
}
inline RefreshWindow(dword ID_REFRESH,ID_ACTIVE)
{
EAX = 18;
EBX = 22;
ECX = 3;
EDX = ID_REFRESH;
$int 0x40
EAX = 18;
EBX = 3;
EDX = ID_ACTIVE;
$int 0x40
}
void UnsafeDefineButton(dword x,y,w,h,EDX,ESI)
{
EAX = 8;
@ -808,15 +833,31 @@ inline fastcall dword GetStartTime()
return mem;
}
:struct _screen
{
dword width,height;
} screen;
:struct _skin
{
dword width,height;
} skin;
dword __generator; // random number generator - äëÿ ãåíåðàöèè ñëó÷àéíûõ ÷èñåë
dword program_path_length;
:dword program_path_length;
//The initialization of the initial data before running
void load_init_main()
{
//program_path_length = strlen(program_path);
skin.height = GetSkinHeight();
screen.width = GetScreenWidth();
screen.height = GetScreenHeight();
//program_path_length = strlen(I_Path);
MOUSE_TIME = 50; //Default 500 ms.
__generator = GetStartTime();
//mem_Init();
main();
}

View File

@ -46,7 +46,7 @@ inline fastcall int random( ECX)
$pop ebx
}
:inline long unirand0(void)
inline long unirand0(void)
{
long k,ans,tmp,save;
save = __generator;
@ -63,7 +63,7 @@ inline fastcall int random( ECX)
}
:long RAND_A,RAND_C,RAND_TMP;
:inline long rand(signed long x1,x2)
inline long rand(signed long x1,x2)
{
long tmp,xx;
RAND_A = __generator;

View File

@ -178,7 +178,7 @@ L2:
$jnz L2
}
:inline dword strncpy(dword text1, text2, signed len)
inline dword strncpy(dword text1, text2, signed len)
signed o1,o2;
{
if(!text1)||(!len) return text1;
@ -237,7 +237,7 @@ inline fastcall void strtrim( ESI)
}
*/
byte __isWhite(int s){ if (s==13)||(s==32)||(s==10)||(s==9) return true; return false; }
inline byte __isWhite(int s){ if (s==13)||(s==32)||(s==10)||(s==9) return true; return false; }
inline void strltrim(dword text){
int s;
dword back_text;
@ -451,7 +451,7 @@ LS3:
}
}
dword strcmpi(dword cmp1, cmp2)
inline dword strcmpi(dword cmp1, cmp2)
{
char si, ue;
@ -470,7 +470,7 @@ dword strcmpi(dword cmp1, cmp2)
}
}
dword strstri(dword searchin, usestr_s)
inline dword strstri(dword searchin, usestr_s)
{
dword usestr_e = usestr_s;
char si, ue;
@ -489,7 +489,7 @@ dword strstri(dword searchin, usestr_s)
}
unsigned int strcpyb(dword search_in, copyin, startstr, endstr)
inline unsigned int strcpyb(dword search_in, copyin, startstr, endstr)
{
dword startp, endp;
dword copyin_start_off = copyin;
@ -662,7 +662,7 @@ inline dword itoa(signed long number)
return ret;
}
:inline fastcall itoa_(signed int EDI, ESI)
inline fastcall itoa_(signed int EDI, ESI)
{
$pusha
EBX = EDI;
@ -695,7 +695,7 @@ F3:
return EBX;
}
:inline dword memchr(dword s,int c,signed len)
inline dword memchr(dword s,int c,signed len)
{
if(!len) return NULL;
do {
@ -706,7 +706,7 @@ F3:
return NULL;
}
:inline dword strdup(dword text)
inline dword strdup(dword text)
{
dword l = strlen(text);
dword ret = malloc(l+1);
@ -715,7 +715,7 @@ F3:
return ret;
}
:inline dword strndup(dword str, signed maxlen)
inline dword strndup(dword str, signed maxlen)
{
dword copy,len;
@ -729,7 +729,36 @@ F3:
return copy;
}
:inline cdecl int sprintf(dword buf, format,...)
inline dword hexdec(dword text)
{
char s;
dword ret,l;
//l = strlen(text);
ret = 0;
s = DSBYTE[text];
//if(l==6)
while(s)
{
ret <<= 4;
if(s>='A')&&(s<='F')ret |= s-'A'+10;
else if(s>='a')&&(s<='f')ret |= s-'a'+10;
else if(s>='0')&&(s<='9')ret |= s-'a'+10;
text++;
s = DSBYTE[text];
}
/*else if(l==3) while(s)
{
ret <<= 4;
if(s>='A')&&(s<='F')ret |= s-'A'+10;
else if(s>='a')&&(s<='f')ret |= s-'a'+10;
else if(s>='0')&&(s<='9')ret |= s-'a'+10;
text++;
s = DSBYTE[text];
}*/
return ret;
}
inline cdecl int sprintf(dword buf, format,...)
{
byte s;
char X[10];
@ -813,7 +842,7 @@ F3:
return buf-ret;
}
void debugi(dword d_int)
inline void debugi(dword d_int)
{
char tmpch[12];
itoa_(#tmpch, d_int);

View File

@ -55,7 +55,7 @@ include '../../../develop/libraries/box_lib/load_lib.mac'
START:
mcall 68,11
mcall 40,0x80000027
mcall 40,0x27
load_libraries l_libs_start,load_lib_end
cmp eax,-1