FireSplitter Example Of problem

Started by Martin Francom, December 07, 2009, 05:56:45 AM

Previous topic - Next topic

Martin Francom

Hello Paul,
   Attached is an example program that shows the problem I am having with the FireSplitter Control.  Its a very simple example.  Four forms.
Form1 contains then FireSplitter Control
Form2 contains buttons to switch between Form3 and Form4 which should be displayed in pane 2 of the FireSplitter control.

   Unless I am missing something, I thick there's a bug in the FireSplitter control.    The command:

  SendMessage HWND_FORM1_FIRESPLITTER1, %FF_SPLITTER_SETCHILD, 2, HWND_FORM4

simply is not functioning.

Could you take a quick look at the attached program and confirm and confirm my observations.  Thanks.
 

Paul Squires

If you are trying to dynamically change the pages in each pane then you would have to load them as non-modal in the WM_CREATE of the Form and do the SendMessage when the button is clicked.


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

    HWND_FORM3 = Form3_Show( HWND_FORM1_FIRESPLITTER1, %FALSE )
    HWND_FORM4 = Form4_Show( HWND_FORM1_FIRESPLITTER1, %FALSE )

    SendMessage HWND_FORM1_FIRESPLITTER1, %FF_SPLITTER_SETCHILD, 2, HWND_FORM3
   
End Function



'--------------------------------------------------------------------------------
Function FORM2_RRBUTTON1_BN_CLICKED ( _
                                    ControlIndex     As Long,  _  ' index in Control Array
                                    hWndForm         As Dword, _  ' handle of Form
                                    hWndControl      As Dword, _  ' handle of Control
                                    idButtonControl  As Long   _  ' identifier of button
                                    ) As Long

    ShowWindow HWND_FORM4, %SW_HIDE
    SendMessage HWND_FORM1_FIRESPLITTER1, %FF_SPLITTER_SETCHILD, 2, HWND_FORM3

End Function


'--------------------------------------------------------------------------------
Function FORM2_RRBUTTON2_BN_CLICKED ( _
                                    ControlIndex     As Long,  _  ' index in Control Array
                                    hWndForm         As Dword, _  ' handle of Form
                                    hWndControl      As Dword, _  ' handle of Control
                                    idButtonControl  As Long   _  ' identifier of button
                                    ) As Long

    ShowWindow HWND_FORM3, %SW_HIDE
    SendMessage HWND_FORM1_FIRESPLITTER1, %FF_SPLITTER_SETCHILD, 2, HWND_FORM4
   
End Function


You would not use the PropertyList "ChildForm2" or "ChildForm3" properties to attach any form at design time because everything is done via code.

I have noticed though that after making the changes that the panes do not seem to consistently resize automatically when the panes are resized. I am checking into that now.

Paul Squires
PlanetSquires Software

Paul Squires

You seem to be using WS_THICKFRAME style for your forms. Don't do that because that style allows the form to resize via the mouse - we want the FireSplitter control to do the resizing. Use the WS_DLGFRAME style instead if you want a raised appearance. I normally just set the child pane to be a TabControlChild = TRUE.

You probably also want the splitter to fill the whole client are of the main form:

'--------------------------------------------------------------------------------
Function FORM1_WM_SIZE ( _
                       hWndForm      As Dword, _  ' handle of Form
                       fwSizeType    As Long,  _  ' type of resizing request
                       nWidth        As Long,  _  ' new width of client area
                       nHeight       As Long   _  ' new height of client area
                       ) As Long

   ' Size the FireSplitter so that it fills the entire client area
   SetWindowPos HWND_FORM1_FIRESPLITTER1, 0, 0, 0, nWidth, nHeight, 0
   
End Function


Paul Squires
PlanetSquires Software

Paul Squires

I have attached the modified project.
Paul Squires
PlanetSquires Software

Martin Francom

Thank you Paul.  That was a easy fix.  I should have thought of it. 

For the benifit of the lurkers.  The solution was to simply hide the previous child window before loading the new child window.  The the calls are:


    ShowWindow HWND_FORM4, %SW_HIDE
    SendMessage HWND_FORM1_FIRESPLITTER1, %FF_SPLITTER_SETCHILD, 2, HWND_FORM3



Again, thanks for the great tech support.

Paul Squires

No problem Marty, you ar every welcome. :)

Make sure that you don't assign any child forms via the PropertyList because doing so will create unnecessary instances of your child forms (once via code generation and a second time via the cod ein your WM_CREATE).

Actually, you are probably creating and assigning the forms in the WM_CREATE for both panes.


Function FORM1_WM_CREATE ( _   

HWND_FORM2 = Form2_Show( HWND_FORM1_FIRESPLITTER1, %FALSE )   
HWND_FORM3 = Form3_Show( HWND_FORM1_FIRESPLITTER1, %FALSE )   
HWND_FORM4 = Form4_Show( HWND_FORM1_FIRESPLITTER1, %FALSE )   

SendMessage HWND_FORM1_FIRESPLITTER1, %FF_SPLITTER_SETCHILD, 1, HWND_FORM2
SendMessage HWND_FORM1_FIRESPLITTER1, %FF_SPLITTER_SETCHILD, 2, HWND_FORM3   
End Function


Paul Squires
PlanetSquires Software

Martin Francom

Paul,
   One thing I have noticed is that the transition from one child form to another seems a bit rough.   These child forms have alot of controls on them and this is probably what is causing the flickering.  I am using your reccommendations above.
  Any other suggestions?

Gary Stout

Quote from: Marty Francom on December 07, 2009, 03:01:26 PM
Paul,
   One thing I have noticed is that the transition from one child form to another seems a bit rough.   These child forms have alot of controls on them and this is probably what is causing the flickering.  I am using your reccommendations above.
  Any other suggestions?

Marty,

I don't know if this applies to your situation. I have  not used the FireSplitter control, but I have noticed when I have a bunch of labels on a tab control and switch from tab to tab, I am seeing some flickering. If I add the WS_EX_TRANSPARENT property to each of the labels, it seems to improve drastically. Otherwise, for a split second, I see a white background on the labels before it changes to the actual background color. The above property seems to hide that.

Gary