Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 617 → Rev 616

/programs/develop/tinypad/trunk/external/dll.inc
File deleted
/programs/develop/tinypad/trunk/external/libio.inc
File deleted
/programs/develop/tinypad/trunk/history.txt
File deleted
/programs/develop/tinypad/trunk/data/tp-defines.inc
File deleted
/programs/develop/tinypad/trunk/data/tp-udata.inc
File deleted
/programs/develop/tinypad/trunk/data/tp-locale.inc
File deleted
/programs/develop/tinypad/trunk/data/tp-idata.inc
File deleted
/programs/develop/tinypad/trunk/data/tp-tables.inc
File deleted
/programs/develop/tinypad/trunk/tp-locale.inc
0,0 → 1,309
 
sz htext,'TINYPAD ',APP_VERSION
 
menubar_res main_menu,\
ru,'” ©«' ,mm.File ,onshow.file ,\
ru,'à ¢ª ' ,mm.Edit ,onshow.edit ,\
ru,'®¨áª' ,mm.Search ,onshow.search ,\
ru,'‡ ¯ãáª' ,mm.Run ,onshow.run ,\
ru,'Š®¤¨à®¢ª ',mm.Encoding,onshow.recode ,\
ru,'Ž¯æ¨¨' ,mm.Options ,onshow.options,\
\
en,'File' ,mm.File ,onshow.file ,\
en,'Edit' ,mm.Edit ,onshow.edit ,\
en,'Search' ,mm.Search ,onshow.search ,\
en,'Run' ,mm.Run ,onshow.run ,\
en,'Encoding',mm.Encoding,onshow.recode ,\
en,'Options' ,mm.Options ,onshow.options,\
\
et,'Fail' ,mm.File ,onshow.file ,\
et,'Muuda' ,mm.Edit ,onshow.edit ,\
et,'Otsi' ,mm.Search ,onshow.search ,\
et,'Käivita' ,mm.Run ,onshow.run ,\
et,'Kodeering',mm.Encoding,onshow.recode ,\
et,'Seaded' ,mm.Options ,onshow.options
 
popup_res mm.File,\
ru,'®¢ë©' ,'Ctrl+N' ,New ,\
ru,'Žâªàëâì...' ,'Ctrl+O' ,Open ,\
ru,'‘®åà ­¨âì' ,'Ctrl+S' ,Save ,\
ru,'‘®åà ­¨âì ª ª...','Ctrl+Shift+S',SaveAs,\
ru,'-' ,'' , ,\
ru,'‡ ªàëâì' ,'Ctrl+F4' ,Close ,\
ru,'-' ,'' , ,\
ru,'‚ë室' ,'Alt+X' ,Exit ,\
\
en,'New' ,'Ctrl+N' ,New ,\
en,'Open...' ,'Ctrl+O' ,Open ,\
en,'Save' ,'Ctrl+S' ,Save ,\
en,'Save as...','Ctrl+Shift+S',SaveAs,\
en,'-' ,'' , ,\
en,'Close' ,'Ctrl+F4' ,Close ,\
en,'-' ,'' , ,\
en,'Exit' ,'Alt+X' ,Exit,\
\
et,'Uus' ,'Ctrl+N' ,New ,\
et,'Ava...' ,'Ctrl+O' ,Open ,\
et,'Salvesta' ,'Ctrl+S' ,Save ,\
et,'Salvesta nimega...','Ctrl+Shift+S',SaveAs,\
et,'-' ,'' , ,\
et,'Sulge' ,'Ctrl+F4' ,Close ,\
et,'-' ,'' , ,\
et,'Välju' ,'Alt+X' ,Exit
 
popup_res mm.Edit,\
ru,'‚ë१ âì' ,'Ctrl+X',Cut ,\
ru,'Š®¯¨à®¢ âì' ,'Ctrl+C',Copy ,\
ru,'‚áâ ¢¨âì' ,'Ctrl+V',Insert,\
ru,'“¤ «¨âì' ,'' ,Delete,\
ru,'-' ,'' , ,\
ru,'‚뤥«¨âì ¢áñ','Ctrl+A',SelAll,\
\
en,'Cut' ,'Ctrl+X',Cut ,\
en,'Copy' ,'Ctrl+C',Copy ,\
en,'Paste' ,'Ctrl+V',Insert,\
en,'Delete' ,'' ,Delete,\
en,'-' ,'' , ,\
en,'Select all','Ctrl+A',SelAll,\
\
et,'Lõika' ,'Ctrl+X',Cut ,\
et,'Kopeeri' ,'Ctrl+C',Copy ,\
et,'Kleebi' ,'Ctrl+V',Insert,\
et,'Kustuta' ,'' ,Delete,\
et,'-' ,'' , ,\
et,'Vali kõik' ,'Ctrl+A',SelAll
 
popup_res mm.Search,\
ru,'¥à¥©â¨...' ,'Ctrl+G',Position,\
ru,'-' ,'' , ,\
ru,' ©â¨...' ,'Ctrl+F',Find ,\
ru,' ©â¨ ¤ «¥¥','F3' ,FindNext,\
ru,'‡ ¬¥­¨âì...','Ctrl+H',Replace ,\
\
en,'Position...','Ctrl+G',Position,\
en,'-' ,'' , ,\
en,'Find...' ,'Ctrl+F',Find ,\
en,'Find next' ,'F3' ,FindNext,\
en,'Replace...' ,'Ctrl+H',Replace ,\
\
et,'Positsioon...','Ctrl+G',Position,\
et,'-' ,'' , ,\
et,'Leia...' ,'Ctrl+F',Find ,\
et,'Leia järgmine','F3' ,FindNext,\
et,'Asenda...' ,'Ctrl+H',Replace
 
popup_res mm.Run,\
ru,'‡ ¯ãáâ¨âì' ,'F9' ,Run ,\
ru,'Š®¬¯¨«¨à®¢ âì' ,'Ctrl+F9',Compile ,\
ru,'-' ,'' , ,\
ru,'„®áª  ®â« ¤ª¨' ,'' ,DbgBoard,\
ru,'‘¨á⥬­ë¥ ä㭪樨','' ,SysFuncs,\
\
en,'Run' ,'F9' ,Run ,\
en,'Compile' ,'Ctrl+F9',Compile ,\
en,'-' ,'' , ,\
en,'Debug board' ,'' ,DbgBoard,\
en,'System functions' ,'' ,SysFuncs,\
\
et,'Käivita' ,'F9' ,Run ,\
et,'Kompileeri' ,'Ctrl+F9',Compile ,\
et,'-' ,'' , ,\
et,'Debug board' ,'' ,DbgBoard,\
et,'Süsteemi funktsioonid' ,'' ,SysFuncs
 
popup_res mm.Encoding,\
@!,<'CP866 ',0x1A,' CP1251'>,'',CP866.CP1251,\
@!,<'CP1251 ',0x1A,' CP866' >,'',CP1251.CP866,\
@!,<'-' >,'', ,\
@!,<'CP866 ',0x1A,' KOI8-R'>,'',CP866.KOI8R ,\
@!,<'KOI8-R ',0x1A,' CP866' >,'',KOI8R.CP866 ,\
@!,<'-' >,'', ,\
@!,<'CP1251 ',0x1A,' KOI8-R'>,'',CP1251.KOI8R,\
@!,<'KOI8-R ',0x1A,' CP1251'>,'',KOI8R.CP1251
 
popup_res mm.Options,\
ru,'‚­¥è­¨© ¢¨¤...' ,'',Appearance ,\
ru,'-' ,'', ,\
ru,'¥§®¯ á­®¥ ¢ë¤¥«¥­¨¥' ,'',SecureSel ,\
ru,'€¢â®¬ â¨ç¥áª¨¥ ᪮¡ª¨' ,'',AutoBrackets,\
ru,'€¢â®¬ â¨ç¥áª¨© ®âáâã¯' ,'',AutoIndents ,\
ru,'“¬­ ï â ¡ã«ïæ¨ï' ,'',SmartTabs ,\
ru,'Ž¯â¨¬ «ì­®¥ á®åà ­¥­¨¥','',OptimalFill ,\
ru,'-' ,'', ,\
ru,'®¬¥à  áâப' ,'',LineNumbers ,\
\
en,'Appearance...' ,'',Appearance ,\
en,'-' ,'', ,\
en,'Secure selection' ,'',SecureSel ,\
en,'Automatic brackets' ,'',AutoBrackets,\
en,'Automatic indents' ,'',AutoIndents ,\
en,'Smart tabulation' ,'',SmartTabs ,\
en,'Optimal fill on saving','',OptimalFill ,\
en,'-' ,'', ,\
en,'Line numbers' ,'',LineNumbers ,\
\
et,'Välimus...' ,'',Appearance ,\
et,'-' ,'', ,\
et,'Secure selection' ,'',SecureSel ,\
et,'Automaatsed sulud' ,'',AutoBrackets,\
et,'Automaatsed taandread' ,'',AutoIndents ,\
et,'Tark tabulatsioon' ,'',SmartTabs ,\
et,'Optimaalne täitmine salvestamisel','',OptimalFill ,\
et,'-' ,'', ,\
et,'Rea numbrid' ,'',LineNumbers
 
lsz s_defname,\
en,<'Untitled',0>,\
ru,<'¥§ë¬ï­­ë©',0>,\
et,<'Nimetu',0>
 
lsz s_modified,\
ru,'ˆ§¬¥­¥­®',\
en,'Modified',\
et,'Muudetud'
 
lsz s_2filename,\
ru,'ˆ¬ï ä ©« :',\
en,'Filename:',\
et,'Faili nimi:'
lsz s_2open,\
ru,'Žâªàëâì',\
en,'Open',\
et,'Ava'
lsz s_2save,\
ru,'‘®åà ­¨âì',\
en,'Save',\
et,'Salvesta'
lsz s_2save_no,\
ru,'¥â',\
en,'No',\
et,'Ei'
lsz s_2find,\
ru,' ©â¨',\
en,'Find',\
et,'Leia'
db ':'
lsz s_2replace,\
ru,'‡ ¬¥­¨âì',\
en,'Replace',\
et,'Asenda'
db ':'
lsz s_2cancel,\
ru,'Žâ¬¥­ ',\
en,'Cancel',\
et,'Tühista'
lsz s_color,\
ru,'–¢¥â: 0x',\
en,'Color: 0x',\
et,'Värv: 0x'
lsz s_tabpos,\
ru,' á¯®«®¦¥­¨¥ § ª« ¤®ª',\
en,'Tabs placement',\
et,'Saki asetus'
 
lsz s_enter_filename,\
ru,<'‚¢¥¤¨â¥ ¨¬ï ä ©« ',0>,\
en,<'Enter filename',0>,\
et,<'Sisesta faili nimi',0>
 
lsz s_ask_save,\
ru,<'†¥« ¥â¥ á®åà ­¨âì?',0>,\
en,<'Would you like to save?',0>,\
et,<'Kas soovite salvestada?',0> ; Now correct
 
lsz s_enter_text_to_find,\
ru,<'‚¢¥¤¨â¥ ⥪áâ ¤«ï ¯®¨áª ',0>,\
en,<'Enter text to find',0>,\
et,<'Sisesta otsitav tekst',0>
 
lsz s_enter_text_to_replace,\
ru,<'‚¢¥¤¨â¥ ⥪áâ ¤«ï § ¬¥­ë',0>,\
en,<'Enter text to replace',0>,\
et,<'Sisesta asendatav tekst',0>
 
lsz s_text_not_found,\
ru,<'„®á⨣­ãâ ª®­¥æ ä ©« , ⥪áâ ­¥ ­ ©¤¥­',0>,\
en,<'Reached end of file, text not found',0>,\
et,<'Faili lõpp, teksti ei leitud',0>
 
lszc s_fs_error,b,\
ru,<'Ž¯¥à æ¨ï § ¢¥à襭  ãᯥ譮 (0)',0>,\
ru,<'',0>,\
ru,<'”ã­ªæ¨ï ­¥ ¯®¤¤¥à¦¨¢ ¥âáï ¤«ï ¤ ­­®© ä ©«®¢®© á¨á⥬ë (2)',0>,\
ru,<'¥¨§¢¥áâ­ ï ä ©«®¢ ï á¨á⥬  (3)',0>,\
ru,<'',0>,\
ru,<'¥¢®§¬®¦­® ®âªàëâì ä ©« (5)',0>,\
ru,<'Ž¯¥à æ¨ï § ¢¥à襭  ãᯥ譮 (6)',0>,\
ru,<'€¤à¥á ­ å®¤¨âáï §  £à ­¨æ ¬¨ ¯ ¬ï⨠¯à®£à ¬¬ë (7)',0>,\
ru,<'  ¤¨áª¥ ­¥â ᢮¡®¤­®£® ¬¥áâ  (8)',0>,\
ru,<'’ ¡«¨æ  FAT ã­¨ç⮦¥­  (9)',0>,\
ru,<'„®áâ㯠§ ¯à¥éñ­ (10)',0>,\
ru,<'Žè¨¡ª  ãáâனá⢠ (11)',0>,\
\
en,<'Operation executed successfully (0)',0>,\
en,<'',0>,\
en,<'Function is not supported for the given filesystem (2)',0>,\
en,<'Unknown filesystem (3)',0>,\
en,<'',0>,\
en,<'Unable to open file (5)',0>,\
en,<'Operation executed successfully (6)',0>,\
en,<'Pointer lies outside of application memory (7)',0>,\
en,<'Disk is full (8)',0>,\
en,<'FAT table is destroyed (9)',0>,\
en,<'Access denied (10)',0>,\
en,<'Device error (11)',0>,\
\
et,<'Operatsioon käivitati edukalt (0)',0>,\
et,<'',0>,\
et,<'Failisüsteem ei toeta funktsiooni (2)',0>,\
et,<'Tundmatu failisüsteem (3)',0>,\
et,<'',0>,\
et,<'Faili ei suudetud avada (5)',0>,\
et,<'Operatsioon käivitatud edukalt (6)',0>,\
et,<'Viit on väljaspool programmi mälu (7)',0>,\
et,<'Ketas täis (8)',0>,\
et,<'FAT tabel hävitatud (9)',0>,\
et,<'Juurdepääs keelatud (10)',0>,\
et,<'Seadme viga (11)',0>
 
lszc s_appearance,b,\
ru,'’¥ªáâ',\
ru,'”®­',\
ru,'’¥ªá⠢뤥«¥­¨ï',\
ru,'”®­ ¢ë¤¥«¥­¨ï',\
ru,'‘¨¬¢®«ë',\
ru,'—¨á« ',\
ru,'‘âப¨',\
ru,'Š®¬¬¥­â à¨¨',\
ru,'ˆ§¬¥­ñ­ë¥ áâப¨',\
ru,'‘®åà ­ñ­­ë¥ áâப¨',\
\
en,'Text',\
en,'Background',\
en,'Selection text',\
en,'Selection background',\
en,'Symbols',\
en,'Numbers',\
en,'Strings',\
en,'Comments',\
en,'Modified lines',\
en,'Saved lines',\
\
et,'Tekst',\
et,'Taust',\
et,'Valitud tekst',\
et,'Valitud taust',\
et,'Sümbolid',\
et,'Numbrid',\
et,'Stringid',\
et,'Kommentaarid',\
et,'Muudetud read',\
et,'Salvestatud read'
 
lsz sysfuncs_filename,\
ru,<'SYSFUNCR.TXT',0>,\
en,<'SYSFUNCS.TXT',0>,\
et,<'SYSFUNCET.TXT',0>
 
sz s_example,'EXAMPLE.ASM'
sz s_still ,'still'
/programs/develop/tinypad/trunk/tinypad.asm
4,7 → 4,7
; memory to compile: 3.0/9.0 MBytes (without/with size optimizations)
; version: 4.0.4
; last update: 2007-02-08 (Feb 08, 2007)
; minimal kernel: revision #270 (svn://kolibrios.org/kernel/trunk)
; minimal kernel: revision #270 (svn://kolibrios.org/kernel)
;-----------------------------------------------------------------------------
; originally by: Ville Michael Turjanmaa >> villemt@aton.co.jyu.fi
; maintained by: Mike Semenyako >> mike.dld@gmail.com
11,25 → 11,156
; Ivan Poddubny >> ivan-yar@bk.ru
;-----------------------------------------------------------------------------
; TODO (4.1.0):
; - add vertical selection, undo, goto position, overwrite mode, smart tabulation
; - optimize drawing (reduce flickering)
; - add vertical selection, undo, goto position, overwrite mode
; - improve window drawing with small dimensions
; - save/load settings to/from ini file, not executable
; - path autocompletion for open/save dialogs
; - save settings to ini file, not to executable
; - add prompt to save file before closing/opening
; - other bug-fixes and speed/size optimizations
;
; HISTORY:
; 4.0.5 (mike.dld and Rus)
; bug-fixes:
; - a new tab is created when opening a file from folder of tinypad
; - correct call save-dialog for saving new files or files from folder of tinypad
; new features:
; - added prompt to save file before closing
; - added close tab button
; 4.0.4 (mike.dld)
; bug-fixes:
; - statusbar contained hint after dialog operation cancelled
; - small drawing fix for gutter and line saved/modified markers
; (incorrect calculations)
; - incorrect lines marking on Ctrl+V
; - put filename of current tab into open/save dialog (noticed by Maxxxx32)
; changes:
; - editor and other modifications to ease parts placement changing,
; including changes in look
; - modified/saved colors now match those in MSVS
; - function 70 for *all* file operations (including diamond's fixes)
; - use memory manager instead of statically allocated region
; - case-insensitive filenames input, to be able to open/save files with
; non-latin chars in name (russian etc.)
; - reduced flickering (changes checker)
; - overall code cleanup
; new features:
; - recode tables between CP866, CP1251 and KOI8-R (suggested by Victor)
; - tabbed interface, ability to open several files in one app instance
; (thanks IRC guys for ideas and testing)
; - make any tab default to compile it disregarding currently active tab
; - configuration dialog (colors, tabs positioning)
; 4.0.3 (mike.dld)
; bug-fixes:
; - 1-char selection if pressing <BS> out of real line length
; - fault in `writepos`, added call to function 9
; - main menu items weren't highlighted if popup opened and cursor
; isn't in main menu item's area
; - statusbar and textboxes drawing fixes (wrong colors)
; - perform no redraw while pressing Shift, Ctrl, Alt keys
; - data length from DOCPAK in string representation (fixed by diamond)
; - compare file extension case-insensitively (fixed by diamond)
; changes:
; - function 70 instead of 58 for files loading/saving
; - clientarea-relative drawing (less code)
; - every line's dword is now splitted into 2 words;
; low word - line block length, so max line length is 65535 now
; high word - various flags. for now, only 2 of 16 bits are used:
; if bit #0 is set, line was modified since file open
; if bit #1 is set, line was saved after last modification
; high word could also be further used for code collapsing and different
; line marking features (breakpoints, errors, bookmarks, etc.)
; new features:
; - line markers for modified and saved lines
; - status messages for various actions
; 4.0.2 (mike.dld)
; bug-fixes:
; - program terminates if started with parameters (fine for DOCPAK)
; 4.0.1 (mike.dld)
; bug-fixes:
; - unable to run program after exiting from main menu (Alt+X)
; new features:
; - integration with DOCPAK
; 4.0 (mike.dld)
; bug-fixes:
; - main menu popups' "on show" was called only for first shown popup
; - clear selection on left/right arrow keys
; new features:
; - "replace" dialog (w/o "skip", "replace all")
; - line numbers display
; - options (except "appearance" and "smart tabulation")
; - options saving (colors, window position, "Options" popup triggers)
; 4.0 beta 2 (mike.dld)
; bug-fixes:
; - unable to start if /rd/1/example.asm is missing (from Halyavin)
; - clicking on menu items draws main window in popup (from Rohan)
; - passed parameters aren't taken into account (from Mario79)
; - background isn't erased if text lines < screen lines after
; selection deletion (from Rohan)
; 4.0 beta 1 (mike.dld)
; menu bar and popup menu;
; removed buttons from the top and input fields from the bottom since
; now they're accesible through main/popup menu;
; improved keyboard handling (using 66th function);
; support for almost all FASMW keyboard shourtcuts;
; added text selection ability, standard selection operations
; (copy,cut,paste);
; new integrated dialogs (open, save, find)
; fix to collapse SPACEs into TABs only for *.asm and *.inc files
; 3.78a (mike.dld)
; fixed termination while typing in x positions higher than (line_length+10);
; improved drawing on small heights
; don't draw window while its height = 0 (Kolibri "minimize" support)
; 3.78 (mike.dld)
; now lines may be of ANY length;
; optimized memory usage (less memory for internal file representation)
; after loading file, it's internal size equals to its real size
; plus 14 bytes for each line (4 bytes for line length
; and 10 spaced to the end - to reduce data relocations count);
; completely rewritten keyboard handling;
; added horizontal scrollbar;
; all line feed formats are supported: WIN(CRLF),*NIX(LF),MAC(CR);
; etc.
; 3.77 (mike.dld)
; changed save_string to collapse SPACEs into TABs;
; rewrote drawfile from scratch (speed++)
; through some drawing improvements needed
; (some checkups to reduce flickering);
; writepos (size--);
; fixed drawing window while height < 100px, and for non-asm files;
; several small fixes; speed/size optimizations
; 3.76 (mike.dld)
; changed loadfile/loadhdfile to expand TABs into SPACEs;
; changed TAB,ENTER,DELETE,BSPACE keys behaviour (rewritten from scratch);
; vertical scrollbar;
; extra window resizing capabilities (added a couple of constants);
; completely new text cursor management & moving text cursor with mouse;
; improved search function, moving cursor to beginning of text found;
; adjustable max line width (change LINE_WIDTH & recompile) // (obsolet)
; 3.75a
; fixed converting char to upper case in read_string
; 3.75
; rewrote save_file from scratch; bugfix in loadfile;
; 3.74
; optimisation
; 3.73
; completly new load_file function
; 3.72
; speed++
; 3.71
; error beep
; 3.6,3.7:
; many bugs fixed
; simple toolbar
; compile, run applications from TINYPAD, all fasm output is in debug board
; TAB button
; auto-indent
; Ctrl+L - insert comment string
;-----------------------------------------------------------------------------
; See history.txt for complete changelog
;-----------------------------------------------------------------------------
 
include 'lang.inc'
 
include '../../../macros.inc' ; useful stuff
include '../../../struct.inc'
include '../../../proc32.inc'
 
include 'external/libio.inc'
 
include '..\..\..\macros.inc' ; useful stuff
;include 'proc32.inc'
include 'tinypad.inc'
 
;purge mov,add,sub ;  SPEED
 
header '01',1,@CODE,TINYPAD_END,STATIC_MEM_END,MAIN_STACK,@PARAMS,self_path
36,9 → 167,6
 
APP_VERSION equ '4.0.4'
 
TRUE = 1
FALSE = 0
 
;include 'debug.inc'
;define __DEBUG__ 1
;define __DEBUG_LEVEL__ 1
113,11 → 241,8
or eax,eax
jz key.alt_x.close
 
stdcall dll.Load,@IMPORT
or eax,eax
jnz key.alt_x.close
 
stdcall mem.Alloc,65536
mov eax,65536
call mem.Alloc
mov [temp_buf],eax
 
inc [do_not_draw]
160,7 → 285,8
 
add edx,20
 
stdcall mem.Alloc,edx
mov eax,edx
call mem.Alloc
mov ebp,eax
push eax
 
181,7 → 307,8
call load_from_memory
 
pop ebp
stdcall mem.Free,ebp
mov eax,ebp
call mem.Free
 
jmp @f
.noipc:
234,71 → 361,8
jmp still.skip_write
 
;-----------------------------------------------------------------------------
proc get_event ctx ;//////////////////////////////////////////////////////////
func start_fasm ;/////////////////////////////////////////////////////////////
;-----------------------------------------------------------------------------
mcall 10
dec eax ; redraw ?
jz .redraw
dec eax ; key ?
jz .key
dec eax ; button ?
jz .button
sub eax,2 ; background ?
jz .background
dec eax ; mouse ?
jz .mouse
dec eax ; ipc ?
jz .ipc
dec eax ; network ?
jz .network
dec eax ; debug ?
jz .debug
sub eax,7 ; irq ?
js .nothing
cmp eax,15
jg .nothing
jmp .irq
 
.nothing:
mov eax,EV_IDLE
ret
 
.redraw:
mov eax,EV_REDRAW
ret
 
.key:
mov eax,EV_KEY
ret
 
.button:
mov eax,EV_BUTTON
ret
 
.background:
mov eax,EV_BACKGROUND
ret
 
.mouse:
mov eax,EV_MOUSE
ret
 
.ipc:
mov eax,EV_IPC
ret
 
.network:
mov eax,EV_NETWORK
ret
 
.debug:
mov eax,EV_DEBUG
ret
endp
 
;-----------------------------------------------------------------------------
proc start_fasm ;/////////////////////////////////////////////////////////////
;-----------------------------------------------------------------------------
; BL = run after compile
;-----------------------------------------------------------------------------
; FASM infile,outfile,/path/to/files[,run]
362,18 → 426,18
start_ret:
mcall 70,app_start
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc open_debug_board ;///////////////////////////////////////////////////////
func open_debug_board ;///////////////////////////////////////////////////////
;-----------------------------------------------------------------------------
mov [app_start.filename],app_board
mov [app_start.params],0
jmp start_ret
endp
endf
 
;-----------------------------------------------------------------------------
proc open_sysfuncs_txt ;//////////////////////////////////////////////////////
func open_sysfuncs_txt ;//////////////////////////////////////////////////////
;-----------------------------------------------------------------------------
mov [app_start.filename],app_docpak
mov [app_start.params],sysfuncs_param
384,7 → 448,7
mov [app_start.params],sysfuncs_filename
call start_ret
@@: ret
endp
endf
 
set_opt:
 
428,7 → 492,7
 
;-----------------------------------------------------------------------------
 
include 'data/tp-defines.inc'
include 'tp-defines.inc'
 
include 'tp-draw.asm'
include 'tp-key.asm'
443,71 → 507,359
include 'tp-editor.asm'
include 'tp-recode.asm'
 
include 'external/dll.inc'
;include 'lib-ini.asm'
 
;-----------------------------------------------------------------------------
section @DATA ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
;-----------------------------------------------------------------------------
 
include 'data/tp-idata.inc'
vscrl_capt dd -1
hscrl_capt dd -1
body_capt dd -1
 
;-----------------------------------------------------------------------------
section @IMPORT ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
;-----------------------------------------------------------------------------
;align 16
;@IMPORT:
key0 db \
0x00,0x00,0x02,0x03,0x04,0x05,0x06,0x07,\
0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x00,0x00,\
0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,\
0x18,0x19,0x1A,0x1B,0x00,0x00,0x1E,0x1F,\
0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,\
0x28,0x29,0x00,0x2B,0x2C,0x2D,0x2E,0x2F,\
0x30,0x31,0x32,0x33,0x34,0x35,0x00,0x00,\
0x00,0x39,0x00,0x00,0x00,0x00,0x00,0x00
times 12*16 db 0x00
 
library \
libini,'libini.obj',\
libio,'libio.obj',\
libgfx,'libgfx.obj'
accel_table_main dd \
0x0000000E,key.bkspace ,\ ; BackSpace
0x0000000F,key.tab ,\ ; Tab
0x0000001C,key.return ,\ ; Return
0x0000003D,key.f3 ,\ ; F3
0x00000043,key.f9 ,\ ; F9
0x00000147,key.home ,\ ; Home
0x00000148,key.up ,\ ; Up
0x00000149,key.pgup ,\ ; PageUp
0x0000014B,key.left ,\ ; Left
0x0000014D,key.right ,\ ; Right
0x0000014F,key.end ,\ ; End
0x00000150,key.down ,\ ; Down
0x00000151,key.pgdn ,\ ; PageDown
0x00000152,key.ins ,\ ; Insert
0x00000153,key.del ,\ ; Delete
0x00010043,key.shift_f9 ,\ ; Shift+F9
0x00010147,key.shift_home ,\ ; Shift+Home
0x00010148,key.shift_up ,\ ; Shift+Up
0x00010149,key.shift_pgup ,\ ; Shift+PageUp
0x0001014B,key.shift_left ,\ ; Shift+Left
0x0001014D,key.shift_right ,\ ; Shift+Right
0x0001014F,key.shift_end ,\ ; Shift+End
0x00010150,key.shift_down ,\ ; Shift+Down
0x00010151,key.shift_pgdn ,\ ; Shift+PageDown
0x00010153,key.del ,\ ; Shift+Delete
0x0002000F,key.ctrl_tab ,\ ; Ctrl+Tab
0x00020015,key.ctrl_y ,\ ; Ctrl+Y
0x00020018,key.ctrl_o ,\ ; Ctrl+O
0x0002001E,key.ctrl_a ,\ ; Ctrl+A
0x0002001F,key.ctrl_s ,\ ; Ctrl+S
0x00020020,key.ctrl_d ,\ ; Ctrl+D
0x00020021,key.ctrl_f ,\ ; Ctrl+F
0x00020022,key.ctrl_g ,\ ; Ctrl+G
0x00020023,key.ctrl_h ,\ ; Ctrl+H
\;0x00020026,key.ctrl_l ,\ ; Ctrl+L
0x0002002D,key.ctrl_x ,\ ; Ctrl+X
0x0002002E,key.ctrl_c ,\ ; Ctrl+C
0x0002002F,key.ctrl_v ,\ ; Ctrl+V
0x00020031,key.ctrl_n ,\ ; Ctrl+N
0x0002003E,key.ctrl_f4 ,\ ; Ctrl+F4
0x00020043,key.ctrl_f9 ,\ ; Ctrl+F9
0x00020147,key.ctrl_home ,\ ; Ctrl+Home
\;0x00020148,key.ctrl_up ,\ ; Ctrl+Up
0x00020149,key.ctrl_pgup ,\ ; Ctrl+PageUp
0x0002014B,key.ctrl_left ,\ ; Ctrl+Left
0x0002014D,key.ctrl_right ,\ ; Ctrl+Right
0x0002014F,key.ctrl_end ,\ ; Ctrl+End
\;0x00020150,key.ctrl_down ,\ ; Ctrl+Down
0x00020151,key.ctrl_pgdn ,\ ; Ctrl+PageDown
0x00020153,key.del ,\ ; Ctrl+Del
0x0003000F,key.shift_ctrl_tab ,\ ; Shift+Ctrl+Tab
0x0003001F,key.shift_ctrl_s ,\ ; Shift+Ctrl+S
0x00030147,key.shift_ctrl_home ,\ ; Shift+Ctrl+Home
\;0x00030148,key.shift_ctrl_up ,\ ; Shift+Ctrl+Up
0x00030149,key.shift_ctrl_pgup ,\ ; Shift+Ctrl+PageUp
0x0003014B,key.shift_ctrl_left ,\ ; Shift+Ctrl+Left
0x0003014D,key.shift_ctrl_right ,\ ; Shift+Ctrl+Right
0x0003014F,key.shift_ctrl_end ,\ ; Shift+Ctrl+End
\;0x00030150,key.shift_ctrl_down ,\ ; Shift+Ctrl+Down
0x00030151,key.shift_ctrl_pgdn ,\ ; Shift+Ctrl+PageDown
0x0004002D,key.alt_x ,\ ; Alt+X
0
 
import libini, \
ini.get_str,'ini.get_str',\
ini.set_str,'ini.set_str',\
ini.get_int,'ini.get_int',\
ini.set_int,'ini.set_int'
accel_table_textbox dd \
\;0x00000001,key.tb.escape ,\ ; Escape
0x0000000E,key.tb.bkspace ,\ ; BackSpace
\;0x0000000F,key.tb.tab ,\ ; Tab
\;0x0000001C,key.tb.return ,\ ; Return
0x00000147,key.tb.home ,\ ; Home
0x0000014B,key.tb.left ,\ ; Left
0x0000014D,key.tb.right ,\ ; Right
0x0000014F,key.tb.end ,\ ; End
0x00000153,key.tb.del ,\ ; Delete
0x00010147,key.tb.shift_home ,\ ; Shift+Home
0x0001014B,key.tb.shift_left ,\ ; Shift+Left
0x0001014D,key.tb.shift_right ,\ ; Shift+Right
0x0001014F,key.tb.shift_end ,\ ; Shift+End
0x00010153,key.tb.del ,\ ; Shift+Del
0
 
import libio, \
file.find_first,'file.find_first',\
file.find_next ,'file.find_next',\
file.find_close,'file.find_close',\
file.size ,'file.size',\
file.open ,'file.open',\
file.read ,'file.read',\
file.write ,'file.write',\
file.seek ,'file.seek',\
file.tell ,'file.tell',\
file.eof? ,'file.eof?',\
file.truncate ,'file.truncate',\
file.close ,'file.close'
accel_table2 dd \
1 ,key.alt_x ,\
'VSL',btn.vscroll_up ,\
'VSG',btn.vscroll_down ,\
'HSL',btn.hscroll_up ,\
'HSG',btn.hscroll_down ,\
'TBL',btn.tabctl_right ,\
'TBG',btn.tabctl_left ,\
177 , key.ctrl_f4 ,\ ; close current tab button
0
 
import libgfx, \
gfx.open ,'gfx.open',\
gfx.close ,'gfx.close',\
gfx.pen.color ,'gfx.pen.color',\
gfx.brush.color ,'gfx.brush.color',\
gfx.pixel ,'gfx.pixel',\
gfx.move.to ,'gfx.move.to',\
gfx.line.to ,'gfx.line.to',\
gfx.line ,'gfx.line',\
gfx.polyline ,'gfx.polyline',\
gfx.polyline.to ,'gfx.polyline.to',\
gfx.fillrect ,'gfx.fillrect',\
gfx.fillrect.ex ,'gfx.fillrect.ex',\
gfx.framerect ,'gfx.framerect',\
gfx.framerect.ex,'gfx.framerect.ex',\
gfx.rectangle ,'gfx.rectangle',\
gfx.rectangle.ex,'gfx.rectangle.ex'
accel_table2_botdlg dd \
1 ,key.alt_x ,\
20001,btn.bot.cancel ,\
20002,btn.bot.opensave ,\
20003,btn.bot.find ,\
20004,btn.bot.appearance,\
20007, btn.bot.no ,\
21001,btn.bot.tabpos ,\
0
 
add_table:
times $1A db -$20
times $25 db -$00
times $10 db -$20
times $30 db -$00
times $10 db -$50
times $04 db -$00,-$01
times $08 db -$00
 
s_status dd 0
 
@^
fasm_start:
dd 7
dd 0
dd fasm_parameters
dd 0
dd 0
db '/sys/DEVELOP/FASM',0
board_start:
dd 7
dd 0
dd 0
dd 0
dd 0
db '/sys/DEVELOP/BOARD',0
tinypad_start:
dd 7
dd 0
dd ?
dd 0
dd 0
db '/sys/TINYPAD',0
docpak_start:
dd 7
dd 0
dd sysfuncs_param
dd 0
dd 0
db '/sys/DOCPAK',0
^@
 
sz app_fasm ,'/sys/DEVELOP/FASM',0
sz app_board ,'/sys/DEVELOP/BOARD',0
sz app_tinypad ,'/sys/TINYPAD',0
sz app_docpak ,'/sys/DOCPAK',0
 
sz sysfuncs_param,'g',0
 
include 'tp-locale.inc'
 
;// options dialog data [
label optsdlg_editor at $-EDITOR.Bounds
; rb PATHL ; FilePath db PATHL dup(?)
; dd 0 ; FileName dd ?
dd ?,?,?,? ; Bounds RECT
dd @f ; Lines dd ?
dd ? ; Lines.Size dd ?
dd 9 ; Lines.Count dd ?
dd 21 ; Columns.Count dd ?
dd 0,4 ; Caret POINT
dd 100,4 ; SelStart POINT
dd 0,0 ; TopLeft POINT
dd 0,0 ; VScroll SCROLLBAR
dd 0,0 ; HScroll SCROLLBAR
dd 0 ; Gutter.Width dd ?
db 0 ; Gutter.Visible db ?
db 1 ; AsmMode db ?
db 0 ; Modified db ?
 
@@:
dd 0x00000000+1
db ' '
dd 0x00010000+9
db ' org 100h'
dd 0x00000000+1
db ' '
dd 0x00000000+20
db ' mov ah,09h ; write'
dd 0x00000000+12
db ' mov dx,text'
dd 0x00000000+8
db ' int 21h'
dd 0x00030000+8
db ' int 20h'
dd 0x00000000+1
db ' '
dd 0x00000000+21
db ' text db "Hello!",24h'
dd 0
 
optsdlg_editor_parts: ; left,top,right,bottom,type
db 0, 12, 13, 29, 22
db 0, 12, 33, 47, 42
db 0, 12, 53, 29, 72
db 0, 12, 83, 53, 92
db 2, 12, 43, 77, 52
db 3, 4, 43,148, 52
db 4, 48, 33, 53, 42
db 4,108, 83,113, 92
db 5, 36, 13, 59, 22
db 5, 54, 33, 71, 42
db 5, 36, 53, 53, 72
db 5,114, 83,131, 92
db 6, 60, 83,107, 92
db 7, 84, 33,125, 42
db 8, 1, 13, 5, 22
db 9, 1, 63, 5, 72
db 1, 1, 1,148,105
db -1
;// ]
 
sz symbols_ex,';?.%"',"'"
sz symbols ,'#&*\:/<>|{}()[]=+-, '
 
sz ini_sec_window ,'Window',0
sz ini_window_top ,'Top',0
sz ini_window_left ,'Left',0
sz ini_window_right ,'Right',0
sz ini_window_bottom,'Bottom',0
 
TINYPAD_END: ; end of file
 
self_path rb PATHL
 
;-----------------------------------------------------------------------------
section @UDATA ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
;-----------------------------------------------------------------------------
 
include 'data/tp-udata.inc'
app_start:
dd ?,?
.params dd ?
dd ?,?
db ?
.filename dd ?
 
f_info.length dd ?
f_info.path:
times PATHL+1 db ?
f_info70 rd 7
 
file_info FILEINFO
 
checker_ed EDITOR
checker_ed_ll dd ?
 
tab_bar TABCTL
virtual at tab_bar.Current
cur_tab TABITEM
end virtual
virtual at tab_bar.Current.Editor
cur_editor EDITOR
end virtual
 
lines.scr dd ? ; number of lines on the screen
columns.scr dd ? ; number of columns on the screen
top_ofs dd ? ; height occupied by top buttons
bot_ofs dd ? ; height occupied by bottom buttons
dw ?
left_ofs dd ? ;
__rc dd ?,?,?,?
copy_count dd ? ; number of lines for copying (Ctrl+E)
copy_size dd ? ; size of data to copy
s_title.size dd ? ; caption length
 
cur_line_len dd ?
h_popup dd ?
bot_dlg_handler dd ?
 
sel.begin.x dd ?
sel.begin.y dd ?
sel.end.x dd ?
sel.end.y dd ?
sel.selected db ?
 
in_sel db ?
 
do_not_draw db ? ; draw top and bottom buttons?
main_closed db ? ; main window closed?
tb_casesen db ? ; focused textbox is case-sensitive?
 
draw_blines db ?
 
align 4
s_fname.size dd ?
s_fname rb PATHL+1
align 4
s_search.size dd ?
s_search rb PATHL+1
 
s_title rb PATHL+11 ; window caption
 
chr db ?
ext db ?
shi dd ?
 
align 4
cl_3d_normal dd ?
cl_3d_pushed dd ?
cl_3d_outset dd ?
cl_3d_inset dd ?
cl_3d_grayed dd ?
 
tb_color TBOX
tb_opensave TBOX
tb_find TBOX
tb_replace TBOX
tb_gotorow TBOX
tb_gotocol TBOX
 
focused_tb dd ?
 
key1 rb 256
 
mst db ?
mst2 db ?
mev db ?
mouse_captured db ?
just_from_popup db ?
 
bot_mode db ?
 
align 4
 
bot_dlg_height dd ?
bot_dlg_mode2 db ?
 
temp_buf dd ?
copy_buf dd ?
 
;-----------------------------------------------------------------------------
section @PARAMS ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
;-----------------------------------------------------------------------------
/programs/develop/tinypad/trunk/tp-dialog.asm
1,5 → 1,5
;-----------------------------------------------------------------------------
proc define_3d_button ;///////////////////////////////////////////////////////
func define_3d_button ;///////////////////////////////////////////////////////
;-----------------------------------------------------------------------------
; ebx = <x,width>
; ecx = <y,height>
26,7 → 26,7
mcall 4,,[sc.work_text],[esp+4*8+4*2],[esp+4*8+4*1]
popad
ret 4*3
endp
endf
 
finddlg_handler:
cmp al,1
641,7 → 641,7
 
movzx eax,[tb_replace.length]
add eax,10
stdcall mem.Alloc,eax
call mem.Alloc
mov [copy_buf],eax
 
movzx eax,[tb_replace.length]
661,7 → 661,8
call key.ctrl_v
pop [cur_editor.SelStart.X]
 
stdcall mem.Free,[copy_buf]
mov eax,[copy_buf]
call mem.Free
 
pop [copy_buf] [copy_count] [copy_size]
 
/programs/develop/tinypad/trunk/tp-draw.asm
1,5 → 1,5
;-----------------------------------------------------------------------------
proc drawwindow ;///// DRAW WINDOW ///////////////////////////////////////////
func drawwindow ;///// DRAW WINDOW ///////////////////////////////////////////
;-----------------------------------------------------------------------------
 
cmp [just_from_popup],1
10,11 → 10,9
mcall 48,3,sc,sizeof.system_colors
call calc_3d_colors
 
;mcall 12,1
invoke gfx.open,TRUE
mov [ctx],eax
mcall 12,1
 
;m2m [sc.work],dword[color_tbl.back]
m2m [sc.work],dword[color_tbl.back]
 
mov edx,[sc.work]
add edx,0x73000000
112,39 → 110,29
call draw_editor
call draw_tabctl
.exit.2:
;mcall 12,2
invoke gfx.close,[ctx]
mcall 12,2
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc draw_bottom_dialog ;/////////////////////////////////////////////////////
func draw_bottom_dialog ;/////////////////////////////////////////////////////
;-----------------------------------------------------------------------------
cmp [bot_dlg_height],0
je .exit
pushad
invoke gfx.pen.color,[ctx],[cl_3d_inset]
mov ebx,[p_info.client_box.width]
mov ecx,[bot_ofs]
dec ecx
invoke gfx.line,[ctx],0,ecx,[p_info.client_box.width],ecx
invoke gfx.brush.color,[ctx],[cl_3d_normal]
inc ecx
mov eax,ecx
add eax,[bot_dlg_height]
invoke gfx.fillrect,[ctx],0,ecx,[p_info.client_box.width],eax
;mov ebx,[p_info.client_box.width]
;mov ecx,[bot_ofs]
;dec ecx
;push cx
;shl ecx,16
;pop cx
;mcall 38,,,[cl_3d_inset]
;mov ecx,[bot_ofs-2]
;mov cx,word[bot_dlg_height]
;dec ecx
;mov ebx,[p_info.client_box.width]
;inc ebx
;mcall 13,,,[cl_3d_normal]
push cx
shl ecx,16
pop cx
mcall 38,,,[cl_3d_inset]
mov ecx,[bot_ofs-2]
mov cx,word[bot_dlg_height]
dec ecx
mov ebx,[p_info.client_box.width]
inc ebx
mcall 13,,,[cl_3d_normal]
mov al,1
call [bot_dlg_handler]
popad
151,13 → 139,13
 
.exit:
ret
endp
endf
 
mi_sel dd ?
mi_cur dd -1
 
;-----------------------------------------------------------------------------
proc draw_main_menu ;/////////////////////////////////////////////////////////
func draw_main_menu ;/////////////////////////////////////////////////////////
;-----------------------------------------------------------------------------
mov ebx,[p_info.client_box.width]
inc ebx
233,10 → 221,10
 
cross:
db 'X'
endp
endf
 
;-----------------------------------------------------------------------------
proc draw_statusbar ;///// DRAW POSITION, MODIFIED STATE, HINT ///////////////
func draw_statusbar ;///// DRAW POSITION, MODIFIED STATE, HINT ///////////////
;-----------------------------------------------------------------------------
cmp [do_not_draw],1 ; return if drawing is not permitted
jae .exit
310,9 → 298,9
 
.exit:
ret
endp
endf
 
proc draw_fillrect ; ebx,ecx,edx
func draw_fillrect ; ebx,ecx,edx
; ebx = <left,width>
; ecx = <top,height>
push ebx ecx edx
322,9 → 310,9
mcall 13,,,esi
pop edx ecx ebx
ret
endp
endf
 
proc draw_framerect ; ebx,ecx,edx
func draw_framerect ; ebx,ecx,edx
; ebx = <left,width>
; ecx = <top,height>
push ebx ecx
353,9 → 341,9
 
pop ecx ebx
ret
endp
endf
 
proc draw_check
func draw_check
push bx
shl ebx,16
pop bx
373,9 → 361,9
sub ecx,0x00010001
mcall
ret
endp
endf
 
proc calc_middle
func calc_middle
shr eax,1
shr ebx,1
and eax,0x007F7F7F
382,9 → 370,9
and ebx,0x007F7F7F
add eax,ebx
ret
endp
endf
 
proc calc_3d_colors
func calc_3d_colors
pushad
m2m [cl_3d_normal],[sc.work]
m2m [cl_3d_inset],[sc.work_graph]
411,9 → 399,9
mov [cl_3d_grayed],eax
popad
ret
endp
endf
 
proc draw_3d_panel ; x,y,w,h
func draw_3d_panel ; x,y,w,h
push eax ebx ecx edx
cmp dword[esp+16+8],4
jl .exit
459,4 → 447,4
.exit:
pop edx ecx ebx eax
ret 4*4
endp
endf
/programs/develop/tinypad/trunk/tp-key.asm
109,7 → 109,7
jmp key.tab.direct
 
;-----------------------------------------------------------------------------
proc key.ctrl_a ;///// SELECT ALL DOCUMENT ///////////////////////////////////
func key.ctrl_a ;///// SELECT ALL DOCUMENT ///////////////////////////////////
;-----------------------------------------------------------------------------
xor eax,eax
mov [cur_editor.SelStart.X],eax
122,10 → 122,10
mov [cur_editor.Caret.X],eax
call draw_editor
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc key.ctrl_o ;///// ENTER OPEN FILENAME ///////////////////////////////////
func key.ctrl_o ;///// ENTER OPEN FILENAME ///////////////////////////////////
;-----------------------------------------------------------------------------
mov [bot_dlg_mode2],0
 
149,10 → 149,10
mov [tb_casesen],0;1
call drawwindow
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc key.ctrl_s ;///// ENTER SAVE FILENAME ///////////////////////////////////
func key.ctrl_s ;///// ENTER SAVE FILENAME ///////////////////////////////////
;-----------------------------------------------------------------------------
cmp [cur_editor.FilePath], 0
je key.shift_ctrl_s
166,17 → 166,17
key.shift_ctrl_s:
mov [bot_dlg_mode2],1
jmp key.ctrl_o.direct
endp
endf
 
;-----------------------------------------------------------------------------
proc key.ctrl_n ;///// CREATE NEW FILE (TAB) /////////////////////////////////
func key.ctrl_n ;///// CREATE NEW FILE (TAB) /////////////////////////////////
;-----------------------------------------------------------------------------
call create_tab
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc key.ctrl_f ;///// ENTER KEYWORD TO FIND /////////////////////////////////
func key.ctrl_f ;///// ENTER KEYWORD TO FIND /////////////////////////////////
;-----------------------------------------------------------------------------
mov [bot_dlg_mode2],0
mov [bot_dlg_height],16*2+4*2-1
202,9 → 202,9
mov [tb_casesen],0
call drawwindow
ret
endp
endf
 
proc key.ctrl_h
func key.ctrl_h
mov [bot_dlg_mode2],1
mov [bot_dlg_height],16*3+4*2+1
 
211,9 → 211,9
mov [s_status],s_enter_text_to_replace
 
jmp key.ctrl_f.direct
endp
endf
 
proc key.ctrl_g
func key.ctrl_g
ret
@^
mov [bot_dlg_mode2],0
230,10 → 230,10
call drawwindow
ret
^@
endp
endf
 
;-----------------------------------------------------------------------------
proc key.ctrl_left ;///// GO TO PREVIOUS WORD ////////////////////////////////
func key.ctrl_left ;///// GO TO PREVIOUS WORD ////////////////////////////////
;-----------------------------------------------------------------------------
call clear_selection
 
323,10 → 323,10
call editor_check_for_changes
.exit.2:
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc key.ctrl_right ;///// GO TO NEXT WORD ///////////////////////////////////
func key.ctrl_right ;///// GO TO NEXT WORD ///////////////////////////////////
;-----------------------------------------------------------------------------
call clear_selection
 
412,10 → 412,10
call editor_check_for_changes
.exit.2:
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc key.ctrl_x
func key.ctrl_x
cmp [sel.selected],0
je @f
call key.ctrl_c
422,16 → 422,18
call key.del
mov [cur_editor.Modified],1
@@: ret
endp
endf
 
;-----------------------------------------------------------------------------
proc key.ctrl_c
func key.ctrl_c
mov [copy_size],0
cmp [sel.selected],0
je .exit
 
call get_selection_size
stdcall mem.ReAlloc,[copy_buf],eax
mov ebx,eax
mov eax,[copy_buf]
call mem.ReAlloc
mov [copy_buf],eax
 
cld
516,10 → 518,10
jecxz @b
rep stosb
jmp @b
endp
endf
 
;-----------------------------------------------------------------------------
proc key.ctrl_v
func key.ctrl_v
cmp [copy_size],0
je .exit
 
528,10 → 530,11
mov eax,[copy_size]
call editor_realloc_lines
 
mov eax,[cur_editor.Lines]
mov ebx,[cur_editor.Lines.Size]
add ebx,[copy_size]
mov [cur_editor.Lines.Size],ebx
stdcall mem.ReAlloc,[cur_editor.Lines],ebx
call mem.ReAlloc
mov [cur_editor.Lines],eax
 
mov ecx,[cur_editor.Caret.Y]
632,10 → 635,10
mov [cur_editor.Columns.Count],eax
@@: pop eax
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc key.ctrl_d ;///// INSERT SEPARATOR //////////////////////////////////////
func key.ctrl_d ;///// INSERT SEPARATOR //////////////////////////////////////
;-----------------------------------------------------------------------------
mov eax,94
call editor_realloc_lines
671,10 → 674,10
 
.exit:
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc key.ctrl_y ;///// DELETE CURRENT LINE ///////////////////////////////////
func key.ctrl_y ;///// DELETE CURRENT LINE ///////////////////////////////////
;-----------------------------------------------------------------------------
mov eax,[cur_editor.Caret.Y]
inc eax
709,10 → 712,10
 
.exit:
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc key.up ;///// GO TO PREVIOUS LINE ///////////////////////////////////////
func key.up ;///// GO TO PREVIOUS LINE ///////////////////////////////////////
;-----------------------------------------------------------------------------
call clear_selection
 
737,10 → 740,10
 
.exit:
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc key.down ;///// GO TO NEXT LINE /////////////////////////////////////////
func key.down ;///// GO TO NEXT LINE /////////////////////////////////////////
;-----------------------------------------------------------------------------
call clear_selection
 
767,10 → 770,10
 
.exit:
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc key.left ;///// GO TO PREVIOUS CHAR /////////////////////////////////////
func key.left ;///// GO TO PREVIOUS CHAR /////////////////////////////////////
;-----------------------------------------------------------------------------
call clear_selection
 
788,10 → 791,10
 
.exit:
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc key.right ;///// GO TO NEXT CHAR ////////////////////////////////////////
func key.right ;///// GO TO NEXT CHAR ////////////////////////////////////////
;-----------------------------------------------------------------------------
call clear_selection
 
810,10 → 813,10
 
.exit:
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc key.pgup ;///// GO TO PREVIOUS PAGE /////////////////////////////////////
func key.pgup ;///// GO TO PREVIOUS PAGE /////////////////////////////////////
;-----------------------------------------------------------------------------
call clear_selection
 
838,10 → 841,10
 
.exit:
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc key.pgdn ;///// GO TO NEXT PAGE /////////////////////////////////////////
func key.pgdn ;///// GO TO NEXT PAGE /////////////////////////////////////////
;-----------------------------------------------------------------------------
call clear_selection
 
866,10 → 869,10
 
.exit:
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc key.home ;///// GO TO LINE START ////////////////////////////////////////
func key.home ;///// GO TO LINE START ////////////////////////////////////////
;-----------------------------------------------------------------------------
call clear_selection
 
884,10 → 887,10
 
.exit:
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc key.end ;///// GO TO LINE END ///////////////////////////////////////////
func key.end ;///// GO TO LINE END ///////////////////////////////////////////
;-----------------------------------------------------------------------------
call clear_selection
 
905,10 → 908,10
 
.exit:
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc key.ctrl_home ;///// GO TO PAGE START ///////////////////////////////////
func key.ctrl_home ;///// GO TO PAGE START ///////////////////////////////////
;-----------------------------------------------------------------------------
call clear_selection
 
925,10 → 928,10
 
.exit:
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc key.ctrl_end ;///// GO TO PAGE END //////////////////////////////////////
func key.ctrl_end ;///// GO TO PAGE END //////////////////////////////////////
;-----------------------------------------------------------------------------
call clear_selection
 
950,10 → 953,10
 
.exit:
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc key.ctrl_pgup ;///// GO TO DOCUMENT START ///////////////////////////////
func key.ctrl_pgup ;///// GO TO DOCUMENT START ///////////////////////////////
;-----------------------------------------------------------------------------
call clear_selection
 
970,10 → 973,10
 
.exit:
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc key.ctrl_pgdn ;///// GO TO DOCUMENT END /////////////////////////////////
func key.ctrl_pgdn ;///// GO TO DOCUMENT END /////////////////////////////////
;-----------------------------------------------------------------------------
call clear_selection
 
994,10 → 997,10
 
.exit:
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc key.del ;///// DELETE NEXT CHAR OR SELECTION ////////////////////////////
func key.del ;///// DELETE NEXT CHAR OR SELECTION ////////////////////////////
;-----------------------------------------------------------------------------
call delete_selection
jnc .exit
1136,11 → 1139,11
 
.exit:
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc key.ins ;///// TOGGLE INSERT/OVERWRITE MODE /////////////////////////////
;-----------------------------------------------------------------------------
key.ins:
;// ... toggle insert/overwrite mode here ...
xor [ins_mode],1
mov eax,[cur_editor.Caret.Y]
mov ebx,eax
1147,10 → 1150,9
call draw_editor_text.part
call draw_editor_caret
ret
endp
 
;-----------------------------------------------------------------------------
proc key.bkspace ;///// DELETE PREVIOUS CHAR OR SELECTION ////////////////////
func key.bkspace ;///// DELETE PREVIOUS CHAR OR SELECTION ////////////////////
;-----------------------------------------------------------------------------
call delete_selection
jnc key.del.exit
1210,10 → 1212,10
dec [cur_editor.Caret.Y]
cld
jmp key.del.line_up
endp
endf
 
;-----------------------------------------------------------------------------
proc key.tab ;///// TABULATE /////////////////////////////////////////////////
func key.tab ;///// TABULATE /////////////////////////////////////////////////
;-----------------------------------------------------------------------------
call delete_selection
mov eax,[cur_editor.Caret.X]
1295,10 → 1297,10
 
.exit:
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc key.return ;///// CARRIAGE RETURN ///////////////////////////////////////
func key.return ;///// CARRIAGE RETURN ///////////////////////////////////////
;-----------------------------------------------------------------------------
call delete_selection
 
1430,10 → 1432,10
 
.exit:
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc key.ctrl_tab ;///// SWITCH TO NEXT TAB //////////////////////////////////
func key.ctrl_tab ;///// SWITCH TO NEXT TAB //////////////////////////////////
;-----------------------------------------------------------------------------
cmp [tab_bar.Items.Count],1
je .exit
1457,10 → 1459,10
call update_caption
.exit:
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc key.shift_ctrl_tab ;///// SWITCH TO PREVIOUS TAB ////////////////////////
func key.shift_ctrl_tab ;///// SWITCH TO PREVIOUS TAB ////////////////////////
;-----------------------------------------------------------------------------
cmp [tab_bar.Items.Count],1
je .exit
1485,10 → 1487,10
call update_caption
.exit:
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc key.ctrl_f4 ;///// CLOSE CURRENT TAB ////////////////////////////////////
func key.ctrl_f4 ;///// CLOSE CURRENT TAB ////////////////////////////////////
;-----------------------------------------------------------------------------
cmp [cur_editor.Modified], 0
je .close
1509,10 → 1511,10
call draw_tabctl
call draw_statusbar
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc key.shift_f9 ;///// SET DEFAULT TAB /////////////////////////////////////
func key.shift_f9 ;///// SET DEFAULT TAB /////////////////////////////////////
;-----------------------------------------------------------------------------
mov eax,[tab_bar.Current.Ptr]
cmp eax,[tab_bar.Default.Ptr]
1527,34 → 1529,34
call draw_editor
@@: call draw_tabctl
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc key.f3 ;///// FIND NEXT MATCH ///////////////////////////////////////////
func key.f3 ;///// FIND NEXT MATCH ///////////////////////////////////////////
;-----------------------------------------------------------------------------
call search
jc @f
@@: ret
endp
endf
 
;-----------------------------------------------------------------------------
proc key.f9 ;///// COMPILE AND RUN ///////////////////////////////////////////
func key.f9 ;///// COMPILE AND RUN ///////////////////////////////////////////
;-----------------------------------------------------------------------------
mov bl,1
call start_fasm
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc key.ctrl_f9 ;///// COMPILE //////////////////////////////////////////////
func key.ctrl_f9 ;///// COMPILE //////////////////////////////////////////////
;-----------------------------------------------------------------------------
mov bl,0
call start_fasm
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc key.alt_x ;///// EXIT PROGRAM ///////////////////////////////////////////
func key.alt_x ;///// EXIT PROGRAM ///////////////////////////////////////////
;-----------------------------------------------------------------------------
mov esi,self_path
mov byte[esi+PATHL-1],0
1581,4 → 1583,4
jne .bgn_rp
mov [main_closed],1
mcall -1
endp
endf
/programs/develop/tinypad/trunk/tp-tabctl.asm
1,5 → 1,5
;-----------------------------------------------------------------------------
proc flush_cur_tab ;///// SAVE CURRENT TAB DATA TO CONTROL ///////////////////
func flush_cur_tab ;///// SAVE CURRENT TAB DATA TO CONTROL ///////////////////
;-----------------------------------------------------------------------------
; EBP = TABITEM*
;-----------------------------------------------------------------------------
11,10 → 11,10
rep movsd
pop edi esi ecx
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc set_cur_tab ;///// SET SPECIFIED TAB CURRENT (FOCUS IT) /////////////////
func set_cur_tab ;///// SET SPECIFIED TAB CURRENT (FOCUS IT) /////////////////
;-----------------------------------------------------------------------------
; EBP = TABITEM*
;-----------------------------------------------------------------------------
30,10 → 30,10
; call update_caption
pop edi esi ecx
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc make_tab_visible ;///// MAKE SPECIFIED TAB VISIBLE IF IT'S OFFSCREEN ////
func make_tab_visible ;///// MAKE SPECIFIED TAB VISIBLE IF IT'S OFFSCREEN ////
;-----------------------------------------------------------------------------
call flush_cur_tab
imul eax,[tab_bar.Items.Left],sizeof.TABITEM
64,10 → 64,10
div ebx
@@: mov [tab_bar.Items.Left],eax
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc create_tab ;///// ADD TAB TO THE END ////////////////////////////////////
func create_tab ;///// ADD TAB TO THE END ////////////////////////////////////
;-----------------------------------------------------------------------------
push eax ecx esi edi
 
75,7 → 75,7
imul ebx,[tab_bar.Items.Count],sizeof.TABITEM
mov eax,[tab_bar.Items]
mov ecx,eax
stdcall mem.ReAlloc,eax,ebx
call mem.ReAlloc
mov [tab_bar.Items],eax
sub ecx,eax
sub [tab_bar.Current.Ptr],ecx
87,7 → 87,7
 
mov eax,1024
mov [cur_editor.Lines.Size],eax
stdcall mem.Alloc,eax
call mem.Alloc
mov [cur_editor.Lines],eax
mov [cur_editor.Lines.Count],1
mov [cur_editor.Columns.Count],1
131,10 → 131,10
mov ebp,cur_tab
pop edi esi ecx eax
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc delete_tab ;///// DELETE SPECIFIED TAB //////////////////////////////////
func delete_tab ;///// DELETE SPECIFIED TAB //////////////////////////////////
;-----------------------------------------------------------------------------
cmp [tab_bar.Default.Ptr],0
je @f
146,7 → 146,8
.lp1:
mov [tab_bar.Default.Ptr],0
 
@@: stdcall mem.Free,[ebp+TABITEM.Editor.Lines]
@@: mov eax,[ebp+TABITEM.Editor.Lines]
call mem.Free
imul ecx,[tab_bar.Items.Count],sizeof.TABITEM
add ecx,[tab_bar.Items]
sub ecx,ebp
163,7 → 164,7
push ebx
mov eax,[tab_bar.Items]
mov ecx,eax
stdcall mem.ReAlloc,eax,ebx
call mem.ReAlloc
mov [tab_bar.Items],eax
sub ecx,eax
sub ebp,ecx
187,16 → 188,17
ret
 
.no_tabs:
stdcall mem.Free,[tab_bar.Items]
mov eax,[tab_bar.Items]
call mem.Free
xor eax,eax
mov [tab_bar.Items],eax
mov [tab_bar.Current.Ptr],eax
mov [tab_bar.Default.Ptr],eax
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc draw_tabctl ;///// DRAW TAB CONTROL /////////////////////////////////////
func draw_tabctl ;///// DRAW TAB CONTROL /////////////////////////////////////
;-----------------------------------------------------------------------------
 
dec [tab_bar.Items.Left]
372,7 → 374,7
call dword[esp+(8+4)+8+8]
mcall 13,,,[sc.work]
pop ecx ebx
mov edx,[sc.work_text];[color_tbl.text]
mov edx,[color_tbl.text]
.draw_tabs.inactive:
 
cmp ebp,[tab_bar.Default.Ptr]
560,10 → 562,10
movzx ecx,cx
lea edi,[edi+ecx+1]
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc get_tab_size ;///// GET TAB WIDTH ///////////////////////////////////////
func get_tab_size ;///// GET TAB WIDTH ///////////////////////////////////////
;-----------------------------------------------------------------------------
; EBP = TABITEM*
;-----------------------------------------------------------------------------
584,10 → 586,10
.lp2: mov ecx,TBARH-1
pop eax
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc get_max_tab_width ;///// GET WIDTH OF LONGEST TAB ///////////////////////
func get_max_tab_width ;///// GET WIDTH OF LONGEST TAB ///////////////////////
;-----------------------------------------------------------------------------
push ebx ecx ebp
mov ecx,[tab_bar.Items.Count]
616,10 → 618,10
add eax,13
@@: pop ebp ecx ebx
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc get_hidden_tabitems_number ;/////////////////////////////////////////////
func get_hidden_tabitems_number ;/////////////////////////////////////////////
;-----------------------------------------------------------------------------
mov al,[tab_bar.Style]
dec al
674,10 → 676,10
@@: pop ecx
mov eax,ecx
ret 8
endp
endf
 
;-----------------------------------------------------------------------------
proc align_editor_in_tab ;///// ADJUST EDITOR POSITION TO FIT IN TAB /////////
func align_editor_in_tab ;///// ADJUST EDITOR POSITION TO FIT IN TAB /////////
;-----------------------------------------------------------------------------
m2m [cur_editor.Bounds.Left],[tab_bar.Bounds.Left]
m2m [cur_editor.Bounds.Top],[tab_bar.Bounds.Top]
718,4 → 720,4
.tabs_on_right:
sub [cur_editor.Bounds.Right],ebx
ret
endp
endf
/programs/develop/tinypad/trunk/tp-files.asm
1,5 → 1,5
;-----------------------------------------------------------------------------
proc save_file ;//////////////////////////////////////////////////////////////
func save_file ;//////////////////////////////////////////////////////////////
;-----------------------------------------------------------------------------
mov esi,tb_opensave.text
mov edi,f_info.path
21,7 → 21,7
mov eax,[cur_editor.Lines.Count]
shl eax,1
lea eax,[eax+ebx+1024]
stdcall mem.Alloc,eax
call mem.Alloc
push eax
mov esi,[cur_editor.Lines]
mov edi,eax
55,10 → 55,10
.exit.2:
stc
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc save_string ;////////////////////////////////////////////////////////////
func save_string ;////////////////////////////////////////////////////////////
;-----------------------------------------------------------------------------
movzx ecx,word[esi]
test dword[esi],0x00010000
126,9 → 126,9
movzx eax,word[esi-4]
add esi,eax;[esi-4]
ret
endp
endf
 
proc set_status_fs_error
func set_status_fs_error
push eax
mov esi,s_fs_error
@@: dec eax
141,10 → 141,10
pop eax
call draw_statusbar
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc load_file ;//////////////////////////////////////////////////////////////
func load_file ;//////////////////////////////////////////////////////////////
;-----------------------------------------------------------------------------
cmp [tb_opensave.length],0
jne @f
171,7 → 171,7
mov [f_info70+0],0
mov eax,dword[file_info.Size]
mov [f_info70+12],eax
stdcall mem.Alloc,eax
call mem.Alloc
mov [f_info70+16],eax
mcall 70,f_info70
 
185,7 → 185,8
cmp ebx,6 ;// ATV driver fix (6 instead of 5)
je .file_found
 
stdcall mem.Free,[f_info70+16]
mov eax,[f_info70+16]
call mem.Free
stc
ret
 
220,7 → 221,8
call flush_cur_tab
pop edi esi ecx
call load_from_memory
stdcall mem.Free,[f_info70+16]
mov eax,[f_info70+16]
call mem.Free
 
xor eax,eax
mov [cur_editor.TopLeft.Y],eax
249,10 → 251,10
 
clc
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc load_from_memory ;///////////////////////////////////////////////////////
func load_from_memory ;///////////////////////////////////////////////////////
;-----------------------------------------------------------------------------
; ECX = data length
; ESI = data pointer
263,8 → 265,9
lea edx,[ebx+ecx]
imul ebx,eax,14
add ebx,edx
mov eax,[ebp+EDITOR.Lines]
mov [ebp+EDITOR.Lines.Size],ebx
stdcall mem.ReAlloc,[ebp+EDITOR.Lines],ebx
call mem.ReAlloc
mov [ebp+EDITOR.Lines],eax
 
mov [ebp+EDITOR.Columns.Count],0
332,4 → 335,4
mov al,' '
rep stosb
jmp .next_char
endp
endf
/programs/develop/tinypad/trunk/tp-defines.inc
0,0 → 1,38
 
define mm.File.New key.ctrl_n
define mm.File.Open key.ctrl_o
define mm.File.Save key.ctrl_s
define mm.File.SaveAs key.shift_ctrl_s
define mm.File.Close key.ctrl_f4
define mm.File.Exit key.alt_x
 
define mm.Edit.Cut key.ctrl_x
define mm.Edit.Copy key.ctrl_c
define mm.Edit.Insert key.ctrl_v
define mm.Edit.Delete key.del
define mm.Edit.SelAll key.ctrl_a
 
define mm.Search.Position key.ctrl_g
define mm.Search.Find key.ctrl_f
define mm.Search.FindNext key.f3
define mm.Search.Replace key.ctrl_h
 
define mm.Run.Run key.f9
define mm.Run.Compile key.ctrl_f9
define mm.Run.DbgBoard open_debug_board
define mm.Run.SysFuncs open_sysfuncs_txt
 
define mm.Encoding.CP866.CP1251 recode.866.1251
define mm.Encoding.CP1251.CP866 recode.1251.866
define mm.Encoding.CP866.KOI8R recode.866.koi
define mm.Encoding.KOI8R.CP866 recode.koi.866
define mm.Encoding.CP1251.KOI8R recode.1251.koi
define mm.Encoding.KOI8R.CP1251 recode.koi.1251
 
define mm.Options.Appearance set_opt.dialog
define mm.Options.SecureSel set_opt.secure_sel
define mm.Options.AutoBrackets set_opt.auto_braces
define mm.Options.AutoIndents set_opt.auto_indents
define mm.Options.SmartTabs 0
define mm.Options.OptimalFill set_opt.optimal_fill
define mm.Options.LineNumbers set_opt.line_numbers
/programs/develop/tinypad/trunk/tp-common.asm
1,5 → 1,5
;-----------------------------------------------------------------------------
proc clear_selection ;////////////////////////////////////////////////////////
func clear_selection ;////////////////////////////////////////////////////////
;-----------------------------------------------------------------------------
push eax ebx
mov eax,[cur_editor.SelStart.Y]
11,10 → 11,10
pop [cur_editor.SelStart.Y] [cur_editor.SelStart.X]
pop ebx eax
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc pt_in_rect ;/////////////////////////////////////////////////////////////
func pt_in_rect ;/////////////////////////////////////////////////////////////
;-----------------------------------------------------------------------------
cmp eax,[ecx+0x0]
jl @f
28,18 → 28,14
ret
@@: clc
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc check_bottom_right ;/////////////////////////////////////////////////////
func check_bottom_right ;/////////////////////////////////////////////////////
;-----------------------------------------------------------------------------
push eax
mov eax,[cur_editor.TopLeft.Y]
or eax,eax
jns @f
xor eax,eax
mov [cur_editor.TopLeft.Y],eax
@@: add eax,[lines.scr]
add eax,[lines.scr]
cmp eax,[cur_editor.Lines.Count]
jbe .lp1
mov eax,[cur_editor.Lines.Count]
48,11 → 44,7
xor eax,eax
@@: mov [cur_editor.TopLeft.Y],eax
.lp1: mov eax,[cur_editor.TopLeft.X]
or eax,eax
jns @f
xor eax,eax
mov [cur_editor.TopLeft.X],eax
@@: add eax,[columns.scr]
add eax,[columns.scr]
cmp eax,[cur_editor.Columns.Count]
jbe .exit
mov eax,[cur_editor.Columns.Count]
63,10 → 55,10
.exit:
pop eax
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc get_real_length ;////////////////////////////////////////////////////////
func get_real_length ;////////////////////////////////////////////////////////
;-----------------------------------------------------------------------------
movzx eax,word[esi]
@@: cmp byte[esi+eax+4-1],' '
74,10 → 66,10
dec eax
jnz @b
@@: ret
endp
endf
 
;-----------------------------------------------------------------------------
proc get_line_offset ;////////////////////////////////////////////////////////
func get_line_offset ;////////////////////////////////////////////////////////
;-----------------------------------------------------------------------------
; Input:
; ECX = line number
94,10 → 86,10
.exit:
pop ecx eax
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc init_sel_vars ;//////////////////////////////////////////////////////////
func init_sel_vars ;//////////////////////////////////////////////////////////
;-----------------------------------------------------------------------------
pushad
mov [sel.selected],1
121,10 → 113,10
mov [sel.end.y],edx
popad
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc get_scroll_vars ;////////////////////////////////////////////////////////
func get_scroll_vars ;////////////////////////////////////////////////////////
;-----------------------------------------------------------------------------
; Input:
; EAX = maximum data size (units)
167,10 → 159,10
mov dword[esp+4],0
mov dword[esp+8],0
jmp @b
endp
endf
 
;-----------------------------------------------------------------------------
proc uint2strz ;//////////////////////////////////////////////////////////////
func uint2strz ;//////////////////////////////////////////////////////////////
;-----------------------------------------------------------------------------
dec ebx
jz @f
184,10 → 176,10
das
stosb
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc uint2str ;///////////////////////////////////////////////////////////////
func uint2str ;///////////////////////////////////////////////////////////////
;-----------------------------------------------------------------------------
cmp eax,ecx
jb @f
201,10 → 193,10
das
stosb
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc strlen ;/////////////////////////////////////////////////////////////////
func strlen ;/////////////////////////////////////////////////////////////////
;-----------------------------------------------------------------------------
push ebx
mov ebx,eax
215,10 → 207,10
jmp @b
@@: pop ebx
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc rgb_to_gray ;////////////////////////////////////////////////////////////
func rgb_to_gray ;////////////////////////////////////////////////////////////
;-----------------------------------------------------------------------------
push 0 eax
and dword[esp],0x000000FF
243,7 → 235,7
pop eax
add esp,4
ret
endp
endf
 
;float_gray_r dd 0.30f
;float_gray_g dd 0.59f
250,7 → 242,7
;float_gray_b dd 0.11f
 
;-----------------------------------------------------------------------------
proc get_active_menu_item ;///////////////////////////////////////////////////
func get_active_menu_item ;///////////////////////////////////////////////////
;-----------------------------------------------------------------------------
pushad
mov [mi_cur],0
284,10 → 276,10
or [mi_cur],-1
@@: popad
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc get_active_popup_item ;//////////////////////////////////////////////////
func get_active_popup_item ;//////////////////////////////////////////////////
;-----------------------------------------------------------------------------
pushad
mov [pi_cur],0
304,9 → 296,9
call pt_in_rect
jnc .outside_window
inc dword[ecx+0x0]
mov dword[ecx+0x4],2
mov dword[ecx+0x4],3
dec dword[ecx+0x8]
mov dword[ecx+0xC],2+POP_IHEIGHT-1
mov dword[ecx+0xC],3+POP_IHEIGHT-1
mov edx,[ebp+POPUP.data]
@@: inc [pi_cur]
inc edx
314,12 → 306,12
cmp byte[edx],'-'
jne .lp1
pushd [ecx+0xC]
sub dword[ecx+0xC],POP_IHEIGHT-POP_SHEIGHT
sub dword[ecx+0xC],POP_IHEIGHT-4
call pt_in_rect
popd [ecx+0xC]
jc .separator
add dword[ecx+0x4],POP_SHEIGHT
add dword[ecx+0xC],POP_SHEIGHT
add dword[ecx+0x4],4
add dword[ecx+0xC],4
jmp .lp3
.lp1: call pt_in_rect
jnc .lp2
343,10 → 335,10
.outside_window:
or [pi_cur],-1
jmp .exit
endp
endf
 
;-----------------------------------------------------------------------------
proc line_add_spaces ;////////////////////////////////////////////////////////
func line_add_spaces ;////////////////////////////////////////////////////////
;-----------------------------------------------------------------------------
; Input:
; ESI = line offset
386,10 → 378,10
.exit:
popad
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc delete_selection ;///////////////////////////////////////////////////////
func delete_selection ;///////////////////////////////////////////////////////
;-----------------------------------------------------------------------------
; call init_sel_vars
 
478,10 → 470,10
.exit.2:
stc
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc get_selection_size ;/////////////////////////////////////////////////////
func get_selection_size ;/////////////////////////////////////////////////////
;-----------------------------------------------------------------------------
push ecx esi
mov ecx,[sel.end.y]
493,10 → 485,10
sub eax,esi
pop esi ecx
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc get_lines_in_file ;//////////////////////////////////////////////////////
func get_lines_in_file ;//////////////////////////////////////////////////////
;-----------------------------------------------------------------------------
; Input:
; ESI = data pointer
536,10 → 528,10
sub [esp],edx
xor edx,edx
jmp .lp1
endp
endf
 
;-----------------------------------------------------------------------------
proc update_caption ;/////////////////////////////////////////////////////////
func update_caption ;/////////////////////////////////////////////////////////
;-----------------------------------------------------------------------------
lea esi,[cur_editor.FilePath]
mov edi,s_title
580,13 → 572,12
add esp,4
clc
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc mem.Alloc,size ;/////////////////////////////////////////////////////////
func mem.Alloc ;//////////////////////////////////////////////////////////////
;-----------------------------------------------------------------------------
push ebx ecx
mov eax,[size]
lea ecx,[eax+4+4095]
and ecx,not 4095
mcall 68,12
595,20 → 586,12
add eax,4
pop ecx ebx
ret
@^
push ebx ecx
mcall 68,12,[size]
pop ecx ebx
ret
^@
endp
endf
 
;-----------------------------------------------------------------------------
proc mem.ReAlloc,mptr,size ;//////////////////////////////////////////////////
func mem.ReAlloc ;////////////////////////////////////////////////////////////
;-----------------------------------------------------------------------------
push ebx ecx esi edi eax
mov eax,[mptr]
mov ebx,[size]
or eax,eax
jz @f
lea ecx,[ebx+4+4095]
616,7 → 599,8
add ecx,-4
cmp ecx,[eax-4]
je .exit
@@: stdcall mem.Alloc,ebx
@@: mov eax,ebx
call mem.Alloc
xchg eax,[esp]
or eax,eax
jz .exit
632,31 → 616,18
cld
rep movsd
xchg eax,[esp]
stdcall mem.Free,eax
call mem.Free
.exit:
pop eax edi esi ecx ebx
ret
@^
push ebx ecx edx
mcall 68,20,[size],[mptr]
pop edx ecx ebx
ret
^@
endp
endf
 
;-----------------------------------------------------------------------------
proc mem.Free,mptr ;//////////////////////////////////////////////////////////
func mem.Free ;///////////////////////////////////////////////////////////////
;-----------------------------------------------------------------------------
push ebx ecx
mov eax,[mptr]
lea ecx,[eax-4]
mcall 68,13
pop ecx ebx
ret
@^
push ebx ecx
mcall 68,13,[mptr]
pop ecx ebx
ret
^@
endp
endf
/programs/develop/tinypad/trunk/tp-button.asm
101,7 → 101,7
call open_sysfuncs_txt
ret
 
proc search
func search
cld
mov ecx,[cur_editor.Caret.Y]
mov edx,ecx
179,4 → 179,4
mov [s_status],s_text_not_found
stc
ret
endp
endf
/programs/develop/tinypad/trunk/tp-editor.asm
1,6 → 1,6
 
;-----------------------------------------------------------------------------
proc draw_editor ;///// DRAW EDITOR //////////////////////////////////////////
func draw_editor ;///// DRAW EDITOR //////////////////////////////////////////
;-----------------------------------------------------------------------------
 
mov ebx,[cur_editor.Bounds.Left-2]
61,10 → 61,10
 
.exit:
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc draw_editor_gutter ;///// DRAW EDITOR GUTTER (LEFT PANEL) ///////////////
func draw_editor_gutter ;///// DRAW EDITOR GUTTER (LEFT PANEL) ///////////////
;-----------------------------------------------------------------------------
cmp [cur_editor.Gutter.Visible],0
je .exit
121,10 → 121,10
 
.exit:
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc draw_editor_vscroll ;///// DRAW EDITOR VERTICAL SCROLL BAR //////////////
func draw_editor_vscroll ;///// DRAW EDITOR VERTICAL SCROLL BAR //////////////
;-----------------------------------------------------------------------------
mov ebx,[cur_editor.Bounds.Right]
shl ebx,16
230,10 → 230,10
mcall 38,,,[cl_3d_inset]
 
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc draw_editor_hscroll ;///// DRAW EDITOR HORIZONTAL SCROLL BAR ////////////
func draw_editor_hscroll ;///// DRAW EDITOR HORIZONTAL SCROLL BAR ////////////
;-----------------------------------------------------------------------------
mov ebx,[cur_editor.Bounds.Left-2]
mov bx,SCRLW
338,10 → 338,10
mcall 38,,,[cl_3d_inset]
 
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc draw_editor_text.part ;///// DRAW EDITOR TEXT (PARTLY) //////////////////
func draw_editor_text.part ;///// DRAW EDITOR TEXT (PARTLY) //////////////////
;-----------------------------------------------------------------------------
; EAX = start line
; EBX = end line
414,10 → 414,10
.exit:
popad
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc draw_editor_text ;///// DRAW EDITOR TEXT ////////////////////////////////
func draw_editor_text ;///// DRAW EDITOR TEXT ////////////////////////////////
;-----------------------------------------------------------------------------
cmp [cur_editor.Lines],0
jne @f
808,10 → 808,10
popad
add esp,4
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc draw_editor_text.get_next_part ;/////////////////////////////////////////
func draw_editor_text.get_next_part ;/////////////////////////////////////////
;-----------------------------------------------------------------------------
; Input:
; ECX = current letter
926,10 → 926,10
mov ecx,[cur_line_len]
mov eax,[color_tbl.text]
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc draw_editor_caret ;///// DRAW EDITOR TEXT CARET /////////////////////////
func draw_editor_caret ;///// DRAW EDITOR TEXT CARET /////////////////////////
;-----------------------------------------------------------------------------
cmp [bot_mode],0
jne @f
966,10 → 966,10
loop .lp8
@@:
ret
endp
endf
 
;-----------------------------------------------------------------------------
proc editor_realloc_lines ;///// ADD $DELTA$ TO LINES SIZE ///////////////////
func editor_realloc_lines ;///// ADD $DELTA$ TO LINES SIZE ///////////////////
;-----------------------------------------------------------------------------
; EAX = delta
;-----------------------------------------------------------------------------
979,12 → 979,12
mov eax,[cur_editor.Lines]
mov [cur_editor.Lines.Size],ebx
mov ecx,eax
stdcall mem.ReAlloc,eax,ebx
call mem.ReAlloc
mov [cur_editor.Lines],eax
sub eax,ecx
pop ecx ebx
ret
endp
endf
 
REDRAW_TEXT = 00000001b
REDRAW_HSCROLL = 00000010b
993,7 → 993,7
REDRAW_TWOLINES = 00010000b
 
;-----------------------------------------------------------------------------
proc editor_check_for_changes ;///// EDITOR CHANGES CHECKER //////////////////
func editor_check_for_changes ;///// EDITOR CHANGES CHECKER //////////////////
;-----------------------------------------------------------------------------
call .check_cursor_visibility
.direct:
1181,4 → 1181,4
pop [cur_editor.SelStart.Y] [cur_editor.SelStart.X]
@@: pop ebx eax
ret
endp
endf
/programs/develop/tinypad/trunk/tinypad.inc
150,7 → 150,7
m2 = -2
end if
store word (m1*6+m2*6+6*8) at _name+POPUP.width
store word (c1*POP_IHEIGHT+c2*POP_SHEIGHT+3) at _name+POPUP.height
store word (c1*POP_IHEIGHT+c2*4+4) at _name+POPUP.height
store dword (((m1+2)*6-1)*65536) at _name+POPUP.acc_ofs
end if
}
216,8 → 216,7
MEV_LUP = 2
MEV_RDOWN = 3
MEV_RUP = 4
MEV_WHEEL = 5
MEV_MOVE = 6
MEV_MOVE = 5
 
;// KEY MODIFIERS
 
/programs/develop/tinypad/trunk/tp-mouse.asm
1,4 → 1,4
proc check_mouse_in_edit_area
func check_mouse_in_edit_area
mcall 37,1
mov ebx,eax
and ebx,0x0000FFFF
16,9 → 16,9
mov ecx,__rc
call pt_in_rect
ret
endp
endf
 
proc get_mouse_event
func get_mouse_event
mcall 37,2
and al,3
mov bl,[ecx]
25,16 → 25,8
cmp [ecx],al
mov [ecx],al
jne @f
mcall 37,7
or eax,eax
jz .mv
add [ecx+6],ax
shr eax,16
add [ecx+4],ax
mov eax,MEV_WHEEL
mov eax,MEV_MOVE
ret
.mv: mov eax,MEV_MOVE
ret
@@: mov bh,al
and ebx,0x0101
cmp bl,bh
51,9 → 43,9
ret
@@: mov eax,MEV_RUP
ret
endp
endf
 
mouse_ev dd mouse.l_down,mouse.l_up,mouse.r_down,mouse.r_up,mouse.wheel,mouse.move
mouse_ev dd mouse.l_down,mouse.l_up,mouse.r_down,mouse.r_up,mouse.move
 
mouse:
mov ecx,mst
84,19 → 76,6
@@: mov [mev],al
jmp [mouse_ev+eax*4-4]
 
.wheel:
movsx eax,word[mst+4]
lea eax,[eax*3]
add [cur_editor.TopLeft.X],eax
movsx eax,word[mst+6]
lea eax,[eax*3]
add [cur_editor.TopLeft.Y],eax
xor eax,eax
mov [mst+4],eax
call check_bottom_right
call draw_editor
jmp still.skip_write
 
.move:
mcall 37,1
movsx ebx,ax
/programs/develop/tinypad/trunk/tp-popup.asm
1,7 → 1,6
 
;POP_WIDTH = (popup_text.max_title+popup_text.max_accel+6)*6
POP_IHEIGHT = 16
POP_SHEIGHT = 3
;POP_HEIGHT = popup_text.cnt_item*POP_IHEIGHT+popup_text.cnt_sep*4+4
 
popup_thread_start:
/programs/develop/tinypad/trunk/tp-recode.asm
38,3 → 38,57
.exit:
ret
 
table.866.1251 db \
$C0,$C1,$C2,$C3,$C4,$C5,$C6,$C7 , $C8,$C9,$CA,$CB,$CC,$CD,$CE,$CF,\
$D0,$D1,$D2,$D3,$D4,$D5,$D6,$D7 , $D8,$D9,$DA,$DB,$DC,$DD,$DE,$DF,\
$E0,$E1,$E2,$E3,$E4,$E5,$E6,$E7 , $E8,$E9,$EA,$EB,$EC,$ED,$EE,$EF,\
$00,$00,$00,$00,$00,$00,$00,$00 , $00,$00,$00,$00,$00,$00,$00,$00,\
$00,$00,$00,$00,$00,$00,$00,$00 , $00,$00,$00,$00,$00,$00,$00,$00,\
$00,$00,$00,$00,$00,$00,$00,$00 , $00,$00,$00,$00,$00,$00,$00,$00,\
$F0,$F1,$F2,$F3,$F4,$F5,$F6,$F7 , $F8,$F9,$FA,$FB,$FC,$FD,$FE,$FF,\
$A8,$B8,$AA,$BA,$AF,$BF,$A1,$A2 , $B0,$95,$B7,$00,$B9,$A4,$00,$00
table.1251.866 db \
$00,$00,$00,$00,$00,$00,$00,$00 , $00,$00,$00,$00,$00,$00,$00,$00,\
$00,$00,$00,$00,$00,$F9,$00,$00 , $00,$00,$00,$00,$00,$00,$00,$00,\
$00,$F6,$F7,$00,$FD,$00,$00,$00 , $F0,$00,$F2,$00,$00,$00,$00,$F4,\
$F8,$00,$00,$00,$00,$00,$00,$FA , $F1,$FC,$F3,$00,$00,$00,$00,$F5,\
$80,$81,$82,$83,$84,$85,$86,$87 , $88,$89,$8A,$8B,$8C,$8D,$8E,$8F,\
$90,$91,$92,$93,$94,$95,$96,$97 , $98,$99,$9A,$9B,$9C,$9D,$9E,$9F,\
$A0,$A1,$A2,$A3,$A4,$A5,$A6,$A7 , $A8,$A9,$AA,$AB,$AC,$AD,$AE,$AF,\
$E0,$E1,$E2,$E3,$E4,$E5,$E6,$E7 , $E8,$E9,$EA,$EB,$EC,$ED,$EE,$EF
table.866.koi db \
$E1,$E2,$F7,$E7,$E4,$E5,$F6,$FA , $E9,$EA,$EB,$EC,$ED,$EE,$EF,$F0,\
$F2,$F3,$F4,$F5,$E6,$E8,$E3,$FE , $FB,$FD,$FF,$F9,$F8,$FC,$E0,$F1,\
$C1,$C2,$D7,$C7,$C4,$C5,$D6,$DA , $C9,$CA,$CB,$CC,$CD,$CE,$CF,$D0,\
$90,$00,$00,$81,$87,$00,$00,$00 , $00,$00,$00,$00,$00,$00,$00,$83,\
$84,$89,$88,$86,$80,$8A,$00,$00 , $00,$00,$00,$00,$00,$00,$00,$00,\
$00,$00,$00,$00,$00,$00,$00,$00 , $00,$85,$82,$8D,$8C,$8E,$8F,$8B,\
$D2,$D3,$D4,$D5,$C6,$C8,$C3,$DE , $DB,$DD,$DF,$D9,$D8,$DC,$C0,$D1,\
$B3,$A3,$B4,$A4,$B7,$A7,$BE,$AE , $00,$95,$9E,$00,$B0,$9F,$00,$A0
table.koi.866 db \
$C4,$B3,$DA,$BF,$C0,$D9,$C3,$B4 , $C2,$C1,$C5,$DF,$DC,$DB,$DD,$DE,\
$B0,$00,$00,$00,$00,$F9,$00,$00 , $00,$00,$00,$00,$00,$00,$FA,$FD,\
$FF,$00,$00,$F1,$F3,$00,$00,$F5 , $00,$00,$00,$00,$00,$00,$F7,$00,\
$FC,$00,$00,$F0,$F2,$00,$00,$F4 , $00,$00,$00,$00,$00,$00,$F6,$00,\
$EE,$A0,$A1,$E6,$A4,$A5,$E4,$A3 , $E5,$A8,$A9,$AA,$AB,$AC,$AD,$AE,\
$AF,$EF,$E0,$E1,$E2,$E3,$A6,$A2 , $EC,$EB,$A7,$E8,$ED,$E9,$E7,$EA,\
$9E,$80,$81,$96,$84,$85,$94,$83 , $95,$88,$89,$8A,$8B,$8C,$8D,$8E,\
$8F,$9F,$90,$91,$92,$93,$86,$82 , $9C,$9B,$87,$98,$9D,$99,$97,$9A
table.1251.koi db \
$B1,$B2,$00,$A2,$00,$00,$00,$00 , $00,$00,$B9,$00,$BA,$BC,$BB,$BF,\
$A1,$91,$92,$93,$94,$95,$96,$97 , $00,$99,$A9,$00,$AA,$AC,$AB,$AF,\
$A0,$BE,$AE,$B8,$9F,$BD,$00,$00 , $B3,$98,$B4,$9D,$00,$00,$9C,$B7,\
$00,$00,$B6,$A6,$AD,$00,$00,$9E , $A3,$B0,$A4,$9B,$A8,$B5,$A5,$A7,\
$E1,$E2,$F7,$E7,$E4,$E5,$F6,$FA , $E9,$EA,$EB,$EC,$ED,$EE,$EF,$F0,\
$F2,$F3,$F4,$F5,$E6,$E8,$E3,$FE , $FB,$FD,$FF,$F9,$F8,$FC,$E0,$F1,\
$C1,$C2,$D7,$C7,$C4,$C5,$D6,$DA , $C9,$CA,$CB,$CC,$CD,$CE,$CF,$D0,\
$D2,$D3,$D4,$D5,$C6,$C8,$C3,$DE , $DB,$DD,$DF,$D9,$D8,$DC,$C0,$D1
table.koi.1251 db \
$00,$00,$00,$00,$00,$00,$00,$00 , $00,$00,$00,$00,$00,$00,$00,$00,\
$00,$91,$92,$93,$94,$95,$96,$97 , $00,$99,$00,$BB,$AE,$AB,$B7,$A4,\
$A0,$90,$83,$B8,$BA,$BE,$B3,$BF , $BC,$9A,$9C,$9E,$9D,$B4,$A2,$9F,\
$B9,$80,$81,$A8,$AA,$BD,$B2,$AF , $A3,$8A,$8C,$8E,$8D,$A5,$A1,$8F,\
$FE,$E0,$E1,$F6,$E4,$E5,$F4,$E3 , $F5,$E8,$E9,$EA,$EB,$EC,$ED,$EE,\
$EF,$FF,$F0,$F1,$F2,$F3,$E6,$E2 , $FC,$FB,$E7,$F8,$FD,$F9,$F7,$FA,\
$DE,$C0,$C1,$D6,$C4,$C5,$D4,$C3 , $D5,$C8,$C9,$CA,$CB,$CC,$CD,$CE,\
$CF,$DF,$D0,$D1,$D2,$D3,$C6,$C2 , $DC,$DB,$C7,$D8,$DD,$D9,$D7,$DA
/programs/develop/tinypad/trunk/tp-tbox.asm
6,7 → 6,7
tb.sel.x db ?
tb.sel.selected db ?
 
proc textbox.get_width
func textbox.get_width
push ebx edx
movzx eax,[tbox.width]
add eax,-6
19,9 → 19,9
mov eax,ebx
@@: pop edx ebx
ret
endp
endf
 
proc textbox.delete_selection
func textbox.delete_selection
cmp [tb.sel.selected],0
je .exit.2
pushad
49,9 → 49,9
.exit.2:
stc
ret
endp
endf
 
proc textbox.draw ; TBOX* ebp
func textbox.draw ; TBOX* ebp
call textbox.get_width
movzx ebx,[tbox.pos.x]
sub bl,[tbox.ofs.x]
196,9 → 196,9
add ebx,0x00010001
mcall
ret
endp
endf
 
proc textbox.key
func textbox.key
mov ebp,[focused_tb]
mov esi,accel_table_textbox
.acc: cmp ebx,[esi]
243,12 → 243,12
call textbox.draw
.exit:
ret
endp
endf
 
textbox.mouse:
ret
 
proc key.tb.bkspace
func key.tb.bkspace
call textbox.delete_selection
jnc @f
 
258,17 → 258,17
jmp key.tb.del.direct
 
@@: ret
endp
endf
 
proc key.tb.home
func key.tb.home
xor al,al
mov [tbox.pos.x],al
mov [tbox.sel.x],al
mov [tbox.ofs.x],al
ret
endp
endf
 
proc key.tb.left
func key.tb.left
mov al,[tbox.pos.x]
mov [tbox.sel.x],al
dec al
281,9 → 281,9
jge @f
mov [tbox.ofs.x],0
@@: ret
endp
endf
 
proc key.tb.right
func key.tb.right
call textbox.get_width
mov bl,[tbox.pos.x]
mov [tbox.sel.x],bl
297,9 → 297,9
jbe @f
inc [tbox.ofs.x]
@@: ret
endp
endf
 
proc key.tb.end
func key.tb.end
call textbox.get_width
movzx ebx,[tbox.length]
mov [tbox.pos.x],bl
309,9 → 309,9
xor bl,bl
@@: mov [tbox.ofs.x],bl
ret
endp
endf
 
proc key.tb.del
func key.tb.del
call textbox.delete_selection
jnc @f
.direct:
327,16 → 327,16
rep movsb
 
@@: ret
endp
endf
 
proc key.tb.shift_home
func key.tb.shift_home
xor al,al
mov [tbox.pos.x],al
mov [tbox.ofs.x],al
ret
endp
endf
 
proc key.tb.shift_left
func key.tb.shift_left
mov al,[tbox.pos.x]
dec al
js @f
347,9 → 347,9
jge @f
mov [tbox.ofs.x],0
@@: ret
endp
endf
 
proc key.tb.shift_right
func key.tb.shift_right
call textbox.get_width
mov bl,[tbox.pos.x]
inc bl
361,9 → 361,9
jbe @f
inc [tbox.ofs.x]
@@: ret
endp
endf
 
proc key.tb.shift_end
func key.tb.shift_end
call textbox.get_width
movzx ebx,[tbox.length]
mov [tbox.pos.x],bl
372,4 → 372,4
xor bl,bl
@@: mov [tbox.ofs.x],bl
ret
endp
endf