Version 1.9.4 (October 1, 2019)
- Fixed: Updated the WinFBE.ini file to correct path to compiler.
- Fixed: Added missing Win32 GCC 5.2 toolchain support files.
- Fixed: Removed the Tool UPX.
- Fixed: Created a SetCompilerSwitches.ini configuration file for the SetCompilerSwitches Tool.
https://github.com/PaulSquires/WinFBE/releases
Hello Paul
Many thanks for the new version.
I got an error while compiling a resource file.
The error was not caused by WinFBE, but by the resource compiler. :-)
Therefore I replaced "gorc.exe" with the current version and the error message is now a thing of the past. You can download the current version from http://godevtool.com/Gorc.zip .
Maybe it is possible to release the current version with the next update of WinFBE.
Thanks Joerg, in my previous distributions I would include the current Gorc but for this one I simply used the 1.07.1 release that CoderJeff produced and I expect that it must have had the older Gorc. I'll have to remember to always replace that file with the newer version one.
Hello Paul
... then it will probably be the better solution if Jeff adds the newer version to the distribution.
Maybe someone from here with access to the FreeBasic forum can point this out and ask him for it.
I think you have enough to do to keep it in mind.
Hello Paul
I noticed that in the 64bit version of Winfbe, the program does not open the template window.
When I try this, WinFBE crashes.
In the 32bit Version the "problem" does not occur.
Quote from: Joerg Buckel on October 03, 2019, 02:14:19 PM
Hello Paul
I noticed that in the 64bit version of Winfbe, the program does not open the template window.
When I try this, WinFBE crashes.
In the 32bit Version the "problem" does not occur.
Odd, it doesn't seem to crash on my computer. I'll try it on a different computer this evening. (both are Windows 10).
Hello Paul
I reinstalled the release version of WinFBE 1.9.4.
Now the opening of the template window also works in the 64bit version.I used a compressed version with about 444Kb from the source code archive.
The size from the Releasearchive now is about 1.002Kb.
I think that probably an error was caused by the strong compression.
My hint is done.
Hi Paul, Thanks again. I think you've fixed the textbox case/casing snag, too.
windows 10 and winfbe editor in task bar, having been using it. Curser over task bar icon, it shows the editor screen only, just above the icon, but the full screen shows the editor and the gui toolbox. Clicking the icon, the editor opens, gui toolbox disappears. Hovering over task bar icon, when editor is full screen, it just shows the editor, as it should. The program was not using or showing the gui toolbox when put on task bar, but the toolbox window shows the last toolbox window that was used. Seems quite consistent, - open winfbe, load/write a program with a form, open the designer, close designer, shrink program to task bar. I've not noticed it before, and wonder if it is connected with the erroneous border styles I am getting with 1.9.4
I created a form for trying out the gdiplus graphics. I created another form with a button and text box to send xy coordinates to the graphics. I have spent literally days, trying to understand this graphics stuff. (That is not the point of this query, exactly.) I tried sharing whatever variable/objects that I could, so that the button form could have access to the graphics form. I've been adding and commenting out code, and more or less got it working almost in the way I want. I commented out all the shared items, and it seemed to still keep running.
The button form calls a function to set up the graphics - makegraphics(oform,esend) where oform and esend were the original shared values for the graphic window sender and event. The dim shared oform and dim shared esend are commented out. If I remove the makegraphics(oform,esend) line from the button-click code, the line is not drawn, if I change it to, say, makegraphics(anyform, anysend) in the function call, the compiler throws an error wrt undefined variable. If I leave it as makegraphics(oform,esend), it draws the line whether or not the dim shareds are commented out. That infers to me, that even though they are commented out, the variables are still recognised on compiling. There are no other references in the program to oform or esend.
Hi Ray,
You may want to start posting your sample project files to your posts so that we can see the actual code. I have a hard time understanding the logic flow of your program just from the description you've posted.
Thanks Paul, for offering to look. I'm not sure if it will duplicate on your pc, but if you want to try, it was based on your code from a week or two back, I wanted to plot more than one line from some other 'form', not all at one go, so I moved things around a bit. Much of the cgi graphic help is based on .net, it seems, so it was pretty much guess work as to where the boundaries between the form, graphic and pen,brush were. Anyway, as usual, it gets in a bit of a mess, but this version was as near as I got, but I'm uncertain as to how much is from what is seen here, if unseen code is sort of hanging around from previous iterations.
the graphics drawing form
''
'' Remove the following Application.Run code if it used elsewhere in your application.
'dim shared pGraphCtx AS CGraphCtx ptr
const IDC_GRCTX = 2000
dim shared ngraphics as cgpgraphics =hdc
' ========================================================================================
' The following example draws a line.
' ========================================================================================
SUB Example_DrawLine (x1 as single,y1 as single,x2 as single,y2 as single)
' // Create a graphics object from the window device context
' // Draw the line
DIM blackPen AS CGpPen = CGpPen(GDIP_ARGB(255, 0, 0, 0), 3)
ngraphics.DrawLine(@blackPen, x1,y1,x2,y2)
?x1,y1
END SUB
' ========================================================================================
function makegraphics(byref sender as wfxform,byref e as eventargs) as lresult
pGraphCtx = new CGraphCtx( sender.pWindow, _
IDC_GRCTX, "drawing", _
px, py, _
sender.ClientSize.Width-100, _
sender.ClientSize.Height-100)
ahdc = pGraphCtx->GetMemDc
ngraphics =ahdc
DIM rxRatio AS SINGLE = ngraphics.GetDpiX / 96
DIM ryRatio AS SINGLE = ngraphics.GetDpiY / 96
ngraphics.ScaleTransform(rxRatio, ryRatio)
function=0
end function
''
''
Function frmMain_Load( ByRef sender As wfxForm, ByRef e As EventArgs ) As LRESULT
px=50
py=50
makegraphics(sender,e)
' pGraphCtx->Clear BGR(255, 255, 255)
function = 0
End Function
''
''
Function frmMain_FormClosed( ByRef sender As wfxForm, ByRef e As EventArgs ) As LRESULT
if pGraphCtx then Delete pGraphCtx
Function = 0
End Function
''
''
Function frmmain_Resize( ByRef sender As wfxForm, ByRef e As EventArgs ) As LRESULT
' DIM hdc AS HDC = pGraphCtx->GetMemDc
' // Draw the graphics
Example_DrawLine( 100,100,600,200)
example_drawline(60,60,400,200)
' pgraphcts.setvirtualbuffersize(80,80)
Function = 0
End Function
''
''
''
''
Function frmmain_Move( ByRef sender As wfxForm, ByRef e As EventArgs ) As LRESULT
makegraphics(sender,e)
example_drawline(90,40,800,70)
Function = 0
End Function
''
''
the button form (start)
''
'' Remove the following Application.Run code if it used elsewhere in your application.
Application.Run(start)
#include "paulsagain.bas"
''
''
SUB DrawLine (x1 as single,y1 as single,x2 as single,y2 as single)
' // Create a graphics object from the window device context
' DIM graphics AS CGpGraphics = ahdc
' ' // Get the DPI scaling ratios
' DIM rxRatio AS SINGLE = graphics.GetDpiX / 96
' DIM ryRatio AS SINGLE = graphics.GetDpiY / 96
' // Set the scale transform
' graphics.ScaleTransform(rxRatio, ryRatio)
' // Draw the line
DIM blackPen AS CGpPen = CGpPen(GDIP_ARGB(255, 0, 0, 0), 3)
' ngraphics.DrawLine(@blackPen, x1,y1,x2,y2)
?x1,y1
END SUB
Function start_Click( ByRef sender As wfxForm, ByRef e As EventArgs ) As LRESULT
Function = 0
End Function
''
''
Function start_Load( ByRef sender As wfxForm, ByRef e As EventArgs ) As LRESULT
frmmain.show
Function = 0
End Function
''
''
Function start_Button1_Click( ByRef sender As wfxButton, ByRef e As EventArgs ) As LRESULT
makegraphics(oform,esend)
example_drawline(val(start.text1.text),100,300,400)
' drawline(val(start.text1.text),100,400,300)
Function = 0
End Function
note this is altered since I mentioned first, but should explain - it only compiles/runs if makegraphics (oform,esend) is in the start_button function. Leave it out, line is not drawn, change oform/esend to other names, it does not compile. At one stage there was a dim shared graphics with oform and esend. but that was commented out, and since deleted, but it seems something is still hanging on. I would expect it to not compile with the makegraphics line, or if it did compile it would do so with anything instead of oform/esend.
Basically, what I'm trying to do, is draw a number of lines by clicking the button and changing the text value (that is not he ultimate goal, but if I can't do that, then I'll have to do something else). It only displays the last line. The size change and move for the frmmain lines also are not displayed at the same time, but you can see both sets of lines when the form is moved. Something obviously I do not understand, but it does not help when commented out code still appears to function. I've checked as best as I can in the include files code, but they have no oform or esend within.
edit to add.
The frmmain form, the first code window above, runs fine, no compile errors in the original project. It should run outside of the project. Copying the code, as above, and creating a frmmain form, with the various events needed, throws a number of compiler errors (referring to items that were once shared in the original project)
such as
Variable not declared, hdc
Variable not declared, pGraphCtx
Variable not declared, ahdc
Hello Paul
I've often had "test projects" quit after compiling and starting as soon as a status bar was inserted.
I haven't searched for the error myself yet.
As soon as the status bar was deactivated, the program worked again.
I once attached a very small test project without much code in the attachment. In the two Exe-files
In the example there is only one form with frame, buttons, a status bar with four fields (0-3) with assigned labels. But only the first label is displayed.
There is no difference whether the individual fields are named immediately or during initialization.
Hello Paul
When I include an empty resource file, I don't get this behavior.
Then it's not WinFBE.
But what is wrong with the resource file?
VERSION_INFO VERSIONINFO
IDR_ICON ICON ".\Key.ico"
#define IDR_VERSION1 1
IDR_VERSION1 VERSIONINFO
FILEVERSION 0,0,0,1
PRODUCTVERSION 0,0,0,1
FILEOS 0x00000004
FILETYPE 0x00000001
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040704B0"
BEGIN
VALUE "FileVersion", "0.0.0.1\0"
VALUE "ProductVersion", "0.0.0.1\0"
VALUE "CompanyName", "CompanyName\0"
VALUE "FileDescription", "FileDescription\0"
VALUE "InternalName", "InternalName\0"
VALUE "LegalCopyright", "LegalCopyright ©2019\0"
VALUE "LegalTrademarks", "LegalTrademarks\0"
VALUE "OriginalFilename", "OriginalFilename.exe\0"
VALUE "ProductName", "ProductName.exe\0"
VALUE "Information", "Information ©2019\0"
VALUE "Nutzen", "Nutzen.\0"
VALUE "Hinweis", "Hinweis\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0407, 0x04B0
END
END
Good morning together
My "problem" has resolved.
The error was, as often before, 80 cm in front of the monitor. :-)
If the resource file still contains
1 24 ".\manifest.xml"
everything works.
I have not got to the cause of the apparent peculiar behaviour of my commented code mentioned in my post #11 above. Anyway, I've started again, and found that I can generate lines form outside the frmmain form, but the frmmain form needs to either have its size changed or hide the form and then show it again before the lines are visible. I mentioned in another thread, that when a form is loaded, it seems to do a move and resize. A manual move does not cause a 'visible redraw', but a resize does.
Hi Ray,
If all you're trying to do is fire Form1_resize, then Form1.Width = Form1.Width + 1 will do that (of course).
:o)
Thanks for the suggestion Clive. Not exactly what i was getting at, but the resize is 'smoother' compared to hiding/showing form. It is the resizing of the graphic that i am aiming for.
Anyway, if you want to play, then I've attached code below. Design a form, named form1, (just for a change...) have a form load event and have a button with a click event and a textbox. The idea being to enter a number in the text box, click the button, and it draws a line related to the number entered. Make this the main file in winfbe
''
' named as "start18oct.bas"
'' Remove the following Application.Run code if it used elsewhere in your application.
application.Run(form1)
#include "oct18test.bas"
''
''
Function Form1_Button1_Click( ByRef sender As wfxButton, ByRef e As EventArgs ) As LRESULT
dim v as single
v=val(form1.text1.text)
drawahdc(v)
'uncomment the four comments below for a number of lines
' for j as integer = -1000 to 1000 step 10
' v=j
' drawahdc(v)
' next
plotform.width = plotform.width+1
plotform.width = plotform.width-1
Function = 0
End Function
''
''
Function Form1_Load( ByRef sender As wfxForm, ByRef e As EventArgs ) As LRESULT
plotform.Show
Function = 0
End Function
Also create another form, named plotform, and select closed, resize and load events and use the code for that form as below (change the #include "oct18test.bas" in above code to match the name by which you saved the following code).
' You should always include a resource file that references a valid manifest.xml
' file otherwise your application will not properly display Windows themed controls.
' Sample resource.rc and manifest.xml files can be found in the WinFBE \Settings folder.
' The following WinFBE directive includes the resource in your application. Simply
' uncomment the line.
' If you are using WinFBE's project management features then delete the following line
' because a resource file will be generated automatically.
' '#RESOURCE "resource.rc"
' named as "oct18test.bas"
#INCLUDE ONCE "Afx/CGdiPlus/CGdiPlus.inc"
#INCLUDE ONCE "Afx/CGraphCtx.inc"
''
'' Remove the following Application.Run code if it used elsewhere in your application.
dim shared pGraphCtx AS CGraphCtx ptr
dim shared ahdc as hdc
const IDC_GRCTX = 2000
SUB drawahdc(v as single)
' // Create a graphics object from the window device context
DIM graphics AS CGpGraphics = ahdc
' // Get the DPI scaling ratios
DIM rxRatio AS SINGLE = graphics.GetDpiX / 96
DIM ryRatio AS SINGLE = graphics.GetDpiY / 96
' // Set the scale transform
graphics.ScaleTransform(rxRatio, ryRatio)
' // Draw the line
DIM blackPen AS CGpPen = CGpPen(GDIP_ARGB(255, 0, 0, 0), 3)
graphics.DrawLine(@blackPen, 100.0, 200.0, 500.0, v)
END SUB
' ========================================================================================
''
''
Function plotform_Load( ByRef sender As wfxForm, ByRef e As EventArgs ) As LRESULT
' // Add a graphic control
pGraphCtx = new CGraphCtx( sender.pWindow, _
IDC_GRCTX, "", _
0, 0, _
sender.ClientSize.Width, _
sender.ClientSize.Height)
pGraphCtx->Clear BGR(255, 255, 255)
' // Get the memory device context of the graphic control
DIM thdc AS HDC = pGraphCtx->GetMemDc
ahdc=thdc
' // Draw a line
drawahdc(80)
function = 0
End Function
''
''
Function plotform_FormClosed( ByRef sender As wfxForm, ByRef e As EventArgs ) As LRESULT
if pGraphCtx then Delete pGraphCtx
Function = 0
End Function
''
''
Function plotform_Resize( ByRef sender As wfxForm, ByRef e As EventArgs ) As LRESULT
Function = 0
End Function
When you run the program, then a line is drawn, and entering a number in the form1.text1 field and clicking the button, draws another line (provided the number is not 80, you will see it). The part that I'm now trying to sort out, is to be able to resize the graphic, without losing the lines. At the moment the graphic is created, sized and located by the attributes given in the cgraphctx constructor, but I've not found an example or information on how to alter those values after construction. It may be necessary to destroy the object and recreate in the new size, hopefully not.
Just after you create the control, set its Resizable property to TRUE: pGraphCtx->Resizable = TRUE.
You can change its size with the CWindow methods MoveWindow or SetWindowPos.
If resizable, the virtual buffer is set to the size of the control. If the control is made smaller and then bigger, part of the contents are lost. Therefore, the caller must redraw it. Resizable and stretchable are mutually exclusive.
BTW regarding a post that you seem to have deleted:
Quote
As you may know, I am struggling with getting to grips with the cgigraphics, for various reasons. However, I am coming across a number of what I think are typos/errors in the winfbx help file. Do you want me to send any that I spot to you, or to Paul, as I'm not knowing who is looking after that part of winfbe? The sort of thing, 'simple' instead of 'single' mix up of width and height, and the like.
If you find errors in the documentation, please report them. I maintain the documentation of the WinFBX framework and Paul the ones about the WinFBE editor and the WinFormsX.
Thanks Jose for your help wrt the graphics. It was an email I sent you wrt the typos, not a post on here. If you and Paul want them reported, then it may be as well to have a separate thread or similar, so they could be collected together, or would pm's/emails be better? It is most likely not many.
You can send personal messages.
OK, thanks, Jose. I've got into a bit of a tangle with trying to do the resize. Then I decided an interim way out, is to simply make the graphic much bigger then whatever I may need for whatever I'm drawing. Even if I had sorted out the resizing, I would still have to adjust the position of whatever was there, zoom factor/whatever. Most forms only resize by dragging right and bottom borders anyway.
Quote from: Joerg Buckel on October 03, 2019, 02:14:19 PM
Hello Paul
I noticed that in the 64bit version of Winfbe, the program does not open the template window.
When I try this, WinFBE crashes.
In the 32bit Version the "problem" does not occur.
Dodicat has the same problem in the FreeBasic forum.
https://freebasic.net/forum/viewtopic.php?f=8&t=25215&start=600 (https://freebasic.net/forum/viewtopic.php?f=8&t=25215&start=600)
The "problem" appears in the different versions of WinFBE.
If I take your source code and compile with
Quote-x "..\WinFBE64.exe" -gen gcc -target win64
, I get as a result a 64bit version in which the Templates window works without problems.