Page 1 of 2
[Done] Persistent entry and bold text
Posted: Sat Jan 12, 2013 11:40 am
by Little John
Hi,
after clicking in the main menu at "Form" > "New Form", it looks like this (PB 5.10 Beta 3 on Windows XP x86):
The "<New Form>" tab contains a window, and the "Objects" tab contains the corresponding entry "Window_0". OK.

But after closing the "<New Form>" tab, the "Objects" tab still contains the entry "Window_0". Shouldn't that entry disappear then?
Another question: Is it possible to change the font of the entries in the lower right corner, so that it is not
bold? Sorry, but for me personally that doesn't look well.
The good thing is, it somewhat reminds me of Win 3.x, which makes me feel 20 years younger.
Regards, Little John
Re: Persistent entry and bold text
Posted: Sat Jan 12, 2013 1:10 pm
by Polo
It's not supposed to be bold, it seems there's issue with drawing text on the canvas on Windows XP, at least with some drawing mode (or I might be doing something wrong!), I'll try to grap a copy of XP and do some tests, thanks for letting me know!
About the Object list you're correct I'll try to fix that

Re: Persistent entry and bold text
Posted: Sat Jan 12, 2013 1:58 pm
by Little John
Thanks!
Re: Persistent entry and bold text
Posted: Sat Jan 12, 2013 2:11 pm
by IdeasVacuum
5.00 Beta 3, the text is not bold on XP, so something slightly changed between then and now.
Re: Persistent entry and bold text
Posted: Sat Jan 12, 2013 2:43 pm
by Polo
Object list is now cleaned when switching to different source or when closing form.
Re: Persistent entry and bold text
Posted: Fri Jan 18, 2013 5:25 pm
by Little John
Hi!
(With 5.10 Beta 4, Text is still bold (on Windows XP).)
I forgot to mention the following:
If something is clipped off at the right side (like the bold text in the above picture), there should be a horizontal scroll bar. Otherwise it's hard to use.
Regards, Little John
Re: Persistent entry and bold text
Posted: Sat Jan 19, 2013 2:33 pm
by Polo
This is unlikely to get changed, it's best to resize the panel. If i remember correctly it's the same in Visual Studio.
Re: Persistent entry and bold text
Posted: Sat Jan 19, 2013 2:57 pm
by Polo
Little John, can you try to reproduce this "bold font" problem with the canvas gadget? ie. by showing a specific code that will have the drawing font wrong on your system? Would help a lot

Re: Persistent entry and bold text
Posted: Sat Jan 19, 2013 9:33 pm
by Danilo
Polo wrote:This is unlikely to get changed, it's best to resize the panel.
Is it possible to put it into a ScrollAreaGadget?
Re: Persistent entry and bold text
Posted: Sat Jan 19, 2013 10:08 pm
by Polo
I need to think of the best way to handle that

Re: Persistent entry and bold text
Posted: Sat Jan 19, 2013 11:47 pm
by Little John
Polo wrote:This is unlikely to get changed, it's best to resize the panel. If i remember correctly it's the same in Visual Studio.
I don't know Visual Studio. However, e.g. many editors have a tools panel at the (right) side, and most of the ones that I had learned to know show a scrollbar when the tools panel gets too small. So the user can decide her/himself what s/he wants to do in a given situation, depending on the screen size, the current DPI settings and window size, the content of the edit area ...
Even the PB IDE already has this functionality built in, try it with "Explorer" and "Templates" on the tools panel.
Polo wrote:Little John, can you try to reproduce this "bold font" problem with the canvas gadget? ie. by showing a specific code that will have the drawing font wrong on your system? Would help a lot

Unfortunately, I don't have any experience with the canvas gadget. In particular, I don't know when a font is drawn as expected, and when it's drawn wrong. However, I've slightly changed the CanvasGadget example from the help, and here is my code and the output that it produces on my system (PB 5.10 Beta 4 on Windows XP SP3 x86). I hope it helps.
Code: Select all
If OpenWindow(0, 0, 0, 150, 150, "CanvasGadget") = 0
MessageRequester("Error", "Can't open window.")
End
EndIf
CanvasGadget(0, 10, 10, 130, 130)
;----------------------------------------
If StartDrawing(CanvasOutput(0))
DrawText(10, 10, "Hello", 0, $FFFFFF)
StopDrawing()
EndIf
;----------------------------------------
If LoadFont(1, "Arial", 10) = 0
MessageRequester("Error", "Can't load font 1.")
EndIf
If StartDrawing(CanvasOutput(0))
DrawingFont(FontID(1))
DrawText(10, 30, "Hello", 0, $FFFFFF)
StopDrawing()
EndIf
;----------------------------------------
If LoadFont(2, "Arial", 10, #PB_Font_Bold) = 0
MessageRequester("Error", "Can't load font 2.")
EndIf
If StartDrawing(CanvasOutput(0))
DrawingFont(FontID(2))
DrawText(10, 50, "Hello", 0, $FFFFFF)
StopDrawing()
EndIf
;----------------------------------------
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow

Re: Persistent entry and bold text
Posted: Sun Jan 20, 2013 12:21 am
by Polo
I think I know what the problem is, I use Segoe UI as the default font on Windows (Lucida Grande on other OSes), which I think Microsoft introduced with Vista (and is probably shipped with MS Office as well).
Can you check if you've got that font?
Re: Persistent entry and bold text
Posted: Sun Jan 20, 2013 1:39 am
by Little John
Polo wrote:I think I know what the problem is, I use Segoe UI as the default font on Windows (Lucida Grande on other OSes), which I think Microsoft introduced with Vista (and is probably shipped with MS Office as well).
Can you check if you've got that font?
Yes, that might be the cause of the problem. When I replace in my above code "Arial" with "Segoe UI", then all three lines are bold. You should not rely on the assumption, that everyone who uses the PB IDE (on Windows) has "Segoe UI" installed. As you wrote, it was introduced as the default dialog font with Vista.
At least for Windows, it would probably be the best not to use any fixed font at all, but to dynamically determine the dialog font of the current system, and then use
that font:
Code: Select all
; Platform: WINDOWS
EnableExplicit
Structure FontInfo
name.s
size.l
style.l
EndStructure
Procedure.i DialogFontInfo (*fi.FontInfo)
; -- Determine the dialog font of the system
; - Windows 95, 98 : MS Shell Dlg (= Microsoft Sans Serif) 8 pt
; - Windows 2000, XP: Tahoma 8 pt
; - Windows Vista, 7: Segoe UI 9 pt
Protected ncm.NONCLIENTMETRICS
Protected hDC.i
ncm\cbSize = SizeOf(ncm)
If SystemParametersInfo_(#SPI_GETNONCLIENTMETRICS, ncm\cbSize, @ncm, 0)
*fi\name = PeekS(@ncm\lfMessageFont\lfFaceName)
hDC = GetDC_(#Null)
If hDC
*fi\size = -MulDiv_(ncm\lfMessageFont\lfHeight, 72, GetDeviceCaps_(hDC, #LOGPIXELSY))
If ncm\lfMessageFont\lfWeight = 700
*fi\style = #PB_Font_Bold
EndIf
If ncm\lfMessageFont\lfItalic
*fi\style + #PB_Font_Italic
EndIf
ReleaseDC_(#Null, hDC)
ProcedureReturn 1 ; success
EndIf
EndIf
ProcedureReturn 0 ; error
EndProcedure
Define DlgFont.FontInfo
If DialogFontInfo(@DlgFont)
With DlgFont
Debug \name
Debug \size
Debug \style
EndWith
EndIf
Well, here are some people on the forum who know much more about fonts than me ... Maybe someone has additional or better suggestions.
Regards, Little John
Re: Persistent entry and bold text
Posted: Sun Jan 20, 2013 1:57 am
by ts-soft
Please don't use it
This make a very big font on my 64-Bit System
Change the structure to:
Code: Select all
Structure FontInfo
name.s
size.l
style.l
EndStructure
Greetings - Thomas
Re: Persistent entry and bold text
Posted: Sun Jan 20, 2013 2:06 am
by Little John
ts-soft wrote:This make a very big font on my 64-Bit System
Corrected in the above message.
Thank you!