WikiPad

Check-in [01f69714ef]
Login

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

Overview
Comment:Fixed the title bar filename update - now it does not blink. Fixed "modified status" in AsmEdit.
Timelines: family | ancestors | trunk
Files: files | file ages | folders
SHA1:01f69714ef65163ef0ac52a0379145c9b5757ca6
User & Date: JohnFound 2011-04-10 06:40:35
Context
2011-04-10
06:40
Fixed the title bar filename update - now it does not blink. Fixed "modified status" in AsmEdit. Leaf check-in: 01f69714ef user: JohnFound tags: trunk
2011-04-08
13:50
Uses AsmEdit for the text editing. Opens the file specified in the command line. On exit save the current configuration of the shortcuts. Can insert multiline texts. New icon to be used for .wiki document association. check-in: 93562586dc user: lhmnai0 tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to MainForm.frm.

1
2
3
4
5
6
7
8
9
;<ff
Window Form1, 3, 0, 'TForm', 'Wiki editor:', $16CF0000, $10000, 0, 516, 476, 550, 409, Form1WinProc;
Window NONE, 0, 1, 'LISTBOX', 'Listbox', $508105C3, $200, 200, 0, 0, 120, 382, 0;
Window NONE, 2, 5, 'ASMEDIT', '', $50300124, $200, 100, 120, 0, 422, 382, EditWinProc;
;ff>
idEdit = 100
idShortcuts = 200

cEditorFontFace text 'FreshBold'

|







1
2
3
4
5
6
7
8
9
;<ff
Window Form1, 3, 0, 'TForm', 'Wiki editor:', $16CF0000, $10000, 0, 200, 93, 550, 409, Form1WinProc;
Window NONE, 0, 1, 'LISTBOX', 'Listbox', $508105C3, $200, 200, 0, 0, 120, 382, 0;
Window NONE, 2, 5, 'ASMEDIT', '', $50300124, $200, 100, 120, 0, 422, 382, EditWinProc;
;ff>
idEdit = 100
idShortcuts = 200

cEditorFontFace text 'FreshBold'

Changes to WikiPad.exe.

cannot compute difference between binary files

Changes to actions.asm.

1
2
3
4


5
6
7
8
9
10
11
..
67
68
69
70
71
72
73





74

75
76
77
78
79
80
81
..
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
...
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127

128
129
130
131
132
133
134
...
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
...
185
186
187
188
189
190
191

192
193
194
195
196
197
198
...
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
...
272
273
274
275
276
277
278

279
280
281
282
283
284
285
ImageChecked = 8

uglobal
  hLoadedFilename dd ?


endg



iglobal

ActionList MainActionList, MainAccels,                                                                             \
................................................................................
  bfSeparator, NONE
endg



proc OnIdle
begin





        stdcall UpdateTitle

        return
endp




proc OnExit, .wparam, .lparam
................................................................................
        stdcall StrDup, [hAppPath]
        push    eax
        stdcall StrCat, eax, cDefaultShortcuts
        stdcall SaveShortcuts, eax
        stdcall StrDel ; from the stack

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

.exit:
        invoke  PostQuitMessage, 0
        return

................................................................................
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     [hLoadedFilename], 0
        je      @f

        stdcall StrCat, ebx, [hLoadedFilename]

@@:
        invoke  SendMessage, [hEditor], EM_GETMODIFY, 0, 0
        test    eax, eax
        jz      @f
        stdcall StrCat, ebx, cModified
@@:
        stdcall StrPtr, ebx
        invoke  SendMessage, [hMainForm], WM_SETTEXT, 0, eax
        stdcall StrDel, ebx
................................................................................
; TODO: Check for 256 chars boundaries and split the lines in this case.
;

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


        stdcall StrNew
        mov     [.src], eax

        stdcall LoadBinaryFile, [.name]
        mov     esi, eax
        push    eax
................................................................................
        stdcall StrPtr, eax
        mov     ecx, eax
        stdcall StrPtr, [hLoadedFilename]
        stdcall SaveBinaryFile, eax, ecx, [ecx+string.len]

        stdcall StrDel ; from the stack.

        invoke  SendMessage, [hEditor], EM_SETMODIFY, 0, 0

.nosave:
        return
endp



................................................................................
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




>
>







 







>
>
>
>
>
|
>







 







|







 







|







>







 







|







 







>







 







|







 







>







1
2
3
4
5
6
7
8
9
10
11
12
13
..
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
..
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
...
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
...
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
...
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
...
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
...
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
ImageChecked = 8

uglobal
  hLoadedFilename dd ?

  fLastModified dd ?
endg



iglobal

ActionList MainActionList, MainAccels,                                                                             \
................................................................................
  bfSeparator, NONE
endg



proc OnIdle
begin
        invoke  SendMessage, [hEditor], AEM_GETMODIFIED, 0, 0
        xchg    eax, [fLastModified]
        cmp     eax, [fLastModified]
        je      .finish

        call    UpdateTitle
.finish:
        return
endp




proc OnExit, .wparam, .lparam
................................................................................
        stdcall StrDup, [hAppPath]
        push    eax
        stdcall StrCat, eax, cDefaultShortcuts
        stdcall SaveShortcuts, eax
        stdcall StrDel ; from the stack

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

.exit:
        invoke  PostQuitMessage, 0
        return

................................................................................
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], AEM_GETMODIFIED, 0, 0
        test    eax, eax
        jnz     .nonew

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

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

................................................................................

        cmp     [hLoadedFilename], 0
        je      @f

        stdcall StrCat, ebx, [hLoadedFilename]

@@:
        invoke  SendMessage, [hEditor], AEM_GETMODIFIED, 0, 0
        test    eax, eax
        jz      @f
        stdcall StrCat, ebx, cModified
@@:
        stdcall StrPtr, ebx
        invoke  SendMessage, [hMainForm], WM_SETTEXT, 0, eax
        stdcall StrDel, ebx
................................................................................
; TODO: Check for 256 chars boundaries and split the lines in this case.
;

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

        stdcall StrNew
        mov     [.src], eax

        stdcall LoadBinaryFile, [.name]
        mov     esi, eax
        push    eax
................................................................................
        stdcall StrPtr, eax
        mov     ecx, eax
        stdcall StrPtr, [hLoadedFilename]
        stdcall SaveBinaryFile, eax, ecx, [ecx+string.len]

        stdcall StrDel ; from the stack.

        invoke  SendMessage, [hEditor], AEM_SETMODIFIED, 0, 0

.nosave:
        return
endp



................................................................................
begin
        stdcall SaveFileDialog, cSaveFileTitle, WikiFilter, [hLoadedFilename]
        test    eax, eax
        jz      .exit

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

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

Changes to wikipad.cfg.

cannot compute difference between binary files