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