I miss VB...

Windows specific questions.
jonbobbly
Posts: 37
Joined: Jun 20, 2007 17:45
Location: Sioux Falls, South Dakota
Contact:

Post by jonbobbly »

rdc wrote: The VB development system isn't Visual Basic; it is a RAD environment for creating applications using the Visual Basic language. The compiler takes the VB code and translates that into winapi calls. You don't see it because it is hidden within the development system. And that is the problem. Since the api is hidden, you can't do things (easily) like sub-classing since the development system doesn't allow you to monkey around with the internals (without a lot of ugly hacks). Delphi is a little better in this regard, but does suffer the same types of problems.
What I am looking for is a library with simple commands that hides the API from me so I don't have to mess with it. I want to program a GUI like I used to in VB6, i.e. some magical thing somewhere handles all the API stuff and all I have to worry about is the code for when a button is clicked, and the only code I see is the code I wrote. When I look at some API code in FB, I think someone puked on the page, and I don't want the headache of going through and learning that barely-human-legible crap.

Can't someone, somewhere just make a SIMPLE library, that wraps around the API and allows me to do this?

Code: Select all

sub FormLoad()
 btn1=New Button(1,1,100,50,"Hi.")
end sub
sub btn_OnClick()
 MsgBox("Hello World!")
end sub
fsw
Posts: 260
Joined: May 27, 2005 6:02

Post by fsw »

jonbobbly wrote: Can't someone, somewhere just make a SIMPLE library, that wraps around the API and allows me to do this?
@jonbobbly
you say "just make a SIMPLE library" but what you don't get is: to do it right it's NOT SIMPLE at all.
If it would be simple you would do it yourself.
Because you can't do it you have to wait for others to have enough INTEREST and TIME to code it and give it away for free.

As others already mentioned FreeBASIC is freeware/open source done by people in their spare time.
So is my FRAMEWORK/GUI library all done in my spare time.

This means you have to be patient because if nobody is interested in such a thing and doesn't share it with others then you have to wait even longer :P

BTW: In your example you forgot to connect btn_OnClick() to btn1...
MichaelW
Posts: 3500
Joined: May 16, 2006 22:34
Location: USA

Post by MichaelW »

jonbobbly wrote: What I am looking for is a library with simple commands that hides the API from me so I don't have to mess with it. I want to program a GUI like I used to in VB6, i.e. some magical thing somewhere handles all the API stuff and all I have to worry about is the code for when a button is clicked, and the only code I see is the code I wrote. When I look at some API code in FB, I think someone puked on the page, and I don't want the headache of going through and learning that barely-human-legible crap.

Can't someone, somewhere just make a SIMPLE library, that wraps around the API and allows me to do this?

Code: Select all

sub FormLoad()
 btn1=New Button(1,1,100,50,"Hi.")
end sub
sub btn_OnClick()
 MsgBox("Hello World!")
end sub
Someone could, but IMO it would be hard to justify spending hundreds of hours on such a library, knowing that most users would quickly realize that the library was too limited. I think a better approach is to use the Windows API more directly, taking advantage of the “shortcuts” that are built into the API, and automating only the most common tasks. Your (probably) incomplete example requires 6 statements. This complete example requires only 16, and most of those are standardized so they could be done by copy/paste:

Code: Select all

'=======================================================
#include "dialogs.bas"
'=======================================================
function DialogProc( byval hDlg as  HWND, _
                     byval uMsg as UINT, _
                     byval wParam as WPARAM, _
                     byval lParam as LPARAM ) as integer

  select case uMsg

    case WM_COMMAND

      if loword(wParam) = 100 then

        MessageBox( hDlg, "HelloWorld!", "", 0 )

      end if

    case WM_CLOSE

      EndDialog( hDlg, null )

  end select

  return 0

end function

'=======================================================
'' Start of implicit main.
'=======================================================

dim as LPDLGTEMPLATE lpdt

Dialog( 1, 0, 0, 100, 75, "Simple", lpdt, _
        WS_OVERLAPPEDWINDOW or DS_CENTER )

PushButton( 100, -1, 50, 40, 12, "Hi" )

CreateModalDialog( 0, @DialogProc, 0, lpdt )
KristopherWindsor
Posts: 2428
Joined: Jul 19, 2006 19:17
Location: Sunnyvale, CA
Contact:

Post by KristopherWindsor »

jonbobbly wrote:What I am looking for is a library with simple commands that hides the API from me so I don't have to mess with it.
Code Windows. Just pick a background picture for your desktop, and all of a sudden, you have your own GUI that even has a built-in screensaver! :-P

BTW, "barely-human-legible" refers to ASM. At least API things use some English! ;-)
fsw
Posts: 260
Joined: May 27, 2005 6:02

Post by fsw »

eodor wrote:fsw I like to see your code.
Are you a open source developer or closed source?
PaulSquires wrote:@fsw
Would you be willing to email be a copy of your gui framework code? No worries that it is incomplete - I am curious about how you have it coded.
You are a closed source developer am I right?

---
On the other hand if only 2 people are interested in looking at the code and no one is interested in contributing then it's maybe better to stay put...
eodor
Posts: 243
Joined: Dec 24, 2005 1:44
Location: Romania
Contact:

Post by eodor »

fsw wrote:
eodor wrote:fsw I like to see your code.
Are you a open source developer or closed source?


Yes I am.
If you are interested, send me your code at nastase_eodor@yahoo.com .
osiyo53
Posts: 96
Joined: Feb 17, 2006 4:53

Post by osiyo53 »

fsw wrote:On the other hand if only 2 people are interested in looking at the code and no one is interested in contributing then it's maybe better to stay put...
I've gotten the impression that more than two people are interested in your code, fsw.

Reading thru the posts, several seem interested in USING it. I wouldn't mind giving it a try, myself.

But I think that most of those interested in using it probably don't feel they have the skills to make any useful contributions. Makes sense, doesn't it?

OTOH, I think Eodor and PaulSquires might well have the skills to make worthy contributions.

Eodor, I know, does both open and closed source programming. He might be interested in helping with an open source project. Or maybe not, you'd have to ask him. But keep in mind that English is not his native language. He MAY not have realized yet that you're only interested in releasing your code to someone who promises to keep it an open source project.
Imortis
Moderator
Posts: 1982
Joined: Jun 02, 2005 15:10
Location: USA
Contact:

Post by Imortis »

I love the idea of the library, and would love to help, but sadly I know very little of the winAPI, or any other gui framework. I would be of absolutely no use to the project. Other than beta testing...
PaulSquires
Posts: 1038
Joined: Jul 14, 2005 23:41

Post by PaulSquires »

fsw wrote:
PaulSquires wrote:@fsw
Would you be willing to email be a copy of your gui framework code? No worries that it is incomplete - I am curious about how you have it coded.
You are a closed source developer am I right?
I am a bit of both. FireFly Visual Designer is currently closed source. Cheetah Database System is open source (SourceForge).

I understand that if your library is only intended to compliment other open source projects - I have no problem with that and totally respect it. I have no trouble building the WinAPI code output (I've done it for years), I just thought that maybe your approach would be useful.
porfirio
Posts: 154
Joined: Mar 17, 2006 11:54
Location: Portugal

Post by porfirio »

eodor wrote:Want powerful GUI, then use Delphi.
Sorry to disapoint you, but delphi is not the best gui builder out there
Delphi is pretty ugly

Take a look to Java Swing and to Netbeans ide
http://www.netbeans.org/download/flash/ ... ilder.html

Ok ok ok, thats Java, an interpreted language, i know. Still its really great
eodor
Posts: 243
Joined: Dec 24, 2005 1:44
Location: Romania
Contact:

Post by eodor »

porfirio wrote:
eodor wrote:Want powerful GUI, then use Delphi.
Sorry to disapoint you, but delphi is not the best gui builder out there
Delphi is pretty ugly

Take a look to Java Swing and to Netbeans ide
http://www.netbeans.org/download/flash/ ... ilder.html

Ok ok ok, thats Java, an interpreted language, i know. Still its really great
It's your opinions...Yes,still interpreted language !. So,that tell us a lot...
Jim Barlow
Posts: 43
Joined: Sep 23, 2005 0:37

Firefly Visual Designer

Post by Jim Barlow »

PaulSquires wrote:If the FB community could build one GUI library and have most people agree that it will be the prime focus of continued development, I would be more than happy to build support for it into the FireFly Visual Designer (http://www.planetsquires.com).

I have long planned to add FreeBASIC support into FireFly, but I have been slow to do so because it means that I would have to write or co-write the library thereby taking away development time from other programming issues of mine.

FireFly Visual Designer + FreeBASIC code generation would be a free product. I think that's a good deal for the community as a whole and maybe help put to rest a lot of these GUI / VB problems (at least until an even better solution emerges).

The library would need to be WinAPI based.

Thoughts on this?
My thought is:
YES!!!! Please!!!!
Firefly Visual Designer for FreeBASIC would be the next best thing to FreeBASIC its self. Just what this project needs.
Eponasoft
Posts: 264
Joined: Jul 26, 2007 2:40

Post by Eponasoft »

I could probably help with backend code in both Windows and Linux if you stick to raw API calls for each. I am very experienced with the Win32 API and have quite a bit of Xlib experience as well.
marcov
Posts: 3503
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Post by marcov »

jonbobbly wrote:I've noticed that many of the posts here often turn to other programming languages such as C, RapidQ, and Pascal to handle simple GUI creation. If it is so simple in those languages, why isn't it in FB?
It is not simple in those languages too. A crossplatform GUI is hard. Period.

Stuff based on one GUI widget set are limited, and specially their non nativeness on Windows (of e.g. a GTK2) is often not accepted by users, have additional costs or conditions (QT, WXW)

If you try to abstract that, so that you can use the native (or most natural) toolkit on every platform, the SWING danger (that the abstraction gets too thick and is non native again) looms.

But even if you stick just to win32, something like lazarus or Delphi go in the millions and even tens of millions of LOC.
I feel like I have been given the most excellent tool for the creation of GUIs, but I need two more hands and the knowledge of a Ph.D. in computer science. Isn't there anyone out there with a SIMPLE library of SIMPLE commands for creating a SIMPLE GUI in FreeBASIC?
Start writing. Lazarus took over 10 years with a dedicated core of 6, and more in recent years. That's purely Lazarus. Language and non visual libs excluded.
sir_mud
Posts: 1402
Joined: Jul 29, 2006 3:00
Location: A van down by the river
Contact:

Post by sir_mud »

The nice thing about GTK is that it is themeable. The default theme with the generic GTK for Windows download is pretty horrible looking. But if you look at major programs like Inkscape and Pidgin, they use a custom theme that looks more native and not nearly so ugly. Xchat2 by silverex also looks pretty nice with his theme.
Post Reply