It is currently Sun Aug 18, 2019 4:20 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: [PB5.70] SetGadgetFont triggers EventType() in EditorGadget
PostPosted: Wed Jun 19, 2019 5:10 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Mar 10, 2013 3:01 pm
Posts: 629
Location: Portugal
Hello!

I believe I have found a bug, but this time, instead of reporting it as a bug I am posting in this forum first so that everyone can check:
Code:
Enumeration
  #WINDOW
  #EDITORGADGET
EndEnumeration

OpenWindow(#WINDOW,0,0,640,480,"Test")

t=LoadFont(1,"Arial",10,#PB_Font_HighQuality)
If t=#False : MessageRequester("Error", "Can't load Arial font.",#PB_MessageRequester_Error) : EndIf
SetGadgetFont(#PB_Default,FontID(1))

EditorGadget(#EDITORGADGET,10,10,600,400)


t=LoadFont(1000,"Arial",20,#PB_Font_HighQuality)
If t=#False : MessageRequester("Error", "Can't load Arial font.",#PB_MessageRequester_Error) : EndIf
SetGadgetFont(#EDITORGADGET,FontID(1000))

quit=#False
Repeat
 
    event=WaitWindowEvent()
    event_menu=EventMenu()
    event_gadget=EventGadget()
    event_type=EventType()
   
    If event_gadget=#EDITORGADGET And event_type=#PB_EventType_Change
      Debug "EditorGadget changed!"
    EndIf
   
    If event=#PB_Event_CloseWindow
      quit=#True
    EndIf
   
Until quit=#True
 
 
 



The:
Code:
SetGadgetFont(#EDITORGADGET,FontID(1000))

Triggers an event saying that the EditorGadget has been changed, which is not true as I only changed its font.

Could someone verify if it is a bug?

I tested it with PureBasic 5.70 x64.

Thank you!


Top
 Profile  
Reply with quote  
 Post subject: Re: [PB5.70] SetGadgetFont triggers EventType() in EditorGad
PostPosted: Wed Jun 19, 2019 8:22 pm 
Offline
Enthusiast
Enthusiast

Joined: Fri Jun 01, 2012 12:20 am
Posts: 140
I think it's not a Bug. One could wish do something when font changes.

Microsoft states:

EN_UPDATE notification code Sent when an edit control is about to redraw itself. This notification code is sent after the control has formatted the text, but before it displays the text. This makes it possible to resize the edit control window, if necessary.


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 17 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