Subversion Repositories Kolibri OS

Rev

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