[Implemented] Clear Debug Window

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
freedimension
Enthusiast
Enthusiast
Posts: 613
Joined: Tue May 06, 2003 2:50 pm
Location: Germany
Contact:

[Implemented] Clear Debug Window

Post by freedimension »

I'm asking for a possibilty to clear the debug output window with

a) a command (like DebugClear)
b) a button within the window itself

(See 'ClearDebugOutput()')
Num3
PureBasic Expert
PureBasic Expert
Posts: 2812
Joined: Fri Apr 25, 2003 4:51 pm
Location: Portugal, Lisbon
Contact:

Post by Num3 »

Nice thinking!

I would really enjoy those commands!
Berikco
Administrator
Administrator
Posts: 1326
Joined: Wed Apr 23, 2003 7:57 pm
Location: Belgium
Contact:

Post by Berikco »

Yeah, i vote for that :)
Froggerprogger
Enthusiast
Enthusiast
Posts: 423
Joined: Fri Apr 25, 2003 5:22 pm
Contact:

Post by Froggerprogger »

And the debug-window should store it's last size. The window is so often too narrow for me... 8O
%1>>1+1*1/1-1!1|1&1<<$1=1
freedimension
Enthusiast
Enthusiast
Posts: 613
Joined: Tue May 06, 2003 2:50 pm
Location: Germany
Contact:

Post by freedimension »

Froggerprogger wrote:And the debug-window should store it's last size...
and position.
Michel_k17
User
User
Posts: 14
Joined: Sun Dec 14, 2003 4:57 am
Location: Wichita, Kansas
Contact:

Post by Michel_k17 »

...and in the background (foreground gets too much in the way),
and the Debug and Variable windows should be in one window with a splitter bar. Something like VB6.

Haaa.... I feel better!
Michel "K-17" Korwin-Szymanowski
User avatar
Danilo
Addict
Addict
Posts: 3036
Joined: Sat Apr 26, 2003 8:26 am
Location: Planet Earth

Re: Clear Debug Window

Post by Danilo »

freedimension wrote:I'm asking for a possibilty to clear the debug output window with

a) a command (like DebugClear)
Good Idea.

Fred should add it directly to the debugger, but here a
workaround because you dont know if Fred wants to add it. :D

Code: Select all

;
; by Danilo, 14.12.2003 - english forum
;
Procedure DebugClear_Callback(hWnd,Value)
  result = 1
  ClassName$ = Space(100)
  GetClassName_(hWnd,@ClassName$,100)
  If ClassName$ = "ListBox"
     Count = SendMessage_(hWnd,#LB_GETCOUNT,0,0)
     If Count > 0
       SendMessage_(hWnd,#WM_SETREDRAW,0,0)
       For a = 0 To Count - 1
         SendMessage_(hWnd,#LB_DELETESTRING,0,0)
       Next a
       SendMessage_(hWnd,#WM_SETREDRAW,1,0)
       InvalidateRect_(hWnd,0,1)
     EndIf
     result = 0
  EndIf
  ProcedureReturn result
EndProcedure

Procedure DebugClear()
  hDebug = FindWindow_(0,"PureBasic - Debug Output")
  If hDebug
    EnumChildWindows_(hDebug,@DebugClear_Callback(),0)
;  Else
;    MessageRequester("DEBUG CLEAR","Debugger Disabled!",#MB_ICONERROR)
  EndIf
EndProcedure


For a = 1 To 100
  Debug Str(a)
Next a

Delay(1000)

DebugClear()

Debug 12

Remember my old code to save debug output?
Still not added to the PB Debugger... :?

Code: Select all

Procedure SaveDebugTextCallback(hWnd,Value)
  ClassName$ = Space(100)
  GetClassName_(hWnd,@ClassName$,100)
  If ClassName$ = "ListBox"
     Count = SendMessage_(hWnd,#LB_GETCOUNT,0,0)
     If Count = 0
        MessageRequester("DEBUG SAVE","No Data in Debug Output",#MB_ICONINFORMATION)
     Else
        If OpenFile(1,PeekS(Value))
           FileSeek(Lof())
           WriteStringN(";---[ New Entry ]-------")
           GetLocalTime_(time.SYSTEMTIME)
           WriteStringN("; - Date: "+StrU(time\wDay,1)+"."+StrU(time\wMonth,1)+"."+StrU(time\wYear,1))
           WriteStringN("; - Time: "+StrU(time\wHour,1)+":"+StrU(time\wMinute,1))
            For a = 0 To Count - 1
                Length = SendMessage_(hWnd,#LB_GETTEXTLEN,a,0)
                Text$   = Space(Length)
                SendMessage_(hWnd,#LB_GETTEXT,a,@Text$)
                WriteStringN("  | "+Text$)
            Next a
           WriteStringN(";---[ End Entry ]-------")
           WriteStringN("")
           CloseFile(1)
           MessageRequester("DEBUG SAVE","Saved Debugger Output to:"+Chr(13)+PeekS(Value),#MB_ICONINFORMATION)
        Else
           MessageRequester("DEBUG SAVE","Couldnt save Debug Output",#MB_ICONERROR)
        EndIf
     EndIf
  EndIf
ProcedureReturn 1
EndProcedure
 
 
Procedure SaveDebugOutput(File$)
hDebug = FindWindow_(0,"PureBasic - Debug Output")
If hDebug
   EnumChildWindows_(hDebug,@SaveDebugTextCallback(),@File$)
Else
   MessageRequester("DEBUG SAVE","Debugger Disabled!",#MB_ICONERROR)
EndIf
EndProcedure


; Code Start
 
SaveDebugOutput("c:\PB_DEBUG.TXT")
Debug "TEST"
Debug Str(12)+" PureBasic Debug"
Debug "testing..."
Debug 123456
SaveDebugOutput("c:\PB_DEBUG.TXT")
Its the same with remembering the position and size of all
debug windows. Users requested this long long time ago,
but somebody doesnt seem to care about it...
cya,
...Danilo
...:-=< http://codedan.net/work >=-:...
-= FaceBook.com/DaniloKrahn =-
User avatar
Rings
Moderator
Moderator
Posts: 1435
Joined: Sat Apr 26, 2003 1:11 am

Re: Clear Debug Window

Post by Rings »

Danilo wrote:....but somebody doesnt seem to care about it...
i cannot remember the meaning of lazyness.........
SPAMINATOR NR.1
Berikco
Administrator
Administrator
Posts: 1326
Joined: Wed Apr 23, 2003 7:57 pm
Location: Belgium
Contact:

Re: Clear Debug Window

Post by Berikco »

Rings wrote:
Danilo wrote:....but somebody doesnt seem to care about it...
i cannot remember the meaning of lazyness.........
yes, me also can't remember what lazy means....mmmm
Fred
Administrator
Administrator
Posts: 18162
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Post by Fred »

same for me... strange.
Post Reply