PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Anonymous on January 20, 2006, 08:47:39 PM

Title: MDI Like PB8 Editor
Post by: Anonymous on January 20, 2006, 08:47:39 PM
I recently upgraded my PB/Win from 7 to 8 (leaving the Console at 3 thanks
to FireFly and Console Wrappers).  Anyhow, while looking at their new
editor I saw what appears to be their MDI code editor with a debug interface
at the bottom.  The debug interface is inline but does not appear to be part
of the MDI interface.  If anyone doesn't know what I'm talking about, I can
take a screenshot.

Anyhow, I'm hoping someone could point me in the right direction on how I
can do something similar.  I'm stumped because the scrollbars for the MDI
section don't account for this debug section (which is the right way).  I tried
doing topmost and having it be set to be flush with the MDI frame, but this
didn't give the intended approach.

Any tips?

Thanks!
Title: MDI Like PB8 Editor
Post by: TechSupport on January 21, 2006, 04:24:18 PM
I am working on an example for you right now.....
Title: MDI Like PB8 Editor
Post by: TechSupport on January 21, 2006, 04:33:41 PM
Okay, try this. For the MDIForm, set the following properties:

AutoSizeClient = False
MDIScrollBars = True


Function MDIFORM_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 MDI Client window. Take into account the toolbar
  ' and StatusBars if they are visible.
 
  Local rc           As Rect
  Local hWndRebar    As Dword
  Local RebarHeight  As Long      
  Local StatusHeight As Long
  Local DebugHeight  As Long
 
  hWndRebar = GetDlgItem( hWndForm, IDC_MDIFORM_REBAR )
  If IsWindowVisible( hWndRebar ) Then
     GetWindowRect hWndRebar, rc
     RebarHeight = rc.nBottom - rc.nTop
  End If                                        
 
  If IsWindowVisible( HWND_MDIFORM_STATUSBAR ) Then
     GetWindowRect HWND_MDIFORM_STATUSBAR, rc
     StatusHeight = rc.nBottom - rc.nTop
  End If                                        

  ' The debug window would have been previously created... probably as
  ' a TextBox control or a ListBox. We need to get its height here but
  ' for this example we will just use a fixed amount.
  DebugHeight = 200  '(pixels)
 
  ' Size the MDI Client window
  SetWindowPos HWND_MDIFORM_MDICLIENT, 0, 0, RebarHeight, _
               nWidth, nHeight - RebarHeight - StatusHeight - DebugHeight, _
               %SWP_NOZORDER
     
  Function = %TRUE        
 
End Function
Title: MDI Like PB8 Editor
Post by: Anonymous on January 21, 2006, 05:37:19 PM
Hey Paul,

Wow!  Thanks a lot for your help.  I think I follow you for most of it, the
sizing and all, but I have one question:

Quote

' The debug window would have been previously created... probably as
' a TextBox control or a ListBox. We need to get its height here but
' for this example we will just use a fixed amount.
DebugHeight = 200  '(pixels)
 
' Size the MDI Client window
SetWindowPos HWND_MDIFORM_MDICLIENT, 0, 0, RebarHeight, _
nWidth, nHeight - RebarHeight - StatusHeight - DebugHeight, _
%SWP_NOZORDER


Is the debug window an actual window or just a control (textbox or
listbox)?  I tried making a control on the MDI form and wasn't able
to (I was expecting that).  I'm going to make a window with a textbox
on it, as an MDI child, and have it show upon starting up the main
MDI.  Just wanted to make sure I was heading in the direction you were
with your example.

Thanks again!

John
Title: MDI Like PB8 Editor
Post by: TechSupport on January 21, 2006, 05:42:46 PM
The debug window in the PB editor is a custom window class called "PBWIN32OUTPUT".

Ideally, in FireFly at design time when the AutoSizeClient is set to False, then the MDIClient window should not resize as you resize your Form. This would allow you to create controls on the main form. I will have to fix this for Version 3.  ;)
Title: MDI Like PB8 Editor
Post by: Anonymous on January 21, 2006, 06:25:08 PM
Cool!  Thanks for adding it!  -John