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
chris319
Posts: 119
Joined: Jun 10, 2005 18:23

Re: FBGUI library for windows 2

Post by chris319 »

chris319! I ask to lay out in the archive [not working code + movie] , without violating the licenses movie.
Hi VANYA -

Where does one find this archive? Is it on SourceForge?

I got the movie volume function to work. Sorry for any misunderstanding.

I am also working with the movie snapshot function. It is very useful to me.
chris319
Posts: 119
Joined: Jun 10, 2005 18:23

Re: FBGUI library for windows 2

Post by chris319 »

chris319! I ask to lay out in the archive [not working code + movie] , without violating the licenses movie.
Hi VANYA -

Where does one find this archive? Is it on SourceForge?

I got the movie volume function to work. Sorry for any misunderstanding.

I am also working with the movie snapshot function. It is very useful to me.
VANYA
Posts: 1834
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FBGUI library for windows 2

Post by VANYA »

chris319 wrote:Where does one find this archive? Is it on SourceForge?
You did not understand me. I asked you to put the project (not working code + any movie) so that I or other forum members could check whether you did everything correctly in the code.
chris319 wrote:I got the movie volume function to work. Sorry for any misunderstanding.
Well, what about this statement:
chris319 wrote:The function LoadMovie() does not open a movie file with a literal string, viz.:

Code: Select all
mov8=loadmovie(GadgetID(4),"mymovie.mp4",0,0,WindowWidth(hwnd)-30,WindowHeight(hwnd)-110)
Happened to specify a string of type: "mymovie.mp4" ?
chris319
Posts: 119
Joined: Jun 10, 2005 18:23

Re: FBGUI library for windows 2

Post by chris319 »

Well, what about this statement:

chris319 wrote:
The function LoadMovie() does not open a movie file with a literal string, viz.:

Code: Select all
mov8=loadmovie(GadgetID(4),"mymovie.mp4",0,0,WindowWidth(hwnd)-30,WindowHeight(hwnd)-110)



Happened to specify a string of type: "mymovie.mp4" ?
That works now, too.
enform
Posts: 185
Joined: Apr 24, 2011 12:57
Location: France

Re: FBGUI library for windows 2

Post by enform »

Hello ,
I'm playing a bit with 2D_Draw . I just added 1 WindowStartDraw ( WSD ) and 1 or 2 ImageStartDraw ( ISD1 & ISTD2 ) .
I can move or comment the code of the 2 ISDn before or after WSD .
When ISD1 and/or ISD2 are moved before WSD , all is displayed , but when WSD is in the first place , it is not displayed ;
only ISD1 and/or ISD2 are .
This is my problem ... A solution , dear FbMen ? Thanks .

Code: Select all

 
#Include Once "window9.bi"
 
Type w0
	As HWND hwnd_0
	Declare Sub Sub_1( )  '  Button  :  Button1
	Declare Sub Sub_2( )  '  Button  :  Button2
	Declare Function OpenWindow_0() As HWND
End Type

' Dim
	Dim As w0 win0
' End Dim

  
Function w0.OpenWindow_0() As HWND
	hwnd_0 = OpenWindow("Win0",10,10,500,600)
	WindowColor(hwnd_0,BGR(240,240,240))
	SetGadgetFont(,CInt(LoadFont("Courier New",10)))
	'WindowBounds(hwnd_0,500,300,500,300)
	Var HIMAGE = Load_Icon(ExePath + "\*.ico")
	SendMessage(hwnd_0,WM_SETICON,ICON_BIG,Cast(LPARAM,HIMAGE))
	UseGadgetList(hwnd_0)
	ButtonGadget(1,230,200,70,200,"Button1")
	SetGadgetFont(1,CInt(LoadFont("Tahoma",9)))
 
	ButtonGadget(2,230,410,70,20,"Button2")
	SetGadgetFont(2,CInt(LoadFont("Tahoma",9)))
	CheckBoxGadget(3,320,380,120,50,"Chk3")
	SetGadgetFont(3,CInt(LoadFont("Tahoma",9)))
	SetGadgetColor(3,BGR(220,220,220),BGR(0,0,0),3)
	
 
	Return hwnd_0
End Function
 
win0.hwnd_0 = win0.OpenWindow_0()
 
Sub w0.Sub_1( )  '  Button  : Button1
	' Static As Long
	' Static As	
 
End Sub 
 
Sub w0.Sub_2( )  '  Button  : Button2
	' Static As Long
	' Static As	
 
End Sub 
 
 
' endcode w0
 
 
 
' code MAIN
 ' ISD1
	' place  Create_Image  just before  ImageStartDraw  for a good parsing
	Var hbitmap = Create_Image(120,140)
	ImageStartDraw(hbitmap)
	FillRectDraw(10,10,&h557788)
	CircleDraw(25,30,20,255,255)
	BoxDraw(10,70,30,30,125)
	StopDraw
	
	ImageGadget(4,0,320,120,140,hbitmap)
 
 ' ISD2
	Var hbitmap1 = Create_Image(120,140)
	ImageStartDraw(hbitmap1)
	FillRectDraw(10,10,&h557788)
	CircleDraw(25,30,20,255,255)
	BoxDraw(10,70,30,30,125)
	StopDraw
	
	ImageGadget(5,150,320,120,140,hbitmap1)

' WSD
	WindowStartDraw(win0.hwnd_0,0,0,500,300,,)
	FillRectDraw(10,10,&h887755)
	'BoxDraw(10,10,100,100,125)
	CircleDraw(10,10,60,255,255)
	RoundDraw(140,20,55,60,200,1671940,20)
	RoundBoxDraw(265,90,110,110,100,220,,,1005,240)
	PieDraw(70,70,80,80,170,60,60,130,255,&hff0000,2)
	LineDraw(205,60,420,160,15,155)
	TextDraw(30,90,"Hello AZERTY",240,50)
 
 
	Dim pPoint0(3) As Point
	pPoint0(0).x = 445
	pPoint0(0).y = 30
	pPoint0(1).x = 165
	pPoint0(1).y = 125
	pPoint0(2).x = 150
	pPoint0(2).y = 200
	PolylineDraw(@pPoint0(0),3,&hD24EF3)
 
	Dim pPoint1(3) As Point
	pPoint1(0).x = 35
	pPoint1(0).y = 140
	pPoint1(1).x = 150
	pPoint1(1).y = 150
	pPoint1(2).x = 110
	pPoint1(2).y = 200
	PolygonDraw(@pPoint1(0),3,&hD24EF3)			
 
	StopDraw
 
 ' if this part is commented , WindowStartDraw(win0.hwnd_0 .... is displayed 
 ' if this part is uncommented , WindowStartDraw(win0.hwnd_0 .... is not displayed 
 ' if the first ImageStartDraw(hbitmap) .... is commented and the following hbitmap1 is uncommented ,
 ' all is displayed . 
 
	' place  Create_Image  just before  ImageStartDraw  for a good parsing
	'Var hbitmap1 = Create_Image(120,140)
	'ImageStartDraw(hbitmap1)
	'FillRectDraw(10,10,&h557788)
	'CircleDraw(25,30,20,255,255)
	'BoxDraw(10,70,30,30,125)
	'StopDraw
	'
	'ImageGadget(5,150,320,120,140,hbitmap1)
 
 
	
' endcode MAIN
 
Do
	Var event = WaitEvent
	Select Case event
		Case WM_SIZE
		Case EventClose
			Exit Do     ' End
		Case EventMenu
			Select Case EventNumber
				Case 1000
			End Select
		Case EventGadget
			Select Case EventNumber
				Case 1      '  Button : Button1
					win0.Sub_1( ) 
				Case 2      '  Button : Button2
					win0.Sub_2( ) 
			End Select
			Select Case EventNumberToolBar
				Case 9999
			End Select
	End Select
Loop
'

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

Re: FBGUI library for windows 2

Post by VANYA »

Hi enform!

Drawing with WindowStartDraw (drawing on the window) should be supported by the programmer. This is done in a cycle or a timer.

example 1:

Code: Select all

#Include "window9.bi"

Var hwnd = OpenWindow("",10,10,500,500)

Do

   Var event = WindowEvent
   
   WindowStartDraw(hwnd)

    CircleDraw(50,50,50,255,255)
   
   StopDraw
   
   Sleep(1)

   If event = eventclose Then Exit Do

Loop 
example 2:

Code: Select all

#Include "window9.bi"

Dim Shared As HWND hwnd 

hwnd = OpenWindow("",10,10,500,500)

Sub draw_()
   
   WindowStartDraw(hwnd)

    CircleDraw(50,50,50,255,255)
   
   StopDraw   
   
End Sub

SetTimer(hwnd,1,10,@draw_())

Do

   Var event = WaitEvent

   If event = eventclose Then Exit Do

Loop 

KillTimer(hwnd,1)
enform
Posts: 185
Joined: Apr 24, 2011 12:57
Location: France

Re: FBGUI library for windows 2

Post by enform »

Thank you Vanya ; in events or timer !
RNBW
Posts: 267
Joined: Apr 11, 2015 11:06
Location: UK

Re: FBGUI library for windows 2

Post by RNBW »

VANYA

I have used Google Translate and CHM Editor to translate the Window9 help file from Russian to English. I can't vouch for Google Translate's conversion, but it seems to make sense.

After downloading the file Window9HelpEng.chm, right-click/open Properties/tick unblock/apply/OK. It should then work fine.

The link for download is below:

https://1drv.ms/u/s!Ak-Oweolk8pomX8gMbeyyLE6F6lL

I hope it will be useful to you and users of your superb FBGUI library.

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

Re: FBGUI library for windows 2

Post by VANYA »

Ok, RNBW, I added your translated file to sf.net . Thank you!
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Re: FBGUI library for windows 2

Post by D.J.Peters »

VANYA is your fine lib 64-bit ready now ?

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

Re: FBGUI library for windows 2

Post by RNBW »

VANYA

A 64-bit version of your library would be great!
VANYA
Posts: 1834
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FBGUI library for windows 2

Post by VANYA »

D.J.Peters wrote:VANYA is your fine lib 64-bit ready now ?

Joshy
No, I do not plan to create a library for 64-bit compilier.
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Re: FBGUI library for windows 2

Post by D.J.Peters »

VANYA wrote:
D.J.Peters wrote:VANYA is your fine lib 64-bit ready now ?
No, I do not plan to create a library for 64-bit compiler.
Why not you bloody bastard :lol:

download: libWindow9.zip 32/64-bit source code are included.

By the way it was a kind of nightmare to change all the hard coded 32-bit stuff in ~300 files.

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

Re: FBGUI library for windows 2

Post by VANYA »

D.J.Peters wrote:
VANYA wrote:
D.J.Peters wrote:VANYA is your fine lib 64-bit ready now ?
No, I do not plan to create a library for 64-bit compiler.
Why not you bloody bastard :lol:

download: libWindow9.zip 32/64-bit source code are included.

By the way it was a kind of nightmare to change all the hard coded 32-bit stuff in ~300 files.

Joshy
Joshy! You are the same developer of window9 as I am. I gave you access to sf.net .If you think that the project window9 64-bit is stable, what prevents you from downloading it to the official branch sf.net ? I can only praise you that you have done such work.

On the merits of the question, why did not I do the 64-bit version myself:

1) I almost do not use 64-bit compilier freebasic on the windows
2) There are pitfalls on 64-bit that I do not know how to implement, for example IncludeBinary
3) Over the past 5-7 years, I have not seen any other project using a library from other users. That is, the popularity of the library is close to zero. Then why should I waste my time?
4) The biggest reason: ask yourself, why do not you create a 64-bit version of fbsound? It's because neither you nor I owe anything to anyone. We did not sign contracts for the creation. Everything was driven by our enthusiasm.
D.J.Peters
Posts: 8586
Joined: May 28, 2005 3:28
Contact:

Re: FBGUI library for windows 2

Post by D.J.Peters »

I have done my best to get the lib 32/64-bit compatible.

That means to day I edit all ~300 files again and it's "-w pedantic" compatible also.

I added only FastCRC16

link is the same: libWindow9.zip

TO DO:
the inc bin macro stuff must be changed but it's enough for me to day :-)

Happy Easter.

Joshy
Last edited by D.J.Peters on Apr 02, 2018 19:11, edited 1 time in total.
Post Reply