Subversion Repositories Kolibri OS

Rev

Rev 259 | Rev 280 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. ;-----------------------------------------------------------------------------
  2. ; project name:      TINYPAD
  3. ; compiler:          flat assembler 1.67.15
  4. ; memory to compile: 2.0/7.0 MBytes (without/with size optimizations)
  5. ; version:           4.0.4 pre
  6. ; last update:       2007-01-07 (Jan 7, 2007)
  7. ; minimal kernel:    revision #138 (svn://kolibrios.org/kernel)
  8. ;-----------------------------------------------------------------------------
  9. ; originally by:     Ville Michael Turjanmaa >> villemt@aton.co.jyu.fi
  10. ; maintained by:     Mike Semenyako          >> mike.dld@gmail.com
  11. ;                    Ivan Poddubny           >> ivan-yar@bk.ru
  12. ;-----------------------------------------------------------------------------
  13. ; TODO (FOR 4.1.0):
  14. ;   - optimize drawing (reduce flickering)
  15. ;   - add vertical selection, undo, goto position, overwrite mode
  16. ;   - improve window drawing with small dimensions
  17. ;   - other bug-fixes and speed/size optimizations
  18. ;   - save settings to ini file, not to executable
  19. ;
  20. ; TODO (FOR 4.0.4, PLANNED FOR 2007-01-21):
  21. ;   - finish tabbed interface (some bug with tab switching) [critical]
  22. ;   - add memory reallocation to keys handler [critical]
  23. ;   - rework save_file (memory manager) [critical]
  24. ;   - fix scrollbars dragging coordinates calculation [critical]
  25. ;   - fix parameters parsing (incl. DOCPAK) [average]
  26. ;   - reduce flickering (introduce changes checker) [normal]
  27. ;   - fix incorrect saved/modified lines flags on copy/paste [normal]
  28. ;   - add prompt to save file before closing/opening [low]
  29. ;
  30. ; HISTORY:
  31. ; 4.0.4 pre (mike.dld)
  32. ;   bug-fixes:
  33. ;     - statusbar contained hint after dialog operation cancelled
  34. ;     - small drawing fix for gutter and line saved/modified markers
  35. ;   changes:
  36. ;     - editor and other modifications to ease parts placement changing
  37. ;     - modified/saved colors now match those in MSVS
  38. ;     - function 70 for *all* file operations (including diamond's fixes)
  39. ;     - use memory manager instead of statically allocated region
  40. ;     - case-insensitive filenames input, to be able to open/save files with
  41. ;       non-latin chars in name (russian etc.)
  42. ;     - overall code cleanup
  43. ;   new features:
  44. ;     - recode tables between CP866, CP1251 and KOI8-R (suggested by Victor)
  45. ;     - tabbed interface, ability to open several files in one app instance
  46. ;       (thanks IRC guys for ideas and testing)
  47. ; 4.0.3 (mike.dld)
  48. ;   bug-fixes:
  49. ;     - 1-char selection if pressing <BS> out of real line length
  50. ;     - fault in `writepos`, added call to function 9
  51. ;     - main menu items weren't highlighted if popup opened and cursor
  52. ;       isn't in main menu item's area
  53. ;     - statusbar and textboxes drawing fixes (wrong colors)
  54. ;     - perform no redraw while pressing Shift, Ctrl, Alt keys
  55. ;     - data length from DOCPAK in string representation (fixed by diamond)
  56. ;     - compare file extension case-insensitively (fixed by diamond)
  57. ;   changes:
  58. ;     - function 70 instead of 58 for files loading/saving
  59. ;     - clientarea-relative drawing (less code)
  60. ;     - every line's dword is now splitted into 2 words;
  61. ;       low word - line block length, so max line length is 65535 now
  62. ;       high word - various flags. for now, only 2 of 16 bits are used:
  63. ;         if bit #0 is set, line was modified since file open
  64. ;         if bit #1 is set, line was saved after last modification
  65. ;       high word could also be further used for code collapsing and different
  66. ;         line marking features (breakpoints, errors, bookmarks, etc.)
  67. ;   new features:
  68. ;     - line markers for modified and saved lines
  69. ;     - status messages for various actions
  70. ; 4.0.2 (mike.dld)
  71. ;   bug-fixes:
  72. ;     - program terminates if started with parameters (fine for DOCPAK)
  73. ; 4.0.1 (mike.dld)
  74. ;   bug-fixes:
  75. ;     - unable to run program after exiting from main menu (Alt+X)
  76. ;   new features:
  77. ;     - integration with DOCPAK
  78. ; 4.0 (mike.dld)
  79. ;   bug-fixes:
  80. ;     - main menu popups' "on show" was called only for first shown popup
  81. ;     - clear selection on left/right arrow keys
  82. ;   new features:
  83. ;     - "replace" dialog (w/o "skip", "replace all")
  84. ;     - line numbers display
  85. ;     - options (except "appearance" and "smart tabulation")
  86. ;     - options saving (colors, window position, "Options" popup triggers)
  87. ; 4.0 beta 2 (mike.dld)
  88. ;   bug-fixes:
  89. ;     - unable to start if /rd/1/example.asm is missing (from Halyavin)
  90. ;     - clicking on menu items draws main window in popup (from Rohan)
  91. ;     - passed parameters aren't taken into account (from Mario79)
  92. ;     - background isn't erased if text lines < screen lines after
  93. ;       selection deletion (from Rohan)
  94. ; 4.0 beta 1 (mike.dld)
  95. ;   menu bar and popup menu;
  96. ;     removed buttons from the top and input fields from the bottom since
  97. ;     now they're accesible through main/popup menu;
  98. ;   improved keyboard handling (using 66th function);
  99. ;     support for almost all FASMW keyboard shourtcuts;
  100. ;   added text selection ability, standard selection operations
  101. ;     (copy,cut,paste);
  102. ;   new integrated dialogs (open, save, find)
  103. ;   fix to collapse SPACEs into TABs only for *.asm and *.inc files
  104. ; 3.78a (mike.dld)
  105. ;   fixed termination while typing in x positions higher than (line_length+10);
  106. ;   improved drawing on small heights
  107. ;     don't draw window while its height = 0 (Kolibri "minimize" support)
  108. ; 3.78 (mike.dld)
  109. ;   now lines may be of ANY length;
  110. ;     optimized memory usage (less memory for internal file representation)
  111. ;       after loading file, it's internal size equals to its real size
  112. ;       plus 14 bytes for each line (4 bytes for line length
  113. ;         and 10 spaced to the end - to reduce data relocations count);
  114. ;     completely rewritten keyboard handling;
  115. ;     added horizontal scrollbar;
  116. ;   all line feed formats are supported: WIN(CRLF),*NIX(LF),MAC(CR);
  117. ;   etc.
  118. ; 3.77 (mike.dld)
  119. ;   changed save_string to collapse SPACEs into TABs;
  120. ;   rewrote drawfile from scratch (speed++)
  121. ;     through some drawing improvements  needed
  122. ;     (some checkups to reduce flickering);
  123. ;   writepos (size--);
  124. ;   fixed drawing window while height < 100px, and for non-asm files;
  125. ;   several small fixes; speed/size optimizations
  126. ; 3.76 (mike.dld)
  127. ;   changed loadfile/loadhdfile to expand TABs into SPACEs;
  128. ;   changed TAB,ENTER,DELETE,BSPACE keys behaviour (rewritten from scratch);
  129. ;   vertical scrollbar;
  130. ;   extra window resizing capabilities (added a couple of constants);
  131. ;   completely new text cursor management & moving text cursor with mouse;
  132. ;   improved search function, moving cursor to beginning of text found;
  133. ;   adjustable max line width (change LINE_WIDTH & recompile) // (obsolet)
  134. ; 3.75a
  135. ;   fixed converting char to upper case in read_string
  136. ; 3.75
  137. ;   rewrote save_file from scratch; bugfix in loadfile;
  138. ; 3.74
  139. ;   optimisation
  140. ; 3.73
  141. ;   completly new load_file function
  142. ; 3.72
  143. ;   speed++
  144. ; 3.71
  145. ;   error beep
  146. ; 3.6,3.7:
  147. ;   many bugs fixed
  148. ;   simple toolbar
  149. ;   compile, run applications from TINYPAD, all fasm output is in debug board
  150. ;   TAB button
  151. ;   auto-indent
  152. ;   Ctrl+L - insert comment string
  153. ;-----------------------------------------------------------------------------
  154.  
  155. include 'lang.inc'
  156. include 'macros.inc' ; useful stuff
  157. ;include 'proc32.inc'
  158. include 'tinypad.inc'
  159. purge mov,add,sub            ;  SPEED
  160.  
  161. header '01',1,@CODE,TINYPAD_END,STATIC_MEM_END,MAIN_STACK,@PARAMS,self_path
  162.  
  163. APP_VERSION equ '4.0.4 pre'
  164.  
  165. ;include 'debug.inc'
  166.  
  167. ASEPC = '-'           ; separator character (char)
  168. ATOPH = POP_IHEIGHT+2 ; menu bar height (pixels)
  169. SCRLW = 16            ; scrollbar widht/height (pixels)
  170. ATABW = 8             ; tab width (chars)
  171. LINEH = 10            ; line height (pixels)
  172. PATHL = 256           ; maximum path length (chars) !!! don't change !!!
  173. AMINS = 8             ; minimal scroll thumb size (pixels)
  174. LCHGW = 3             ; changed/saved marker width
  175.  
  176. STATH = 16            ; status bar height
  177. TBARH = 18            ; tab bar height
  178.  
  179. ;-----------------------------------------------------------------------------
  180. section @OPTIONS ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  181. ;-----------------------------------------------------------------------------
  182.  
  183. label color_tbl dword
  184.   RGB(  0,  0,  0) ; RGB(  0,  0,  0) ; RGB(  0,  0,  0) ; text
  185.   RGB(  0,144,  0) ; RGB(  0,160,  0) ; RGB(  0,144,  0) ; numbers
  186.   RGB(176,  0,  0) ; RGB(  0,128,255) ; RGB(160,  0,  0) ; strings
  187.   RGB(128,128,128) ; RGB(160,160,160) ; RGB(144,144,144) ; comments
  188.   RGB( 48, 48,240) ; RGB(255,  0,  0) ; RGB( 48, 48,240) ; symbols
  189.   RGB(255,255,255) ; RGB(255,255,255) ; RGB(224,224,224) ; background
  190.   RGB(255,255,255) ; RGB(255,255,255) ; RGB(255,255,255) ; selection text
  191.   RGB( 10, 36,106) ; RGB(  0, 64,128) ; RGB(  0,  0,128) ; selection background
  192.   RGB(255,238, 98) ; modified line marker
  193.   RGB(108,226,108) ; saved line marker
  194.  
  195. ins_mode db 1
  196.  
  197. options  db OPTS_AUTOINDENT+OPTS_OPTIMSAVE+OPTS_SMARTTAB
  198.  
  199. mainwnd_pos:
  200.   .x dd 250
  201.   .y dd 75
  202.   .w dd 6*80+6+SCRLW+5
  203.   .h dd 402
  204.  
  205. ;-----------------------------------------------------------------------------
  206. section @CODE ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  207. ;-----------------------------------------------------------------------------
  208.  
  209. ;       fninit
  210.  
  211. ;        stdcall ini.get_int,finfo_ini,ini_sec_window,ini_window_left,50
  212. ;        mov     [mainwnd_pos.x],eax
  213. ;        stdcall ini.get_int,finfo_ini,ini_sec_window,ini_window_top,50
  214. ;        mov     [mainwnd_pos.y],eax
  215. ;        stdcall ini.get_int,finfo_ini,ini_sec_window,ini_window_right,350
  216. ;        sub     eax,[mainwnd_pos.x]
  217. ;        mov     [mainwnd_pos.w],eax
  218. ;        stdcall ini.get_int,finfo_ini,ini_sec_window,ini_window_bottom,450
  219. ;        sub     eax,[mainwnd_pos.y]
  220. ;        mov     [mainwnd_pos.h],eax
  221.  
  222.         cld
  223.         mov     edi,@UDATA
  224.         mov     ecx,@PARAMS-@UDATA
  225.         mov     al,0
  226.         rep     stosb
  227.  
  228.         mov     [tab_bar.Style],2
  229.  
  230.         mcall   68,11
  231.         or      eax,eax
  232.         jz      key.alt_x.close
  233.  
  234.         mov     eax,65536
  235.         call    mem.Alloc
  236.         mov     [temp_buf],eax
  237.  
  238.         mov     eax,65536
  239.         call    mem.Alloc
  240.         mov     [cur_editor.Lines],eax
  241.  
  242.         inc     [do_not_draw]
  243.  
  244.         mov     [left_ofs],40+1
  245. ;       mov     [f_info+4],0
  246. ;       mov     [f_info+12],AREA_TEMP
  247. ;       mov     [f_info+16],AREA_EDIT-AREA_TEMP
  248.  
  249.         mov     esi,s_example
  250.         mov     edi,tb_opensave.text
  251.         mov     ecx,s_example.size
  252.         mov     [tb_opensave.length],cl
  253.         rep     movsb
  254.  
  255.         mov     esi,s_still
  256.         mov     edi,s_search
  257.         mov     ecx,s_still.size
  258.         mov     [s_search.size],ecx
  259.         rep     movsb
  260.  
  261.         cmp     byte[@PARAMS],0
  262.         jz      no_params
  263.  
  264. ;// Willow's code to support DOCPAK [
  265.  
  266.         cmp     byte[@PARAMS],'*'
  267.         jne     .noipc
  268.  
  269. ;// diamond [ (convert size from decimal representation to dword)
  270. ;--     mov     edx,dword[@PARAMS+1]
  271.         mov     esi,@PARAMS+1
  272.         xor     edx,edx
  273.         xor     eax,eax
  274.     @@: lodsb
  275.         test    al,al
  276.         jz      @f
  277.         lea     edx,[edx*4+edx]
  278.         lea     edx,[edx*2+eax-'0']
  279.         jmp     @b
  280.     @@:
  281. ;// diamond ]
  282.  
  283.         add     edx,20
  284.  
  285.         mov     eax,edx
  286.         call    mem.Alloc
  287.         mov     ebp,eax
  288.  
  289. ;!      mcall   60,1,AREA_TEMP-16 ; 0x10000-16
  290. ;!      mov     dword[AREA_TEMP-16+4],8 ; [0x10000-16+4],8
  291.         mcall   60,1,ebp
  292.         mov     dword[ebp+4],8
  293.         mcall   40,1000000b
  294.         mcall   23,200
  295.         cmp     eax,7
  296.         jne     key.alt_x.close
  297. ;!      mov     esi,AREA_TEMP-16 ; 0x10000-16
  298. ;!      mov     byte[esi],1
  299. ;!      mov     eax,[esi+12]
  300.         mov     byte[ebp],1
  301. ;!      mov     eax,[ebp+12]
  302. ;!      inc     eax
  303. ;!      call    load_file.file_found
  304.  
  305.         mov     ecx,[ebp+12]
  306.         mov     esi,ebp
  307.         call    create_tab
  308.         call    load_from_memory
  309.  
  310.         mov     eax,ebp
  311.         call    mem.Free
  312.  
  313.         jmp     @f
  314.   .noipc:
  315.  
  316. ;// Willow's code to support DOCPAK ]
  317.  
  318.     ; parameters are at @PARAMS
  319.         mov     esi,@PARAMS
  320.         mov     edi,tb_opensave.text
  321.         mov     ecx,PATHL
  322.         rep     movsb
  323.         mov     edi,tb_opensave.text
  324.         mov     ecx,PATHL
  325.         xor     al,al
  326.         repne   scasb
  327.         jne     key.alt_x.close
  328.         lea     eax,[edi-tb_opensave.text-1]
  329.         mov     [tb_opensave.length],al
  330.  
  331.   no_params:
  332.         ;call    btn.load_file;do_load_file
  333.         ;jnc     @f
  334.         call    create_tab
  335.  
  336.     @@:
  337.         dec     [do_not_draw]
  338.         mcall   66,1,1
  339.         mcall   40,00100111b
  340. red:
  341.         call    drawwindow
  342.         call    check_inv_all.skip_check
  343.  
  344. ;-----------------------------------------------------------------------------
  345.  
  346. still:
  347.        call    draw_statusbar ; write current position & number of strings
  348.  
  349.   .skip_write:
  350.         mcall   10;23,50; wait here until event
  351.         cmp     [main_closed],0
  352.         jne     key.alt_x
  353.         dec     eax     ; redraw ?
  354.         jz      red
  355.         dec     eax     ; key ?
  356.         jz      key
  357.         dec     eax     ; button ?
  358.         jz      button
  359.         sub     eax,3   ; mouse ?
  360.         jz      mouse
  361.  
  362.         jmp     still.skip_write
  363.  
  364. ;-----------------------------------------------------------------------------
  365. func start_fasm ;/////////////////////////////////////////////////////////////
  366. ;-----------------------------------------------------------------------------
  367. ; BL = run after compile
  368. ;-----------------------------------------------------------------------------
  369.         cmp     [cur_editor.AsmMode],0 ;! [asm_mode],0
  370.         jne     @f
  371.         ret
  372.     @@: mov     esi,f_info.path ; s_fname
  373.         mov     edi,fasm_parameters
  374.  
  375.         cmp     byte[esi],'/'
  376.         je      .yes_systree
  377.  
  378.         mov     ecx,[f_info.length] ; [s_fname.size]
  379.         rep     movsb
  380.  
  381.         mov     al,','
  382.         stosb
  383.  
  384.         mov     ecx,[f_info.length] ; [s_fname.size]
  385.         add     ecx,-4
  386.         mov     esi,f_info.path ; s_fname
  387.         rep     movsb
  388.  
  389.         mov     al,','
  390.         stosb
  391.  
  392.         mov     dword[edi],'/RD/'
  393.         mov     word[edi+4],'1/'
  394.         add     edi,6
  395.  
  396.         mov     al,0
  397.         stosb
  398.  
  399.         jmp     .run
  400.  
  401.  .yes_systree:
  402.         mov     eax,[f_info.length]
  403.         add     esi,eax ; [s_fname.size]
  404.         dec     esi
  405.  
  406.         xor     ecx,ecx
  407.         mov     al,'/'
  408.     @@: cmp     [esi],al
  409.         je      @f
  410.         dec     esi
  411.         inc     ecx
  412.         jmp     @b
  413.     @@: inc     esi
  414.  
  415.         push    esi esi ecx
  416.  
  417.         rep     movsb
  418.  
  419.         mov     al,','
  420.         stosb
  421.  
  422.         pop     ecx esi
  423.  
  424.         add     ecx,-4
  425.         rep     movsb
  426.  
  427.         mov     al,','
  428.         stosb
  429.  
  430.         pop     ecx
  431.         sub     ecx,f_info.path ; s_fname
  432.         mov     esi,f_info.path ; s_fname
  433.  
  434.         rep     movsb
  435.  
  436.         mov     al,0
  437.         stosb
  438.  
  439.  .run:
  440.         cmp     bl,0 ; run outfile ?
  441.         je      @f
  442.         mov     dword[edi-1],',run'
  443.         mov     byte[edi+3],0
  444.     @@:
  445.         mov     ebx, fasm_start
  446. start_ret:
  447.         mov     eax, 70
  448.         int     0x40
  449.         ret
  450. endf
  451.  
  452. ;-----------------------------------------------------------------------------
  453. func open_debug_board ;///////////////////////////////////////////////////////
  454. ;-----------------------------------------------------------------------------
  455.         mov     ebx, board_start
  456.         jmp     start_ret
  457. endf
  458.  
  459. ;-----------------------------------------------------------------------------
  460. func open_sysfuncs_txt ;//////////////////////////////////////////////////////
  461. ;-----------------------------------------------------------------------------
  462.         mov     ebx, docpak_start
  463.         call    start_ret
  464.         cmp     eax,0xfffffff0
  465.         jb      @f
  466.         mov     ebx, tinypad_start
  467.         mov     dword [ebx+8], sysfuncs_filename
  468.         call    start_ret
  469.     @@: ret
  470. endf
  471.  
  472. ;-----------------------------------------------------------------------------
  473. ;func layout  ;///// change keyboard layout ///////////////////////////////////
  474. ;-----------------------------------------------------------------------------
  475. ;        mcall   19,setup,param_setup
  476. ;        mcall   5,eax
  477. ;;       call    activate_me
  478. ;;       ret
  479. ;;endf
  480.  
  481. ;;func activate_me
  482. ;        mcall   9,p_info,-1
  483. ;        inc     eax
  484. ;        inc     eax
  485. ;        mov     ecx,eax
  486. ;        mov     edi,[p_info.PID]
  487. ;        mov     ebx,p_info
  488. ;    @@: dec     ecx
  489. ;        jz      @f    ; counter=0 => not found? => return
  490. ;        mcall   9
  491. ;        cmp     edi,[p_info.PID]
  492. ;        jne     @b
  493. ;        mcall   18,3
  494. ;        mcall   5,eax
  495. ;    @@: ret
  496. ;endf
  497.  
  498. set_opt:
  499.  
  500.   .line_numbers:
  501.         mov     al,OPTS_LINENUMS
  502.         jmp     .main
  503.   .optimal_fill:
  504.         mov     al,OPTS_OPTIMSAVE
  505.         jmp     .main
  506.   .auto_indents:
  507.         mov     al,OPTS_AUTOINDENT
  508.         jmp     .main
  509.   .auto_braces:
  510.         mov     al,OPTS_AUTOBRACES
  511.         jmp     .main
  512.   .secure_sel:
  513.         mov     al,OPTS_SECURESEL
  514.  
  515.   .main:
  516.         xor     [options],al
  517. ;       test    [options],al
  518. ;       je      @f
  519. ;       not     al
  520. ;       and     [options],al
  521. ;       ret
  522. ;   @@: or      [options],al
  523.         ret
  524.  
  525. ;-----------------------------------------------------------------------------
  526.  
  527. include 'tp-defines.inc'
  528.  
  529. include 'tp-draw.asm'
  530. include 'tp-key.asm'
  531. include 'tp-button.asm'
  532. include 'tp-mouse.asm'
  533. include 'tp-files.asm'
  534. include 'tp-common.asm'
  535. include 'tp-dialog.asm'
  536. include 'tp-popup.asm'
  537. include 'tp-tbox.asm'
  538. include 'tp-tabctl.asm'
  539. include 'tp-editor.asm'
  540. include 'tp-recode.asm'
  541.  
  542. ;include 'lib-ini.asm'
  543.  
  544. ;-----------------------------------------------------------------------------
  545. section @DATA ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  546. ;-----------------------------------------------------------------------------
  547.  
  548. ;addr       dd s_fname  ; address of input string
  549. ;temp       dd 0xABCD   ; used in read_string
  550. vscrl_capt dd -1
  551. hscrl_capt dd -1
  552. body_capt  dd -1
  553.  
  554. key0 db \
  555.   0x00,0x00,0x02,0x03,0x04,0x05,0x06,0x07,\
  556.   0x08,0x09,0x0A,0x0B,0x0C,0x0D,0x00,0x00,\
  557.   0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,\
  558.   0x18,0x19,0x1A,0x1B,0x00,0x00,0x1E,0x1F,\
  559.   0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,\
  560.   0x28,0x29,0x00,0x2B,0x2C,0x2D,0x2E,0x2F,\
  561.   0x30,0x31,0x32,0x33,0x34,0x35,0x00,0x00,\
  562.   0x00,0x39,0x00,0x00,0x00,0x00,0x00,0x00
  563.   times 12*16 db 0x00
  564.  
  565. accel_table_main dd                 \
  566.   0x0000000E,key.bkspace           ,\ ; BackSpace
  567.   0x0000000F,key.tab               ,\ ; Tab
  568.   0x0000001C,key.return            ,\ ; Return
  569.   0x0000003D,key.f3                ,\ ; F3
  570.   0x00000043,key.f9                ,\ ; F9
  571.   0x00000147,key.home              ,\ ; Home
  572.   0x00000148,key.up                ,\ ; Up
  573.   0x00000149,key.pgup              ,\ ; PageUp
  574.   0x0000014B,key.left              ,\ ; Left
  575.   0x0000014D,key.right             ,\ ; Right
  576.   0x0000014F,key.end               ,\ ; End
  577.   0x00000150,key.down              ,\ ; Down
  578.   0x00000151,key.pgdn              ,\ ; PageDown
  579.   0x00000152,key.ins               ,\ ; Insert
  580.   0x00000153,key.del               ,\ ; Delete
  581.   0x00010147,key.shift_home        ,\ ; Shift+Home
  582.   0x00010148,key.shift_up          ,\ ; Shift+Up
  583.   0x00010149,key.shift_pgup        ,\ ; Shift+PageUp
  584.   0x0001014B,key.shift_left        ,\ ; Shift+Left
  585.   0x0001014D,key.shift_right       ,\ ; Shift+Right
  586.   0x0001014F,key.shift_end         ,\ ; Shift+End
  587.   0x00010150,key.shift_down        ,\ ; Shift+Down
  588.   0x00010151,key.shift_pgdn        ,\ ; Shift+PageDown
  589.   0x00010153,key.del               ,\ ; Shift+Delete
  590.   0x0002000F,key.ctrl_tab          ,\ ; Ctrl+Tab
  591.   0x00020015,key.ctrl_y            ,\ ; Ctrl+Y
  592.   0x00020018,key.ctrl_o            ,\ ; Ctrl+O
  593.   0x0002001E,key.ctrl_a            ,\ ; Ctrl+A
  594.   0x0002001F,key.ctrl_s            ,\ ; Ctrl+S
  595.   0x00020020,key.ctrl_d            ,\ ; Ctrl+D
  596.   0x00020021,key.ctrl_f            ,\ ; Ctrl+F
  597.   0x00020022,key.ctrl_g            ,\ ; Ctrl+G
  598.   0x00020023,key.ctrl_h            ,\ ; Ctrl+H
  599. \;0x00020026,key.ctrl_l            ,\ ; Ctrl+L
  600.   0x0002002D,key.ctrl_x            ,\ ; Ctrl+X
  601.   0x0002002E,key.ctrl_c            ,\ ; Ctrl+C
  602.   0x0002002F,key.ctrl_v            ,\ ; Ctrl+V
  603.   0x00020031,key.ctrl_n            ,\ ; Ctrl+N
  604.   0x0002003E,key.ctrl_f4           ,\ ; Ctrl+F4
  605.   0x00020043,key.ctrl_f9           ,\ ; Ctrl+F9
  606.   0x00020147,key.ctrl_home         ,\ ; Ctrl+Home
  607. \;0x00020148,key.ctrl_up           ,\ ; Ctrl+Up
  608.   0x00020149,key.ctrl_pgup         ,\ ; Ctrl+PageUp
  609.   0x0002014B,key.ctrl_left         ,\ ; Ctrl+Left
  610.   0x0002014D,key.ctrl_right        ,\ ; Ctrl+Right
  611.   0x0002014F,key.ctrl_end          ,\ ; Ctrl+End
  612. \;0x00020150,key.ctrl_down         ,\ ; Ctrl+Down
  613.   0x00020151,key.ctrl_pgdn         ,\ ; Ctrl+PageDown
  614.   0x00020153,key.del               ,\ ; Ctrl+Del
  615.   0x0003000F,key.shift_ctrl_tab    ,\ ; Shift+Ctrl+Tab
  616.   0x0003001F,key.shift_ctrl_s      ,\ ; Shift+Ctrl+S
  617.   0x00030147,key.shift_ctrl_home   ,\ ; Shift+Ctrl+Home
  618. \;0x00030148,key.shift_ctrl_up     ,\ ; Shift+Ctrl+Up
  619.   0x00030149,key.shift_ctrl_pgup   ,\ ; Shift+Ctrl+PageUp
  620.   0x0003014B,key.shift_ctrl_left   ,\ ; Shift+Ctrl+Left
  621.   0x0003014D,key.shift_ctrl_right  ,\ ; Shift+Ctrl+Right
  622.   0x0003014F,key.shift_ctrl_end    ,\ ; Shift+Ctrl+End
  623. \;0x00030150,key.shift_ctrl_down   ,\ ; Shift+Ctrl+Down
  624.   0x00030151,key.shift_ctrl_pgdn   ,\ ; Shift+Ctrl+PageDown
  625.   0x0004002D,key.alt_x             ,\ ; Alt+X
  626.   0
  627.  
  628. accel_table_textbox dd              \
  629. \;0x00000001,key.tb.escape         ,\ ; Escape
  630.   0x0000000E,key.tb.bkspace        ,\ ; BackSpace
  631. \;0x0000000F,key.tb.tab            ,\ ; Tab
  632. \;0x0000001C,key.tb.return         ,\ ; Return
  633.   0x00000147,key.tb.home           ,\ ; Home
  634.   0x0000014B,key.tb.left           ,\ ; Left
  635.   0x0000014D,key.tb.right          ,\ ; Right
  636.   0x0000014F,key.tb.end            ,\ ; End
  637.   0x00000153,key.tb.del            ,\ ; Delete
  638.   0x00010147,key.tb.shift_home     ,\ ; Shift+Home
  639.   0x0001014B,key.tb.shift_left     ,\ ; Shift+Left
  640.   0x0001014D,key.tb.shift_right    ,\ ; Shift+Right
  641.   0x0001014F,key.tb.shift_end      ,\ ; Shift+End
  642.   0x00010153,key.tb.del            ,\ ; Shift+Del
  643.   0
  644.  
  645. accel_table2 dd            \
  646.   1,btn.close_main_window ,\
  647.   'VSL',btn.vscroll_up   ,\
  648.   'VSG',btn.vscroll_down ,\
  649.   'HSL',btn.hscroll_up   ,\
  650.   'HSG',btn.hscroll_down ,\
  651.   'TBL',btn.tabctl_right ,\
  652.   'TBG',btn.tabctl_left  ,\
  653.   0
  654.  
  655. accel_table2_botdlg dd     \
  656.   1,btn.close_main_window ,\
  657.   20001,btn.bot.cancel    ,\
  658.   20002,btn.bot.opensave  ,\
  659.   20003,btn.bot.find      ,\
  660.   0
  661.  
  662. add_table:
  663.   times $1A db -$20
  664.   times $25 db -$00
  665.   times $10 db -$20
  666.   times $30 db -$00
  667.   times $10 db -$50
  668.   times $04 db -$00,-$01
  669.   times $08 db -$00
  670.  
  671. s_status dd 0
  672.  
  673. fasm_start:
  674.         dd      7
  675.         dd      0
  676.         dd      fasm_parameters
  677.         dd      0
  678.         dd      0
  679.         db      '/RD/1/DEVELOP/FASM',0
  680. board_start:
  681.         dd      7
  682.         dd      0
  683.         dd      0
  684.         dd      0
  685.         dd      0
  686.         db      '/RD/1/BOARD',0
  687. tinypad_start:
  688.         dd      7
  689.         dd      0
  690.         dd      ?
  691.         dd      0
  692.         dd      0
  693.         db      '/RD/1/TINYPAD',0
  694. docpak_start:
  695.         dd      7
  696.         dd      0
  697.         dd      sysfuncs_param
  698.         dd      0
  699.         dd      0
  700.         db      '/RD/1/DOCPAK',0
  701.  
  702. sz sysfuncs_param,'g',0
  703.  
  704. include 'tp-locale.inc'
  705.  
  706. sz symbols_ex,';?.%"',"'"
  707. sz symbols   ,'#&*\:/<>|{}()[]=+-, '
  708.  
  709. sz ini_sec_window   ,'Window',0
  710. sz ini_window_top   ,'Top',0
  711. sz ini_window_left  ,'Left',0
  712. sz ini_window_right ,'Right',0
  713. sz ini_window_bottom,'Bottom',0
  714.  
  715. TINYPAD_END:     ; end of file
  716.  
  717. self_path rb PATHL
  718.  
  719. ;-----------------------------------------------------------------------------
  720. section @UDATA ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  721. ;-----------------------------------------------------------------------------
  722.  
  723. f_info.length dd ?
  724. f_info.path:
  725.     times PATHL+1 db ?
  726. f_info70 rd 7
  727.  
  728. file_info FILEINFO
  729.  
  730. tab_bar      TABCTL
  731. virtual at tab_bar.Current
  732.   cur_tab      TABITEM
  733. end virtual
  734. virtual at tab_bar.Current.Editor
  735.   cur_editor   EDITOR
  736. end virtual
  737.  
  738. lines.scr     dd ?    ; number of lines on the screen
  739. columns.scr   dd ?    ; number of columns on the screen
  740. top_ofs       dd ?    ; height occupied by top buttons
  741. bot_ofs       dd ?    ; height occupied by bottom buttons
  742.               dw ?
  743. left_ofs      dd ?    ;
  744. __rc          dd ?,?,?,?
  745. copy_count    dd ?    ; number of lines for copying (Ctrl+E)
  746. copy_size     dd ?    ; size of data to copy
  747. s_title.size  dd ?    ; caption length
  748.  
  749. draw_blines   dd ?    ; last line to draw
  750.  
  751. cur_line_len  dd ?
  752. h_popup       dd ?
  753. bot_dlg_handler dd ?
  754.  
  755. sel.begin.x   dd ?
  756. sel.begin.y   dd ?
  757. sel.end.x     dd ?
  758. sel.end.y     dd ?
  759. sel.selected  db ?
  760.  
  761. in_sel        db ?
  762.  
  763. do_not_draw   db ?    ; draw top and bottom buttons?
  764. main_closed   db ?    ; main window closed?
  765. tb_casesen    db ?    ; focused textbox is case-sensitive?
  766.  
  767. align 4
  768. s_fname.size  dd ?
  769. s_fname       rb PATHL+1
  770. align 4
  771. s_search.size dd ?
  772. s_search      rb PATHL+1
  773.  
  774. s_title       rb PATHL+11  ; window caption
  775.  
  776. chr db ?
  777. ext db ?
  778. shi dd ?
  779.  
  780. align 4
  781. cl_3d_normal dd ?
  782. cl_3d_pushed dd ?
  783. cl_3d_outset dd ?
  784. cl_3d_inset  dd ?
  785. cl_3d_grayed dd ?
  786.  
  787. tb_opensave  TBOX
  788. tb_find      TBOX
  789. tb_replace   TBOX
  790. tb_gotorow   TBOX
  791. tb_gotocol   TBOX
  792.  
  793. focused_tb   dd ?
  794.  
  795. key1 rb 256
  796.  
  797. mst  db ?
  798. mst2 db ?
  799. mev  db ?
  800. mouse_captured  db ?
  801. just_from_popup db ?
  802.  
  803. bot_mode db ?
  804.  
  805. align 4
  806.  
  807. bot_dlg_height dd ?
  808. bot_dlg_mode2  db ?
  809.  
  810. temp_buf dd ?
  811. copy_buf dd ?
  812.  
  813. ;-----------------------------------------------------------------------------
  814. section @PARAMS ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  815. ;-----------------------------------------------------------------------------
  816.  
  817. fasm_parameters:
  818.  
  819. p_info  process_information
  820. p_info2 process_information
  821. sc      system_colors
  822.  
  823. ;store dword '/hd/' at tb_opensave.text+4*0
  824. ;store dword '1/tp' at tb_opensave.text+4*1
  825. ;store dword 'ad4/' at tb_opensave.text+4*2
  826. ;store dword 'tiny' at tb_opensave.text+4*3
  827. ;store dword 'pad.' at tb_opensave.text+4*4
  828. ;store dword 'asm'  at tb_opensave.text+4*5
  829. ;store byte  23     at tb_opensave.length
  830.  
  831. ;rb 1024*36
  832. rb 1024*4
  833. MAIN_STACK:
  834. rb 1024*4
  835. POPUP_STACK:
  836.  
  837. STATIC_MEM_END:
  838.  
  839. diff10 'Main memory size',0,$
  840.