https://github.com/PaulSquires/WinFBE/releases
Version 1.9.5 (November 1, 2019)
- Added: ListView control.
- Added: Visual designer projects create WinFBE_VD_MAIN.bas that contains EQUATES to activate all controls that are present in the project. Thi helps reduce EXE size.
- Added: ListBox Insert method.
- Changed: Remove the Visual Designer sample project (a new one will be added in the future).
- Fixed: WinFBE project files for the those found in the "Sample_Projects" folder.
Thanks, Paul!
Early observations, ListView Events:
ListView control added to form - all events selected except ALLEVENTS , one error only: "error 18: Element not defined, OnTextChanged"
The ListView control is visible but no mods appear to be functioning; can't add anything to control, but still testing...
Thanks Clive! You are correct - the OnTextChanged should nt be there. I have now removed it and will have the fix in the next upload.
To add to the control you can use code lie the following:
''
''
Function frmMain_Initialize( ByRef sender As wfxForm, ByRef e As EventArgs ) As LRESULT
dim i as Long
i = frmMain.ListView1.Columns.Add( "Column 1", 100, TextAlignment.Left )
i = frmMain.ListView1.Columns.Add( "Column 2", 100, TextAlignment.Center )
i = frmMain.ListView1.Columns.Add( "Column 3", 100, TextAlignment.Right )
for ii as long = 0 to 99
i = frmMain.ListView1.Items.Add( "Line " & ii )
frmMain.ListView1.Item(i).SubItems.Add( "L" & ii & "Sub1" )
frmMain.ListView1.Item(i).SubItems.Add( "L" & ii & "Sub2" )
next
frmMain.ListView1.Item(0).SubItem(0).ForeColor = colors.Red
frmMain.ListView1.Item(0).SubItem(2).ForeColor = colors.Red
frmMain.ListView1.Item(2).ForeColor = colors.Blue
frmMain.ListView1.Item(2).BackColor = colors.Yellow
frmMain.ListView1.Item(2).SubItem(1).ForeColor = colors.Blue
frmMain.ListView1.SelectedIndex = 0
Function = 0
End Function
....looks like the ListView events are not firing. I am investigating.
(EDIT: This is now fixed. Stupid omission on my part).
Here is how to respond to a mouse double click and determine the item and/or subitem.
''
''
Function frmMain_ListView1_MouseDoubleClick( ByRef sender As wfxListView, ByRef e As EventArgs ) As LRESULT
? "mouse doubleclick"
dim as POINT pt
pt.x = e.x
pt.y = e.y
ScreenToClient( sender.hWindow, @pt )
dim hitinfo as LVHITTESTINFO
hitinfo.pt = pt
if ListView_SubItemHitTest( sender.hWindow, @hitinfo ) <> -1 then
? "Item = "; hitinfo.iItem
? "SubItem = "; hitinfo.iSubItem
end if
Function = 0
End Function
Hi Paul, Yesterday I had the initialization code for the ListView in a module that was calling it too early. Moving the code to frmMain_Initialize as you recommended, got it working, thanks. The Col header responds to mouse move and mouse click.
I have added a HitTest method for the ListView so that you can more easily check which Item and/or SubItem is clicked/Doubleclicked on.
''
''
Function frmMain_ListView1_MouseDoubleClick( ByRef sender As wfxListView, ByRef e As EventArgs ) As LRESULT
? "mouse doubleclick"
dim as long iItem, iSubItem
if sender.HitTest( iItem, iSubItem ) <> -1 then
? "iItem = "; iItem, "iSubItem = "; iSubItem
else
? "No ListView hit"
end if
Function = 0
End Function
I will upload a new package so that you can properly try the ListView control.
Thanks!
Great, thanks.
:(Paul
I get error messages (error 1) when I try to compile the first Project Sample pc piano. I am planning to go back to version 194 and check that one
Mark Janecki
Quote from: mjanecki on November 02, 2019, 03:28:10 PM
:(Paul
I get error messages (error 1) when I try to compile the first Project Sample pc piano. I am planning to go back to version 194 and check that one
Mark Janecki
Can anyone else duplicate Mark's problem? I don't get any errors.
Hi, i'm aa bit late to this party, but I've downloaded/installed, the 1.9.7 version from Paul's git hub, and none of the included examples work, piano included. I get various messages in compile, sometimes the only file loaded is the .fbe, and I am often getting Chinese type characters. My previous software that I have written seems to be OK. Only on 32bit at the moment. Is there an example/tutorial on the listview control?
edit to add
here's a compiler error message (64bit attempt) Failed Compile (Errors 2 Warnings 0 [2019-11-04 12:00:57])
Command Line:
C:\Users\Ray\fbetest\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\fbc32.exe -m "C:\Users\Ray\fbetest\WinFBE_Suite\Sample_Projects\FBPiano\FBPiano.bas" "" -v -s console
倀爀漀樀攀挀琀伀琀栀攀爀㘀㐀㴀ഀഀ -x C:\Users\Ray\fbetest\WinFBE_Suite\Sample_Projects\FBPiano\FBPiano.exe
error 81: Invalid command-line option, "
??????????????????"
in case not understood, it seems that the example codes are broken, not stuff I've written myself and previously saved.
Hello Paul
I don't get any errors or hints while compiling.
Good morning, Paul, no errors compiling FBPiano - WinFBE 1.9.7 Win32 Console (Release), Win64 Console (Release). I'll try with WinFBE 1.9.5 later.
All I have to do now is learn how to play the piano!
Quote from: Paul Squires on November 02, 2019, 07:08:01 PM
Quote from: mjanecki on November 02, 2019, 03:28:10 PM
:(Paul
I get error messages (error 1) when I try to compile the first Project Sample pc piano. I am planning to go back to version 194 and check that one
Mark Janecki
Can anyone else duplicate Mark's problem? I don't get any errors.
Looks like this is related to an error that fxm reported many versions ago
https://www.freebasic.net/forum/viewtopic.php?f=8&p=265796#p265744
I thought that it was fixed:
Version 1.4.8 (August 25, 2017)
- Fixed: Compiling failed in situations where spaces in file path to compiler (CreateProcess and/or FBC assembling would fail).
I will check again because maybe it is a different compile process that is failing (eg. if *.bas modules exist then they get compiled separately as part of the compile process). I will report back with a fix.
Quote from: raymw on November 03, 2019, 07:36:34 PM
Hi, i'm aa bit late to this party, but I've downloaded/installed, the 1.9.7 version from Paul's git hub, and none of the included examples work, piano included. I get various messages in compile, sometimes the only file loaded is the .fbe, and I am often getting Chinese type characters. My previous software that I have written seems to be OK. Only on 32bit at the moment. Is there an example/tutorial on the listview control?
edit to add
here's a compiler error message (64bit attempt) Failed Compile (Errors 2 Warnings 0 [2019-11-04 12:00:57])
Command Line:
C:\Users\Ray\fbetest\WinFBE_Suite\FreeBASIC-1.07.1-gcc-5.2\fbc32.exe -m "C:\Users\Ray\fbetest\WinFBE_Suite\Sample_Projects\FBPiano\FBPiano.bas" "" -v -s console
倀爀漀樀攀挀琀伀琀栀攀爀㘀㐀㴀ഀഀ -x C:\Users\Ray\fbetest\WinFBE_Suite\Sample_Projects\FBPiano\FBPiano.exe
error 81: Invalid command-line option, "
??????????????????"
in case not understood, it seems that the example codes are broken, not stuff I've written myself and previously saved.
I had corrected all of the *.wfbe project files (Jose has added them to his WinFBX sample projects). I moved the Sample Projects under the Examples folder to be in line with the way that Jose has his folder structure laid out for WinFBX. Looks like that on me development computer that I failed to remove the Sample Projects folder that already existed in the main root folder. So, you need to open the sample projects from this path .\Examples\Sample_Projects I will fix this for the next release.