GUI library for Windows \ Linux (window9)
-
- Posts: 289
- Joined: Oct 10, 2006 7:19
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
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?
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)
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 :)How do you set values for scrollbars? I mean windows created with OpenWindow and stil WS_VSCROLL.
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.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 thisa 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?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)
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
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.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?
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.
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.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 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.
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.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)
Imortis try the example as:
Calendar.bas
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.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!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
It is this like:
Code: Select all
InitCtrlEx.dwICC = ICC_PROGRESS_CLASS
Code: Select all
InitCtrlEx.dwICC = ICC_DATE_CLASSES
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)
I would be willing to do that if VANYA doesn't want to.
Imortis wrote:I looked over this code closely... And I found out why this did not work!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
It is this like:It needs to be this:Code: Select all
InitCtrlEx.dwICC = ICC_PROGRESS_CLASS
That works properly on win 2000.Code: Select all
InitCtrlEx.dwICC = ICC_DATE_CLASSES
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:to the Create<Name>Gadget functions of each, with the appropriate ICC value.Code: Select all
Dim InitCtrlEx As INITCOMMONCONTROLSEX InitCtrlEx.dwSize = sizeof(INITCOMMONCONTROLSEX) InitCtrlEx.dwICC = ICC_PROGRESS_CLASS InitCommonControlsEx(@InitCtrlEx)
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)
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.VANYA wrote: Imortis! Don notions of how work on windows 2000?
so:
or so:Code: Select all
Dim InitCtrlEx As INITCOMMONCONTROLSEX InitCtrlEx.dwSize = sizeof(INITCOMMONCONTROLSEX) InitCtrlEx.dwICC = ICC_PROGRESS_CLASS InitCommonControlsEx(@InitCtrlEx)
Code: Select all
Dim InitCtrlEx As INITCOMMONCONTROLSEX InitCtrlEx.dwSize = sizeof(INITCOMMONCONTROLSEX) InitCtrlEx.dwICC = ICC_DATE_CLASSES InitCommonControlsEx(@InitCtrlEx)
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