Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;
- ; This code is automatically generated by the FormDesigner.
- ; Manual modification is possible to adjust existing commands, but anything else will be dropped when the code is compiled.
- ; Event procedures needs to be put in another source file.
- ;
- Global Window_0
- Global ButtonImage_0, RenderedImage_0, ImgGadget_0, ButtonImage_1, ImgGadget_1, RenderedImage_1
- #BtnTxtString1 = "Testing 1"
- #BtnTxtString2 = "Testing 2"
- UsePNGImageDecoder()
- RenderedImage_0 = CreateImage(#PB_Any, 128, 32, 32, #PB_Image_Transparent)
- RenderedImage_1 = CreateImage(#PB_Any, 128, 32, 32, #PB_Image_Transparent)
- ButtonImage_0 = CatchImage(#PB_Any, ?ChkImage, ?XImage - ?ChkImage)
- ButtonImage_1 = CatchImage(#PB_Any, ?XImage, ?EndPtr - ?XImage)
- Procedure DrawGoodlyButton(rndImg, btnImg, txtCaption.s)
- If StartDrawing(ImageOutput(rndImg))
- DrawingMode(#PB_2DDrawing_AlphaBlend | #PB_2DDrawing_Transparent)
- ;DrawingFont(FontID(#Font_Window_0_0))
- DrawAlphaImage(ImageID(btnImg), 0, 0)
- DrawText(ImageWidth(btnImg) + 5, (ImageHeight(btnImg) / 2) - (TextHeight(txtCaption) / 2), txtCaption, RGBA(0, 0, 0, 255))
- StopDrawing()
- EndIf
- EndProcedure
- Procedure OpenWindow_0(x = 0, y = 0, width = 600, height = 400)
- Window_0 = OpenWindow(#PB_Any, x, y, width, height, "Testing Native Graphic Buttons", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
- DrawGoodlyButton(RenderedImage_0, ButtonImage_0, #BtnTxtString1)
- DrawGoodlyButton(RenderedImage_1, ButtonImage_1, #BtnTxtString2)
- ImgGadget_0 = ButtonImageGadget(#PB_Any, 320, 260, 160, 60, ImageID(RenderedImage_0))
- ImgGadget_1 = ButtonImageGadget(#PB_Any, 240, 170, 128, 32, ImageID(RenderedImage_1))
- EndProcedure
- Procedure Window_0_Events(event)
- Select event
- Case #PB_Event_CloseWindow
- ProcedureReturn #False
- Case #PB_Event_Menu
- Select EventMenu()
- EndSelect
- Case #PB_Event_Gadget
- Select EventGadget()
- EndSelect
- EndSelect
- ProcedureReturn #True
- EndProcedure
- OpenWindow_0()
- Repeat
- Event = WaitWindowEvent(100)
- Window_0_Events(Event)
- Until Event = #PB_Event_CloseWindow
- DataSection
- ChkImage:
- Data.b $89,$50,$4E,$47,$0D,$0A,$1A,$0A,$00,$00,$00,$0D,$49,$48,$44,$52
- Data.b $00,$00,$00,$20,$00,$00,$00,$20,$08,$06,$00,$00,$00,$73,$7A,$7A
- Data.b $F4,$00,$00,$00,$01,$73,$52,$47,$42,$00,$AE,$CE,$1C,$E9,$00,$00
- Data.b $00,$04,$67,$41,$4D,$41,$00,$00,$B1,$8F,$0B,$FC,$61,$05,$00,$00
- Data.b $00,$09,$70,$48,$59,$73,$00,$00,$0E,$C3,$00,$00,$0E,$C3,$01,$C7
- Data.b $6F,$A8,$64,$00,$00,$01,$0B,$49,$44,$41,$54,$58,$47,$E5,$96,$D1
- Data.b $0E,$83,$20,$0C,$45,$61,$3F,$8E,$7C,$79,$C7,$65,$E8,$10,$2B,$50
- Data.b $6D,$63,$B2,$9D,$8C,$E8,$1E,$D6,$73,$AD,$95,$E9,$89,$C8,$3D,$C9
- Data.b $AB,$1C,$1F,$E3,$F7,$03,$78,$E7,$29,$AF,$E8,$D9,$7B,$6D,$3A,$03
- Data.b $10,$E7,$93,$98,$D6,$B2,$E0,$93,$09,$21,$F8,$CF,$99,$61,$07,$76
- Data.b $F2,$0E,$26,$01,$66,$E5,$40,$3D,$00,$2B,$5F,$7B,$CF,$A0,$1A,$A0
- Data.b $27,$3F,$CB,$A0,$16,$E0,$8A,$1C,$A8,$04,$90,$C8,$EB,$27,$00,$B0
- Data.b $01,$50,$70,$B7,$4E,$9E,$61,$70,$47,$0E,$D8,$7D,$20,$17,$6D,$0A
- Data.b $12,$31,$3F,$BE,$29,$07,$87,$0E,$6C,$45,$1B,$62,$8C,$84,$55,$BE
- Data.b $F2,$F2,$C2,$AC,$1C,$F0,$33,$C0,$14,$AD,$39,$95,$B7,$E6,$44,$4F
- Data.b $0E,$C4,$43,$38,$92,$D7,$19,$46,$72,$20,$0A,$B0,$84,$52,$7D,$42
- Data.b $3E,$CB,$61,$08,$F3,$15,$72,$B7,$20,$94,$E3,$A4,$7C,$E6,$EA,$C1
- Data.b $7C,$00,$8E,$9B,$72,$20,$9E,$81,$0D,$05,$39,$B8,$16,$40,$49,$0E
- Data.b $E4,$01,$14,$E5,$40,$16,$40,$59,$0E,$0E,$01,$C8,$A5,$ED,$7F,$9D
- Data.b $F8,$1A,$03,$39,$60,$3B,$90,$43,$D4,$26,$23,$39,$E8,$BE,$94,$7A
- Data.b $FF,$DD,$FB,$2D,$E4,$60,$F8,$56,$5C,$FF,$01,$AD,$68,$C9,$C1,$70
- Data.b $08,$5B,$99,$A6,$1C,$0C,$3B,$60,$8D,$7C,$1F,$50,$E6,$DF,$03,$38
- Data.b $F7,$06,$2E,$CD,$8E,$A8,$CB,$01,$14,$B6,$00,$00,$00,$00,$49,$45
- Data.b $4E,$44,$AE,$42,$60,$82
- XImage:
- Data.b $89,$50,$4E,$47,$0D,$0A,$1A,$0A,$00,$00,$00,$0D,$49,$48,$44,$52
- Data.b $00,$00,$00,$20,$00,$00,$00,$20,$08,$06,$00,$00,$00,$73,$7A,$7A
- Data.b $F4,$00,$00,$00,$01,$73,$52,$47,$42,$00,$AE,$CE,$1C,$E9,$00,$00
- Data.b $00,$04,$67,$41,$4D,$41,$00,$00,$B1,$8F,$0B,$FC,$61,$05,$00,$00
- Data.b $00,$09,$70,$48,$59,$73,$00,$00,$0E,$C3,$00,$00,$0E,$C3,$01,$C7
- Data.b $6F,$A8,$64,$00,$00,$01,$4D,$49,$44,$41,$54,$58,$47,$ED,$96,$E1
- Data.b $8E,$84,$20,$0C,$84,$E1,$5E,$1C,$79,$72,$96,$D9,$85,$4B,$ED,$52
- Data.b $3A,$DD,$3D,$E3,$9F,$FB,$12,$A3,$26,$38,$33,$54,$8A,$E6,$D6,$5A
- Data.b $BA,$93,$9F,$71,$BE,$8D,$FF,$00,$D7,$04,$C8,$B9,$3D,$0F,$02,$7F
- Data.b $11,$4A,$A1,$D6,$F2,$B8,$B2,$19,$E3,$EB,$F3,$26,$A5,$E2,$3C,$63
- Data.b $57,$40,$CC,$02,$62,$38,$B2,$37,$2B,$65,$0E,$BC,$67,$EC,$00,$23
- Data.b $B9,$14,$03,$B5,$D6,$B5,$E0,$C2,$FC,$18,$67,$F3,$99,$4E,$68,$0D
- Data.b $40,$F0,$38,$8E,$77,$C1,$8D,$39,$C6,$03,$2B,$C4,$3E,$40,$AF,$42
- Data.b $19,$97,$26,$84,$F9,$8E,$70,$17,$9C,$AA,$10,$30,$2F,$A5,$2C,$17
- Data.b $23,$B7,$15,$77,$23,$BD,$16,$66,$65,$BE,$31,$07,$E1,$0A,$4C,$60
- Data.b $AC,$43,$81,$88,$39,$E0,$02,$10,$6B,$E1,$6C,$FB,$C2,$33,$07,$1F
- Data.b $57,$40,$B2,$2A,$3D,$63,$0E,$FE,$24,$00,$D0,$A5,$67,$E1,$02,$8C
- Data.b $D5,$CE,$C2,$CE,$1E,$F8,$01,$16,$AD,$A6,$C1,$DC,$67,$05,$22,$E6
- Data.b $60,$DF,$86,$84,$B9,$04,$11,$BA,$5E,$28,$80,$5D,$81,$A0,$39,$40
- Data.b $00,$F7,$83,$A5,$D8,$BE,$82,$65,$9F,$8F,$C3,$22,$1A,$62,$1D,$C0
- Data.b $10,$98,$C6,$78,$DF,$DE,$BE,$C0,$86,$30,$2B,$A0,$67,$2F,$CD,$41
- Data.b $35,$42,$C8,$71,$BB,$CF,$F0,$C4,$EF,$82,$8E,$36,$FF,$45,$ED,$90
- Data.b $AB,$71,$5E,$08,$2A,$00,$D0,$E6,$BA,$DD,$AC,$90,$5E,$5B,$BA,$01
- Data.b $CE,$72,$2F,$4E,$A2,$A2,$0A,$51,$73,$B0,$DD,$07,$E6,$42,$92,$C2
- Data.b $96,$A8,$2E,$35,$63,$0E,$B6,$01,$56,$EF,$6F,$27,$3C,$C7,$B3,$E6
- Data.b $80,$FA,$21,$F9,$44,$98,$85,$FB,$23,$BA,$10,$BA,$0B,$AE,$E2,$E6
- Data.b $00,$29,$3D,$00,$51,$D5,$A9,$B6,$7A,$BC,$6F,$57,$00,$00,$00,$00
- Data.b $49,$45,$4E,$44,$AE,$42,$60,$82
- EndPtr:
- EndDataSection
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement