flat assembler
Message board for the users of flat assembler.
Index
> IDE Development > "Fresh" after some radical rebuild... Goto page Previous 1, 2, 3 Next |
Author |
|
JohnFound 30 Jul 2003, 16:19
So, here are the source files for Fresh. So, don't laugh at me. It's just the begin.
You will need my StrLib. I will atach it here. Place files from StrLib in "%include%/StrLib/" directory (or you will need to change paths in source files of Fresh). [EDIT] Outdated version of Fresh 1.0 is removed [/EDIT] See: http://board.flatassembler.net/topic.php?t=144 for the last version. Enjoy: Last edited by JohnFound on 02 Aug 2003, 11:12; edited 2 times in total |
|||
30 Jul 2003, 16:19 |
|
Blag 31 Jul 2003, 07:20
Hi John Found:
As i promised....i have tested FRESH on my WinXP....and guess what??? No errors or exceptions when i press the "X" to close the program The only bug, i have found (And it's not necessarily a bug - sorry my bad english ), is that when i make a new form, i can modify it's size, but as soon as it lost it's focus....i can't do it anymore......well, i just test all the controls....all the resizes and everything is OK! Thanx a lot for the source codes....i kinda not understand a little bit but it great to look at them and realize, that they're wonderfull piece of code. I hope i can help you someday, keep on! |
|||
31 Jul 2003, 07:20 |
|
RobotBob 01 Aug 2003, 02:54
Quote:
your english is fine, better than some native speakers lol. |
|||
01 Aug 2003, 02:54 |
|
Blag 01 Aug 2003, 06:03
Thanx a lot RobotBob
I try to do my best. |
|||
01 Aug 2003, 06:03 |
|
scientica 01 Aug 2003, 08:45
JohnFound wrote: Maybe this will attract some potential volunteers to help with the project. Because I really need help with this project, it's too big for one programmer. I can't promiss you that I'll be able to provide help on a regular basis, but to day I got some time over and decided to play a little with you'r sources (I hope you don't mind ). What I've done is add the lines below (at the line specified, the line number is from the original sources unless others is wirtten, sometimes unmodyfied code is include to ease teh finding of the lines (if I made some digit typo)). So, what medival surgery and rites have I performed on the poor sources? I've tried to get the X-button-hides-window working (and un-hiding the window when the form is selected in the proj. manager, I just can't get IsWindowVisible to work, herefore those lines are commented out) When I use the IsWindowVisible-testing lines the hiden window won't show (it's resizers does however, perhaps the IsWindowVisible (when it works) should be somewhere in the begining of ProjManProc .selectitem, to prevent them from showing when the window is hidden) Code: projmanager.asm (line 109, after ProjManProc.showsizers): .showsizers: invoke ShowWindow, [esi+TBaseWin.SizerLU], ebx invoke ShowWindow, [esi+TBaseWin.SizerL], ebx invoke ShowWindow, [esi+TBaseWin.SizerLD], ebx invoke ShowWindow, [esi+TBaseWin.SizerU], ebx invoke ShowWindow, [esi+TBaseWin.SizerD], ebx invoke ShowWindow, [esi+TBaseWin.SizerRU], ebx invoke ShowWindow, [esi+TBaseWin.SizerR], ebx invoke ShowWindow, [esi+TBaseWin.SizerRD], ebx invoke SendMessage, [hProjTree], TVM_SELECTITEM, TVGN_CARET, [esi+TBaseWin.tvItem] ; Set selected item bold. mov [.tvi.item.stateMask], TVIS_BOLD mov [.tvi.item.mask], TVIF_STATE push [esi+TBaseWin.tvItem] pop [.tvi.item.hItem] lea eax, [.tvi.item] invoke SendMessage, [hProjTree], TVM_SETITEM, 0, eax ;--- scientica: ;assuming titForm is the image number too... push edi sub esp, sizeof.TVITEM mov edi, esp push [esi+TBaseWin.tvItem] pop [edi+TVITEM.hItem] mov [edi+TVITEM.mask], TVIF_IMAGE or TVIF_PARAM lea eax, [edi] invoke SendMessage, [hProjTree], TVM_GETITEM, 0, eax ;test eax, eax ;jz .error ; TODO: add error code mov eax, [edi+TVITEM.iImage] cmp eax, titForm+1 jz byte .not_titForm ; invoke IsWindowVisible, [esi+TBaseWin.hwnd] ; don't work for me :/ ; jnz byte .Visible invoke ShowWindow,[esi+TBaseWin.hwnd],SW_RESTORE .Visible: .not_titForm: add esp, sizeof.TVITEM pop edi ;--- jmp .qfalse Code: formclass.asm (line 44, FormWindowProc): cmp eax, WM_SETFONT je .setfont cmp eax, WM_CLOSE ; scientica je .dontclose ; scientica .default: invoke DefWindowProc, [hwnd],[wmsg],[wparam],[lparam] jmp .finish ;----- WM_CLOSE ------------------------------ ; Hide window instead of closing it. .dontclose: ; scientica invoke ShowWindow, [hwnd],SW_HIDE xor eax,eax jmp .finish ;----- WM_SETFONT ---------------------------- last minute "bug", when the window that's to be hiden via the X-button is already selected in teh project manager it will show again when an other form is selected. solution: Select some other item in the list project treeview and then hit the windows X-button (selecting the window in the project manager un-hides the window). _________________ ... a professor saying: "use this proprietary software to learn computer science" is the same as English professor handing you a copy of Shakespeare and saying: "use this book to learn Shakespeare without opening the book itself. - Bradley Kuhn |
|||
01 Aug 2003, 08:45 |
|
JohnFound 01 Aug 2003, 09:08
Thank you Scientica. I will implement your sources as soon as possible. Maybe with some edition . For example: Why to play around "sub esp, sizeof.TVITEM " when you can use local variable.
BTW: I fix [X] button problem, making the windows not to close at all. But your approach is better. Thanks. I have a question about whole design of Fresh. Do you like current look. Because I think about making Fresh in one window. See the attachement. In the center will be source editor. What is better in your opininon. (Other members opinions are welcome too ) Regards. John Found [EDIT]Outdated picture attachement removed.[/EDIT] Last edited by JohnFound on 22 Sep 2003, 09:02; edited 1 time in total |
|||
01 Aug 2003, 09:08 |
|
Tommy 01 Aug 2003, 09:16
Hi JohnFound!
I prefer to have everything in one window (as in FasmW).. Keep up the good work! Your tool seems to be very good and handy! So long! Take care! Regards, Tommy |
|||
01 Aug 2003, 09:16 |
|
scientica 01 Aug 2003, 10:17
JohnFound wrote: Why to play around "sub esp, sizeof.TVITEM " when you can use local variable. Saving stack space, we don't live in a world of unlimited resources and by dynamically allocate the "locals" (what I'm doing is basically to create a local, but it's placed within the "procedure frame space"), and it's also a very quick way of keeping track of which locals are used and which are just dead code (left overs after some test, my older sources are rather full of them ) I use this technique a lot now days, it allows me to quickly allocte a small amount of memory with out needing to allocate a whole 4 kb page wiht some API, this method means, no API overhead. Quote: I have a question about whole design of Fresh. Do you like current look. Because I think about making Fresh in one window. See the attachement. In the center will be source editor. What is better in your opininon. I prefer the multi window approach, since it (could) enables one to hide (close) some of the unsused tool windows, and to move around them freely so I can have clear overview of the project, or move a window that is "in the way". fasmw, well IMO that an other kind of app, "only" a window with tabs, a menu and a workspace/writing area, Fresh however, forms, menu icon bar, project manager _window_, style _window_. Some might like to have the proj. mngr. at the bottom of the screen the style window to the right of the screen and the "main" window on the top, not easy to do if all tool windows were one big window. _________________ ... a professor saying: "use this proprietary software to learn computer science" is the same as English professor handing you a copy of Shakespeare and saying: "use this book to learn Shakespeare without opening the book itself. - Bradley Kuhn |
|||
01 Aug 2003, 10:17 |
|
JohnFound 01 Aug 2003, 10:44
scientica wrote: Saving stack space, we don't live in a world of unlimited resources and by dynamically allocate the "locals" (what I'm doing is basically to create a local, but it's placed within the "procedure frame space"), and it's also a very quick way of keeping track of which locals are used and which are just dead code (left overs after some test, my older sources are rather full of them ) Some misunderstood maybe. I am not talking about API memory allocation. I am talking about the same stack frame, but using "local" definitions: ( see stdcall.inc for details ) The advantage is that you have label names and you still can use the stack. Code: proc MyProc, arg1, arg2, arg2 .local1 dd ? ; when you declare variables here, between "proc" and "enter" they becomes local (refered by [bp-??]) .local2 dd ? ; they are defined in the stack enter ; ... some code return About Fresh look/behaviout. I simply don't know. I think about making some Drag&Dock engine to allow users to dock the windows where they want. But let wait a little for more opinions. Regards |
|||
01 Aug 2003, 10:44 |
|
scientica 01 Aug 2003, 11:04
JohnFound wrote:
The only difference with "mine" locals (compared to "real") are that they are added after the enter macro. If you wan't some name/label for "my" locals it easy done like this: Code: sub esp, sizeof.RECT mov ebx, esp virtual at ebx .rect RECT end virtual ... add esp, sizeof.RECT btw, teh real loacals are referenced by [ebp-#] Code: you example would look like this after enter macro: ESP+24 EBP+16 ; arg3 ESP+20 EBP+12 ; arg2 ESP+16 EBP+8 ; arg1 ESP+12 EBP+4 ; return address ESP+8 EBP ; saved ebp ESP+4 EBP-4 ; local 0 ESP EBP-8 ; local 1 what I'm doint is simply to add a local at the stack. Thus if I "allocate" a dword like this: sub esp,4 mov ebx, esp the stack look like this: ESP+28 EBP+16 ; arg3 ESP+24 EBP+12 ; arg2 ESP+20 EBP+8 ; arg1 ESP+16 EBP+4 ; return address ESP+12 EBP ; saved ebp ESP+8 EBP-4 ; local 0 ESP+4 EBP-8 ; local 1 ESP EBP-12 ; <--- my just "allocated" dword ---> add esp,4 the stack look like this after above: ESP+24 EBP+16 ; arg3 ESP+20 EBP+12 ; arg2 ESP+16 EBP+8 ; arg1 ESP+12 EBP+4 ; return address ESP+8 EBP ; saved ebp ESP+4 EBP-4 ; local 0 ESP EBP-8 ; local 1 _________________ ... a professor saying: "use this proprietary software to learn computer science" is the same as English professor handing you a copy of Shakespeare and saying: "use this book to learn Shakespeare without opening the book itself. - Bradley Kuhn |
|||
01 Aug 2003, 11:04 |
|
JohnFound 01 Aug 2003, 11:40
Yea, that is the same I want to say. I am agree. But, this is the point of individual style.
BTW, what you think about Drag&Dock behaviour. I hope you understand what I mean. This is when you can drag the window near the border of some other window (dock site) and draged window becomes child of the dock site window. Then you can drag the caption of the window and undock it as separate window. When the window is docked, you have visible splitters to resize it. |
|||
01 Aug 2003, 11:40 |
|
scientica 01 Aug 2003, 11:55
JohnFound wrote: BTW, what you think about Drag&Dock behaviour. I hope you understand what I mean. This is when you can drag the window near the border of some other window (dock site) and draged window becomes child of the dock site window. Then you can drag the caption of the window and undock it as separate window. When the window is docked, you have visible splitters to resize it. It sounds like the kind of stuff I'd put in version 2 or "Fresh XP" version, it sounds like too much cooding for the first version, but yeah, that would be usefull/cool, but as I said, too much coding for a first version. I think priority should be set on getting the app to to what it's supposed to do, the non-form.design-GUI stuff is a later head ace _________________ ... a professor saying: "use this proprietary software to learn computer science" is the same as English professor handing you a copy of Shakespeare and saying: "use this book to learn Shakespeare without opening the book itself. - Bradley Kuhn |
|||
01 Aug 2003, 11:55 |
|
JohnFound 01 Aug 2003, 12:59
scientica wrote: It sounds like the kind of stuff I'd put in version 2 or "Fresh XP" version, it sounds like too much cooding for the first version, but yeah, that would be usefull/cool, but as I said, too much coding for a first version. I think priority should be set on getting the app to to what it's supposed to do, the non-form.design-GUI stuff is a later head ace Yea, (unfortunately) you are right. Sometimes I have a leaning to improve user interface more than it's necessary on the current stage. OK. End variant for version 1 will be with separate windows. Version 2 - feature to dock the separate windows as childs to the source edit window. Now I will take the text editor. (I intend to use Privalov's AsmEdit, but I must understand how it works ) Scientica, do you want to take "styles editor". It's very important, but I can't make it just now. This is the window opened when button beside "Style" or "ExStyle" edit windows is pressed. The common idea is to use ListView with check boxes to edit window Styles/ExStyles. If someone else want to write this or any other part of Fresh, please just post a message, to avoid double work. Regards |
|||
01 Aug 2003, 12:59 |
|
scientica 01 Aug 2003, 13:08
JohnFound wrote: Yea, (unfortunately) you are right. Sometimes I have a leaning to improve user interface more than it's necessary on the current stage. OK. Here's a secret: I tend to do so sometime too, that's what kills my projects JohnFound wrote: Scientica, do you want to take "styles editor". It's very important, but I can't make it just now. This is the window opened when button beside "Style" or "ExStyle" edit windows is pressed. The common idea is to use ListView with check boxes to edit window Styles/ExStyles. I'll see what I can do. [EDIT]Hmm, some comments look like greek (bulgarian?) to me (the font I use has mapped greek chars and some math "chars") Could you please translate these lines: \; Òîâà å Ãîìåð Ãà âèäà Ãà áóòîÃà à ÃÃ¥ Ã¥ áèòîâà ìà ñêà \; Òîâà âå÷å Ã¥ áèòîâà ìà ñêà . [/EDIT] _________________ ... a professor saying: "use this proprietary software to learn computer science" is the same as English professor handing you a copy of Shakespeare and saying: "use this book to learn Shakespeare without opening the book itself. - Bradley Kuhn |
|||
01 Aug 2003, 13:08 |
|
JohnFound 01 Aug 2003, 14:49
scientica wrote:
This is not a Greek, it's Cyrillic. You must switch to win-1251 to see them corectly. (try in the browser) I translate these comments. Here is the fixed file. But, this is only very very very raw draft. These data structures by the idea are description of the acceptable styles for every separate class. But they not work at all now. [EDIT]Outdated attachement removed. There must be newer version. possibly in another thread.[/EDIT] Last edited by JohnFound on 22 Sep 2003, 09:04; edited 1 time in total |
|||
01 Aug 2003, 14:49 |
|
scientica 01 Aug 2003, 16:00
I've made some major (or minor, don't know what to calss it as) changes to the WinStyle struct/macro, the bindedMask is replaced with _dsc (description). I'm currently debugging the code (the last column doesn't work when I fixed so that the other two column display data, I'll post the file as soon as I've gotten teh alst column to display the data correctly, which is soon I hope
[offtopic]btw, I don't know if it's international, but when something look like jibberish (even though one know it has some real meaning), it said that it looks like greek, thus there was an attempt to be a little pun there. /me, no comedian so you don't have to laught [/offtopic] _________________ ... a professor saying: "use this proprietary software to learn computer science" is the same as English professor handing you a copy of Shakespeare and saying: "use this book to learn Shakespeare without opening the book itself. - Bradley Kuhn |
|||
01 Aug 2003, 16:00 |
|
JohnFound 01 Aug 2003, 16:13
scientica wrote: I've made some major (or minor, don't know what to calss it as) changes to the WinStyle struct/macro, the bindedMask is replaced with _dsc (description). I'm currently debugging the code (the last column doesn't work when I fixed so that the other two column display data, I'll post the file as soon as I've gotten teh alst column to display the data correctly, which is soon I hope 1. Feel free to make any changes you want. It was just a 10-minutes draft. only idea is to have list of right styles maybe with short comments about any ot them. 2. Some wrapper function will be great: Code: proc EditStyle, style, flags, ...whatever you need... return edited/not edited style - depending how the user exit the window. 3. offtopic: I was afraid for a moment that you may think bulgarians writes using all these horrible letters. |
|||
01 Aug 2003, 16:13 |
|
scientica 01 Aug 2003, 16:34
JohnFound wrote: 3. offtopic: I was afraid for a moment that you may think bulgarians writes using all these horrible letters. I didn't _know_ Bulgarian uses cyrillic, but I _thought_ you use it, now I _know_ you use it Here's a work copy (+1 hour draft ), I zipped it and included teh fresh compiled with it. I'll make some more equates and put them in the beginning of the file or styleedit.inc. It's safe to assume that all contolls use the common window style, shall I assume WS_EX_ styles always present too? [EDIT] Oops forgot to attach the files, here it is:[/EDIT] [EDIT2]---Deleted obsolete attacment---[/EDIT2] _________________ ... a professor saying: "use this proprietary software to learn computer science" is the same as English professor handing you a copy of Shakespeare and saying: "use this book to learn Shakespeare without opening the book itself. - Bradley Kuhn Last edited by scientica on 01 Aug 2003, 18:05; edited 1 time in total |
|||
01 Aug 2003, 16:34 |
|
JohnFound 01 Aug 2003, 16:58
Looks very good. With some notes:
1. You don't need to compute the length of description. Simply compute the length in compile time and put it in the field before description string. Code: ; I am talking about this part. invoke lstrlen, esi mov ebx, eax inc ebx 2. In strutils.asm there are two procedures: NumToStr and NumToStrU that I use very often to convert numbers to hex (or any other radix). Well, keep good working. I must go off-line. |
|||
01 Aug 2003, 16:58 |
|
Goto page Previous 1, 2, 3 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.