- Code: Select all Expand view RUN
ACTIVATE DIALOG oDlg CENTERED AS MDICHILD // no puede MAXIMIZAR, solo MINIMIZAR.
https://imgur.com/mcaKXEZ
Regards, saludos.
ACTIVATE DIALOG oDlg CENTERED AS MDICHILD // no puede MAXIMIZAR, solo MINIMIZAR.
METHOD New( nTop, nLeft, nBottom, nRight, cTitle, nStyle, oMenu, oWnd,;
oIcon, lVScroll, nClrFore, nClrBack, oCursor, oBrush,;
lPixel, lHScroll, nHelpId, cBorder, lSysMenu, lCaption,;
lMin, lMax, nMenuInfo, lUnicode ) CLASS TMdiChild
local lMaximize := .f.
DEFAULT cTitle := "MDI Child " + AllTrim( Str( Len( oWnd:oWndClient:aWnd ) + 1 ) ),;
lVScroll := .f., lHScroll := .f.,;
oWnd := GetWndFrame(),;
nClrFore := oWnd:oWndClient:nClrText,;
nClrBack := oWnd:oWndClient:nClrPane,;
nStyle := 0,;
cBorder := "SINGLE", lSysMenu := .t., lCaption := .t.,;
lMin := .t., lMax := .t., lPixel := .f., ;
lUnicode := FW_SetUnicode()
::lUnicode := lUnicode
if oWnd:lChildAutoSize .and. ;
If( Empty( oWnd:oWndClient:aWnd ), IsZoomed( oWnd:hWnd ), IsZoomed( oWnd:oWndClient:GetActive():hWnd ) )
lMaximize := .t.
endif
if nStyle == 0
IF lDesligaMax // := .T. // En: MENUPRINC.PRG -> PUBLIC
// Desliga: WS_MAXIMIZEBOX
lMax := .F. // MODIFICADO EN: 16/12/2021 - Joao.
ENDIF
nStyle = nOr( WS_CLIPCHILDREN, WS_VISIBLE, ;
If( cBorder == "NONE", 0, 0 ),;
If( cBorder == "SINGLE", WS_THICKFRAME, 0 ),;
If( lCaption, WS_CAPTION, 0 ),;
If( lSysMenu .and. lCaption, WS_SYSMENU, 0 ),;
If( lMin .and. lCaption, WS_MINIMIZEBOX, 0 ),;
If( lMax .and. lCaption, WS_MAXIMIZEBOX, 0 ),;
If( lVScroll, WS_VSCROLL, 0 ),;
If( lHScroll, WS_HSCROLL, 0 ),;
If( lMaximize, WS_MAXIMIZE, 0 ) )
endif
METHOD New( nTop, nLeft, nBottom, nRight, cTitle, nStyle, oMenu, oWnd,;
oIcon, lVScroll, nClrFore, nClrBack, oCursor, oBrush,;
lPixel, lHScroll, nHelpId, cBorder, lSysMenu, lCaption,;
lMin, lMax, nMenuInfo, lUnicode ) CLASS TMdiChild
local lMaximize := .f.
DEFAULT cTitle := "MDI Child " + AllTrim( Str( Len( oWnd:oWndClient:aWnd ) + 1 ) ),;
lVScroll := .f., lHScroll := .f.,;
oWnd := GetWndFrame(),;
nClrFore := oWnd:oWndClient:nClrText,;
nClrBack := oWnd:oWndClient:nClrPane,;
nStyle := 0,;
cBorder := "SINGLE", lSysMenu := .t., lCaption := .t.,;
lMin := .t., lMax := .f., lPixel := .f., ;
lUnicode := FW_SetUnicode()
::lUnicode := lUnicode
if oWnd:lChildAutoSize .and. ;
If( Empty( oWnd:oWndClient:aWnd ), IsZoomed( oWnd:hWnd ), IsZoomed( oWnd:oWndClient:GetActive():hWnd ) )
lMaximize := .t.
endif
if nStyle == 0
IF lDesligaMax // := .T. // En: MENUPRINC.PRG
// Desliga: WS_MAXIMIZEBOX
lMax := .F. // MODIFICADO EN: 16/12/2021 - Joao.
ENDIF
nStyle = nOr( WS_CLIPCHILDREN, WS_VISIBLE, ;
If( cBorder == "NONE", 0, 0 ),;
If( cBorder == "SINGLE", WS_THICKFRAME, 0 ),;
If( lCaption, WS_CAPTION, 0 ),;
If( lSysMenu .and. lCaption, WS_SYSMENU, 0 ),;
If( lMin .and. lCaption, WS_MINIMIZEBOX, 0 ),;
If( lMax .and. lCaption, WS_MAXIMIZEBOX, 0 ),;
If( lVScroll, WS_VSCROLL, 0 ),;
If( lHScroll, WS_HSCROLL, 0 ),;
If( lMaximize, WS_MAXIMIZE, 0 ) )
endif
::nTop = If( nTop != nil, nTop * If( ! lPixel, MDIC_CHARPIX_H, 1 ), CW_USEDEFAULT ) // 16
::nLeft = If( nLeft != nil, nLeft * If( ! lPixel, MDIC_CHARPIX_W, 1 ), CW_USEDEFAULT ) // 8
::nBottom = If( nBottom != nil, nBottom * If( ! lPixel, MDIC_CHARPIX_H, 1 ), CW_USEDEFAULT ) // 16
::nRight = If( nRight != nil, nRight * If( ! lPixel, MDIC_CHARPIX_W, 1 ), CW_USEDEFAULT ) // 8
::oWndClient = oWnd:oWndClient
::oWnd = oWnd
::nStyle = nStyle
::oIcon = oIcon
::lVisible = .t.
::aControls = {}
::nHelpId = nHelpId
::cCaption = cTitle
::lKeepMenu = .f.
::nMenuInfo = nMenuInfo
if ValType( oIcon ) == "C"
if File( oIcon )
DEFINE ICON oIcon FILENAME oIcon
else
DEFINE ICON oIcon RESOURCE oIcon
endif
::oIcon = oIcon
else // MODIFICADO EM: 17/12/2021 - Joao
DEFINE ICON oIcon NAME "ICONE01" // EM IMAGENS.RES
::oIcon = oIcon
endif
::oCursor = oCursor
// dDataNascimen := ( cAlias )->DATANASC
REDEFINE GET aGet[14] VAR dDataNascimen PICTURE "@KD 99/99/9999" ID 34 ;
SPINNER OF oFld:aDialogs[1] UPDATE COLORS CLR_BLACK, CLR_WHITE FONT oFont
ACTIVATE DIALOG oDlg CENTERED AS MDICHILD
extern Set
static oWnd
//----------------------------------------------------------------------------//
function Main()
local oBar
DEFINE WINDOW oWnd FROM 1, 1 To 22, 75 ;
TITLE "This is a MDI enviroment" MDI VSCROLL
DEFINE BUTTONBAR oBar OF oWnd
DEFINE BUTTON OF oBar ACTION CreateChild()
SET MESSAGE OF oWnd TO "A message bar"
ACTIVATE WINDOW oWnd
return nil
//----------------------------------------------------------------------------//
function CreateChild()
local oWndChild, oIcon
local oBar
local oDate, dDate
dDate := date()
DEFINE ICON oIcon RESOURCE "test"
DEFINE WINDOW oWndChild MDICHILD OF oWnd ICON oIcon
// oWndChild:bGotFocus = { || MsgBeep() }
oWndChild:bLostFocus = { || MsgBeep() }
DEFINE BUTTONBAR oBar OF oWndChild
DEFINE BUTTON OF oBar ACTION MsgInfo( "Action" )
DEFINE BUTTON OF oBar ACTION oWndChild:End()
@ 3, 3 GET oDate var dDate SPINNER OF oWndChild SIZE 120, 25 PICTURE "@KD 99/99/9999" //<--- AQUÍ
oWndChild:Center()
ACTIVATE WINDOW oWndChild MAXIMIZED VALID MsgYesNo( "¿Nos vamos de copas, João?" )
return nil
//----------------------------------------------------------------------------//
procedure AppSys // XBase++ requirements
return
//----------------------------------------------------------------------------//
karinha wrote:Buenas noches, porque el comando SPINNER no funciona con: AS MDICHILD?
- Code: Select all Expand view RUN
// dDataNascimen := ( cAlias )->DATANASC
REDEFINE GET aGet[14] VAR dDataNascimen PICTURE "@KD 99/99/9999" ID 34 ;
SPINNER OF oFld:aDialogs[1] UPDATE COLORS CLR_BLACK, CLR_WHITE FONT oFont
ACTIVATE DIALOG oDlg CENTERED AS MDICHILD
Regards, saludos.
// \samples\MDIDLG.PRG
// viewtopic.php?f=3&t=36244
#include "fivewin.ch"
#define AS_MDICHILD 1
#define AS_DIALOG 2
//----------------------------------------------------------------------------//
function Main()
LOCAL oWnd, oBar, oMenu
SET CENTURY ON
SET DATE BRITISH
SET TIME FORMAT TO "HH:MM:SS"
SET EPOCH TO YEAR( DATE() ) - 30
SetGetColorFocus()
DEFINE WINDOW oWnd MDI TITLE "FWH18.08: DIALOG IN MDICHILD WINDOW"
DEFINE BUTTONBAR oBar OF oWnd SIZE 100, 32 2007
DEFINE BUTTON OF oBar PROMPT "MDIDLG-OLD" CENTER ;
ACTION DlgInMdiChildOld()
DEFINE BUTTON OF oBar PROMPT "MDIDLG-NEW" CENTER ;
ACTION CreateDialog( AS_MDICHILD )
DEFINE BUTTON OF oBar PROMPT "DIALOG" CENTER ;
ACTION CreateDialog( AS_DIALOG )
ACTIVATE WINDOW oWnd
return nil
//----------------------------------------------------------------------------//
static function CreateDialog( nAs )
local oDlg, oCbx, oChk, oFont, oBrush, cTitle
local cVar1, cVar2
local lSwitch1, lSwitch2, lSwitch3
local cVar := "Two"
local aGrad := {{1, CLR_WHITE, CLR_HBLUE }}
cVar1 := cVar2 := Space( 50 )
lSwitch1 := lSwitch2 := lSwitch3 := .f.
cTitle := "MDI-DLG - USANDO RESOURCE Y SPINNER Ramon: \SAMPLES\MDIDLG.PRG"
DEFINE BRUSH oBrush GRADIENT aGrad
DEFINE FONT oFont NAME "Segoe UI" SIZE 0,-14
DEFINE DIALOG oDlg RESOURCE "MDIDLG" FONT oFont ;
TITLE cTitle BRUSH oBrush
RELEASE FONT oFont
RELEASE BRUSH oBrush
REDEFINE CHECKBOX oChk VAR lSwitch1 ID 1001 OF oDlg
oChk:lTransparent := .t.
REDEFINE CHECKBOX oChk VAR lSwitch2 ID 1002 OF oDlg
oChk:lTransparent := .t.
// REDEFINE GET cVar1 ID 1005 OF oDlg
REDEFINE GET cVar1 SPINNER PICTURE "@KD 99/99/9999" ID 1005 OF oDlg
REDEFINE CHECKBOX oChk VAR lSwitch3 ID 1010 OF oDlg WHEN lSwitch1
oChk:lTransparent := .t.
REDEFINE COMBOBOX oCbx VAR cVar ITEMS { "One", "Two", "Three" } ID 1015 OF oDlg WHEN lSwitch2
// REDEFINE GET cVar2 ID 1020 OF oDlg
REDEFINE GET cVar2 SPINNER PICTURE "@KD 99/99/9999" ID 1020 OF oDlg
REDEFINE SAY ID 1200 OF oDlg TRANSPARENT COLOR CLR_WHITE,CLR_WHITE
REDEFINE BTNBMP PROMPT "CLOSE" ID 2001 OF oDlg CENTER 2007 ACTION oDlg:End()
if nAs == AS_MDICHILD
ACTIVATE DIALOG oDlg AS MDICHILD ;
ON PAINT oDlg:Box( 8,8, 373, 584, CLR_HRED ) ;
ON RIGHT CLICK MsgInfo( oDlg:ClassName(), "oDlg:ClassName" )
elseif nAs == AS_DIALOG
ACTIVATE DIALOG oDlg CENTERED
endif
return oDlg
//----------------------------------------------------------------------------//
static function DlgInMdiChildOld()
local oWnd, oDlg
oDlg := CreateDialog()
DEFINE WINDOW oWnd MDICHILD OF WndMain() TITLE "Dialog"
ACTIVATE DIALOG oDlg NOWAIT ON INIT ( ChangeParent( oDlg, oWnd ) )
oDlg:End()
ACTIVATE WINDOW oWnd
return nil
//----------------------------------------------------------------------------//
static function ChangeParent( oDlg, oWnd )
local oControl
for each oControl in oDlg:aControls
SetParent( oControl:hWnd, oWnd:hWnd )
AAdd( oWnd:aControls, oControl )
oControl:oWnd := oWnd
next
oWnd:SetSize( oDlg:nWidth, oDlg:nHeight )
oWnd:SetColor( oDlg:nClrText, oDlg:nClrPane, oDlg:oBrush )
return nil
//----------------------------------------------------------------------------//
cnavarro wrote:karinha wrote:Buenas noches, porque el comando SPINNER no funciona con: AS MDICHILD?
- Code: Select all Expand view RUN
// dDataNascimen := ( cAlias )->DATANASC
REDEFINE GET aGet[14] VAR dDataNascimen PICTURE "@KD 99/99/9999" ID 34 ;
SPINNER OF oFld:aDialogs[1] UPDATE COLORS CLR_BLACK, CLR_WHITE FONT oFont
ACTIVATE DIALOG oDlg CENTERED AS MDICHILD
Regards, saludos.
Joao, tengo la sana costumbre de "crear" los controles cuando se trata de un diálogo en una function en la claúsula ON INIT del ACTIVATE DIALOG
LANGUAGE 10, 3
MDIDLG DIALOG 0, 0, 394, 234
STYLE DS_MODALFRAME | DS_SETFONT | WS_CAPTION | WS_POPUP | WS_SYSMENU
CAPTION "TXBrowse demo"
FONT 8, "MS Sans Serif"
{
AUTOCHECKBOX "Switch-1", 1001, 44, 22, 69, 9
AUTOCHECKBOX "Switch-2", 1002, 219, 23, 94, 8
EDITTEXT 1005, 45, 54, 294, 18, WS_VSCROLL // <-- Este control tiene que quedar así para que funcione SPINNER
AUTOCHECKBOX "CheckBox When Switch-1", 1010, 47, 86, 123, 12
COMBOBOX 1015, 202, 85, 139, 30, CBS_DROPDOWNLIST | CBS_HASSTRINGS
EDITTEXT 1020, 46, 116, 294, 18, WS_VSCROLL // <-- Este control tiene que quedar así para que funcione SPINNER
CTEXT "TRANSPARENT SAY", 1200, 44, 174, 131, 22, SS_CENTER, WS_EX_TRANSPARENT
PUSHBUTTON "OK", 2001, 256, 178, 69, 24
}
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: No registered users and 51 guests