oWnd:oMenu:End()

oWnd:oMenu:End()

Postby Rimantas » Sun Nov 27, 2011 12:24 pm

Hi ,

I want to disable menu and other controls on MDI Child window . But this line oWnd:bInit := { || oWnd:oMenu:End() } return error . How to do that with mdi child ? I want to leave only caption and border .

Regards !
Rimantas U.
User avatar
Rimantas
 
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania

Re: oWnd:oMenu:End()

Postby ukoenig » Sun Nov 27, 2011 12:45 pm

Hello Rimantas,

A MDI-project, using a Solution from Mr. Rao, to paint MDI-Childs and show embedded Controls.
Hide / Show from MDI-child 1 MdiChild 2 <= and => Hide / Show from MDI-child 2 MdiChild 1

Just delete from 2. MDI-child :

DEFINE BRUSH oBrush4 FILENAME "E:\T_SAMPLES\MDI\bitmaps\Back2A.jpg"
DEFINE WINDOW oWndBtn MDICHILD OF oWndMain FROM 50, 20 TO 350, 190 PIXEL ;
BORDER NONE ;
NOSYSMENU ;
NOICONIZE ;
NOCAPTION ;
BRUSH oBrush4

A project-sample :

Image

Code: Select all  Expand view

#include "fivewin.ch"

STATIC hDC, oWndMain, oWndEdit, oWndBtn, oWndDlg, oFont1
STATIC c_path

FUNCTION MAIN()
LOCAL aColors1,aColors2,aColors3
LOCAL oBtn1, oBtn2, oBtn3, oBtn4
LOCAL oTmp, oBrush1, oBrush2, oBrush3, oBrush4
LOCAL aRect3 := GetSysmetrics( 1 ) // Screen-Height
LOCAL aRect4 := GetSysmetrics( 0 ) // Screen-Width

c_path := CURDRIVE() + ":\" + GETCURDIR()
DEFINE FONT oFont1 NAME "
Arial" SIZE 0, -14 BOLD

// ---- MDI - FRAME -----------
// ----------------------------------

DEFINE BRUSH oBrush1 FILENAME "
E:\T_SAMPLES\MDI\bitmaps\Back2.jpg"
DEFINE WINDOW oWndMain FROM 1, 1 TO aRect3, aRect4 ;
TITLE "
MDI Frame" MDI BRUSH oBrush1 PIXEL

// ----- 1. MDI - CHILD ( normal ) -------

aColors2 := { { 0.5, 128, 65535 }, { 0.5, 65535, 128 } }
DEFINE WINDOW oWndEdit MDICHILD OF oWndMain FROM 50, 550 TO 280, 980 PIXEL ;
TITLE "
MDI Child"

@ 20, 50 BTNBMP oBtn1 OF oWndEdit PIXEL ;
SIZE 150 , 60  PROMPT "
Hide MDI-buttons" 2007 ;
FONT oFont1 ;
TOP ;
NOBORDER ;
FILENAME c_Path + "
\bitmaps\32x32\Hide.bmp" ;
ACTION oWndBtn:Hide()

oBtn1:SetColor( 128, )
oBtn1:cTooltip :=  { "
Hide MDI-buttons" + CRLF + ;
                  "
on MDI-frame","Hide", 1, CLR_BLACK, 14089979 }

@ 100, 50 BTNBMP oBtn2 OF oWndEdit PIXEL ;
SIZE 150 , 60  PROMPT "
Show MDI-buttons" 2007 ;
FONT oFont1 ;
TOP ;
NOBORDER ;
FILENAME c_Path + "
\bitmaps\32x32\Show.bmp" ;
ACTION oWndBtn:Show()

oBtn2:SetColor( 128, )
oBtn2:cTooltip :=  { "
Show MDI-buttons" + CRLF + ;
                  "
on MDI-frame","Show", 1, CLR_BLACK, 14089979 }

@ 100, 220 BTNBMP oBtn3 OF oWndEdit PIXEL ;
SIZE 150 , 60  PROMPT "
Exit" 2007 ;
FONT oFont1 ;
TOP ;
NOBORDER ;
FILENAME c_Path + "
\bitmaps\32x32\Exit.bmp" ;
ACTION oWndMain:End()

oBtn3:SetColor( 128, )
oBtn3:cTooltip :=  { "
Close" + CRLF + ;
                "
MDI-Test","MDI-Test", 1, CLR_BLACK, 14089979 }

ACTIVATE WINDOW oWndEdit ;
ON PAINT GradientFill( hDC, 0, 0, oWndEdit:nHeight, oWndEdit:nWidth, aColors2, .T. )

// --------- 2. MDI-Child  ( hidden with BUTTONS  ) ----------

DEFINE BRUSH oBrush4 FILENAME "
E:\T_SAMPLES\MDI\bitmaps\Back2A.jpg"
DEFINE WINDOW oWndBtn MDICHILD OF oWndMain FROM 50, 20 TO 350, 190 PIXEL ;
BORDER NONE ;
NOSYSMENU ;
NOICONIZE ;
NOCAPTION ;
BRUSH oBrush4

@ 10, 10 BTNBMP oBtn1 OF oWndBtn PIXEL ;
SIZE 150 , 70  PROMPT "
Hide MDI-child" 2007 ;
FONT oFont1 ;
TOP ;
NOBORDER ;
FILENAME c_Path + "
\bitmaps\32x32\Hide.bmp" ;
ACTION  oWndEdit:Hide()

oBtn1:SetColor( 128, )
oBtn1:cTooltip :=  { "
Hide MDI-Child" + CRLF + ;
                  "
on MDI-frame","Hide MDI-child", 1, CLR_BLACK, 14089979 }

@ 115, 10 BTNBMP oBtn2 OF oWndBtn PIXEL ;
SIZE 150 , 70  PROMPT "
Show MDI-child" 2007 ;
FONT oFont1 ;
TOP ;
NOBORDER ;
FILENAME c_Path + "
\bitmaps\32x32\Show.bmp" ;
ACTION  oWndEdit:Show()

oBtn2:SetColor( 128, )
oBtn2:cTooltip :=  { "
Show MDI-child" + CRLF + ;
                   "
on MDI-frame","Show MDI-child", 1, CLR_BLACK, 14089979 }

@ 220, 10 BTNBMP oBtn3 OF oWndBtn PIXEL ;
SIZE 150 , 70  PROMPT "
Exit" 2007 ;
FONT oFont1 ;
TOP ;
NOBORDER ;
FILENAME c_Path + "
\bitmaps\32x32\Exit.bmp" ;
ACTION ( oWndMain:End() )

oBtn3:SetColor( 128, )
oBtn3:cTooltip :=  { "
Exit" + CRLF + ;
                  "
MDI-test","Exit", 1, CLR_BLACK, 14089979 }

ACTIVATE WINDOW oWndBtn

DEFINE BITMAP oAlpha FILENAME c_Path + "
\bitmaps\Logo.bmp"

ACTIVATE WINDOW oWndMain MAXIMIZED ;
ON INIT MDI_DIALOG() ;
ON PAINT ABPaint( hDC, 80, 400, oAlpha:hBitmap, 255 )  // Horiz / Vertical

SET MESSAGE OF oWndMain TO FWVERSION + "
 TechData Software " ;
CENTERED 2007

oFont1:End()
oBrush1:End()
oBrush3:End()
oBrush4:End()

RETURN NIL

// --------- MDI-DIALOG ----------

FUNCTION MDI_DIALOG()
LOCAL hDC, oBtn1

DEFINE DIALOG oWndDlg FROM 500, 555 TO 650, 970 OF oWndMain  PIXEL ;
TITLE "
Dialog on MDI-Frame"

@ 20, 110 BTNBMP oBtn1 OF oWndDlg ;
SIZE 75 , 35  PROMPT "
Exit" 2007 ;
FONT oFont1 ;
TOP ;
NOBORDER ;
FILENAME c_Path + "
\bitmaps\32x32\Exit.bmp" ;
ACTION  oWndMain:End()

oBtn1:SetColor( 128, )
oBtn1:cTooltip :=  { "
Close" + CRLF + ;
                  "
MDI-test","Exit", 1, CLR_BLACK, 14089979 }

ACTIVATE DIALOG oWndDlg NOWAIT ;
ON INIT NEW_BRUSH()

RETURN NIL

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

FUNCTION NEW_BRUSH()
LOCAL hDC1, aColors

aColors := { { 0.5, 128, 65535 }, { 0.5, 65535, 128 } }
hDC1 = CreateCompatibleDC( oWndDlg:GetDC() )
hBmp = CreateCompatibleBitMap( oWndDlg:hDC, oWndDlg:nWidth(), oWndDlg:nHeight() - 25 )
hBmpOld = SelectObject( hDC1, hBmp )
GradientFill( hDC1, 0, 0, oWndDlg:nHeight(), oWndDlg:nWidth(), aColors, .T. )
DeleteObject( oWndEdit:oBrush:hBrush )
oWndDlg:oBrush:hBitmap = hBmp
oWndDlg:oBrush:hBrush = CreatePatternBrush( hBmp )
SelectObject( hDC1, hBmpOld )
oWndDlg:ReleaseDC()

oWndDlg:Refresh()

RETURN NIL


Best Regards
Uwe :lol:
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: oWnd:oMenu:End()

Postby Rimantas » Sun Nov 27, 2011 1:27 pm

ukoenig wrote:Hello Rimantas,

DEFINE BRUSH oBrush4 FILENAME "E:\T_SAMPLES\MDI\bitmaps\Back2A.jpg"
DEFINE WINDOW oWndBtn MDICHILD OF oWndMain FROM 50, 20 TO 350, 190 PIXEL ;
BORDER NONE ;
NOSYSMENU ;
NOICONIZE ;
NOCAPTION ;
BRUSH oBrush4

Best Regards
Uwe :lol:


Many thanks Uwe ! That was what I need ...

Regards !
Rimantas U.
User avatar
Rimantas
 
Posts: 437
Joined: Fri Oct 07, 2005 12:56 pm
Location: Utena , Lithuania


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 102 guests