It is currently Sun Sep 24, 2017 2:45 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: [Done] AddGadgetItem forget the defined font -PB560
PostPosted: Wed May 17, 2017 10:54 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Mar 02, 2013 9:17 am
Posts: 592
AddGadgetItem forget the defined font
Code:
LoadFont(1, "Arial", 19, #PB_Font_Bold)
window_ID=OpenWindow(#PB_Any, #PB_Ignore, #PB_Ignore, 320, 320, "",
                     #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
EditorGadget(1, 10, 10, 300, 300)
SetGadgetFont(1, FontID(1))
SetGadgetText(1, "Test Text")
AddGadgetItem(1, -1, "And forget")
While WaitWindowEvent()<>#PB_Event_CloseWindow : Wend

_________________
http://www.nachtoptik.de
BucketFill advanced -GFX FOR IMAGES & CANVAS: http://www.purebasic.fr/english/viewtopic.php?f=12&t=66927
QUICK-AES-256 -SUITE & DLL/SO & RSA: http://www.purebasic.fr/english/viewtopic.php?f=27&t=60507


Top
 Profile  
Reply with quote  
 Post subject: Re: AddGadgetItem forget the defined font -PB560
PostPosted: Wed May 17, 2017 11:39 pm 
Offline
Always Here
Always Here

Joined: Fri Oct 23, 2009 2:33 am
Posts: 5664
Location: Wales, UK
...strange, works fine here. PB5.60 x86 Win7 x86

_________________
IdeasVacuum
If it sounds simple, you have not grasped the complexity.


Top
 Profile  
Reply with quote  
 Post subject: Re: AddGadgetItem forget the defined font -PB560
PostPosted: Wed May 17, 2017 11:48 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Mar 02, 2013 9:17 am
Posts: 592
Yep, it fails only on Mac
Tested with OS 10.12

_________________
http://www.nachtoptik.de
BucketFill advanced -GFX FOR IMAGES & CANVAS: http://www.purebasic.fr/english/viewtopic.php?f=12&t=66927
QUICK-AES-256 -SUITE & DLL/SO & RSA: http://www.purebasic.fr/english/viewtopic.php?f=27&t=60507


Top
 Profile  
Reply with quote  
 Post subject: Re: AddGadgetItem forget the defined font -PB560
PostPosted: Thu May 18, 2017 4:30 am 
Offline
Addict
Addict

Joined: Mon Aug 04, 2008 10:56 pm
Posts: 1100
Location: Seattle, USA
Yep, it doesn't work for me either.

The 'Test Text' is large/bold and the 'And forget' is small regular font.

I think I reported font problems in the EditorGadget more than once in the past.

_________________
MacBook Pro-r, OSX 10.11.6, Command Line Tools 7.3 (10.11), PB-5.60x64


Top
 Profile  
Reply with quote  
 Post subject: Re: AddGadgetItem forget the defined font -PB560
PostPosted: Thu May 18, 2017 8:15 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Apr 21, 2005 2:38 pm
Posts: 1440
Location: Germany
It seems that -1 (end of list) as the second parameter of AddGadgetItem() is the culprit. If you change -1 to a valid line index (1 in the AddGadgetItem() command) the second line "And forget" will be displayed correctly.


Top
 Profile  
Reply with quote  
 Post subject: Re: AddGadgetItem forget the defined font -PB560
PostPosted: Thu May 18, 2017 9:11 pm 
Offline
Addict
Addict

Joined: Mon Aug 04, 2008 10:56 pm
Posts: 1100
Location: Seattle, USA
That's interesting Shardik!

That would be an easy work-around till it's fixed.

_________________
MacBook Pro-r, OSX 10.11.6, Command Line Tools 7.3 (10.11), PB-5.60x64


Top
 Profile  
Reply with quote  
 Post subject: Re: AddGadgetItem forget the defined font -PB560
PostPosted: Thu May 18, 2017 9:28 pm 
Offline
Addict
Addict
User avatar

Joined: Fri May 12, 2006 6:51 pm
Posts: 969
Location: Germany
Work around...

Update
Code:
Procedure MyAddGadgetItem(Gadget, Position, Text.s, Image=0, Flags=0)
  Protected font
  AddGadgetItem(Gadget, Position, Text, Image, Flags)
  If GadgetType(Gadget) = #PB_GadgetType_Editor
    font = GetGadgetFont(Gadget)
    If font
      SetGadgetFont(Gadget, font)
    EndIf
  EndIf
EndProcedure

Macro AddGadgetItem(Gadget, Position, Text, Image=0, Flags=0)
  MyAddGadgetItem(Gadget, Position, Text, Image, Flags)
EndMacro

LoadFont(1, "Arial", 19, #PB_Font_Bold)
window_ID=OpenWindow(#PB_Any, #PB_Ignore, #PB_Ignore, 320, 320, "",
                     #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
EditorGadget(1, 10, 10, 300, 300)
SetGadgetFont(1, FontID(1))
SetGadgetText(1, "Test Text")
AddGadgetItem(1, -1, "And forget")
AddGadgetItem(1, -1, "And restore")

While WaitWindowEvent()<>#PB_Event_CloseWindow : Wend

_________________
My Projects OOP-BaseClass / OOP-BaseClassDispatch / Event-Designer /
PB v3.30 / v5.60 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace


Top
 Profile  
Reply with quote  
 Post subject: Re: AddGadgetItem forget the defined font -PB560
PostPosted: Fri May 19, 2017 7:42 am 
Offline
Enthusiast
Enthusiast

Joined: Sat Mar 02, 2013 9:17 am
Posts: 592
@mk-soft
This is a fine Workaround !

_________________
http://www.nachtoptik.de
BucketFill advanced -GFX FOR IMAGES & CANVAS: http://www.purebasic.fr/english/viewtopic.php?f=12&t=66927
QUICK-AES-256 -SUITE & DLL/SO & RSA: http://www.purebasic.fr/english/viewtopic.php?f=27&t=60507


Top
 Profile  
Reply with quote  
 Post subject: Re: AddGadgetItem forget the defined font -PB560
PostPosted: Sun May 28, 2017 9:09 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Apr 21, 2005 2:38 pm
Posts: 1440
Location: Germany
walbus wrote:
AddGadgetItem forget the defined font

Danilo already reported this bug here. He also reported that the foreground color will be lost using position '-1'.


Top
 Profile  
Reply with quote  
 Post subject: Re: AddGadgetItem forget the defined font -PB560
PostPosted: Fri Jun 02, 2017 5:17 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Mar 02, 2013 9:17 am
Posts: 592
@Shardik
Thanks for this info

_________________
http://www.nachtoptik.de
BucketFill advanced -GFX FOR IMAGES & CANVAS: http://www.purebasic.fr/english/viewtopic.php?f=12&t=66927
QUICK-AES-256 -SUITE & DLL/SO & RSA: http://www.purebasic.fr/english/viewtopic.php?f=27&t=60507


Top
 Profile  
Reply with quote  
 Post subject: Re: [Done] AddGadgetItem forget the defined font -PB560
PostPosted: Wed Aug 09, 2017 3:32 pm 
Offline
Administrator
Administrator

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


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

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


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