[Implemented] Debug Output...

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
RichardL
Enthusiast
Enthusiast
Posts: 532
Joined: Sat Sep 11, 2004 11:54 am
Location: UK

[Implemented] Debug Output...

Post by RichardL »

Maybe I’ve missed a buried option switch somewhere… but it would be so much more convenient if the Debug Output window could be switched to use a non-proportional font. Tabular data would be much clearer and easier to understand.

Opinions anyone?
MaxNorris
New User
New User
Posts: 4
Joined: Fri Aug 11, 2006 1:21 am
Location: Columbus, Ohio
Contact:

Post by MaxNorris »

I've only been messing with PB for a couple days, the demo version at that, but that does make sense.. just throw an option somewhere in the debugger preferences to set a font.. or at least say switch between something like Arial and Terminal. You can use Chr(9) to embed tabs, but it wont show correctly in the debug window, but if the debug data is saved and opened in notepad it'll show correctly.. a fixed font would make it a lot simpler.
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Post by Trond »

I thought about the same a few days ago. In the process I tried out the option to change font for the tools. Unfortunately it didn't work for the debug window and there was no way to revert to the default font.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

Agreed, it would be a good feature. In the meantime, if you want the functionality you can stick this at the top of your source during development and remove it when finished:

Code: Select all

ProcedureDLL SetDebugFont() 
  debugwin = 0 
  t=ElapsedMilliseconds() 
  While Not debugwin 
    debugwin = GetWindow_(FindWindow_(0,"Debug Output - "),#GW_CHILD) 
    Delay(1) 
    If ElapsedMilliseconds()-t > 500 
      Break 
    EndIf 
  Wend 
  If debugwin 
    SendMessage_(debugwin, #WM_SETFONT, GetStockObject_(#SYSTEM_FIXED_FONT), 1) 
  EndIf 
EndProcedure 

Macro Debugg(value) 
  Debug "" 
  SetDebugFont() 
  Debug value 
EndMacro 

;usage: Debugg( <value> )
Last edited by netmaestro on Wed Dec 06, 2006 9:51 am, edited 2 times in total.
BERESHEIT
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

Hm - it doesn't seem to work. It changes the font but not to what you specify. Gotta look a bit deeper into this..

[edit] Fixed. The posted source is updated and works now.

Code: Select all

 Debug ( "EEEEEE "+"      "+Str(100) )
 Debug ( "iiiiii "+"      "+Str(22) )
 
 Delay(1000)

 Debugg( "EEEEEE "+"      "+Str(100) )
 Debugg( "iiiiii "+"      "+Str(22) )
Additionally, I don't see a downside to the team applying the LBS_USETABSTOPS style to the debug window listbox - is there one? If not, I'd like to see it implemented too.
BERESHEIT
RichardL
Enthusiast
Enthusiast
Posts: 532
Joined: Sat Sep 11, 2004 11:54 am
Location: UK

Post by RichardL »

LBS_USETABSTOPS ?? Yes, that would get my vote as well.

Long strings of HEX values origination from a HEX Dump function I use for debugging are fairly 'solid' and list badly in the debugger at present.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

@netmaestro: Nice tip, but how would we modify it so we can use the font of
our choice, instead of using #SYSTEM_FIXED_FONT? I've tried with loading a
font and using its load return value, but it doesn't work. :(
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
netmaestro
PureBasic Bullfrog
PureBasic Bullfrog
Posts: 8451
Joined: Wed Jul 06, 2005 5:42 am
Location: Fort Nelson, BC, Canada

Post by netmaestro »

Hi PB! -argg I don't know. I started by putting in Courier New, and I saw the font changing and that made me think it was working, but the font it was sticking in there wasn't what I chose. Further experiments showed that the stock fixed font would go in so I just did that. I was also rebuffed in my attempt to apply the LBS_USETABSTOPS style, as MSDN says it can't be changed after the control is created. Any progress someone can make on these fronts, a post would be really welcome.
BERESHEIT
harff182
Enthusiast
Enthusiast
Posts: 105
Joined: Thu Dec 08, 2005 4:58 pm
Location: Duesseldorf, Germany

Post by harff182 »

Nice and usefull Macro :)

But I get an empty line between the debugg-lines :(
How can I avoid those empty lines ?

And your example-lines show, that it doesn't work here (XPHome,SP2 PB401)

TIA.....
scholly
Sorry 4 my poor English, it's the only one I learned 40 years ago...
since 17.12.08: XPHome(SP3) + PB 4.30
mskuma
Enthusiast
Enthusiast
Posts: 573
Joined: Sat Dec 03, 2005 1:31 am
Location: Australia

Post by mskuma »

When running a unicode program, it would be nice when copying the text from the debug output that it could be copied in unicode also.
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

mskuma wrote:When running a unicode program, it would be nice when copying the text from the debug output that it could be copied in unicode also.
Use the standalone debugger option. It has full unicode support. The IDE itself has not.
quidquid Latine dictum sit altum videtur
User avatar
skywalk
Addict
Addict
Posts: 4211
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: Debug Output...

Post by skywalk »

Hi,
This topic is old, but I think it would be great for new users like me if the Debug Output Window default font was fixed pitch like courier new or something similar.
I only recently figured out the font was editable.
This makes the debug window so much more readable!!
I feel like I have been wearing someone else's prescription glasses for months! :shock:

Thanks for a great tool.
Last edited by skywalk on Tue Jul 08, 2014 12:28 am, edited 1 time in total.
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Debug Output...

Post by IdeasVacuum »

....and also respect #CRLF$
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Re: Debug Output...

Post by blueznl »

Yeah, just a toggle to go for a fixed font would be great! I know Fred hates this, but...

+2399283749237

:-)
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: Debug Output...

Post by Trond »

blueznl wrote:Yeah, just a toggle to go for a fixed font would be great! I know Fred hates this, but...

+2399283749237

:-)
What do you mean? You can set a fixed width font now. It's just off by default.
Post Reply