FBGUI library for Windows 2

External libraries (GTK, GSL, SDL, Allegro, OpenGL, etc) questions.
D.J.Peters
Posts: 8179
Joined: May 28, 2005 3:28
Contact:

Re: FBGUI library for windows 2

Postby D.J.Peters » Feb 23, 2013 13:44

Hello VANYA
if i use the source code from http://free-basic.ru/user-files/Project.zip i get one error.

the HWND parm are different

Code: Select all

...
compile: TextPrinter.bas
compile: ToolBarToolTip.bas
ToolBarToolTip.bas(68) error 1: Argument count mismatch in 'Function ToolBarTool
Tip(ByVal buttonID As Integer,ByVal toolTipS_ As String) As Integer Export'
###################
# compile error ! #
###################

windows9.bi

Code: Select all

Declare Function ToolBarToolTip(ByVal Hwnd As Hwnd,ByVal buttonID As Integer,ByVal toolTipS As String) As Integer

ToolBartooltip.bas

Code: Select all

Function ToolBarToolTip(ByVal buttonID As Integer,ByVal toolTipS_ As String) As Integer Export
Jonge
Posts: 130
Joined: Jul 17, 2012 17:51
Location: Norway
Contact:

Re: FBGUI library for windows 2

Postby Jonge » Feb 23, 2013 16:15

That's the same errors I got, those are fixed in the source you find on the SF page
VANYA
Posts: 1374
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FBGUI library for windows 2

Postby VANYA » Feb 23, 2013 17:19

D.J.Peters wrote:if i use the source code from http://free-basic.ru/user-files/Project.zip i get one error...


Hello Joshy!

I forgot to update the files on those links. Thanks for the post, now there is also updated.
I3I2UI/I0
Posts: 90
Joined: Jun 03, 2005 10:39
Location: Germany

Re: FBGUI library for windows 2

Postby I3I2UI/I0 » Mar 12, 2013 18:51

Hi,
an example of a splash screen with a transparent background.
This tip worked: http://www.codeproject.com/Tips/141076/ ... nGL-window

Code: Select all

#Include "window9.bi"
#Include "GL/glut.bi"

Dim Shared As Integer OpenGL = 1

Sub RenderScene
  Static i As Single
  glClear GL_COLOR_BUFFER_BIT Or GL_DEPTH_BUFFER_BIT
  glPushMatrix

  glLoadIdentity
  glTranslatef 0.0, 0.0, -3.0
  glRotatef i, 0, 1, 0

  glBegin GL_TRIANGLES
  glColor3f   1.0, 0.0, 0.0     'Red
  glVertex3f  0.0, 1.0, 0.0     'Top Of Triangle Front
  glColor3f   0.0, 1.0, 0.0     'Green
  glVertex3f -1.0,-1.0, 1.0     'Left Of Triangle Front
  glColor3f   0.0, 0.0, 1.0     'Blue
  glVertex3f  1.0,-1.0, 1.0     'Right Of Triangle Front
  glColor3f   1.0, 0.0, 0.0     'Red
  glVertex3f  0.0, 1.0, 0.0     'Top Of Triangle  Right
  glColor3f   0.0, 0.0, 1.0     'Blue
  glVertex3f  1.0,-1.0, 1.0     'Left Of Triangle Right
  glColor3f   0.0, 1.0, 0.0     'Green
  glVertex3f  1.0,-1.0,-1.0     'Right Of Triangle Right
  glColor3f   1.0, 0.0, 0.0     'Red
  glVertex3f  0.0, 1.0, 0.0     'Top Of Triangle Back
  glColor3f   0.0, 1.0, 0.0     'Green
  glVertex3f  1.0,-1.0,-1.0     'Left Of Triangle Back
  glColor3f   0.0, 0.0, 1.0     'Blue
  glVertex3f -1.0,-1.0,-1.0     'Right Of Triangle Back
  glColor3f   1.0, 0.0, 0.0     'Red
  glVertex3f  0.0, 1.0, 0.0     'Top Of Triangle Left
  glColor3f   0.0, 0.0, 1.0     'Blue
  glVertex3f -1.0,-1.0,-1.0     'Left Of Triangle Left
  glColor3f   0.0, 1.0, 0.0     'Green
  glVertex3f -1.0,-1.0, 1.0     'Right Of Triangle Left
  glEnd
  glPopMatrix
  i = i + 2.0f
  OpenGLGadgetSwapBuffers opengl
End Sub

'http://www.codeproject.com/Tips/141076/Transparent-OpenGL-window
Var win = OpenWindow ("", 0,0,640,480,  WS_POPUP Or WS_VISIBLE, WS_EX_LAYERED )
SetLayeredWindowAttributes(win, 0, 0, LWA_COLORKEY)
CenterWindow win

OpenGLGadget(OpenGL, 0, 0, WindowClientWidth(win), WindowClientHeight(win))

'glEnable GL_ALPHA_TEST
glEnable GL_DEPTH_TEST
'glEnable GL_COLOR_MATERIAL

'Transparent-OpenGL-window
'glEnable GL_BLEND
'glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA
glClearColor 0, 0, 0, 0

Do
  Var event = WindowEvent
  If event = EventClose Then End
  If EventKEY = 27 Then End 'ESC -Taste
  RenderScene
  Sleep  1
Loop
VANYA
Posts: 1374
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FBGUI library for windows 2

Postby VANYA » Mar 13, 2013 4:59

Hello I3I2UI/I0!

I did not know anything about this, but here article (on russian) , that explains how it can be implemented
I3I2UI/I0
Posts: 90
Joined: Jun 03, 2005 10:39
Location: Germany

Re: FBGUI library for windows 2

Postby I3I2UI/I0 » Mar 13, 2013 14:14

VANYA wrote:I did not know anything about this, but here article (on russian) , that explains how it can be implemented

Nice article, but I read nothing about the implementation in window9.
VANYA
Posts: 1374
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FBGUI library for windows 2

Postby VANYA » Mar 13, 2013 15:38

I3I2UI/I0 wrote:Nice article, but I read nothing about the implementation in window9.


Of course there is no window9, paper is designed for C++, but it is the method of implementation.

P.S. functions OpenGlGadget involved DJPeters, I wrote in the help that my knowledge of this surface
bob2
Posts: 40
Joined: Sep 27, 2012 18:29

Re: FBGUI library for windows 2

Postby bob2 » Apr 17, 2013 9:30

Super. Very nice to use FreeBasic
with this library.
Big thank you.
bob2
Posts: 40
Joined: Sep 27, 2012 18:29

Re: FBGUI library for windows 2

Postby bob2 » Apr 18, 2013 13:40

Hello,
With EventKey, it is impossible to see if the é key (for example) has been pressed.
Image
It works with uppercase and numbers only.
Is it possible to overcome it to intercept any key ?
In advance, thank you for your reply.
VANYA
Posts: 1374
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FBGUI library for windows 2

Postby VANYA » Apr 18, 2013 14:00

bob2 wrote:Is it possible to overcome it to intercept any key ?
In advance, thank you for your reply.


Hi!

Try our GetAsyncKeyState:

Code: Select all

#Include "window9.bi"
Do
   Cls
   Print "Press ESC to exit"
Loop Until GetAsyncKeyState(&h1b)<0


All key codes
bob2
Posts: 40
Joined: Sep 27, 2012 18:29

Re: FBGUI library for windows 2

Postby bob2 » Apr 18, 2013 16:47

OK thank you. I understand better what it is: Virtual-Key Codes
But when I write a TextGadget (for example):
é è
I get characters like this:
Image
Should I change the font or should make adjustments?
bob2
Posts: 40
Joined: Sep 27, 2012 18:29

Re: FBGUI library for windows 2

Postby bob2 » Apr 18, 2013 20:33

Oh! I found using:
ASCIITOUTF (Text)
bob2
Posts: 40
Joined: Sep 27, 2012 18:29

Re: FBGUI library for windows 2

Postby bob2 » Apr 19, 2013 9:29

Hello,
with :
Var handle=Create_File("essai.txt")
If handle Then
Write_StringN(handle,"Paris")
Write_StringN(handle,"Londres")
EndIf
Close_file(handle)
one obtains:
Image

Can anyone tell me: how to add a line in that file already created? for :
Image
How when we reopened the file? Write_StringN(handle,"Moscou") crushes "Paris" and "Londres"

D'avance, merci
VANYA
Posts: 1374
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Re: FBGUI library for windows 2

Postby VANYA » Apr 19, 2013 11:58

bob2 wrote:Can anyone tell me: how to add a line in that file already created?


Hello!

Code: Select all

#Include "window9.bi"

Var handle=Create_File("essai.txt")
If handle<>-1 Then
 Write_StringN(handle,"Paris")
 Write_StringN(handle,"Londres")
 Close_file(handle)
EndIf


handle = Open_File("essai.txt")
If handle<>-1 Then
   Set_File_Pointer(handle,0,FILE_END)
   Write_StringN(handle,"Moscow")
   Close_file(handle)
EndIf
bob2
Posts: 40
Joined: Sep 27, 2012 18:29

Re: FBGUI library for windows 2

Postby bob2 » Apr 19, 2013 12:59

OK ! Again thank you.

Return to “Libraries”

Who is online

Users browsing this forum: No registered users and 1 guest