GUI library for Windows \ Linux (window9)

Headers, Bindings, Libraries for use with FreeBASIC, Please include example of use to help ensure they are tested and usable.
Post Reply
RNBW
Posts: 267
Joined: Apr 11, 2015 11:06
Location: UK

Re: FBGUI library for Windows 2

Post by RNBW »

VANYA

Not a problem. I should have it finished in time. I’ve identified all the sections that need updating and I’ve already done 9 of them. I was slowed down somewhat this morning. I slipped and fell down the stairs and suffered whiplash to my neck and a painful back. Fortunately, it doesn’t look as if any real harm has been done and I should be able to get down to it again in a couple of day’s time.

Ray
VANYA
Posts: 1834
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FBGUI library for Windows 2

Post by VANYA »

RNBW wrote:VANYA

Not a problem. I should have it finished in time. I’ve identified all the sections that need updating and I’ve already done 9 of them. I was slowed down somewhat this morning. I slipped and fell down the stairs and suffered whiplash to my neck and a painful back. Fortunately, it doesn’t look as if any real harm has been done and I should be able to get down to it again in a couple of day’s time.

Ray
I sincerely wish you recover from ailments!
VANYA
Posts: 1834
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FBGUI library for Windows 2

Post by VANYA »

I think to delay the release of window9 until the 1.08 compiler is released, so that later on not doing double work. There have already been cases when the library worked on one version of the compiler and did not work on another version of the compiler.
RNBW
Posts: 267
Joined: Apr 11, 2015 11:06
Location: UK

Re: FBGUI library for Windows 2

Post by RNBW »

Hi VANYA

I have completed the translation of the Window9 help file from Russian to English and it can be obtained from https://www.dropbox.com/s/2ft9saiw562eh ... 1.chm?dl=0. Please note that to open it, first right click on the file and then on Properties and click the Unblock box.

To anyone else thinking of downloading the file, please note that it is for the next update of Window9, which VANYA is hoping to issue in the next few weeks. Some of the code will not work with the current Window9 version. So the advice is to wait until the next update of Window9 to use this help file.
VANYA
Posts: 1834
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FBGUI library for Windows 2

Post by VANYA »

Thanks to RNBW!
Coolman
Posts: 294
Joined: Nov 05, 2010 15:09

Re: FBGUI library for Windows 2

Post by Coolman »

by curiosity, i examined the chm file under linux with xchm. impressive translation work. bravo.

I confess that I didn't believe in this library because it was only for windows. it's not the case anymore. many functions are compatible with linux. very good work...

for the moment, I use BlitzMax and I evaluate Cerberus two excellent languages. but FBGUI has potential under Freebasic. as soon as I have some time, I will test the linux version.
SARG
Posts: 1756
Joined: May 27, 2005 7:15
Location: FRANCE

Re: FBGUI library for Windows 2

Post by SARG »

@Coolman

I use this library for re-coding fbdebugger in view to get a compatible Linux/Windows version.
Only the GUI elements are necessary for this task but it's much more easier than using directly the Windows APIs.

The library is well maintained and every time, VANYA reacted quickly adding missing features I needed. :-)
Coolman
Posts: 294
Joined: Nov 05, 2010 15:09

Re: FBGUI library for Windows 2

Post by Coolman »

@SARG

i never used FB debugger because freebasic is only used for small command line projects. this could change with an efficient gui (fltk would be ideal because this library allows static compilation without any dependency. this is important under linux). i looked at your post. impressive work. it seems to be the ideal tool to debug an important program under freebasic...
VANYA
Posts: 1834
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FBGUI library for Windows 2

Post by VANYA »

Library Update:

Linux:

Fix / change:
Clearstring (now the passed string does not change internally)
Getlinetexteditor (return value no longer contains hyphenation characters)
Messbox (flag parameter can now be MB_YESNOCANCEL)
Openwindow (style can contain WS_HSCROLL, WS_VSCROLL)
Updateinfoxserver (parameter was not used, it was always 10000; now the parameter is used)
Setgadgetcolor (using GTK3 on newer distributions the color did not change in some gadgets)
Openglgadget (removed dependency in the form of glarea library, now supported with GTK3)
Load_image (optimization)
Catch_image (optimization)
Resize_image (freeing resources)
Create_image (optimization)
Imagestartdraw (optimization)
Windowstartdraw (optimization)
Pixdraw (range checks added)
Imagedraw (optimization)
Getpix (range checks added)
Fillrectdraw (freeing up resources)
Textdraw (now full unicode support, previously used a stripped-down version for drawing text)
Piedraw (fixed drawing with frame)
minor fix for working with events
the disable_webgadget macro will now allow excluding the Webgadget code when compiling the library (if this gadget is not required for some reason)
Panelgadget (added Eventgadget event when switching tabs)
renamed (ReplaceTextItemListView, ReplaceTextColumnListView, RenameItemTreeView) to (Settextitemlistview, Settextcolumnlistview, Settextitemtreeview)
includeBinary - changed code for 64-bit

Add:
Getfirstvisiblelineeditor
Lineindexeditor
Linelengtheditor
Rotateandscaleimage
Setselecttreeviewitem
Getchilditemtreeview
Getparentitemtreeview
Collapsetreeviewitem
Expandtreeviewitemall
Collapsetreeviewitemall
Expandtreeviewitem
Getnextitemtreeview
Getprevitemtreeview
Getfirstitemtreeview
Deletetreeviewitemall
Creategpbitmapfromhbitmap
Copy_imagea
Catch_imagea
Grab_imagea
Image_heighta
Image_widtha
Resize_imagea
Create_imagea
Save_imagea
Rotateandscaleimagea
Load_imagea
Free_imagea
Arcdrawa
Bezierdrawa
Boxdrawa
Circledrawa
Createbrusha
Createfontdrawa
Fillrectdrawa
Freebrusha
Freefontdrawa
Getpixa
Imagedrawa
Imagestartdrawa
Linedrawa
Modedrawa
Piedrawa
Polygondrawa
Rounddrawa
Setpixa
Stopdrawa
Textdrawa
Windowstartdrawa
Createhbitmapfromgpbitmap
Full support for USTRING (dynamic unicode string)

Windows:

Fix / change:
Clearstring (now the passed string does not change internally)
Readonlyeditor (now does not return a value)
Createhbitmapfromgpbitmap (color bug fixed)
Panelgadgetsetcursel (tab switching fixed)
Addtreeviewitem (changed the internal algorithm for working with images)
Replaceimageitemtreeview (minor minor fix)
Replaceimagelistview (minor minor fix)
Getcountitemtreeview (minor fix for working with Explorerlistgadget)
Deletelistviewcolumn (freeing image resources)
Deleteitemlistview (changed the internal algorithm for working with images)
Addlistviewitem (changed the internal algorithm for working with images)
Deletelistviewitemsall (changed the internal algorithm for working with images)
Deletetreeviewitem (internal algorithm for working with images has been changed)
Hidegadget (Spingadget bug fix)
Gadgetwidth (fix for Spingadget)
Gadgetheight (Spingadget bug fix)
Resizegadget (fix for Spingadget)
Deletetreeviewitemall (internal algorithm for working with images has been changed)
minor fix for working with events
Close_window (freeing resources for shortcut)
Inputbox (support for switching focus for interface elements, added the ability to set a parent for this dialog)
renamed (ReplaceTextItemListView, ReplaceTextColumnListView, RenameItemTreeView, FreeGpBitmap) to (Settextitemlistview, Settextcolumnlistview, Settextitemtreeview, Free_imagea)
includeBinary - changed code for 64-bit

Add:
Setselecttreeviewitem
Getparentitemtreeview
Getchilditemtreeview
Expandtreeviewitem
Expandtreeviewitemall
Getnextitemtreeview
Getprevitemtreeview
Getfirstitemtreeview
Collapsetreeviewitem
Collapsetreeviewitemall
Deletetreeviewitemall
Support for switching focus for gadgets using Tab, SHIFT + Tab, CTRL + Tab keys
RNBW
Posts: 267
Joined: Apr 11, 2015 11:06
Location: UK

Re: FBGUI library for Windows 2

Post by RNBW »

VANYA

Thank you for the update.

I am having a problem. No matter what code I write using Window 9 with the recent update to FreeBASIC (1.08.0 with gcc 9.3) I get the following error message:

"C:\FreeBASIC-1.08.0-winlibs-gcc-9.3.0\bin\ld.exe: cannot find -lz"

I don't understand the error message so I don't know how to proceed.

I suspect it is to do with gcc 9.3 because I have just tried the code using your February 2021 update and I get the same message. Using Freebasic 1.07.3 and your Window9 Februaru 2021 update the code runs fine.

Ray
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Re: FBGUI library for Windows 2

Post by D.J.Peters »

@RNBW you need the file "libz.a" 32 and or 64-bit version !

Joshy
RNBW
Posts: 267
Joined: Apr 11, 2015 11:06
Location: UK

Re: FBGUI library for Windows 2

Post by RNBW »

D.J.Peters wrote:@RNBW you need the file "libz.a" 32 and or 64-bit version !

Joshy
Joshy
Thanks that seems to have solved the problem. The file "libz.a" wasn't included in the June 2021 Window9 library that I downloaded from SourceForge. However, I did find it in the version in the January and May 2021 versions. I don't know if they are the same but are both 129Kb.

Ray
VANYA
Posts: 1834
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FBGUI library for Windows 2

Post by VANYA »

C:\FreeBASIC-1.08.0-winlibs-gcc-9.3.0\bin\ld.exe: cannot find -lz
The old release has zlib libraries for win32 and win64. Imortis also offered links to libraries in this post.
RNBW
Posts: 267
Joined: Apr 11, 2015 11:06
Location: UK

Re: FBGUI library for Windows 2

Post by RNBW »

Vanya

I'm going through one of my "thick" periods. Could you give me an example of MessBox Yes/No.

Thank you.

Edit:

I have come up with the following solution, which works, but is it the correct way?

Code: Select all

  #include "Window9.bi"
  dim as string a
  dim as integer Result
  Const MB_YES = 6
  Const MB_NO = 7
  
  Result = MessBox("Title", "Please make your input:", MB_YESNO)
  a = "Result of the request was: "

select case Result
	Case   6
		a = a + "Yes"
	case 7
		a = a + "No"
End Select
  
  
  MessBox("Information", a, MB_Ok)

sleep
VANYA
Posts: 1834
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FBGUI library for Windows 2

Post by VANYA »

Hi RNBW!

Code: Select all

#include "window9.bi"

Openwindow("",300,300,150,200)

Buttongadget(1,10,10,100,30,"yesno")

Buttongadget(2,10,50,100,30,"yesnocancel")

Editorgadget(3,10,100,100,30)

Do
	
	Var Event = Waitevent()
	
	If Event = Eventgadget Then
		
		Select Case Eventnumber
				
			Case 1
				
				Select Case Messbox("Message","YESNO" , MB_YESNO)
						
					Case IDYES
						
						Setgadgettext(3 , "YES")
						
					Case IDNO
						
						Setgadgettext(3 , "NO")
						
				End Select
				
			Case 2
				
				Select Case Messbox("Message","YESNOCANCEL" , MB_YESNOCANCEL)
						
					Case IDYES
						
						Setgadgettext(3 , "YES")
						
					Case IDNO
						
						Setgadgettext(3 , "NO")
						
					Case IDCANCEL
						
						Setgadgettext(3 , "CANCEL")
						
				End Select
				
		End Select
		
	Elseif Event = Eventclose Then
		
		Exit Do
		
	Endif
	
Loop
Post Reply