PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2] 3

Author Topic: WinFBE on GitHub  (Read 2771 times)

Paul Squires

  • Administrator
  • Master FireFly Member
  • *****
  • Posts: 8088
  • Windows 10
    • PlanetSquires Software
Re: WinFBE on GitHub
« Reply #15 on: July 13, 2017, 04:26:11 PM »

...I will dive deep into the Find dialog and fix whatever is wrong  :)
Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor

Josť Roca

  • FireFly3 Registered User
  • Master FireFly Member
  • *
  • Posts: 2726
    • Josť Roca Software
Re: WinFBE on GitHub
« Reply #16 on: July 13, 2017, 05:29:10 PM »

Pierre's suggestion could also been used effectively to override the compiler options, specially when compiling a file that does not belong to a project.

Paul Squires

  • Administrator
  • Master FireFly Member
  • *****
  • Posts: 8088
  • Windows 10
    • PlanetSquires Software
Re: WinFBE on GitHub
« Reply #17 on: July 13, 2017, 08:54:54 PM »

Check the code to save a file. Each time I save the code, a bunch of "Invalid parameter passed to a C runtime function" messages appear in DebugView.


I ran DebugView++ and this also happens when you simply create a "New" file. This will be hard to track down and could be something deep in the compiler generated code or simply something in my code. A tough one.
Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor

Josť Roca

  • FireFly3 Registered User
  • Master FireFly Member
  • *
  • Posts: 2726
    • Josť Roca Software
Re: WinFBE on GitHub
« Reply #18 on: July 15, 2017, 01:21:01 AM »

I always test my code with DebugView activated. Not only allows me to display my own messages, but also dispays messages sent by system DLLs. It has spared me more than one headache.

I have tried opening a file in binary mode and writing to it and it does not throw any exception. As always, the usual suspects are pointers.

« Last Edit: July 15, 2017, 01:25:59 AM by Josť Roca »
Logged

Paul Squires

  • Administrator
  • Master FireFly Member
  • *****
  • Posts: 8088
  • Windows 10
    • PlanetSquires Software
Re: WinFBE on GitHub
« Reply #19 on: July 15, 2017, 10:36:13 PM »

I always test my code with DebugView activated. Not only allows me to display my own messages, but also dispays messages sent by system DLLs. It has spared me more than one headache.

I have tried opening a file in binary mode and writing to it and it does not throw any exception. As always, the usual suspects are pointers.


The problem was my call to _stricmp in clsDBEngine.dbDelete
I have changed the code to now simply compare the two filenames using UCASE instead of _stricmp.

I have also added a "Mixed Case" keyword casing option.

GitHub release 1.3.5 uploaded.
Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor

Paul Squires

  • Administrator
  • Master FireFly Member
  • *****
  • Posts: 8088
  • Windows 10
    • PlanetSquires Software
Re: WinFBE on GitHub
« Reply #20 on: July 15, 2017, 10:53:35 PM »

BTW the most annoying problem that I'm having is with the Find option. After using the Find dialog several times (more than a few times, but less than many times), the cursor disppears and I have to restart the compiler. It is as if it has entered in a loop.

I am looking into this one now. I have added a bit of code to the find/replace code. You should install the 1.3.5 release and then download the raw WinFBE exe's from GitHub (as the code addition is not in the 1.3.5 release but is in the raw exe's).
Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor

Pierre Bellisle

  • FireFly3 User
  • Junior FireFly Member
  • *
  • Posts: 57
Re: WinFBE on GitHub
« Reply #21 on: August 10, 2017, 09:19:10 PM »

Hey Paul,

If I may ask, what _stricmp() couldn't do that UCASE() can?
Logged

Paul Squires

  • Administrator
  • Master FireFly Member
  • *****
  • Posts: 8088
  • Windows 10
    • PlanetSquires Software
Re: WinFBE on GitHub
« Reply #22 on: August 10, 2017, 11:16:41 PM »

I must have been calling _stricmp incorrectly because DebugView was reporting errors calling the api. Rather than risk errors in the code I simply changed to using UCASE rather than the string insensitive compare. It must have been that particular choice of variable types that I was comparing because I also use _stricmp elsewhere in the WinFBE codebase and no errors are thrown in those cases.
Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor

Josť Roca

  • FireFly3 Registered User
  • Master FireFly Member
  • *
  • Posts: 2726
    • Josť Roca Software
Re: WinFBE on GitHub
« Reply #23 on: August 15, 2017, 06:07:44 PM »

There is still a cosmetic problem with the Find/Replace dialog when used with a DPI <> 96 (I'm using 192). The icons are being drawn bigger that they should and if it not was for the tooltips you will never guess what they do. See capture below.
« Last Edit: August 15, 2017, 06:09:18 PM by Josť Roca »
Logged

Paul Squires

  • Administrator
  • Master FireFly Member
  • *****
  • Posts: 8088
  • Windows 10
    • PlanetSquires Software
Re: WinFBE on GitHub
« Reply #24 on: August 15, 2017, 08:07:02 PM »

Hi Jose, yes, I was aware of that problem. I believe I need to create multiple versions of the icon so that it will scale better.
Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor

Josť Roca

  • FireFly3 Registered User
  • Master FireFly Member
  • *
  • Posts: 2726
    • Josť Roca Software
Re: WinFBE on GitHub
« Reply #25 on: August 31, 2017, 02:30:16 AM »

A couple of suggestions:

1.- Asking before exiting the editor should be optional, i.e. in Code Editor Options
- Ask before exiting the editor?

2.- Another option
- Allow multiple instances?

Currently, if I register an extension (e.g. bas) with the editor, each time I double click a .bas file in explorer a new instance of the editor is launched to load the file. If "Allow multiple instances?" is unchecked, the file should be loaded in the active instance of the editor, instead of launching a new one.

To check if it is already an instance of the editor running, you can use something like:

Code: [Select]
IF AllowMultipleInstances = FALSE THEN
   hWindow = FindWindow("WinFBE_Class", NULL")
   IF hWindow THEN
      SetForegroundWindow hWindow
      ProcessCommandLine(hWindow)
      FUNCTION = -1
      EXIT FUNCTION
   END IF
END IF

To process the the command line, in the CSED editor I use:

Code: [Select]
' ========================================================================================
' Gets the command line and processes it
' ========================================================================================
SUB CSED_ProcessCommandLine (BYVAL hwnd AS DWORD)

   LOCAL strFileName   AS STRING           ' // File name
   LOCAL strLineNumber AS STRING           ' // Line number
   LOCAL DataToSend    AS COPYDATASTRUCT   ' // Data to send structure

   IF ISFALSE hwnd THEN EXIT SUB

   IF IsIconic(hwnd) <> 0 OR IsZoomed(hwnd) <> 0 THEN ShowWindow hwnd, %SW_RESTORE
   SetForegroundWindow hwnd

   IF TRIM$(COMMAND$) = "" THEN EXIT SUB

   strLineNumber = RIGHT$(COMMAND$, LEN(COMMAND$) - INSTR(-1, COMMAND$, " "))
   IF LEN(TRIM$(strLineNumber, ANY "0123456789")) THEN
      strFileName = TRIM$(COMMAND$, ANY $DQ + $SPC)
   ELSE
      strFileName = TRIM$(LEFT$(COMMAND$, LEN(COMMAND$) - LEN(strLineNumber)), ANY $DQ + $SPC)
   END IF

   IF TRIM$(strFilename) = "" THEN EXIT SUB

'   IF strFileName <> "" AND PATHNAME$(PATH, strFileName) = "" THEN
'      FBSED_MsgBox hwnd, "Missing path in file " & strFileName, %MB_OK OR %MB_ICONERROR, "Error"
'      EXIT SUB
'   END IF

   IF strFileName <> "" AND PATHNAME$(PATH, strFileName) = "" THEN strFileName = CURDIR$ & "\" & strFileName

   IF ISFALSE AfxFileExists(strFileName) THEN
      FBSED_MsgBox hwnd, "Can't find the file " & strFileName, %MB_OK OR %MB_ICONERROR, "Error"
      EXIT SUB
   END IF

   DataToSend.lpData  = STRPTR(strFileName)
   DataToSend.cbdata  = LEN(strFileName) + 1
   DataToSend.dwData  = VAL(strLineNumber) - 1

   SendMessage hwnd, %WM_COPYDATA, LEN(DataToSend), VARPTR(DataToSend)
   IF pSed.hEdit THEN SCI_GotoLine(pSed.hEdit, VAL(strLineNumber) - 1)

END SUB
' ========================================================================================

and in the WM_COPY message processing:

Code: [Select]
      CASE %WM_COPYDATA
         pDataToGet = lParam
         pszBuffer = @pDataToGet.lpData
         CSED_OpenFile TRIM$(@pszBuffer)
         SCI_GotoLine(pSed.hEdit, SCI_GetTextLength(pSed.hEdit))
         SCI_GotoLine(pSed.hEdit, @pDataToGet.dwData)

This is also useful for tools like FileSearch that display a list of finds and allow to load the file in the editor an position the cursor in the selected line.

Paul Squires

  • Administrator
  • Master FireFly Member
  • *****
  • Posts: 8088
  • Windows 10
    • PlanetSquires Software
Re: WinFBE on GitHub
« Reply #26 on: August 31, 2017, 08:52:47 AM »

Thanks Josť, I will modify my command line processing code to include yours so that incoming files can be opened in existing instances of the editor.

I am not understanding your "Ask before exiting the editor?" question. I already have that option listed in "Options", "Environment Options", General Options". Is it not working correctly?
Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor

Paul Squires

  • Administrator
  • Master FireFly Member
  • *****
  • Posts: 8088
  • Windows 10
    • PlanetSquires Software
Re: WinFBE on GitHub
« Reply #27 on: August 31, 2017, 10:57:46 AM »

2.- Another option
- Allow multiple instances?

Currently, if I register an extension (e.g. bas) with the editor, each time I double click a .bas file in explorer a new instance of the editor is launched to load the file. If "Allow multiple instances?" is unchecked, the file should be loaded in the active instance of the editor, instead of launching a new one.
I have this implemented now. Appears to be working perfectly. This is a very nice change and addition. Thanks for the suggestion and code!
I will upload a new release this evening (v1.4.9).

Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor

Josť Roca

  • FireFly3 Registered User
  • Master FireFly Member
  • *
  • Posts: 2726
    • Josť Roca Software
Re: WinFBE on GitHub
« Reply #28 on: August 31, 2017, 11:18:08 AM »

Thanks Josť, I will modify my command line processing code to include yours so that incoming files can be opened in existing instances of the editor.

I am not understanding your "Ask before exiting the editor?" question. I already have that option listed in "Options", "Environment Options", General Options". Is it not working correctly?


Sorry, I was looking for it in the wrong place.

Josť Roca

  • FireFly3 Registered User
  • Master FireFly Member
  • *
  • Posts: 2726
    • Josť Roca Software
Re: WinFBE on GitHub
« Reply #29 on: August 31, 2017, 11:19:23 AM »

2.- Another option
- Allow multiple instances?

Currently, if I register an extension (e.g. bas) with the editor, each time I double click a .bas file in explorer a new instance of the editor is launched to load the file. If "Allow multiple instances?" is unchecked, the file should be loaded in the active instance of the editor, instead of launching a new one.
I have this implemented now. Appears to be working perfectly. This is a very nice change and addition. Thanks for the suggestion and code!
I will upload a new release this evening (v1.4.9).



Do you have used unicode? I have noticed that I was using ansi in the code posted.
« Last Edit: August 31, 2017, 11:31:19 AM by Josť Roca »
Logged
Pages: 1 [2] 3