FireFly Visual Designer for FreeBASIC (Updated March 8, 2016)

User projects written in or related to FreeBASIC.
Post Reply
PaulSquires
Posts: 1002
Joined: Jul 14, 2005 23:41

Re: FireFly Visual Designer for FreeBASIC (Updated Aug 15, 2

Post by PaulSquires »

Hi josnan,

This is not a FireFly problem but rather a error in the WinAPI include files. Check out this thread that discusses the problem:
http://www.freebasic.net/forum/viewtopi ... =3&t=23728

Thanks,
Paul
PaulSquires
Posts: 1002
Joined: Jul 14, 2005 23:41

Re: FireFly Visual Designer for FreeBASIC (Updated Aug 15, 2

Post by PaulSquires »

FireFly for FreeBASIC v3.77 uploaded:
http://www.planetsquires.com/firefly_freebasic.html
FireFly3 - 3.77 (Released 2015-09-17)
=========================
- 0000930: [Bug] FB: StatusBar Panels were not being code generated correctly in 64-bit Windows (Paul Squires) - closed.
- 0000927: [Change] FB: Updated many topics in Help file removing reference to PowerBASIC specific items (Paul Squires) - closed.
- 0000928: [New Feature Request] FB: Multilanguage (localization) support for projects (Paul Squires) - closed.
- 0000929: [Change] FB/PB: Updated Reference info to change GetWindowLong/SetWindowLong to GetWindowLongPtr/SetWindowLongPtr (Paul Squires) - closed.
- 0000926: [Change] FB: Updated code generated for manifest file to include compatibility sections. (Paul Squires) - closed.
- 0000925: [New Feature Request] FB: Adding #DEFINE FF_NOSCALE to FF_AppStart will disable all screen resolution scaling (Paul Squires) - closed.
- 0000924: [Bug] FB: Code generation for Custom Control tool was incorrectly applying screen resolution scaling (Paul Squires) - closed.
- 0000923: [Change] FB/PB: Corrected code generation for toolbar buttons with text strings (Paul Squires) - closed.
- 0000922: [New Feature Request] FB: Linking Errors are now detected during the compiling process. (Paul Squires) - closed.
- 0000921: [Change] FB: Moved "Show console" general compiler option to Project Properties (Paul Squires) - closed.
- 0000920: [New Feature Request] FB: Added 33 new FireFly string functions to Functions Library (Paul Squires) - closed.
In addition to the new 33 FireFly string functions (that emulate all of PowerBASIC's good string functions), I have included support to create applications with "Localization".

From the Help file:
Projects can be created that allow the end user to select the language that they wish for the application to use. This concept, known as localization, allows the developer to create an application using the spoken language of their choice (eg. English) but have the user graphical display (menus, toolbars, statusbar, message boxes, etc) display using text based on the user's choice (for example, French or German).

You must enable support for Multilanguage projects from the "Project Properties" dialog.

During the code generation phase of a FireFly compile, FireFly will search all menus, toolbar buttons that contain text, statusbars (simple and panels), and automatically generate a file in the application folder called "default.lang". That file is a simple text file that can be viewed in any text editor. The format of the file is extremely simple. Each line represents a key/value pair separated by an equals "=" sign. The key is to the left of the equals sign and the value/data is to the right of the equals sign.

For example:

FORM1 =My Aplication
6000|FORM1_MNUFILE =&File
6001|FORM1_MNUFILENEW =&New\tCtrl+N
6002|FORM1_MNUFILEOPEN =&Open...\tCtrl+O
6004|FORM1_MNUFILECLOSE =&Close\tCtrl+Q
6005|FORM1_MNUFILECLOSEALL =C&lose All
6007|FORM1_MNUFILESAVE =&Save\tCtrl+S
6008|FORM1_MNUFILESAVEAS =Save &As...\tF12
6009|FORM1_MNUFILESAVEALL =Sa&ve All
6011|FORM1_MNUFILEPRINT =&Print...\tCtrl+P
6013|FORM1_MNUFILERECENTFILES =&Recent Files
6014|FORM1_MNUMOSTRECENTLYUSED =Most Recently Used
6016|FORM1_MNUFILECOMMANDPROMPT =Co&mmand Prompt...\tCtrl+D
6018|FORM1_MNUFILEEXIT =E&xit
FORM1_COMMAND1 =Command1
FORM1_LABEL3 =Label3
FORM1_LABEL2 =Label2
FORM1_LABEL1 =Label1
MSGBOX_CAPTION =MyMessageBox
MSGBOX_TEXT =This is my message box text.\rAnd this is the second line.

To create a new localization language you simply need to make a copy of the "default.lang" file and rename it to the language of your choice (for example, French.lang or German.lang). You would then change each data portion of each line to the corresponding new language (that is, in the above example you would change "My Application", "&File", "&New\tCtrl+N", etc...).

For menu entries, do not change the keyboard accelerators. Those are the values after the "\t".

Take notice of the last two lines in the above example:

MSGBOX_CAPTION =MyMessageBox
MSGBOX_TEXT =This is my message box text.\rAnd this is the second line.

Those are user defined values are for a message box that is presented to the end user. The definition for these values are defined directly in the code for the program as follows:

'--------------------------------------------------------------------------------
Function FORM1_COMMAND1_BN_CLICKED ( _
ControlIndex as Integer, _ ' index in Control Array
hWndForm as HWnd, _ ' handle of Form
hWndControl as HWnd, _ ' handle of Control
idButtonControl as Integer _ ' identifier of button
) as Integer

' Let the programmer define a key/data multilanguage pair that FireFly
' will recognize during parsing.

'MULTILANG: MSGBOX_CAPTION=MyMessageBox
'MULTILANG: MSGBOX_TEXT=This is my message box text.\rAnd this is the second line.
Select Case MessageBox( hWndForm, FF_GetLangSt("MSGBOX_TEXT"), FF_GetLangSt("MSGBOX_CAPTION"), _
MB_OK Or MB_DEFBUTTON1 Or MB_APPLMODAL )
Case IDOK
End Select

Function = 0 ' change according to your needs
End Function


You must use the 'MULITLANG: identifier to signal to FireFly that during parsing you want the key/data that follows the label to represent a multilanguage definition to be output to the "default.lang" file. These 'MULTILANG tags do not have to appear directly next to the place where you intend to use them (although that makes reading the code much easier). You could place all of them in a separate code module or in FF_APPSTART if you wish.

Notice that for the MSGBOX_TEXT key that the data values contains a "\r" embedded "carriage return" specifier. When FireFly loads this string it will replace the \r with a Chr(13,10) in order to break the string into multiple lines.

When multilanguage support is enabled for a project, FireFly will automatically add code your project that loads your language of choice and puts the key/value pairs into an extremely small and fast hash data structure. To retrieve the text you use the built in FireFly function call FF_GetLangSt (this roughly means "Get Language String").

To load your desired language you call the built in FireFly functions called FF_LoadLanguage specifying the file name of your language to load. The file name could be hard coded or based on a user selection from, say, a listbox containing all of the available translated language files available.

For best results, this function must be called in FF_APPSTART.

' Define the language file that we will use for our multilanguage support
FF_LoadLanguage("French.lang")
flaviofornazier
Posts: 59
Joined: Oct 10, 2015 7:19
Location: Brazil

Re: FireFly Visual Designer for FreeBASIC (Updated Sept18, 2

Post by flaviofornazier »

Hi all,

I'm a FB beginner from Brazil. I hope I'm welcome here
and that I'm in the right place. =)

I have Firefly, FB32/64 latest versions on a W8/64 machine.

When I try to compile 64 projects I receive a lot of errors,
except when "Enabled GDI Plus Support" is unchecked...

I miss something? Any idea?

PS: Thanks to all, especially to FB Developers and Mr.Paul Squires.

FreeBASIC Compiler - Version 1.04.0 (10-01-2015), built for win64 (64bit)
Copyright (C) 2004-2015 The FreeBASIC development team.
standalone
target: win64, x86-64, 64bit
compiling: CODEGEN_PROJECT1_MAIN.bas -o CODEGEN_PROJECT1_MAIN.c (main module)
C:\FreeBASIC-1.04.0-win64\inc\win\commctrl.bi(454) error 58: Illegal specification, at parameter 1 (pstm) of ImageList_Read() in 'declare function ImageList_Read(byval pstm as LPSTREAM) as HIMAGELIST'
C:\FreeBASIC-1.04.0-win64\inc\win\commctrl.bi(455) error 58: Illegal specification, at parameter 2 (pstm) of ImageList_Write() in 'declare function ImageList_Write(byval himl as HIMAGELIST, byval pstm as LPSTREAM) as WINBOOL'
C:\FreeBASIC-1.04.0-win64\inc\win\commctrl.bi(458) error 58: Illegal specification, at parameter 2 (pstm) of ImageList_ReadEx() in 'declare function ImageList_ReadEx(byval dwFlags as DWORD, byval pstm as LPSTREAM, byval riid as const IID const ptr, byval ppv as PVOID ptr) as HRESULT'
C:\FreeBASIC-1.04.0-win64\inc\win\commctrl.bi(459) error 58: Illegal specification, at parameter 3 (pstm) of ImageList_WriteEx() in 'declare function ImageList_WriteEx(byval himl as HIMAGELIST, byval dwFlags as DWORD, byval pstm as LPSTREAM) as HRESULT'
C:\FreeBASIC-1.04.0-win64\inc\win\commctrl.bi(6132) error 58: Illegal specification, at parameter 2 (pstream) in 'type PFNDPASTREAM as function(byval pinfo as DPASTREAMINFO ptr, byval pstream as IStream ptr, byval pvInstData as any ptr) as HRESULT'
C:\FreeBASIC-1.04.0-win64\inc\win\commctrl.bi(6133) error 58: Illegal specification, at parameter 3 (pstream) of DPA_LoadStream() in 'declare function DPA_LoadStream(byval phdpa as HDPA ptr, byval pfn as PFNDPASTREAM, byval pstream as IStream ptr, byval pvInstData as any ptr) as HRESULT'
C:\FreeBASIC-1.04.0-win64\inc\win\commctrl.bi(6134) error 58: Illegal specification, at parameter 3 (pstream) of DPA_SaveStream() in 'declare function DPA_SaveStream(byval hdpa as HDPA, byval pfn as PFNDPASTREAM, byval pstream as IStream ptr, byval pvInstData as any ptr) as HRESULT'
C:\FreeBASIC-1.04.0-win64\inc\win\commdlg.bi(1109) error 14: Expected identifier, found 'LPUNKNOWN' in 'lpCallback as LPUNKNOWN'
C:\FreeBASIC-1.04.0-win64\inc\win\commdlg.bi(1162) error 14: Expected identifier, found 'LPUNKNOWN' in 'lpCallback as LPUNKNOWN'
C:\FreeBASIC-1.04.0-win64\inc\win\richedit.bi(367) error 14: Expected identifier, found 'IStream' in 'pIStream as IStream ptr'
C:\FreeBASIC-1.04.0-win64\inc\win\richedit.bi(367) error 132: Too many errors, exiting
maxarg
Posts: 7
Joined: May 21, 2014 7:09

Re: FireFly Visual Designer for FreeBASIC (Updated Sept18, 2

Post by maxarg »

It's seems related to fb 1.04. Reverting to 1.03 it works for me
flaviofornazier
Posts: 59
Joined: Oct 10, 2015 7:19
Location: Brazil

Re: FireFly Visual Designer for FreeBASIC (Updated Sept18, 2

Post by flaviofornazier »

Thank you very much Mr. Maxarg.

I'll try to revert to FB 1.03

I wish to meet others Firefly users. =)

Best Regards.
klahol
Posts: 1
Joined: May 18, 2015 16:52
Location: Holland

Re: FireFly Visual Designer for FreeBASIC (Updated Sept18, 2

Post by klahol »

Do ask Paul Squires to let you connect to the FireFly private members forum.

Regards,
Klaas
flaviofornazier
Posts: 59
Joined: Oct 10, 2015 7:19
Location: Brazil

Re: FireFly Visual Designer for FreeBASIC (Updated Sept18, 2

Post by flaviofornazier »

Thank you very much for your suggestion Mr.Klaas!

Would be great! I've read all the help file and public
posts.

I'd really like to connect to the private members forum and
read all posts to learn more about Firefly, but I don't know if
I have permission to send an email to Mr.Squires.

Thank you again.

Regards.
maxarg
Posts: 7
Joined: May 21, 2014 7:09

Re: FireFly Visual Designer for FreeBASIC (Updated Sept18, 2

Post by maxarg »

@flaviofornazier (firefly 3.77 && fb1.04_win64)

I was able to compile to win64 and gdiplus support
The problem seems to be related to firefly generated code
Take a look inside your .bas generated file, you will find:

#ifdef __FB_WIN64__
#Else
Using gdiplus
#EndIf

With fb 1.04 we need the Using of gdiplus

So....
Open FireFly37.exe with a binary editor, do a search of __FB_WIN64__, change it to __FB_NOGDI__ and save the executale.

....All done! ;-)

If Paul Squires could modify this ....... many thanks
PaulSquires
Posts: 1002
Joined: Jul 14, 2005 23:41

Re: FireFly Visual Designer for FreeBASIC (Updated Sept18, 2

Post by PaulSquires »

The FireFly support forum is now open for all FreeBASIC FireFly users:
http://www.planetsquires.com/protect/forum/index.php

You should be able to view all posts. If you wish to post then you'll need to register in the forum by sending me an email. Automatic registrations are disabled due to the huge amount of forum spam registrations.
PaulSquires
Posts: 1002
Joined: Jul 14, 2005 23:41

Re: FireFly Visual Designer for FreeBASIC (Updated March 8, 2016)

Post by PaulSquires »

(First post in this thread updated)

FireFly for FreeBASIC v3.78 uploaded:
http://www.planetsquires.com/firefly_freebasic.html
FireFly3 - 3.78 (Released 2016-03-08)
=====================================
- 0000944: [New Feature Request] FB: Added keywords to code highlighting (DateAdd, DateDiff, DatePart, Day, Month, Year, MonthName, Hour, Minute, Second) (Paul Squires) - closed.
- 0000943: [New Feature Request] FB: Added keywords to code highlighting (Now, DateSerial, DateValue, TimeSerial, TimeValue, SetDate, SetTime) (Paul Squires) - closed.
- 0000942: [New Feature Request] FB: Added keywords to code highlighting (AndAlso, OrElse, #Assert, Assert, AssetWarn, CVLongInt) (Paul Squires) - closed.
- 0000941: [Change] FB: Public/Private sub/functions now recognized in code editor finder combobox (Paul Squires) - closed.
- 0000940: [Change] FB: Code editor now recognizes Public Sub/Function for folding purposes (Paul Squires) - closed.
- 0000939: [Change] FB: Changed code for FF_ListView_GetCheckState and FF_ListView_SetCheckState to use Listview macros (Paul Squires) - closed.
- 0000938: [Change] FB: Corrected FF_Remain function to better handle match string patterns greater than one character (Paul Squires) - closed.
- 0000937: [Bug] FB: Corrected code parsing whereby FUNCTIONS with default parameters using an "=" sign where bypassed. (Paul Squires) - closed.
- 0000936: [Change] FB: Reverted code to use Long instead of Integer datatype. Better for WinAPI compatibility. (Paul Squires) - closed.
- 0000935: [Unfinished Code] FB: TabControl "Custom" property now outputs Caption strings to MultiLanguage file (default.lang) (Paul Squires) - closed.
- 0000934: [Change] FB: Changed TabControl icons to use imagelist with ILC_MASK Or ILC_COLOR32 flags (Paul Squires) - closed.
- 0000933: [New Feature Request] FB: Clicking on selected compiler text in StatusBar will toggle between 32-bit and 64-bit compilers (Paul Squires) - closed.
- 0000932: [Bug] FB: Corrected FF_PathName for "PATH" option when no path exists (null string now returned) (Paul Squires) - closed.
- 0000931: [Bug] FB: Update code for FF_STRDELETE to remove the use of MemCpy (Paul Squires) - closed.
kcvinu
Posts: 232
Joined: Oct 07, 2015 16:44
Location: Keralam, India

Re: FireFly Visual Designer for FreeBASIC (Updated March 8, 2016)

Post by kcvinu »

Hi @ PaulSquires ,
What about unicode support ? Is that possible ?
PaulSquires
Posts: 1002
Joined: Jul 14, 2005 23:41

Re: FireFly Visual Designer for FreeBASIC (Updated March 8, 2016)

Post by PaulSquires »

kcvinu wrote:Hi @ PaulSquires ,
What about unicode support ? Is that possible ?
Sorry, it is too late in FireFly's life to add unicode support at this point. The code editor control was written by me using raw winapi and I did not build it with the forethought to allow unicode. I am now writing a new editor and I hope to have a visual designer portion added to it some day. This new editor will allow UTF-8 unicode via the Scintilla editing control.
kcvinu
Posts: 232
Joined: Oct 07, 2015 16:44
Location: Keralam, India

Re: FireFly Visual Designer for FreeBASIC (Updated March 8, 2016)

Post by kcvinu »

@ PaulSquires,
Thanks for the reply. I am glad to hear that a new IDE is coming from you. If you don't mind i would like to suggest some features for that new IDE.

1. Automatic filling of "End If, Wend, Next, End Select" like key words when user press enter key right after appropriate keyword.
2. We are using another modules via include. So assume that i have include a *.bas or *.bi file in my project. One of the functions in that file is named "GetText" . So when i write "Get" right after "Function" keyword, the editor will show me an intellisense about that function and assist me to autocomplet it's name.
Gablea
Posts: 1104
Joined: Apr 06, 2010 0:05
Location: Northampton, United Kingdom
Contact:

Re: FireFly Visual Designer for FreeBASIC (Updated March 8, 2016)

Post by Gablea »

@ PaulSquires
Will the new IDE create programs for Linux? (Love it if it would do forms for DOS but that just me being me with my love of MS-DOS)
PaulSquires
Posts: 1002
Joined: Jul 14, 2005 23:41

Re: FireFly Visual Designer for FreeBASIC (Updated March 8, 2016)

Post by PaulSquires »

kcvinu wrote:@ PaulSquires,
Thanks for the reply. I am glad to hear that a new IDE is coming from you. If you don't mind i would like to suggest some features for that new IDE.

1. Automatic filling of "End If, Wend, Next, End Select" like key words when user press enter key right after appropriate keyword.
2. We are using another modules via include. So assume that i have include a *.bas or *.bi file in my project. One of the functions in that file is named "GetText" . So when i write "Get" right after "Function" keyword, the editor will show me an intellisense about that function and assist me to autocomplet it's name.
Yes, autocomplete and intellisense will be in the new editor.
Post Reply