Extending the Debug-Window

Share your advanced knowledge/code with the community.
falsam
Posts: 280
Joined: Mon May 05, 2014 9:49 pm
Location: France
Contact:

Re: Extending the Debug-Window

Post by falsam »

Thanks, Peter, but it doesn't work with this erroneous code.

Code: Select all

SetConsole(#myConsole)

! try {
!initProcess()
!var process = New PROCESS 

! } catch (err) {
!   console.error(err);
! }

➽ Windows 11 - JDK 1.8 - SB 2.40 - Android 13
http://falsam.com

Sorry for my poor english
User avatar
Peter
Posts: 1086
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080
Contact:

Re: Extending the Debug-Window

Post by Peter »

falsam wrote:

Code: Select all

!var process = New PROCESS
i don't think that you can catch uncaught SyntaxErrors. Image I have to investigate...

in the meantime you can take a look at my updated code (now there is no try-catch-block needed anymore): http://forums.spiderbasic.com/viewtopic ... 5111#p5111

Greetings ... Peter
User avatar
Peter
Posts: 1086
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080
Contact:

Re: Extending the Debug-Window

Post by Peter »

Peter wrote:i don't think that you can catch uncaught SyntaxErrors. Image I have to investigate...
in principle it seems to be possible (see this JsFiddle), but I have no idea how to implement it with SpiderBasic...

Greetings ... Peter
karu
Posts: 40
Joined: Mon Feb 24, 2014 10:16 pm

Re: Extending the Debug-Window

Post by karu »

Peter wrote:
karu wrote:Now working
i'm glad to read that it was solved.
karu wrote:Please advice, how i can put similar button also to other windows, thaks :roll:
Image

Code: Select all

Procedure AddWindowGadget(Window, Gadget)
  
  If IsWindow(Window) = 0 : ProcedureReturn : EndIf
  If IsGadget(Gadget) = 0 : ProcedureReturn : EndIf
  
  Protected WID = WindowID(Window)
  Protected GID = GadgetID(Gadget)
  
  ! $(v_gid.div).css("right", $(v_gid.div).css("left"));
  ! $(v_gid.div).css("left", "");
  
  ! $(v_gid.div).appendTo(v_wid.title);
  
EndProcedure

Enumeration
  #myWindow
  #myButton1
  #myButton2
EndEnumeration

Procedure myButton1Event()
  Debug "myButton1Event()"
EndProcedure

Procedure myButton2Event()
  Debug "myButton2Event()"
EndProcedure

OpenWindow(#myWindow, #PB_Ignore, #PB_Ignore, 300, 300, "Window", #PB_Window_ScreenCentered | #PB_Window_SystemMenu | #PB_Window_SizeGadget)

ButtonGadget(#myButton1, 64, 4, 22, 22, "!") ; Please note, that the X-Position of the button is the Right-Position in the titlebar!
GadgetToolTip(#myButton1, "This is button 1")
AddWindowGadget(#myWindow, #myButton1)
BindGadgetEvent(#myButton1, @myButton1Event())

ButtonGadget(#myButton2, 40, 4, 22, 22, "?") ; Please note, that the X-Position of the button is the Right-Position in the titlebar!
GadgetToolTip(#myButton2, "This is button 2")
AddWindowGadget(#myWindow, #myButton2)
BindGadgetEvent(#myButton2, @myButton2Event())
Greetings ... Peter
Thaks Perer, can you show how code with only one button (now beetween one button and close button empty space) and if there possible to use flat buttos (like in the beginning of the topic) with my custom image, thanks?

Karu
Post Reply