• Welcome to PlanetSquires Forums.
 

WinFBE on GitHub (July 2, 2016)

Started by Paul Squires, July 02, 2016, 10:44:21 PM

Previous topic - Next topic

Paul Squires

Lots of changes and improvements in today's commit to github. I did a lot of work on project management and incremental compiling for projects. Projects automatically save all generated object files ( *.o ) that are re-used on subsequent compiles. The datetime of the object file is checked against the source file. If the source file is time stamped later than the object file then the object file is regenerated. On a test of recompiling the FB compiler itself, the intial compile was about 12 seconds. Subsequent compiles reduced to about 1.5 seconds. The system is simple and easy and works very well so far.

As an aside, in FB there is usually more than one source file. Multiple *.bas files compose a project. Each .bas file is compiled into an object file and during the linking process they are combined with the main compiled source file. In our old PB ways, we normally created our applications by having one main source file and everything #Include'd into the main file. In FB all you need to do is include the child .bas object module's header files (*.bi) into the main file so that the main file can resolve references to variables, structures, subs, and functions located in the compiled object files.

Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

José Roca

Tried the 64-bit version. It GPFed when clicking the ListView of the Project Manager.

Paul Squires

Looks like in NM_DBLCLK for listview I did not test for a Null pDoc pointer. Here is the corrected code:


      Case NM_DBLCLK
         ' Load the selected file into the editor
         If id = IDC_FRMPROJECTMANAGER_LISTVIEW Then   
            ' Get the pDoc from the selected row
            Dim pDoc As clsDocument Ptr = Cast( clsDocument Ptr, FF_ListView_GetlParam(nmi->hdr.hwndFrom, nmi->iItem) )
            If pDoc Then
               frmMain_OpenFileSafely(HWND_FRMMAIN, False, False, True, pDoc->DiskFilename, pDoc )
            End If
         End If


I am also reconsidering the folder layout for projects. I am going to simplify it more. I will do that in the morning, Too tired to start it now.
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

José Roca

#3
Also the window is larger than the height of the work area of my monitor. I suggest the following change in frmProjectManager_Show:


   DIM rcWork AS RECT = pWindow->GetWorkArea
   DIM nHeight AS LONG = (rcWork.Bottom - rcWork.Top) - (20 * pWindow->ryRatio)
   HWND_FRMPROJECTMANAGER = _
   pWindow->Create( hWndParent, L(188,"Project Manager"), @frmProjectManager_WndProc, 0, 0, 700, nHeight, _
        WS_POPUP Or WS_CAPTION Or WS_SYSMENU Or WS_THICKFRAME Or WS_CLIPSIBLINGS Or WS_CLIPCHILDREN, _
        WS_EX_CONTROLPARENT Or WS_EX_LEFT Or WS_EX_LTRREADING Or WS_EX_RIGHTSCROLLBAR)
'   pWindow->SetClientSize(400, 500)
   pWindow->Center(pWindow->hWindow, hWndParent)


Make sure that the dialogs aren't larger than the height of the work area. If they need to be, then it's time to use an scrollable window.

For the width choose the one that you prefer, but 400 looks too narrow tho show the paths of the files.

José Roca

And thanks for removing the top most style.

The first thing that I did when it had this style was to change the language and didn't see the expected message because it was behind the top most dialog.

José Roca

I have created a new project and added a file.

Each time that I open this project, it duplicates the same file(s).

The first time, it appears duplicated; the second time, quadruplicated, and so on.

Paul Squires

Quote from: Jose Roca on July 03, 2016, 12:33:03 AM
I have created a new project and added a file.

Each time that I open this project, it duplicates the same file(s).

The first time, it appears duplicated; the second time, quadruplicated, and so on.

That's odd. I have not been able to duplicate that problem. A few days ago i saw something like that occur but I reworked the code a lot since then. Try the latest code in github to see if it is happening? I will keep trying to see if I can recreate the steps that lead to the duplicates being added.
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Paul Squires

Actually, hold off using any of the code in github until I finish changing the directory structure changes for the compiling. Should only be an hour at most. I will post again when everything is changed.
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Paul Squires

Okay, the changes are in github now. I also added a subclass for the Project Management listview in order to catch the ENTER key. This makes it easier to open a file (or multiple files) from the listview when using the keyboard.
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

José Roca

> That's odd. I have not been able to duplicate that problem.

It's very easy to reproduce. Don't use F4 to activate the project manager, but choose "Open Project" from the menu. Each time you open it, the file names are duplicated.

I have created a project and added a file. After opening the project several times, I have ended with what you can see in the capture below.

José Roca

Another thing: When I create a new project, it displays the dialog with the listview, but it doesn't leave you to do anything. You have to close it and select the menu option to add files to the project.

Paul Squires

Thanks Jose, I see the problem with the duplicate files now. I will fix that as soon as I get home tonight. My attempt was to prevent the destruction of the Project Manager window and simply "hide" it whenever someone pressed F4 or clicked on the "X" button. Looks like Alt+F4 or close from the windows command menu destroys it. I need to trap and prevent that behaviour.

When the Project Manager displays, it is a non-modal window. You shouldn't have to close it in order to select options from the Project menu. Maybe I should have a menu or toolbar on the Project Manager window as well.
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Paul Squires

Jose, I have uploaded the changes for the duplicates. I don't think it had anything to do with the Project Manager window itself. I was not totally clearing the IsProjectFile attribute of the loaded pDoc's when a new project was opened.

I have also changed the folder structure for the generate object files ( *.o )for project files. Instead of having two separate folders (obj32, obj64) for the generated obj files, I am now using only one called wfbe_obj. All object files for both 32 and 64 bit are put in that folder (they are differentiated by appending either a 32 or 64 to their names).
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Paul Squires

I uploaded some new code tonight. F9 will now toggle viewing the Compile Results dialog. I am also experimenting with the font quality and anti-aliasing settings just to see if I like the way it looks. If you have any strong opinions of it then please let me know. I have also changed the setting that dictates how selections are visually displayed. Now the entire screen space is filled with the selection highlight rather than just to the end of the line. This is how my other editors looked when full lines were selected so it feels more natural for me. I also increased the pixel width of the caret from 1 pixel to 2 pixels.

I finally got to use the editor today in a real world situation. I am writing a utility that scans source code and generates the .bi header file. It is allowing me to work through how the editor works and how it looks and feels. Getting to use the project management features as well.

One thing that I am having a hard time getting used to is the behaviour of the Ctrl+left arrow key. I am used to using it to eventually stop at the beginning of the line (column 0) no matter if there is a word match or not. In Scintilla, it does not stop at the start of the line but will wrap itself to the previous line(s) until a beginning of word match is found. That is going to take some time for me to get used to. I often use Ctrl+left arrow rather than the HOME key to position to column 0.

Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

José Roca

Since I use the Consolas font (more readable than Courier New) I don't think that antialiasing will make a noticeable difference.

Scintilla passes the value down to the platform as lfQuality in the logical font struct for GDI:

SC_EFF_QUALITY_DEFAULT -> DEFAULT_QUALITY
SC_EFF_QUALITY_NON_ANTIALIASED -> NONANTIALIASED_QUALITY
SC_EFF_QUALITY_ANTIALIASED -> ANTIALIASED_QUALITY
SC_EFF_QUALITY_LCD_OPTIMIZED -> CLEARTYPE_QUALITY

Its a request. The platform may honour it or ignore it when configured to do so or when it can't because the device or context does not support that choice.