Hilfe mit ImageGadget
Verfasst: 14.07.2010 23:06
Hallo zusammen,
ich möchte mit ein einfache PB mit ImageGadget testen.
Ohne ImageGadget ist die Funktion OK.
Mit ImageGadget reagieren die Button nicht.
Ich verstehe nicht warum:
Danke für ein (oder mehrere Tips)
Gruß
Marcel
ich möchte mit ein einfache PB mit ImageGadget testen.
Ohne ImageGadget ist die Funktion OK.
Mit ImageGadget reagieren die Button nicht.
Ich verstehe nicht warum:
Code: Alles auswählen
Enumeration
#Window_0
#txt1
#txt2
#txt3
#buttonEnd
#buttonNew
#web
#frame
#img
EndEnumeration
Define.l Event, EventWindow, EventGadget, EventMenu
Global width.i = 960
Global height.i = 768
Global W_dscrx.i = 80
Global W_dscry.i = 20
Global W_dscrw.i = 700
Global W_dscrh.i = 570
W_dscrx = (width - W_dscrw)/2
#pathTxt = "text\fr\"
UseJPEGImageDecoder()
imgBack = CatchImage (1,?imgBack)
If OpenWindow(#Window_0, 0, 0, width, height, "Titel", #PB_Window_ScreenCentered|#PB_Window_SystemMenu|#PB_Window_MinimizeGadget|#PB_Window_TitleBar)
hWnd = GetActiveWindow()
;- ImageGadget(#img, 0,0,width,height-300,imgBack)
TextGadget(#txt1, 0, height-120, width, 120, "");
SetGadgetColor(#txt1, #PB_Gadget_BackColor, RGB($99, $CC, $CD))
TextGadget(#txt2, 0, height-30, width, 25, "text ... ", #PB_Text_Center)
SetGadgetColor(#txt2, #PB_Gadget_BackColor, RGB($99, $CC, $CD))
SetGadgetColor(#txt2, #PB_Gadget_FrontColor, RGB($33, $66, $CC))
ButtonGadget(#buttonEnd, width -100, height-100, 70, 30, "end")
WebGadget(#web, W_dscrx, W_dscry, W_dscrw, W_dscrh, "")
Global dscr.s=PeekS(?dscr, ?W_1_end-?dscr)
SetGadgetItemText (#web, #PB_Web_HtmlCode, dscr.s)
Frame3DGadget(#frame, W_dscrx-1, W_dscry-1, W_dscrw+2, W_dscrh+2, "xxxxxxx", #PB_Frame3D_Flat)
ButtonGadget(#buttonNew, width/2 + 50, height-100, 70, 30, "new")
EndIf
isTxt3=#False
stateTxt3 = 0;
Repeat
Event = WaitWindowEvent()
Select Event
Case #PB_Event_Gadget
EventGadget = EventGadget()
If EventGadget = #buttonEnd
CloseWindow(#Window_0)
Break
ElseIf EventGadget = #buttonNew
If isTxt3 = #False
TextGadget(#txt3, 10, height-200, 50, 25, "text3 ... ")
Debug("TextGadget")
;HideGadget(#txt3,stateTxt3)
isTxt3 = #True
Else
If stateTxt3 = 1
stateTxt3 = 0
Else
stateTxt3 = 1
EndIf
HideGadget(#txt3,stateTxt3)
EndIf
EndIf
Case #PB_Event_CloseWindow
EventWindow = EventWindow()
If EventWindow = #Window_0
CloseWindow(#Window_0)
Break
EndIf
EndSelect
ForEver
DataSection
imgBack: IncludeBinary "imgBack.jpg"
dscr: IncludeBinary #pathTxt + "W_1_dscr.html" : W_1_end:
EndDataSection
Gruß
Marcel