PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Mark Strickland on June 07, 2005, 07:00:48 PM

Title: WinLIFT and Tabs and 'Gator tooth marks
Post by: Mark Strickland on June 07, 2005, 07:00:48 PM
WinLIFT question ---

OK --- It is probably out there somewhere but wading through the Windows "Swamp" is not easy --- lots of 'gators.  I am getting better at the Windows SDK stuff but some things are just not obvious or have WAY too many trial and error options to test.

I have build a tabbed app and that works OK with the child forms.  When I add WinLIFT to the main form "almost" everything works OK --- EXCEPT the background of the tab forms displays as the Windows default color (no skin).  Oddly the buttons and other controls seem to take on the WinLIFT properties.

Any thoughts?

Thanks, Mark
Title: WinLIFT and Tabs and 'Gator tooth marks
Post by: TechSupport on June 11, 2005, 11:13:43 AM
I am not 100% sure of the problem but I have logged the problem and I will check into it. Could be a FireFly-WinLift integration problem because both programs use a fair amount of subclassing and ownerdrawn techniques.
Title: Re: WinLIFT and Tabs and 'Gator tooth marks
Post by: TechSupport on June 16, 2005, 08:58:30 PM
Quote from: Mark StricklandI have build a tabbed app and that works OK with the child forms.  When I add WinLIFT to the main form "almost" everything works OK --- EXCEPT the background of the tab forms displays as the Windows default color (no skin).  Oddly the buttons and other controls seem to take on the WinLIFT properties.
Hi Mark,

I see the problem that you have reported. I have tried a couple of approaches to fix it, but no luck yet. I have another approach that I'll try out tomorrow.... strange problem.  :?
Title: WinLIFT and Tabs and 'Gator tooth marks
Post by: Marty Francom on June 21, 2005, 06:12:29 PM
Paul,
  Any success with this problem?  I would like to be able to use WinLift but the program uses the Tab Control.
...Marty
Title: WinLIFT and Tabs and 'Gator tooth marks
Post by: TechSupport on June 21, 2005, 07:40:57 PM
Hi Marty,

No luck yet. Sorry. :(
Title: WinLIFT and Tabs and 'Gator tooth marks
Post by: Patrice Terrier on July 05, 2005, 12:06:39 PM
Because TAB controls in FF use separate forms the WSA skSkinWindow must be used with each of these forms.
Or at least after all the child controls have been created, see the DDT TAB.BAS example that is provided together with WinLIFT.

The WSA uses the EnumChildWindows API in order to subclass child controls on the fly (if you have the WSA version with the skSdkApi.bas source code, look at the EnumChildproc function)

I am unable to test FF myself because it doesn't work on my Windows 98 computer.
However if you can send me a complete FF demo with the resulting PB source code, I can have a look on it and see the right place where to put the skSkinWindow.
Title: WinLIFT and Tabs and 'Gator tooth marks
Post by: Patrice Terrier on July 07, 2005, 08:41:24 AM
Ok, here is the solution.

Because FF uses a specific class to handle the TAB control, you must paint yourself the background using this.

In the F2TAB1_FORMPROCEDURE add the code below in bold

Function F2TAB1_FORMPROCEDURE (ByVal hWndForm As Dword, ByVal wMsg As Dword, _
                  ByVal wParam As Dword, ByVal lParam As Long) As Long
 
   'The following CASE calls each user defined function (event)
   Select Case wMsg
[b]
   CASE %WM_ERASEBKGND ' <<<< Patrice'
        LOCAL rc AS RECT, Xin AS LONG, Yin AS LONG, ofX AS LONG, ofY AS LONG
        CALL GetClientRect(hWndForm, rc): Xin = rc.nRight: Yin = rc.nBottom
        CALL skChildoffset(hWndForm, ofX, ofY)
        CALL skTileBlt(wParam, -ofX, -ofY, ofX + Xin&, ofY + Yin, skCtlBack)
        FUNCTION = 1: EXIT FUNCTION
[/b]
Title: WinLIFT and Tabs and 'Gator tooth marks
Post by: TechSupport on July 07, 2005, 09:04:44 AM
Thanks Patrice ! I was banging my head against the wall trying to fix this problem.

:)
Title: Thanks and just to make sure
Post by: Mark Strickland on July 07, 2005, 01:28:54 PM
Paul,

I assume that in the "final release" of my code I will just have to "hand edit" one of the files that FireFly outputs per Patrice's suggestion.  I don't see this function in the standard list of FF functions when looking at the code editor.

If there is a "trick" to put this code in the FF code editor that would be much better.  Does the CUSTOM section for that control put the code in the "right place"?

Can you confirm the best process to handle this modification to make this work?

Thanks to both Patrice and to you Paul.
Title: WinLIFT and Tabs and 'Gator tooth marks
Post by: TechSupport on July 07, 2005, 03:50:46 PM
Hi Matt,

You can put this code directly in the FireFly code editor under the Form's CUSTOM message handler.


 'The following CASE calls each user defined function (event)
   Select Case wMsg

   CASE %WM_ERASEBKGND ' <<<< Patrice'
        LOCAL rc AS RECT, Xin AS LONG, Yin AS LONG, ofX AS LONG, ofY AS LONG
        CALL GetClientRect(hWndForm, rc): Xin = rc.nRight: Yin = rc.nBottom
        CALL skChildoffset(hWndForm, ofX, ofY)
        CALL skTileBlt(wParam, -ofX, -ofY, ofX + Xin&, ofY + Yin, skCtlBack)
        FUNCTION = 1: EXIT FUNCTION
   End Select


Basically, any Windows message that does not have a specific message handler in the code editor can be placed in the CUSTOM message handler.