PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Marc van Cauwenberghe on April 10, 2011, 12:32:31 PM

Title: Powerbasic include files
Post by: Marc van Cauwenberghe on April 10, 2011, 12:32:31 PM
Hello,
starting to convert a few programs this weekend.
Am I correct in thinking that azt this moment powerbasic includes do not work and that you should use Jose's includes?

Marc
Title: Re: Powerbasic include files
Post by: Paul Squires on April 10, 2011, 06:08:54 PM
If you are converting programs then maybe you should start using Jose's includes. I fully intend to *only* support Jose's includes in FF4.

Title: Re: Powerbasic include files
Post by: José Roca on April 10, 2011, 09:26:47 PM
Thanks to dead code removal, now I can develop helper classes that I had in mind. Today I have written a class for image lists that makes it very easy to create them, e.g.

' ========================================================================================
' Create the toolbar control image list
' ========================================================================================
FUNCTION CreateToolbarImageList () AS IAfxImageList

   ' // Create the image list
   LOCAL pAfxImageList AS IAfxImageList
   pAfxImageList  = NewAfxImageList(16, 16, %ILC_COLOR32 OR %ILC_MASK, 14)
   IF ISNOTHING(pAfxImageList) THEN EXIT FUNCTION

   ' // Give a name to the image list
   pAfxImageList.Name = "Toolbar image list"

   ' // Add the icons from the resource file
   pAfxImageList.LoadResIcon(%IDI_BACK)
   pAfxImageList.LoadResIcon(%IDI_FORWARD)
   pAfxImageList.LoadResIcon(%IDI_NEW)
   pAfxImageList.LoadResIcon(%IDI_FIND)
   pAfxImageList.LoadResIcon(%IDI_PRINTPREV)
   pAfxImageList.LoadResIcon(%IDI_PAGESETUP)
   pAfxImageList.LoadResIcon(%IDI_PRINT)
   pAfxImageList.LoadResIcon(%IDI_PROPERTIES)
   pAfxImageList.LoadResIcon(%IDI_SAVE)
   pAfxImageList.LoadResIcon(%IDI_REFRESH)
   pAfxImageList.LoadResIcon(%IDI_STOP)
   pAfxImageList.LoadResIcon(%IDI_ZOOMIN)
   pAfxImageList.LoadResIcon(%IDI_ZOOMOUT)
   pAfxImageList.LoadResIcon(%IDI_EXIT)

   FUNCTION = pAfxImageList

END FUNCTION
' ========================================================================================


I have in mind to avoid to have to use globals to keep the object references alive storing them into a collection in the CWindow class, but I will have to delay it because I have found an "issue" in the compiler.

I will start to work in a Toolbar class. Toolbars are a pain to create manually.
Title: Re: Powerbasic include files
Post by: Marc van Cauwenberghe on April 11, 2011, 06:26:20 AM
Ok,

From now on only Jose's includes. Most project were those in fact.

Thanks,
Marc