PlanetSquires Forums

Support Forums => PlanetSquires Software => Topic started by: Paul Squires on December 06, 2016, 08:02:28 PM

Title: WinFBE on GitHub (December 6, 2016)
Post by: Paul Squires on December 06, 2016, 08:02:28 PM
I also created a "Release" on GitHub for this 1.1.0 version. My first time doing that. It is pretty cool because it allows for a snapshot of all code and binaries at that specific point in time should we ever need to test the code at some point in the future.

Version 1.1.0 (December 6, 2016)
- Added: Subfolder called "Sample_Projects" containing many sample projects as written by Jose Roca.
- Added: StatusBar panel 5 shows current compile results (Errors/Warnings). Clicking that panel shows/hide Output window.
- Added: Change cursor to hourglass during compile process.
- Changed: Project files are now saved to the project file as relative to the project disk filename (*.wfbe).
- Changed: Updated the Scintilla 32-bit DLL to version 3.7.1.
- Fixed: Situation where newly created untitled source filename could be saved to a project file (*.wfbe).
- Fixed: Correct font for Compiler Log output to be HighDPI aware.
- Fixed: Dropping of files onto editor (frmMain_OnDropFiles) now correctly opens regular files or projects.
- Fixed: Problem with "Untitled.bas*" files persisting in Project Explorer list even when untitled source file is closed.
- Fixed: Situation where removing/closing a file would continue to show its list of functions in the popup Function List.
Title: Re: WinFBE on GitHub (December 6, 2016)
Post by: José Roca on December 11, 2016, 02:17:25 AM
CULNG is missing in the list of keywords. Also CULNGINT.
Title: Re: WinFBE on GitHub (December 6, 2016)
Post by: Paul Squires on December 11, 2016, 05:34:34 PM
Thanks Jose - added now to GitHub.
Title: Re: WinFBE on GitHub (December 6, 2016)
Post by: José Roca on December 11, 2016, 08:23:19 PM
Currently, Ctrl+W is doing the same as Ctrl+Q, i.e. closing the current tab. I suggest to use Ctrl+W to switch tabs.
Title: Re: WinFBE on GitHub (December 6, 2016)
Post by: José Roca on December 14, 2016, 05:06:47 AM
Two new projects. A Toolbar inside a rebar and a treeview with imagelist.
Title: Re: WinFBE on GitHub (December 6, 2016)
Post by: José Roca on December 14, 2016, 12:58:09 PM
A new project: RichOleDemo.

Two frequently asked questions are how to load a rich edit text file using the EM_STREAMIN message and how to display images embedded in the file.

This demo implements the wrapper function RichEdit_LoadRtfFromFileW and the IRichEditOleCallback interface.


' ########################################################################################
' Microsoft Windows
' File: RichOleDemo.bas
' Contents: Demonstrates how to load a rich edit text file and how to implement the
' IRichEditOleCallback interface, which allows to display embedded images.
' Compiler: FreeBasic 32 & 64 bit
' Copyright (c) 2016 Jose Roca. Freeware. Use at your own risk.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################

#define UNICODE
#INCLUDE ONCE "Afx/CWindow.inc"
#INCLUDE ONCE "Afx/AfxCOM.inc"
USING Afx

CONST IDC_RICHEDIT = 1001

DECLARE FUNCTION WinMain (BYVAL hInstance AS HINSTANCE, _
                          BYVAL hPrevInstance AS HINSTANCE, _
                          BYVAL szCmdLine AS ZSTRING PTR, _
                          BYVAL nCmdShow AS LONG) AS LONG

   END WinMain(GetModuleHandleW(NULL), NULL, COMMAND(), SW_NORMAL)

' // Forward declaration
DECLARE FUNCTION WndProc (BYVAL hwnd AS HWND, BYVAL uMsg AS UINT, BYVAL wParam AS WPARAM, BYVAL lParam AS LPARAM) AS LRESULT

' ========================================================================================
' The EditStreamCallback function is an application defined callback function used with
' the EM_STREAMIN and EM_STREAMOUT messages. It is used to transfer a stream of data into
' or out of a rich edit control.
' ========================================================================================
FUNCTION RichEdit_LoadRtfFromFileCallback ( _
   BYVAL hFile AS HANDLE _                  ' // Value of the dwCookie member of the EDITSTREAM structure.
, BYVAL lpBuff AS BYTE PTR _               ' // Pointer to a buffer to write to
, BYVAL cb AS LONG _                       ' // Maximum number of bytes to read
, BYVAL pcb AS LONG PTR _                  ' // Number of bytes actually read
) AS UINT                                  ' // 0 for success, or an error code

   IF ReadFile(hFile, lpBuff, cb, pcb, NULL) = 0 THEN FUNCTION = GetLastError

END FUNCTION
' ========================================================================================

' ========================================================================================
FUNCTION RichEdit_LoadRtfFromFileW ( _
   BYVAL hRichEdit AS HWND _                ' // Handle of the Rich Edit control
, BYREF wszFileName AS WSTRING _           ' // Name of the file to load
) AS BOOLEAN                               ' // TRUE or FALSE

   DIM hFile AS HANDLE                      ' // File handle
   DIM eds AS EDITSTREAM                    ' // EDITSTREAM structure

   ' // Checks the validity of the parameters
   IF hRichEdit = 0 THEN EXIT FUNCTION
   IF LEN(wszFileName) = 0 THEN EXIT FUNCTION

   ' // Opens the file and sends the message
   hFile = CreateFileW(wszFileName, GENERIC_READ, FILE_SHARE_READ, _
                       BYVAL NULL, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, NULL)
   IF hFile = INVALID_HANDLE_VALUE THEN EXIT FUNCTION
   eds.dwCookie = cast(DWORD_PTR, hFile)
   eds.dwError = 0
   eds.pfnCallback = cast(EDITSTREAMCALLBACK, @RichEdit_LoadRtfFromFileCallback)
   IF SendMessageW(hRichEdit, EM_STREAMIN, SF_RTF, cast(LPARAM, @eds)) > 0 AND eds.dwError = 0 THEN FUNCTION = TRUE
   CloseHandle hFile

END FUNCTION
' ========================================================================================

#ifndef __Afx_IRichEditOleCallback_INTERFACE_DEFINED__
#define __Afx_IRichEditOleCallback_INTERFACE_DEFINED__
TYPE Afx_IRichEditOleCallback AS Afx_IRichEditOleCallback_
TYPE Afx_IRichEditOleCallback_ EXTENDS Afx_IUnknown
DECLARE ABSTRACT FUNCTION GetNewStorage (BYVAL lplpstg AS LPSTORAGE PTR) AS HRESULT
DECLARE ABSTRACT FUNCTION GetInPlaceContext (BYVAL lplpFrame AS LPOLEINPLACEFRAME PTR, BYVAL lplpDoc AS LPOLEINPLACEUIWINDOW PTR, BYVAL lpFrameInfo AS LPOLEINPLACEFRAMEINFO) AS HRESULT
DECLARE ABSTRACT FUNCTION ShowContainerUI (BYVAL fShow AS WINBOOL) AS HRESULT
DECLARE ABSTRACT FUNCTION QueryInsertObject (BYVAL lpclsid AS LPCLSID, BYVAL lpstg AS LPSTORAGE, BYVAL cp AS LONG) AS HRESULT
DECLARE ABSTRACT FUNCTION DeleteObject (BYVAL lpoleobj AS LPOLEOBJECT) AS HRESULT
DECLARE ABSTRACT FUNCTION QueryAcceptData (BYVAL lpdataobj AS LPDATAOBJECT, BYVAL lpcfFormat AS CLIPFORMAT PTR, BYVAL reco AS DWORD, BYVAL fReally AS WINBOOL, BYVAL hMetaPict AS HGLOBAL) AS HRESULT
DECLARE ABSTRACT FUNCTION ContextSensitiveHelp (BYVAL fEnterMode AS WINBOOL) AS HRESULT
DECLARE ABSTRACT FUNCTION GetClipboardData (BYVAL lpchrg AS CHARRANGE PTR, BYVAL reco AS DWORD, BYVAL lplpdataobj AS LPDATAOBJECT PTR) AS HRESULT
DECLARE ABSTRACT FUNCTION GetDragDropEffect (BYVAL fDrag AS WINBOOL, BYVAL grfKeyState AS DWORD, BYVAL pdwEffect AS LPDWORD) AS HRESULT
DECLARE ABSTRACT FUNCTION GetContextMenu (BYVAL seltype AS WORD, BYVAL lpoleobj AS LPOLEOBJECT, BYVAL lpchrg AS CHARRANGE PTR, BYVAL lphmenu AS HMENU PTR) AS HRESULT
END TYPE
TYPE AFX_LPRICHEDITOLECALLBACK AS Afx_IRichEditOleCallback PTR
#endif

' ========================================================================================
TYPE Afx_IRichEditOleCallbackImpl EXTENDS Afx_IRichEditOleCallback

   DECLARE VIRTUAL FUNCTION QueryInterface (BYVAL AS REFIID, BYVAL AS PVOID PTR) AS HRESULT
   DECLARE VIRTUAL FUNCTION AddRef () AS ULONG
   DECLARE VIRTUAL FUNCTION Release () AS ULong
   DECLARE VIRTUAL FUNCTION GetNewStorage (BYVAL lplpstg AS LPSTORAGE PTR) AS HRESULT
   DECLARE VIRTUAL FUNCTION GetInPlaceContext (BYVAL lplpFrame AS LPOLEINPLACEFRAME PTR, BYVAL lplpDoc AS LPOLEINPLACEUIWINDOW PTR, BYVAL lpFrameInfo AS LPOLEINPLACEFRAMEINFO) AS HRESULT
   DECLARE VIRTUAL FUNCTION ShowContainerUI (BYVAL fShow AS WINBOOL) AS HRESULT
   DECLARE VIRTUAL FUNCTION QueryInsertObject (BYVAL lpclsid AS LPCLSID, BYVAL lpstg AS LPSTORAGE, BYVAL cp AS LONG) AS HRESULT
   DECLARE VIRTUAL FUNCTION DeleteObject (BYVAL lpoleobj AS LPOLEOBJECT) AS HRESULT
   DECLARE VIRTUAL FUNCTION QueryAcceptData (BYVAL lpdataobj AS LPDATAOBJECT, BYVAL lpcfFormat AS CLIPFORMAT PTR, BYVAL reco AS DWORD, BYVAL fReally AS WINBOOL, BYVAL hMetaPict AS HGLOBAL) AS HRESULT
   DECLARE VIRTUAL FUNCTION ContextSensitiveHelp (BYVAL fEnterMode AS WINBOOL) AS HRESULT
   DECLARE VIRTUAL FUNCTION GetClipboardData (BYVAL lpchrg AS CHARRANGE PTR, BYVAL reco AS DWORD, BYVAL lplpdataobj AS LPDATAOBJECT PTR) AS HRESULT
   DECLARE VIRTUAL FUNCTION GetDragDropEffect (BYVAL fDrag AS WINBOOL, BYVAL grfKeyState AS DWORD, BYVAL pdwEffect AS LPDWORD) AS HRESULT
   DECLARE VIRTUAL FUNCTION GetContextMenu (BYVAL seltype AS WORD, BYVAL lpoleobj AS LPOLEOBJECT, BYVAL lpchrg AS CHARRANGE PTR, BYVAL lphmenu AS HMENU PTR) AS HRESULT

   DECLARE CONSTRUCTOR
   DECLARE DESTRUCTOR

   cRef AS DWORD                       ' // Reference count

END TYPE
' ========================================================================================

' ========================================================================================
' Constructor
' ========================================================================================
CONSTRUCTOR Afx_IRichEditOleCallbackImpl
END CONSTRUCTOR
' ========================================================================================
' ========================================================================================
' Destructor
' ========================================================================================
DESTRUCTOR Afx_IRichEditOleCallbackImpl
END DESTRUCTOR
' ========================================================================================
' ========================================================================================
' Returns pointers to the implemented classes and supported interfaces.
' ========================================================================================
FUNCTION Afx_IRichEditOleCallbackImpl.QueryInterface (BYVAL riid AS REFIID, BYVAL ppvObj AS LPVOID PTR) AS HRESULT
   IF ppvObj = NULL THEN RETURN E_INVALIDARG
   DIM IID_IRichEditOleCallback_ AS GUID = (&h00020D03, &h0000, &h0000, {&hC0, &h00, &h00, &h00, &h00, &h00, &h00, &h46})
   IF IsEqualIID(riid, @IID_IRichEditOleCallback_) OR IsEqualIID(riid, @IID_IUnknown) OR IsEqualIID(riid, @IID_IDispatch) THEN
      *ppvObj = @this
      ' // Not really needed, since this is not a COM object
      cast(Afx_IUnknown PTR, *ppvObj)->AddRef
      RETURN S_OK
   END IF
   RETURN E_NOINTERFACE
END FUNCTION
' ========================================================================================
' ========================================================================================
FUNCTION Afx_IRichEditOleCallbackImpl.AddRef () AS ULONG
   RETURN 2
END FUNCTION
' ========================================================================================
' ========================================================================================
FUNCTION Afx_IRichEditOleCallbackImpl.Release () AS ULONG
   RETURN 1
END FUNCTION
' ========================================================================================
' ========================================================================================
FUNCTION Afx_IRichEditOleCallbackImpl.GetNewStorage (BYVAL lplpstg AS LPSTORAGE PTR) AS HRESULT
   DIM hr AS HRESULT, pILockBytes AS ILockBytes PTR
   hr = CreateILockBytesOnHGlobal(NULL, TRUE, @pILockBytes)
   IF FAILED(hr) THEN RETURN hr
   hr = StgCreateDocfileOnILockBytes(pILockBytes, _
        STGM_SHARE_EXCLUSIVE OR STGM_READWRITE OR STGM_CREATE, 0, lplpstg)
   RETURN hr
END FUNCTION
' ========================================================================================
' ========================================================================================
FUNCTION Afx_IRichEditOleCallbackImpl.GetInPlaceContext (BYVAL lplpFrame AS LPOLEINPLACEFRAME PTR, BYVAL lplpDoc AS LPOLEINPLACEUIWINDOW PTR, BYVAL lpFrameInfo AS LPOLEINPLACEFRAMEINFO) AS HRESULT
   RETURN E_NOTIMPL
END FUNCTION
' ========================================================================================
' ========================================================================================
FUNCTION Afx_IRichEditOleCallbackImpl.ShowContainerUI (BYVAL fShow AS WINBOOL) AS HRESULT
   RETURN E_NOTIMPL
END FUNCTION
' ========================================================================================
' ========================================================================================
FUNCTION Afx_IRichEditOleCallbackImpl.QueryInsertObject (BYVAL lpclsid AS LPCLSID, BYVAL lpstg AS LPSTORAGE, BYVAL cp AS LONG) AS HRESULT
   RETURN S_OK
END FUNCTION
' ========================================================================================
' ========================================================================================
FUNCTION Afx_IRichEditOleCallbackImpl.DeleteObject (BYVAL lpoleobj AS LPOLEOBJECT) AS HRESULT
   RETURN S_OK
END FUNCTION
' ========================================================================================
' ========================================================================================
FUNCTION Afx_IRichEditOleCallbackImpl.QueryAcceptData (BYVAL lpdataobj AS LPDATAOBJECT, BYVAL lpcfFormat AS CLIPFORMAT PTR, BYVAL reco AS DWORD, BYVAL fReally AS WINBOOL, BYVAL hMetaPict AS HGLOBAL) AS HRESULT
   RETURN E_NOTIMPL
END FUNCTION
' ========================================================================================
' ========================================================================================
FUNCTION Afx_IRichEditOleCallbackImpl.ContextSensitiveHelp (BYVAL fEnterMode AS WINBOOL) AS HRESULT
   RETURN E_NOTIMPL
END FUNCTION
' ========================================================================================
' ========================================================================================
FUNCTION Afx_IRichEditOleCallbackImpl.GetClipboardData (BYVAL lpchrg AS CHARRANGE PTR, BYVAL reco AS DWORD, BYVAL lplpdataobj AS LPDATAOBJECT PTR) AS HRESULT
   RETURN E_NOTIMPL
END FUNCTION
' ========================================================================================
' ========================================================================================
FUNCTION Afx_IRichEditOleCallbackImpl.GetDragDropEffect (BYVAL fDrag AS WINBOOL, BYVAL grfKeyState AS DWORD, BYVAL pdwEffect AS LPDWORD) AS HRESULT
   RETURN E_NOTIMPL
END FUNCTION
' ========================================================================================
' ========================================================================================
FUNCTION Afx_IRichEditOleCallbackImpl.GetContextMenu (BYVAL seltype AS WORD, BYVAL lpoleobj AS LPOLEOBJECT, BYVAL lpchrg AS CHARRANGE PTR, BYVAL lphmenu AS HMENU PTR) AS HRESULT
   RETURN E_NOTIMPL
END FUNCTION
' ========================================================================================

' ========================================================================================
' Main
' ========================================================================================
FUNCTION WinMain (BYVAL hInstance AS HINSTANCE, _
                  BYVAL hPrevInstance AS HINSTANCE, _
                  BYVAL szCmdLine AS ZSTRING PTR, _
                  BYVAL nCmdShow AS LONG) AS LONG

   ' // Set process DPI aware
   ' // The recommended way is to use  manifest
'   AfxSetProcessDPIAware

   ' // Initialize the COM library
   CoInitialize NULL

   ' // Create the main window
   DIM pWindow AS CWindow
   pWindow.Create(NULL, "Rich Ole Demo", @WndProc)
   ' // Set the client size
   pWindow.SetClientSize(750, 450)
   ' // Center the window
   pWindow.Center

   ' // Add a rich edit control without coordinates (it will be resized in WM_SIZE)
   DIM hRichEdit AS HWND = pWindow.AddControl("RichEdit", , IDC_RICHEDIT, "RichEdit box", , , , , _
   WS_VISIBLE OR WS_TABSTOP OR ES_LEFT OR WS_VSCROLL OR ES_MULTILINE OR ES_WANTRETURN OR ES_NOHIDESEL OR ES_SAVESEL)

   ' // Raise the 32,767 default characters limit to no limit
   SendMessageW(hRichEdit, EM_EXLIMITTEXT, 0, -1)
   ' // Set the left margin
   SendMessageW(hRichEdit, EM_SETMARGINS, EC_LEFTMARGIN, 20)
   ' // Specify which notifications the control sends to its parent window
   SendMessageW(hRichEdit, EM_SETEVENTMASK, 0, ENM_CHANGE)

   ' // Set the IRichEditOleCallback object.
   ' // The control calls the AddRef function for the object before returning.
   DIM pRichEditOleCallback AS Afx_IRichEditOleCallbackImpl PTR = NEW Afx_IRichEditOleCallbackImpl
   SendMessageW(hRichEdit, EM_SETOLECALLBACK, 0, cast(LPARAM, pRichEditOleCallback))

   ' // Load the file
   RichEdit_LoadRtfFromFileW hRichEdit, ".\Resources\The_Third_Man.rtf"

   ' // Set the focus in the control
   SetFocus hRichEdit

   ' // Dispatch Windows messages
   FUNCTION = pWindow.DoEvents(nCmdShow)

   ' // Delete the class
   IF pRichEditOleCallback THEN Delete pRichEditOleCallback

   ' // Uninitialize the COM library
   CoUninitialize

END FUNCTION
' ========================================================================================

' ========================================================================================
' Main window callback procedure
' ========================================================================================
FUNCTION WndProc (BYVAL hwnd AS HWND, BYVAL uMsg AS UINT, BYVAL wParam AS WPARAM, BYVAL lParam AS LPARAM) AS LRESULT

   SELECT CASE uMsg

      CASE WM_COMMAND
         SELECT CASE GET_WM_COMMAND_ID(wParam, lParam)
            ' // If ESC key pressed, close the application sending an WM_CLOSE message
            CASE IDCANCEL
               IF GET_WM_COMMAND_CMD(wParam, lParam) = BN_CLICKED THEN
                  SendMessageW hwnd, WM_CLOSE, 0, 0
                  EXIT FUNCTION
               END IF
         END SELECT

      CASE WM_SIZE
         ' // If the window isn't minimized, resize it
         IF wParam <> SIZE_MINIMIZED THEN
            ' // Resize the Rich Edit control
            DIM hRichEdit AS HWND = GetDlgItem(hwnd, IDC_RICHEDIT)
            MoveWindow hRichEdit, 10, 10, LOWORD(lParam) - 20, HIWORD(lParam) - 20, CTRUE
         END IF

    CASE WM_DESTROY
         ' // End the application by sending an WM_QUIT message
         PostQuitMessage(0)
         EXIT FUNCTION

   END SELECT

   ' // Default processing of Windows messages
   FUNCTION = DefWindowProcW(hWnd, uMsg, wParam, lParam)

END FUNCTION
' ========================================================================================

Title: Re: WinFBE on GitHub (December 6, 2016)
Post by: Paul Squires on December 14, 2016, 04:38:52 PM
Quote from: Jose Roca on December 11, 2016, 08:23:19 PM
Currently, Ctrl+W is doing the same as Ctrl+Q, i.e. closing the current tab. I suggest to use Ctrl+W to switch tabs.
Hi Jose, the logic I used was based on this previous post: http://www.planetsquires.com/protect/forum/index.php?topic=3890.msg28794#msg28794
Title: Re: WinFBE on GitHub (December 6, 2016)
Post by: Paul Squires on December 14, 2016, 04:40:50 PM
Jose, thanks for the new sample projects! I have added them to GitHub.  :)
Title: Re: WinFBE on GitHub (December 6, 2016)
Post by: José Roca on December 15, 2016, 01:50:58 AM
Quote from: TechSupport on December 14, 2016, 04:38:52 PM
Quote from: Jose Roca on December 11, 2016, 08:23:19 PM
Currently, Ctrl+W is doing the same as Ctrl+Q, i.e. closing the current tab. I suggest to use Ctrl+W to switch tabs.
Hi Jose, the logic I used was based on this previous post: http://www.planetsquires.com/protect/forum/index.php?topic=3890.msg28794#msg28794


Then you can use Ctrl+Tab to switch tabs.
Title: Re: WinFBE on GitHub (December 6, 2016)
Post by: José Roca on December 15, 2016, 03:25:46 AM
There is still a problem when using projects: after using a project with a resource and closing it, if you try to compile a .bas file, it fails because it tries to compile also the resource of the closed project, forcing you to restart the editor.
Title: Re: WinFBE on GitHub (December 6, 2016)
Post by: Paul Squires on December 15, 2016, 05:50:06 PM
Quote from: Jose Roca on December 15, 2016, 03:25:46 AM
There is still a problem when using projects: after using a project with a resource and closing it, if you try to compile a .bas file, it fails because it tries to compile also the resource of the closed project, forcing you to restart the editor.
Thanks Jose, yes you are correct. I was able to reproduce the problem and have now fixed it. New code and exe's are now in GitHub.
Title: Re: WinFBE on GitHub (December 6, 2016)
Post by: Andrew Lindsay on December 16, 2016, 07:52:26 AM
Paul / Jose,


Just a quick note to say thanks for your hard work and efforts for the community.  While I am not in a position to play with your tools or code examples at the moment, I am sitting back dreaming of days less concerned with broken pumps and leaking tubes, driving Excel spreadsheets and delving into long forgotten fluid flow equations.


But please accept my appreciation and understand my anticipation for some free time at home with my family and my computer to play.


Andrew
Title: Re: WinFBE on GitHub (December 6, 2016)
Post by: Paul Squires on December 16, 2016, 09:22:58 AM
Thanks Andrew! That is so nice of you to say. Really appreciate the kind words.

I admit that these days programming is more relaxing for me as I do it now as a nice hobby and without the expectations that come with supporting commercial software. Using FreeBasic and creating open source tools is a refreshing experience. I'll never be able to churn out as much code as Jose does but it is satisfying when I create something useful.

All the best to you and hope you can pick up programming again soon!  :)
Title: Re: WinFBE on GitHub (December 6, 2016)
Post by: Paul Squires on December 20, 2016, 08:40:07 PM
Should have Autocomplete finished tomorrow. Once again stole some code from Jose's awesome CSED Editor.
Autocomplete works by inserting a fragment of code based on an initial keyword. For example, typing "FOR" and then pressing the space key will insert a blank FOR/NEXT code fragment, etc.  Pretty cool.

Codetips will come after this Autocomplete is finished.
Title: Re: WinFBE on GitHub (December 6, 2016)
Post by: Paul Squires on December 21, 2016, 08:05:06 PM
Autocomplete added to GitHub:

- Added: Autocomplete feature for IF/WHILE/FOR/SELECT/FUNCTION/SUB/PROPERTY/TYPE/UNION

If you are happy with this new functionality then I will release a new package via GitHub. Will number it version 1.2.0
Title: Re: WinFBE on GitHub (December 6, 2016)
Post by: José Roca on December 22, 2016, 06:40:20 AM
Works fine, but maybe you should made it optional.
Title: Re: WinFBE on GitHub (December 6, 2016)
Post by: Petrus Vorster on December 22, 2016, 01:57:17 PM
Editor work pretty cool.
Now for my usual dumb question.

The samples with the latest Jose includes...
I can see the files under the Editor folder /AFX but still get File not found error.
It must be a setting i am missing as usual.
Title: Re: WinFBE on GitHub (December 6, 2016)
Post by: José Roca on December 22, 2016, 02:39:55 PM
There are no samples in the editor's Afx folder. There are templates in the Templates folder and projects in the Sample_Projects folder.
Title: Re: WinFBE on GitHub (December 6, 2016)
Post by: José Roca on December 22, 2016, 02:49:59 PM
..or, if you mean my include files, you must download them from here: http://www.planetsquires.com/protect/forum/index.php?topic=3966.0

...and copy them to the "inc" folder of your FreeBasic installation, e.g. C:\Users\Pepe\FreeBasic32\inc\Afx and C:\Users\Pepe\FreeBasic64\inc\Afx.

Title: Re: WinFBE on GitHub (December 6, 2016)
Post by: Petrus Vorster on December 22, 2016, 02:55:52 PM
LOL, yes, i actually had them.

I still get errors on the same place.
I am trying to look at the examples like the Split button and the toolbars that came in the download.

Title: Re: WinFBE on GitHub (December 6, 2016)
Post by: José Roca on December 22, 2016, 03:23:30 PM
You must always to use the latest version of the includes, not an old one.
Title: Re: WinFBE on GitHub (December 6, 2016)
Post by: Paul Squires on December 22, 2016, 04:43:55 PM
Quote from: Jose Roca on December 22, 2016, 06:40:20 AM
Works fine, but maybe you should made it optional.
Thanks Jose, yes it already is optional. There is a setting in Editor Options. One for Codetips (that doesn't do anything yet) and one for Autocomplete (which is what this feature is).


Title: Re: WinFBE on GitHub (December 6, 2016)
Post by: José Roca on December 22, 2016, 04:50:55 PM
I don't see it.
Title: Re: WinFBE on GitHub (December 6, 2016)
Post by: Paul Squires on December 22, 2016, 10:19:10 PM
Quote from: Jose Roca on December 22, 2016, 04:50:55 PM
I don't see it.
Well that's odd. I recompiled the EXE's and uploaded them again for you. Use the EXE's from the GitHub ZIP file download rather than the "Release" download. The screen should look like this attachment:
Title: Re: WinFBE on GitHub (December 6, 2016)
Post by: Tasos Georgas on December 23, 2016, 04:21:19 AM
Quote from: Petrus Vorster on December 22, 2016, 02:55:52 PM
LOL, yes, i actually had them.

I still get errors on the same place.
I am trying to look at the examples like the Split button and the toolbars that came in the download.

You have to #include once "C:\FreeBASIC\inc\win\windowsx.bi"
Or there is  "C:\WinFBE-master\src\windowsxx.bi" that you can include, too.

I don't know why that is missed from the code.

Tasos Georgas.
Title: Re: WinFBE on GitHub (December 6, 2016)
Post by: José Roca on December 23, 2016, 05:28:41 AM
Quote from: Tasos Georgas on December 23, 2016, 04:21:19 AM
Quote from: Petrus Vorster on December 22, 2016, 02:55:52 PM
LOL, yes, i actually had them.

I still get errors on the same place.
I am trying to look at the examples like the Split button and the toolbars that came in the download.

You have to #include once "C:\FreeBASIC\inc\win\windowsx.bi"
Or there is  "C:\WinFBE-master\src\windowsxx.bi" that you can include, too.

I don't know why that is missed from the code.

Tasos Georgas.

The latest include files already use windowsx.bi. He must be using an older version.
Title: Re: WinFBE on GitHub (December 6, 2016)
Post by: José Roca on December 23, 2016, 05:58:35 AM
> Well that's odd.

Very odd, indeed. I have needed to do a new install. Overwriting or copying the .exe files only did not work, I wonder why.

Guess it has to do with the language files. You have changed them to add the new option.
Title: Re: WinFBE on GitHub (December 6, 2016)
Post by: José Roca on December 23, 2016, 06:48:58 AM
Updated Spanish language file.

You need to make one of the labels a bit bigger (the last four characters aren't being displayed).
Title: Re: WinFBE on GitHub (December 6, 2016)
Post by: Paul Squires on December 23, 2016, 11:18:44 AM
Thanks Jose - appreciate the updated language file! I have also made the visual change to the New Project Options dialog to ensure enough space for the label. I will update GitHub later today.
Title: Re: WinFBE on GitHub (December 6, 2016)
Post by: Paul Squires on December 23, 2016, 08:22:23 PM
I updated GitHub with the changes as well as including new code that displays a popup list of data types when "AS" is typed. Seems to be working well so far.
Title: Re: WinFBE on GitHub (December 6, 2016)
Post by: Paul Squires on December 25, 2016, 01:50:42 PM
Codetip popups for builtin FreeBASIC keywords added to GitHub.
Title: Re: WinFBE on GitHub (December 6, 2016)
Post by: Paul Squires on December 26, 2016, 12:05:06 AM
Made a few more changes. Codetips now show for subs/functions present in all loaded documents in the editor (user written functions). I am also now closing the Compile Output window if it is currently active and a subsequent compile produces no warnings/errors.

I am now ready to deal with the Windows API codetips and other sub/functions found in other #INCLUDE'd files.

This approach seems like it might be the most efficient approach:
(1) Prebuild a codetips file (codetips_winapi.ini) (actually, maybe one for ansi functions and another for unicode).
(2) Parse source code files during loading for all #INCLUDES. Bypass any Windows includes because they would have already been prebuilt. Parse any other #INCLUDEs such as Jose's AFX includes.
(3) When "(" is pressed, search builtin FB keywords first, then subs/functions of all loaded documents, and finally the Windows API codetips (if previous parsing showed that Windows API files were present in the source. Display the ANSI or UNICODE version depending on if #DEFINE UNICODE was present in the source).

Sounds pretty do-able.  :)