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
'