Simple GUI

Post your FreeBASIC source, examples, tips and tricks here. Please don’t post code without including an explanation.
Lothar Schirm
Posts: 437
Joined: Sep 28, 2013 15:08
Location: Germany

Re: Simple GUI

Post by Lothar Schirm »

Yes, WinAPI is really hard stuff. For me, also FLTK is very attractive, but it depends very much on the work of one single person (D.J.Peters). WinAPI headers are part of the FreeBasic packages and will always be maintained, and I use Windows only. But I am on my limit with WinAPI now. With my own solutions (GUI or TUI), I have full control over my code, no libs, no dependencies from external resources - maybe I will work again more with my own solutions, as you do. I like your nice examples here in the forum very much!
BasicCoder2
Posts: 3906
Joined: Jan 01, 2009 7:03
Location: Australia

Re: Simple GUI

Post by BasicCoder2 »

Lothar Schirm wrote: I like your nice examples here in the forum very much!
Glad you like them, thank you :) And you did a very fine job with your Simple GUI.
Of course it depends on why you program and what you program. A consistent professionally written and maintained GUI library would be required I imagine for complex programs written in a commercial environment. I am of course just messing about for fun and wouldn't use such ad hoc GUI "solutions" if I was a professional programmer.
.
Lothar Schirm
Posts: 437
Joined: Sep 28, 2013 15:08
Location: Germany

Re: Simple GUI

Post by Lothar Schirm »

Simple GUI: New Release with further functions and controls, see first post.
t57042
Posts: 10
Joined: Jun 17, 2005 11:23

Re: Simple GUI

Post by t57042 »

Hi,
Is there any documentation available that describes the library (syntax...)?
Lothar Schirm
Posts: 437
Joined: Sep 28, 2013 15:08
Location: Germany

Re: Simple GUI

Post by Lothar Schirm »

Sorry, no. I used comments in the source code of GUI.bas in order to describe each control type and each function briefly, but you should study the code examples in order to see how the library works. I guess it is not too difficult.

Alternatively, you might try my Windows API library (see first post, project site on http://www.freebasic.net/forum/viewtopi ... =8&t=24617, if you work with Windows. It is also very easy to use and has additional features (e.g. multiline editor, pulldown menue, file browser, colourpicker, simplified event loop). Meanwhile, I prefer to use this library for my projects.
Lothar Schirm
Posts: 437
Joined: Sep 28, 2013 15:08
Location: Germany

Re: Simple GUI

Post by Lothar Schirm »

New Update (see first post)

I improved Simple GUI a little bit:
- Better look of Checkbox and Radiobutton
- Added: Frame, Trackbar style (horizontal and vertical trackbar)
- The name of GUI.bas is changed to GUI.bi
Coolman
Posts: 294
Joined: Nov 05, 2010 15:09

Re: Simple GUI

Post by Coolman »

I just tested this gui. compiles without problem with freebasic 1.09. only basic source code. no dependencies. this is what is needed without it becoming too heavy. excellent. ideal for small projects. great job.
RNBW
Posts: 267
Joined: Apr 11, 2015 11:06
Location: UK

Re: Simple GUI

Post by RNBW »

Coolman wrote: Mar 03, 2022 13:17 I just tested this gui. compiles without problem with freebasic 1.09. only basic source code. no dependencies. this is what is needed without it becoming too heavy. excellent. ideal for small projects. great job.
Lothar Schirm's Simple GUI is indeed a gem, but I understand that, being a WinAPI library, it has a problem in that it does not register the Windows Class. I am no expert with the WinAPI and would appreciate very much if someone knowledgeable could provide examples of how the Windows Class could be registered in use with the Simple GUI library. If this could be done, the library would indeed be very useful in producing GUI based FreeBasic code.
Lothar Schirm
Posts: 437
Joined: Sep 28, 2013 15:08
Location: Germany

Re: Simple GUI

Post by Lothar Schirm »

Hi Ray,
"Simple GUI" is not a Windows API GUI, it is pure FreeBASIC on a FB grafics screen. See URL on first post for download (there are also some screenshots).
RNBW
Posts: 267
Joined: Apr 11, 2015 11:06
Location: UK

Re: Simple GUI

Post by RNBW »

Lothar Schirm wrote: Mar 04, 2022 14:42 Hi Ray,
"Simple GUI" is not a Windows API GUI, it is pure FreeBASIC on a FB grafics screen. See URL on first post for download (there are also some screenshots).
Hi Lothar, nice to hear from you.
Lothar Schirm wrote: Aug 03, 2016 15:43 ........
Alternatively, you might try my Windows API library (see first post, project site on http://www.freebasic.net/forum/viewtopi ... =8&t=24617, if you work with Windows. It is ............
I think I must have misinterpreted your quote above.
However, your Simple GUI is based on Windows code. I know you moved to WinAPI because you found it easy to use and it got over the problem of registering the Window Class, because you do it when coding WinAPI. I have always liked your Simple GUI because, well it's simple to use. I use it to carry out a rough layout of controls and code before movoing onto another library. Sometime your library is enough for my purposes. I just wish that I could find a way to use it with registered Windows Class. It would then be perfect for my use.

Ray.
Coolman
Posts: 294
Joined: Nov 05, 2010 15:09

Re: Simple GUI

Post by Coolman »

the interest of this gui is that everything was made with freebasic commands so no dependency. no api. i examined the code, everything is drawn on the window, event management included. that said i'm looking for a way to enlarge the display font because on my laptop with a 1920x1080 resolution it's too small.
Coolman
Posts: 294
Joined: Nov 05, 2010 15:09

Re: Simple GUI

Post by Coolman »

it seems that the height and width of the display font have not been coded in global variables, the positioning depends equally on these data, which makes the enlargement of the display font a bit complicated...
Lothar Schirm
Posts: 437
Joined: Sep 28, 2013 15:08
Location: Germany

Re: Simple GUI

Post by Lothar Schirm »

Hi Coolman, the font size is 8 x 16 pixels, as defined by Width in the Sub OpenWindow of GUI.bi. No simple way to change this to a larger font, 16 pixels is the largest font height.
VANYA
Posts: 1834
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: Simple GUI

Post by VANYA »

Lothar Schirm wrote: Mar 04, 2022 18:59 Hi Coolman, the font size is 8 x 16 pixels, as defined by Width in the Sub OpenWindow of GUI.bi. No simple way to change this to a larger font, 16 pixels is the largest font height.
Hi Lothar Schirm!

And there is no desire to implement the xFont library in your library? This would help with the font size and make it possible to use not only 127 ASCII characters, but also Unicode. In any case, I like what you do.
Coolman
Posts: 294
Joined: Nov 05, 2010 15:09

Re: Simple GUI

Post by Coolman »

thanks for the answer Lothar Schirm. it's a pity. i thought it would be possible to change the values 8 and 16 by 16 and 32 in the gui.bi file using global variables to double the size of the display font and keep the positioning correct. i haven't made any graphics program with freebasic, the font management looks complicated...

I found a very good documentation about freebasic here :

https://documentation.help/FreeBASIC/

if it can interest other people.
Post Reply