Subversion Repositories Kolibri OS

Rev

Rev 7548 | Rev 7848 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7548 Rev 7786
Line 19... Line 19...
19
;   Some parts of code rewritten by Ivan Poddubny 
19
;   Some parts of code rewritten by Ivan Poddubny 
20
;
20
;
21
;   Compile with FASM for Menuet
21
;   Compile with FASM for Menuet
22
;******************************************************************************
22
;******************************************************************************
23
  BTN_HEIGHT  = 22
23
  BTN_HEIGHT  = 22
-
 
24
  BTN_WIDTH   = 140
24
  TXT_Y       = (BTN_HEIGHT)/2-4
25
  TXT_Y       = (BTN_HEIGHT)/2-4
Line 25... Line 26...
25
 
26
 
26
  PANEL_HEIGHT	= 20
27
  PANEL_HEIGHT	= 20
27
  MENU_BOTTON_X_POS	= 10
28
  MENU_BOTTON_X_POS	= 10
Line 37... Line 38...
37
	dd mem_end	; memory for app
38
	dd mem_end	; memory for app
38
	dd stack_area	; esp
39
	dd stack_area	; esp
39
	dd bootparam	; boot parameters
40
	dd bootparam	; boot parameters
40
	dd 0x0		; path
41
	dd 0x0		; path
41
;------------------------------------------------------------------------------
42
;------------------------------------------------------------------------------
42
include "lang.inc"
-
 
43
include "..\..\..\macros.inc"
43
include "..\..\..\macros.inc"
-
 
44
include "..\..\..\gui_patterns.inc"
44
;include "../../../debug.inc"             ; debug macros
45
;include "../../../debug.inc"             ; debug macros
45
;------------------------------------------------------------------------------
46
;------------------------------------------------------------------------------
46
align 4
47
align 4
47
conversion_ASCII_to_HEX:
48
conversion_ASCII_to_HEX:
48
	xor	ebx,ebx
49
	xor	ebx,ebx
Line 473... Line 474...
473
	mcall	37,2
474
	mcall	37,2
474
	test	eax,eax	   ; check buttons state
475
	test	eax,eax	   ; check buttons state
475
	jnz	click
476
	jnz	click
476
	mcall	37,1
477
	mcall	37,1
477
	ror	eax,16	  ; eax = [ Y | X ] relative to window
478
	ror	eax,16	  ; eax = [ Y | X ] relative to window
478
	cmp	ax,140	   ; pointer in window?
479
	cmp	ax,BTN_WIDTH	   ; pointer in window?
479
	ja	noinwindow
480
	ja	noinwindow
480
; *** in window ***
481
; *** in window ***
481
	shr	eax,16	  ; eax = [ 0 | Y ]
482
	shr	eax,16	  ; eax = [ 0 | Y ]
482
	xor	edx,edx
483
	xor	edx,edx
483
	mov	ebx,BTN_HEIGHT
484
	mov	ebx,BTN_HEIGHT
Line 720... Line 721...
720
;--------------------------------------
721
;--------------------------------------
721
align 4
722
align 4
722
.1:
723
.1:
723
	shl	ecx,16
724
	shl	ecx,16
724
	add	ecx,eax	    ; ecx = [ Y_START | Y_SIZE ]
725
	add	ecx,eax	    ; ecx = [ Y_START | Y_SIZE ]
-
 
726
	dec ecx
Line 725... Line 727...
725
 
727
 
726
	movzx	ebx,[edi + x_start]
728
	movzx	ebx,[edi + x_start]
727
	shl	ebx,16
729
	shl	ebx,16
728
	mov	bx,140	    ; ebx = [ X_START | X_SIZE ]
730
	mov	bx,BTN_WIDTH	    ; ebx = [ X_START | X_SIZE ]
729
	mov	edx,0x01000000       ; color of work area RRGGBB,8->color gl
731
	mov	edx,0x01000000       ; color of work area RRGGBB,8->color gl
Line 730... Line 732...
730
	mov	esi,edx	    ; unmovable window
732
	mov	esi,edx	    ; unmovable window
731
	
733
	
Line 786... Line 788...
786
align 4
788
align 4
787
draw_one_button:
789
draw_one_button:
788
; receives number of button in dl
790
; receives number of button in dl
789
	push	edx
791
	push	edx
790
	mov	eax,8
792
	mov	eax,8
791
	mov	ebx,140
793
	mov	ebx,BTN_WIDTH
792
	movzx	ecx,dl
794
	movzx	ecx,dl
793
	imul	ecx,BTN_HEIGHT
795
	imul	ecx,BTN_HEIGHT
-
 
796
	mov [draw_y], ecx
794
	shl	ecx,16
797
	shl	ecx,16
795
	add	ecx,BTN_HEIGHT
798
	add	ecx,BTN_HEIGHT
796
; edx = button identifier
799
; edx = button identifier
797
	mov	esi,[sc.work]
800
	mov	esi,[sc.work]
798
	cmp	esi,0xdfdfdf
801
	cmp	esi,0xdfdfdf
799
	jb	nocorrect
802
	jb	nocorrect
800
	sub	esi,0x1b1b1b
803
	sub	esi,0x1b1b1b
-
 
804
	
801
;--------------------------------------
805
;--------------------------------------
802
align 4
806
align 4
803
nocorrect: 
807
nocorrect: 
804
	inc	dl
808
	inc	dl
805
	cmp	[edi + cur_sel],dl
809
	cmp	[edi + cur_sel],dl
806
	jne	.nohighlight
810
	jne	.nohighlight
807
	add	esi,0x1a1a1a
811
	add	esi,0x1a1a1a
808
;--------------------------------------
812
;--------------------------------------
809
align 4
813
align 4
810
.nohighlight:
814
.nohighlight:
811
	or	edx,0x20000000
815
	or	edx,BT_NOFRAME + BT_HIDE
812
				; dunkaist[
816
				; dunkaist[
813
	add	edx,0xd1ff00	; This makes first menu buttons differ
817
	add	edx,0xd1ff00	; This makes first menu buttons differ
814
				; from system close button with 0x000001 id
818
				; from system close button with 0x000001 id
815
				; dunkaist]
819
				; dunkaist]
816
	mcall
820
	mcall
-
 
821
	pusha
-
 
822
	
-
 
823
	mov edx, esi
-
 
824
	mcall 13
-
 
825
	
-
 
826
	mcall   , BTN_WIDTH,     <[draw_y],1>,            [sc.work_light]
-
 
827
	mcall   , 1,             <[draw_y],BTN_HEIGHT>
-
 
828
	mcall   , , <[draw_y],BTN_HEIGHT+1>, [sc.work_dark]
-
 
829
	add [draw_y], BTN_HEIGHT-1
-
 
830
	mcall   , BTN_WIDTH,     <[draw_y],1>
-
 
831
	
-
 
832
	popa
817
	movzx	edx,dl
833
	movzx	edx,dl
818
	dec	dl
834
	dec	dl
819
	imul	ebx,edx,BTN_HEIGHT
835
	imul	ebx,edx,BTN_HEIGHT
820
	add	ebx,(4 shl 16) + TXT_Y
836
	add	ebx,(4 shl 16) + TXT_Y
821
	movzx	ecx,dl
837
	movzx	ecx,dl
Line 909... Line 925...
909
;--------------------------------------
925
;--------------------------------------
910
screen_size:
926
screen_size:
911
.y	dw ?
927
.y	dw ?
912
.x	dw ?
928
.x	dw ?
913
;--------------------------------------
929
;--------------------------------------
-
 
930
draw_y dd ?
-
 
931
;--------------------------------------
914
x_working_area:
932
x_working_area:
915
.right:		dw ?
933
.right:		dw ?
916
.left:		dw ?
934
.left:		dw ?
917
y_working_area:
935
y_working_area:
918
.bottom:	dw ?
936
.bottom:	dw ?