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
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.
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. :?
Paul,
Any success with this problem? I would like to be able to use WinLift but the program uses the Tab Control.
...Marty
Hi Marty,
No luck yet. Sorry. :(
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.
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]
Thanks Patrice ! I was banging my head against the wall trying to fix this problem.
:)
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.
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.