Coming from RapidQ and ... Freebasic not that easy

New to FreeBASIC? Post your questions here.
fred76
Posts: 3
Joined: Feb 10, 2010 19:21

Coming from RapidQ and ... Freebasic not that easy

Postby fred76 » Feb 13, 2010 22:00

Hello,

I am coming from RapidQ, with which I was used to program easily for Windows interface (see here : http://www.geneamichaud.123.fr/articles ... g=fr&pg=12 what I've done so far)

I wanted to use Freebasic to program another software, but I am very confused in the way to use it for Windows applications. Where are the MsgBox, CheckList, and the like... ? Is there any tutorial to use these functions, and any library ?

I am not a geek and do not want to spend weeks to collect all the files and parameters, and play with those tricky command lines. So is there something that is working quickly for the Windows environment (I don't intend to program for Linux, Unix, Mac or ZX81). I mean, the compiler, the library to use the Windows API, the editor, the ressource editor, and all the associated help and example files.

Just an example. Is there any FB code example of a Hello World in a Windows window (i.e. not in the DOS console), with one "Exit" button ?

In RapidQ this is

Code: Select all

Showmessage "Hello World"


Is there any bundle that works ? I just want to program and - I know, I am a stupid dumb french guy... ;)

Best regards

Fred
dkl
Site Admin
Posts: 3221
Joined: Jul 28, 2005 14:45
Location: Germany

Postby dkl » Feb 13, 2010 22:42

Hello, welcome to FB!

If you are still looking for an IDE, you might want to choose <FbEdit> -- it includes a dialog designer that generates resource scripts (.RC) for you.

FreeBASIC itself has no builtin Windows GUI functions. The Windows API can be used directly and easily by including the headers:

Code: Select all

#include "windows.bi"
MessageBox(NULL, "There", "Hello", MB_OK)


More specific code examples are available in the FreeBASIC installation at FreeBASIC\examples\Windows\gui and all over this forum. Everything you can do in RapidQ you can do in FB.

In the <FB wiki> there is a tutorial that might get you started:
Introduction to Message-Based Programming (written by rdc)
Learning how to use the Windows API directly is an invaluable lesson.

Last but not least, in this forum's Tips and Tricks section there is a collection of <really short WinAPI examples>.
fred76
Posts: 3
Joined: Feb 10, 2010 19:21

Postby fred76 » Feb 13, 2010 23:22

Thanks for your answer.

I checked the examples given in the last tutorial... they are far more complex than the coding in RQ. And we shall complexify them even more if we need a safe code (class registered and windows messages processed as explained in the tutorial).

I'm afraid I will revert to RQ even if I really had prefered coding in FB :( It is so easy coding win apps with RQ...

Best regards

Fred
MichaelW
Posts: 3500
Joined: May 16, 2006 22:34
Location: USA

Postby MichaelW » Feb 14, 2010 1:49

Did you see this? It’s no more difficult than what I remember of RQ, and it’s more flexible.
fred76
Posts: 3
Joined: Feb 10, 2010 19:21

Postby fred76 » Feb 17, 2010 21:03

Well, I desesperately tried what you indicated :
- MichaelW's way of programming
- Glade2bas
- GTK+tobac

Michael's solution was quite promising but still quite complex compared to the easy and straightforward programming with RQ.

I can't get anything to work on my computer (dll missing, parameters not working, etc.), or it is far too complex to program to me. I need to spend my time to program the clever thing in my soft, not wasting all the time trying to understand complex tools for the GUI. I don't care about Linux, 99.9% of my targeted users are not using Linux : it is a software to calculate the divorced parents' kids time sharing schedule (under french rules).

It is very bad, because I really wanted to use Freebasic...

At least I will program the user interface with RQ, and include all the code in a FB dll.

Thanks for you help

Fred
D.J.Peters
Posts: 8208
Joined: May 28, 2005 3:28
Contact:

Postby D.J.Peters » Feb 18, 2010 3:00

all code from the link MichaelW posted in one file
(i don't know why he dont put the link in his first post)

http://freefile.kristopherw.us/uploads/ ... ialogs.zip

Joshy
Drago
Posts: 116
Joined: Aug 10, 2005 13:15

Postby Drago » Feb 19, 2010 8:33

I know what Fred means......

coming from VB6 it is the same pain for me....

there is no editor which will clear my logic code from the GUI Mess...

The best approch for this is Stuebers Editor....

http://www.freebasic.net/forum/viewtopic.php?t=14795

What will make FB coding easy is --- in my opinion --- and I think this is what Fred means.....

The GUI Designer has to store all the Layout an Message routines in a separat file... in VB this are the *.frm files..

If I want to add logic code to a widget

I click an this widget in the GUI Designer..
- chose a message to react on ... maybe DoubleClick

The IDE will now...
insert the reactor code in the *frm File...points there to the code in my *.bas file....
inserts in the *.bas file the... SUB myWidget_onDoubleClick --- end Sub

and i just have to do the logic on reaction on the DoubleClick event

that would be simple..

also I am missing often...something like

a = OpenFile_Source.txt

where OpenFile... is a OpenDialog in its own window which i have droppt in the Gui Designer on my Dialog Frame named it OpenFile_Source....preconfigured some things like extensions to show..etc.

that would be simple..

but I know ... the more simple is the more unflexibility

Greetings
Imortis
Moderator
Posts: 1744
Joined: Jun 02, 2005 15:10
Location: USA
Contact:

Postby Imortis » Feb 19, 2010 13:11

What you have described is very, very complex to program. I would think this is th reason it hasn't been done yet.
Eponasoft
Posts: 264
Joined: Jul 26, 2007 2:40

Postby Eponasoft » Feb 19, 2010 16:56

If you see all the code that goes into simply making a window, let alone handling controls, you can clearly see why such an editor has never been made. It is a massive undertaking. Microsoft spends millions of dollars and several years with dozens of coders to produce marginally-working GUI editors...do you actually expect one or two hobbyist coders to be able to make anything even near that so quickly?
JohnK
Posts: 279
Joined: Sep 01, 2005 5:20
Location: Earth, usually
Contact:

Postby JohnK » Feb 23, 2010 4:15

If you search the FreeBasic site for Eodor's FreeBasic Windows gui toolkit, you will see that he too wrote a win32 GUI library that supports basic gui controls. The syntax may remind you a little of RQ. Another one is FB_GUI.

http://www.freebasic.net/forum/viewtopic.php?t=12592


both are unfinished?

They are not supported by a "visual designer" like IDE, but then how hard is it to search for "Button_OnClick" ...

Yes, GUI libs cross platform are no fun to construct for free.

-JK
Milivoj
Posts: 16
Joined: Dec 14, 2006 11:39

Postby Milivoj » Feb 23, 2010 14:56

D.J.Peters wrote:all code from the link MichaelW posted in one file
(i don't know why he dont put the link in his first post)

http://freefile.kristopherw.us/uploads/ ... ialogs.zip

Joshy


This may sound a bit foolish, but is it possible to use these commands in GFX window (declared by SCREEN...)

Thanks, Milivoj

Return to “Beginners”

Who is online

Users browsing this forum: No registered users and 15 guests