PlanetSquires Forums

Please login or register.

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

Author Topic: Are you adventurous? WinFBE 1.8.8 draft is ready....  (Read 499 times)

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 8747
  • Windows 10
    • PlanetSquires Software
Re: Are you adventurous? WinFBE 1.8.8 draft is ready....
« Reply #15 on: January 20, 2019, 03:19:06 PM »

I wonder if the following may be the problem (issue with the font?) because I am using a unicode edit control (from CWindow). I will try setting a different font and see what happens......

https://stackoverflow.com/questions/7153340/russian-characters-not-showing-up-correctly-in-mfc-unicode-list-box

https://stackoverflow.com/questions/8742882/display-arabic-unicode-in-mfc-view?rq=1

« Last Edit: January 20, 2019, 03:20:52 PM by Paul Squires »
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

raymw

  • Senior Member
  • ***
  • Posts: 237
Re: Are you adventurous? WinFBE 1.8.8 draft is ready....
« Reply #16 on: January 20, 2019, 03:48:52 PM »

is the options - build configurations - working properly? It seems stuck on win32 console (release)
Logged

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 8747
  • Windows 10
    • PlanetSquires Software
Re: Are you adventurous? WinFBE 1.8.8 draft is ready....
« Reply #17 on: January 20, 2019, 04:01:33 PM »

is the options - build configurations - working properly? It seems stuck on win32 console (release)
I fixed that yesterday if I remember correctly.... it was not saving between sessions. I will upload another package tonight if I get this Russian font thing figured out.
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 8747
  • Windows 10
    • PlanetSquires Software
Re: Are you adventurous? WinFBE 1.8.8 draft is ready....
« Reply #18 on: January 20, 2019, 04:14:23 PM »

When I switch to Russian and restart WinFBE, the entire application shows "??????" for text. I am wondering if it will require being on a Russian version of Windows. I do have #Define UNICODE defined for the compiled version of WinFBE.
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Josť Roca

  • Guru Member
  • *****
  • Posts: 3164
Re: Are you adventurous? WinFBE 1.8.8 draft is ready....
« Reply #19 on: January 21, 2019, 03:13:17 AM »

> I am wondering if it will require being on a Russian version of Windows.

No. It works in this test:

Code: [Select]
' ########################################################################################
' Microsoft Windows
' Contents: Demonstrates the use of the Edit control.
' Compiler: FreeBasic 32 & 64 bit
' Copyright (c) 2016 Josť 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/CTextStream.inc"
USING Afx

CONST IDC_EDIT1 = 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

' ========================================================================================
' 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
   AfxSetProcessDPIAware

   ' // Create the main window
   DIM pWindow AS CWindow
   pWindow.Create(NULL, "Edit controls", @WndProc)
   pWindow.SetClientSize 400, 200
   pWindow.Center

   ' // Add an Edit control
   DIM hEdit AS HWND = pWindow.AddControl("Edit", , IDC_EDIT1, "", 20, 15, 305, 23)

   ' // Set the focus in the first edit control
   SetFocus hEdit

dim idx as long
   ' // Create an instance of the CTextStream class
DIM pTxtStm AS CTextStream
' // Open file as a text stream
DIM cbsFile AS CBSTR = ExePath & $"\russian.lang"
DIM cbs AS CBSTR
IF pTxtStm.OpenUnicode(cbsFile) = S_OK THEN
   ' // Read the file sequentially
   DO UNTIL pTxtStm.EOS
      cbs = pTxtStm.ReadLine
      idx = idx + 1
      if idx > 20 then exit do
   LOOP
   pTxtStm.Close
END IF

DIM i as long
i = Instr(cbs, ":")
cbs = Mid(**cbs, i+1)
SetWindowText hEdit, cbs
cbs = rtrim(AfxStrParse(cbs, 1, ";"), any chr(9,32))


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

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_DESTROY
         ' // End the application
         PostQuitMessage(0)
         EXIT FUNCTION

   END SELECT

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

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

Josť Roca

  • Guru Member
  • *****
  • Posts: 3164
Re: Are you adventurous? WinFBE 1.8.8 draft is ready....
« Reply #20 on: January 21, 2019, 03:15:03 AM »

I remember that it worked in a much older version. Don't know in which version started happening.
« Last Edit: January 21, 2019, 09:22:05 AM by Josť Roca »
Logged

Josť Roca

  • Guru Member
  • *****
  • Posts: 3164
Re: Are you adventurous? WinFBE 1.8.8 draft is ready....
« Reply #21 on: January 21, 2019, 03:55:15 AM »

The Chinese.lang file that comes with this package is bad. It is full of ???.

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 8747
  • Windows 10
    • PlanetSquires Software
Re: Are you adventurous? WinFBE 1.8.8 draft is ready....
« Reply #22 on: January 21, 2019, 08:43:58 AM »

> I am wondering if it will require being on a Russian version of Windows.

No. It works in this test:

Yes, your demo works on my system as well. Strange, because in WinFBE I am using the same type of code as you are to open and read the file. I am using the CTextStream class and CBSTR's. You can see this in the LoadLocalizationFile function in the modRoutines.inc file.

During startup, I load the "English.lang" into a global array gLangEnglish() and whatever localized file into the LL() array. The only difference being that the arrays are WSTRING * MAX_PATH rather than CBSTR but the conversion from CBSTR to WSTRING shouldn't make a difference, should it? I am a little perplexed by this problem so far.

Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Josť Roca

  • Guru Member
  • *****
  • Posts: 3164
Re: Are you adventurous? WinFBE 1.8.8 draft is ready....
« Reply #23 on: January 21, 2019, 11:27:50 AM »

I have found the problem. The intrinsic FB string functions don't work with languages like Chinese and Russian if you rely in automatic conversion. I warned you about it regarding MID, but it also happens with other functions.

The only reliable way with the current versions of FB is to use ** because this way you access the string buffer directly, without conversions (and it is faster too).

So, instead of

cbs = rtrim(AfxStrParse(cbs, 1, ";"), any chr(9,32))

use

cbs = rtrim(**AfxStrParse(cbs, 1, ";"), any chr(9,32))

So get used to ** whem using FB intrinsic string functions.
« Last Edit: January 21, 2019, 11:36:16 AM by Josť Roca »
Logged

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 8747
  • Windows 10
    • PlanetSquires Software
Re: Are you adventurous? WinFBE 1.8.8 draft is ready....
« Reply #24 on: January 21, 2019, 11:33:44 AM »

The problem appears to be when I apply RTRIM.

' FAIL
      gLocalPhrases(pp) = rtrim(AfxStrParse(wData, 1, ";"), any chr(9,32))
      AfxSetWindowText( GetDlgItem(HWND_FRMOPTIONSLOCAL, IDC_FRMOPTIONSLOCAL_CMDLOCALIZATION), gLocalPhrases(pp) )

' SUCCESS
      gLocalPhrases(pp) = AfxStrParse(wData, 1, ";")
      AfxSetWindowText( GetDlgItem(HWND_FRMOPTIONSLOCAL, IDC_FRMOPTIONSLOCAL_CMDNEW), gLocalPhrases(pp) )

' SUCCESS
      gLocalPhrases(pp) = wData
      AfxSetWindowText( GetDlgItem(HWND_FRMOPTIONSLOCAL, IDC_FRMOPTIONSLOCAL_CMDEDIT), gLocalPhrases(pp) )
 
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 8747
  • Windows 10
    • PlanetSquires Software
Re: Are you adventurous? WinFBE 1.8.8 draft is ready....
« Reply #25 on: January 21, 2019, 11:35:06 AM »

LOL, we posted the same time  :-)

Thanks for researching it Jose. I will make sure to use ** with the FB intrinsic functions.
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

SeaVipe

  • Junior Member
  • **
  • Posts: 147
  • Windows 10 Ubuntu 18
Re: Are you adventurous? WinFBE 1.8.8 draft is ready....
« Reply #26 on: January 21, 2019, 03:00:19 PM »

Hi Paul, Looking Good!

1.
Testing various items on the Version 1.8.8 list copied from GitHub. I like Snippets; nice and simple and works very well.

2.
F6 works on my machine but only after the subject file has been loaded into the editor.
Close the file(s) and F6 works okay with no need to perform the same file open/close on subsequent runnings of WinFBE.
Example: In an #Include file, this line functioned correctly when called from my test program:
Code: [Select]
? "Last Error: " + toStringFBerrorCodes( GetLastError() ) However, highlighting toStringFBerrorCodes and pressing F6 only popped up a file not found msgbox. Load the (#included) file (.bi) into the editor and then close it (the file now appears in Explorer/Header) and F6 opens the file and moves the cursor to the beginning of the function. I'm not sure if this is by design or not.

3.
Is there a way to set the colours for the 3 combo boxes to windows default or the Explorer panel or my choice? See the attached image.
Thanks.
Logged
Clive Richey
There is nothing government can give you that it hasn't already taken from you in the first place. Winston Churchill

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 8747
  • Windows 10
    • PlanetSquires Software
Re: Are you adventurous? WinFBE 1.8.8 draft is ready....
« Reply #27 on: January 21, 2019, 04:16:31 PM »

Hi Clive,

The F6 functionality is designed to only work if the source code containing the sub/function being searched for is actually loaded in WinFBE (either in an open Tab, or as part of a Project).

I will change the colors for those comboboxes. I set them to equal the same color as the edit window (background/foreground/highlight) because I thought that people using different theme colors would like to have those comboboxes reflect the same type of colors. Personally, like you, I prefer the standard Windows colors. Maybe in the future I will allow a setting to color them different or a setting to toggle their visibility (show/hide).

Thanks for testing. I will upload a new test version shortly that has a new PictureBox control for the visual designer along with a few minor fixes I came across since the last draft upload. If this next draft goes okay then I will post a formal release in the next few days.
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

SeaVipe

  • Junior Member
  • **
  • Posts: 147
  • Windows 10 Ubuntu 18
Re: Are you adventurous? WinFBE 1.8.8 draft is ready....
« Reply #28 on: January 21, 2019, 04:48:41 PM »

Thanks, Paul,
I assumed that all the includes would be searched when F6 was pressed but that could slow down the editor if there were a lot of files to search.


When you get to working on colour settings, any chance of special colours for user defined functions/types, WinAPI etc. I've manually added key words like GetTickCount and GetLastError to freebasic_keywords.txt which sort of works. I guess I got used to FF3's colouring scheme.
Logged
Clive Richey
There is nothing government can give you that it hasn't already taken from you in the first place. Winston Churchill
Pages: 1 [2]