MDI & Splitter Problem
MDI & Splitter Problem
Hi,
When i try to use MDI Window with splitter does not work .See for example testspl1.prg use MDI .I found a previous forum witch shows the problem
http://fivetechsoft.com/forums/viewtopi ... r+mdichild
Is there any solution for this?
Thank you
A.S.K
When i try to use MDI Window with splitter does not work .See for example testspl1.prg use MDI .I found a previous forum witch shows the problem
http://fivetechsoft.com/forums/viewtopi ... r+mdichild
Is there any solution for this?
Thank you
A.S.K
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
A.S.K.
You can do it this way. Anyhow when you try to create a Child window it GPFs and we need to find the reason
You can do it this way. Anyhow when you try to create a Child window it GPFs and we need to find the reason
Code: Select all
#include "FiveWin.ch"
#include "Splitter.ch"
static oWnd
static oLbx, oGet
static oSplit
function Main()
local cTitle := "Testing the Splitter controls"
local cText
DEFINE WINDOW oWnd FROM 1, 1 TO 400, 600 PIXEL ;
TITLE cTitle ;
BORDER NONE MDI
SELECT 1
USE EJEMPLO1.DBF
@ 20,20 LISTBOX oLbx FIELDS SIZE 200,300 PIXEL OF oWnd ;
ON CHANGE cText := Ejemplo1->Sintax
SetParent( oLbx:hWnd, oWnd:hWnd )
@ 20,225 GET oGet VAR cText TEXT SIZE 300,300 PIXEL OF oWnd
oLbx:bChange:={|| oGet:Refresh() }
SetParent( oGet:hWnd, oWnd:hWnd )
@ 20, 220 SPLITTER oSplit ;
VERTICAL ;
PREVIOUS CONTROLS oLbx ;
HINDS CONTROLS oGet ;
LEFT MARGIN 100 ;
RIGHT MARGIN 140 ;
SIZE 4, 300 PIXEL ;
OF oWnd ;
_3DLOOK ;
UPDATE
SetParent( oSplit:hWnd, oWnd:hWnd )
ACTIVATE WINDOW oWnd
return nil
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Last edited by Antonio Linares on Mon Nov 19, 2007 4:11 pm, edited 1 time in total.
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Here it is the source code:
Code: Select all
// FWH Class TOutLook2003
#include "FiveWin.ch"
#include "Splitter.ch"
//----------------------------------------------------------------------------//
function Main()
local oWnd, oOutLook2003, oStatusBar, oSplit, cCombo, oRad, nValue := 1
local oFont
DEFINE WINDOW oWnd TITLE "FWH new Class TOutLook2003" MDI // ;
// MENU BuildMenu()
DEFINE OUTLOOK2003 oOutLook2003 OF oWnd ;
PROMPTS "Mail", "Calendar", "Contacts", "" ;
BITMAPS "..\bitmaps\mail.bmp", "..\bitmaps\calendar.bmp", "..\bitmaps\notes.bmp"
oWnd:oLeft = nil // Because the splitter is going to control the resize
@ 1, 2 BUTTON "New" OF oOutLook2003:aDialogs[ 1 ] SIZE 80, 22 ACTION BuildDlg()
@ 3, 2 BUTTON "Edit" OF oOutLook2003:aDialogs[ 1 ] SIZE 80, 22 ACTION MsgInfo( "Edit" )
@ 5, 2 BUTTON "Search" OF oOutLook2003:aDialogs[ 1 ] SIZE 80, 22 ACTION MsgInfo( "Search" )
@ 1, 1 COMBOBOX cCombo ITEMS { "January", "February", "March", "April", "May" } ;
OF oOutLook2003:aDialogs[ 2 ] SIZE 170, 100
DEFINE FONT oFont NAME "Arial" SIZE 0, -10
@ 12, 10 SAY Date() OF oOutLook2003:aDialogs[ 2 ] SIZE 80, 20 FONT oFont
@ 3, 1 RADIO oRad VAR nValue OF oOutLook2003:aDialogs[ 2 ] ;
ITEMS "&Day", "&Week", "&Month" SIZE 100, 20
oRad:SetFont( oFont )
#ifndef __CLIPPER__
DEFINE STATUSBAR oStatusBar PROMPT " FWH Class TOutLook2003" OF oWnd
#else
DEFINE MESSAGE oStatusBar PROMPT " FWH Class TOutLook2003" OF oWnd
#endif
SetParent( oOutLook2003:hWnd, oWnd:hWnd )
oWnd:oClient = nil
@ 0, 191 SPLITTER oSplit ;
VERTICAL _3DLOOK ;
PREVIOUS CONTROLS oOutLook2003 ;
HINDS CONTROLS oWnd:oWndClient ;
SIZE 4, oWnd:nHeight - 70 PIXEL ;
OF oWnd
SetParent( oSplit:hWnd, oWnd:hWnd )
ACTIVATE WINDOW oWnd ;
ON RESIZE oSplit:Adjust() ;
VALID PostQuitMessage( 0 )
return nil
//----------------------------------------------------------------------------//
function BuildMenu()
local oMenu
MENU oMenu
MENUITEM "&One"
MENUITEM "&Two"
MENUITEM "&Three"
ENDMENU
return oMenu
//----------------------------------------------------------------------------//
function BuildDlg()
local oDlg, oOutL2003
DEFINE DIALOG oDlg RESOURCE "Test"
REDEFINE OUTLOOK2003 oOutL2003 ID 110 OF oDlg ;
PROMPTS "One", "Two", "Three" ;
BITMAPS "..\bitmaps\mail.bmp", "..\bitmaps\calendar.bmp", "..\bitmaps\notes.bmp" ;
DIALOGS "Page1", "Page2", "Page3"
REDEFINE BUTTON ID 110 OF oOutL2003:aDialogs[ 1 ] ACTION MsgInfo( "Click" )
ACTIVATE DIALOG oDlg CENTERED
return nil
//----------------------------------------------------------------------------//
function WinRun()
while NoGPF()
end
return nil
//----------------------------------------------------------------------------//
#pragma BEGINDUMP
#include <windows.h>
#include <hbapi.h>
BOOL SysRefresh( void );
HB_FUNC( NOGPF )
{
__try
{
hb_retl( SysRefresh() );
}
__except ( ( hb_retl( TRUE ), TRUE ) )
{}
}
#pragma ENDDUMP
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
-
- Posts: 824
- Joined: Thu Oct 13, 2005 7:39 am
- Location: Germany
Antonio,
this is the error:
this is the error:
Code: Select all
Application
===========
Path and name: D:\FWH\samples\testspl7.exe (32 bits)
Size: 1,295,360 bytes
Time from start: 0 hours 0 mins 36 secs
Error occurred at: 11/20/07, 09:36:36
Error description: Error BASE/1066 Argument error: conditional
Args:
[ 1] = U
Stack Calls
===========
Called from: MDIFRAME.PRG => TMDIFRAME:END(0)
Called from: MDIFRAME.PRG => (b)TMDIFRAME:NEW(0)
Called from: MENU.PRG => TMENU:COMMAND(0)
Called from: WINDOW.PRG => TWINDOW:COMMAND(0)
Called from: MDIFRAME.PRG => TMDIFRAME:COMMAND(0)
Called from: => TMDIFRAME:HANDLEEVENT(0)
Called from: WINDOW.PRG => _FWH(0)
Called from: testspl7.prg => NOGPF(0)
Called from: testspl7.prg => WINRUN(102)
Called from: WINDOW.PRG => TMDIFRAME:ACTIVATE(0)
Called from: testspl7.prg => MAIN(61)
kind regards
Stefan
Stefan
-
- Posts: 824
- Joined: Thu Oct 13, 2005 7:39 am
- Location: Germany
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
This version fixes the exit error on XP (on Vista is ok):
Code: Select all
// FWH Class TOutLook2003
#include "FiveWin.ch"
#include "Splitter.ch"
static lExit := .F.
//----------------------------------------------------------------------------//
function Main()
local oWnd, oOutLook2003, oStatusBar, oSplit, cCombo, oRad, nValue := 1
local oFont
DEFINE WINDOW oWnd TITLE "FWH new Class TOutLook2003" MDI // ;
// MENU BuildMenu()
DEFINE OUTLOOK2003 oOutLook2003 OF oWnd ;
PROMPTS "Mail", "Calendar", "Contacts", "" ;
BITMAPS "..\bitmaps\mail.bmp", "..\bitmaps\calendar.bmp", "..\bitmaps\notes.bmp"
oWnd:oLeft = nil // Because the splitter is going to control the resize
@ 1, 2 BUTTON "New" OF oOutLook2003:aDialogs[ 1 ] SIZE 80, 22 ACTION BuildDlg()
@ 3, 2 BUTTON "Edit" OF oOutLook2003:aDialogs[ 1 ] SIZE 80, 22 ACTION MsgInfo( "Edit" )
@ 5, 2 BUTTON "Search" OF oOutLook2003:aDialogs[ 1 ] SIZE 80, 22 ACTION MsgInfo( "Search" )
@ 1, 1 COMBOBOX cCombo ITEMS { "January", "February", "March", "April", "May" } ;
OF oOutLook2003:aDialogs[ 2 ] SIZE 170, 100
DEFINE FONT oFont NAME "Arial" SIZE 0, -10
@ 12, 10 SAY Date() OF oOutLook2003:aDialogs[ 2 ] SIZE 80, 20 FONT oFont
@ 3, 1 RADIO oRad VAR nValue OF oOutLook2003:aDialogs[ 2 ] ;
ITEMS "&Day", "&Week", "&Month" SIZE 100, 20
oRad:SetFont( oFont )
#ifndef __CLIPPER__
DEFINE STATUSBAR oStatusBar PROMPT " FWH Class TOutLook2003" OF oWnd
#else
DEFINE MESSAGE oStatusBar PROMPT " FWH Class TOutLook2003" OF oWnd
#endif
SetParent( oOutLook2003:hWnd, oWnd:hWnd )
oWnd:oClient = nil
@ 0, 191 SPLITTER oSplit ;
VERTICAL _3DLOOK ;
PREVIOUS CONTROLS oOutLook2003 ;
HINDS CONTROLS oWnd:oWndClient ;
SIZE 4, oWnd:nHeight - 70 PIXEL ;
OF oWnd
SetParent( oSplit:hWnd, oWnd:hWnd )
ACTIVATE WINDOW oWnd ;
ON RESIZE oSplit:Adjust() ;
VALID lExit := .T.
return nil
//----------------------------------------------------------------------------//
function BuildMenu()
local oMenu
MENU oMenu
MENUITEM "&One"
MENUITEM "&Two"
MENUITEM "&Three"
ENDMENU
return oMenu
//----------------------------------------------------------------------------//
function BuildDlg()
local oDlg, oOutL2003
DEFINE DIALOG oDlg RESOURCE "Test"
REDEFINE OUTLOOK2003 oOutL2003 ID 110 OF oDlg ;
PROMPTS "One", "Two", "Three" ;
BITMAPS "..\bitmaps\mail.bmp", "..\bitmaps\calendar.bmp", "..\bitmaps\notes.bmp" ;
DIALOGS "Page1", "Page2", "Page3"
REDEFINE BUTTON ID 110 OF oOutL2003:aDialogs[ 1 ] ACTION MsgInfo( "Click" )
ACTIVATE DIALOG oDlg CENTERED
return nil
//----------------------------------------------------------------------------//
function WinRun()
while NoGPF()
if lExit
PostQuitMessage( 0 )
endif
end
return nil
//----------------------------------------------------------------------------//
#pragma BEGINDUMP
#include <windows.h>
#include <hbapi.h>
BOOL SysRefresh( void );
HB_FUNC( NOGPF )
{
__try
{
hb_retl( SysRefresh() );
}
__except ( ( hb_retl( TRUE ), TRUE ) )
{}
}
#pragma ENDDUMP
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Stefan,
> if you maximize the mdi window, you can´t resize it nor select other open mdi windows
Yes, we have noticed it.
The problem is that we are not using the FWH standard windows procedure as the MDI GPFs internally (even if we use a standard Windows procedure and not the FWH one).
Its a tricky code tu push MDI environment to its limits, but lets see if we can solve those problems
> if you maximize the mdi window, you can´t resize it nor select other open mdi windows
Yes, we have noticed it.
The problem is that we are not using the FWH standard windows procedure as the MDI GPFs internally (even if we use a standard Windows procedure and not the FWH one).
Its a tricky code tu push MDI environment to its limits, but lets see if we can solve those problems
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
-
- Posts: 824
- Joined: Thu Oct 13, 2005 7:39 am
- Location: Germany
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact: