Calc+ v1.0 (#189)
- Bigger fonts - System colors - Code refactoring to make UI flexible and more readable - Move from ISO to IMG - Add to main menu, add to desktop instead of Calc, remove from App+ - Localization to all system languages - Source code file is now UTF-8 Co-authored-by: Burer <burer@kolibrios.org> Reviewed-on: #189 Reviewed-by: Max Logaev <maxlogaev@proton.me> Co-authored-by: Kiril Lipatov <lipatov.kiril@gmail.com> Co-committed-by: Kiril Lipatov <lipatov.kiril@gmail.com>
This commit is contained in:
@@ -410,6 +410,7 @@ tup.append_table(img_files, {
|
|||||||
{"ACLOCK", VAR_PROGS .. "/demos/aclock/aclock"},
|
{"ACLOCK", VAR_PROGS .. "/demos/aclock/aclock"},
|
||||||
{"APM", VAR_PROGS .. "/system/apm/apm"},
|
{"APM", VAR_PROGS .. "/system/apm/apm"},
|
||||||
{"CALC", VAR_PROGS .. "/other/calc/trunk/calc"},
|
{"CALC", VAR_PROGS .. "/other/calc/trunk/calc"},
|
||||||
|
{"CALCPLUS", VAR_PROGS .. "/other/calcplus/calcplus"},
|
||||||
{"CALENDAR", VAR_PROGS .. "/system/calendar/trunk/calendar"},
|
{"CALENDAR", VAR_PROGS .. "/system/calendar/trunk/calendar"},
|
||||||
{"COLRDIAL", VAR_PROGS .. "/system/colrdial/color_dialog"},
|
{"COLRDIAL", VAR_PROGS .. "/system/colrdial/color_dialog"},
|
||||||
{"CROPFLAT", VAR_PROGS .. "/system/cropflat/cropflat"},
|
{"CROPFLAT", VAR_PROGS .. "/system/cropflat/cropflat"},
|
||||||
@@ -626,7 +627,6 @@ tup.append_table(extra_files, {
|
|||||||
{"kolibrios/media/zsea/plugins/rotate.obj", VAR_PROGS .. "/media/zsea/plugins/rotate/rotate.obj"},
|
{"kolibrios/media/zsea/plugins/rotate.obj", VAR_PROGS .. "/media/zsea/plugins/rotate/rotate.obj"},
|
||||||
{"kolibrios/media/zsea/plugins/scaling.obj", VAR_PROGS .. "/media/zsea/plugins/scaling/scaling.obj"},
|
{"kolibrios/media/zsea/plugins/scaling.obj", VAR_PROGS .. "/media/zsea/plugins/scaling/scaling.obj"},
|
||||||
{"kolibrios/utils/AMDtemp", VAR_PROGS .. "/system/amd_temp_view/AMDtemp"},
|
{"kolibrios/utils/AMDtemp", VAR_PROGS .. "/system/amd_temp_view/AMDtemp"},
|
||||||
{"kolibrios/utils/calcplus", VAR_PROGS .. "/other/calcplus/calcplus"},
|
|
||||||
{"kolibrios/utils/kfm/kfm", VAR_PROGS .. "/fs/kfm/trunk/kfm"},
|
{"kolibrios/utils/kfm/kfm", VAR_PROGS .. "/fs/kfm/trunk/kfm"},
|
||||||
{"kolibrios/utils/tedit/t_edit", VAR_PROGS .. "/other/t_edit/t_edit"},
|
{"kolibrios/utils/tedit/t_edit", VAR_PROGS .. "/other/t_edit/t_edit"},
|
||||||
{"kolibrios/3D/blocks/block.bin", VAR_PROGS .. "/bcc32/games/blocks/block.bin"}
|
{"kolibrios/3D/blocks/block.bin", VAR_PROGS .. "/bcc32/games/blocks/block.bin"}
|
||||||
|
@@ -29,7 +29,6 @@ Dicty=/k/utils/DICTY.KEX,79
|
|||||||
fNav=/k/utils/fNav/fNav,93
|
fNav=/k/utils/fNav/fNav,93
|
||||||
CncEditor=/k/utils/cnc_editor/cnc_editor,15
|
CncEditor=/k/utils/cnc_editor/cnc_editor,15
|
||||||
Life=/k/demos/life2,13
|
Life=/k/demos/life2,13
|
||||||
Calc+=/k/utils/calcplus,4
|
|
||||||
TinyBasic=/k/develop/TinyBasic/TinyBasic,91
|
TinyBasic=/k/develop/TinyBasic/TinyBasic,91
|
||||||
THashView=/k/utils/thashview,124
|
THashView=/k/utils/thashview,124
|
||||||
Notes=/k/utils/notes,117
|
Notes=/k/utils/notes,117
|
||||||
|
@@ -235,8 +235,8 @@ ico=58
|
|||||||
x=68
|
x=68
|
||||||
y=68
|
y=68
|
||||||
[21]
|
[21]
|
||||||
name=CALC
|
name=CALC+
|
||||||
path=CALC
|
path=CALCPLUS
|
||||||
param=
|
param=
|
||||||
ico=4
|
ico=4
|
||||||
x=204
|
x=204
|
||||||
|
@@ -92,6 +92,7 @@
|
|||||||
59 Screen keyboard |zkey
|
59 Screen keyboard |zkey
|
||||||
#10 **** DATA PROCESSING
|
#10 **** DATA PROCESSING
|
||||||
16 Calculator |calc
|
16 Calculator |calc
|
||||||
|
16 Calculator+ |calcplus
|
||||||
03 Tinypad |tinypad
|
03 Tinypad |tinypad
|
||||||
28 CodeEdit |develop/cedit
|
28 CodeEdit |develop/cedit
|
||||||
21 Table processor |table
|
21 Table processor |table
|
||||||
|
@@ -235,8 +235,8 @@ ico=58
|
|||||||
x=68
|
x=68
|
||||||
y=68
|
y=68
|
||||||
[21]
|
[21]
|
||||||
name=CALC
|
name=CALC+
|
||||||
path=CALC
|
path=CALCPLUS
|
||||||
param=
|
param=
|
||||||
ico=4
|
ico=4
|
||||||
x=204
|
x=204
|
||||||
|
@@ -96,6 +96,7 @@
|
|||||||
24 NDN * |/kolibrios/utils/ndn/ndn
|
24 NDN * |/kolibrios/utils/ndn/ndn
|
||||||
#11 **** PROCESO DE DATOS
|
#11 **** PROCESO DE DATOS
|
||||||
16 Calculadora |calc
|
16 Calculadora |calc
|
||||||
|
16 Calculadora+ |calcplus
|
||||||
16 Tinypad |tinypad
|
16 Tinypad |tinypad
|
||||||
16 CodeEdit |develop/cedit
|
16 CodeEdit |develop/cedit
|
||||||
16 Procesador de tablas |table
|
16 Procesador de tablas |table
|
||||||
|
@@ -235,8 +235,8 @@ ico=58
|
|||||||
x=68
|
x=68
|
||||||
y=68
|
y=68
|
||||||
[21]
|
[21]
|
||||||
name=CALC
|
name=CALC+
|
||||||
path=CALC
|
path=CALCPLUS
|
||||||
param=
|
param=
|
||||||
ico=4
|
ico=4
|
||||||
x=204
|
x=204
|
||||||
|
@@ -80,6 +80,7 @@
|
|||||||
65 NDN * |/kolibrios/utils/ndn/ndn
|
65 NDN * |/kolibrios/utils/ndn/ndn
|
||||||
#11 **** DATA PROCESSING ****
|
#11 **** DATA PROCESSING ****
|
||||||
16 Kalkulaator |calc
|
16 Kalkulaator |calc
|
||||||
|
16 Kalkulaator+ |calcplus
|
||||||
16 Teksti redaktor |tinypad
|
16 Teksti redaktor |tinypad
|
||||||
16 CodeEdit |develop/cedit
|
16 CodeEdit |develop/cedit
|
||||||
16 Tabelarvutus |table
|
16 Tabelarvutus |table
|
||||||
|
@@ -235,8 +235,8 @@ ico=58
|
|||||||
x=68
|
x=68
|
||||||
y=68
|
y=68
|
||||||
[21]
|
[21]
|
||||||
name=CALC
|
name=CALC+
|
||||||
path=CALC
|
path=CALCPLUS
|
||||||
param=
|
param=
|
||||||
ico=4
|
ico=4
|
||||||
x=204
|
x=204
|
||||||
|
@@ -79,6 +79,7 @@
|
|||||||
65 NDN * |/kolibrios/utils/ndn/ndn
|
65 NDN * |/kolibrios/utils/ndn/ndn
|
||||||
#11 **** DATA PROCESSING
|
#11 **** DATA PROCESSING
|
||||||
16 Calcolatrice |calc
|
16 Calcolatrice |calc
|
||||||
|
16 Calcolatrice+ |calcplus
|
||||||
16 Tinypad |tinypad
|
16 Tinypad |tinypad
|
||||||
16 CodeEdit |develop/cedit
|
16 CodeEdit |develop/cedit
|
||||||
16 Table Processor |table
|
16 Table Processor |table
|
||||||
|
@@ -235,8 +235,8 @@ ico=58
|
|||||||
x=68
|
x=68
|
||||||
y=68
|
y=68
|
||||||
[21]
|
[21]
|
||||||
name=CALC
|
name=CALC+
|
||||||
path=CALC
|
path=CALCPLUS
|
||||||
param=
|
param=
|
||||||
ico=4
|
ico=4
|
||||||
x=204
|
x=204
|
||||||
|
@@ -90,6 +90,7 @@
|
|||||||
59 <20><>࠭<EFBFBD><E0A0AD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> |zkey
|
59 <20><>࠭<EFBFBD><E0A0AD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> |zkey
|
||||||
#10 **** <20><><EFBFBD><EFBFBD>
|
#10 **** <20><><EFBFBD><EFBFBD>
|
||||||
16 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> |calc
|
16 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> |calc
|
||||||
|
16 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>+ |calcplus
|
||||||
03 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Tinypad |tinypad
|
03 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Tinypad |tinypad
|
||||||
28 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> CodeEdit |develop/cedit
|
28 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> CodeEdit |develop/cedit
|
||||||
21 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> |table
|
21 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> |table
|
||||||
|
@@ -1,2 +1,5 @@
|
|||||||
if tup.getconfig("NO_FASM") ~= "" then return end
|
if tup.getconfig("NO_FASM") ~= "" then return end
|
||||||
tup.rule("calcplus.asm", "fasm %f %o " .. tup.getconfig("KPACK_CMD"), "calcplus")
|
HELPERDIR = (tup.getconfig("HELPERDIR") == "") and "../.." or tup.getconfig("HELPERDIR")
|
||||||
|
tup.include(HELPERDIR .. "/use_fasm.lua")
|
||||||
|
tup.rule("calcplus.asm", FASM .. " -dlang=" .. tup.getconfig("LANG") .. " %f %o" .. tup.getconfig("KPACK_CMD"), "%B")
|
||||||
|
|
||||||
|
@@ -1,2 +0,0 @@
|
|||||||
@fasm calcplus.asm calc+
|
|
||||||
@pause
|
|
@@ -1,125 +1,171 @@
|
|||||||
VERSION equ "0.5"
|
; SPDX-License-Identifier: GPL-2.0-only
|
||||||
|
;
|
||||||
|
; Calc+ - Multifunctional calculator
|
||||||
|
; Copyright (C) 2014-2025 KolibriOS team
|
||||||
|
;
|
||||||
|
; Contributor eAndrew - Main code
|
||||||
|
; Contributor Leency - Code refactoring and UX/UI update
|
||||||
|
; Contributor Burer - Code refactoring and UI update
|
||||||
|
|
||||||
|
; ====================================================================
|
||||||
|
|
||||||
use32
|
use32
|
||||||
org 0
|
org 0
|
||||||
|
|
||||||
db 'MENUET01'
|
db 'MENUET01'
|
||||||
dd 1, main, dataend, memory, stacktop, 0, 0
|
dd 1
|
||||||
|
dd START
|
||||||
|
dd I_END
|
||||||
|
dd MEM
|
||||||
|
dd STACKTOP
|
||||||
|
dd 0, 0
|
||||||
|
|
||||||
|
; ====================================================================
|
||||||
|
|
||||||
include "../../proc32.inc"
|
include "../../proc32.inc"
|
||||||
include "../../macros.inc"
|
include "../../macros.inc"
|
||||||
|
include "../../KOSfuncs.inc"
|
||||||
|
include "../../encoding.inc"
|
||||||
include "../../dll.inc"
|
include "../../dll.inc"
|
||||||
include "../../develop/libraries/box_lib/trunk/box_lib.mac"
|
include "../../develop/libraries/box_lib/trunk/box_lib.mac"
|
||||||
; include "../../debug.inc"
|
|
||||||
include "parser.inc"
|
include "parser.inc"
|
||||||
|
|
||||||
;===============================
|
|
||||||
|
|
||||||
LIST_ITEM_SIZE equ 16
|
|
||||||
LIST_ITEM_COUNT equ 6
|
|
||||||
LIST_SIZE equ LIST_ITEM_SIZE * LIST_ITEM_COUNT
|
|
||||||
LIST_ITEM_COLOR1 equ dword [scn.btn_face]
|
|
||||||
LIST_ITEM_COLOR2 equ dword [scn.win_face]
|
|
||||||
LIST_ITEM_TEXT1 equ dword [scn.btn_text]
|
|
||||||
LIST_ITEM_TEXT2 equ dword [scn.win_text]
|
|
||||||
LIST_ITEM_Y equ LIST_ITEM_SIZE / 2 - 3
|
|
||||||
|
|
||||||
KEYB_SIZE equ 140
|
|
||||||
|
|
||||||
sz_cont db "Keyboard ", 0x10
|
|
||||||
sz_head db "Calc+ v", VERSION, 0
|
|
||||||
btn_clr db ""
|
|
||||||
buttons db "|%^*/-+)(=7894561230"
|
|
||||||
edb1 edit_box 0, 8, 12, 0, 0, 0, 0, 0, 480, \
|
|
||||||
exp, group, ed_always_focus + ed_focus, 0, 0
|
|
||||||
|
|
||||||
imports:
|
imports:
|
||||||
|
|
||||||
library gui, "box_lib.obj"
|
library gui, "box_lib.obj"
|
||||||
import gui, editbox.draw, "edit_box", \
|
import gui, editbox.draw, "edit_box", \
|
||||||
editbox.key, "edit_box_key", \
|
editbox.key, "edit_box_key", \
|
||||||
editbox.mouse, "edit_box_mouse"
|
editbox.mouse, "edit_box_mouse"
|
||||||
|
|
||||||
;===============================
|
; ====================================================================
|
||||||
|
|
||||||
main:
|
LIST_X = 8
|
||||||
|
LIST_Y = 47
|
||||||
|
LIST_ITEM_H = 26
|
||||||
|
LIST_ITEM_W = 295
|
||||||
|
LIST_ITEM_COUNT = 8
|
||||||
|
LIST_H = LIST_ITEM_H * LIST_ITEM_COUNT
|
||||||
|
LIST_TEXT_Y = LIST_ITEM_H / 2 - 8
|
||||||
|
|
||||||
|
KEYB_BTN_W = 37
|
||||||
|
KEYB_BTN_H = 37
|
||||||
|
GAP = 5
|
||||||
|
|
||||||
|
KEYBOARD_X = LIST_ITEM_W + 16
|
||||||
|
KEYBOARD_Y = LIST_Y
|
||||||
|
KEYBOARD_W = 190
|
||||||
|
|
||||||
|
LIST_ITEM_TEXT1 equ dword [sc.work_text]
|
||||||
|
LIST_ITEM_TEXT2 equ dword [sc.work_text]
|
||||||
|
|
||||||
|
WIN_X = 200
|
||||||
|
WIN_Y = 200
|
||||||
|
WIN_W = LIST_ITEM_W + KEYBOARD_W + 7
|
||||||
|
WIN_H = LIST_H + 60
|
||||||
|
|
||||||
|
sz_head db "Calc+", 0
|
||||||
|
btn_clr db "" ; "Enter" symbol, curved arrow in input area
|
||||||
|
buttons db "|%^*/-+)(=7894561230"
|
||||||
|
edb1 edit_box 0, 14, 12, 0xFFFFFF, 0x94AECE, 0xFFC90E, 0xCACACA, 0x10000000, \
|
||||||
|
480, exp, group, ed_always_focus + ed_focus, 0, 0
|
||||||
|
|
||||||
|
; ====================================================================
|
||||||
|
|
||||||
|
START:
|
||||||
mov [ans.buffer], dword " = 0"
|
mov [ans.buffer], dword " = 0"
|
||||||
mov [ans.size], 3 * 6 + 9
|
mov [ans.size], 4 * 8 + 9
|
||||||
|
|
||||||
mcall 40, 100111b
|
|
||||||
; mcall 48, 3, scn, 192
|
|
||||||
|
|
||||||
|
mcall SF_SET_EVENTS_MASK, EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE
|
||||||
|
|
||||||
m2m [edb1.color], [scn.gui_face]
|
m2m [edb1.color], [scn.gui_face]
|
||||||
m2m [edb1.shift_color], [scn.gui_select]
|
|
||||||
m2m [edb1.focus_border_color], [scn.gui_face]
|
|
||||||
m2m [edb1.text_color], [scn.gui_text]
|
|
||||||
|
|
||||||
mcall 68, 11
|
mcall SF_SYS_MISC, SSF_HEAP_INIT
|
||||||
stdcall dll.Load, imports
|
stdcall dll.Load, imports
|
||||||
|
|
||||||
;----------------------
|
; ====================================================================
|
||||||
|
|
||||||
update:
|
update:
|
||||||
mcall 23, 5
|
mcall SF_WAIT_EVENT_TIMEOUT, 5
|
||||||
|
|
||||||
cmp eax, EV_REDRAW
|
cmp eax, EV_REDRAW
|
||||||
je ev_redraw
|
je ev_redraw
|
||||||
|
|
||||||
cmp eax, EV_KEY
|
cmp eax, EV_KEY
|
||||||
je ev_key
|
je ev_key
|
||||||
|
|
||||||
cmp eax, EV_BUTTON
|
cmp eax, EV_BUTTON
|
||||||
je ev_button
|
je ev_button
|
||||||
|
|
||||||
cmp eax, EV_MOUSE
|
cmp eax, EV_MOUSE
|
||||||
je ev_mouse
|
je ev_mouse
|
||||||
|
|
||||||
jmp update
|
jmp update
|
||||||
|
|
||||||
;----------------------
|
; ====================================================================
|
||||||
|
|
||||||
ev_redraw:
|
ev_redraw:
|
||||||
mcall 12, 1
|
mcall SF_REDRAW, SSF_BEGIN_DRAW
|
||||||
|
mcall SF_STYLE_SETTINGS, SSF_GET_COLORS, sc, sizeof.system_colors
|
||||||
|
|
||||||
; WINDOW
|
; WINDOW
|
||||||
mov edx, [scn.win_face]
|
mov edx, [sc.work]
|
||||||
or edx, 0x34 shl 24
|
or edx, 0x34 shl 24
|
||||||
mcall 0, <100, 236 + 100 - 50 - 25>, <100, 66 + LIST_SIZE>, , , sz_head
|
|
||||||
|
|
||||||
; TOOLBAR
|
mcall SF_STYLE_SETTINGS, SSF_GET_SKIN_HEIGHT
|
||||||
mov ebx, 120 shl 16 + 64
|
mov ecx, WIN_Y shl 16 + WIN_H
|
||||||
mcall 8, , <-17, 12>, 2 + 1 shl 30
|
add ecx, eax
|
||||||
add ebx, 4 shl 16 - (64 + 14)
|
|
||||||
mcall 4, , [scn.win_title], sz_cont, 10
|
mcall SF_GET_SCREEN_SIZE
|
||||||
|
shr eax, 16
|
||||||
|
mov ebx, eax
|
||||||
|
sub ebx, WIN_W
|
||||||
|
shr ebx, 1
|
||||||
|
|
||||||
|
mcall 0, <ebx, WIN_W>, , , , sz_head
|
||||||
|
|
||||||
; CONTENT
|
; CONTENT
|
||||||
call draw_textbox
|
call draw_textbox
|
||||||
call draw_keyb
|
call draw_keyb
|
||||||
call draw_list
|
call draw_list
|
||||||
|
|
||||||
mcall 12, 2
|
mcall SF_REDRAW, SSF_END_DRAW
|
||||||
|
|
||||||
jmp update
|
jmp update
|
||||||
|
|
||||||
;----------------------
|
; ====================================================================
|
||||||
|
|
||||||
ev_key:
|
ev_key:
|
||||||
mcall 2
|
mcall SF_GET_KEY
|
||||||
|
|
||||||
cmp ah, 27
|
cmp ah, 27
|
||||||
je exit
|
je exit
|
||||||
|
|
||||||
cmp ah, 13
|
cmp ah, 13
|
||||||
je calc
|
je calc
|
||||||
|
|
||||||
invoke editbox.key, edb1
|
invoke editbox.key, edb1
|
||||||
|
|
||||||
jmp update
|
jmp update
|
||||||
|
|
||||||
;----------------------
|
; ====================================================================
|
||||||
|
|
||||||
ev_button:
|
ev_button:
|
||||||
mcall 17
|
mcall SF_GET_BUTTON
|
||||||
|
|
||||||
; EXIT
|
; EXIT
|
||||||
cmp ah, 1
|
cmp ah, 1
|
||||||
je exit
|
je exit
|
||||||
|
|
||||||
|
cmp ah, 250
|
||||||
|
jne @f
|
||||||
|
mcall SF_FILE, f70_calc
|
||||||
|
jmp update
|
||||||
|
|
||||||
; DELETE
|
; DELETE
|
||||||
|
@@:
|
||||||
cmp ah, 4
|
cmp ah, 4
|
||||||
jne .not_del
|
jne .not_del
|
||||||
|
|
||||||
cmp [edb1.pos], 0
|
cmp [edb1.pos], 0
|
||||||
je update
|
je update
|
||||||
mov eax, exp
|
mov eax, exp
|
||||||
@@ -128,6 +174,7 @@
|
|||||||
mov ebx, exp
|
mov ebx, exp
|
||||||
add ebx, [edb1.size]
|
add ebx, [edb1.size]
|
||||||
inc ebx
|
inc ebx
|
||||||
|
|
||||||
@@:
|
@@:
|
||||||
cmp eax, ebx
|
cmp eax, ebx
|
||||||
je @f
|
je @f
|
||||||
@@ -135,32 +182,15 @@
|
|||||||
mov [eax], cl
|
mov [eax], cl
|
||||||
inc eax
|
inc eax
|
||||||
jmp @b
|
jmp @b
|
||||||
|
|
||||||
@@:
|
@@:
|
||||||
dec [edb1.pos]
|
dec [edb1.pos]
|
||||||
dec [edb1.size]
|
dec [edb1.size]
|
||||||
m2m [edb1.shift], [edb1.pos]
|
m2m [edb1.shift], [edb1.pos]
|
||||||
jmp .redraw
|
jmp .redraw
|
||||||
|
|
||||||
.not_del:
|
.not_del:
|
||||||
|
|
||||||
; SHOW/HIDE KEYBOARD
|
|
||||||
cmp ah, 2
|
|
||||||
jne .not_keyb
|
|
||||||
|
|
||||||
cmp [keyb], byte 0
|
|
||||||
je .open
|
|
||||||
|
|
||||||
mov [keyb], 0
|
|
||||||
mov [sz_cont + 9], byte 0x10
|
|
||||||
mcall 67, -1, -1, 286 - 25, -1
|
|
||||||
jmp update
|
|
||||||
|
|
||||||
.open:
|
|
||||||
mov [keyb], 1
|
|
||||||
mov [sz_cont + 9], byte 0x11
|
|
||||||
mcall 67, -1, -1, 286 - 25 + KEYB_SIZE, -1
|
|
||||||
jmp update
|
|
||||||
.not_keyb:
|
|
||||||
|
|
||||||
; CALCULATE
|
; CALCULATE
|
||||||
cmp ah, 19
|
cmp ah, 19
|
||||||
je calc
|
je calc
|
||||||
@@ -181,6 +211,7 @@
|
|||||||
add edx, eax
|
add edx, eax
|
||||||
mov edi, exp
|
mov edi, exp
|
||||||
add edi, [edb1.pos]
|
add edi, [edb1.pos]
|
||||||
|
|
||||||
@@:
|
@@:
|
||||||
cmp edx, edi
|
cmp edx, edi
|
||||||
je @f
|
je @f
|
||||||
@@ -192,6 +223,7 @@
|
|||||||
pop eax
|
pop eax
|
||||||
dec edx
|
dec edx
|
||||||
jmp @b
|
jmp @b
|
||||||
|
|
||||||
@@:
|
@@:
|
||||||
add [edb1.size], eax
|
add [edb1.size], eax
|
||||||
|
|
||||||
@@ -205,9 +237,10 @@
|
|||||||
dec eax
|
dec eax
|
||||||
inc [edb1.pos]
|
inc [edb1.pos]
|
||||||
jmp @b
|
jmp @b
|
||||||
@@:
|
|
||||||
|
|
||||||
|
@@:
|
||||||
jmp .redraw
|
jmp .redraw
|
||||||
|
|
||||||
.not_list:
|
.not_list:
|
||||||
|
|
||||||
; KEYBOARD
|
; KEYBOARD
|
||||||
@@ -224,6 +257,7 @@
|
|||||||
cmp dh, 30
|
cmp dh, 30
|
||||||
jl @f
|
jl @f
|
||||||
add ebx, 2
|
add ebx, 2
|
||||||
|
|
||||||
@@:
|
@@:
|
||||||
cmp ebx, ecx
|
cmp ebx, ecx
|
||||||
je @f
|
je @f
|
||||||
@@ -231,8 +265,8 @@
|
|||||||
mov [ebx], dl
|
mov [ebx], dl
|
||||||
dec ebx
|
dec ebx
|
||||||
jmp @b
|
jmp @b
|
||||||
@@:
|
|
||||||
|
|
||||||
|
@@:
|
||||||
movzx eax, dh
|
movzx eax, dh
|
||||||
add eax, buttons
|
add eax, buttons
|
||||||
sub eax, 10
|
sub eax, 10
|
||||||
@@ -245,37 +279,38 @@
|
|||||||
jl @f
|
jl @f
|
||||||
add [edb1.size], 2
|
add [edb1.size], 2
|
||||||
add [edb1.pos], 2
|
add [edb1.pos], 2
|
||||||
|
|
||||||
@@:
|
@@:
|
||||||
.redraw:
|
.redraw:
|
||||||
call draw_textbox
|
call draw_textbox
|
||||||
jmp update
|
jmp update
|
||||||
|
|
||||||
;----------------------
|
; ====================================================================
|
||||||
|
|
||||||
ev_mouse:
|
ev_mouse:
|
||||||
mcall 2
|
mcall SF_GET_KEY
|
||||||
|
|
||||||
invoke editbox.mouse, edb1
|
invoke editbox.mouse, edb1
|
||||||
jmp update
|
jmp update
|
||||||
|
|
||||||
;----------------------
|
; ====================================================================
|
||||||
|
|
||||||
exit:
|
exit:
|
||||||
mcall -1
|
mcall SF_TERMINATE_PROCESS
|
||||||
|
|
||||||
;----------------------
|
; ====================================================================
|
||||||
|
|
||||||
calc:
|
calc:
|
||||||
stdcall parse
|
stdcall parse
|
||||||
cmp [error_n], 0
|
cmp [error_n], 0
|
||||||
jne .error
|
jne .error
|
||||||
|
|
||||||
mov [ans.buffer], word "= "
|
mov [ans.buffer], dword " = "
|
||||||
|
|
||||||
stdcall convert_to_str, eax, ans.buffer + 2
|
stdcall convert_to_str, eax, ans.buffer + 3
|
||||||
add eax, 2
|
add eax, 3
|
||||||
mov edi, eax
|
mov edi, eax
|
||||||
imul eax, 6
|
imul eax, 8 ; char_w
|
||||||
add eax, 9
|
add eax, 9
|
||||||
mov [ans.size], eax
|
mov [ans.size], eax
|
||||||
|
|
||||||
@@ -283,6 +318,7 @@
|
|||||||
mov ecx, LIST_ITEM_COUNT - 1
|
mov ecx, LIST_ITEM_COUNT - 1
|
||||||
mov eax, history
|
mov eax, history
|
||||||
add eax, (LIST_ITEM_COUNT - 1) * 512
|
add eax, (LIST_ITEM_COUNT - 1) * 512
|
||||||
|
|
||||||
@@:
|
@@:
|
||||||
mov ebx, eax
|
mov ebx, eax
|
||||||
sub ebx, 512
|
sub ebx, 512
|
||||||
@@ -301,7 +337,6 @@
|
|||||||
stdcall str_cpy, ans.buffer, history + 480
|
stdcall str_cpy, ans.buffer, history + 480
|
||||||
mov esi, [ans.size]
|
mov esi, [ans.size]
|
||||||
mov dword[history + 508], esi
|
mov dword[history + 508], esi
|
||||||
not [his_even]
|
|
||||||
|
|
||||||
; Check length
|
; Check length
|
||||||
mov esi, 37
|
mov esi, 37
|
||||||
@@ -319,7 +354,6 @@
|
|||||||
jmp .redraw
|
jmp .redraw
|
||||||
|
|
||||||
; ERRORS
|
; ERRORS
|
||||||
|
|
||||||
.error:
|
.error:
|
||||||
cmp [error_n], 1
|
cmp [error_n], 1
|
||||||
je .err_1
|
je .err_1
|
||||||
@@ -330,7 +364,7 @@
|
|||||||
mov [ans.buffer + 4], dword "cted"
|
mov [ans.buffer + 4], dword "cted"
|
||||||
mov [ans.buffer + 8], dword " ')'"
|
mov [ans.buffer + 8], dword " ')'"
|
||||||
mov [ans.buffer + 12], byte 0
|
mov [ans.buffer + 12], byte 0
|
||||||
mov [ans.size], 81
|
mov [ans.size], 105
|
||||||
|
|
||||||
cmp [error_n], 2
|
cmp [error_n], 2
|
||||||
je .redraw
|
je .redraw
|
||||||
@@ -338,213 +372,222 @@
|
|||||||
je .err_3
|
je .err_3
|
||||||
cmp [error_n], 5
|
cmp [error_n], 5
|
||||||
je .err_5
|
je .err_5
|
||||||
|
|
||||||
.err_1:
|
.err_1:
|
||||||
mov [ans.buffer + 0], dword "Div."
|
mov [ans.buffer + 0], dword "Div."
|
||||||
mov [ans.buffer + 4], dword " by "
|
mov [ans.buffer + 4], dword " by "
|
||||||
mov [ans.buffer + 8], byte "0"
|
mov [ans.buffer + 8], byte "0"
|
||||||
mov [ans.buffer + 9], byte 0
|
mov [ans.buffer + 9], byte 0
|
||||||
mov [ans.size], 63
|
mov [ans.size], 81
|
||||||
jmp .redraw
|
jmp .redraw
|
||||||
|
|
||||||
.err_4:
|
.err_4:
|
||||||
mov [ans.buffer + 0], dword "Inpu"
|
mov [ans.buffer + 0], dword "Inpu"
|
||||||
mov [ans.buffer + 4], dword "t er"
|
mov [ans.buffer + 4], dword "t er"
|
||||||
mov [ans.buffer + 8], dword "rror"
|
mov [ans.buffer + 8], dword "rror"
|
||||||
mov [ans.buffer + 12], byte 0
|
mov [ans.buffer + 12], byte 0
|
||||||
mov [ans.size], 81
|
mov [ans.size], 105
|
||||||
jmp .redraw
|
jmp .redraw
|
||||||
|
|
||||||
.err_3:
|
.err_3:
|
||||||
mov [ans.buffer + 10], byte "("
|
mov [ans.buffer + 10], byte "("
|
||||||
jmp .redraw
|
jmp .redraw
|
||||||
|
|
||||||
.err_5:
|
.err_5:
|
||||||
mov [ans.buffer + 10], byte "|"
|
mov [ans.buffer + 10], byte "|"
|
||||||
jmp .redraw
|
jmp .redraw
|
||||||
|
|
||||||
.redraw:
|
.redraw:
|
||||||
|
|
||||||
call draw_textbox
|
call draw_textbox
|
||||||
call draw_list
|
call draw_list
|
||||||
jmp update
|
jmp update
|
||||||
|
|
||||||
;----------------------
|
; ====================================================================
|
||||||
|
|
||||||
proc draw_button, x, y
|
|
||||||
mcall 8, <[x], 30>, <[y], 21>, [but_id], [but_c]
|
|
||||||
|
|
||||||
mov ebx, [x]
|
|
||||||
mov esi, [txt_size]
|
|
||||||
imul esi, 3
|
|
||||||
mov edi, 16
|
|
||||||
sub edi, esi
|
|
||||||
add ebx, edi
|
|
||||||
shl ebx, 16
|
|
||||||
add ebx, [y]
|
|
||||||
add ebx, 7
|
|
||||||
mcall 4, , [but_tc], [txt_id], [txt_size]
|
|
||||||
|
|
||||||
mov eax, [txt_size]
|
|
||||||
add [txt_id], eax
|
|
||||||
inc dword [but_id]
|
|
||||||
|
|
||||||
ret
|
|
||||||
endp
|
|
||||||
|
|
||||||
;----------------------
|
|
||||||
|
|
||||||
proc draw_textbox
|
proc draw_textbox
|
||||||
mcall 13, <4, 320 - 50 - 25>, < 8, 23>, [scn.gui_frame]
|
|
||||||
|
; border
|
||||||
|
mcall SF_DRAW_RECT, <LIST_X, LIST_ITEM_W>, < 8, 30>, [sc.work_graph]
|
||||||
|
|
||||||
|
; background
|
||||||
mov edx, [scn.gui_face]
|
mov edx, [scn.gui_face]
|
||||||
cmp [error_n], 0
|
cmp [error_n], 0
|
||||||
je @f
|
je @f
|
||||||
mov edx, 0xFFAAAA
|
mov edx, 0xFFAAAA
|
||||||
@@:
|
|
||||||
mcall 13, < 5, 318 - 50 - 25>, < 9, 21>
|
|
||||||
mcall , < 5, 318 - 50 - 25>, < 9, 1>, [scn.3d_face]
|
|
||||||
mcall , < 5, 1>, < 10, 20>
|
|
||||||
mcall , < 5, 318 - 50 - 25>, < 31, 1>, [scn.3d_light]
|
|
||||||
|
|
||||||
mov ebx, 328 - 16 - 50 - 25
|
@@:
|
||||||
|
mcall SF_DRAW_RECT, <LIST_X + 1, LIST_ITEM_W - 2>, < 9, 28>
|
||||||
|
mcall , <LIST_X + 1, LIST_ITEM_W - 2>, < 9, 1>, [scn.gui_tb_in_shd]
|
||||||
|
mcall , <LIST_X + 1, 1 >, < 10, 27>
|
||||||
|
|
||||||
|
mov ebx, LIST_X + LIST_ITEM_W - 12
|
||||||
sub ebx, [ans.size]
|
sub ebx, [ans.size]
|
||||||
shl ebx, 16
|
shl ebx, 16
|
||||||
add ebx, 16
|
add ebx, 16
|
||||||
mov ecx, [scn.gui_intext]
|
mov ecx, [scn.gui_intext]
|
||||||
|
add ecx, 0x10000000
|
||||||
or ecx, 1 shl 31
|
or ecx, 1 shl 31
|
||||||
mcall 4, , , ans.buffer
|
mcall SF_DRAW_TEXT, , , ans.buffer
|
||||||
|
|
||||||
mov ecx, [scn.gui_text]
|
mcall , <LIST_ITEM_W - 8, 19>, [scn.gui_intext], btn_clr, 1
|
||||||
mcall , <310 - 50 - 25, 16>, , btn_clr, 1
|
|
||||||
add ebx, 1 shl 16
|
add ebx, 1 shl 16
|
||||||
mcall
|
mcall
|
||||||
|
|
||||||
mcall 8, <305 - 50 - 25, 17>, <9, 20>, 0x40000004
|
mcall SF_DEFINE_BUTTON, <LIST_ITEM_W - 14, 17>, <9, 27>, 4 + BT_HIDE
|
||||||
|
|
||||||
mcall 1, 4, 8, [scn.win_body]
|
mov ebx, LIST_ITEM_W - 18
|
||||||
mcall , 323 - 50 - 25
|
|
||||||
mcall , , 30, [scn.3d_light]
|
|
||||||
mcall , 4
|
|
||||||
|
|
||||||
mov ebx, 318 - 16 - 50 - 25
|
|
||||||
sub ebx, [ans.size]
|
sub ebx, [ans.size]
|
||||||
cmp ebx, 24
|
cmp ebx, 24
|
||||||
jg @f
|
jg @f
|
||||||
mov ebx, 24
|
mov ebx, 24
|
||||||
|
|
||||||
@@:
|
@@:
|
||||||
mov [edb1.width], ebx
|
mov [edb1.width], ebx
|
||||||
m2m [edb1.color] , [scn.gui_face]
|
m2m [edb1.color] , [scn.gui_face]
|
||||||
m2m [edb1.focus_border_color], [scn.gui_face]
|
m2m [edb1.focus_border_color], [scn.gui_face]
|
||||||
cmp [error_n], 0
|
cmp [error_n], 0
|
||||||
je @f
|
je @f
|
||||||
mov [edb1.color], 0xFFAAAA
|
mov [edb1.color] , 0x00FFAAAA
|
||||||
mov [edb1.focus_border_color], 0xFFAAAA
|
mov [edb1.focus_border_color], 0x00FFAAAA
|
||||||
|
|
||||||
@@:
|
@@:
|
||||||
invoke editbox.draw, edb1
|
invoke editbox.draw, edb1
|
||||||
|
|
||||||
ret
|
ret
|
||||||
|
|
||||||
endp
|
endp
|
||||||
|
|
||||||
;----------------------
|
; ====================================================================
|
||||||
|
|
||||||
|
proc draw_button, x, y
|
||||||
|
|
||||||
|
mcall SF_DEFINE_BUTTON, <[x], KEYB_BTN_W>, <[y], KEYB_BTN_H>, [but_id], [but_c]
|
||||||
|
|
||||||
|
mov ebx, [x]
|
||||||
|
add ebx, KEYB_BTN_W/2-4
|
||||||
|
|
||||||
|
shl ebx, 16
|
||||||
|
add ebx, [y]
|
||||||
|
add ebx, KEYB_BTN_H/2 - 6
|
||||||
|
or [but_tc], 0x01000000 ; use bigger font
|
||||||
|
mcall SF_DRAW_TEXT, , [but_tc], [txt_id], [txt_size]
|
||||||
|
|
||||||
|
mov eax, [txt_size]
|
||||||
|
add [txt_id], eax
|
||||||
|
inc dword [but_id]
|
||||||
|
|
||||||
|
ret
|
||||||
|
|
||||||
|
endp
|
||||||
|
|
||||||
|
; ====================================================================
|
||||||
|
|
||||||
proc draw_keyb
|
proc draw_keyb
|
||||||
cmp [keyb], byte 0
|
|
||||||
je @f
|
mcall SF_DEFINE_BUTTON, <KEYBOARD_X, (KEYB_BTN_W + GAP)*4 - GAP>, <8, 29>, 250, [sc.work_light]
|
||||||
|
mov ecx, [sc.work_text]
|
||||||
|
or ecx, 0x10000000
|
||||||
|
mcall SF_DRAW_TEXT, <(KEYB_BTN_W + GAP - engineering_len*2)*2 - GAP/2 + KEYBOARD_X, KEYB_BTN_H / 2 - 10 + 8>, , engineering_str, engineering_len
|
||||||
|
|
||||||
mov [txt_size], 1
|
mov [txt_size], 1
|
||||||
mov [but_id], 0x0000000A
|
mov [but_id], 0x0000000A
|
||||||
mov [txt_id], buttons
|
mov [txt_id], buttons
|
||||||
|
|
||||||
mov eax, [scn.win_face]
|
m2m [but_c], [sc.work]
|
||||||
mov [but_c], eax
|
m2m [but_tc], [sc.work_text]
|
||||||
mov eax, [scn.win_text]
|
stdcall draw_button, KEYBOARD_X + (KEYB_BTN_W + GAP)*0, KEYBOARD_Y
|
||||||
mov [but_tc], eax
|
stdcall draw_button, KEYBOARD_X + (KEYB_BTN_W + GAP)*1, KEYBOARD_Y
|
||||||
stdcall draw_button, 4 + 278 - 25, 42 - 25 - 8
|
stdcall draw_button, KEYBOARD_X + (KEYB_BTN_W + GAP)*2, KEYBOARD_Y
|
||||||
stdcall draw_button, 37 + 278 - 25, 42 - 25 - 8
|
stdcall draw_button, KEYBOARD_X + (KEYB_BTN_W + GAP)*3, KEYBOARD_Y
|
||||||
stdcall draw_button, 70 + 278 - 25, 42 - 25 - 8
|
stdcall draw_button, KEYBOARD_X + (KEYB_BTN_W + GAP)*3, KEYBOARD_Y + (KEYB_BTN_H + GAP)*1
|
||||||
stdcall draw_button, 103 + 278 - 25, 42 - 25 - 8
|
stdcall draw_button, KEYBOARD_X + (KEYB_BTN_W + GAP)*3, KEYBOARD_Y + (KEYB_BTN_H + GAP)*2
|
||||||
stdcall draw_button, 103 + 278 - 25, 66 - 25 - 8
|
stdcall draw_button, KEYBOARD_X + (KEYB_BTN_W + GAP)*3, KEYBOARD_Y + (KEYB_BTN_H + GAP)*3
|
||||||
stdcall draw_button, 103 + 278 - 25, 90 - 25 - 8
|
stdcall draw_button, KEYBOARD_X + (KEYB_BTN_W + GAP)*2, KEYBOARD_Y + (KEYB_BTN_H + GAP)*4
|
||||||
stdcall draw_button, 103 + 278 - 25, 114 - 25 - 8
|
stdcall draw_button, KEYBOARD_X + (KEYB_BTN_W + GAP)*1, KEYBOARD_Y + (KEYB_BTN_H + GAP)*4
|
||||||
stdcall draw_button, 70 + 278 - 25, 139 - 25 - 8
|
|
||||||
stdcall draw_button, 37 + 278 - 25, 139 - 25 - 8
|
|
||||||
|
|
||||||
mov eax, [scn.btn_inface]
|
mov [but_c] , 0x00F0969D
|
||||||
mov [but_c], eax
|
mov [but_tc], 0x00FFFFFF
|
||||||
mov eax, [scn.btn_intext]
|
stdcall draw_button, KEYBOARD_X + (KEYB_BTN_W + GAP)*3, KEYBOARD_Y +(KEYB_BTN_H + GAP)*4
|
||||||
mov [but_tc], eax
|
|
||||||
stdcall draw_button, 103 + 278 - 25, 139 - 25 - 8
|
|
||||||
|
|
||||||
mov eax, [scn.btn_face]
|
m2m [but_c] , [sc.work_button]
|
||||||
mov [but_c], eax
|
m2m [but_tc], [sc.work_button_text]
|
||||||
mov eax, [scn.btn_text]
|
stdcall draw_button, KEYBOARD_X + (KEYB_BTN_W + GAP)*0, KEYBOARD_Y + KEYB_BTN_H + GAP
|
||||||
mov [but_tc], eax
|
stdcall draw_button, KEYBOARD_X + (KEYB_BTN_W + GAP)*1, KEYBOARD_Y + KEYB_BTN_H + GAP
|
||||||
stdcall draw_button, 4 + 278 - 25, 66 - 25 - 8
|
stdcall draw_button, KEYBOARD_X + (KEYB_BTN_W + GAP)*2, KEYBOARD_Y + KEYB_BTN_H + GAP
|
||||||
stdcall draw_button, 37 + 278 - 25, 66 - 25 - 8
|
stdcall draw_button, KEYBOARD_X + (KEYB_BTN_W + GAP)*0, KEYBOARD_Y + (KEYB_BTN_H + GAP)*2
|
||||||
stdcall draw_button, 70 + 278 - 25, 66 - 25 - 8
|
stdcall draw_button, KEYBOARD_X + (KEYB_BTN_W + GAP)*1, KEYBOARD_Y + (KEYB_BTN_H + GAP)*2
|
||||||
stdcall draw_button, 4 + 278 - 25, 90 - 25 - 8
|
stdcall draw_button, KEYBOARD_X + (KEYB_BTN_W + GAP)*2, KEYBOARD_Y + (KEYB_BTN_H + GAP)*2
|
||||||
stdcall draw_button, 37 + 278 - 25, 90 - 25 - 8
|
stdcall draw_button, KEYBOARD_X + (KEYB_BTN_W + GAP)*0, KEYBOARD_Y + (KEYB_BTN_H + GAP)*3
|
||||||
stdcall draw_button, 70 + 278 - 25, 90 - 25 - 8
|
stdcall draw_button, KEYBOARD_X + (KEYB_BTN_W + GAP)*1, KEYBOARD_Y + (KEYB_BTN_H + GAP)*3
|
||||||
stdcall draw_button, 4 + 278 - 25, 114 - 25 - 8
|
stdcall draw_button, KEYBOARD_X + (KEYB_BTN_W + GAP)*2, KEYBOARD_Y + (KEYB_BTN_H + GAP)*3
|
||||||
stdcall draw_button, 37 + 278 - 25, 114 - 25 - 8
|
stdcall draw_button, KEYBOARD_X + (KEYB_BTN_W + GAP)*0, KEYBOARD_Y + (KEYB_BTN_H + GAP)*4
|
||||||
stdcall draw_button, 70 + 278 - 25, 114 - 25 - 8
|
|
||||||
stdcall draw_button, 4 + 278 - 25, 139 - 25 - 8
|
|
||||||
|
|
||||||
@@:
|
|
||||||
ret
|
ret
|
||||||
|
|
||||||
endp
|
endp
|
||||||
|
|
||||||
;----------------------
|
; ====================================================================
|
||||||
|
|
||||||
proc draw_list
|
proc draw_list
|
||||||
|
|
||||||
; BACKGROUND
|
; BACKGROUND
|
||||||
|
mov eax, SF_DRAW_RECT
|
||||||
|
mov ebx, LIST_X shl 16 + LIST_ITEM_W
|
||||||
|
mov ecx, LIST_Y shl 16 + LIST_ITEM_H
|
||||||
|
mov edx, [sc.work_light]
|
||||||
mov edi, LIST_ITEM_COUNT
|
mov edi, LIST_ITEM_COUNT
|
||||||
mov eax, 13
|
|
||||||
mov ebx, 4 shl 16 + 320 - 50 - 25
|
|
||||||
mov ecx, 37 shl 16 + LIST_ITEM_SIZE
|
|
||||||
mov edx, LIST_ITEM_COLOR1
|
|
||||||
cmp [his_even], byte 0
|
|
||||||
je @f
|
|
||||||
mov edx, LIST_ITEM_COLOR2
|
|
||||||
@@:
|
@@:
|
||||||
mcall
|
mcall
|
||||||
add ecx, LIST_ITEM_SIZE shl 16
|
; draw separator {
|
||||||
cmp edx, LIST_ITEM_COLOR1
|
push ecx edx
|
||||||
je .set_color_to_2
|
sub ecx, LIST_ITEM_H - 1
|
||||||
mov edx, LIST_ITEM_COLOR1
|
mov edx, [sc.work_dark]
|
||||||
jmp .next
|
mcall
|
||||||
.set_color_to_2:
|
; }
|
||||||
mov edx, LIST_ITEM_COLOR2
|
pop edx ecx
|
||||||
|
add ecx, LIST_ITEM_H shl 16
|
||||||
|
|
||||||
.next:
|
.next:
|
||||||
dec edi
|
dec edi
|
||||||
cmp edi, 0
|
cmp edi, 0
|
||||||
jne @b
|
jne @b
|
||||||
|
|
||||||
|
mcall , <LIST_X , 1>, <LIST_Y, LIST_ITEM_H * 8>, [sc.work_dark]
|
||||||
|
mcall , <LIST_X + LIST_ITEM_W - 1, 1>,
|
||||||
|
mcall , <LIST_X, LIST_ITEM_W>, <LIST_Y + LIST_ITEM_H * 8, 1>
|
||||||
|
|
||||||
; BUTTONS
|
; BUTTONS
|
||||||
|
mov eax, SF_DEFINE_BUTTON
|
||||||
|
mov ebx, LIST_X shl 16 + LIST_ITEM_W
|
||||||
|
mov ecx, 43 shl 16 + LIST_ITEM_H
|
||||||
|
mov edx, 60 + BT_HIDE
|
||||||
mov edi, LIST_ITEM_COUNT
|
mov edi, LIST_ITEM_COUNT
|
||||||
mov eax, 8
|
|
||||||
mov ebx, 4 shl 16 + 320 - 50 - 25
|
|
||||||
mov ecx, 37 shl 16 + LIST_ITEM_SIZE
|
|
||||||
mov edx, 0x40000060
|
|
||||||
@@:
|
@@:
|
||||||
mcall
|
mcall
|
||||||
add ecx, LIST_ITEM_SIZE shl 16
|
add ecx, LIST_ITEM_H shl 16
|
||||||
inc edx
|
inc edx
|
||||||
dec edi
|
dec edi
|
||||||
cmp edi, 0
|
cmp edi, 0
|
||||||
jne @b
|
jne @b
|
||||||
|
|
||||||
; TEXT
|
; TEXT
|
||||||
|
mov eax, SF_DRAW_TEXT
|
||||||
|
mov ebx, (LIST_X + LIST_X) shl 16 + LIST_Y + LIST_TEXT_Y + 1
|
||||||
|
mov ecx, [sc.work_text]
|
||||||
mov edi, LIST_ITEM_COUNT
|
mov edi, LIST_ITEM_COUNT
|
||||||
mov eax, 4
|
|
||||||
mov ebx, 8 shl 16 + 37 + LIST_ITEM_Y
|
|
||||||
mov ecx, LIST_ITEM_TEXT1
|
|
||||||
cmp [his_even], byte 0
|
|
||||||
je @f
|
|
||||||
mov ecx, LIST_ITEM_TEXT2
|
|
||||||
@@:
|
@@:
|
||||||
or ecx, 1 shl 31
|
or ecx, 1 shl 31
|
||||||
mov edx, history
|
mov edx, history
|
||||||
|
|
||||||
@@:
|
@@:
|
||||||
|
add ecx, 0x10000000
|
||||||
mcall
|
mcall
|
||||||
|
|
||||||
push ebx
|
push ebx
|
||||||
add ebx, (320 - 50 - 25) shl 16
|
add ebx, (LIST_ITEM_W - 8) shl 16
|
||||||
mov esi, [edx + 508]
|
mov esi, [edx + 508]
|
||||||
shl esi, 16
|
shl esi, 16
|
||||||
sub ebx, esi
|
sub ebx, esi
|
||||||
@@ -553,15 +596,17 @@
|
|||||||
pop ebx
|
pop ebx
|
||||||
|
|
||||||
add edx, 32
|
add edx, 32
|
||||||
add ebx, LIST_ITEM_SIZE
|
add ebx, LIST_ITEM_H
|
||||||
|
|
||||||
and ecx, 0xFFFFFF
|
and ecx, 0xFFFFFF
|
||||||
cmp ecx, LIST_ITEM_TEXT2
|
cmp ecx, LIST_ITEM_TEXT2
|
||||||
je .set_color_to_2_txt
|
je .set_color_to_2_txt
|
||||||
mov ecx, LIST_ITEM_TEXT2
|
mov ecx, LIST_ITEM_TEXT2
|
||||||
jmp .next_txt
|
jmp .next_txt
|
||||||
|
|
||||||
.set_color_to_2_txt:
|
.set_color_to_2_txt:
|
||||||
mov ecx, LIST_ITEM_TEXT1
|
mov ecx, LIST_ITEM_TEXT1
|
||||||
|
|
||||||
.next_txt:
|
.next_txt:
|
||||||
or ecx, 1 shl 31
|
or ecx, 1 shl 31
|
||||||
|
|
||||||
@@ -570,29 +615,35 @@
|
|||||||
jne @b
|
jne @b
|
||||||
|
|
||||||
ret
|
ret
|
||||||
|
|
||||||
endp
|
endp
|
||||||
|
|
||||||
;----------------------
|
; ====================================================================
|
||||||
|
|
||||||
proc str_len uses ebx, str
|
proc str_len uses ebx, str
|
||||||
|
|
||||||
xor eax, eax
|
xor eax, eax
|
||||||
mov ebx, [str]
|
mov ebx, [str]
|
||||||
|
|
||||||
@@:
|
@@:
|
||||||
cmp [ebx], byte 0
|
cmp [ebx], byte 0
|
||||||
je @f
|
je @f
|
||||||
inc eax
|
inc eax
|
||||||
inc ebx
|
inc ebx
|
||||||
jmp @b
|
jmp @b
|
||||||
@@:
|
|
||||||
|
|
||||||
|
@@:
|
||||||
ret
|
ret
|
||||||
|
|
||||||
endp
|
endp
|
||||||
|
|
||||||
;----------------------
|
; ====================================================================
|
||||||
|
|
||||||
proc str_cpy uses eax ebx ecx, from, to
|
proc str_cpy uses eax ebx ecx, from, to
|
||||||
|
|
||||||
mov eax, [from]
|
mov eax, [from]
|
||||||
mov ebx, [to]
|
mov ebx, [to]
|
||||||
|
|
||||||
@@:
|
@@:
|
||||||
cmp [eax], byte 0
|
cmp [eax], byte 0
|
||||||
je @f
|
je @f
|
||||||
@@ -601,19 +652,56 @@
|
|||||||
inc eax
|
inc eax
|
||||||
inc ebx
|
inc ebx
|
||||||
jmp @b
|
jmp @b
|
||||||
|
|
||||||
@@:
|
@@:
|
||||||
mov [ebx], byte 0
|
mov [ebx], byte 0
|
||||||
ret
|
ret
|
||||||
|
|
||||||
endp
|
endp
|
||||||
|
|
||||||
;----------------------
|
; ====================================================================
|
||||||
|
|
||||||
dataend:
|
if lang eq ru_RU
|
||||||
|
|
||||||
;===============================
|
engineering_str cp866 "Инженерный режим"
|
||||||
|
engineering_len = $ - engineering_str
|
||||||
|
|
||||||
|
else if lang eq es_ES
|
||||||
|
|
||||||
|
engineering_str db " Modo ingeniero "
|
||||||
|
engineering_len = $ - engineering_str
|
||||||
|
else
|
||||||
|
|
||||||
|
engineering_str db "Engineering calc"
|
||||||
|
engineering_len = $ - engineering_str
|
||||||
|
|
||||||
|
endf
|
||||||
|
|
||||||
|
; ====================================================================
|
||||||
|
|
||||||
|
f70_calc:
|
||||||
|
dd SSF_START_APP
|
||||||
|
dd 0
|
||||||
|
dd 0
|
||||||
|
dd 0
|
||||||
|
dd 0
|
||||||
|
db '/sys/calc', 0
|
||||||
|
|
||||||
|
; system colors internal
|
||||||
|
scn:
|
||||||
|
.gui_tb_in_shd dd 0x00CED0D0
|
||||||
|
.gui_face dd 0x00FAF8FA
|
||||||
|
.gui_text dd 0x10373C42
|
||||||
|
.gui_intext dd 0x005F5F5F
|
||||||
|
.gui_select dd 0x00C7C9C9
|
||||||
|
|
||||||
|
; ====================================================================
|
||||||
|
|
||||||
|
I_END:
|
||||||
|
|
||||||
rb 2048
|
rb 2048
|
||||||
stacktop:
|
|
||||||
|
STACKTOP:
|
||||||
|
|
||||||
exp rb 480
|
exp rb 480
|
||||||
exp_pos rd 1
|
exp_pos rd 1
|
||||||
@@ -631,38 +719,10 @@
|
|||||||
but_tc rd 1
|
but_tc rd 1
|
||||||
txt_id rd 1
|
txt_id rd 1
|
||||||
txt_size rd 1
|
txt_size rd 1
|
||||||
keyb rb 1
|
|
||||||
|
|
||||||
his_even rb 1
|
|
||||||
history rb 512 * LIST_ITEM_COUNT
|
history rb 512 * LIST_ITEM_COUNT
|
||||||
rb 512
|
rb 512
|
||||||
|
|
||||||
struc system_colors_internal {
|
sc system_colors
|
||||||
.3d_face dd 0xCED0D0
|
|
||||||
.3d_dark dd 0xD7D7D7
|
|
||||||
.3d_light dd 0xFEFEFE
|
|
||||||
.win_title dd 0x2F2F2F
|
|
||||||
.win_body dd 0xE4DFE1
|
|
||||||
.btn_face dd 0xEFEBEF
|
|
||||||
.btn_text dd 0x373C42
|
|
||||||
.win_text dd 0x000000
|
|
||||||
.panel_frame dd 0x94AECE
|
|
||||||
.win_face dd 0xE1E1E1
|
|
||||||
.win_inface dd 0xE1E1E1
|
|
||||||
.win_frame dd 0x204962
|
|
||||||
.btn_inface dd 0xEFEBEF
|
|
||||||
.btn_intext dd 0xD0D9E8
|
|
||||||
.btn_fctext dd 0x2D3135
|
|
||||||
.gui_shadow dd 0xFFFFFF
|
|
||||||
.gui_face dd 0xFAF8FA
|
|
||||||
.gui_inface dd 0xF6F3F6
|
|
||||||
.gui_fcface dd 0xFAF8FA
|
|
||||||
.gui_frame dd 0x7698C0
|
|
||||||
.gui_text dd 0x373C42
|
|
||||||
.gui_intext dd 0x5F5F5F
|
|
||||||
.gui_select dd 0xC7C9C9
|
|
||||||
}
|
|
||||||
|
|
||||||
scn system_colors_internal
|
MEM:
|
||||||
|
|
||||||
memory:
|
|
||||||
|
Reference in New Issue
Block a user