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
SARG
Posts: 1756
Joined: May 27, 2005 7:15
Location: FRANCE

Re: FBGUI library for Windows 2

Post by SARG »

Hi VANYA,
VANYA wrote:I do not understand. What operating system? Have you used the version of the library from this page? What example did you run?
Yes from this page
zip : 2020/05/05
lib WIN : 2020/03/02

I tried the 64bit version with this code from the chm file (addtreeviewitem page) :

Code: Select all

#Include "window9.bi"
Dim As Integer event
Dim As HWND hwnd,tree
hwnd=OpenWindow("TreeView",10,10,180,200) : CenterWindow(hwnd)
Var hbmp = load_Icon("1.ico")
Var hbmp1 = load_Icon("2.ico")
#Ifdef __FB_WIN32__
Dim As Long iStyle = TVS_HASLINES or TVS_HASBUTTONS or TVS_LINESATROOT
#Else
Dim As Long iStyle = 0
#EndIf
tree=TreeViewGadget(4,10,10,140,140, iStyle,,32)
Var Pos_=AddTreeViewItem(4,"1",hbmp,hbmp1,TVI_FIRST)
AddTreeViewItem(4,"1-1",hbmp,hbmp1,TVI_FIRST,Pos_)
Pos_=AddTreeViewItem(4,"2",hbmp,hbmp1,Pos_)
AddTreeViewItem(4,"2-1",hbmp,hbmp1,TVI_FIRST,Pos_)
Do
event=waitevent
If event=EventClose Then end
Loop
And this example (openwindows page) works fine but the values W and H are a bit too small better with 300/200.

Code: Select all

var hwnd=OpenWindow("test",10,10,100,100) 'hwnd=OpenWindow("test",10,10,300,200)
Var event=0
Do
event=WaitEvent()
If Event=EventClose Then End
Loop
VANYA
Posts: 1834
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FBGUI library for Windows 2

Post by VANYA »

addtreeviewitem....
Error in the Window9.Bi file during declaration. It should be like this:

Code: Select all

Declare Function AddTreeViewItem OverLoad(ByVal gadget As long, ByRef string_ As String, ByVal IDImage_0 As HBITMAP, ByVal IDImage_Selected As HBITMAP, ByVal pos_ As integer, ByVal parent As Integer=0) As Integer
Declare Function AddTreeViewItem(ByVal gadget As Long, ByRef string_ As String,ByVal IDImage_0 As HICON,ByVal IDImage_Selected As HICON,ByVal pos_ As integer,ByVal parent As Integer=0) As Integer
I allowed this error when I combined the Linux and Windows versions

And this example (openwindows page) works fine but the values W and H are a bit too small better with 300/200.
Yes, I see the problem. I have not written for a long time under Windows, therefore I did not notice. And so far I do not even know because of what reason it happens. After all, even in a simple example, the same problem:

Code: Select all

#INCLUDE "windows.bi"
Dim msg As MSG 
Dim As WNDCLASSEX wc 
Dim As String NameClass="MyClass" 
Dim As HINSTANCE Hinst=GetModuleHandle(0) 

Function wndproc(hwnd As HWND, msg As Uinteger,_
 		wparam As WPARAM, lparam As LPARAM) As Integer
    Select Case msg
        Case WM_DESTROY
            PostQuitMessage(0)
    End Select
    Return DefWindowProc(hwnd,msg,wparam,lparam)
End Function

With wc
    .cbSize=SizeOf(WNDCLASSEX)
    .style=CS_HREDRAW Or CS_VREDRAW
    .lpfnWndProc=@WndProc
    .hInstance=Hinst
    .hIcon=LoadIcon(0,IDI_QUESTION)
    .hCursor=LoadCursor(0,IDC_HELP)
    .hbrBackground=Cast(HBRUSH,COLOR_WINDOWFRAME)
    .lpszClassName=StrPtr(NameClass)
    .hIconSm=.hIcon
End With

If RegisterClassEx(@wc)=0 Then
    Print "Register error, press any key"
    Sleep
    End
Endif

CreateWindowEx(0,NameClass,"Header",_
WS_VISIBLE Or WS_OVERLAPPEDWINDOW,100,100,300,300,0,0,Hinst,0)

While GetMessage(@msg,0,0,0)
    TranslateMessage(@msg)
    DispatchMessage(@msg)
Wend
Perhaps this is due to the visual style of Windows 10. I will look for the cause, thanks for bug reports
VANYA
Posts: 1834
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FBGUI library for Windows 2

Post by VANYA »

The windows 10 style for windows creates transparent pixels on the sides of the window.

You can check this if you set the "x" coordinate to the value "0":

Code: Select all

OpenWindow("",0,0,300,300)
On the left you will see that the window does not adjoin the beginning of the screen. The same will be in height, but at the bottom of the screen

In the case of operating systems windows xp, windows 7, there were no such pixels with the standard theme and the sizes were the same. I don’t think there is anything to be done here, because different topics can change this quality. In any case, the gadgets in the window take their count from the zero coordinates of the client side of the window. The total window size is an approximate value and is most often indicated with a small margin (a little more than necessary).
SARG
Posts: 1756
Joined: May 27, 2005 7:15
Location: FRANCE

Re: FBGUI library for Windows 2

Post by SARG »

The result on the left is after W and H increased a bit. On the right you can't move the window and the title is not visible due to the buttons taking all the place. I'm not sure that under XP or 7 a width of 100 is enough.

It was just a comment, the display could appear weird for some users testing the example.

Image

Just testing it, AddtreeView example is working. Thanks.
finchley
Posts: 1
Joined: Jan 08, 2021 17:10

Re: FBGUI library for Windows 2

Post by finchley »

I have been learning to use the window9 library over the last few days but I am having difficulty with two things: setting tab order and giving a gadget the focus.

I've scoured the help file (and a big thank you for providing an English version), searched this forum topic, and grepped the source code but to no avail.

Any help would be greatly appreciated. Thanks in advance...

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

Re: FBGUI library for Windows 2

Post by VANYA »

finchley wrote:I have been learning to use the window9 library over the last few days but I am having difficulty with two things: setting tab order and giving a gadget the focus.
Hi finchley!

Please clarify the question.

1) What operating system?
2) Are you having a problem with PanelGadget? Or are you talking about switching gadgets using the TAB key?
3) Source code of what doesn't work
VANYA
Posts: 1834
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FBGUI library for Windows 2

Post by VANYA »

Hi all!

Another library update. This time the update mainly affected the Windows version, although a couple of bugs were also fixed on Linux.

What is done :

1) UNICODE support for WINDOWS version of the library
2) Correction of errors and shortcomings, including in the help

Explanation:

Any version of ASCII or UNICODE can be used. In the header for Windows, there is an additional extwstring.bi file that implements a dynamic UNICODE string. It is required for the UNICODE version.

The library has a new type USTRING, which is essentially:

in ASCII version is a regular STRING type
in UNICODE version is of type extWstring

Usage in all functions (with very few exceptions) is the same. Help was updated only for those few functions where there is a difference.

To use UNICODE:

1) the library must be compiled correctly. To do this, before compiling the library in the window9.bi file, you need to uncomment the #Define UNICODE line
2) use the USTRING type.

To use ASCII:

1) the library must be compiled correctly. To do this, before compiling the library in the window9.bi file, you need to comment out the #Define UNICODE line
2) use the STRING or USTRING type (which is the same for the ASCII version).

The archives contain compiled libraries, for those who are too lazy to compile themselves

You can download as always here: https://sourceforge.net/projects/guiwindow9/files/
enform
Posts: 185
Joined: Apr 24, 2011 12:57
Location: France

Re: FBGUI library for Windows 2

Post by enform »

Hi Vanya !
Glad to see you are working again on the great lib ! Courage ++ !!!
I have switched to Xubuntu now with wine . But not deleted my w7 .
I have coded a ' simple ' EditorGadget but under Linux i am a bit annoyed without GetFirstVisibleLineEditor () ...

Is it possible for you to implement this instruction ? And even more instructions ???
greetings ( and ... what is the temperature in your town , Stan ? )
VANYA
Posts: 1834
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FBGUI library for Windows 2

Post by VANYA »

Hi enform!
and ... what is the temperature in your town , Stan ?
-17 degrees. This year we have a normal russian winter
I have coded a ' simple ' EditorGadget but under Linux i am a bit annoyed without GetFirstVisibleLineEditor () ...
Is it possible for you to implement this instruction ? And even more instructions ???
I can't promise anything, but I'll see what can be done there.
enform
Posts: 185
Joined: Apr 24, 2011 12:57
Location: France

Re: FBGUI library for Windows 2

Post by enform »

Ok , i understand , gtk doesn't look funny at first glance ... ( to me ...) .

another thing :
about health , bad virus and bad bacteria : i discovered in 2016 " colloidal silver " or " ionic silver " , do you know this product ?
It is made by electrolysis of 2 electrodes of pure silver metal in pure water , giving a concentration of 20 ppm .
Using that product since 2016 , no more infections ... , also good for wounds, burns , fungal infections .
In Europe , it is authorized only for external usage , THEY don't want more ....
I am not a doctor, legally speaking it is just " my opinion " , I don't recommend one product or another , but you can get documentation
on the subject . Spend the time , It is very important with our current and future pandemics++ , i think .
VANYA
Posts: 1834
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FBGUI library for Windows 2

Post by VANYA »

enform wrote: another thing :
about health , bad virus and bad bacteria : i discovered in 2016 " colloidal silver " or " ionic silver " , do you know this product ?
It is made by electrolysis of 2 electrodes of pure silver metal in pure water , giving a concentration of 20 ppm .
Using that product since 2016 , no more infections ... , also good for wounds, burns , fungal infections .
In Europe , it is authorized only for external usage , THEY don't want more ....
I am not a doctor, legally speaking it is just " my opinion " , I don't recommend one product or another , but you can get documentation
on the subject . Spend the time , It is very important with our current and future pandemics++ , i think .
I don't believe in "miraculous pills" (a panacea).
Coolman
Posts: 294
Joined: Nov 05, 2010 15:09

Re: FBGUI library for Windows 2

Post by Coolman »

it has nothing to do with freebasic. but you're wrong. colloidal silver is actually very effective if used well. try it and see. that's just my opinion.
jj2007
Posts: 2326
Joined: Oct 23, 2016 15:28
Location: Roma, Italia
Contact:

Re: FBGUI library for Windows 2

Post by jj2007 »

Coolman wrote:colloidal silver is actually very effective if used well. try it and see. that's just my opinion.
Sure, that's just your opinion. Post it elsewhere, and be careful...
What Is Colloidal Silver?

Colloidal silver consists of tiny silver particles in a liquid that is sometimes promoted on the Internet as a dietary supplement. However, evidence supporting health-related claims is lacking. In fact, colloidal silver can be dangerous to your health.

Is Colloidal Silver Safe?

Colloidal silver can cause serious side effects. The most common is argyria, a bluish-gray discoloration of the skin, which is usually permanent.
Colloidal silver can also cause poor absorption of some drugs, such as certain antibiotics and thyroxine (used to treat thyroid deficiency).
The FDA also warned in 1999 that colloidal silver isn’t safe or effective for treating any disease or condition.
The FDA and the Federal Trade Commission have taken action against a number of companies for making misleading claims about colloidal silver products.
Coolman
Posts: 294
Joined: Nov 05, 2010 15:09

Re: FBGUI library for Windows 2

Post by Coolman »

i have been using alternative medicine for years and never get sick. but you may be right. keep following the recommendations of the FDA. good luck.
RNBW
Posts: 267
Joined: Apr 11, 2015 11:06
Location: UK

Re: FBGUI library for Windows 2

Post by RNBW »

VANYA

Hi. I found that I had not translated all of the Russian to English in the Window9 Help file. Hopefully now this has been corrected and the updated file can be found at https://www.dropbox.com/s/yftyo1kqeubx0 ... d.chm?dl=0.

I note from your post on 8 February 2021 that you have updated the Window9 library. Are there any changes to the help file that need to be made. If there are, could you direct me where you have made the changes and I will incorporate them in an updated English translation.

Best regards

Ray
Post Reply