	SECTION _TEXT align=1 CLASS=CODE USE32
	SECTION _DATA align=16 CLASS=DATA USE32
	SECTION _BSS align=16 CLASS=BSS USE32
	SECTION _CONST align=16 CLASS=CONST USE32
	SECTION _STRING align=4 CLASS=STRING USE32
	SECTION cstartup align=4 CLASS=INITDATA USE32
	SECTION crundown align=4 CLASS=EXITDATA USE32
	SECTION cppinit  align=4 CLASS=CPPINIT USE32
	SECTION cppexit  align=4 CLASS=CPPEXIT USE32
	GROUP DGROUP _DATA _BSS _CONST _STRING

SECTION _TEXT
;
; Line 5:	static void PaintMsg(WINDOW wnd, CTLWINDOW *ct, RECT *rc)
;
_PaintMsg:
	PUSH	EBP
	MOV	EBP,ESP
	SUB	ESP,BYTE 04H
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	MOV	ESI,DWORD [EBP+08H]
	MOV	EDI,DWORD [EBP+0CH]
L_2:
;
; Line 6:	{
;
;
; Line 7:	if (isVisible(wnd))    {
;
	PUSH	ESI
	CALL	_isVisible
	POP	ECX
	TEST	EAX,EAX
	JE	NEAR	L_3
;
; Line 8:	if (TestAttribute(wnd, SHADOW) && cfg.mono == 0)    {
;
	MOV	EAX,DWORD [ESI+054H]
	AND	EAX,BYTE 01H
	JE	SHORT	L_5
	MOVSX	EAX,BYTE [0BH+_cfg]
	TEST	EAX,EAX
	JNE	SHORT	L_5
;
; Line 11:	background = WndBackground(GetParent(wnd));
;
	MOV	EAX,DWORD [ESI+03CH]
	MOVSX	EAX,BYTE [EAX+035H]
	MOV	DWORD [_background],EAX
;
; Line 12:	foreground = BLACK;
;
	MOV	DWORD [_foreground],00H
	MOV	DWORD [EBP-04H],01H
	JMP	SHORT	L_9
L_7:
;
; Line 14:	wputch(wnd, 223, x, 1);
;
	PUSH	BYTE 01H
	PUSH	DWORD [EBP-04H]
	PUSH	DWORD 0DFH
	PUSH	ESI
	CALL	_wputch
	ADD	ESP,BYTE 010H
;
; Line 13:	for (x = 1; x <= WindowWidth(wnd); x++)
;
L_8:
	INC	DWORD [EBP-04H]
L_9:
	MOV	EAX,DWORD [EBP-04H]
	CMP	EAX,DWORD [ESI+020H]
	JLE	SHORT	L_7
L_10:
;
; Line 15:	wputch(wnd, 220, WindowWidth(wnd), 0);
;
	PUSH	BYTE 00H
	PUSH	DWORD [ESI+020H]
	PUSH	DWORD 0DCH
	PUSH	ESI
	CALL	_wputch
	ADD	ESP,BYTE 010H
L_5:
;
; Line 17:	if (ct->itext != NULL)    {
;
	CMP	DWORD [EDI+018H],BYTE 00H
	JE	NEAR	L_11
;
; Line 19:	txt = DFcalloc(1, (strlen(ct->itext)+10) * sizeof(ATTRCHR));
;
	PUSH	DWORD [EDI+018H]
	CALL	_strlen
	POP	ECX
	ADD	EAX,BYTE 0AH
	SHL	EAX,01H
	PUSH	EAX
	PUSH	BYTE 01H
	CALL	_DFcalloc
	ADD	ESP,BYTE 08H
	MOV	EBX,EAX
;
; Line 20:	if (ct->setting == OFF)    {
;
	CMP	DWORD [EDI+028H],BYTE 00H
	JNE	SHORT	L_13
;
; Line 21:	CopyCommand(txt,ct->itext,!ct->setting,
;
	MOVSX	EAX,BYTE [ESI+035H]
	PUSH	EAX
	MOVSX	EAX,BYTE [ESI+03AH]
	PUSH	EAX
	CMP	DWORD [EDI+028H],BYTE 00H
	SETE	AL
	MOVZX	EAX,AL
	PUSH	EAX
	PUSH	DWORD [EDI+018H]
	PUSH	EBX
	CALL	_CopyCommand
	ADD	ESP,BYTE 014H
	JMP	SHORT	L_14
L_13:
;
; Line 26:	CopyCommand(txt,ct->itext,!ct->setting,
;
	MOVSX	EAX,BYTE [ESI+035H]
	PUSH	EAX
	MOVSX	EAX,BYTE [ESI+034H]
	PUSH	EAX
	CMP	DWORD [EDI+028H],BYTE 00H
	SETE	AL
	MOVZX	EAX,AL
	PUSH	EAX
	PUSH	DWORD [EDI+018H]
	PUSH	EBX
	CALL	_CopyCommand
	ADD	ESP,BYTE 014H
L_14:
;
; Line 28:	SendMessage(wnd, CLEARTEXT, 0, 0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 033H
	PUSH	ESI
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
;
; Line 29:	SendMessage(wnd, ADDTEXT, (PARAM) txt, 1);
;
	PUSH	BYTE 01H
	PUSH	EBX
	PUSH	BYTE 030H
	PUSH	ESI
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
;
; Line 30:	free(txt);
;
	PUSH	EBX
	CALL	_free
	POP	ECX
L_11:
;
; Line 33:	WriteTextLine(wnd, rc, 0, wnd == inFocus);
;
	CMP	ESI,DWORD [_inFocus]
	SETE	AL
	MOVZX	AX,AL
	MOVSX	EAX,AX
	PUSH	EAX
	PUSH	BYTE 00H
	PUSH	DWORD [EBP+010H]
	PUSH	ESI
	CALL	_WriteTextLine
	ADD	ESP,BYTE 010H
L_3:
;
; Line 35:	}
;
L_1:
	POP	EDI
	POP	ESI
	POP	EBX
	MOV	ESP,EBP
	POP	EBP
	RET
;
; Line 37:	static void LeftButtonMsg(WINDOW wnd, MESSAGE msg, CTLWINDOW *ct)
;
_LeftButtonMsg:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	MOV	ESI,DWORD [EBP+08H]
	MOV	EDI,DWORD [EBP+010H]
L_16:
;
; Line 38:	{
;
;
; Line 39:	if (cfg.mono == 0)    {
;
	MOVSX	EAX,BYTE [0BH+_cfg]
	TEST	EAX,EAX
	JNE	SHORT	L_17
;
; Line 42:	background = WndBackground(GetParent(wnd));
;
	MOV	EAX,DWORD [ESI+03CH]
	MOVSX	EAX,BYTE [EAX+035H]
	MOV	DWORD [_background],EAX
;
; Line 43:	foreground = WndBackground(wnd);
;
	MOVSX	EAX,BYTE [ESI+035H]
	MOV	DWORD [_foreground],EAX
;
; Line 44:	wputch(wnd, ' ', 0, 0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 020H
	PUSH	ESI
	CALL	_wputch
	ADD	ESP,BYTE 010H
	MOV	EBX,00H
	JMP	SHORT	L_21
L_19:
;
; Line 46:	wputch(wnd, 220, x+1, 0);
;
	PUSH	BYTE 00H
	MOV	EAX,EBX
	INC	EAX
	PUSH	EAX
	PUSH	DWORD 0DCH
	PUSH	ESI
	CALL	_wputch
	ADD	ESP,BYTE 010H
;
; Line 47:	wputch(wnd, 223, x+1, 1);
;
	PUSH	BYTE 01H
	MOV	EAX,EBX
	INC	EAX
	PUSH	EAX
	PUSH	DWORD 0DFH
	PUSH	ESI
	CALL	_wputch
	ADD	ESP,BYTE 010H
;
; Line 45:	for (x = 0; x < WindowWidth(wnd); x++)    {
;
L_20:
	INC	EBX
L_21:
	CMP	EBX,DWORD [ESI+020H]
	JL	SHORT	L_19
L_22:
L_17:
;
; Line 50:	if (msg == LEFT_BUTTON)
;
	CMP	DWORD [EBP+0CH],BYTE 024H
	JNE	SHORT	L_23
;
; Line 51:	SendMessage(NULL, WAITMOUSE, 0, 0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 02CH
	PUSH	BYTE 00H
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
	JMP	SHORT	L_24
L_23:
;
; Line 53:	SendMessage(NULL, WAITKEYBOARD, 0, 0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 01FH
	PUSH	BYTE 00H
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
L_24:
;
; Line 54:	SendMessage(wnd, PAINT, 0, 0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	PUSH	BYTE 09H
	PUSH	ESI
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
;
; Line 55:	if (ct->setting == ON)
;
	CMP	DWORD [EDI+028H],BYTE 01H
	JNE	SHORT	L_25
;
; Line 56:	PostMessage(GetParent(wnd), COMMAND, ct->command, 0);
;
	PUSH	BYTE 00H
	PUSH	DWORD [EDI+01CH]
	PUSH	BYTE 02H
	PUSH	DWORD [ESI+03CH]
	CALL	_PostMessage
	ADD	ESP,BYTE 010H
	JMP	SHORT	L_26
L_25:
;
; Line 58:	beep();
;
	CALL	_beep
L_26:
;
; Line 59:	}
;
L_15:
	POP	EDI
	POP	ESI
	POP	EBX
	POP	EBP
	RET
[GLOBAL	_ButtonProc]
;
; Line 61:	int ButtonProc(WINDOW wnd, MESSAGE msg, PARAM p1, PARAM p2)
;
_ButtonProc:
	PUSH	EBP
	MOV	EBP,ESP
	SUB	ESP,BYTE 08H
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	MOV	EBX,DWORD [EBP+010H]
	MOV	ESI,DWORD [EBP+08H]
	MOV	EDI,DWORD [EBP+014H]
L_28:
;
; Line 62:	{
;
;
; Line 63:	CTLWINDOW *ct = GetControl(wnd);
;
	MOV	EAX,DWORD [ESI+0108H]
	MOV	DWORD [EBP-04H],EAX
;
; Line 64:	if (ct != NULL)    {
;
	CMP	DWORD [EBP-04H],BYTE 00H
	JE	NEAR	L_29
;
; Line 65:	switch (msg)    {
;
	MOV	EAX,DWORD [EBP+0CH]
	CMP	EAX,BYTE 015H
	JE	SHORT	L_35
	JA	SHORT	L_38
	CMP	EAX,BYTE 09H
	JE	SHORT	L_34
	JA	SHORT	L_32
	CMP	EAX,BYTE 08H
	JE	SHORT	L_33
	JMP	SHORT	L_32
L_38:
	CMP	EAX,BYTE 036H
	JE	SHORT	L_37
	JA	SHORT	L_32
	CMP	EAX,BYTE 024H
	JE	SHORT	L_36
	JMP	SHORT	L_32
L_33:
;
; Line 67:	BaseWndProc(BUTTON, wnd, msg, p1, p2);
;
	PUSH	EDI
	PUSH	EBX
	MOVSX	EAX,WORD [EBP+0CH]
	PUSH	EAX
	PUSH	ESI
	MOV	EAX,DWORD [_classdefs+084H]
	IMUL	EAX,BYTE 0CH
	CALL	DWORD [EAX+04H+_classdefs+00H]
	ADD	ESP,BYTE 010H
;
; Line 68:	p1 = 0;
;
	MOV	EBX,00H
;
; Line 70:	case PAINT:
;
L_34:
;
; Line 71:	PaintMsg(wnd, ct, (RECT*)p1);
;
	PUSH	EBX
	PUSH	DWORD [EBP-04H]
	PUSH	ESI
	CALL	_PaintMsg
	ADD	ESP,BYTE 0CH
;
; Line 72:	return TRUE;
;
	MOV	EAX,01H
	JMP	SHORT	L_27
L_35:
;
; Line 74:	if (p1 != '\r')
;
	CMP	EBX,BYTE 0DH
	JNE	SHORT	L_31
;
; Line 75:	break;
;
L_39:
;
; Line 77:	case LEFT_BUTTON:
;
L_36:
;
; Line 78:	LeftButtonMsg(wnd, msg, ct);
;
	PUSH	DWORD [EBP-04H]
	MOVSX	EAX,WORD [EBP+0CH]
	PUSH	EAX
	PUSH	ESI
	CALL	_LeftButtonMsg
	ADD	ESP,BYTE 0CH
;
; Line 79:	return TRUE;
;
	MOV	EAX,01H
	JMP	SHORT	L_27
L_37:
;
; Line 81:	return TRUE;
;
	MOV	EAX,01H
	JMP	SHORT	L_27
L_32:
;
; Line 83:	break;
;
	JMP	SHORT	L_31
L_31:
L_29:
;
; Line 86:	return BaseWndProc(BUTTON, wnd, msg, p1, p2);
;
	PUSH	EDI
	PUSH	EBX
	MOVSX	EAX,WORD [EBP+0CH]
	PUSH	EAX
	PUSH	ESI
	MOV	EAX,DWORD [_classdefs+084H]
	IMUL	EAX,BYTE 0CH
	CALL	DWORD [EAX+04H+_classdefs+00H]
	ADD	ESP,BYTE 010H
L_27:
	POP	EDI
	POP	ESI
	POP	EBX
	MOV	ESP,EBP
	POP	EBP
	RET
SECTION _CONST

SECTION _TEXT
[EXTERN	_wputch]
[EXTERN	_inFocus]
[EXTERN	_DFcalloc]
[EXTERN	_isVisible]
[EXTERN	_strlen]
[EXTERN	_cfg]
[EXTERN	_WriteTextLine]
[EXTERN	_background]
[EXTERN	_beep]
[EXTERN	_free]
[EXTERN	_foreground]
[EXTERN	_classdefs]
[EXTERN	_SendMessage]
[EXTERN	_PostMessage]
[EXTERN	_CopyCommand]
