PlanetSquires Forums

Please login or register.

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

Author Topic: WinFBE Suite 1.9.8 (November 7, 2019)  (Read 555 times)

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 8913
  • Windows 10
    • PlanetSquires Software
WinFBE Suite 1.9.8 (November 7, 2019)
« on: November 07, 2019, 08:55:03 PM »

Version 1.9.8 (November 7, 2019)
- Added: ListView ItemSelectionChanged event.
- Added: ListView ColumnClick event.
- Added: ListView.BeginUpdate and ListView.EndUpdate for situations when adding many items during a bulk add.
- Added: ListViewRow, ListViewColumn to the e EventArgs passed to certain ListView event handlers.
- Added: Code to manipulate ListView Columns Text, Width, Alignment, Add, Insert, Remove, Clear for situations outside of the Form's Initialize event.
- Fixed: Much faster deallocation of memory for large collections of items for controls like ListView and ListBox.
- Fixed: ListView Click event now only fires once rather then three times when fired.
- Fixed: freebasic_keywords.txt to remove duplicate entries (thanks cbruce).
- Fixed: Regression fixed whereby compile would fail for source code files that have spaces in their full path filename. However, the problem still persists if your WinFBE installation folder contains spaces. Install WinFBE to locations with folder paths containing no spaces until a permanent fix can be found for this problem.

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

SeaVipe

  • Senior Member
  • ***
  • Posts: 229
  • Windows 10
Re: WinFBE Suite 1.9.8 (November 7, 2019)
« Reply #1 on: November 07, 2019, 09:27:02 PM »

Hi Paul, the link in your post for 1.9.8 is the URL for 1.9.7  https://github.com/PaulSquires/WinFBE/releases/tag/1.9.7
Maybe it's my PC!
« Last Edit: November 08, 2019, 02:49:10 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: 8913
  • Windows 10
    • PlanetSquires Software
Re: WinFBE Suite 1.9.8 (November 7, 2019)
« Reply #2 on: November 08, 2019, 03:30:53 PM »

Sorry, I didn't "Publish" the release. It was still in Draft status.

You may see the "TreeView" icon in the ToolBox. That is still a work in progress and not yet usable.
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

raymw

  • Senior Member
  • ***
  • Posts: 355
Re: WinFBE Suite 1.9.8 (November 7, 2019)
« Reply #3 on: November 08, 2019, 09:40:14 PM »

It's there now, thanks.
Logged

raymw

  • Senior Member
  • ***
  • Posts: 355
Re: WinFBE Suite 1.9.8 (November 7, 2019)
« Reply #4 on: November 09, 2019, 09:30:55 AM »

I think i will have remembered every line of my test file before much longer.  ;)  Anyway, it takes 22 seconds to read in the file, and show the first few lines in a text box. It takes only 18 seconds to read in the file and display it in a listview, which allows scrolling over the whole file. So, I think that can count as another success for Paul.

Having programmatically selected a line e.g. frmmain.fileview.SelectedIndex = aline, how do I get that line, to show in the listview window?
Logged

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 8913
  • Windows 10
    • PlanetSquires Software
Re: WinFBE Suite 1.9.8 (November 7, 2019)
« Reply #5 on: November 09, 2019, 10:54:38 AM »

Having programmatically selected a line e.g. frmmain.fileview.SelectedIndex = aline, how do I get that line, to show in the listview window?

Not sure that I understand the question because if you know the SelectedIndex then you simply should only have to access the Item and SubItem:
frmmain.fileview.Item(aline).SubItem(0)
frmmain.fileview.Item(aline).SubItem(1)
frmmain.fileview.Item(aline).SubItem(2)
etc...

Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

raymw

  • Senior Member
  • ***
  • Posts: 355
Re: WinFBE Suite 1.9.8 (November 7, 2019)
« Reply #6 on: November 09, 2019, 12:58:25 PM »

Hi Paul,
Basically, using your example code for listview, I want to be able to enter a value of 20, say and get the display in the attached image, without altering the values in the list, or using the scroll bars. I guess in pseudo code, I'm looking for 'display.top = 20, display.bottom = 26' I just can't think of the answer at the moment.
Thanks
Logged

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 8913
  • Windows 10
    • PlanetSquires Software
Re: WinFBE Suite 1.9.8 (November 7, 2019)
« Reply #7 on: November 09, 2019, 03:10:31 PM »

Okay, you want to set the top item in the display window of the ListView to be your desired index. There is no ListView_SetTopIndex macro (even though a ListView_GetTopIndex exists). I did a quick search and adapted the code below from Gary Beene over in the PB forum:

Code: [Select]
Function ListView_SetTopIndex( byval hLV as hwnd, byval index AS Long ) AS Long
   dim rc AS RECT
   SendMessage( hLV, LVM_GETITEMRECT, 0, cast(LPARAM, @rc) )
   function = SendMessage( hLV, LVM_SCROLL, 0, (index - GetScrollPos(hLV, SB_VERT)) * (rc.Bottom - rc.Top))
End Function

Set it using:
   ListView_SetTopIndex( frmMain.ListView1.hWindow, 20 )
   frmMain.ListView1.SelectedIndex = 20
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

SeaVipe

  • Senior Member
  • ***
  • Posts: 229
  • Windows 10
Re: WinFBE Suite 1.9.8 (November 7, 2019)
« Reply #8 on: November 09, 2019, 03:23:32 PM »

Thanks, Paul, works great. (I was looking into ListView_Scroll, above my pay grade!)
Ray, Insure the mouse pointer isn't over the listview control or the Row will change from ListView_SetTopIndex( frmMain.ListView1.hWindow, some_number) to the mouse pointer position.
« Last Edit: November 09, 2019, 03:26:33 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

Josť Roca

  • Guru Member
  • *****
  • Posts: 3215
Re: WinFBE Suite 1.9.8 (November 7, 2019)
« Reply #9 on: November 09, 2019, 03:57:14 PM »

> There is no ListView_SetTopIndex macro

There is one that I prefer, Listview_EnsureViisble.

raymw

  • Senior Member
  • ***
  • Posts: 355
Re: WinFBE Suite 1.9.8 (November 7, 2019)
« Reply #10 on: November 09, 2019, 05:04:47 PM »

Thanks.
I'm coming to the conclusion, that it may not be best to have all the arrays as listviews, since I need to carry out various calculations, maybe, such as scaling the coordinates, removing ones outside or inside a particular area, and generally manipulate individual or chunks of items, and that would involve a lot of string/number conversions. I think, for my purpose it may be best to stick to the idea of using it as a viewer of lists, instead of using it as a list and viewing it.
With two lists, it is straightforward to tie together the selected items, but is it possible to get at the scroll bars, and coordinate their movements, possibly remove one scrollbar, but the other one controlling both lists?
I have a list of strings from the file, and another shorter list of a about a screen full of rows (about 80) of ten subitems. The subitems are parsed from the file list. The filelist scroll bar has a range of, say 0 to 2million, the parsed list scroll bar 0 to 80. If I select a file list line, then it can quickly parse 80 lines and display the resulting 10 or more. It would be nice to be able to get a line number directly from the scroll bar in the file list.
I've a feeling this may be an XY problem, where what I want to achieve is Y, but my thinking to get there I have to use X.

I guess I can in effect remove the scroll bar by ensuring the parsed view list is less than or equal to the number of lines it can show in the viewlist window. (for my particular, font number of rows = (frmmain.fileview.height -3)/15)
Logged

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 8913
  • Windows 10
    • PlanetSquires Software
Re: WinFBE Suite 1.9.8 (November 7, 2019)
« Reply #11 on: November 09, 2019, 05:39:59 PM »

> There is no ListView_SetTopIndex macro

There is one that I prefer, Listview_EnsureViisble.


The only problem is that EnsureVisible doesn't place the item at the top of the window area. It will only ensure that it's visible somewhere within the window.
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Josť Roca

  • Guru Member
  • *****
  • Posts: 3215
Re: WinFBE Suite 1.9.8 (November 7, 2019)
« Reply #12 on: November 09, 2019, 06:35:04 PM »

You can use:

Code: [Select]
ListView_EnsureVisible(hListview, item number + number of visible rows, TRUE)
ListView_EnsureVisible(hListview, item number, TRUE)

SeaVipe

  • Senior Member
  • ***
  • Posts: 229
  • Windows 10
WinFBE Suite 1.9.8 Main Menu and Using Older Versions
« Reply #13 on: November 09, 2019, 07:25:54 PM »

3 things I noticed:
1) I was testing an anomaly with the main menu where e.ListViewColumn and e.ListViewRow are popup choices in the Menu's Click event.
2) Any Menu choice will fire frmMain_Deactivate and associated shutdown routines. Then go on to load frmMain again (and associated startup routines) which partially locks up the program (the exit routines will still work with manual intervention but it's not very tidy).
3) I closed WinFBE 1.9.8 and opened WinFBE 1.9.0 to see if I could determine where 1 and 2 anomalies started. The older version 1.9.0 wouldn't load a ListView, a Statusbar or a Progressbar so I closed WinFBE 1.9.0 without saving or clicking on anything. Tried 1.9.1 and the same thing so I reverted back to the current 1.9.8 release and the ListView, StatusBar and ProgressBar were still missing...

I added the 3 (new) controls to frmMain and positioned and sized them roughly as before and all works the way it did before opening in 1.9.0.

Added note:
It appears as though after frmMain_MainMenu_Click() code resumes somewhere it shouldn't. I placed a Return 0 immediately after the first Select Case Str( sender.Name ) > Case "mnuExit" and the problem is still there.

More: I placed a Return 0 as the first line of code in frmMain_MainMenu_Click() and nothing happens until I give the Console focus then frmMain_Deactivate fires and all that entails (threads detach etc...).
« Last Edit: November 09, 2019, 09:30:10 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

raymw

  • Senior Member
  • ***
  • Posts: 355
Re: WinFBE Suite 1.9.8 (November 7, 2019)
« Reply #14 on: November 09, 2019, 08:08:40 PM »

Thanks. If got it to work quite nicely with
Code: [Select]
ListView_EnsureVisible(frmmain.fileview.hwindow  ,frmmain.fileview.selectedindex +displaylines-1,TRUE) I found it interesting, calculating the number of lines for the multicolumn listview, to ensure that the number of rows is no more than will fit in, so that the vertical scroll bar is not present for that list view, then having to subtract 1 since the fileview listview has a horizontal scrollbar. And then, if I change the font?

At the end, when this is all working, it will look very simple. If I need to go back and modify it, it will give me yet more headaches, a bit like programming in APL, but in that case you spent a day writing a line of hieroglyphics to change the world, the next day you found it hadn't, and you could never understand what you had written, and neither could anyone else.

edit to add - I've been testing the font sizes. It used to be that font sizes were in points, 72 to the inch, but that was in the analogue world. However, in Windows, it appears that the same size value for courier heights are less than the segoe ui, for example. By empirical testing, I have found, that for a text box and segoe ui, that the (font size * 1.83 ) +6 gives a usable text box height, for the usual range of font sizes, say 6 to 20. for courier, it is something like font size*1.4.
« Last Edit: November 11, 2019, 03:10:51 PM by raymw »
Logged
Pages: [1] 2