1 ;---------------------------------------------------------------------
\rk_option:
\r test dword [status],64
\r jnz still
\r or dword [status],64
\r\r call get_memory_for_thread_stack
\r mov [thread_stack_7],eax
\r mcall 51,1,thread7 ; thread_stack_7
\r jmp still
\r;---------------------------------------------------------------------
\rget_memory_for_thread_stack:
\r mcall 68,12,4096
\r mov edx,eax
\r add edx,4096
\r ret
\r;---------------------------------------------------------------------
\rthread7: ; start of bgrd thread
\r mcall 9, procinfo_threads, -1
\r mov eax,[ebx+30]
\r mov [PID7],eax
\r mcall 40,0x27
\r mov eax,[slide_show_delay]
\r mov [slide_show_delay_old],eax
\r mov eax,[arrows_offset]
\r mov [arrows_offset_old],eax
\r mov eax,[check1.flags]
\r mov [show_file_name_old],eax
\r mov eax,[check2.flags]
\r mov [filtering_flag_old],eax
\r xor eax,eax
\r mov [option_pointer],eax
\r call .set_pointers
\r;-----------------------------------------
\r.red:
\r call .draw_window
\r;-----------------------------------------
\r.still:
\r mcall 10 ; wait here for event
\r\r cmp eax,1 ; redraw request ?
\r je .red
\r \r cmp eax,2 ; key in buffer ?
\r je .key
\r \r cmp eax,3 ; button in buffer ?
\r je .button
\r \r cmp eax,6 ; mouse in buffer ?
\r je .mouse
\r \r jmp .still
\r;---------------------------------------------------------------------
\r.mouse:
\r mov ebx,[check1.flags]
\r and ebx,10b
\r push dword check1
\r call [check_box_mouse]
\r mov eax,[check1.flags]
\r and eax,10b
\r cmp ebx,eax
\r je @f ;.still
\r \r mov [option_pointer],2
\r call .set_pointers
\r call .draw_all_options_values
\r jmp .still
\r;---------------------------------------------------------------------
\r@@:
\r mov ebx,[check2.flags]
\r and ebx,10b
\r push dword check2
\r call [check_box_mouse]
\r mov eax,[check2.flags]
\r and eax,10b
\r cmp ebx,eax
\r je .still
\r \r mov [option_pointer],3
\r call .set_pointers
\r call .draw_all_options_values
\r jmp .still
\r;---------------------------------------------------------------------
\r.key:
\r mcall
\r cmp ah,27
\r je .close
\r \r cmp ah,13
\r je .kok
\r \r cmp ah,32
\r je .select_space
\r \r cmp ah,56 ;plus
\r je .select_plus ;.plus_slide_show_delay
\r \r cmp ah,43 ;plus
\r je .select_plus ;.plus_slide_show_delay
\r \r cmp ah,61 ;plus
\r je .select_plus ;.plus_slide_show_delay
\r \r cmp ah,54 ;minus
\r je .select_minus ;.minus_slide_show_delay
\r \r cmp ah,45 ;minus
\r je .select_minus ;.minus_slide_show_delay
\r \r cmp ah,95 ;minus
\r je .select_minus ;.minus_slide_show_delay
\r \r cmp ah,178 ;up arrow
\r je .up_arrow
\r \r cmp ah,177 ;down arrow
\r je .down_arrow
\r \r jmp .still
\r;---------------------------------------------------------------------
\r.button: ; button
\r mov eax,17 ; get id
\r mcall
\r \r cmp ah,5
\r je .minus_arrows_offset
\r \r cmp ah,4
\r je .plus_arrows_offset
\r \r cmp ah,3
\r je .minus_slide_show_delay
\r \r cmp ah,2
\r je .plus_slide_show_delay
\r\r cmp ah,1 ; button id=1 ?
\r jne .noclose
\r;-----------------------------------
\r.close:
\r mov eax,[slide_show_delay_old]
\r mov [slide_show_delay],eax
\r mov eax,[arrows_offset_old]
\r mov [arrows_offset],eax
\r mov eax,[show_file_name_old]
\r mov [check1.flags],eax
\r mov eax,[filtering_flag_old]
\r mov [check2.flags],eax
\r jmp .close_all
\r;---------------------------------------------------------------------
\r.close_1:
\r mov eax,[check2.flags]
\r test eax,10b
\r jz @f
\r \r mov [filtering_flag],1
\r jmp .redraw_flag
\r;---------------------------------------------------------------------
\r@@:
\r mov [filtering_flag],0
\r.redraw_flag:
\r mov [redraw_flag],byte 1
\r.close_all:
\r xor dword [status],64
\r xor eax,eax
\r mov [PID7],eax
\r mcall 68,13,[thread_stack_7]
\r mcall -1 ; close this program
\r;---------------------------------------------------------------------
\r.noclose:
\r.kok:
\r jmp .close_1
\r;---------------------------------------------------------------------
\r.select_plus:
\r jmp [plus_pointer]
\r;---------------------------------------------------------------------
\r.select_minus:
\r jmp [minus_pointer]
\r;---------------------------------------------------------------------
\r.select_space:
\r jmp [space_pointer]
\r;---------------------------------------------------------------------
\r.plus_slide_show_delay:
\r cmp [option_pointer],0
\r je @f
\r \r mov [option_pointer],0
\r call .draw_all_options_values
\r@@:
\r cmp [slide_show_delay],99990
\r je .still
\r \r add [slide_show_delay],10
\r call .draw_slide_show_delay
\r jmp .still
\r;---------------------------------------------------------------------
\r.minus_slide_show_delay:
\r cmp [option_pointer],0
\r je @f
\r \r mov [option_pointer],0
\r call .draw_all_options_values
\r@@:
\r cmp [slide_show_delay],0
\r je .still
\r \r sub [slide_show_delay],10
\r call .draw_slide_show_delay
\r jmp .still
\r;---------------------------------------------------------------------
\r.plus_arrows_offset:
\r cmp [option_pointer],1
\r je @f
\r \r mov [option_pointer],1
\r call .draw_all_options_values
\r@@:
\r cmp [arrows_offset],100
\r je .still
\r \r inc [arrows_offset]
\r call .draw_arrows_offset
\r call calculate_arrows_offset
\r jmp .still
\r;---------------------------------------------------------------------
\r.minus_arrows_offset:
\r cmp [option_pointer],1
\r je @f
\r \r mov [option_pointer],1
\r call .draw_all_options_values
\r@@:
\r cmp [arrows_offset],1
\r je .still
\r \r dec [arrows_offset]
\r call .draw_arrows_offset
\r call calculate_arrows_offset
\r jmp .still
\r;---------------------------------------------------------------------
\r.space_check1:
\r test [check1.flags],dword 10b
\r jnz @f
\r \r or [check1.flags],dword 10b
\r jmp .space_check1_1
\r;---------------------------------------------------------------------
\r@@:
\r xor [check1.flags],dword 10b
\r.space_check1_1:
\r call .draw_all_options_values
\r jmp .still
\r;---------------------------------------------------------------------
\r.space_check2:
\r test [check2.flags],dword 10b
\r jnz @f
\r \r or [check2.flags],dword 10b
\r jmp .space_check2_1
\r;---------------------------------------------------------------------
\r@@:
\r xor [check2.flags],dword 10b
\r.space_check2_1:
\r call .draw_all_options_values
\r jmp .still
\r;---------------------------------------------------------------------
\r.down_arrow:
\r cmp [option_pointer],3
\r je .still
\r \r inc [option_pointer]
\r.draw_all_points:
\r call .set_pointers
\r call .draw_all_options_values
\r jmp .still
\r;---------------------------------------------------------------------
\r.up_arrow:
\r cmp [option_pointer],0
\r je .still
\r \r dec [option_pointer]
\r jmp .draw_all_points
\r;---------------------------------------------------------------------
\r.set_pointers:
\r cmp [option_pointer],0
\r jne @f
\r \r mov [plus_pointer],thread7.plus_slide_show_delay
\r mov [minus_pointer],thread7.minus_slide_show_delay
\r mov [space_pointer],thread7.still
\r ret
\r@@:
\r cmp [option_pointer],1
\r jne @f
\r \r mov [plus_pointer],thread7.plus_arrows_offset
\r mov [minus_pointer],thread7.minus_arrows_offset
\r mov [space_pointer],thread7.still
\r ret
\r@@:
\r cmp [option_pointer],2
\r jne @f
\r \r mov [plus_pointer],thread7.still
\r mov [minus_pointer],thread7.still
\r mov [space_pointer],thread7.space_check1
\r ret
\r@@:
\r mov [plus_pointer],thread7.still
\r mov [minus_pointer],thread7.still
\r mov [space_pointer],thread7.space_check2
\r ret
\r;---------------------------------------------------------------------
\r.draw_all_options_values:
\r call .draw_slide_show_delay
\r call .draw_arrows_offset
\r call .draw_check1
\r call .draw_check2
\r ret
\r;---------------------------------------------------------------------
\r; *********************************************
\r; ******* WINDOW DEFINITIONS AND DRAW ********
\r; *********************************************
\r.draw_window:
\r mcall 12,1
\r xor eax,eax ; function 0 : define and draw window
\r xor esi,esi
\r mcall ,<100,300>,<100,120>,0x13909090,,optiontext
\r mcall 8,<10,15>,<50,16>,2,0xdddddd
\r inc edx
\r mcall ,<81,15>
\r;---------------------------------
\r inc edx
\r mcall ,<10,15>,<90,16>
\r inc edx
\r mcall ,<81,15>
\r;---------------------------------
\r inc edx
\r mcall ,<250,40>,<90,20>
\r;---------------------------------
\r mcall 4,<10,35>,0x80ffffff,slide_show_delay_title
\r mcall ,<13,51>,0x90000000,slide_show_delay_text
\r mcall ,<10,75>,0x80ffffff,arrows_offset_title
\r mcall ,<13,91>,0x90000000,slide_show_delay_text
\r mcall ,<263,93>, ,ok_btn
\r call .draw_all_options_values
\r; mcall 47,0x80000,[PID5],<200, 5>,0xffffff
\r mcall 12,2
\r ret
\r;---------------------------------------------------------------------
\r.draw_slide_show_delay:
\r mov edx,0xffffff
\r cmp [option_pointer],0
\r jne @f
\r \r mov edx,0xffff80
\r@@:
\r mcall 13,<29,50>,<50,17>,
\r mcall 47,0x800a0000,[slide_show_delay],<32,52>,0x10000000; 0x40000000,0xffffff
\r ret
\r;---------------------------------------------------------------------
\r.draw_arrows_offset:
\r mov edx,0xffffff
\r cmp [option_pointer],1
\r jne @f
\r \r mov edx,0xffff80
\r@@:
\r mcall 13,<29,50>,<90,17>,
\r mcall 47,0x800a0000,[arrows_offset],<32,92>,0x10000000; 0x40000000,0xffffff
\r ret
\r;---------------------------------------------------------------------
\r.draw_check1:
\r mov [check1+12],dword 0xffffff
\r cmp [option_pointer],2
\r jne @f
\r \r mov [check1+12],dword 0xffff80
\r@@:
\r push dword check1
\r call [check_box_draw]
\r ret
\r;---------------------------------------------------------------------
\r.draw_check2:
\r mov [check2+12],dword 0xffffff
\r cmp [option_pointer],3
\r jne @f
\r \r mov [check2+12],dword 0xffff80
\r@@:
\r push dword check2
\r call [check_box_draw]
\r ret
\r;---------------------------------------------------------------------