It is currently Tue Sep 29, 2020 9:07 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: [Done] PB 5.50 / 5.51 TreeGadget with SetGadgetFont()
PostPosted: Mon Jan 02, 2017 6:27 pm 
Offline
Enthusiast
Enthusiast

Joined: Mon Dec 08, 2003 7:50 pm
Posts: 154
Location: Germany
Hi,

when using the TreeGadget with icons and a custom set font / font size I observed a small bug: the text is not correctly centered vertically with regard to the row height anymore. It's not a big thing, but it looks somehow ... ugly (see picture: left shows what PB produces, right how it should look like). (PB 5.51 x64 on macOS Sierra 10.12)


Here is a small example code:

Code:
EnableExplicit

Define WindowEvent.q

LoadFont(0, "Verdana", 12)

If OpenWindow(0, 0, 0, 200, 500, "TreeGadget", #PB_Window_ScreenCentered)
  TreeGadget(0, 10, 10, WindowWidth(0) - 20, WindowHeight(0) - 20)
    SetGadgetFont(0, FontID(0))
 
  CreateImage(0, 16, 16)

  If StartDrawing(ImageOutput(0))
    Box(0, 0, OutputWidth(), OutputHeight(), $CC3299)
    StopDrawing()
  EndIf

  CreateImage(1, 16, 16)

  If StartDrawing(ImageOutput(1))
    Box(0, 0, OutputWidth(), OutputHeight(), $7A96E9)
    StopDrawing()
  EndIf
 
  AddGadgetItem(0, -1, "Item", ImageID(0))
  AddGadgetItem(0, -1, "Subitem", ImageID(1), 1)
  SetGadgetItemState(0, 0, #PB_Tree_Expanded)

  Repeat
    WindowEvent = WaitWindowEvent()

    Select WindowEvent
    EndSelect
  Until WindowEvent = #PB_Event_CloseWindow
EndIf


Thanks and best regards,
Christian


Top
 Profile  
Reply with quote  
 Post subject: Re: [PB 5.50 / 5.51] TreeGadget with SetGadgetFont()
PostPosted: Thu Feb 13, 2020 7:39 am 
Offline
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 14090
Location: France
Fixed.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye