flat assembler
Message board for the users of flat assembler.

Index > IDE Development > append full path to FasmW IDE program title

Author
Thread Post new topic Reply to topic
MCD



Joined: 21 Aug 2004
Posts: 602
Location: Germany
MCD 26 Apr 2005, 14:18
Okay, I finally got another stuff for FASMW now, which Privalov agreed to add earlier in a PM. Here it goes.

It will make FASMW append the full path of the currently selected file in the file tab control on the bottom to its program title. Thus you don't need to open the save as dialog each time you want to see where your file is actually located. An implementation description follows.

in "FASMW.ASM":
------------

Main window message handler

Old:
----
Code:
fmselect:
        mov     [ei.header.mask],TCIF_PARAM
        invoke  SendMessage,[hwnd_tabctrl],TCM_GETITEM,[wparam],ei
        invoke  GetWindowLong,[hwnd_asmedit],GWL_STYLE
        and     eax,not WS_VISIBLE
        invoke  SetWindowLong,[hwnd_asmedit],GWL_STYLE,eax
        mov     ebx,[ei.hwnd]
        mov     [hwnd_asmedit],ebx
        mov     eax,WS_CHILD+WS_HSCROLL+WS_VSCROLL+ES_NOHIDESEL
        or      eax,[asmedit_style]
        invoke  SetWindowLong,ebx,GWL_STYLE,eax
        invoke  SendMessage,ebx,WM_SETFONT,[hfont],0
        invoke  SendMessage,ebx,AEM_SETTEXTCOLOR,[editor_colors],[editor_colors+4]
        invoke  SendMessage,ebx,AEM_SETSELCOLOR,[editor_colors+8],[editor_colors+12]
        invoke  SendMessage,ebx,AEM_SETSYNTAXHIGHLIGHT,asm_syntax_colors,fasm_syntax
        invoke  SendMessage,ebx,AEM_SETRIGHTCLICKMENU,[hmenu_edit],[hwnd]
        invoke  SendMessage,[hwnd],WM_SIZE,0,0
        invoke  ShowWindow,ebx,SW_SHOW
        invoke  UpdateWindow,ebx
        invoke  SetFocus,[hwnd]
        jmp     finish
    

New:
----
Code:
fmselect:
        mov     [ei.header.mask],TCIF_PARAM
        invoke  SendMessage,[hwnd_tabctrl],TCM_GETITEM,[wparam],ei
        invoke  GetWindowLong,[hwnd_asmedit],GWL_STYLE
        and     eax,not WS_VISIBLE
        invoke  SetWindowLong,[hwnd_asmedit],GWL_STYLE,eax
        mov     ebx,[ei.hwnd]
        mov     [hwnd_asmedit],ebx
        mov     eax,WS_CHILD+WS_HSCROLL+WS_VSCROLL+ES_NOHIDESEL
        or      eax,[asmedit_style]
        invoke  SetWindowLong,ebx,GWL_STYLE,eax
        mov     esi,_caption            ;start of new code
        mov     edi,string_buffer
        push    edi
      copy_caption:
        lodsb
        stosb
        or      al,al
        jnz     copy_caption
        mov     esi,[ei.pszpath]
        or      esi,esi
        jz      caption_ok
        dec     edi
        mov     eax,' -  '
        stosd
        dec     edi
      append_path_to_caption:
        lodsb
        stosb
        or      al,al
        jnz     append_path_to_caption
      caption_ok:
        invoke  SetWindowText,[hwnd]    ;last new instruction
        invoke  SendMessage,ebx,WM_SETFONT,[hfont],0
        invoke  SendMessage,ebx,AEM_SETTEXTCOLOR,[editor_colors],[editor_colors+4]
        invoke  SendMessage,ebx,AEM_SETSELCOLOR,[editor_colors+8],[editor_colors+12]
        invoke  SendMessage,ebx,AEM_SETSYNTAXHIGHLIGHT,asm_syntax_colors,fasm_syntax
        invoke  SendMessage,ebx,AEM_SETRIGHTCLICKMENU,[hmenu_edit],[hwnd]
        invoke  SendMessage,[hwnd],WM_SIZE,0,0
        invoke  ShowWindow,ebx,SW_SHOW
        invoke  UpdateWindow,ebx
        invoke  SetFocus,[hwnd]
        jmp     finish
    


a bit further down at save_file_as

Old:
----
Code:
        mov     [ei.header.pszText],name_buffer
        mov     [ei.header.mask],TCIF_TEXT+TCIF_PARAM
        invoke  SendMessage,[hwnd_tabctrl],TCM_SETITEM,ebx,ei
        invoke  SendMessage,[hwnd],FM_SAVE,ebx,0
    

New:
----
Code:
        mov     [ei.header.pszText],name_buffer
        mov     [ei.header.mask],TCIF_TEXT+TCIF_PARAM
        invoke  SendMessage,[hwnd_tabctrl],TCM_SETITEM,ebx,ei
        invoke  SendMessage,[hwnd_main],FM_SELECT,ebx,0
        invoke  SendMessage,[hwnd],FM_SAVE,ebx,0
    

Someone just say if he/she doesn't like it.

_________________
MCD - the inevitable return of the Mad Computer Doggy

-||__/
.|+-~
.|| ||
Post 26 Apr 2005, 14:18
View user's profile Send private message Reply with quote
MCD



Joined: 21 Aug 2004
Posts: 602
Location: Germany
MCD 28 Apr 2005, 17:13
no one seems to have any interest in it?
Post 28 Apr 2005, 17:13
View user's profile Send private message Reply with quote
Giedrius



Joined: 13 Feb 2005
Posts: 40
Location: Lithuania
Giedrius 28 Apr 2005, 19:33
You have forgot to say to add SetTextWindow definition. I've added it to line 2787 and it looks like this:

Code:
...
         PostMessage,'PostMessageA',\
         PostQuitMessage,'PostQuitMessage',\
         SetWindowText,'SetWindowTextA' ;my excellent line Razz

  import gdi,\
...    

_________________
Better to rule in hell, than to be a slave in heaven...
Post 28 Apr 2005, 19:33
View user's profile Send private message Reply with quote
MCD



Joined: 21 Aug 2004
Posts: 602
Location: Germany
MCD 02 May 2005, 13:30
Giedrius wrote:
You have forgot to say to add SetTextWindow definition. I've added it to line 2787 and it looks like this:

Code:
...
         PostMessage,'PostMessageA',\
         PostQuitMessage,'PostQuitMessage',\
         SetWindowText,'SetWindowTextA' ;my excellent line Razz

  import gdi,\
...    

yep. I just forgot this. thanks for bugreport Smile

_________________
MCD - the inevitable return of the Mad Computer Doggy

-||__/
.|+-~
.|| ||
Post 02 May 2005, 13:30
View user's profile Send private message 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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.