Subversion Repositories Kolibri OS

Rev

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