🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.os.os2.programmer
1 messages
1 total messages Started by Barry King Sat, 05 Jan 1991 09:18
Fixed Fonts in List Boxes???
#2356
Author: Barry King
Date: Sat, 05 Jan 1991 09:18
133 lines
4014 bytes
I am writing an application in which I require a fixed font in a listbox. 


 Thinking that this _should_ be fairly straightforward, I basically set   


out the following scheme:                                                 


                                                                          


  In response to WM_MEASUREITEM                                           


      if it's for my listbox                                              


          retrieve hps                                                    


          GpiQueryFonts for a fixed font                                  


          store font metrics in a global FATTR structure for later use    


          GpiCreateLogFont                                                


          GpiSetCharSet                                                   


          return height of listbox item from new font                     


          release the hps                                                 


                                                                          


This works and the effects show up in my listbox.                         


                                                                          


  In response to the WM_DRAWITEM message I do the following:              


      if it's my listbox                                                  


          get a pointer to the item to be drawn from mp2                  


          GpiCreateLogFont from my global FATTR structure                 


          GpiSetCharSet from the same structure                           


                                                                          


This doesn't appear to work... The functions return no errors but I do    


not get my fixed font (Courier, in this case) in the listbox although the 


spacing of the proportional system font is changed to reflect the new     


font metrics...???                                                        


                                                                          


I know the above is very general but what kinds of things should I be     


looking for?  I am using calls to WinSendMsg to insert items into the     


listbox.  I use WinWindowFromID to get a hwnd to my listbox and use that  


in my calls...no errors are returned from WinSendMsg.                     


                                                                          


After checking around for some source that does something similar, I came 


across a file finder that uses virtually the same technique.  My code     


(appears) functionaly identical to the file finder code with the distinct 


difference being that mine doesn't work properly...                       


                                                                          


I find it odd that the listbox item height changed correctly  and that    


the formatting of the listbox items appears as though it might if it were 


in a fixed font even though it is actually displayed in the system        


proportional font.                                                        


                                                                          


Ideas anyone?                                                             


                                                                          


Thanks.                                                                   
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads