Code: Select all
LoadImage(12, #PB_Compiler_Home + "examples/sources/Data/Geebee2.bmp")

Code: Select all
LoadImage(12, #PB_Compiler_Home + "examples/sources/Data/Geebee2.bmp")
aaaarg these %$&§" Slashes (Done)ts-soft wrote:You should change line 61 to:Code: Select all
LoadImage(12, #PB_Compiler_Home + "examples/sources/Data/Geebee2.bmp")
Not only slashes, linux is casesensitiv!Bisonte wrote:aaaarg these %$&§" Slashes
On my windows installation I copy the path from the explorer window... with the capital letters....ts-soft wrote:Not only slashes, linux is casesensitiv!Bisonte wrote:aaaarg these %$&§" Slashes
Sound, Sprite, Library, File, etc...Bisonte wrote:By the way... are there more "PB.xxx.Objects", I can put in this procedure ?
Code: Select all
DeclareModule Get_PB_Object
Enumeration 1
#PB_ID_Window
#PB_ID_Gadget
#PB_ID_Image
EndEnumeration
CompilerIf #PB_Compiler_OS = #PB_OS_Windows
Import ""
CompilerElse
ImportC ""
CompilerEndIf
PB_Object_EnumerateStart(*object)
PB_Object_EnumerateNext(*object,*id.Integer)
PB_Object_EnumerateAbort(*object)
PB_Window_Objects.i
PB_Gadget_Objects.i
PB_Image_Objects.i
EndImport
Declare PB_ID(OS_Handle, Type = #PB_ID_Window)
EndDeclareModule
Module Get_PB_Object
EnableExplicit
Procedure PB_ID(OS_Handle, Type = #PB_ID_Window)
Protected ID, Objects, Result = -1
Select Type
Case #PB_ID_Gadget :Objects = PB_Gadget_Objects
Case #PB_ID_Image :Objects = PB_Image_Objects
Case #PB_ID_Window :Objects = PB_Window_Objects
EndSelect
PB_Object_EnumerateStart(Objects)
While PB_Object_EnumerateNext(Objects, @ID)
Select Type
Case #PB_ID_Window :If OS_Handle = WindowID(ID) Or (IsWindow(OS_Handle) And OS_Handle = ID) :Result = ID :PB_Object_EnumerateAbort(Objects) :Break :EndIf
Case #PB_ID_Gadget :If OS_Handle = GadgetID(ID) Or (IsGadget(OS_Handle) And OS_Handle = ID) :Result = ID :PB_Object_EnumerateAbort(Objects) :Break :EndIf
Case #PB_ID_Image :If OS_Handle = ImageID(ID) Or (IsImage(OS_Handle) And OS_Handle = ID) :Result = ID :PB_Object_EnumerateAbort(Objects) :Break :EndIf
EndSelect
Wend
ProcedureReturn Result
EndProcedure
EndModule
Macro Window(hWnd)
Get_PB_Object::PB_ID(hWnd)
EndMacro
Macro Gadget(hWnd)
Get_PB_Object::PB_ID(hWnd, Get_PB_Object::#PB_ID_Gadget)
EndMacro
Macro Image(hWnd)
Get_PB_Object::PB_ID(hWnd, Get_PB_Object::#PB_ID_Image)
EndMacro
Procedure Is_Window(Window)
ProcedureReturn IsWindow(Get_PB_Object::PB_ID(Window))
EndProcedure
Macro IsWindow(Window)
Is_Window(Window)
EndMacro
Procedure Is_Gadget(Gadget)
ProcedureReturn IsGadget(Get_PB_Object::PB_ID(Gadget, Get_PB_Object::#PB_ID_Gadget))
EndProcedure
Macro IsGadget(Gadget)
Is_Gadget(Gadget)
EndMacro
Procedure Is_Image(Image)
ProcedureReturn IsImage(Get_PB_Object::PB_ID(Image, Get_PB_Object::#PB_ID_Image))
EndProcedure
Macro IsImage(Image)
Is_Image(Image)
EndMacro
LoadImage(10, #PB_Compiler_Home + "Examples/Sources/Data/GeeBee2.bmp")
OpenWindow(10, 100, 100, 500, 300, "testwindow")
ButtonGadget(10, 10, 10, 100, 20 , "test")
img=10
gad=10
win=10
Debug "Window = " + Str(Window(WindowID(win)))
Debug "Gadget = " + Str(Gadget(GadgetID(gad)))
Debug "Image = " + Str(Image(ImageID(img)))
Debug IsWindow(win)
Debug IsWindow(WindowID(win))
Debug IsGadget(gad)
Debug IsGadget(GadgetID(gad))
Debug IsImage(img)
Debug IsImage(ImageID(img))
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow