WikiPad

Check-in [970026b1fd]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:It is almost useful. It misses search and replace, syntax highlight and other things, but allows inserting text really fast.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:970026b1fd6ccdf2e788c54714b608ef580247b4
User & Date: lhmnai0 2011-03-16 14:58:14
Context
2011-04-08
08:41
Implemented AsmEdit as an edit control. Some highlighing added. Work in progress. check-in: 9cbee56b0a user: JohnFound tags: trunk
2011-03-16
14:58
It is almost useful. It misses search and replace, syntax highlight and other things, but allows inserting text really fast. check-in: 970026b1fd user: lhmnai0 tags: trunk
10:43
Small changes adjustments and file ordering in the project directory. Color icons. check-in: 6dc9d825f3 user: lhmnai0 tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to MainForm.frm.

216
217
218
219
220
221
222




223
224
225
226
227
228
229
230
231
232
233

        invoke  CreateFont, -13, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, RUSSIAN_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, PROOF_QUALITY, FIXED_PITCH or FF_DONTCARE, cEditorFontFace
        mov     [hEditorFont], eax
        invoke  SendMessage, [.hwnd], WM_SETFONT, [hEditorFont], 1
        clc
        return





onmessage WM_DESTROY
        invoke  DeleteObject, [hEditorFont]
        clc
        return

endwp












>
>
>
>











216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237

        invoke  CreateFont, -13, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, RUSSIAN_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, PROOF_QUALITY, FIXED_PITCH or FF_DONTCARE, cEditorFontFace
        mov     [hEditorFont], eax
        invoke  SendMessage, [.hwnd], WM_SETFONT, [hEditorFont], 1
        clc
        return

onmessage WM_SETFOCUS
        invoke  SetProp, [.hwnd], [propIgnoreNext], 0
        jmp     .ondefault

onmessage WM_DESTROY
        invoke  DeleteObject, [hEditorFont]
        clc
        return

endwp





Changes to ShortcutEngine.asm.

30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
...
225
226
227
228
229
230
231



232








































233
234
235
236
237
238


























239
240
241
242
243
244
245

        stdcall StrPtr, [esi+TShortcutItem.hCloseTag]
        invoke  SendMessage, [hEditor], EM_REPLACESEL, TRUE, eax

        invoke  SendMessage, [hEditor], EM_SETSEL, [.beg], [.beg]

        stdcall StrPtr, [esi+TShortcutItem.hOpenTag]
        invoke  SendMessage, [hEditor], EM_REPLACESEL, TRUE, eax

        mov     eax, [.beg]
        cmp     eax, [.end]
        je      .posok

        mov     eax, [.end]
        add     eax, [.ins]
................................................................................
        invoke  DestroyWindow, ebx
        stdcall SetTabstop
        return
endp















































proc OnNewShortcut, .wparam, .lparam
begin
        stdcall OnEditShortcut, [.wparam], -1
        return
endp






























uglobal
  file_buffer rb 1024
endg








|







 







>
>
>
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>






>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
...
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314

        stdcall StrPtr, [esi+TShortcutItem.hCloseTag]
        invoke  SendMessage, [hEditor], EM_REPLACESEL, TRUE, eax

        invoke  SendMessage, [hEditor], EM_SETSEL, [.beg], [.beg]

        stdcall StrPtr, [esi+TShortcutItem.hOpenTag]
        invoke  SendMessage, [hEditor], EM_REPLACESEL, 0, eax

        mov     eax, [.beg]
        cmp     eax, [.end]
        je      .posok

        mov     eax, [.end]
        add     eax, [.ins]
................................................................................
        invoke  DestroyWindow, ebx
        stdcall SetTabstop
        return
endp



;proc ParseString, .hString
;begin
;        push    eax ecx edx esi edi
;
;        stdcall StrPtr, [.hString]
;        mov     esi, eax
;        mov     edi, eax
;
;.loop:
;        mov     al, [esi]
;        inc     esi
;
;        cmp     al, '^'
;        je      .escape
;
;.continue:
;        mov     [edi], al
;        inc     edi
;
;        test    al, al
;        jnz     .loop
;
;        stdcall StrFixLen, [.hString]
;        pop     edi esi edx ecx eax
;        return
;
;.escape:
;        mov     al, [esi]
;        inc     esi
;        cmp     al, '^'
;        je      .continue
;
;        cmp     al, 'A'
;        jb      .continue
;        cmp     al, 'Z'
;        ja      .continue
;        sub     al, $40
;        jmp     .continue
;endp
;




proc OnNewShortcut, .wparam, .lparam
begin
        stdcall OnEditShortcut, [.wparam], -1
        return
endp



proc OnDelShortcut, .wparam, .lparam
begin
        invoke  SendMessage, [hShortcuts], LB_GETCARETINDEX, 0, 0
        cmp     eax, LB_ERR
        je      .exit
        mov     ebx, eax

        invoke  SendMessage, [hShortcuts], LB_GETITEMDATA, ebx, 0
        mov     esi, eax
        test    esi, esi
        jz      .nodata

        stdcall StrDel, [esi+TShortcutItem.hCaption]
        stdcall StrDel, [esi+TShortcutItem.hOpenTag]
        stdcall StrDel, [esi+TShortcutItem.hCloseTag]

        stdcall FreeMem, esi

.nodata:
        invoke  SendMessage, [hShortcuts], LB_DELETESTRING, ebx, 0
.exit:
        return
endp




uglobal
  file_buffer rb 1024
endg

Changes to WikiPad.exe.

cannot compute difference between binary files

Changes to actions.asm.

16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
..
74
75
76
77
78
79
80


81




























82
83






84
85
86










87



88

89
90
91
92
93
94
95
...
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
...
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
  actExit,       -1, '&Exit',           <Alt,  'X'>,         'Exit program',               OnExit,              \
\
  actUndo,        3, '&Undo',           <Ctrl, 'Z'>,         'Undo last change',           OnUndo,              \
  actCut ,        4, 'Cu&t',            <Ctrl, 'X'>,         'Cut to clipboard',           OnCut,               \
  actCopy,        5, '&Copy',           <Ctrl, 'C'>,         'Copy to clipboard',          OnCopy,              \
  actPaste,       6, '&Paste',          <Ctrl, 'V'>,         'Paste from clipboard',       OnPaste,             \
\
  actLoadShortcuts, -1, '&Load shortcuts', <NONE>, 'Load shortcuts from a file.',   OnLoadShortcuts,    \
  actSaveShortcuts, -1, '&Save shortcuts', <NONE>, 'Save the shortcuts to a file.', OnSaveShortcuts,  \
  actEditShortcut, -1, '&Edit shortcut',   <NONE>, 'Edit shortcut.',                OnEditShortcut,                   \
  actNewShortcut, -1, '&New shortcut',     <NONE>, 'Add new shortcut.',             OnNewShortcut,                    \
  actDelShortcut, -1, '&Del shortcut',     <NONE>, 'Delete a shortcut.',            OnDelShortcut




CoolMenu MainMenu,                      \
  mfSubmenu, '&File',                   \
    mfNormal, actNew,                   \
................................................................................
        stdcall UpdateTitle
        return
endp



































proc OnNew, .wparam, .lparam
begin






        invoke  SendMessage, [hEditor], WM_SETTEXT, 0, 0
        stdcall StrDel, [hLoadedFilename]
        mov     [hLoadedFilename], 0










        stdcall UpdateTitle



        return

endp





cEditorTitle text 'Wikipad: '
................................................................................
        return
endp

proc _openFileCallback, .name, .lparam
.src dd ?
begin
        stdcall SetString, hLoadedFilename, [.name]
        stdcall UpdateTitle

        stdcall StrNew
        mov     [.src], eax

        stdcall LoadBinaryFile, [.name]
        mov     esi, eax
        push    eax
................................................................................
begin
        stdcall SaveFileDialog, cSaveFileTitle, WikiFilter, [hLoadedFilename]
        test    eax, eax
        jz      .exit

        stdcall SetString, hLoadedFilename, eax
        stdcall StrDel, eax
        stdcall UpdateTitle

        cmp     [.wparam], 1
        je      .exit
        stdcall OnSave, 0, 0
.exit:
        return
endp



proc OnExit, .wparam, .lparam
begin

.check:
        invoke  SendMessage, [hEditor], EM_GETMODIFY, 0, 0
        test    eax, eax
        jnz     .noexit

.exit:
        invoke  PostQuitMessage, 0
        return

.noexit:
        invoke  MessageBox, [hMainForm], cErrorNotSaved, cTitleNotSaved, MB_YESNOCANCEL or MB_ICONQUESTION
        cmp     eax, MR_NO
        je      .exit

        cmp     eax, MR_CANCEL
        je      .finish

        stdcall OnSave, 0, 0
        jmp     .check

.finish:
        return
endp

cErrorNotSaved text 'The current file is not saved. Do you want to save it before exit?',0
cTitleNotSaved text 'Do you want to save?'

proc OnUndo, .wparam, .lparam
begin
        invoke  SendDlgItemMessage, [hMainForm], idEdit, EM_UNDO, 0, 0
        return
endp








|
|
|
|
|







 







>
>

>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>


>
>
>
>
>
>



>
>
>
>
>
>
>
>
>
>
|
>
>
>

>







 







<







 







<










<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
..
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
...
175
176
177
178
179
180
181

182
183
184
185
186
187
188
...
262
263
264
265
266
267
268

269
270
271
272
273
274
275
276
277
278





























279
280
281
282
283
284
285
  actExit,       -1, '&Exit',           <Alt,  'X'>,         'Exit program',               OnExit,              \
\
  actUndo,        3, '&Undo',           <Ctrl, 'Z'>,         'Undo last change',           OnUndo,              \
  actCut ,        4, 'Cu&t',            <Ctrl, 'X'>,         'Cut to clipboard',           OnCut,               \
  actCopy,        5, '&Copy',           <Ctrl, 'C'>,         'Copy to clipboard',          OnCopy,              \
  actPaste,       6, '&Paste',          <Ctrl, 'V'>,         'Paste from clipboard',       OnPaste,             \
\
  actLoadShortcuts, -1, '&Load shortcuts', <Ctrl+Alt, 'L'>, 'Load shortcuts from a file.',   OnLoadShortcuts,    \
  actSaveShortcuts, -1, '&Save shortcuts', <Ctrl+Alt, 'S'>, 'Save the shortcuts to a file.', OnSaveShortcuts,  \
  actEditShortcut, -1, '&Edit shortcut',   <Ctrl+Alt, 'E'>, 'Edit shortcut.',                OnEditShortcut,                   \
  actNewShortcut, -1, '&New shortcut',     <Ctrl+Alt, 'N'>, 'Add new shortcut.',             OnNewShortcut,                    \
  actDelShortcut, -1, '&Del shortcut',     <Ctrl+Alt, 'D'>, 'Delete a shortcut.',            OnDelShortcut




CoolMenu MainMenu,                      \
  mfSubmenu, '&File',                   \
    mfNormal, actNew,                   \
................................................................................
        stdcall UpdateTitle
        return
endp




proc OnExit, .wparam, .lparam
begin

.check:
        invoke  SendMessage, [hEditor], EM_GETMODIFY, 0, 0
        test    eax, eax
        jnz     .noexit

.exit:
        invoke  PostQuitMessage, 0
        return

.noexit:
        invoke  MessageBox, [hMainForm], cErrorNotSaved, cTitleNotSaved, MB_YESNOCANCEL or MB_ICONQUESTION
        cmp     eax, MR_NO
        je      .exit

        cmp     eax, MR_CANCEL
        je      .finish

        stdcall OnSave, 0, 0
        jmp     .check

.finish:
        return
endp

cErrorNotSaved text 'The current file is not saved. Do you want to save it?',0
cTitleNotSaved text 'Do you want to save?'


proc OnNew, .wparam, .lparam
begin
.check:
        invoke  SendMessage, [hEditor], EM_GETMODIFY, 0, 0
        test    eax, eax
        jnz     .nonew

.new:
        invoke  SendMessage, [hEditor], WM_SETTEXT, 0, 0
        stdcall StrDel, [hLoadedFilename]
        mov     [hLoadedFilename], 0
        return

.nonew:
        invoke  MessageBox, [hMainForm], cErrorNotSaved, cTitleNotSaved, MB_YESNOCANCEL or MB_ICONQUESTION
        cmp     eax, MR_NO
        je      .new

        cmp     eax, MR_CANCEL
        je      .finish

        stdcall OnSave, 0, 0
        jmp     .check

.finish:
        return

endp





cEditorTitle text 'Wikipad: '
................................................................................
        return
endp

proc _openFileCallback, .name, .lparam
.src dd ?
begin
        stdcall SetString, hLoadedFilename, [.name]


        stdcall StrNew
        mov     [.src], eax

        stdcall LoadBinaryFile, [.name]
        mov     esi, eax
        push    eax
................................................................................
begin
        stdcall SaveFileDialog, cSaveFileTitle, WikiFilter, [hLoadedFilename]
        test    eax, eax
        jz      .exit

        stdcall SetString, hLoadedFilename, eax
        stdcall StrDel, eax


        cmp     [.wparam], 1
        je      .exit
        stdcall OnSave, 0, 0
.exit:
        return
endp

































proc OnUndo, .wparam, .lparam
begin
        invoke  SendDlgItemMessage, [hMainForm], idEdit, EM_UNDO, 0, 0
        return
endp

Changes to dlgShortcuts.frm.

1
2
3
4
5
6
7
8
9
10
11
12


13
14
15
16
17
18
19
;<ff
Window frmEditShortcuts, 3, 0, 'TForm', 'Edit shortcut', $16480000, $10000, 0, 362, 147, 320, 299, CustomWinProc;
Window NONE, 0, 0, 'EDIT', '', $50010080, $200, 104, 8, 176, 297, 21, 0;
Window NONE, 0, 0, 'EDIT', '', $50010080, $200, 101, 8, 32, 297, 21, 0;
Window NONE, 0, 0, 'STATIC', 'Shortcut key:', $50000000, $0, 0, 8, 160, 64, 16, 0;
Window NONE, 0, 0, 'STATIC', 'Open tag:', $50000000, $0, 0, 8, 64, 64, 16, 0;
Window NONE, 0, 0, 'EDIT', '', $50010080, $200, 102, 8, 80, 297, 21, 0;
Window NONE, 0, 0, 'STATIC', 'Caption:', $50000000, $0, 0, 8, 16, 64, 16, 0;
Window NONE, 0, 0, 'STATIC', 'Close tag:', $50000000, $0, 0, 8, 112, 64, 16, 0;
Window NONE, 0, 0, 'EDIT', '', $50010080, $200, 103, 8, 128, 297, 21, 0;
Window NONE, 0, 0, 'BUTTON', 'OK', $50010000, $0, 1, 88, 232, 64, 25, 0;
Window NONE, 2, 0, 'BUTTON', 'Cancel', $50010000, $0, 2, 160, 232, 64, 25, 0;


;ff>
idCaptionEdit  = 101
idOpenTagEdit  = 102
idCloseTagEdit = 103
idKeyEdit      = 104

idBtnCancel   = MR_CANCEL

|
|
|
|
|
<
|
|
<
|
|
>
>







1
2
3
4
5
6

7
8

9
10
11
12
13
14
15
16
17
18
19
;<ff
Window frmEditShortcuts, 3, 0, 'TForm', 'Edit shortcut', $16480000, $10001, 0, 362, 147, 384, 353, CustomWinProc;
Window NONE, 0, 0, 'EDIT', '', $50010080, $200, 104, 192, 24, 176, 21, 0;
Window NONE, 0, 0, 'EDIT', '', $50010080, $200, 101, 8, 24, 176, 21, 0;
Window NONE, 0, 0, 'STATIC', 'Shortcut key:', $50000000, $0, 0, 200, 8, 64, 16, 0;
Window NONE, 0, 0, 'STATIC', 'Open tag:', $50000000, $0, 0, 8, 48, 64, 16, 0;

Window NONE, 0, 0, 'STATIC', 'Caption:', $50000000, $0, 0, 8, 8, 64, 16, 0;
Window NONE, 0, 0, 'STATIC', 'Close tag:', $50000000, $0, 0, 8, 168, 64, 16, 0;

Window NONE, 0, 0, 'BUTTON', 'OK', $50010000, $0, 1, 120, 296, 64, 25, 0;
Window NONE, 0, 0, 'BUTTON', 'Cancel', $50010000, $0, 2, 192, 296, 64, 25, 0;
Window NONE, 0, 0, 'EDIT', '', $503100C4, $200, 103, 8, 184, 360, 104, 0;
Window NONE, 2, 0, 'EDIT', '', $503100C4, $200, 102, 8, 64, 360, 104, 0;
;ff>
idCaptionEdit  = 101
idOpenTagEdit  = 102
idCloseTagEdit = 103
idKeyEdit      = 104

idBtnCancel   = MR_CANCEL

Changes to wikipad.cfg.

cannot compute difference between binary files