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
super_castle
Posts: 289
Joined: Oct 10, 2006 7:19

Post by super_castle »

the serial interface with com1 ... 2 .. How does it work with windows 2?

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

Post by VANYA »

super_castle wrote:the serial interface with com1 ... 2 .. How does it work with windows 2?

gruss
As in FreeBasic. :)
Kot
Posts: 336
Joined: Dec 28, 2006 10:34

Post by Kot »

How do you set values for scrollbars? I mean windows created with OpenWindow and stil WS_VSCROLL.
And the second - if I do something like this

Code: Select all

hwnd=OpenWindow("",200,200,150,200)
'SetTransparentWindow(hwnd,140)
WindowStartDraw(hwnd)
FillRectDraw(10,10,&h00f0f0) 
TextDraw(10,10,"Hello",&hffffff)
StopDraw
ListBoxGadget(5,50,10,120,210)
a call to ListBoxGadget resets FillRectDraw color and erases all that I wrote with TextDraw (so does SetTransparentWindow). Is it the way it is in Windows or it's just a bug?
VANYA
Posts: 1834
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Post by VANYA »

How do you set values for scrollbars? I mean windows created with OpenWindow and stil WS_VSCROLL.
In the next update on the request of the Rens, I'll do the normal support ScrollBar. In the meantime, you can specify the styles in the function OpenWindow WS_VSCROLL Or WS_VISIBLE and using the API to implement scrolling. Or wait for next update :)
Kot wrote:How do you set values for scrollbars? I mean windows created with OpenWindow and stil WS_VSCROLL.
And the second - if I do something like this

Code: Select all

hwnd=OpenWindow("",200,200,150,200)
'SetTransparentWindow(hwnd,140)
WindowStartDraw(hwnd)
FillRectDraw(10,10,&h00f0f0) 
TextDraw(10,10,"Hello",&hffffff)
StopDraw
ListBoxGadget(5,50,10,120,210)
a call to ListBoxGadget resets FillRectDraw color and erases all that I wrote with TextDraw (so does SetTransparentWindow). Is it the way it is in Windows or it's just a bug?
That's OK, because the function SetTransparentWindow or add any gadget redraws the window. To sign not erased, it is necessary to draw in the procedure of the timer.

Example:

Code: Select all

#Include "window9.bi"
Dim ev As Integer
Dim Shared As HWND hwnd
hwnd=OpenWindow("",200,200,300,200):WindowColor(hwnd,&h00f0f0)
SetTransparentWindow(hwnd,140)
Sub draw_
	WindowStartDraw(hwnd,10,10,50,30)
	FillRectDraw(10,10,&h00f0f0)
	TextDraw(10,10,"Hello",&hffffff)
	StopDraw
End Sub
SetTimer(hwnd,1,1,@draw_)
ListBoxGadget(5,70,10,120,150)
Do
	ev=WindowEvent
Loop Until ev=EventClose
Albom
Posts: 24
Joined: Oct 13, 2010 8:53
Location: Kharkiv, Ukraine
Contact:

Post by Albom »

Thanks for this great library!
Is statusbar and threads implementation in plans?
VANYA
Posts: 1834
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Post by VANYA »

Albom wrote:Thanks for this great library!
Is statusbar and threads implementation in plans?
StatusBar necessarily going to do.
Imortis
Moderator
Posts: 1923
Joined: Jun 02, 2005 15:10
Location: USA
Contact:

Post by Imortis »

Vanya:
Have you ever tried this library on win 2000?

I am. Most of it seems to work very well, but their are a few gadgets (like the IP address Gadget) that don't work in win 2000.

Is there some DLL I can get for win 2000 to make everything work?
VANYA
Posts: 1834
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Post by VANYA »

Imortis wrote:Vanya:
Have you ever tried this library on win 2000?

I am. Most of it seems to work very well, but their are a few gadgets (like the IP address Gadget) that don't work in win 2000.

Is there some DLL I can get for win 2000 to make everything work?
Library of written and tested under Windows 7. It is for this reason that I refused to animation control, animation control not work under windows 7.
If Library will run under other versions of Windows, it's not bad. If you are ready to help do something, I'll be happy.

PS The next update will be no warning when compiling, I corrected it.
Imortis
Moderator
Posts: 1923
Joined: Jun 02, 2005 15:10
Location: USA
Contact:

Post by Imortis »

VANYA wrote:...If you are ready to help do something, I'll be happy.

PS The next update will be no warning when compiling, I corrected it.
I am currently trying to find out why the calendar control (SysMonthCal32) is not showing up on win 2000. What I can tell you is that CreateWindowEx returns 0 on Win 2000. From what I have read, the code for the calendar is in the a DLL that comes with Internet Explorer 5 and up. I have IE 6 on this win 2000 machine, so it SHOULD work.

I will see what else I can find out.

Also, I'm glad to here you removed the warnings from the source code. About how long until the next release?

PS: Just so you know: I LOVE your library. I think the way it streamlines things is just perfect. It is for that reason that I made a big deal about the Warnings. If I didn't like the end product I would not have said a thing.
Merick wrote:Which version of FbEdit are you using? I have 1.0.7.6.c (haven't updated in a while, don't know what the current version is at now)
Sorry, Merick. I missed this until just now. I am using the same version as you. It is the newest. I have used it on win 2000 and win 7 and in both cases, compiling the library here crashes the IDE. It does finish compiling the library, but after the .a file is made, the IDE crashes.
mdchipman
Posts: 9
Joined: Aug 26, 2006 2:48

Post by mdchipman »

Imortis try the example as:

Calendar.bas

Code: Select all

#Include "window9.bi"

Dim InitCtrlEx As INITCOMMONCONTROLSEX 

InitCtrlEx.dwSize = sizeof(INITCOMMONCONTROLSEX)
InitCtrlEx.dwICC  = ICC_PROGRESS_CLASS
InitCommonControlsEx(@InitCtrlEx)

OpenWindow("",10,10,400,300)
CalendarGadget(1,10,10,220,220)
ButtonGadget(2,250,100,130,20,"???????? ????")
TextGadget(3,250,140,130,20,"",SS_CENTER)
Do
 var event=WindowEvent()
 If event=eventclose Then End
 If event=eventgadget Then
  If eventnumber()=2 Then
   SetGadgetText(3,Str(GetStateCalendar(1)))
  EndIf
 EndIf

Loop
Imortis
Moderator
Posts: 1923
Joined: Jun 02, 2005 15:10
Location: USA
Contact:

Post by Imortis »

mdchipman wrote:Imortis try the example as:

Calendar.bas

Code: Select all

#Include "window9.bi"

Dim InitCtrlEx As INITCOMMONCONTROLSEX 

InitCtrlEx.dwSize = sizeof(INITCOMMONCONTROLSEX)
InitCtrlEx.dwICC  = ICC_PROGRESS_CLASS
InitCommonControlsEx(@InitCtrlEx)

OpenWindow("",10,10,400,300)
CalendarGadget(1,10,10,220,220)
ButtonGadget(2,250,100,130,20,"???????? ????")
TextGadget(3,250,140,130,20,"",SS_CENTER)
Do
 var event=WindowEvent()
 If event=eventclose Then End
 If event=eventgadget Then
  If eventnumber()=2 Then
   SetGadgetText(3,Str(GetStateCalendar(1)))
  EndIf
 EndIf

Loop
Nope. Still no good.
VANYA
Posts: 1834
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Post by VANYA »

Also, I'm glad to here you removed the warnings from the source code. About how long until the next release?
I'm stuck with a control TreeView. Asked in the forum, but so far no one has helped. I can not make the function move Items.
Imortis
Moderator
Posts: 1923
Joined: Jun 02, 2005 15:10
Location: USA
Contact:

Post by Imortis »

mdchipman wrote:Imortis try the example as:

Calendar.bas

Code: Select all

#Include "window9.bi"

Dim InitCtrlEx As INITCOMMONCONTROLSEX 

InitCtrlEx.dwSize = sizeof(INITCOMMONCONTROLSEX)
InitCtrlEx.dwICC  = ICC_PROGRESS_CLASS
InitCommonControlsEx(@InitCtrlEx)

OpenWindow("",10,10,400,300)
CalendarGadget(1,10,10,220,220)
ButtonGadget(2,250,100,130,20,"???????? ????")
TextGadget(3,250,140,130,20,"",SS_CENTER)
Do
 var event=WindowEvent()
 If event=eventclose Then End
 If event=eventgadget Then
  If eventnumber()=2 Then
   SetGadgetText(3,Str(GetStateCalendar(1)))
  EndIf
 EndIf

Loop
I looked over this code closely... And I found out why this did not work!

It is this like:

Code: Select all

InitCtrlEx.dwICC  = ICC_PROGRESS_CLASS
It needs to be this:

Code: Select all

InitCtrlEx.dwICC  = ICC_DATE_CLASSES
That works properly on win 2000.

It looks like all of the controls that do not work could be fixed for any windows system with at least IE5 on them just by adding a block like so:

Code: Select all

Dim InitCtrlEx As INITCOMMONCONTROLSEX 

InitCtrlEx.dwSize = sizeof(INITCOMMONCONTROLSEX)
InitCtrlEx.dwICC  = ICC_PROGRESS_CLASS
InitCommonControlsEx(@InitCtrlEx)
to the Create<Name>Gadget functions of each, with the appropriate ICC value.

I would be willing to do that if VANYA doesn't want to.
VANYA
Posts: 1834
Joined: Oct 24, 2010 15:16
Location: Ярославль
Contact:

Post by VANYA »

Imortis wrote:
mdchipman wrote:Imortis try the example as:

Calendar.bas

Code: Select all

#Include "window9.bi"

Dim InitCtrlEx As INITCOMMONCONTROLSEX 

InitCtrlEx.dwSize = sizeof(INITCOMMONCONTROLSEX)
InitCtrlEx.dwICC  = ICC_PROGRESS_CLASS
InitCommonControlsEx(@InitCtrlEx)

OpenWindow("",10,10,400,300)
CalendarGadget(1,10,10,220,220)
ButtonGadget(2,250,100,130,20,"???????? ????")
TextGadget(3,250,140,130,20,"",SS_CENTER)
Do
 var event=WindowEvent()
 If event=eventclose Then End
 If event=eventgadget Then
  If eventnumber()=2 Then
   SetGadgetText(3,Str(GetStateCalendar(1)))
  EndIf
 EndIf

Loop
I looked over this code closely... And I found out why this did not work!

It is this like:

Code: Select all

InitCtrlEx.dwICC  = ICC_PROGRESS_CLASS
It needs to be this:

Code: Select all

InitCtrlEx.dwICC  = ICC_DATE_CLASSES
That works properly on win 2000.

It looks like all of the controls that do not work could be fixed for any windows system with at least IE5 on them just by adding a block like so:

Code: Select all

Dim InitCtrlEx As INITCOMMONCONTROLSEX 

InitCtrlEx.dwSize = sizeof(INITCOMMONCONTROLSEX)
InitCtrlEx.dwICC  = ICC_PROGRESS_CLASS
InitCommonControlsEx(@InitCtrlEx)
to the Create<Name>Gadget functions of each, with the appropriate ICC value.

I would be willing to do that if VANYA doesn't want to.

Imortis! Don notions of how work on windows 2000?

so:

Code: Select all

Dim InitCtrlEx As INITCOMMONCONTROLSEX 
InitCtrlEx.dwSize = sizeof(INITCOMMONCONTROLSEX)
InitCtrlEx.dwICC  = ICC_PROGRESS_CLASS
InitCommonControlsEx(@InitCtrlEx)
or so:

Code: Select all

Dim InitCtrlEx As INITCOMMONCONTROLSEX 
InitCtrlEx.dwSize = sizeof(INITCOMMONCONTROLSEX)
InitCtrlEx.dwICC  = ICC_DATE_CLASSES
InitCommonControlsEx(@InitCtrlEx)
Imortis
Moderator
Posts: 1923
Joined: Jun 02, 2005 15:10
Location: USA
Contact:

Post by Imortis »

VANYA wrote: Imortis! Don notions of how work on windows 2000?

so:

Code: Select all

Dim InitCtrlEx As INITCOMMONCONTROLSEX 
InitCtrlEx.dwSize = sizeof(INITCOMMONCONTROLSEX)
InitCtrlEx.dwICC  = ICC_PROGRESS_CLASS
InitCommonControlsEx(@InitCtrlEx)
or so:

Code: Select all

Dim InitCtrlEx As INITCOMMONCONTROLSEX 
InitCtrlEx.dwSize = sizeof(INITCOMMONCONTROLSEX)
InitCtrlEx.dwICC  = ICC_DATE_CLASSES
InitCommonControlsEx(@InitCtrlEx)
I'm afraid I don't get what you are asking me., but I will explain the code a little.

Those four lines are needed to initialize the Common Controls on Windows 2000. The third line specifies what Common controls to initialize. For Calendar controls you, use the Windows define ICC_DATE_CLASSES. For Progress bars, you use ICC_PROGRESS_CLASS.

Here is a link to a list of each define and what it initializes:
http://msdn.microsoft.com/en-us/library ... s.85).aspx

The effects of those four lines of code stack, so you only need to initialize the control when a new one is made using a CreateGadget function.

For example, here is the Code for CreateCalendarGadget, fixed to include the correct four lines above:

Code: Select all

Function CalendarGadget Alias "CalendarGadget"(ByVal gadget As integer,ByVal x As Integer,ByVal y As Integer,ByVal width_ As Integer,ByVal height_ As Integer,ByVal Style As Integer=0) As Integer Export
       Dim InitCtrlEx As INITCOMMONCONTROLSEX 
       InitCtrlEx.dwSize = sizeof(INITCOMMONCONTROLSEX)
       InitCtrlEx.dwICC  = ICC_DATE_CLASSES
       InitCommonControlsEx(@InitCtrlEx
       Var hhh =CreateWindowEx( Style, "SysMonthCal32", "", WS_CHILD Or WS_VISIBLE, x, y, width_ , height_, Cast(HWND, GETGURRENTAL()), Cast(HMENU, gadget),0,0)
	ADDIN9999 (gadget,hhh)
	If GGF()<>0 Then
		SendMessage(hhh,WM_SETFONT,GGF(),0)
	EndIf
	Return Cast(Integer, hhh)
End Function
That will have no extra effect on win XP and up, but will cause it to also function in win 2000.
Post Reply