PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: WinFBE Suite 1.9.9 (November 17, 2019)  (Read 581 times)

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 8941
  • Windows 10
    • PlanetSquires Software
WinFBE Suite 1.9.9 (November 17, 2019)
« on: November 17, 2019, 07:45:36 PM »

Version 1.9.9 (November 17, 2019)
- Added: New method Form.ShowChild allows displaying a Form as a child (WS_CHILD). This allows forms to act like child panel controls.
- Added: ListView DoubleClick, RightClick events.
- Added: ListView Click event will now also fire if ENTER is pressed on a ListView line.
- Changed: ListView Columns.Add now only requires Text parameter with Width (default 100 pixels) and Alignment (TextAlignment.Left) being optional.
- Fixed: ListView Click event was not returning correct e.ListViewRow, e.ListViewColumn values.
- Fixed: When items are insert/remove from ListView/ListBox/ComboBox then their Index properties are now updated to accurately reflect their new position within the collections.
- Fixed: Bug in Replace All whereby start search position was incremented by length of the find phrase rather than the replace phrase.
- Fixed: Compile would fail if RichEdit exists in a project but no TextBoxes also exist in the project.

https://github.com/PaulSquires/WinFBE/releases
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 8941
  • Windows 10
    • PlanetSquires Software
Re: WinFBE Suite 1.9.9 (November 17, 2019)
« Reply #1 on: November 18, 2019, 02:43:39 PM »

For the next update I have added the ability to invoke sorting (ascending or descending) of the ListView items based on a specified SubItem/Column index.

This will allow you to do things like respond to the user clicking on a column header to toggle sorting that column ascending or descending. The internal code uses a Shell Sort that is decently fast for most purposes.

Example:

Code: [Select]
''
''
Function frmEmpPicker_lvEmployees_ColumnClick( ByRef sender As wfxListView, ByRef e As EventArgs ) As LRESULT
   ' Sort the ListView based on the column that is clicked. Toggle Ascending
   ' and Descending sorting if the same column is clicked.
   
   ' Don't sort on the first subitem as it is only the line numbers
   if e.ListViewColumn = 0 then exit function
   
   ' Toggle the sort direction if the same column has been subsequently clicked on
   if gSortColumn = e.ListViewColumn then
      gSortAscend = not gSortAscend
   end if
   
   gSortColumn = e.ListViewColumn

   frmEmpPicker.lvEmployees.BeginUpdate
   frmEmpPicker.lvEmployees.Items.SortByColumn( gSortColumn, gSortAscend )
   
   ' Update the individual row numbers. This is not necessary but I had a column at
   ' position 0 that simply displayed the row number (like Excel or other grids).
   dim as long nCount = frmEmpPicker.lvEmployees.Items.Count
   for i as long = 0 to nCount - 1         
      frmEmpPicker.lvEmployees.Item(i).SubItem(0).Text = wstr(i+1)
   next

   frmEmpPicker.lvEmployees.EndUpdate
   
   Function = 0
End Function

Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 8941
  • Windows 10
    • PlanetSquires Software
Re: WinFBE Suite 1.9.9 (November 17, 2019)
« Reply #2 on: November 18, 2019, 03:29:33 PM »

For the next update:

- Added: ListView Click event now sets e.KeyChar = 13, e.KeyCode = VK_RETURN, whenever ENTER is pressed on a selected row.
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

SeaVipe

  • Senior Member
  • ***
  • Posts: 251
  • Windows 10
Re: WinFBE Suite 1.9.9 (November 17, 2019) - Sorting
« Reply #3 on: November 18, 2019, 04:32:20 PM »

Usefull feature, Paul, will sorting work on dates?
To avoid confusion, my dates are always "dd-mmm-yyyy" as in 18-Nov-2019. Smallest to biggest with a 2 digit day, an alpha month and 4 digit year. I use a number of date handling routines to modify date such as those returned from a calendar control.
Code: [Select]

    Dim strut1 as SYSTEMTIME '' Structure
    MonthCal_GetCurSel( HWND_FRMMAIN_MONTHCALENDAR1 , @strut1 )
    Dim as Long a = DateSerial( strut1.wYear, strut1.wMonth, strut1.wDay )
    ? Format( a, "dd-mmm-yyyy" )

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: 8941
  • Windows 10
    • PlanetSquires Software
Re: WinFBE Suite 1.9.9 (November 17, 2019)
« Reply #4 on: November 18, 2019, 06:40:08 PM »

Sorting just works on the raw text (case insensitive). It doesn't know that the data is text, number, date, etc... I don't want to implement a callback functionality so if you must show your dates in your dd-mmm-yyyy format then you might also want to create a hidden column containing YYYYMMDD and sort that column in response to clicks on the dd-mmm-yyyy column,
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

SeaVipe

  • Senior Member
  • ***
  • Posts: 251
  • Windows 10
Re: WinFBE Suite 1.9.9 (November 17, 2019)
« Reply #5 on: November 18, 2019, 07:09:37 PM »

The date format is just a holdover from ages ago when we couldn't allow a user to confuse days and months and years and we only had 16 characters to display it plus the time. Not required any more.
YYYYMMDD will work just fine, 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: 8941
  • Windows 10
    • PlanetSquires Software
Re: WinFBE Suite 1.9.9 (November 17, 2019)
« Reply #6 on: November 18, 2019, 09:51:46 PM »

No problem. In my applications I display the dates as YYYY-MM-DD as it is the least confusing format and easiest to sort by, etc.
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

SeaVipe

  • Senior Member
  • ***
  • Posts: 251
  • Windows 10
WinFBE Suite 1.9.9 - Form Line Numbers
« Reply #7 on: November 19, 2019, 01:48:58 PM »

Hi Paul, __LINE__ is reporting the file's line number in forms, not the editor's line number. I thought you made mention of this ages ago but I couldn't find the post.
__LINE__ works correctly in other files.
If I need the number the form file can be kept open in NotePad++ and call GoTo line number, easy peasy.
« Last Edit: November 19, 2019, 01:54:37 PM by SeaVipe »
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: 8941
  • Windows 10
    • PlanetSquires Software
Re: WinFBE Suite 1.9.9 (November 17, 2019)
« Reply #8 on: November 21, 2019, 10:54:24 AM »

The Form`s configuration data is stored in the Form file prior to the regular code of the form. This means that whenever an error occurs I need to offset the reported compiler error line number by the number of configuration lines that exists in the form file. It is a bit of a pain but it does allow me to keep everything within one file rather than to have the form`s code in one file and the form`s configuration data in a separate file.
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 8941
  • Windows 10
    • PlanetSquires Software
Re: WinFBE Suite 1.9.9 (November 17, 2019)
« Reply #9 on: November 21, 2019, 10:56:32 AM »

See attached screenshot of how I am modifying the "New Project" dialog. It will allow you to specify a template to use when the project is initially created. This will be in the next release.

Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

SeaVipe

  • Senior Member
  • ***
  • Posts: 251
  • Windows 10
Line Numbers
« Reply #10 on: November 21, 2019, 01:27:57 PM »

This is so not a big deal but, could the form's configuration data be placed after the regular code? Or is there a way that the last form configuration line number could be an internal offset?
Logged
Clive Richey
There is nothing government can give you that it hasn't already taken from you in the first place. Winston Churchill