FBGUI library for Windows 2

External libraries (GTK, GSL, SDL, Allegro, OpenGL, etc) questions.
Coolman
Posts: 233
Joined: Nov 05, 2010 15:09

Re: FBGUI library for Windows 2

Postby Coolman » May 04, 2021 13:20

@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: 1522
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FBGUI library for Windows 2

Postby VANYA » Jun 06, 2021 13:43

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: 211
Joined: Apr 11, 2015 11:06
Location: UK

Re: FBGUI library for Windows 2

Postby RNBW » Jun 06, 2021 18:55

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: 8301
Joined: May 28, 2005 3:28
Contact:

Re: FBGUI library for Windows 2

Postby D.J.Peters » Jun 06, 2021 20:42

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

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

Re: FBGUI library for Windows 2

Postby RNBW » Jun 06, 2021 22:28

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: 1522
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FBGUI library for Windows 2

Postby VANYA » Jun 07, 2021 3:41

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: 211
Joined: Apr 11, 2015 11:06
Location: UK

Re: FBGUI library for Windows 2

Postby RNBW » Jul 04, 2021 9:25

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: 1522
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FBGUI library for Windows 2

Postby VANYA » Jul 04, 2021 12:36

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
RNBW
Posts: 211
Joined: Apr 11, 2015 11:06
Location: UK

Re: FBGUI library for Windows 2

Postby RNBW » Jul 04, 2021 13:53

VANYA

Thank you for your prompt response. It's much clearer to me now.
VANYA
Posts: 1522
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FBGUI library for Windows 2

Postby VANYA » Jul 08, 2021 5:16

Update Library.
Applies only to the version for the Linux platform. In short, added printer functionality and improved window resizing on GTK3.

Added functions:
Startprinter
Stopprinter
Framepage
Printtext
Printimage
Colorprinter
Fontprinter
Getrealsize
Getfullsize
Getlenstring
Getcountdoc
Pagestart
Pageend
Textprinter
Hwndprinter
GetDesktopWindow

Changes:
Main window on GTK3 now behave the same as on GTK2 when resized (thanks to Xusinboy Bekchanov for the tip).
enform
Posts: 184
Joined: Apr 24, 2011 12:57
Location: France

Re: FBGUI library for Windows 2

Postby enform » Jul 21, 2021 16:25

Hi Vanya ,
Thank you for the new version , its' a pleasure to work with it !
thanks to RNBW for the work++ of translation .

Simply reading the gtk3.bi file is FFFFFFFFF !!! ... courageous coders ... you are , guys .

I have adapted to Linux Xubuntu at least one code now ! And I have just uploaded it to the forum : CompileAndRunLin4 ;
If you can report how it works for you , thanks .

In the execution of different codes , i have the impression that gtk send more warnings or 'critical' messages ( and crashes ! ) than Windows .

In the chm , i read : ClearClipBoard and FreeGpBitmap but they are missing .
If i try SetClipBoardText("") gtk crashes but with a space SetClipBoardText("") it's ok .
Can you verify if the height of a window OpenWindow(......200) gives the same size in Window and Linux , for me the diff is 15 pixels .
I have had a problem with GetTopIndexListBox with a lines of text long enough to trigger the auto Horizontal scroll bar , the text moves
horizontally when the bin is executed . I found a solution on internet ! for that , the 'column' parameter should be NULL .

greetings !

the code below works for me :

Code: Select all

#Include "window9.bi"

OpenWindow("",10,10,400,150)

Function GetTopIndexListBoxA (iGadget as long) as Long
   
   dim as GtkWidget ptr listbox = GadgetId(iGadget)
   
   dim as GtkTreePath ptr path
   
   dim as any ptr column
   
   dim as Gint cell_x , cell_y
   
   gtk_tree_view_get_path_at_pos (cast(any ptr ,listbox), 1,1, @path, @column, @cell_x,@cell_y)

   'gtk_tree_view_scroll_to_cell(cast(any ptr ,listbox) , path , Column , FALSE,0,0) ' align rows on the upper edge
   gtk_tree_view_scroll_to_cell(cast(any ptr ,listbox) , path , NULL , FALSE,0,0) ' align rows on the upper edge

   function = *gtk_tree_path_get_indices( path )   
   
   gtk_tree_path_free(path)

End Function

ListBoxGadget(1,10,10,100,80)
For a As Integer=1000 To 1400
   AddListBoxItem(1,Str(a) + "00000000000000000000000000000000000000000000000000000000000000")
Next

Do
   Var event=WaitEvent
   Select Case event
      Case EventClose
         End
      Case EventGadget
         If EventNumber=1 Then
            ? GetTopIndexListBoxA(1)
         endif
   End Select
Loop
VANYA
Posts: 1522
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FBGUI library for Windows 2

Postby VANYA » Jul 22, 2021 6:03

Hi enform!

FreeGpBitmap


This function has been renamed to Free_ImageA: viewtopic.php?p=283352#p283352

Can you verify if the height of a window OpenWindow(......200) gives the same size in Window and Linux , for me the diff is 15 pixels .


On Windows 10, the window size may not match: viewtopic.php?p=278750#p278750

ClearClipBoard ... GetTopIndexListBox ... SetClipBoardText ...


Fixed. The library has been updated.

I have adapted to Linux Xubuntu at least one code now ! And I have just uploaded it to the forum : CompileAndRunLin4 ;
If you can report how it works for you , thanks .


The dimensions of buttongadget, textgadget and some others should preferably be at least 25 (or better than 30) in height, otherwise there will be such an effect:
Image

Return to “Libraries”

Who is online

Users browsing this forum: No registered users and 2 guests