Trying new WinLIFT with FF3

Started by Patrice Terrier, November 14, 2009, 04:59:52 AM

Previous topic - Next topic

Patrice Terrier

Paul

In order to check my new WinLIFT with FF3, i need to fire the subclassing engine, once all the child controls have been created.

The best place for me, is to do it just before you show the main window, or at the end of the %WM_CREATE message in the CODEGEN_xxxxx_FORM1_FORM.inc.

So far i didn't find how i could edit the "CODEGEN_xxxxx_FORM1_FORM.inc" file from the environment, i did look at the "FireFly Workspace" tab "Explorer" but nothing there that would let me do what i want.

Currently i have to edit the "CODEGEN_xxxxx_FORM1_FORM.inc" with UltraEdit, while i would like to do it with Firefly, could you tell me how to do it with plain FF3.

Thank you!

PS: I am checking this with the GDImage project i have done with the beta version.

Marc van Cauwenberghe

Patrice,

Aff-topic maybe. I would love to see a GDImage project with FF3  :)

Marc

Paul Squires

The best place to do anything to any controls after they have been created, but before they are shown, is in the WM_CREATE message handler of the Form that the controls are on. You should never have to manually modify any of the CODEGEN*.* files.

Paul Squires
PlanetSquires Software

Patrice Terrier

Paul

For an SDK coder like me it is not clear where i have to do it:

Do i have to put the code in the FORM1_WM_COMMAND ?

And use something like this:

Function FORM1_WM_COMMAND ( _
                          hWndForm     As Dword, _  ' handle of Form
                          hWndControl  As Dword, _  ' handle of Control
                          wNotifyCode  As Long,  _  ' notification code
                          wID          As Long   _  ' item, control, or accelerator identifer
                          ) As Long
      SELECT CASE LONG wNotifyCode
      CASE %WM_CREATE
              IF skInitEngine("Boxer.sks", "") THEN
                  CALL skSkinWindow(hDlg, "Dock|Undock|Minimize|Maximize|Restore|Close")
              END IF
      END SELECT
End Function

Marc van Cauwenberghe

Patrice,
What Paul means I think is the FORM1_WM_CREATE function.

Marc

Paul Squires

Hi Patrice,

Marc has your answer. If you called your form "FORM1" then the message handler would be FORM1_WM_CREATE.

You would unsubclass anything in FORM1_WM_DESTROY.

Also,
CALL skSkinWindow(hDlg, "Dock|Undock|Minimize|Maximize|Restore|Close")

You are using "hDlg" when you should use either "hWndForm" or HWND_FORM1.
Paul Squires
PlanetSquires Software

Patrice Terrier

I can't find a %NULL brush in the "System" tab for "BackColor" properties.

...

Patrice Terrier

#7
FORM1_WM_CREATE is not the good place to use with WSA.

The right place is just before ShowWindow hWndForm, %SW_SHOWNORMAL in FORM1_Show

    If skInitEngine("Boxer.sks", "") Then
       Call skSkinWindow(hWndForm, "Dock|Undock|Minimize|Maximize|Restore|Close")
    End If
       
       ShowWindow hWndForm, %SW_SHOWNORMAL
       UpdateWindow hWndForm


It must be realy the last code executed before showing the main form.

Thus i have no other choice than editing "manualy" CODEGEN_xxxxx_FORM1_FORM.inc   :-[

Paul Squires

Maybe try something like this:


'--------------------------------------------------------------------------------
Function FORM1_WM_CREATE ( _
                         hWndForm As Dword, _      ' handle of Form
                         ByVal UserData As Long _  ' optional user defined Long value
                         ) As Long

   Local hBrush As Dword
   
   ' Get the current background brush and delete it
   hBrush = GetClassLong( hWndForm, %GCL_HBRBACKGROUND )
   DeleteObject hBrush
   
   ' Set our new brush
   SetClassLong hWndForm, %GCL_HBRBACKGROUND, GetStockObject( %NULL_BRUSH )
   
 
End Function

Paul Squires
PlanetSquires Software

Paul Squires

Quote from: Patrice Terrier on November 14, 2009, 03:08:59 PM
FORM1_WM_CREATE is not the good place to use with WSA.

The right place is just before ShowWindow hWndForm, %SW_SHOWNORMAL in FORM1_Show

    If skInitEngine("Boxer.sks", "") Then
       Call skSkinWindow(hWndForm, "Dock|Undock|Minimize|Maximize|Restore|Close")
    End If
       
       ShowWindow hWndForm, %SW_SHOWNORMAL
       UpdateWindow hWndForm


It must be realy the last code executed before showing the main form.

Thus i have no other choice than editing "manualy" CODEGEN_xxxxx_FORM1_FORM.inc   :-[

Would it be too late if you put the code in the WM_SHOWWINDOW of the form? Probably use a static variable to ensure that it executes only the first time that the window is shown?


'--------------------------------------------------------------------------------
Function FORM1_CUSTOM ( _
                      hWndForm      As Dword, _  ' handle of Form
                      wMsg          As Long,  _  ' type of message
                      wParam        As Dword, _  ' first message parameter
                      lParam        As Long   _  ' second message parameter
                      ) As Long

   Select Case wMsg

      Case %WM_SHOWWINDOW

         Static fShowDone As Long
         If fShowDone = %FALSE Then
            If skInitEngine("Boxer.sks", "") Then
               Call skSkinWindow(hWndForm, "Dock|Undock|Minimize|Maximize|Restore|Close")
            End If
            fShowDone = %TRUE
         End If
             
   End Select
     
End Function

Paul Squires
PlanetSquires Software

Paul Squires

Hi Patrice,

I download the WinLift beta and I can recreate the same problem that you are having.

I'll keep thinking to see if I can get an easier solution than having to modify the CODEGEN*.* sources.
Paul Squires
PlanetSquires Software

Patrice Terrier

Paul,

There are a few other issues, thus keep it onto your back burner, until i come back to you.

...

Patrice Terrier

Paul

I have been able to solve the WSA init problem, and now it works when fired from FORM1_WM_CREATE.

My next problem is to find why it flickers when resizing the main form.
(i do not see this with plain SDK or DDT, any thought?)

...

Andrew Lindsay

Patrice and Paul,

I hope you manage to sort it out, I love the Winlift look and feel of apps for some appealing eye candy.

Regards

Andrew

Paul Squires

Quote from: Patrice Terrier on November 14, 2009, 06:23:05 PM
My next problem is to find why it flickers when resizing the main form.
(i do not see this with plain SDK or DDT, any thought?)

You just need to uncheck the CS_VREDRAW and CS_HREDRAW properties in the "(ClassStyles)" of the Form that WinLift is on.
Paul Squires
PlanetSquires Software