PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 10 11 [12]

Author Topic: José, if you're bored...  (Read 4343 times)

José Roca

  • Moderator
  • Master Member
  • *****
  • Posts: 3103
    • Jos
Re: José, if you're bored...
« Reply #165 on: September 14, 2018, 05:29:45 PM »

Hi guys, if you're bored... you can test a new data type, CInt96.

CInt96 is a wrapper class for the DECIMAL data type. Holds signed 128-bit (16-byte) values representing 96-bit (12-byte) integer numbers. The largest possible value is +/-79,228,162,514,264,337,593,543,950,335.

Documentation: https://github.com/JoseRoca/WinFBX/blob/master/docs/Numeric%20datatypes/CInt96%20Class.md

Johan Klassen

  • FireFly3 Registered User
  • Junior Member
  • *
  • Posts: 73
  • FF3 User
Re: José, if you're bored...
« Reply #166 on: September 14, 2018, 08:04:41 PM »

hello José Roca
my small test show that it works ok, tried both 32 and 64 bit, thanks José
Logged

José Roca

  • Moderator
  • Master Member
  • *****
  • Posts: 3103
    • Jos
Re: José, if you're bored...
« Reply #167 on: September 14, 2018, 09:00:40 PM »

Thanks for testing. There are many big numbers libraries, but this class if fast, and 29 digits should be enough for most tasks.

José Roca

  • Moderator
  • Master Member
  • *****
  • Posts: 3103
    • Jos
Re: José, if you're bored...
« Reply #168 on: September 16, 2018, 11:21:46 AM »

New class: CMemMapFile (memory-mapped files).

Documentation:
https://github.com/JoseRoca/WinFBX/blob/master/docs/File%20Management/CMemMapFile%20Class.md

Wikipedia article:
https://en.wikipedia.org/wiki/Memory-mapped_file

Usage example:

Example
The following code maps the contents of the ansi file "textA.txt", retrieves access to the data and converts it to lower case.

Code: [Select]
#INCLUDE ONCE "windows.bi"
#INCLUDE ONCE "Afx/CMemMapFile.inc"

DIM pMemMap AS CMemMapFile
IF pMemMap.MapFile(AfxGetExePath & "/testA.txt") THEN
   DIM pData AS ANY PTR = pMemMap.AccessData(100)
   IF pData THEN
      CharLowerBuffA(pData, pMemMap.GetFileSize)
      pMemMap.UnaccessData
   END IF
   pMemMap.Unmap
END IF

Unicode:

Code: [Select]
#INCLUDE ONCE "windows.bi"
#INCLUDE ONCE "Afx/CMemMapFile.inc"

DIM pMemMap AS CMemMapFile
IF pMemMap.MapFile(AfxGetExePath & "/testW.txt") THEN
   DIM pData AS ANY PTR = pMemMap.AccessData(100)
   IF pData THEN
      CharLowerBuffW(pData, pMemMap.GetFileSize)
      pMemMap.UnaccessData
   END IF
   pMemMap.Unmap
END IF
« Last Edit: September 16, 2018, 11:26:08 AM by José Roca »
Logged

José Roca

  • Moderator
  • Master Member
  • *****
  • Posts: 3103
    • Jos
Re: José, if you're bored...
« Reply #169 on: September 16, 2018, 04:00:17 PM »

CMaskEdit: Fixed a problem with Undo not working after deleting characters.
« Last Edit: September 16, 2018, 04:12:24 PM by José Roca »
Logged

José Roca

  • Moderator
  • Master Member
  • *****
  • Posts: 3103
    • Jos
Re: José, if you're bored...
« Reply #170 on: September 17, 2018, 03:28:42 AM »

CMaskedEdit

- Removed the DisableMask method. It was causing many problems and it is not needed: if you want an standard edit control, use it instead of a MskedEdit control with the mask disabled.

- Changed SetWindowText to SetText, GetWindowTextLength to GetTextLenght, and GetWindowText to GetText.

- Added SetMaskedText.

- The cursor now is positioned automatically at the beginning of a group, without having to call SetPos.

Documentation updated:
https://github.com/JoseRoca/WinFBX/blob/master/docs/Windows%20GUI/CMaskedEdit%20Class.md

Paul Squires

  • Administrator
  • Master Member
  • *****
  • Posts: 8613
  • Windows 10
    • PlanetSquires Software
Re: José, if you're bored...
« Reply #171 on: October 14, 2018, 12:11:26 PM »

Hi José,

Just starting to use the new masked edit control and integrate it into the WinFBE visual designer. I am integrating the control's properties and methods. Here are some of my initial thoughts (your thoughts on these would be appreciated)....

EnableGetMaskedCharsOnly - is this redundant? The GetText method allows retrieving text with or without the mask via the optional true/false bGetMaskedCharsOnly parameter. Why include this property?

SetMaskedText - why not just use SetText and add an additional true/false parameter that specifies that the pointed to text has (or doesn't have have) a mask in it? This would be consistent with the logic used by GetText.

GetTextLength - doesn't seem to be documented in your GitHub docs repository.

Thanks for your hard work on this control. It be a great addition to the visual designer!

Paul
Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor

José Roca

  • Moderator
  • Master Member
  • *****
  • Posts: 3103
    • Jos
Re: José, if you're bored...
« Reply #172 on: October 14, 2018, 05:56:31 PM »

Welcome back! I was waiting for your input before doing cleanup. Meanwhile I have been experimenting with Oxygen Basic because this forum is dead if you're on vacation.

I first tried to mimic the original control, then I changed several things and now I have implemented your suggestions and updated the documentation.
« Last Edit: October 14, 2018, 07:35:26 PM by José Roca »
Logged

Paul Squires

  • Administrator
  • Master Member
  • *****
  • Posts: 8613
  • Windows 10
    • PlanetSquires Software
Re: José, if you're bored...
« Reply #173 on: October 14, 2018, 06:02:38 PM »

:-) I have been back a couple of weeks now but busy getting up to speed with my regular day job. Finally have time now to get back at the editor. I have noticed your activity with Oxygen Basic.

One thing I have been toying with is documentation. I love the markdown approach to documentation but the only downside is viewing it when you're offline (exporting to pdf doesn't always look good). I have been thinking of using a markdown parser to convert the markdown to html and then combine it with the github markdown css. Finally, display it all in an embedded web browser control within WinFBE. In theory, it all seems to be do-able and would make for a nice help system rather than CHM files.
Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor

José Roca

  • Moderator
  • Master Member
  • *****
  • Posts: 3103
    • Jos
Re: José, if you're bored...
« Reply #174 on: October 14, 2018, 06:11:50 PM »

I'm using markdown because I can made changes to the documentation instantaneously, instead of having to prepare new .chm files. Besides, HelpNDoc is awfully slow with big help files like the WinFBX documentation and Help+Manual is expensive.

Paul Squires

  • Administrator
  • Master Member
  • *****
  • Posts: 8613
  • Windows 10
    • PlanetSquires Software
Re: José, if you're bored...
« Reply #175 on: October 14, 2018, 06:21:20 PM »

I agree 100%. I was using markdown a bit for my winformsx documentation before I switched to pdf. It was so incredibly easy to write and looks really nice. I think we can leverage the markdown format to get something working nicely inside WinFBE that should easily display your existing markdown files as well as be easily expandable for the long term. I have always hated the whole process of creating CHM files.
Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor

José Roca

  • Moderator
  • Master Member
  • *****
  • Posts: 3103
    • Jos
Re: José, if you're bored...
« Reply #176 on: October 14, 2018, 07:35:10 PM »

Added an small change to the new overloaded SetText function (I was doing nothing with the bSetMaskedCharsOnly parameter).

Code: [Select]
' ========================================================================================
' Sets masked text to the control.
' ========================================================================================
PRIVATE FUNCTION CMaskedEdit.SetText (BYREF cwsText AS CWSTR, BYVAL bSetMaskedCharsOnly AS BOOLEAN) AS BOOLEAN
   DIM cws AS CWSTR = cwsText
   IF bSetMaskedCharsOnly THEN
      FOR i AS LONG = 1 TO LEN(m_strInputTemplate)
         IF MID(**cws, i, 1) = MID(**m_strInputTemplate, i, 1) THEN MID(**cws, i, 1) = "_"
      NEXT
      cws = AfxStrRemoveAny(cws, "_")
   END IF
   FUNCTION = this.SetText(cws)
END FUNCTION
' ========================================================================================

Paul Squires

  • Administrator
  • Master Member
  • *****
  • Posts: 8613
  • Windows 10
    • PlanetSquires Software
Re: José, if you're bored...
« Reply #177 on: October 14, 2018, 07:44:20 PM »

...I have been thinking of using a markdown parser to convert the markdown to html and then combine it with the github markdown css. Finally, display it all in an embedded web browser control within WinFBE. In theory, it all seems to be do-able and would make for a nice help system rather than CHM files.
We already have code in your Templates folder to create and embedded web browser and display either a html string or file. It might now just be a case of adding a client side javascript code file to take the string/file and render the markdown as html in the embedded browser. Something like showdownjs or markedjs might do the trick.
Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor

Paul Squires

  • Administrator
  • Master Member
  • *****
  • Posts: 8613
  • Windows 10
    • PlanetSquires Software
Re: José, if you're bored...
« Reply #178 on: October 17, 2018, 05:07:33 PM »

Okay, here is what my approach will be to the help/documentation for WinFBE and WinFBX, etc.

Instead of CHM files, I am building a form that will show a treeview on the left, a tab control on top, and an embedded web browser control on the right. The tab control will have tabs for "WinFBE", "WinFBX", etc...  Depending on what tab is selected, the treeview will display the folder structure of the help files. When a file is selected then that help topic will be rendered in the embedded web browser.

To generate the HTML files to display in the web browser, I will run all the documentation markdown files (*.md) through a batch converter to create standalone stylized HTML files in the exact same format as GitHub markdown. This is accomplished via this process:

Use Pandoc to batch convert the markdown files to HTML
https://pandoc.org/

The command line looks like (ran via a batch file):
pandoc -f markdown -t html5 -o "%2" "%1" -c ".\github.css" --self-contained

%1 is the input markdown file
%2 is the html file

The "github.css" is the specific stylesheet that gives the final HTML file its look and feel of a github markdown file. I am using the css from:
https://github.com/otsaloma/markdown-css

Using this approach it will be easier to create help documentation for WinFBE and the visual designer, as well as easily work with Jose's new markdown files that he is using to document the WinFBX library.





Logged
Paul Squires
PlanetSquires Software
FireFly Visual Designer, WinFBE Editor
Pages: 1 ... 10 11 [12]