Page 1 of 1

MDI without caption

PostPosted: Sat Apr 23, 2011 9:06 am
by Marco Turco
Hi all,
coult it be possible to create a mdi window without caption and without the system menu ?
I tried using the NOCAPTION and NOSYSMENU flags but the following error appairs at startup.

Path and name: K:\fwh\samples\testmdi.exe (32 bits)
Size: 1,477,632 bytes
Time from start: 0 hours 0 mins 0 secs
Error occurred at: 04/23/11, 11:01:37
Error description: Error BASE/1004 Class: 'NIL' has no exported method: OWNDCLIENT
Args:
[ 1] = U

Any ideas ?


Thanks in advance

Re: MDI without caption

PostPosted: Sat Apr 23, 2011 12:54 pm
by nageswaragunupudi
Most likely cause could be omission of "MDICHILD OF WndMain()" or if the code is "MDICHILD OF oWndMain", oWndMain could be NIL.

NOCAPTION clause for MDICHILD works as expected.

Please try this code.
Code: Select all  Expand view
#include "FiveWin.Ch"

//----------------------------------------------------------------------------//

function Main()

   local oWnd, oBar

   DEFINE WINDOW oWnd MDI
   DEFINE BUTTONBAR oBar OF oWnd 2007
   DEFINE BUTTON OF oBar PROMPT "C" ACTION Child()
   SET MESSAGE OF oWnd TO '' 2007
   ACTIVATE WINDOW ownd

return nil

//----------------------------------------------------------------------------//

static function Child()

   local oWnd

   DEFINE WINDOW oWnd MDICHILD OF WndMain() ;
      NOCAPTION NOSYSMENU ;
      COLOR CLR_BLACK,CLR_HBLUE

   ACTIVATE WINDOW oWnd

return nil

//----------------------------------------------------------------------------//
 

Re: MDI without caption

PostPosted: Sun Apr 24, 2011 1:50 pm
by Marco Turco
Yes, but I would like remove the sysmenu and border from the main window,
like this to be clear

function Main()

local oWnd, oBar

DEFINE WINDOW oWnd MDI NOSYSMENU NOCAPTION
DEFINE BUTTONBAR oBar OF oWnd 2007
DEFINE BUTTON OF oBar PROMPT "C" ACTION Child()
SET MESSAGE OF oWnd TO '' 2007
ACTIVATE WINDOW ownd

return nil

Do you know any way to make this ? With this code the error appairs.

Re: MDI without caption

PostPosted: Sun Apr 24, 2011 4:35 pm
by ukoenig
Marco,

like You can see in the Include-file, I think it is not possible on MDI-frame.
Instead, to show just a empty Screen, You can use a Dialog like :

DEFINE IMAGE oTmp FILENAME c_Path + "\bitmaps\Backgrd.jpg"

DEFINE DIALOG oDlg FROM 0, 0 TO 720, 1004 PIXEL ; // TRANSPARENT ;
STYLE WS_POPUP | WS_VISIBLE // | WS_DLGFRAME | WS_THICKFRAME // Frame disabled
oBrush1 := TBrush():new( ,,,, ResizeBmp( oTmp:hBitmap, 1004, 720, .T. ) )
oDlg:Setbrush( oBrush1 )
oTmp:End()


All Dialogs on Top of to the Main-dialog will need :
...
DEFINE DIALOG oDlg1 FROM 90, 60 TO 390, 500 PIXEL
...
...
ACTIVATE DIALOG oDlg1 NOWAIT ;
...
You can have a look at the new Image-viewer, how to use it.

The Include-section for MDI-windows from Fivewin.ch ( only Border defined ) :

#xcommand DEFINE WINDOW <oWnd> ;
[ FROM <nTop>, <nLeft> TO <nBottom>, <nRight> ] ;
[ TITLE <cTitle> ] ;
[ STYLE <nStyle> ] ;
[ MENU <oMenu> ] ;
[ BRUSH <oBrush> ] ;
[ ICON <oIcon> ] ;
[ MDI ] ;
[ <color: COLOR, COLORS> <nClrFore> [,<nClrBack>] ] ;
[ <vScroll: VSCROLL, VERTICAL SCROLL> ] ;
[ <hScroll: HSCROLL, HORIZONTAL SCROLL> ] ;
[ MENUINFO <nMenuInfo> ] ;
[ [ BORDER ] <border: NONE, SINGLE> ] ;
[ OF <oParent> ] ;
[ <pixel: PIXEL> ] ;

Best Regards
Uwe :lol:

Re: MDI without caption

PostPosted: Mon Apr 25, 2011 12:27 pm
by Marco Turco
Hi,
solved using oWnd:oMenu:End() on the window activation.

Re: MDI without caption

PostPosted: Mon Apr 25, 2011 1:09 pm
by ukoenig
Marco,

that doesn't disable the SYSMENU of the MDI-frame !!!
NOSYSMENU doesn't work on MDI-frame.

Image

Best Regards
Uwe :?:

Re: MDI without caption

PostPosted: Mon Apr 25, 2011 3:27 pm
by Marco Turco
Hi,
I only need to disable the main menu because I don't need to create a MDI window I'm using directly oWnd:oWndClient to operate on the MDI.
So it's going well for my case.