flat assembler
Message board for the users of flat assembler.

Index > IDE Development > Using AsmEdit

Author
Thread Post new topic Reply to topic
Crukko



Joined: 26 Nov 2005
Posts: 118
Crukko 07 Dec 2005, 10:34
I think these information can be helpfull for everyone Cool
Thx decard!

1. How to Use AsmEdit

You have three options:

i. Standard AsmEdit control, from DLL (easiest Wink): search this forum for latest AsmEdit control in DLL (may require updating control's core to latest files, but don't worry about it), then in your program: load this DLL, call RegisterAsmEditClass function, and from now you can use AsmEdit in a similar way you use standard Edit (create window of 'ASMEDIT' class).

ii. Standard AsmEdit control, compiled with your project (recommended): get latest FASMW, all files from \source\ide directory (but from \source\ide\fasmw copy only asmedit.inc and asmedit.ash). Then include asmedit.ash and asmedit.inc in your source. Add this code in the beginning (initialization part):

Code:
invoke LoadCursor,0,IDC_IBEAM
mov [wc.hCursor],eax
mov [wc.style],CS_GLOBALCLASS+CS_DBLCLKS
mov [wc.lpfnWndProc],AsmEdit
mov eax,[hinstance]
mov [wc.hInstance],eax
mov [wc.cbWndExtra],4
xor eax,eax
mov [wc.hbrBackground],eax
mov [wc.cbClsExtra],eax
mov [wc.lpszMenuName],eax
mov [wc.lpszClassName],_asmedit_class
invoke RegisterClass,wc


This will register asmedit. Don't forget to define _asmedit_class string.
Now you can use this conrol just like in first paragraph.

iii. AsmEdit control from Fresh: more difficult, as this control is more complex (has margin, supports bookmarks, themes...). You have to proceed like in ii., but there are more things to do when initializing AsmEdit: you have to provide bookmark and other icons (AEM_SETICONS message), set theme (AEM_SETTHEME)... and it requires Fresh macro library (uglobal macro).

Of sourse I didn't described every detail, if you will have any problems then feel free to ask.

Proably in each case you would want to set some different font after creating AsmEdit control. I'd recommend starting with ii., you have FASMW source as an example.

regards,
decard
Post 07 Dec 2005, 10:34
View user's profile Send private message Reply with quote
Crukko



Joined: 26 Nov 2005
Posts: 118
Crukko 07 Dec 2005, 10:36
I verified we need these other

_asmedit_class db 'ASMEDIT',0
asmedit_font dd 0
whell_scroll_lines dd 3
case_table rb 100h
Post 07 Dec 2005, 10:36
View user's profile Send private message Reply with quote
Crukko



Joined: 26 Nov 2005
Posts: 118
Crukko 07 Dec 2005, 11:03
Problem: when using AEM_GETLINE
I don't know why...with

invoke SendMessage, [hAsmEditwin], AEM_GETLINE, dword 6, Buff

if the source line .6 is 'test', in Buff I find 'est'.
I verified: line 499 in 'BLOCKS.INC'
lea esi,[esi+SEGMENT_HEADER_LENGTH+edx]
edx is set '1'....

solution? what's wrong?
Post 07 Dec 2005, 11:03
View user's profile Send private message Reply with quote
Crukko



Joined: 26 Nov 2005
Posts: 118
Crukko 08 Dec 2005, 12:23
How to obtain the total line number of the source code loaded in AsmEdit?
Post 08 Dec 2005, 12:23
View user's profile Send private message Reply with quote
decard



Joined: 11 Sep 2003
Posts: 1092
Location: Poland
decard 08 Dec 2005, 14:16
You can't do it directly (currently there's no such message). You have to:

1. Store current position (AEM_GETPOS).
2. go to last line (AEM_SETPOS with caretLine and caretSelectionLine set to -1).
3. Read current position (AEM_GETPOS again). Then read aepos.caretLine - it will contain last line number.
4. Restore previous position by calling AEM_SETPOS again with position obtained in 1).

regards,
decard
Post 08 Dec 2005, 14:16
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.